@unieai/code 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/App-ncpmz34p.js +2 -0
- package/dist/chunks/ApproveApiKey-fqzjf1j3.js +2 -0
- package/dist/chunks/{assistant-ftzr3mjp.js → AssistantSessionChooser-wxmyvgcf.js} +1 -1
- package/dist/chunks/BypassPermissionsModeDialog-3ksmd8pp.js +2 -0
- package/dist/chunks/{ClaudeInChromeOnboarding-qa0pvwfw.js → ClaudeInChromeOnboarding-ckjppjhr.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-rrsfavte.js +2 -0
- package/dist/chunks/ConsoleOAuthFlow-04xt4sby.js +2 -0
- package/dist/chunks/{DiffDialog-t6vvtbb2.js → DiffDialog-ptnc4sgx.js} +1 -1
- package/dist/chunks/Doctor-kg5m2zma.js +2 -0
- package/dist/chunks/Grove-rf9xhe2e.js +2 -0
- package/dist/chunks/{ITermBackend-73waaahf.js → ITermBackend-wgbbpgpy.js} +1 -1
- package/dist/chunks/{InProcessTransport-qwjgb17j.js → InProcessTransport-vgh7qgjn.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-zmqw3fj1.js → InvalidConfigDialog-6spqsgmr.js} +1 -1
- package/dist/chunks/InvalidSettingsDialog-m6y6esgz.js +2 -0
- package/dist/chunks/{Onboarding-p0tq6pgz.js → Onboarding-j1m69bqm.js} +1 -1
- package/dist/chunks/REPL-qyytrhe5.js +2 -0
- package/dist/chunks/{ResumeConversation-krn9hqb1.js → ResumeConversation-wfhd5xb2.js} +1 -1
- package/dist/chunks/{SnapshotUpdateDialog-raq029pd.js → SnapshotUpdateDialog-aya2c2f9.js} +1 -1
- package/dist/chunks/{TeleportProgress-vyy2k3bv.js → TeleportProgress-kn3qgvd9.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-ff0h2cnq.js → TeleportRepoMismatchDialog-01v6e2qz.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-esjykret.js → TeleportResumeWrapper-48dsm503.js} +1 -1
- package/dist/chunks/{TmuxBackend-14kmnkcb.js → TmuxBackend-s0bt8zqj.js} +1 -1
- package/dist/chunks/ToolSearchTool-4rm3kr13.js +2 -0
- package/dist/chunks/{TrustDialog-7fvaze2x.js → TrustDialog-xtn3kq0n.js} +1 -1
- package/dist/chunks/TungstenTool-3wjjz6cf.js +2 -0
- package/dist/chunks/{add-dir-kqw72mky.js → add-dir-z0kz5nf7.js} +1 -1
- package/dist/chunks/{agents-z66twpqr.js → agents-ex4cdx64.js} +1 -1
- package/dist/chunks/agents-w6zde2j9.js +4 -0
- package/dist/chunks/ant-claude-for-chrome-mcp-gr0b0jr4.js +2 -0
- package/dist/chunks/api-07pqphw5.js +2 -0
- package/dist/chunks/asciicast-2k1ztt6v.js +2 -0
- package/dist/chunks/{AssistantSessionChooser-g1vsya6h.js → assistant-bmwndz7j.js} +1 -1
- package/dist/chunks/{auth-wk077awh.js → auth-g2p039wk.js} +1 -1
- package/dist/chunks/auth-g509w5pr.js +2 -0
- package/dist/chunks/backgroundHousekeeping-hw0chw1d.js +2 -0
- package/dist/chunks/{branch-1d0b8590.js → branch-rdvbhvts.js} +1 -1
- package/dist/chunks/{bridgePointer-vhd47np6.js → bridgePointer-9rqn5tp6.js} +1 -1
- package/dist/chunks/{btw-s3r5jhyd.js → btw-xts6twbq.js} +1 -1
- package/dist/chunks/{buddy-xzm5npk8.js → buddy-yc09g048.js} +1 -1
- package/dist/chunks/{cachedMicrocompact-6j3zxr4g.js → cachedMicrocompact-fa2mdnyh.js} +1 -1
- package/dist/chunks/caches-3qzm958c.js +2 -0
- package/dist/chunks/{chrome-mdyx0s5j.js → chrome-gb6g0d5p.js} +1 -1
- package/dist/chunks/{chromeNativeHost-8wc6wcr6.js → chromeNativeHost-jsntnc29.js} +1 -1
- package/dist/chunks/{claudeDesktop-p5bfxmvz.js → claudeDesktop-me56qerx.js} +1 -1
- package/dist/chunks/{cleanup-q46nbce1.js → cleanup-hxj6tm50.js} +1 -1
- package/dist/chunks/clear-ssfbry3k.js +2 -0
- package/dist/chunks/{cli-bmk0rb5v.js → cli-07f2hk9d.js} +1 -1
- package/dist/chunks/{cli-h4a90xbh.js → cli-0nz8v3dj.js} +1 -1
- package/dist/chunks/{cli-fwrj8ybs.js → cli-16k24hzp.js} +1 -1
- package/dist/chunks/{cli-msmzt4c3.js → cli-192xnkcx.js} +1 -1
- package/dist/chunks/{cli-g4n9das2.js → cli-1eejy071.js} +1 -1
- package/dist/chunks/{cli-3m8n808e.js → cli-1p7nc6zb.js} +1 -1
- package/dist/chunks/{cli-s160fqyz.js → cli-1q1b8rgs.js} +1 -1
- package/dist/chunks/{cli-99mqr54v.js → cli-222ywgt0.js} +1 -1
- package/dist/chunks/{cli-f63fdj4w.js → cli-2428yw99.js} +1 -1
- package/dist/chunks/{cli-v943fd6a.js → cli-2fqrjjs9.js} +1 -1
- package/dist/chunks/{cli-t4j047cx.js → cli-2j6cv2kz.js} +1 -1
- package/dist/chunks/{cli-xpa1neza.js → cli-2sbq6ggm.js} +2 -2
- package/dist/chunks/{cli-8qd16mt4.js → cli-33tchr20.js} +1 -1
- package/dist/chunks/{cli-zjbzak9n.js → cli-3619x17q.js} +1 -1
- package/dist/chunks/{cli-gtm212j6.js → cli-3hrmwgsv.js} +1 -1
- package/dist/chunks/{cli-hzr2zraz.js → cli-3tkd82y4.js} +1 -1
- package/dist/chunks/{cli-zev50xap.js → cli-3tmtx9ka.js} +1 -1
- package/dist/chunks/{cli-xfsqvp8r.js → cli-4pwyex04.js} +1 -1
- package/dist/chunks/{cli-jj93qmmc.js → cli-5ajcy93q.js} +2 -2
- package/dist/chunks/{cli-0w4wc1z0.js → cli-5kehgkgh.js} +1 -1
- package/dist/chunks/{cli-fghyxar5.js → cli-601zv0wv.js} +1 -1
- package/dist/chunks/{cli-r3etpht1.js → cli-609dp2ck.js} +1 -1
- package/dist/chunks/{cli-ns0aaggm.js → cli-63wps6p0.js} +1 -1
- package/dist/chunks/{cli-m0z3rmf0.js → cli-64x5ghm5.js} +1 -1
- package/dist/chunks/{cli-de1hwp88.js → cli-67azkkwm.js} +1 -1
- package/dist/chunks/{cli-dbdqrqmt.js → cli-6cqemsm9.js} +1 -1
- package/dist/chunks/{cli-27mzrnr8.js → cli-6ee37m6j.js} +1 -1
- package/dist/chunks/{cli-mb1qrqw1.js → cli-6qt2xm18.js} +1 -1
- package/dist/chunks/{cli-49m97nbg.js → cli-7ed2q42n.js} +1 -1
- package/dist/chunks/{cli-s9fhtgmz.js → cli-7jw2qe69.js} +1 -1
- package/dist/chunks/cli-7k17xstr.js +3 -0
- package/dist/chunks/{cli-61x73ksv.js → cli-7n4d5yzr.js} +1 -1
- package/dist/chunks/{cli-p0vh69b9.js → cli-7wxv39ry.js} +2 -2
- package/dist/chunks/{cli-15sqp3mq.js → cli-8h10q2x8.js} +1 -1
- package/dist/chunks/{cli-yqbvprz7.js → cli-8j0b3b55.js} +1 -1
- package/dist/chunks/{cli-akcxtvv9.js → cli-8jym9hp6.js} +1 -1
- package/dist/chunks/{cli-4ewb3q42.js → cli-8kpqq0ea.js} +2 -2
- package/dist/chunks/{cli-2rw44zfx.js → cli-8xyb31dy.js} +1 -1
- package/dist/chunks/cli-8xz7dd7z.js +3 -0
- package/dist/chunks/{cli-g5wq5ptg.js → cli-8ykv66e4.js} +1 -1
- package/dist/chunks/{cli-jegyadmb.js → cli-8z8d5bgb.js} +1 -1
- package/dist/chunks/{cli-cqkne34j.js → cli-93sm9n17.js} +1 -1
- package/dist/chunks/{cli-q0156x0d.js → cli-97vx3m99.js} +1 -1
- package/dist/chunks/{cli-1jp3rm7n.js → cli-9e8f55fp.js} +1 -1
- package/dist/chunks/{cli-2wd8eaac.js → cli-9hqmq5g6.js} +1 -1
- package/dist/chunks/{cli-6bxfdgv1.js → cli-9tbmrp89.js} +1 -1
- package/dist/chunks/{cli-5dt9yjha.js → cli-9xtyh8c7.js} +1 -1
- package/dist/chunks/{cli-sh9w2tbd.js → cli-a1cx6p3g.js} +1 -1
- package/dist/chunks/{cli-ja540nr7.js → cli-a1dqnvy2.js} +1 -1
- package/dist/chunks/{cli-wt2bfbn0.js → cli-a25jeqs8.js} +1 -1
- package/dist/chunks/{cli-x8xgga1a.js → cli-a2d962bq.js} +2 -2
- package/dist/chunks/{cli-h120wpk2.js → cli-a826q5zk.js} +1 -1
- package/dist/chunks/{cli-k4v08k8t.js → cli-an97yxg9.js} +1 -1
- package/dist/chunks/{cli-m12smc5e.js → cli-asc9xmsr.js} +1 -1
- package/dist/chunks/{cli-hke6r0q8.js → cli-awb77t95.js} +2 -2
- package/dist/chunks/{cli-6yprtw88.js → cli-awe5yg6m.js} +1 -1
- package/dist/chunks/{cli-15w3eaed.js → cli-ax0ckqpv.js} +1 -1
- package/dist/chunks/{cli-mbp8f3f3.js → cli-b29enbbc.js} +1 -1
- package/dist/chunks/{cli-me4e2p3e.js → cli-b3k8arn1.js} +25 -25
- package/dist/chunks/{cli-c22wpdk4.js → cli-b5z57an7.js} +1 -1
- package/dist/chunks/{cli-0dc8sd37.js → cli-b8j8bm5m.js} +1 -1
- package/dist/chunks/{cli-51720d82.js → cli-bdgrtpsy.js} +2 -2
- package/dist/chunks/{cli-yrwenjxs.js → cli-bfm3f0yw.js} +1 -1
- package/dist/chunks/{cli-764c4bsm.js → cli-bj0csmzs.js} +1 -1
- package/dist/chunks/{cli-ms5j6fff.js → cli-bnr79ddy.js} +1 -1
- package/dist/chunks/{cli-a52ra30v.js → cli-bpj9na88.js} +1 -1
- package/dist/chunks/{cli-v9f860t5.js → cli-brr3bnrj.js} +1 -1
- package/dist/chunks/{cli-eyw3czmn.js → cli-bzrat9yd.js} +1 -1
- package/dist/chunks/{cli-msw0vv86.js → cli-ca1jmr8f.js} +1 -1
- package/dist/chunks/{cli-br6zjh6x.js → cli-ceas97gw.js} +1 -1
- package/dist/chunks/{cli-kqv5b8zh.js → cli-cfbfexxj.js} +1 -1
- package/dist/chunks/{cli-tckzkegq.js → cli-chvks6bg.js} +1 -1
- package/dist/chunks/cli-cmh6qwg8.js +3 -0
- package/dist/chunks/{cli-khs3sj9k.js → cli-d1w21hsm.js} +1 -1
- package/dist/chunks/{cli-z5e72gsd.js → cli-d2pn0xfj.js} +1 -1
- package/dist/chunks/{cli-fm14mg07.js → cli-df5r5xrp.js} +1 -1
- package/dist/chunks/{cli-2rwjx3w0.js → cli-dx0pk7k2.js} +1 -1
- package/dist/chunks/{cli-p2cqnrnp.js → cli-dy9qrrps.js} +1 -1
- package/dist/chunks/{cli-q46epwyh.js → cli-e3q6b1cv.js} +1 -1
- package/dist/chunks/{cli-fs7yttfp.js → cli-e4a4fjx9.js} +2 -2
- package/dist/chunks/{cli-t9jht3kb.js → cli-e5yek4vx.js} +2 -2
- package/dist/chunks/{cli-5f0w3fy6.js → cli-e9t5kfxm.js} +1 -1
- package/dist/chunks/{cli-1n8he7s8.js → cli-eh1wx76n.js} +1 -1
- package/dist/chunks/{cli-d0hzw78c.js → cli-ez2xsd4m.js} +1 -1
- package/dist/chunks/{cli-n5s5fnyj.js → cli-fdjfk8yq.js} +2 -2
- package/dist/chunks/{cli-rvad3yhg.js → cli-fnt125we.js} +2 -2
- package/dist/chunks/{cli-0qt9btbe.js → cli-fz053waw.js} +1 -1
- package/dist/chunks/{cli-89x414pj.js → cli-g2s3391y.js} +1 -1
- package/dist/chunks/cli-geka8fb7.js +3 -0
- package/dist/chunks/{cli-73jf8hyz.js → cli-gfweqbpz.js} +1 -1
- package/dist/chunks/{cli-tfv2qcgf.js → cli-gypyp608.js} +1 -1
- package/dist/chunks/{cli-1ny2386w.js → cli-h2t2hyz7.js} +1 -1
- package/dist/chunks/{cli-zp8s7q5w.js → cli-hp5gs22f.js} +1 -1
- package/dist/chunks/{cli-pgg33dhw.js → cli-hpxspent.js} +1 -1
- package/dist/chunks/{cli-ezs5sney.js → cli-hrmzaf5d.js} +2 -2
- package/dist/chunks/{cli-8dmy2s42.js → cli-hs2k9997.js} +1 -1
- package/dist/chunks/{cli-19ncan36.js → cli-j403r21v.js} +1 -1
- package/dist/chunks/{cli-wn2srq2e.js → cli-j4r75xsd.js} +1 -1
- package/dist/chunks/{cli-5vsnhp97.js → cli-jmq1x925.js} +1 -1
- package/dist/chunks/{cli-sycqd3xe.js → cli-jnc0ze6w.js} +4 -4
- package/dist/chunks/{cli-4nejhkd0.js → cli-jrwh6rs0.js} +1 -1
- package/dist/chunks/{cli-vwg0v35a.js → cli-jz50hv3m.js} +1 -1
- package/dist/chunks/{cli-vkvmhjha.js → cli-jz8jcrhh.js} +1 -1
- package/dist/chunks/{cli-nvnj7r73.js → cli-ktzyyx91.js} +1 -1
- package/dist/chunks/{cli-9aq7vxaq.js → cli-kx3r72jp.js} +1 -1
- package/dist/chunks/{cli-tyqh91zq.js → cli-m3r80gy0.js} +1 -1
- package/dist/chunks/{cli-9z9r2set.js → cli-m6amgxq3.js} +1 -1
- package/dist/chunks/{cli-qaxvg7gv.js → cli-mcbntv3p.js} +1 -1
- package/dist/chunks/{cli-pbc8sk2d.js → cli-mx33m3gs.js} +1 -1
- package/dist/chunks/{cli-r83ttew2.js → cli-n5wt59z1.js} +1 -1
- package/dist/chunks/{cli-gq5fve62.js → cli-nqvfpxp6.js} +1 -1
- package/dist/chunks/{cli-zpcncwrv.js → cli-pgjnzqk4.js} +1 -1
- package/dist/chunks/{cli-6pdpyz1a.js → cli-phwbqkv7.js} +1 -1
- package/dist/chunks/{cli-57yrpnaq.js → cli-ps5qshk4.js} +1 -1
- package/dist/chunks/{cli-4mvvtchx.js → cli-psqvdh1r.js} +1 -1
- package/dist/chunks/{cli-gxgdnjfn.js → cli-q0vret0x.js} +1 -1
- package/dist/chunks/{cli-zxdnz6vp.js → cli-q2g5mjv6.js} +1 -1
- package/dist/chunks/{cli-tq5z9qv3.js → cli-q8zmmp6z.js} +2 -2
- package/dist/chunks/{cli-j08dmxw5.js → cli-qpjkqhg2.js} +1 -1
- package/dist/chunks/{cli-scaqq0v9.js → cli-qrmc38f8.js} +1 -1
- package/dist/chunks/{cli-w1d8n9g3.js → cli-qwx84m9c.js} +1 -1
- package/dist/chunks/{cli-s6vr7213.js → cli-r43jhzwm.js} +1 -1
- package/dist/chunks/{cli-x70v8rsj.js → cli-rc3w6tqd.js} +2 -2
- package/dist/chunks/{cli-7c99j0pt.js → cli-rd5ax7sn.js} +1 -1
- package/dist/chunks/{cli-m8fq163z.js → cli-rjy86nps.js} +1 -1
- package/dist/chunks/cli-rwh0a2m1.js +3 -0
- package/dist/chunks/{cli-3gwqrmcd.js → cli-ry9g546q.js} +1 -1
- package/dist/chunks/{cli-8mk2zg4a.js → cli-rz03bav0.js} +1 -1
- package/dist/chunks/{cli-66jj9zj3.js → cli-sbm8tsyq.js} +1 -1
- package/dist/chunks/{cli-55ntywtj.js → cli-shsgq494.js} +1 -1
- package/dist/chunks/{cli-tt9a4124.js → cli-sr25begm.js} +1 -1
- package/dist/chunks/{cli-c60c9qvm.js → cli-swrtc7tv.js} +1 -1
- package/dist/chunks/{cli-cwbxhdt1.js → cli-sxe9wke0.js} +1 -1
- package/dist/chunks/{cli-qm684n63.js → cli-szxfz15b.js} +1 -1
- package/dist/chunks/{cli-w52yvzkn.js → cli-t4see9hh.js} +2 -2
- package/dist/chunks/cli-t5ddsvmv.js +3 -0
- package/dist/chunks/cli-t5yqvdb3.js +3 -0
- package/dist/chunks/{cli-wbe1p8n2.js → cli-t7sx6zqn.js} +1 -1
- package/dist/chunks/cli-t8ydjjs7.js +3 -0
- package/dist/chunks/{cli-3ac555qw.js → cli-tafg3e9w.js} +2 -2
- package/dist/chunks/{cli-zjfya500.js → cli-tpjr1pz9.js} +1 -1
- package/dist/chunks/{cli-d53fhs6v.js → cli-vb6aa4jk.js} +1 -1
- package/dist/chunks/{cli-749tdaqc.js → cli-vfh77r55.js} +1 -1
- package/dist/chunks/{cli-jkj867t1.js → cli-vm7dr5aa.js} +2 -2
- package/dist/chunks/{cli-k2nh5cby.js → cli-vqne1z50.js} +1 -1
- package/dist/chunks/{cli-42kma5r3.js → cli-vtsy70mz.js} +1 -1
- package/dist/chunks/{cli-mj03488e.js → cli-vy3e90k9.js} +1 -1
- package/dist/chunks/{cli-vkzp66cm.js → cli-wvctks7e.js} +1 -1
- package/dist/chunks/{cli-er7z496e.js → cli-wznsj6nb.js} +1 -1
- package/dist/chunks/{cli-msgx4pnp.js → cli-x9s7jxq5.js} +1 -1
- package/dist/chunks/{cli-grxvgq2n.js → cli-xqqnx8gk.js} +1 -1
- package/dist/chunks/{cli-rjerv816.js → cli-yaxs01at.js} +2 -2
- package/dist/chunks/{cli-fdya77ch.js → cli-yb5m6jwq.js} +3 -3
- package/dist/chunks/{cli-mzcsnm06.js → cli-yfb8bk69.js} +2 -2
- package/dist/chunks/{cli-rxb5q8zw.js → cli-yktdhy9p.js} +2 -2
- package/dist/chunks/{cli-4a4bb1kf.js → cli-yt4ezhhk.js} +1 -1
- package/dist/chunks/{cli-jgn9jprh.js → cli-yxsn8ang.js} +1 -1
- package/dist/chunks/{cli-350pymj4.js → cli-z02gsrtd.js} +2 -2
- package/dist/chunks/{cli-xmgm2573.js → cli-z2ewnqgr.js} +2 -2
- package/dist/chunks/{cli-r9db9mqv.js → cli-zqrzc3qx.js} +1 -1
- package/dist/chunks/{cli-wm8qb6j3.js → cli-zwn9x1p2.js} +1 -1
- package/dist/chunks/{cli-kq16afrr.js → cli-zxe1a0ey.js} +2 -2
- package/dist/chunks/client-qxx2ja27.js +2 -0
- package/dist/chunks/color-k1ew8kzn.js +2 -0
- package/dist/chunks/commitAttribution-nsa26sdx.js +2 -0
- package/dist/chunks/common-7t28qq0q.js +2 -0
- package/dist/chunks/{compact-zmvj1pk0.js → compact-kysg5kxd.js} +1 -1
- package/dist/chunks/config-d4kj5q8e.js +2 -0
- package/dist/chunks/{config-gj0gbg5g.js → config-txzzncm9.js} +1 -1
- package/dist/chunks/{context-h1qc69rg.js → context-aat04hqp.js} +1 -1
- package/dist/chunks/context-noninteractive-w54t6xnc.js +2 -0
- package/dist/chunks/conversation-brecqh0t.js +2 -0
- package/dist/chunks/{copy-76r9v46d.js → copy-zpvnnk85.js} +1 -1
- package/dist/chunks/cost-5fbyws6x.js +5 -0
- package/dist/chunks/createSession-hsp3x7vw.js +2 -0
- package/dist/chunks/desktop-7kdmxet0.js +2 -0
- package/dist/chunks/detectRepository-9xqead5f.js +2 -0
- package/dist/chunks/detection-z3cdks0s.js +2 -0
- package/dist/chunks/{devtools-10ba48t9.js → devtools-7jd4m7th.js} +1 -1
- package/dist/chunks/{diff-05xxjeqc.js → diff-xaw6ebj0.js} +1 -1
- package/dist/chunks/doctor-nbm4z0tx.js +2 -0
- package/dist/chunks/{earlyInput-navj6cdn.js → earlyInput-e8zh4d2d.js} +1 -1
- package/dist/chunks/{effort-a190c878.js → effort-bj5x7fcg.js} +1 -1
- package/dist/chunks/executor-e1744nra.js +2 -0
- package/dist/chunks/exit-894g29w2.js +2 -0
- package/dist/chunks/{export-ct4sty4d.js → export-tjrkechp.js} +1 -1
- package/dist/chunks/extra-usage-noninteractive-577ac873.js +2 -0
- package/dist/chunks/extra-usage-tfwmdc7z.js +2 -0
- package/dist/chunks/fast-1krm57mn.js +2 -0
- package/dist/chunks/feedback-2421cbpm.js +2 -0
- package/dist/chunks/{files-qrrrkjke.js → files-n3b22fs2.js} +1 -1
- package/dist/chunks/firstPartyEventLogger-1kwwcqdn.js +2 -0
- package/dist/chunks/gates-sd1cp8f2.js +2 -0
- package/dist/chunks/git-t6e9xdt2.js +2 -0
- package/dist/chunks/goal-0sxyk3va.js +2 -0
- package/dist/chunks/{growthbook-f7ag30hy.js → growthbook-4hx0kbpq.js} +1 -1
- package/dist/chunks/{heapdump-16gnh3zm.js → heapdump-2y7wcy1r.js} +1 -1
- package/dist/chunks/{help-rgcakcxe.js → help-a7mc9946.js} +1 -1
- package/dist/chunks/{hooks-c7fqwas5.js → hooks-22nm9hn0.js} +1 -1
- package/dist/chunks/hooks-tf9v5b0x.js +2 -0
- package/dist/chunks/{ide-q83qr9cn.js → ide-9x5zsk63.js} +1 -1
- package/dist/chunks/index-p1k4dhfc.js +2 -0
- package/dist/chunks/{initReplBridge-zfwxgpsm.js → initReplBridge-xjc6eaan.js} +1 -1
- package/dist/chunks/{ink-vkxsn90v.js → ink-9n8bszp5.js} +1 -1
- package/dist/chunks/{insights-4fwap4e5.js → insights-n7k1ty4n.js} +1 -1
- package/dist/chunks/{install-github-app-djzea7r4.js → install-github-app-zdsmjft8.js} +1 -1
- package/dist/chunks/{install-7nxzmgp5.js → install-rhzcmymh.js} +1 -1
- package/dist/chunks/install-slack-app-vhfe2dsf.js +2 -0
- package/dist/chunks/{instrumentation-223qqr23.js → instrumentation-5jjvsvke.js} +1 -1
- package/dist/chunks/keybindings-tqnmw7ng.js +3 -0
- package/dist/chunks/loadAgentsDir-j7pntb5v.js +2 -0
- package/dist/chunks/loadPluginHooks-sta7ra57.js +2 -0
- package/dist/chunks/login-j7x2fjw8.js +2 -0
- package/dist/chunks/logout-53bvwba1.js +2 -0
- package/dist/chunks/{main-0b8hyp8h.js → main-07p6q3f9.js} +13 -13
- package/dist/chunks/{mcp-fn4yrf5y.js → mcp-3mjagnnt.js} +1 -1
- package/dist/chunks/{mcp-9enw5a8j.js → mcp-yqhzespv.js} +1 -1
- package/dist/chunks/{mcp-yymqpmv6.js → mcp-yrt7dbxp.js} +3 -3
- package/dist/chunks/{mcpServer-85gt8ypc.js → mcpServer-f90a93nt.js} +1 -1
- package/dist/chunks/{mcpServer-60jg9v58.js → mcpServer-v1dy489g.js} +1 -1
- package/dist/chunks/{memory-kam5z1cw.js → memory-mdwb22wh.js} +1 -1
- package/dist/chunks/{mobile-7zsgawnb.js → mobile-j4jwvavn.js} +1 -1
- package/dist/chunks/{model-03987182.js → model-hz3nn362.js} +1 -1
- package/dist/chunks/{model-wbxx5kcd.js → model-tf1ne2j9.js} +1 -1
- package/dist/chunks/{oauth-y0p2y1w5.js → oauth-1b0qpxz4.js} +1 -1
- package/dist/chunks/{output-style-x148mzhn.js → output-style-t39s3jqx.js} +1 -1
- package/dist/chunks/parser-8venanpw.js +2 -0
- package/dist/chunks/{passes-jrmjk5zk.js → passes-s3fqswrg.js} +1 -1
- package/dist/chunks/{permissions-karmgb0m.js → permissions-a050zfqv.js} +1 -1
- package/dist/chunks/plan-gjaybyvb.js +2 -0
- package/dist/chunks/plugin-trf2388p.js +2 -0
- package/dist/chunks/pluginStartupCheck-wxmc7h98.js +2 -0
- package/dist/chunks/{plugins-vvf897b4.js → plugins-4py04yzf.js} +2 -2
- package/dist/chunks/{preauthorizedConfig-p02f23jb.js → preauthorizedConfig-hmxcgb8e.js} +1 -1
- package/dist/chunks/{print-krwpbp2j.js → print-pmzxgktf.js} +4 -4
- package/dist/chunks/privacy-settings-b2rz35r5.js +2 -0
- package/dist/chunks/process-n5355p53.js +2 -0
- package/dist/chunks/{processBashCommand-8fqgv2ec.js → processBashCommand-zkztsgn4.js} +1 -1
- package/dist/chunks/{processSlashCommand-q32wy80b.js → processSlashCommand-mfh1h592.js} +1 -1
- package/dist/chunks/prompt-2jyjhkwg.js +2 -0
- package/dist/chunks/prompt-b34a0h5z.js +2 -0
- package/dist/chunks/provider-prompt-qe4s2yzh.js +2 -0
- package/dist/chunks/{rate-limit-options-rd4rjfv5.js → rate-limit-options-kd432dap.js} +1 -1
- package/dist/chunks/registry-d7cd5dqg.js +2 -0
- package/dist/chunks/release-notes-rwgbn4pp.js +6 -0
- package/dist/chunks/reload-plugins-9axdwaaj.js +3 -0
- package/dist/chunks/{remote-env-nn9ngr99.js → remote-env-rg4k5em5.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-cg7qd8m4.js → remoteBridgeCore-t980tt3v.js} +1 -1
- package/dist/chunks/rename-xap3rpbv.js +2 -0
- package/dist/chunks/{resume-4rvj8jbz.js → resume-3tc40yn9.js} +1 -1
- package/dist/chunks/{rewind-r4g5njsg.js → rewind-b6vg7dxs.js} +1 -1
- package/dist/chunks/sandbox-adapter-1z8xktva.js +2 -0
- package/dist/chunks/{sandbox-toggle-620bkz9q.js → sandbox-toggle-eke03mr8.js} +1 -1
- package/dist/chunks/{session-5vm1vwv1.js → session-53f3eza5.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-xscvsvqt.js +2 -0
- package/dist/chunks/{sessionStorage-ffkhmn5q.js → sessionStorage-rb63e8bn.js} +1 -1
- package/dist/chunks/settings-hp0ksjn9.js +2 -0
- package/dist/chunks/{setup-vegs56f5.js → setup-gravfzvg.js} +1 -1
- package/dist/chunks/setup-ssq8b1e6.js +2 -0
- package/dist/chunks/{setup-pf09nfsj.js → setup-z05dsr8q.js} +2 -2
- package/dist/chunks/sinks-agafqaxj.js +2 -0
- package/dist/chunks/{skills-evga8f7n.js → skills-41mfq71n.js} +1 -1
- package/dist/chunks/startupProfiler-wmf8nvfd.js +2 -0
- package/dist/chunks/state-rhxyy4qm.js +2 -0
- package/dist/chunks/{stats-mgqf6r7c.js → stats-7qg84dw1.js} +1 -1
- package/dist/chunks/status-sran2y9h.js +2 -0
- package/dist/chunks/stickers-hythmrsd.js +2 -0
- package/dist/chunks/subprocessEnv-b12dkzky.js +2 -0
- package/dist/chunks/{systemPromptSections-07y2z2wn.js → systemPromptSections-jxxyhnxe.js} +1 -1
- package/dist/chunks/{tag-gd73kstd.js → tag-58ndeaa9.js} +1 -1
- package/dist/chunks/tasks-52g28x72.js +2 -0
- package/dist/chunks/{teamHelpers-8ykc4bxa.js → teamHelpers-rxt9rvmd.js} +1 -1
- package/dist/chunks/teammateModeSnapshot-2782d4w9.js +2 -0
- package/dist/chunks/teleport-8gjys6yn.js +2 -0
- package/dist/chunks/terminalSetup-bbftxeqk.js +2 -0
- package/dist/chunks/theme-b38te5rz.js +2 -0
- package/dist/chunks/thinkback-05a9q24j.js +2 -0
- package/dist/chunks/thinkback-play-1nbagfm5.js +2 -0
- package/dist/chunks/toolSearch-7rnke366.js +2 -0
- package/dist/chunks/trustedDevice-2dn4981h.js +2 -0
- package/dist/chunks/{ultrareviewCommand-j23bjbf8.js → ultrareviewCommand-qwnsjdez.js} +1 -1
- package/dist/chunks/{update-w8wdxh3m.js → update-ney1krzn.js} +1 -1
- package/dist/chunks/upgrade-zxxxfq8c.js +2 -0
- package/dist/chunks/{upstreamproxy-x405ef9p.js → upstreamproxy-34wva0r5.js} +1 -1
- package/dist/chunks/usage-82ghrfb3.js +2 -0
- package/dist/chunks/util-xm9cs164.js +2 -0
- package/dist/chunks/utils-zs0ft181.js +2 -0
- package/dist/chunks/vim-6gxdrp1k.js +2 -0
- package/dist/chunks/worktree-xjxz4ndt.js +2 -0
- package/dist/chunks/worktreeModeEnabled-8ndm5yfs.js +2 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/App-s5ex5j86.js +0 -2
- package/dist/chunks/ApproveApiKey-b4z6h2gn.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-jbg97eja.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-gqmed78y.js +0 -2
- package/dist/chunks/ConsoleOAuthFlow-yh72vs8j.js +0 -2
- package/dist/chunks/Doctor-k08ggw2j.js +0 -2
- package/dist/chunks/Grove-tkkskg8n.js +0 -2
- package/dist/chunks/InvalidSettingsDialog-tnd5hymg.js +0 -2
- package/dist/chunks/REPL-hjjz80kq.js +0 -2
- package/dist/chunks/ToolSearchTool-w4t61c7d.js +0 -2
- package/dist/chunks/TungstenTool-rv96z549.js +0 -2
- package/dist/chunks/agents-3exybgtb.js +0 -4
- package/dist/chunks/ant-claude-for-chrome-mcp-712xg07f.js +0 -2
- package/dist/chunks/api-z8svc3xt.js +0 -2
- package/dist/chunks/asciicast-vzd7qjbb.js +0 -2
- package/dist/chunks/auth-gbyfq0g2.js +0 -2
- package/dist/chunks/backgroundHousekeeping-m8gthtkh.js +0 -2
- package/dist/chunks/caches-fbggdeq7.js +0 -2
- package/dist/chunks/clear-fwad6zxy.js +0 -2
- package/dist/chunks/cli-55jdp9ky.js +0 -3
- package/dist/chunks/cli-78apjp3t.js +0 -3
- package/dist/chunks/cli-8hxz2qs6.js +0 -3
- package/dist/chunks/cli-95wg48h9.js +0 -3
- package/dist/chunks/cli-edkqs0ge.js +0 -3
- package/dist/chunks/cli-fakdskp6.js +0 -3
- package/dist/chunks/cli-h4dspaac.js +0 -3
- package/dist/chunks/cli-przq3zk6.js +0 -3
- package/dist/chunks/client-dkpgx025.js +0 -2
- package/dist/chunks/color-zrm6r755.js +0 -2
- package/dist/chunks/commitAttribution-3y6pessz.js +0 -2
- package/dist/chunks/common-0bee37at.js +0 -2
- package/dist/chunks/config-hbq35b68.js +0 -2
- package/dist/chunks/context-noninteractive-7wbe6qvd.js +0 -2
- package/dist/chunks/conversation-fwnfp0p5.js +0 -2
- package/dist/chunks/cost-56r5xxqy.js +0 -5
- package/dist/chunks/createSession-m5y8fjy4.js +0 -2
- package/dist/chunks/desktop-z3jqgnw7.js +0 -2
- package/dist/chunks/detectRepository-w6wawmmg.js +0 -2
- package/dist/chunks/detection-1yb2c7hh.js +0 -2
- package/dist/chunks/doctor-hgwjdraj.js +0 -2
- package/dist/chunks/executor-s42mdmqs.js +0 -2
- package/dist/chunks/exit-kyrjy6hb.js +0 -2
- package/dist/chunks/extra-usage-noninteractive-byts9mme.js +0 -2
- package/dist/chunks/extra-usage-xh1mkrca.js +0 -2
- package/dist/chunks/fast-g4aa49jf.js +0 -2
- package/dist/chunks/feedback-m5r66qd5.js +0 -2
- package/dist/chunks/firstPartyEventLogger-mthxtmgc.js +0 -2
- package/dist/chunks/gates-yhakv4vb.js +0 -2
- package/dist/chunks/git-c39vd9dm.js +0 -2
- package/dist/chunks/goal-24dr7fwz.js +0 -2
- package/dist/chunks/hooks-8dh43zmv.js +0 -2
- package/dist/chunks/index-v875zpde.js +0 -2
- package/dist/chunks/install-slack-app-3rde0k08.js +0 -2
- package/dist/chunks/keybindings-6t5f69wx.js +0 -3
- package/dist/chunks/loadAgentsDir-f8shfnw3.js +0 -2
- package/dist/chunks/loadPluginHooks-mdwjrjtp.js +0 -2
- package/dist/chunks/login-34j3xdr9.js +0 -2
- package/dist/chunks/logout-yew8mymc.js +0 -2
- package/dist/chunks/parser-4y4b0e6b.js +0 -2
- package/dist/chunks/plan-w0beh9bh.js +0 -2
- package/dist/chunks/plugin-6nwptn3s.js +0 -2
- package/dist/chunks/pluginStartupCheck-0nzv1ae9.js +0 -2
- package/dist/chunks/privacy-settings-m0mfykh0.js +0 -2
- package/dist/chunks/process-26nny2p0.js +0 -2
- package/dist/chunks/prompt-gw1e1gef.js +0 -2
- package/dist/chunks/prompt-xgw2hxrc.js +0 -2
- package/dist/chunks/provider-prompt-s26vatcw.js +0 -2
- package/dist/chunks/registry-fp7x9ekd.js +0 -2
- package/dist/chunks/release-notes-76y1r2s1.js +0 -6
- package/dist/chunks/reload-plugins-z0fepkva.js +0 -3
- package/dist/chunks/rename-fdjzyjar.js +0 -2
- package/dist/chunks/sandbox-adapter-craea9vm.js +0 -2
- package/dist/chunks/sessionFileAccessHooks-5jbvwabj.js +0 -2
- package/dist/chunks/settings-s2bcajs6.js +0 -2
- package/dist/chunks/setup-fwcttwbm.js +0 -2
- package/dist/chunks/sinks-wd4ccgbf.js +0 -2
- package/dist/chunks/startupProfiler-x5zbs2j7.js +0 -2
- package/dist/chunks/state-qpmfrvsv.js +0 -2
- package/dist/chunks/status-78yks3jw.js +0 -2
- package/dist/chunks/stickers-bdp8w2gr.js +0 -2
- package/dist/chunks/subprocessEnv-s797f06r.js +0 -2
- package/dist/chunks/tasks-63qaca0z.js +0 -2
- package/dist/chunks/teammateModeSnapshot-ae9r29dy.js +0 -2
- package/dist/chunks/teleport-es58k4xz.js +0 -2
- package/dist/chunks/terminalSetup-gyh5z5e2.js +0 -2
- package/dist/chunks/theme-qrhbaht6.js +0 -2
- package/dist/chunks/thinkback-5bs7ezv5.js +0 -2
- package/dist/chunks/thinkback-play-1dy160y5.js +0 -2
- package/dist/chunks/toolSearch-6cv284b7.js +0 -2
- package/dist/chunks/trustedDevice-77ketbgg.js +0 -2
- package/dist/chunks/upgrade-nft7c1yk.js +0 -2
- package/dist/chunks/usage-s5qgc615.js +0 -2
- package/dist/chunks/util-1geb93kp.js +0 -2
- package/dist/chunks/utils-6sb44pg8.js +0 -2
- package/dist/chunks/vim-kq91w44a.js +0 -2
- package/dist/chunks/worktree-0af6b1mt.js +0 -2
- package/dist/chunks/worktreeModeEnabled-ea6wb7aj.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ae as LJ,Be as MQ}from"./cli-
|
|
2
|
+
import{Ae as LJ,Be as MQ}from"./cli-shsgq494.js";import{Ye as EJ,bf as lQ}from"./cli-cfbfexxj.js";import{mg as SJ,pg as NJ,qg as pQ}from"./cli-df5r5xrp.js";import{$o as TJ,Ei as bQ,Ep as VJ,Fp as qQ,Lh as h,Mh as NQ,OI as rQ,Rm as wJ,Rv as i,Sm as DQ,To as jJ,Vo as AJ,Xo as xJ,Yz as bJ,Zv as dQ,Zz as cQ,_o as vJ,ap as fJ,cp as CJ,dI as uJ,eD as FJ,gr as yJ,hr as OQ,ip as EQ,kn as q,ln as _Q,oD as mQ,pi as $J,vH as mJ,wD as DJ,wi as hJ,zD as uQ}from"./cli-b3k8arn1.js";import{GM as p,HM as d,YM as RQ}from"./cli-ez2xsd4m.js";import{ON as IJ,RN as FQ}from"./cli-bj0csmzs.js";import{TN as pJ,UN as dJ,VN as cJ,ZN as nQ}from"./cli-8ykv66e4.js";import{mO as _J,sO as iQ}from"./cli-bzrat9yd.js";import{BQ as y,CQ as SQ,DQ as c,FQ as UJ,fR as PQ}from"./cli-a2d962bq.js";import{nS as XJ,pS as UQ}from"./cli-ceas97gw.js";import{$2 as YJ,C3 as b,D3 as s,EW as C,F1 as CQ,FW as u,NW as TQ,Q2 as R,Q3 as x,T1 as o,U1 as aJ,UY as OJ,VY as MJ,XW as iJ,_W as eQ,a3 as WJ,i1 as f,rZ as fQ,u3 as M,x3 as Y,zW as qJ}from"./cli-192xnkcx.js";import{D4 as LQ,r4 as HJ}from"./cli-r43jhzwm.js";import{c5 as $,g5 as vQ}from"./cli-6qt2xm18.js";import{l5 as _,o5 as KQ,t5 as GJ,u5 as KJ,z5 as XQ}from"./cli-2428yw99.js";import{C7 as g,f7 as n,g7 as r,v7 as PJ}from"./cli-yb5m6jwq.js";import{J7 as N,K7 as gJ}from"./cli-7wxv39ry.js";import{N7 as S,O7 as rJ}from"./cli-fnt125we.js";import{G8 as W,L8 as A}from"./cli-8kpqq0ea.js";import{$8 as kQ,_8 as BJ}from"./cli-e5yek4vx.js";import{s9 as U,u9 as a}from"./cli-5ajcy93q.js";import{D9 as zJ,E9 as GQ}from"./cli-zxe1a0ey.js";import{A_ as v,Z9 as QJ,d_ as ZQ,f_ as D,g_ as ZJ,j_ as zQ,x_ as K}from"./cli-awb77t95.js";import{ida as QQ}from"./cli-qwx84m9c.js";rJ();x();a();gJ();g();A();aJ();import t from"lodash-es/memoize.js";import l from"lodash-es/sample.js";var oJ=[/(?:^|\/)(?:package-lock\.json|yarn\.lock|bun\.lock|bun\.lockb|pnpm-lock\.yaml|Pipfile\.lock|poetry\.lock|Cargo\.lock|Gemfile\.lock|go\.sum|composer\.lock|uv\.lock)$/,/\.generated\./,/(?:^|\/)(?:dist|build|out|target|node_modules|\.next|__pycache__)\//,/\.(?:min\.js|min\.css|map|pyc|pyo)$/,/\.(?:json|ya?ml|toml|xml|ini|cfg|conf|env|lock|txt|md|mdx|rst|csv|log|svg)$/i,/(?:^|\/)\.?(?:eslintrc|prettierrc|babelrc|editorconfig|gitignore|gitattributes|dockerignore|npmrc)/,/(?:^|\/)(?:tsconfig|jsconfig|biome|vitest\.config|jest\.config|webpack\.config|vite\.config|rollup\.config)\.[a-z]+$/,/(?:^|\/)\.(?:github|vscode|idea|claude)\//,/(?:^|\/)(?:CHANGELOG|LICENSE|CONTRIBUTING|CODEOWNERS|README)(?:\.[a-z]+)?$/i];function sJ(Q){return!oJ.some((J)=>J.test(Q))}function tJ(Q,J){let Z=[],z=new Set,X=new Map;for(let G=1;Z.length<J&&G<=J;G++)for(let H of Q){if(Z.length>=J)break;if(!sJ(H))continue;let B=Math.max(H.lastIndexOf("/"),H.lastIndexOf("\\")),V=B>=0?H.slice(B+1):H;if(!V||z.has(V))continue;let L=B>=0?H.slice(0,B):".";if((X.get(L)??0)>=G)continue;Z.push(V),z.add(V),X.set(L,(X.get(L)??0)+1)}return Z.length>=J?Z:[]}async function eJ(){if(U.platform==="win32")return[];if(!await r())return[];try{let Q=await o(),J=["log","-n","1000","--pretty=format:","--name-only","--diff-filter=M"],Z=new Map,z=(G)=>{for(let H of G.split(`
|
|
3
3
|
`)){let B=H.trim();if(B)Z.set(B,(Z.get(B)??0)+1)}};if(Q){let{stdout:G}=await N("git",[...J,`--author=${Q}`],{cwd:S()});z(G)}if(Z.size<10){let{stdout:G}=await N(n(),J,{cwd:S()});z(G)}let X=Array.from(Z.entries()).sort((G,H)=>H[1]-G[1]).map(([G])=>G);return tJ(X,5)}catch(Q){return W(Q),[]}}var JQ=604800000,UZ=t(()=>{let Q=b(),J=Q.exampleFiles?.length?l(Q.exampleFiles):"<filepath>",Z=["fix lint errors","fix typecheck errors",`how does ${J} work?`,`refactor ${J}`,"how do I log an error?",`edit ${J} to...`,`write a test for ${J}`,"create a util logging.py that..."];return`Try "${l(Z)}"`}),VZ=t(async()=>{let Q=b(),J=Date.now(),Z=Q.exampleFilesGeneratedAt??0;if(J-Z>JQ)Q.exampleFiles=[];if(!Q.exampleFiles?.length)eJ().then((z)=>{if(z.length)s((X)=>({...X,exampleFiles:z,exampleFilesGeneratedAt:Date.now()}))})});v();A();UQ();GQ();v();ZQ();A();KQ();XQ();zQ();import{randomUUID as HQ}from"crypto";var e=2000,JJ=5,BQ=30000,F=3,YQ=new Set([4003]);function WQ(Q){if(typeof Q!=="object"||Q===null||!("type"in Q))return!1;return typeof Q.type==="string"}class E{sessionId;orgUuid;getAccessToken;callbacks;ws=null;state="closed";reconnectAttempts=0;sessionNotFoundRetries=0;pingInterval=null;reconnectTimer=null;constructor(Q,J,Z,z){this.sessionId=Q;this.orgUuid=J;this.getAccessToken=Z;this.callbacks=z}async connect(){if(this.state==="connecting"){K("[SessionsWebSocket] Already connecting");return}this.state="connecting";let J=`${zJ().BASE_API_URL.replace("https://","wss://")}/v1/sessions/ws/${this.sessionId}/subscribe?organization_uuid=${this.orgUuid}`;K(`[SessionsWebSocket] Connecting to ${J}`);let z={Authorization:`Bearer ${this.getAccessToken()}`,"anthropic-version":"2023-06-01"};if(typeof Bun<"u"){let X=new globalThis.WebSocket(J,{headers:z,proxy:KJ(J),tls:_()||void 0});this.ws=X,X.addEventListener("open",()=>{K("[SessionsWebSocket] Connection opened, authenticated via headers"),this.state="connected",this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),X.addEventListener("message",(G)=>{let H=typeof G.data==="string"?G.data:String(G.data);this.handleMessage(H)}),X.addEventListener("error",()=>{let G=Error("[SessionsWebSocket] WebSocket error");W(G),this.callbacks.onError?.(G)}),X.addEventListener("close",(G)=>{K(`[SessionsWebSocket] Closed: code=${G.code} reason=${G.reason}`),this.handleClose(G.code)}),X.addEventListener("pong",()=>{K("[SessionsWebSocket] Pong received")})}else{let{default:X}=await import("ws"),G=new X(J,{headers:z,agent:GJ(J),..._()});this.ws=G,G.on("open",()=>{K("[SessionsWebSocket] Connection opened, authenticated via headers"),this.state="connected",this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),G.on("message",(H)=>{this.handleMessage(H.toString())}),G.on("error",(H)=>{W(Error(`[SessionsWebSocket] Error: ${H.message}`)),this.callbacks.onError?.(H)}),G.on("close",(H,B)=>{K(`[SessionsWebSocket] Closed: code=${H} reason=${B.toString()}`),this.handleClose(H)}),G.on("pong",()=>{K("[SessionsWebSocket] Pong received")})}}handleMessage(Q){try{let J=ZJ(Q);if(WQ(J))this.callbacks.onMessage(J);else K(`[SessionsWebSocket] Ignoring message type: ${typeof J==="object"&&J!==null&&"type"in J?String(J.type):"unknown"}`)}catch(J){W(Error(`[SessionsWebSocket] Failed to parse message: ${QJ(J)}`))}}handleClose(Q){if(this.stopPingInterval(),this.state==="closed")return;this.ws=null;let J=this.state;if(this.state="closed",YQ.has(Q)){K(`[SessionsWebSocket] Permanent close code ${Q}, not reconnecting`),this.callbacks.onClose?.();return}if(Q===4001){if(this.sessionNotFoundRetries++,this.sessionNotFoundRetries>F){K(`[SessionsWebSocket] 4001 retry budget exhausted (${F}), not reconnecting`),this.callbacks.onClose?.();return}this.scheduleReconnect(e*this.sessionNotFoundRetries,`4001 attempt ${this.sessionNotFoundRetries}/${F}`);return}if(J==="connected"&&this.reconnectAttempts<JJ)this.reconnectAttempts++,this.scheduleReconnect(e,`attempt ${this.reconnectAttempts}/${JJ}`);else K("[SessionsWebSocket] Not reconnecting"),this.callbacks.onClose?.()}scheduleReconnect(Q,J){this.callbacks.onReconnecting?.(),K(`[SessionsWebSocket] Scheduling reconnect (${J}) in ${Q}ms`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},Q)}startPingInterval(){this.stopPingInterval(),this.pingInterval=setInterval(()=>{if(this.ws&&this.state==="connected")try{this.ws.ping?.()}catch{}},BQ)}stopPingInterval(){if(this.pingInterval)clearInterval(this.pingInterval),this.pingInterval=null}sendControlResponse(Q){if(!this.ws||this.state!=="connected"){W(Error("[SessionsWebSocket] Cannot send: not connected"));return}K("[SessionsWebSocket] Sending control response"),this.ws.send(D(Q))}sendControlRequest(Q){if(!this.ws||this.state!=="connected"){W(Error("[SessionsWebSocket] Cannot send: not connected"));return}let J={type:"control_request",request_id:HQ(),request:Q};K(`[SessionsWebSocket] Sending control request: ${Q.subtype}`),this.ws.send(D(J))}isConnected(){return this.state==="connected"}close(){if(K("[SessionsWebSocket] Closing connection"),this.state="closed",this.stopPingInterval(),this.reconnectTimer)clearTimeout(this.reconnectTimer),this.reconnectTimer=null;if(this.ws)this.ws.close(),this.ws=null}reconnect(){K("[SessionsWebSocket] Force reconnecting"),this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.close(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},500)}}function VQ(Q){return Q.type!=="control_request"&&Q.type!=="control_response"&&Q.type!=="control_cancel_request"}class yQ{config;callbacks;websocket=null;pendingPermissionRequests=new Map;constructor(Q,J){this.config=Q;this.callbacks=J}connect(){K(`[RemoteSessionManager] Connecting to session ${this.config.sessionId}`);let Q={onMessage:(J)=>this.handleMessage(J),onConnected:()=>{K("[RemoteSessionManager] Connected"),this.callbacks.onConnected?.()},onClose:()=>{K("[RemoteSessionManager] Disconnected"),this.callbacks.onDisconnected?.()},onReconnecting:()=>{K("[RemoteSessionManager] Reconnecting"),this.callbacks.onReconnecting?.()},onError:(J)=>{W(J),this.callbacks.onError?.(J)}};this.websocket=new E(this.config.sessionId,this.config.orgUuid,this.config.getAccessToken,Q),this.websocket.connect()}handleMessage(Q){if(Q.type==="control_request"){this.handleControlRequest(Q);return}if(Q.type==="control_cancel_request"){let{request_id:J}=Q,Z=this.pendingPermissionRequests.get(J);K(`[RemoteSessionManager] Permission request cancelled: ${J}`),this.pendingPermissionRequests.delete(J),this.callbacks.onPermissionCancelled?.(J,Z?.tool_use_id);return}if(Q.type==="control_response"){K("[RemoteSessionManager] Received control response");return}if(VQ(Q))this.callbacks.onMessage(Q)}handleControlRequest(Q){let{request_id:J,request:Z}=Q;if(Z.subtype==="can_use_tool")K(`[RemoteSessionManager] Permission request for tool: ${Z.tool_name}`),this.pendingPermissionRequests.set(J,Z),this.callbacks.onPermissionRequest(Z,J);else{K(`[RemoteSessionManager] Unsupported control request subtype: ${Z.subtype}`);let z={type:"control_response",response:{subtype:"error",request_id:J,error:`Unsupported control request subtype: ${Z.subtype}`}};this.websocket?.sendControlResponse(z)}}async sendMessage(Q,J){K(`[RemoteSessionManager] Sending message to session ${this.config.sessionId}`);let Z=await XJ(this.config.sessionId,Q,J);if(!Z)W(Error(`[RemoteSessionManager] Failed to send message to session ${this.config.sessionId}`));return Z}respondToPermissionRequest(Q,J){if(!this.pendingPermissionRequests.get(Q)){W(Error(`[RemoteSessionManager] No pending permission request with ID: ${Q}`));return}this.pendingPermissionRequests.delete(Q);let z={type:"control_response",response:{subtype:"success",request_id:Q,response:{behavior:J.behavior,...J.behavior==="allow"?{updatedInput:J.updatedInput}:{message:J.message}}}};K(`[RemoteSessionManager] Sending permission response: ${J.behavior}`),this.websocket?.sendControlResponse(z)}isConnected(){return this.websocket?.isConnected()??!1}cancelSession(){K("[RemoteSessionManager] Sending interrupt signal"),this.websocket?.sendControlRequest({subtype:"interrupt"})}getSessionId(){return this.config.sessionId}disconnect(){K("[RemoteSessionManager] Disconnecting"),this.websocket?.close(),this.websocket=null,this.pendingPermissionRequests.clear()}reconnect(){K("[RemoteSessionManager] Reconnecting WebSocket"),this.websocket?.reconnect()}}function xZ(Q,J,Z,z=!1,X=!1){return{sessionId:Q,getAccessToken:J,orgUuid:Z,hasInitialPrompt:z,viewerOnly:X}}v();A();LQ();RQ();function NZ(){let Q=HJ();if(!Q?.teamName||!Q?.agentName){K("[Reconnection] computeInitialTeamContext: No teammate context set (not a teammate)");return}let{teamName:J,agentId:Z,agentName:z}=Q,X=d(J);if(!X){W(Error(`[computeInitialTeamContext] Could not read team file for ${J}`));return}let G=p(J),H=!Z;return K(`[Reconnection] Computed initial team context for ${H?"leader":`teammate ${z}`} in team ${J}`),{teamName:J,teamFilePath:G,leadAgentId:X.leadAgentId,selfAgentId:Z,selfAgentName:z,isLeader:H,teammates:{}}}function bZ(Q,J,Z){let z=d(J);if(!z){W(Error(`[initializeTeammateContextFromSession] Could not read team file for ${J} (agent: ${Z})`));return}let X=z.members.find((B)=>B.name===Z);if(!X)K(`[Reconnection] Member ${Z} not found in team ${J} - may have been removed`);let G=X?.agentId,H=p(J);Q((B)=>({...B,teamContext:{teamName:J,teamFilePath:H,leadAgentId:z.leadAgentId,selfAgentId:G,selfAgentName:Z,isLeader:!1,teammates:{}}})),K(`[Reconnection] Initialized agent context from session for ${Z} in team ${J}`)}PQ();WJ();kQ();x();qQ();MQ();OQ();import{c as $Q}from"react/compiler-runtime";import{useEffect as hQ,useState as IQ}from"react";import{jsxDEV as P}from"react/jsx-dev-runtime";var wQ={enable_shortcut_tip:!1,enable_startup_dialog:!1};function m(){return YJ("tengu_desktop_upsell",wQ)}function jQ(){return process.platform==="darwin"||process.platform==="win32"&&process.arch==="x64"}function lZ(){if(!jQ())return!1;if(!m().enable_startup_dialog)return!1;let Q=Y();if(Q.desktopUpsellDismissed)return!1;if((Q.desktopUpsellSeenCount??0)>=3)return!1;return!0}function nZ(Q){let J=$Q(14),{onDone:Z}=Q,[z,X]=IQ(!1),G;if(J[0]===Symbol.for("react.memo_cache_sentinel"))G=[],J[0]=G;else G=J[0];if(hQ(xQ,G),z){let O;if(J[1]!==Z)O=P(LJ,{onDone:()=>Z()},void 0,!1,void 0,this),J[1]=Z,J[2]=O;else O=J[2];return O}let H;if(J[3]!==Z)H=function(nJ){switch(nJ){case"try":{X(!0);return}case"never":{M(AQ),Z();return}case"not-now":{Z();return}}},J[3]=Z,J[4]=H;else H=J[4];let B=H,V;if(J[5]===Symbol.for("react.memo_cache_sentinel"))V={label:"Open in UnieAI Code Desktop",value:"try"},J[5]=V;else V=J[5];let L;if(J[6]===Symbol.for("react.memo_cache_sentinel"))L={label:"Not now",value:"not-now"},J[6]=L;else L=J[6];let I;if(J[7]===Symbol.for("react.memo_cache_sentinel"))I=[V,L,{label:"Don't ask again",value:"never"}],J[7]=I;else I=J[7];let lJ=I,w;if(J[8]===Symbol.for("react.memo_cache_sentinel"))w=P(c,{marginBottom:1,children:P(UJ,{children:"Same UnieAI Code with visual diffs, live app preview, parallel sessions, and more."},void 0,!1,void 0,this)},void 0,!1,void 0,this),J[8]=w;else w=J[8];let k;if(J[9]!==B)k=()=>B("not-now"),J[9]=B,J[10]=k;else k=J[10];let j;if(J[11]!==B||J[12]!==k)j=P(yJ,{title:"Try UnieAI Code Desktop",children:P(c,{flexDirection:"column",paddingX:2,paddingY:1,children:[w,P(VJ,{options:lJ,onChange:B,onCancel:k},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),J[11]=B,J[12]=k,J[13]=j;else j=J[13];return j}function AQ(Q){if(Q.desktopUpsellDismissed)return Q;return{...Q,desktopUpsellDismissed:!0}}function xQ(){let Q=(Y().desktopUpsellSeenCount??0)+1;M((J)=>{if((J.desktopUpsellSeenCount??0)>=Q)return J;return{...J,desktopUpsellSeenCount:Q}}),BJ("tengu_desktop_upsell_shown",{seen_count:Q})}v();dQ();TQ();iQ();import gQ from"chalk";SQ();lQ();_Q();DQ();CQ();cQ();x();bQ();a();FQ();g();EQ();fQ();vQ();uQ();mQ();NQ();rQ();WJ();pQ();nQ();x();function oZ(Q){let J=Y().numStartups;M((Z)=>{let z=Z.tipsHistory??{};if(z[Q]===J)return Z;return{...Z,tipsHistory:{...z,[Q]:J}}})}function RJ(Q){let J=Y(),Z=J.tipsHistory?.[Q];if(!Z)return 1/0;return J.numStartups-Z}var T;async function aQ(){if(T!==void 0)return T;let Q=await FJ();return T=h in Q,T}async function kJ(Q,J,Z){if(!await aQ())return!1;if(DJ(`${Q}@${h}`))return!1;let{bashTools:z}=J??{};if(Z.cli&&z?.size){if(Z.cli.some((X)=>z.has(X)))return!0}if(Z.filePath&&J?.readFileState){if(IJ(J.readFileState).some((G)=>Z.filePath.test(G)))return!0}return!1}var oQ=[{id:"new-user-warmup",content:async()=>"Start with small features or bug fixes, tell Claude to propose a plan, and verify its suggested edits",cooldownSessions:3,async isRelevant(){return Y().numStartups<10}},{id:"plan-mode-for-complex-tasks",content:async()=>`Use Plan Mode to prepare for a complex request before making changes. Press ${q("chat:cycleMode","Chat","shift+tab")} twice to enable.`,cooldownSessions:5,isRelevant:async()=>{if(process.env.USER_TYPE==="ant")return!1;let Q=Y();return(Q.lastPlanModeUse?(Date.now()-Q.lastPlanModeUse)/86400000:1/0)>7}},{id:"default-permission-mode-config",content:async()=>"Use /config to change your default permission mode (including Plan Mode)",cooldownSessions:10,isRelevant:async()=>{try{let Q=Y(),J=u(),Z=Boolean(Q.lastPlanModeUse),z=Boolean(J?.permissions?.defaultMode);return Z&&!z}catch(Q){return K(`Failed to check default-permission-mode-config tip relevance: ${Q}`,{level:"warn"}),!1}}},{id:"git-worktrees",content:async()=>"Use git worktrees to run multiple Claude sessions in parallel.",cooldownSessions:10,isRelevant:async()=>{try{let Q=Y();return await PJ()<=1&&Q.numStartups>50}catch(Q){return!1}}},{id:"color-when-multi-clauding",content:async()=>"Running multiple Claude sessions? Use /color and /rename to tell them apart at a glance.",cooldownSessions:10,isRelevant:async()=>{if(uJ())return!1;return await bJ()>=2}},{id:"terminal-setup",content:async()=>U.terminal==="Apple_Terminal"?"Run /terminal-setup to enable convenient terminal integration like Option + Enter for new line and more":"Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more",cooldownSessions:10,async isRelevant(){let Q=Y();if(U.terminal==="Apple_Terminal")return!Q.optionAsMetaKeyInstalled;return!Q.shiftEnterKeyBindingInstalled}},{id:"shift-enter",content:async()=>U.terminal==="Apple_Terminal"?"Press Option+Enter to send a multi-line message":"Press Shift+Enter to send a multi-line message",cooldownSessions:10,async isRelevant(){let Q=Y();return Boolean((U.terminal==="Apple_Terminal"?Q.optionAsMetaKeyInstalled:Q.shiftEnterKeyBindingInstalled)&&Q.numStartups>3)}},{id:"shift-enter-setup",content:async()=>U.terminal==="Apple_Terminal"?"Run /terminal-setup to enable Option+Enter for new lines":"Run /terminal-setup to enable Shift+Enter for new lines",cooldownSessions:10,async isRelevant(){if(!_J())return!1;let Q=Y();return!(U.terminal==="Apple_Terminal"?Q.optionAsMetaKeyInstalled:Q.shiftEnterKeyBindingInstalled)}},{id:"memory-command",content:async()=>"Use /memory to view and manage Claude memory",cooldownSessions:15,async isRelevant(){return Y().memoryUsageCount<=0}},{id:"theme-command",content:async()=>"Use /theme to change the color theme",cooldownSessions:20,isRelevant:async()=>!0},{id:"colorterm-truecolor",content:async()=>"Try setting environment variable COLORTERM=truecolor for richer colors",cooldownSessions:30,isRelevant:async()=>!process.env.COLORTERM&&gQ.level<3},{id:"powershell-tool-env",content:async()=>"Set CLAUDE_CODE_USE_POWERSHELL_TOOL=1 to enable the PowerShell tool (preview)",cooldownSessions:10,isRelevant:async()=>$()==="windows"&&process.env.CLAUDE_CODE_USE_POWERSHELL_TOOL===void 0},{id:"status-line",content:async()=>"Use /statusline to set up a custom status line that will display beneath the input box",cooldownSessions:25,isRelevant:async()=>u().statusLine===void 0},{id:"prompt-queue",content:async()=>"Hit Enter to queue up additional messages while Claude is working.",cooldownSessions:5,async isRelevant(){return Y().promptQueueUseCount<=3}},{id:"enter-to-steer-in-relatime",content:async()=>"Send messages to Claude while it works to steer Claude in real-time",cooldownSessions:20,isRelevant:async()=>!0},{id:"todo-list",content:async()=>"Ask Claude to create a todo list when working on complex tasks to track progress and remain on track",cooldownSessions:20,isRelevant:async()=>!0},{id:"vscode-command-install",content:async()=>`Open the Command Palette (Cmd+Shift+P) and run "Shell Command: Install '${U.terminal==="vscode"?"code":U.terminal}' command in PATH" to enable IDE integration`,cooldownSessions:0,async isRelevant(){if(!jJ())return!1;if($()!=="macos")return!1;switch(U.terminal){case"vscode":return!await fJ();case"cursor":return!await vJ();case"windsurf":return!await TJ();default:return!1}}},{id:"ide-upsell-external-terminal",content:async()=>"Connect Claude to your IDE \xB7 /ide",cooldownSessions:4,async isRelevant(){if(AJ())return!1;if((await xJ()).length!==0)return!1;return(await CJ()).length>0}},{id:"install-github-app",content:async()=>"Run /install-github-app to tag @claude right from your Github issues and PRs",cooldownSessions:10,isRelevant:async()=>!Y().githubActionSetupCount},{id:"install-slack-app",content:async()=>"Run /install-slack-app to use Claude in Slack",cooldownSessions:10,isRelevant:async()=>!Y().slackAppInstallCount},{id:"permissions",content:async()=>"Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools",cooldownSessions:10,async isRelevant(){return Y().numStartups>10}},{id:"drag-and-drop-images",content:async()=>"Did you know you can drag and drop image files into your terminal?",cooldownSessions:10,isRelevant:async()=>!U.isSSH()},{id:"paste-images-mac",content:async()=>"Paste images into Claude Code using control+v (not cmd+v!)",cooldownSessions:10,isRelevant:async()=>$()==="macos"},{id:"double-esc",content:async()=>"Double-tap esc to rewind the conversation to a previous point in time",cooldownSessions:10,isRelevant:async()=>!i()},{id:"double-esc-code-restore",content:async()=>"Double-tap esc to rewind the code and/or conversation to a previous point in time",cooldownSessions:10,isRelevant:async()=>i()},{id:"continue",content:async()=>"Run unieai --continue or unieai --resume to resume a conversation",cooldownSessions:10,isRelevant:async()=>!0},{id:"rename-conversation",content:async()=>"Name your conversations with /rename to find them easily in /resume later",cooldownSessions:15,isRelevant:async()=>mJ()&&Y().numStartups>10},{id:"custom-commands",content:async()=>"Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project",cooldownSessions:15,async isRelevant(){return Y().numStartups>10}},{id:"shift-tab",content:async()=>process.env.USER_TYPE==="ant"?`Hit ${q("chat:cycleMode","Chat","shift+tab")} to cycle between default mode and auto mode`:`Hit ${q("chat:cycleMode","Chat","shift+tab")} to cycle between default mode, auto-accept edit mode, and plan mode`,cooldownSessions:10,isRelevant:async()=>!0},{id:"image-paste",content:async()=>`Use ${q("chat:imagePaste","Chat","ctrl+v")} to paste images from your clipboard`,cooldownSessions:20,isRelevant:async()=>!0},{id:"custom-agents",content:async()=>"Use /agents to optimize specific tasks. Eg. Software Architect, Code Writer, Code Reviewer",cooldownSessions:15,async isRelevant(){return Y().numStartups>5}},{id:"agent-flag",content:async()=>"Use --agent <agent_name> to directly start a conversation with a subagent",cooldownSessions:15,async isRelevant(){return Y().numStartups>5}},{id:"desktop-app",content:async()=>"Run Claude Code locally or remotely using the Claude desktop app: clau.de/desktop",cooldownSessions:15,isRelevant:async()=>$()!=="linux"},{id:"desktop-shortcut",content:async(Q)=>{return`Continue your session in Claude Code Desktop with ${y("suggestion",Q.theme)("/desktop")}`},cooldownSessions:15,isRelevant:async()=>{if(!m().enable_shortcut_tip)return!1;return process.platform==="darwin"||process.platform==="win32"&&process.arch==="x64"}},{id:"web-app",content:async()=>"Run tasks in the cloud while you keep coding locally \xB7 clau.de/web",cooldownSessions:15,isRelevant:async()=>!0},{id:"mobile-app",content:async()=>"/mobile to use Claude Code from the Claude app on your phone",cooldownSessions:15,isRelevant:async()=>!0},{id:"opusplan-mode-reminder",content:async()=>`Your default model setting is Opus Plan Mode. Press ${q("chat:cycleMode","Chat","shift+tab")} twice to activate Plan Mode and plan with Claude Opus.`,cooldownSessions:2,async isRelevant(){if(process.env.USER_TYPE==="ant")return!1;let Q=Y(),Z=OJ()==="opusplan",z=Q.lastPlanModeUse?(Date.now()-Q.lastPlanModeUse)/86400000:1/0;return Z&&z>3}},{id:"frontend-design-plugin",content:async(Q)=>{return`Working with HTML/CSS? Install the frontend-design plugin:
|
|
4
4
|
${y("suggestion",Q.theme)(`/plugin install frontend-design@${h}`)}`},cooldownSessions:3,isRelevant:async(Q)=>kJ("frontend-design",Q,{filePath:/\.(html|css|htm)$/i})},{id:"vercel-plugin",content:async(Q)=>{return`Working with Vercel? Install the vercel plugin:
|
|
5
5
|
${y("suggestion",Q.theme)(`/plugin install vercel@${h}`)}`},cooldownSessions:3,isRelevant:async(Q)=>kJ("vercel",Q,{filePath:/(?:^|[/\\])vercel\.json$/i,cli:["vercel"]})},{id:"effort-high-nudge",content:async(Q)=>{let Z=y("suggestion",Q.theme)("/effort high");return R("tengu_tide_elm","off")==="copy_b"?`Use ${Z} for better one-shot answers. Claude thinks it through first.`:`Working on something tricky? ${Z} gives better first answers`},cooldownSessions:3,isRelevant:async()=>{if(!f())return!1;if(!$J(MJ()))return!1;if(qJ("policySettings")?.effortLevel!==void 0)return!1;if(hJ()!==void 0)return!1;let Q=C().effortLevel;if(Q==="high"||Q==="max")return!1;return R("tengu_tide_elm","off")!=="off"}},{id:"subagent-fanout-nudge",content:async(Q)=>{let J=y("suggestion",Q.theme);return R("tengu_tern_alloy","off")==="copy_b"?`For big tasks, tell Claude to ${J("use subagents")}. They work in parallel and keep your main thread clean.`:`Say ${J('"fan out subagents"')} and Claude sends a team. Each one digs deep so nothing gets missed.`},cooldownSessions:3,isRelevant:async()=>{if(!f())return!1;return R("tengu_tern_alloy","off")!=="off"}},{id:"loop-command-nudge",content:async(Q)=>{let J=y("suggestion",Q.theme);return R("tengu_timber_lark","off")==="copy_b"?`Use ${J("/loop 5m check the deploy")} to run any prompt on a schedule. Set it and forget it.`:`${J("/loop")} runs any prompt on a recurring schedule. Great for monitoring deploys, babysitting PRs, or polling status.`},cooldownSessions:3,isRelevant:async()=>{if(!f())return!1;if(!wJ())return!1;return R("tengu_timber_lark","off")!=="off"}},{id:"guest-passes",content:async(Q)=>{let J=y("claude",Q.theme),Z=cJ();return Z?`Share Claude Code and earn ${J(dJ(Z))} of extra usage \xB7 ${J("/passes")}`:`You have free guest passes to share \xB7 ${J("/passes")}`},cooldownSessions:3,isRelevant:async()=>{if(Y().hasVisitedPasses)return!1;let{eligible:J}=pJ();return J}},{id:"overage-credit",content:async(Q)=>{let J=y("claude",Q.theme),Z=SJ(),z=Z?NJ(Z):null;if(!z)return"";return`${J(`${z} in extra usage, on us`)} \xB7 third-party apps \xB7 ${J("/extra-usage")}`},cooldownSessions:3,isRelevant:async()=>EJ()},{id:"feedback-command",content:async()=>"Use /feedback to help us improve!",cooldownSessions:15,async isRelevant(){if(process.env.USER_TYPE==="ant")return!1;return Y().numStartups>5}}],sQ=process.env.USER_TYPE==="ant"?[{id:"important-claudemd",content:async()=>'[ANT-ONLY] Use "IMPORTANT:" prefix for must-follow CLAUDE.md rules',cooldownSessions:30,isRelevant:async()=>!0},{id:"skillify",content:async()=>"[ANT-ONLY] Use /skillify at the end of a workflow to turn it into a reusable skill",cooldownSessions:15,isRelevant:async()=>!0}]:[];function tQ(){let J=C().spinnerTipsOverride;if(!J?.tips?.length)return[];return J.tips.map((Z,z)=>({id:`custom-tip-${z}`,content:async()=>Z,cooldownSessions:0,isRelevant:async()=>!0}))}async function A0(Q){let Z=C().spinnerTipsOverride,z=tQ();if(Z?.excludeDefault&&z.length>0)return z;let X=[...oQ,...sQ],G=await Promise.all(X.map((B)=>B.isRelevant(Q)));return[...X.filter((B,V)=>G[V]).filter((B)=>RJ(B.id)>=B.cooldownSessions),...z]}eQ();var JZ={"claude-3-opus":{modelName:"Claude 3 Opus",retirementDates:{firstParty:"January 5, 2026",bedrock:"January 15, 2026",vertex:"January 5, 2026",foundry:"January 5, 2026",azureOpenAI:null}},"claude-3-7-sonnet":{modelName:"Claude 3.7 Sonnet",retirementDates:{firstParty:"February 19, 2026",bedrock:"April 28, 2026",vertex:"May 11, 2026",foundry:"February 19, 2026",azureOpenAI:null}},"claude-3-5-haiku":{modelName:"Claude 3.5 Haiku",retirementDates:{firstParty:"February 19, 2026",bedrock:null,vertex:null,foundry:null,azureOpenAI:null}}};function QZ(Q){let J=Q.toLowerCase(),Z=iJ();for(let[z,X]of Object.entries(JZ)){let G=X.retirementDates[Z];if(!J.includes(z)||!G)continue;return{isDeprecated:!0,modelName:X.modelName,retirementDate:G}}return{isDeprecated:!1}}function T0(Q){if(!Q)return null;let J=QZ(Q);if(!J.isDeprecated)return null;return`\u26A0 ${J.modelName} will be retired on ${J.retirementDate}. Consider switching to a newer model.`}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{AC as A,BC as p,Bn as a,MC as P,PC as n,PD as D,Ry as W,SD as r,Sy as i,dx as O,ex as t,ij as y,ix as R,kx as l,nj as u,qw as M,ww as o,zC as x,zn as K}from"./cli-
|
|
2
|
+
import{AC as A,BC as p,Bn as a,MC as P,PC as n,PD as D,Ry as W,SD as r,Sy as i,dx as O,ex as t,ij as y,ix as R,kx as l,nj as u,qw as M,ww as o,zC as x,zn as K}from"./cli-b3k8arn1.js";import{G8 as $,L8 as m}from"./cli-8kpqq0ea.js";import{A_ as v,Z9 as Z,d_ as d,x_ as J}from"./cli-awb77t95.js";import{$_ as X,d$ as c,dda as g,m$ as Y}from"./cli-tafg3e9w.js";import{hda as h}from"./cli-qwx84m9c.js";async function Tj(w){J("refreshActivePlugins: clearing settings and plugin caches"),X(),P(),W();let H=await D(),[E,F,G]=await Promise.all([x(),A(),y(Y())]),z=[...E,...F],{enabled:B,disabled:L,errors:I}=H,[S,k]=await Promise.all([Promise.all(B.map(async(j)=>{if(j.mcpServers)return Object.keys(j.mcpServers).length;let q=await K(j,I);if(q)j.mcpServers=q;return q?Object.keys(q).length:0})),Promise.all(B.map(async(j)=>{if(j.lspServers)return Object.keys(j.lspServers).length;let q=await O(j,I);if(q)j.lspServers=q;return q?Object.keys(q).length:0}))]),N=S.reduce((j,q)=>j+q,0),Q=k.reduce((j,q)=>j+q,0);w((j)=>({...j,plugins:{...j.plugins,enabled:B,disabled:L,commands:z,errors:s(j.plugins.errors,I),needsRefresh:!1},agentDefinitions:G,mcp:{...j.mcp,pluginReconnectKey:j.mcp.pluginReconnectKey+1}})),R();let T=!1;try{await M()}catch(j){T=!0,$(j),J(`refreshActivePlugins: loadPluginHooks failed: ${Z(j)}`)}let U=B.reduce((j,q)=>{if(!q.hooksConfig)return j;return j+Object.values(q.hooksConfig).reduce((b,C)=>b+(C?.reduce((_,f)=>_+f.hooks.length,0)??0),0)},0);return J(`refreshActivePlugins: ${B.length} enabled, ${E.length} commands, ${G.allAgents.length} agents, ${U} hooks, ${N} MCP, ${Q} LSP`),{enabled_count:B.length,disabled_count:L.length,command_count:E.length,skill_count:F.length,agent_count:G.allAgents.length,hook_count:U,mcp_count:N,lsp_count:Q,error_count:I.length+(T?1:0),agentDefinitions:G,pluginCommands:z,pluginSkills:F}}function s(w,H){let E=w.filter((z)=>z.source==="lsp-manager"||z.source.startsWith("plugin:")),F=new Set(H.map(V));return[...E.filter((z)=>!F.has(V(z))),...H]}function V(w){return w.type==="generic-error"?`generic-error:${w.source}:${w.error}`:`${w.type}:${w.source}`}var e=h(()=>{g();l();u();v();d();m();c();n();p();o();t();a();i();r()});
|
|
3
3
|
export{Tj as ub,e as vb};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{YR as AJ,dS as oJ}from"./cli-wt2bfbn0.js";import{D4 as qJ,f4 as PJ,g4 as U,k4 as ZJ,l4 as $J,p4 as bJ,t4 as SJ,u4 as h,v4 as zJ}from"./cli-s6vr7213.js";import{$4 as w,a5 as YJ}from"./cli-fakdskp6.js";import{A7 as gJ,d7 as vJ}from"./cli-fdya77ch.js";import{H7 as xJ,I7 as lJ}from"./cli-p0vh69b9.js";import{E8 as L,J8 as fJ}from"./cli-4ewb3q42.js";import{X9 as W,Y9 as x,b_ as QJ,d_ as v,e_ as y,h_ as VJ,v_ as G,y_ as XJ}from"./cli-hke6r0q8.js";import{F_ as a,G_ as l,I_ as e,S_ as JJ}from"./cli-tq5z9qv3.js";import{Taa as s,bda as t,c$ as i,d$ as DJ,e$ as m,oca as N}from"./cli-3ac555qw.js";import{fda as I,gda as CJ}from"./cli-w1d8n9g3.js";import{mkdir as cJ,readdir as g,readFile as GJ,unlink as KJ,writeFile as u}from"fs/promises";import{join as D}from"path";import{z as _}from"zod/v4";function EQ(J){if(M===J)return;M=J,B()}function UQ(){if(M===void 0)return;M=void 0,B()}function B(){try{RJ.emit()}catch{}}function _J(J){return D(H(J),uJ)}async function o(J){let Q=_J(J);try{let V=(await GJ(Q,"utf-8")).trim(),X=parseInt(V,10);return isNaN(X)?0:X}catch{return 0}}async function WJ(J,Q){let V=_J(J);await u(V,String(Q))}function OQ(){if(e(process.env.CLAUDE_CODE_ENABLE_TASKS))return!0;return!s()}async function CQ(J){let Q=H(J),V=await n(J),X;try{X=await U(V,f);let Z=await EJ(J);if(Z>0){let $=await o(J);if(Z>$)await WJ(J,Z)}let Y;try{Y=await g(Q)}catch{Y=[]}for(let $ of Y)if($.endsWith(".json")&&!$.startsWith(".")){let q=D(Q,$);try{await KJ(q)}catch{}}B()}finally{if(X)await X()}}function xQ(){if(process.env.CLAUDE_CODE_TASK_LIST_ID)return process.env.CLAUDE_CODE_TASK_LIST_ID;let J=$J();if(J)return J.teamName;return h()||M||m()}function HJ(J){return J.replace(/[^a-zA-Z0-9_-]/g,"-")}function H(J){return D(a(),"tasks",HJ(J))}function z(J,Q){return D(H(J),`${HJ(Q)}.json`)}async function FJ(J){let Q=H(J);try{await cJ(Q,{recursive:!0})}catch{}}async function EJ(J){let Q=H(J),V;try{V=await g(Q)}catch{return 0}let X=0;for(let Z of V){if(!Z.endsWith(".json"))continue;let Y=parseInt(Z.replace(".json",""),10);if(!isNaN(Y)&&Y>X)X=Y}return X}async function NJ(J){let[Q,V]=await Promise.all([EJ(J),o(J)]);return Math.max(Q,V)}async function vQ(J,Q){let V=await n(J),X;try{X=await U(V,f);let Z=await NJ(J),Y=String(Z+1),$={id:Y,...Q},q=z(J,Y);return await u(q,v($,null,2)),B(),Y}finally{if(X)await X()}}async function C(J,Q){let V=z(J,Q);try{let X=await GJ(V,"utf-8"),Z=y(X);if(process.env.USER_TYPE==="ant"){if(Z.status==="open")Z.status="pending";else if(Z.status==="resolved")Z.status="completed";else if(Z.status&&["planning","implementing","reviewing","verifying"].includes(Z.status))Z.status="in_progress"}let Y=hJ().safeParse(Z);if(!Y.success)return G(`[Tasks] Task ${Q} failed schema validation: ${Y.error.message}`),null;return Y.data}catch(X){if(x(X)==="ENOENT")return null;return G(`[Tasks] Failed to read task ${Q}: ${W(X)}`),L(X),null}}async function UJ(J,Q,V){let X=await C(J,Q);if(!X)return null;let Z={...X,...V,id:Q},Y=z(J,Q);return await u(Y,v(Z,null,2)),B(),Z}async function j(J,Q,V){let X=z(J,Q);if(!await C(J,Q))return null;let Y;try{return Y=await U(X,f),await UJ(J,Q,V)}finally{await Y?.()}}async function SQ(J,Q){let V=z(J,Q);try{let X=parseInt(Q,10);if(!isNaN(X)){let Y=await o(J);if(X>Y)await WJ(J,X)}try{await KJ(V)}catch(Y){if(x(Y)==="ENOENT")return!1;throw Y}let Z=await F(J);for(let Y of Z){let $=Y.blocks.filter((K)=>K!==Q),q=Y.blockedBy.filter((K)=>K!==Q);if($.length!==Y.blocks.length||q.length!==Y.blockedBy.length)await j(J,Y.id,{blocks:$,blockedBy:q})}return B(),!0}catch{return!1}}async function F(J){let Q=H(J),V;try{V=await g(Q)}catch{return[]}let X=V.filter((Y)=>Y.endsWith(".json")).map((Y)=>Y.replace(".json",""));return(await Promise.all(X.map((Y)=>C(J,Y)))).filter((Y)=>Y!==null)}async function zQ(J,Q,V){let[X,Z]=await Promise.all([C(J,Q),C(J,V)]);if(!X||!Z)return!1;if(!X.blocks.includes(V))await j(J,Q,{blocks:[...X.blocks,V]});if(!Z.blockedBy.includes(Q))await j(J,V,{blockedBy:[...Z.blockedBy,Q]});return!0}function TJ(J){return D(H(J),".lock")}async function n(J){await FJ(J);let Q=TJ(J);try{await u(Q,"",{flag:"wx"})}catch{}return Q}async function AQ(J,Q,V,X={}){let Z=z(J,Q);if(!await C(J,Q))return{success:!1,reason:"task_not_found"};if(X.checkAgentBusy)return IJ(J,Q,V);let $;try{$=await U(Z,f);let q=await C(J,Q);if(!q)return{success:!1,reason:"task_not_found"};if(q.owner&&q.owner!==V)return{success:!1,reason:"already_claimed",task:q};if(q.status==="completed")return{success:!1,reason:"already_resolved",task:q};let K=await F(J),O=new Set(K.filter((A)=>A.status!=="completed").map((A)=>A.id)),T=q.blockedBy.filter((A)=>O.has(A));if(T.length>0)return{success:!1,reason:"blocked",task:q,blockedByTasks:T};return{success:!0,task:await UJ(J,Q,{owner:V})}}catch(q){return G(`[Tasks] Failed to claim task ${Q}: ${W(q)}`),L(q),{success:!1,reason:"task_not_found"}}finally{if($)await $()}}async function IJ(J,Q,V){let X=await n(J),Z;try{Z=await U(X,f);let Y=await F(J),$=Y.find((R)=>R.id===Q);if(!$)return{success:!1,reason:"task_not_found"};if($.owner&&$.owner!==V)return{success:!1,reason:"already_claimed",task:$};if($.status==="completed")return{success:!1,reason:"already_resolved",task:$};let q=new Set(Y.filter((R)=>R.status!=="completed").map((R)=>R.id)),K=$.blockedBy.filter((R)=>q.has(R));if(K.length>0)return{success:!1,reason:"blocked",task:$,blockedByTasks:K};let O=Y.filter((R)=>R.status!=="completed"&&R.owner===V&&R.id!==Q);if(O.length>0)return{success:!1,reason:"agent_busy",task:$,busyWithTasks:O.map((R)=>R.id)};return{success:!0,task:await j(J,Q,{owner:V})}}catch(Y){return G(`[Tasks] Failed to claim task ${Q} with busy check: ${W(Y)}`),L(Y),{success:!1,reason:"task_not_found"}}finally{if(Z)await Z()}}async function MQ(J,Q,V,X){let Y=(await F(J)).filter((K)=>K.status!=="completed"&&(K.owner===Q||K.owner===V));for(let K of Y)await j(J,K.id,{owner:void 0,status:"pending"});if(Y.length>0)G(`[Tasks] Unassigned ${Y.length} task(s) from ${V}`);let q=`${V} ${X==="terminated"?"was terminated":"has shut down"}.`;if(Y.length>0){let K=Y.map((O)=>`#${O.id} "${O.subject}"`).join(", ");q+=` ${Y.length} task(s) were unassigned: ${K}. Use TaskList to check availability and TaskUpdate with owner to reassign them to idle teammates.`}return{unassignedTasks:Y.map((K)=>({id:K.id,subject:K.subject})),notificationMessage:q}}var RJ,M,BQ,LJ,hJ,uJ=".highwatermark",f,jQ="tasklist";var BJ=I(()=>{t();PJ();XJ();JJ();QJ();YJ();ZJ();fJ();DJ();VJ();qJ();bJ();RJ=i();BQ=RJ.subscribe;LJ=w(()=>_.enum(["pending","in_progress","completed"])),hJ=w(()=>_.object({id:_.string(),subject:_.string(),description:_.string(),activeForm:_.string().optional(),owner:_.string().optional(),status:LJ(),blocks:_.array(_.string()),blockedBy:_.array(_.string()),metadata:_.record(_.string(),_.unknown()).optional()})),f={retries:{retries:30,minTimeout:5,maxTimeout:100}}});function k(J){return J==="tmux"||J==="iterm2"}var OJ=()=>{};import{mkdirSync as nJ,readFileSync as kJ,writeFileSync as dJ}from"fs";import{mkdir as MJ,readFile as jJ,rm as d,writeFile as r}from"fs/promises";import{join as p}from"path";import{z as P}from"zod/v4";function yJ(J){return J.replace(/[^a-zA-Z0-9]/g,"-").toLowerCase()}function kQ(J){return J.replace(/@/g,"-")}function b(J){return p(l(),yJ(J))}function c(J){return p(b(J),"config.json")}function E(J){try{let Q=kJ(c(J),"utf-8");return y(Q)}catch(Q){if(x(Q)==="ENOENT")return null;return G(`[TeammateTool] Failed to read team file for ${J}: ${W(Q)}`),null}}async function wJ(J){try{let Q=await jJ(c(J),"utf-8");return y(Q)}catch(Q){if(x(Q)==="ENOENT")return null;return G(`[TeammateTool] Failed to read team file for ${J}: ${W(Q)}`),null}}function S(J,Q){let V=b(J);nJ(V,{recursive:!0}),dJ(c(J),v(Q,null,2))}async function rJ(J,Q){let V=b(J);await MJ(V,{recursive:!0}),await r(c(J),v(Q,null,2))}async function dQ(J,Q){let V=b(J),X=c(J),Z=`${X}.lock`;await MJ(V,{recursive:!0});try{await r(X,"{}",{encoding:"utf-8",flag:"wx"})}catch($){if(x($)!=="EEXIST")throw $}let Y=await U(X,{lockfilePath:Z,retries:{retries:10,minTimeout:5,maxTimeout:100}});try{let $=await wJ(J);if(!$||!Array.isArray($.members))throw Error(`Team "${J}" does not exist`);let q=Q($)??$;return await r(X,v(q,null,2)),q}finally{await Y()}}function rQ(J,Q){let V=Q.agentId||Q.name;if(!V)return G("[TeammateTool] removeTeammateFromTeamFile called with no identifier"),!1;let X=E(J);if(!X)return G(`[TeammateTool] Cannot remove teammate ${V}: failed to read team file for "${J}"`),!1;let Z=X.members.length;if(X.members=X.members.filter((Y)=>{if(Q.agentId&&Y.agentId===Q.agentId)return!1;if(Q.name&&Y.name===Q.name)return!1;return!0}),X.members.length===Z)return G(`[TeammateTool] Teammate ${V} not found in team file for "${J}"`),!1;return S(J,X),G(`[TeammateTool] Removed teammate from team file: ${V}`),!0}function iQ(J,Q){let V=E(J);if(!V)return!1;let X=V.hiddenPaneIds??[];if(!X.includes(Q))X.push(Q),V.hiddenPaneIds=X,S(J,V),G(`[TeammateTool] Added ${Q} to hidden panes for team ${J}`);return!0}function mQ(J,Q){let V=E(J);if(!V)return!1;let X=V.hiddenPaneIds??[],Z=X.indexOf(Q);if(Z!==-1)X.splice(Z,1),V.hiddenPaneIds=X,S(J,V),G(`[TeammateTool] Removed ${Q} from hidden panes for team ${J}`);return!0}function sQ(J,Q){let V=E(J);if(!V)return!1;let X=V.members.findIndex((Z)=>Z.tmuxPaneId===Q);if(X===-1)return!1;if(V.members.splice(X,1),V.hiddenPaneIds){let Z=V.hiddenPaneIds.indexOf(Q);if(Z!==-1)V.hiddenPaneIds.splice(Z,1)}return S(J,V),G(`[TeammateTool] Removed member with pane ${Q} from team ${J}`),!0}function tQ(J,Q){let V=E(J);if(!V)return!1;let X=V.members.findIndex((Z)=>Z.agentId===Q);if(X===-1)return!1;return V.members.splice(X,1),S(J,V),G(`[TeammateTool] Removed member ${Q} from team ${J}`),!0}function iJ(J,Q,V){let X=E(J);if(!X)return!1;let Z=X.members.find(($)=>$.name===Q);if(!Z)return G(`[TeammateTool] Cannot set member mode: member ${Q} not found in team ${J}`),!1;if(Z.mode===V)return!0;let Y=X.members.map(($)=>$.name===Q?{...$,mode:V}:$);return S(J,{...X,members:Y}),G(`[TeammateTool] Set member ${Q} in team ${J} to mode: ${V}`),!0}function aQ(J,Q){if(!zJ())return;let V=Q??h(),X=SJ();if(V&&X)iJ(V,X,J)}function eQ(J,Q){let V=E(J);if(!V)return!1;let X=new Map(Q.map(($)=>[$.memberName,$.mode])),Z=!1,Y=V.members.map(($)=>{let q=X.get($.name);if(q!==void 0&&$.mode!==q)return Z=!0,{...$,mode:q};return $});if(Z)S(J,{...V,members:Y}),G(`[TeammateTool] Set ${Q.length} member modes in team ${J}`);return!0}async function JV(J,Q,V){let X=await wJ(J);if(!X){G(`[TeammateTool] Cannot set member active: team ${J} not found`);return}let Z=X.members.find((Y)=>Y.name===Q);if(!Z){G(`[TeammateTool] Cannot set member active: member ${Q} not found in team ${J}`);return}if(Z.isActive===V)return;Z.isActive=V,await rJ(J,X),G(`[TeammateTool] Set member ${Q} in team ${J} to ${V?"active":"idle"}`)}async function mJ(J){let Q=p(J,".git"),V=null;try{let Z=(await jJ(Q,"utf-8")).trim().match(/^gitdir:\s*(.+)$/);if(Z&&Z[1]){let Y=Z[1],$=p(Y,"..","..");V=p($,"..")}}catch{}if(V){let X=await xJ(vJ(),["worktree","remove","--force",J],{cwd:V});if(X.code===0){G(`[TeammateTool] Removed worktree via git: ${J}`);return}if(X.stderr?.includes("not a working tree")){G(`[TeammateTool] Worktree already removed: ${J}`);return}G(`[TeammateTool] git worktree remove failed, falling back to rm: ${X.stderr}`)}try{await d(J,{recursive:!0,force:!0}),G(`[TeammateTool] Removed worktree directory manually: ${J}`)}catch(X){G(`[TeammateTool] Failed to remove worktree ${J}: ${W(X)}`)}}function QV(J){N().add(J)}function VV(J){N().delete(J)}async function XV(){let J=N();if(J.size===0)return;let Q=Array.from(J);G(`cleanupSessionTeams: removing ${Q.length} orphan team dir(s): ${Q.join(", ")}`),await Promise.allSettled(Q.map((V)=>sJ(V))),await Promise.allSettled(Q.map((V)=>tJ(V))),J.clear()}async function sJ(J){let Q=E(J);if(!Q)return;let V=Q.members.filter((q)=>q.name!==AJ&&q.tmuxPaneId&&q.backendType&&k(q.backendType));if(V.length===0)return;let[{ensureBackendsRegistered:X,getBackendByType:Z},{isInsideTmux:Y}]=await Promise.all([import("./registry-fp7x9ekd.js"),import("./detection-1yb2c7hh.js")]);await X();let $=!await Y();await Promise.allSettled(V.map(async(q)=>{if(!q.tmuxPaneId||!q.backendType||!k(q.backendType))return;let K=await Z(q.backendType).killPane(q.tmuxPaneId,$);G(`cleanupSessionTeams: killPane ${q.name} (${q.backendType} ${q.tmuxPaneId}) \u2192 ${K}`)}))}async function tJ(J){let Q=yJ(J),V=E(J),X=[];if(V){for(let $ of V.members)if($.worktreePath)X.push($.worktreePath)}for(let $ of X)await mJ($);let Z=b(J);try{await d(Z,{recursive:!0,force:!0}),G(`[TeammateTool] Cleaned up team directory: ${Z}`)}catch($){G(`[TeammateTool] Failed to clean up team directory ${Z}: ${W($)}`)}let Y=H(Q);try{await d(Y,{recursive:!0,force:!0}),G(`[TeammateTool] Cleaned up tasks directory: ${Y}`),B()}catch($){G(`[TeammateTool] Failed to clean up tasks directory ${Y}: ${W($)}`)}}var nQ;var aJ=I(()=>{t();XJ();JJ();QJ();lJ();gJ();YJ();ZJ();VJ();BJ();qJ();OJ();oJ();nQ=w(()=>P.strictObject({operation:P.enum(["spawnTeam","cleanup"]).describe("Operation: spawnTeam to create a team, cleanup to remove team and task directories."),agent_type:P.string().optional().describe('Type/role of the team lead (e.g., "researcher", "test-runner"). Used for team file and inter-agent coordination.'),team_name:P.string().optional().describe("Name for the new team to create (required for spawnTeam)."),description:P.string().optional().describe("Team description/purpose (only used with spawnTeam).")}))});
|
|
2
|
+
import{YR as AJ,dS as oJ}from"./cli-a25jeqs8.js";import{D4 as qJ,f4 as PJ,g4 as U,k4 as ZJ,l4 as $J,p4 as bJ,t4 as SJ,u4 as h,v4 as zJ}from"./cli-r43jhzwm.js";import{$4 as w,a5 as YJ}from"./cli-t5ddsvmv.js";import{C7 as gJ,f7 as vJ}from"./cli-yb5m6jwq.js";import{J7 as xJ,K7 as lJ}from"./cli-7wxv39ry.js";import{G8 as L,L8 as fJ}from"./cli-8kpqq0ea.js";import{A_ as XJ,Z9 as W,_9 as x,d_ as QJ,f_ as v,g_ as y,j_ as VJ,x_ as G}from"./cli-awb77t95.js";import{H_ as a,I_ as l,K_ as e,U_ as JJ}from"./cli-q8zmmp6z.js";import{Vaa as s,dda as t,e$ as i,f$ as DJ,g$ as m,qca as N}from"./cli-tafg3e9w.js";import{hda as I,ida as CJ}from"./cli-qwx84m9c.js";import{mkdir as cJ,readdir as g,readFile as GJ,unlink as KJ,writeFile as u}from"fs/promises";import{join as D}from"path";import{z as _}from"zod/v4";function EQ(J){if(M===J)return;M=J,B()}function UQ(){if(M===void 0)return;M=void 0,B()}function B(){try{RJ.emit()}catch{}}function _J(J){return D(H(J),uJ)}async function o(J){let Q=_J(J);try{let V=(await GJ(Q,"utf-8")).trim(),X=parseInt(V,10);return isNaN(X)?0:X}catch{return 0}}async function WJ(J,Q){let V=_J(J);await u(V,String(Q))}function OQ(){if(e(process.env.CLAUDE_CODE_ENABLE_TASKS))return!0;return!s()}async function CQ(J){let Q=H(J),V=await n(J),X;try{X=await U(V,f);let Z=await EJ(J);if(Z>0){let $=await o(J);if(Z>$)await WJ(J,Z)}let Y;try{Y=await g(Q)}catch{Y=[]}for(let $ of Y)if($.endsWith(".json")&&!$.startsWith(".")){let q=D(Q,$);try{await KJ(q)}catch{}}B()}finally{if(X)await X()}}function xQ(){if(process.env.CLAUDE_CODE_TASK_LIST_ID)return process.env.CLAUDE_CODE_TASK_LIST_ID;let J=$J();if(J)return J.teamName;return h()||M||m()}function HJ(J){return J.replace(/[^a-zA-Z0-9_-]/g,"-")}function H(J){return D(a(),"tasks",HJ(J))}function z(J,Q){return D(H(J),`${HJ(Q)}.json`)}async function FJ(J){let Q=H(J);try{await cJ(Q,{recursive:!0})}catch{}}async function EJ(J){let Q=H(J),V;try{V=await g(Q)}catch{return 0}let X=0;for(let Z of V){if(!Z.endsWith(".json"))continue;let Y=parseInt(Z.replace(".json",""),10);if(!isNaN(Y)&&Y>X)X=Y}return X}async function NJ(J){let[Q,V]=await Promise.all([EJ(J),o(J)]);return Math.max(Q,V)}async function vQ(J,Q){let V=await n(J),X;try{X=await U(V,f);let Z=await NJ(J),Y=String(Z+1),$={id:Y,...Q},q=z(J,Y);return await u(q,v($,null,2)),B(),Y}finally{if(X)await X()}}async function C(J,Q){let V=z(J,Q);try{let X=await GJ(V,"utf-8"),Z=y(X);if(process.env.USER_TYPE==="ant"){if(Z.status==="open")Z.status="pending";else if(Z.status==="resolved")Z.status="completed";else if(Z.status&&["planning","implementing","reviewing","verifying"].includes(Z.status))Z.status="in_progress"}let Y=hJ().safeParse(Z);if(!Y.success)return G(`[Tasks] Task ${Q} failed schema validation: ${Y.error.message}`),null;return Y.data}catch(X){if(x(X)==="ENOENT")return null;return G(`[Tasks] Failed to read task ${Q}: ${W(X)}`),L(X),null}}async function UJ(J,Q,V){let X=await C(J,Q);if(!X)return null;let Z={...X,...V,id:Q},Y=z(J,Q);return await u(Y,v(Z,null,2)),B(),Z}async function j(J,Q,V){let X=z(J,Q);if(!await C(J,Q))return null;let Y;try{return Y=await U(X,f),await UJ(J,Q,V)}finally{await Y?.()}}async function SQ(J,Q){let V=z(J,Q);try{let X=parseInt(Q,10);if(!isNaN(X)){let Y=await o(J);if(X>Y)await WJ(J,X)}try{await KJ(V)}catch(Y){if(x(Y)==="ENOENT")return!1;throw Y}let Z=await F(J);for(let Y of Z){let $=Y.blocks.filter((K)=>K!==Q),q=Y.blockedBy.filter((K)=>K!==Q);if($.length!==Y.blocks.length||q.length!==Y.blockedBy.length)await j(J,Y.id,{blocks:$,blockedBy:q})}return B(),!0}catch{return!1}}async function F(J){let Q=H(J),V;try{V=await g(Q)}catch{return[]}let X=V.filter((Y)=>Y.endsWith(".json")).map((Y)=>Y.replace(".json",""));return(await Promise.all(X.map((Y)=>C(J,Y)))).filter((Y)=>Y!==null)}async function zQ(J,Q,V){let[X,Z]=await Promise.all([C(J,Q),C(J,V)]);if(!X||!Z)return!1;if(!X.blocks.includes(V))await j(J,Q,{blocks:[...X.blocks,V]});if(!Z.blockedBy.includes(Q))await j(J,V,{blockedBy:[...Z.blockedBy,Q]});return!0}function TJ(J){return D(H(J),".lock")}async function n(J){await FJ(J);let Q=TJ(J);try{await u(Q,"",{flag:"wx"})}catch{}return Q}async function AQ(J,Q,V,X={}){let Z=z(J,Q);if(!await C(J,Q))return{success:!1,reason:"task_not_found"};if(X.checkAgentBusy)return IJ(J,Q,V);let $;try{$=await U(Z,f);let q=await C(J,Q);if(!q)return{success:!1,reason:"task_not_found"};if(q.owner&&q.owner!==V)return{success:!1,reason:"already_claimed",task:q};if(q.status==="completed")return{success:!1,reason:"already_resolved",task:q};let K=await F(J),O=new Set(K.filter((A)=>A.status!=="completed").map((A)=>A.id)),T=q.blockedBy.filter((A)=>O.has(A));if(T.length>0)return{success:!1,reason:"blocked",task:q,blockedByTasks:T};return{success:!0,task:await UJ(J,Q,{owner:V})}}catch(q){return G(`[Tasks] Failed to claim task ${Q}: ${W(q)}`),L(q),{success:!1,reason:"task_not_found"}}finally{if($)await $()}}async function IJ(J,Q,V){let X=await n(J),Z;try{Z=await U(X,f);let Y=await F(J),$=Y.find((R)=>R.id===Q);if(!$)return{success:!1,reason:"task_not_found"};if($.owner&&$.owner!==V)return{success:!1,reason:"already_claimed",task:$};if($.status==="completed")return{success:!1,reason:"already_resolved",task:$};let q=new Set(Y.filter((R)=>R.status!=="completed").map((R)=>R.id)),K=$.blockedBy.filter((R)=>q.has(R));if(K.length>0)return{success:!1,reason:"blocked",task:$,blockedByTasks:K};let O=Y.filter((R)=>R.status!=="completed"&&R.owner===V&&R.id!==Q);if(O.length>0)return{success:!1,reason:"agent_busy",task:$,busyWithTasks:O.map((R)=>R.id)};return{success:!0,task:await j(J,Q,{owner:V})}}catch(Y){return G(`[Tasks] Failed to claim task ${Q} with busy check: ${W(Y)}`),L(Y),{success:!1,reason:"task_not_found"}}finally{if(Z)await Z()}}async function MQ(J,Q,V,X){let Y=(await F(J)).filter((K)=>K.status!=="completed"&&(K.owner===Q||K.owner===V));for(let K of Y)await j(J,K.id,{owner:void 0,status:"pending"});if(Y.length>0)G(`[Tasks] Unassigned ${Y.length} task(s) from ${V}`);let q=`${V} ${X==="terminated"?"was terminated":"has shut down"}.`;if(Y.length>0){let K=Y.map((O)=>`#${O.id} "${O.subject}"`).join(", ");q+=` ${Y.length} task(s) were unassigned: ${K}. Use TaskList to check availability and TaskUpdate with owner to reassign them to idle teammates.`}return{unassignedTasks:Y.map((K)=>({id:K.id,subject:K.subject})),notificationMessage:q}}var RJ,M,BQ,LJ,hJ,uJ=".highwatermark",f,jQ="tasklist";var BJ=I(()=>{t();PJ();XJ();JJ();QJ();YJ();ZJ();fJ();DJ();VJ();qJ();bJ();RJ=i();BQ=RJ.subscribe;LJ=w(()=>_.enum(["pending","in_progress","completed"])),hJ=w(()=>_.object({id:_.string(),subject:_.string(),description:_.string(),activeForm:_.string().optional(),owner:_.string().optional(),status:LJ(),blocks:_.array(_.string()),blockedBy:_.array(_.string()),metadata:_.record(_.string(),_.unknown()).optional()})),f={retries:{retries:30,minTimeout:5,maxTimeout:100}}});function k(J){return J==="tmux"||J==="iterm2"}var OJ=()=>{};import{mkdirSync as nJ,readFileSync as kJ,writeFileSync as dJ}from"fs";import{mkdir as MJ,readFile as jJ,rm as d,writeFile as r}from"fs/promises";import{join as p}from"path";import{z as P}from"zod/v4";function yJ(J){return J.replace(/[^a-zA-Z0-9]/g,"-").toLowerCase()}function kQ(J){return J.replace(/@/g,"-")}function b(J){return p(l(),yJ(J))}function c(J){return p(b(J),"config.json")}function E(J){try{let Q=kJ(c(J),"utf-8");return y(Q)}catch(Q){if(x(Q)==="ENOENT")return null;return G(`[TeammateTool] Failed to read team file for ${J}: ${W(Q)}`),null}}async function wJ(J){try{let Q=await jJ(c(J),"utf-8");return y(Q)}catch(Q){if(x(Q)==="ENOENT")return null;return G(`[TeammateTool] Failed to read team file for ${J}: ${W(Q)}`),null}}function S(J,Q){let V=b(J);nJ(V,{recursive:!0}),dJ(c(J),v(Q,null,2))}async function rJ(J,Q){let V=b(J);await MJ(V,{recursive:!0}),await r(c(J),v(Q,null,2))}async function dQ(J,Q){let V=b(J),X=c(J),Z=`${X}.lock`;await MJ(V,{recursive:!0});try{await r(X,"{}",{encoding:"utf-8",flag:"wx"})}catch($){if(x($)!=="EEXIST")throw $}let Y=await U(X,{lockfilePath:Z,retries:{retries:10,minTimeout:5,maxTimeout:100}});try{let $=await wJ(J);if(!$||!Array.isArray($.members))throw Error(`Team "${J}" does not exist`);let q=Q($)??$;return await r(X,v(q,null,2)),q}finally{await Y()}}function rQ(J,Q){let V=Q.agentId||Q.name;if(!V)return G("[TeammateTool] removeTeammateFromTeamFile called with no identifier"),!1;let X=E(J);if(!X)return G(`[TeammateTool] Cannot remove teammate ${V}: failed to read team file for "${J}"`),!1;let Z=X.members.length;if(X.members=X.members.filter((Y)=>{if(Q.agentId&&Y.agentId===Q.agentId)return!1;if(Q.name&&Y.name===Q.name)return!1;return!0}),X.members.length===Z)return G(`[TeammateTool] Teammate ${V} not found in team file for "${J}"`),!1;return S(J,X),G(`[TeammateTool] Removed teammate from team file: ${V}`),!0}function iQ(J,Q){let V=E(J);if(!V)return!1;let X=V.hiddenPaneIds??[];if(!X.includes(Q))X.push(Q),V.hiddenPaneIds=X,S(J,V),G(`[TeammateTool] Added ${Q} to hidden panes for team ${J}`);return!0}function mQ(J,Q){let V=E(J);if(!V)return!1;let X=V.hiddenPaneIds??[],Z=X.indexOf(Q);if(Z!==-1)X.splice(Z,1),V.hiddenPaneIds=X,S(J,V),G(`[TeammateTool] Removed ${Q} from hidden panes for team ${J}`);return!0}function sQ(J,Q){let V=E(J);if(!V)return!1;let X=V.members.findIndex((Z)=>Z.tmuxPaneId===Q);if(X===-1)return!1;if(V.members.splice(X,1),V.hiddenPaneIds){let Z=V.hiddenPaneIds.indexOf(Q);if(Z!==-1)V.hiddenPaneIds.splice(Z,1)}return S(J,V),G(`[TeammateTool] Removed member with pane ${Q} from team ${J}`),!0}function tQ(J,Q){let V=E(J);if(!V)return!1;let X=V.members.findIndex((Z)=>Z.agentId===Q);if(X===-1)return!1;return V.members.splice(X,1),S(J,V),G(`[TeammateTool] Removed member ${Q} from team ${J}`),!0}function iJ(J,Q,V){let X=E(J);if(!X)return!1;let Z=X.members.find(($)=>$.name===Q);if(!Z)return G(`[TeammateTool] Cannot set member mode: member ${Q} not found in team ${J}`),!1;if(Z.mode===V)return!0;let Y=X.members.map(($)=>$.name===Q?{...$,mode:V}:$);return S(J,{...X,members:Y}),G(`[TeammateTool] Set member ${Q} in team ${J} to mode: ${V}`),!0}function aQ(J,Q){if(!zJ())return;let V=Q??h(),X=SJ();if(V&&X)iJ(V,X,J)}function eQ(J,Q){let V=E(J);if(!V)return!1;let X=new Map(Q.map(($)=>[$.memberName,$.mode])),Z=!1,Y=V.members.map(($)=>{let q=X.get($.name);if(q!==void 0&&$.mode!==q)return Z=!0,{...$,mode:q};return $});if(Z)S(J,{...V,members:Y}),G(`[TeammateTool] Set ${Q.length} member modes in team ${J}`);return!0}async function JV(J,Q,V){let X=await wJ(J);if(!X){G(`[TeammateTool] Cannot set member active: team ${J} not found`);return}let Z=X.members.find((Y)=>Y.name===Q);if(!Z){G(`[TeammateTool] Cannot set member active: member ${Q} not found in team ${J}`);return}if(Z.isActive===V)return;Z.isActive=V,await rJ(J,X),G(`[TeammateTool] Set member ${Q} in team ${J} to ${V?"active":"idle"}`)}async function mJ(J){let Q=p(J,".git"),V=null;try{let Z=(await jJ(Q,"utf-8")).trim().match(/^gitdir:\s*(.+)$/);if(Z&&Z[1]){let Y=Z[1],$=p(Y,"..","..");V=p($,"..")}}catch{}if(V){let X=await xJ(vJ(),["worktree","remove","--force",J],{cwd:V});if(X.code===0){G(`[TeammateTool] Removed worktree via git: ${J}`);return}if(X.stderr?.includes("not a working tree")){G(`[TeammateTool] Worktree already removed: ${J}`);return}G(`[TeammateTool] git worktree remove failed, falling back to rm: ${X.stderr}`)}try{await d(J,{recursive:!0,force:!0}),G(`[TeammateTool] Removed worktree directory manually: ${J}`)}catch(X){G(`[TeammateTool] Failed to remove worktree ${J}: ${W(X)}`)}}function QV(J){N().add(J)}function VV(J){N().delete(J)}async function XV(){let J=N();if(J.size===0)return;let Q=Array.from(J);G(`cleanupSessionTeams: removing ${Q.length} orphan team dir(s): ${Q.join(", ")}`),await Promise.allSettled(Q.map((V)=>sJ(V))),await Promise.allSettled(Q.map((V)=>tJ(V))),J.clear()}async function sJ(J){let Q=E(J);if(!Q)return;let V=Q.members.filter((q)=>q.name!==AJ&&q.tmuxPaneId&&q.backendType&&k(q.backendType));if(V.length===0)return;let[{ensureBackendsRegistered:X,getBackendByType:Z},{isInsideTmux:Y}]=await Promise.all([import("./registry-d7cd5dqg.js"),import("./detection-z3cdks0s.js")]);await X();let $=!await Y();await Promise.allSettled(V.map(async(q)=>{if(!q.tmuxPaneId||!q.backendType||!k(q.backendType))return;let K=await Z(q.backendType).killPane(q.tmuxPaneId,$);G(`cleanupSessionTeams: killPane ${q.name} (${q.backendType} ${q.tmuxPaneId}) \u2192 ${K}`)}))}async function tJ(J){let Q=yJ(J),V=E(J),X=[];if(V){for(let $ of V.members)if($.worktreePath)X.push($.worktreePath)}for(let $ of X)await mJ($);let Z=b(J);try{await d(Z,{recursive:!0,force:!0}),G(`[TeammateTool] Cleaned up team directory: ${Z}`)}catch($){G(`[TeammateTool] Failed to clean up team directory ${Z}: ${W($)}`)}let Y=H(Q);try{await d(Y,{recursive:!0,force:!0}),G(`[TeammateTool] Cleaned up tasks directory: ${Y}`),B()}catch($){G(`[TeammateTool] Failed to clean up tasks directory ${Y}: ${W($)}`)}}var nQ;var aJ=I(()=>{t();XJ();JJ();QJ();lJ();gJ();YJ();ZJ();VJ();BJ();qJ();OJ();oJ();nQ=w(()=>P.strictObject({operation:P.enum(["spawnTeam","cleanup"]).describe("Operation: spawnTeam to create a team, cleanup to remove team and task directories."),agent_type:P.string().optional().describe('Type/role of the team lead (e.g., "researcher", "test-runner"). Used for team file and inter-agent coordination.'),team_name:P.string().optional().describe("Name for the new team to create (required for spawnTeam)."),description:P.string().optional().describe("Team description/purpose (only used with spawnTeam).")}))});
|
|
3
3
|
export{EQ as gM,UQ as hM,BQ as iM,LJ as jM,OQ as kM,CQ as lM,xQ as mM,HJ as nM,H as oM,FJ as pM,vQ as qM,C as rM,j as sM,SQ as tM,F as uM,zQ as vM,AQ as wM,MQ as xM,jQ as yM,BJ as zM,k as AM,OJ as BM,nQ as CM,yJ as DM,kQ as EM,b as FM,c as GM,E as HM,wJ as IM,rJ as JM,dQ as KM,rQ as LM,iQ as MM,mQ as NM,sQ as OM,tQ as PM,iJ as QM,aQ as RM,eQ as SM,JV as TM,QV as UM,VV as VM,XV as WM,tJ as XM,aJ as YM};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{j as
|
|
2
|
+
import{C7 as _,n7 as Q}from"./cli-yb5m6jwq.js";import{N7 as I,O7 as X}from"./cli-fnt125we.js";import{A_ as V,x_ as B}from"./cli-awb77t95.js";import{hda as T}from"./cli-qwx84m9c.js";function j(){A.clear()}async function P(){let f=await Y();if(!f)return null;if(f.host!=="github.com")return null;return`${f.owner}/${f.name}`}async function Y(){let f=I();if(A.has(f))return A.get(f)??null;try{let q=await Q();if(B(`Git remote URL: ${q}`),!q)return B("No git remote URL found"),A.set(f,null),null;let x=O(q);return B(`Parsed repository: ${x?`${x.host}/${x.owner}/${x.name}`:null} from URL: ${q}`),A.set(f,x),x}catch(q){return B(`Error detecting repository: ${q}`),A.set(f,null),null}}function S(){let f=A.get(I());if(!f||f.host!=="github.com")return null;return`${f.owner}/${f.name}`}function O(f){let q=f.trim(),x=q.match(/^git@([^:]+):([^/]+)\/([^/]+?)(?:\.git)?$/);if(x?.[1]&&x[2]&&x[3]){if(!N(x[1]))return null;return{host:x[1],owner:x[2],name:x[3]}}let z=q.match(/^(https?|ssh|git):\/\/(?:[^@]+@)?([^/:]+(?::\d+)?)\/([^/]+)\/([^/]+?)(?:\.git)?$/);if(z?.[1]&&z[2]&&z[3]&&z[4]){let E=z[1],J=z[2],K=J.split(":")[0]??"";if(!N(K))return null;return{host:E==="https"||E==="http"?J:K,owner:z[3],name:z[4]}}return null}function D(f){let q=f.trim(),x=O(q);if(x){if(x.host!=="github.com")return null;return`${x.owner}/${x.name}`}if(!q.includes("://")&&!q.includes("@")&&q.includes("/")){let z=q.split("/");if(z.length===2&&z[0]&&z[1]){let E=z[1].replace(/\.git$/,"");return`${z[0]}/${E}`}}return B(`Could not parse repository from: ${q}`),null}function N(f){if(!f.includes("."))return!1;let q=f.split(".").pop();if(!q)return!1;return/^[a-zA-Z]+$/.test(q)}var A;var Z=T(()=>{X();V();_();A=new Map});
|
|
3
|
+
export{j as J6,P as K6,Y as L6,S as M6,O as N6,D as O6,Z as P6};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{M as
|
|
2
|
+
import{dda as E,m$ as m,q$ as q}from"./cli-tafg3e9w.js";import{hda as D}from"./cli-qwx84m9c.js";import{AsyncLocalStorage as F}from"async_hooks";function M(z,B){return x.run(z,B)}function H(){return x.getStore()??q()}function N(){try{return H()}catch{return m()}}var x;var I=D(()=>{E();x=new F});
|
|
3
|
+
export{M as L7,H as M7,N as N7,I as O7};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fda as B}from"./cli-w1d8n9g3.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{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(`
|
|
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===`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ch as O,Fh as f,ci as j,hi as qq,ym as M,zm as g}from"./cli-
|
|
2
|
+
import{Ch as O,Fh as f,ci as j,hi as qq,ym as M,zm as g}from"./cli-b3k8arn1.js";import{F1 as u,NW as p,Q2 as G,a3 as y,b1 as F,m1 as D,zW as k}from"./cli-192xnkcx.js";import{$4 as V,a5 as b}from"./cli-t5ddsvmv.js";import{G8 as S,L8 as e,l8 as H,q8 as o}from"./cli-8kpqq0ea.js";import{A_ as t,f_ as P,g_ as I,j_ as n,n_ as _,r_ as r,x_ as N}from"./cli-awb77t95.js";import{Mca as C,dda as d}from"./cli-tafg3e9w.js";import{hda as Y}from"./cli-qwx84m9c.js";import{z as B}from"zod/v4";function v(){let q=G("tengu_harbor_ledger",[]),J=h().safeParse(q);return J.success?J.data:[]}function w(){return G("tengu_harbor",!1)}var h;var z=Y(()=>{b();f();y();h=V(()=>B.array(B.object({marketplace:B.string(),plugin:B.string()})))});import{z as U}from"zod/v4";function kq(q,J,Q){let W=Object.entries(Q??{}).filter(([x])=>l.test(x)).map(([x,$])=>` ${x}="${M($)}"`).join("");return`<${H} source="${M(q)}"${W}>
|
|
3
3
|
${J}
|
|
4
4
|
</${H}>`}function i(q,J){if((q==="team"||q==="enterprise")&&J)return{entries:J,source:"org"};return{entries:v(),source:"ledger"}}function s(q,J){let Q=q.split(":");return J.find((W)=>W.kind==="server"?q===W.name:Q[0]==="plugin"&&Q[1]===W.name)}function Fq(q,J,Q){if(!J?.experimental?.["claude/channel"])return{action:"skip",kind:"capability",reason:"server did not declare claude/channel capability"};if(!w())return{action:"skip",kind:"disabled",reason:"channels feature is not currently available"};if(!F()?.accessToken)return{action:"skip",kind:"auth",reason:"channels requires claude.ai authentication (run /login)"};let W=D(),x=W==="team"||W==="enterprise",$=x?k("policySettings"):void 0;if(x&&$?.channelsEnabled!==!0)return{action:"skip",kind:"policy",reason:"channels not enabled by org policy (set channelsEnabled: true in managed settings)"};let Z=s(q,C());if(!Z)return{action:"skip",kind:"session",reason:`server ${q} not in --channels list for this session`};if(Z.kind==="plugin"){let L=Q?O(Q).marketplace:void 0;if(L!==Z.marketplace)return{action:"skip",kind:"marketplace",reason:`you asked for plugin:${Z.name}@${Z.marketplace} but the installed ${Z.name} plugin is from ${L??"an unknown source"}`};if(!Z.dev){let{entries:E,source:m}=i(W,$?.allowedChannelPlugins);if(!E.some((T)=>T.plugin===Z.name&&T.marketplace===Z.marketplace))return{action:"skip",kind:"allowlist",reason:m==="org"?`plugin ${Z.name}@${Z.marketplace} is not on your org's approved channels list (set allowedChannelPlugins in managed settings)`:`plugin ${Z.name}@${Z.marketplace} is not on the approved channels allowlist (use --dangerously-load-development-channels for local dev)`}}}else if(!Z.dev)return{action:"skip",kind:"allowlist",reason:`server ${Z.name} is not on the approved channels allowlist (use --dangerously-load-development-channels for local dev)`};return{action:"register"}}var zq,c="notifications/claude/channel/permission",Cq,l;var a=Y(()=>{d();o();u();b();f();p();g();z();zq=V(()=>U.object({method:U.literal("notifications/claude/channel"),params:U.object({content:U.string(),meta:U.record(U.string(),U.string()).optional()})})),Cq=V(()=>U.object({method:U.literal(c),params:U.object({request_id:U.string(),behavior:U.enum(["allow","deny"])})})),l=/^[a-zA-Z_][a-zA-Z0-9_]*$/});import{randomBytes as Jq}from"crypto";import{readFile as Qq,rename as Wq,unlink as Zq,writeFile as $q}from"fs/promises";import{join as xq}from"path";function A(){return xq(j(),Kq)}function Vq(q){let J=I(q);if(typeof J!=="object"||J===null||!("plugins"in J)||typeof J.plugins!=="object"||J.plugins===null)return{};let Q=J.plugins,W={};for(let[x,$]of Object.entries(Q))if($&&typeof $==="object"&&"flaggedAt"in $&&typeof $.flaggedAt==="string"){let Z={flaggedAt:$.flaggedAt};if("seenAt"in $&&typeof $.seenAt==="string")Z.seenAt=$.seenAt;W[x]=Z}return W}async function R(){try{let q=await Qq(A(),{encoding:"utf-8"});return Vq(q)}catch{return{}}}async function X(q){let J=A(),Q=`${J}.${Jq(8).toString("hex")}.tmp`;try{await _().mkdir(j());let W=P({plugins:q},null,2);await $q(Q,W,{encoding:"utf-8",mode:384}),await Wq(Q,J),K=q}catch(W){S(W);try{await Zq(Q)}catch{}}}async function yq(){let q=await R(),J=Date.now(),Q=!1;for(let[W,x]of Object.entries(q))if(x.seenAt&&J-new Date(x.seenAt).getTime()>=Uq)delete q[W],Q=!0;if(K=q,Q)await X(q)}function hq(){return K??{}}async function dq(q){if(K===null)K=await R();let J={...K,[q]:{flaggedAt:new Date().toISOString()}};await X(J),N(`Flagged plugin: ${q}`)}async function oq(q){if(K===null)K=await R();let J=new Date().toISOString(),Q=!1,W={...K};for(let x of q){let $=W[x];if($&&!$.seenAt)W[x]={...$,seenAt:J},Q=!0}if(Q)await X(W)}async function pq(q){if(K===null)K=await R();if(!(q in K))return;let{[q]:J,...Q}=K;K=Q,await X(Q)}var Kq="flagged-plugins.json",Uq=172800000,K=null;var Bq=Y(()=>{t();r();e();n();qq()});
|
|
5
5
|
export{z as id,zq as jd,kq as kd,s as ld,Fq as md,a as nd,yq as od,hq as pd,dq as qd,oq as rd,pq as sd,Bq as td};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ep as N,Fp as __,Jx as T,Kx as f_,Mq as V,NI as K_,Nq as w_,OI as P_,Ou as X,Pu as q_,dK as x,ew as h,jw as $_,oK as y,qK as E,rK as D,xK as O_}from"./cli-
|
|
2
|
+
import{Ep as N,Fp as __,Jx as T,Kx as f_,Mq as V,NI as K_,Nq as w_,OI as P_,Ou as X,Pu as q_,dK as x,ew as h,jw as $_,oK as y,qK as E,rK as D,xK as O_}from"./cli-b3k8arn1.js";import{YL as L,ZL as Q}from"./cli-4pwyex04.js";import{DQ as S,FQ as i,fR as U}from"./cli-a2d962bq.js";import{I7 as e,K7 as F}from"./cli-7wxv39ry.js";import{$8 as I,_8 as a}from"./cli-e5yek4vx.js";import{A_ as B,x_ as m}from"./cli-awb77t95.js";import{eda as g,hda as d}from"./cli-qwx84m9c.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,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{O4 as f}from"./cli-
|
|
2
|
+
import{O4 as f}from"./cli-601zv0wv.js";import{W4 as v}from"./cli-h2t2hyz7.js";import{A_ as S,K9 as I,L9 as D,M9 as z,O9 as b,f_ as _,j_ as P,n_ as $,r_ as w,x_ as x}from"./cli-awb77t95.js";import{H_ as U,K_ as F,U_ as C}from"./cli-q8zmmp6z.js";import{dda as O,g$ as B,m$ as E}from"./cli-tafg3e9w.js";O();D();b();S();C();w();f();P();import{appendFile as m,rename as u}from"fs/promises";import{basename as R,dirname as p,join as M}from"path";var A={filePath:null,timestamp:0};function j(){if(A.filePath!==null)return A.filePath;if(process.env.USER_TYPE!=="ant")return null;if(!F(process.env.CLAUDE_CODE_TERMINAL_RECORDING))return null;let q=M(U(),"projects"),K=M(q,v(E()));return A.timestamp=Date.now(),A.filePath=M(K,`${B()}-${A.timestamp}.cast`),A.filePath}function t(){A.filePath=null,A.timestamp=0}function r(){let q=B(),K=M(U(),"projects"),X=M(K,v(E()));try{let G=$().readdirSync(X);return(typeof G[0]==="string"?G:G.map((J)=>J.name)).filter((J)=>J.startsWith(q)&&J.endsWith(".cast")).sort().map((J)=>M(X,J))}catch{return[]}}async function e(){let q=A.filePath;if(!q||A.timestamp===0)return;let K=M(U(),"projects"),X=M(K,v(E())),G=M(X,`${B()}-${A.timestamp}.cast`);if(q===G)return;await Z?.flush();let Y=R(q),Q=R(G);try{await u(q,G),A.filePath=G,x(`[asciicast] Renamed recording: ${Y} \u2192 ${Q}`)}catch{x(`[asciicast] Failed to rename recording from ${Y} to ${Q}`)}}var Z=null;function T(){let q=process.stdout.columns||80,K=process.stdout.rows||24;return{cols:q,rows:K}}async function qq(){await Z?.flush()}function Aq(){let q=j();if(!q)return;let{cols:K,rows:X}=T(),G=performance.now(),Y=_({version:2,width:K,height:X,timestamp:Math.floor(Date.now()/1000),env:{SHELL:process.env.SHELL||"",TERM:process.env.TERM||""}});try{$().mkdirSync(p(q))}catch{}$().appendFileSync(q,Y+`
|
|
3
3
|
`,{mode:384});let Q=Promise.resolve(),J=I({writeFn(L){let V=A.filePath;if(!V)return;Q=Q.then(()=>m(V,L)).catch(()=>{})},flushIntervalMs:500,maxBufferSize:50,maxBufferBytes:10485760}),H=process.stdout.write.bind(process.stdout);process.stdout.write=function(L,V,N){let W=(performance.now()-G)/1000,k=typeof L==="string"?L:Buffer.from(L).toString("utf-8");if(J.write(_([W,"o",k])+`
|
|
4
4
|
`),typeof V==="function")return H(L,V);return H(L,V,N)};function y(){let L=(performance.now()-G)/1000,{cols:V,rows:N}=T();J.write(_([L,"r",`${V}x${N}`])+`
|
|
5
5
|
`)}process.stdout.on("resize",y),Z={async flush(){J.flush(),await Q},async dispose(){J.dispose(),await Q,process.stdout.removeListener("resize",y),process.stdout.write=H}},z(async()=>{await Z?.dispose(),Z=null}),x(`[asciicast] Recording to ${q}`)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{M8 as F,P8 as x}from"./cli-z2ewnqgr.js";import{H_ as M,U_ as I}from"./cli-q8zmmp6z.js";import{hda as z}from"./cli-qwx84m9c.js";import{execFile as D}from"child_process";import{promisify as A}from"util";async function R(q){try{let{stdout:Q}=await m("git",["worktree","list","--porcelain"],{cwd:q,timeout:5000});if(!Q)return[];return Q.split(`
|
|
3
3
|
`).filter((V)=>V.startsWith("worktree ")).map((V)=>V.slice(9).normalize("NFC"))}catch{return[]}}var m;var U=z(()=>{m=A(D)});import{open as N,readdir as e,realpath as t,stat as s}from"fs/promises";import{join as y}from"path";function Vq(q){if(typeof q!=="string")return null;return _.test(q)?q:null}function j(q){if(!q.includes("\\"))return q;try{return JSON.parse(`"${q}"`)}catch{return q}}function Yq(q,Q){let V=[`"${Q}":"`,`"${Q}": "`];for(let Y of V){let $=q.indexOf(Y);if($<0)continue;let J=$+Y.length,G=J;while(G<q.length){if(q[G]==="\\"){G+=2;continue}if(q[G]==='"')return j(q.slice(J,G));G++}}return}function Gq(q,Q){let V=[`"${Q}":"`,`"${Q}": "`],Y;for(let $ of V){let J=0;while(!0){let G=q.indexOf($,J);if(G<0)break;let K=G+$.length,v=K;while(v<q.length){if(q[v]==="\\"){v+=2;continue}if(q[v]==='"'){Y=j(q.slice(K,v));break}v++}J=v+1}}return Y}async function vq(q,Q,V){try{let Y=await N(q,"r");try{let $=await Y.read(V,0,g,0);if($.bytesRead===0)return{head:"",tail:""};let J=V.toString("utf8",0,$.bytesRead),G=Math.max(0,Q-g),K=J;if(G>0){let v=await Y.read(V,0,g,G);K=V.toString("utf8",0,v.bytesRead)}return{head:J,tail:K}}finally{await Y.close()}}catch{return{head:"",tail:""}}}function k(q){return Math.abs(F(q)).toString(36)}function Kq(q){let Q=q.replace(/[^a-zA-Z0-9]/g,"-");if(Q.length<=L)return Q;let V=typeof Bun<"u"?Bun.hash(q).toString(36):k(q);return`${Q.slice(0,L)}-${V}`}function Wq(){return y(M(),"projects")}function p(){return E??=Buffer.from('"compact_boundary"')}function w(q){try{let Q=JSON.parse(q);if(Q.type!=="system"||Q.subtype!=="compact_boundary")return null;return{hasPreservedSegment:Boolean(Q.compactMetadata?.preservedSegment)}}catch{return null}}function H(q,Q,V,Y){let $=Y-V;if($<=0)return;if(q.len+$>q.buf.length){let J=Buffer.allocUnsafe(Math.min(Math.max(q.buf.length*2,q.len+$),q.cap));q.buf.copy(J,0,0,q.len),q.buf=J}Q.copy(q.buf,q.len,V,Y),q.len+=$}function Z(q,Q,V,Y){return Y-V>=Q.length&&q.compare(Q,0,Q.length,V,V+Q.length)===0}function o(q,Q,V){if(q.straddleSnapCarryLen=0,q.straddleSnapTailEnd=0,q.carryLen===0)return 0;let Y=q.carryBuf,$=Q.indexOf(C);if($===-1||$>=V)return 0;let J=$+1;if(Z(Y,O,0,q.carryLen))q.straddleSnapCarryLen=q.carryLen,q.straddleSnapTailEnd=J,q.lastSnapSrc=null;else if(q.carryLen<O.length)return 0;else{if(Z(Y,S,0,q.carryLen)){let G=w(Y.toString("utf-8",0,q.carryLen)+Q.toString("utf-8",0,$));if(G?.hasPreservedSegment)q.hasPreservedSegment=!0;else if(G)q.out.len=0,q.boundaryStartOffset=q.bufFileOff,q.hasPreservedSegment=!1,q.lastSnapSrc=null}H(q.out,Y,0,q.carryLen),H(q.out,Q,0,J)}return q.bufFileOff+=q.carryLen+J,q.carryLen=0,J}function c(q,Q,V){let Y=Q.indexOf(V),$=0,J=0,G=-1,K=-1,v=Q.indexOf(C);while(v!==-1){let X=v+1;if(Y!==-1&&Y<J)Y=Q.indexOf(V,J);if(Z(Q,O,J,X))H(q.out,Q,$,J),G=J,K=X,$=X;else if(Y>=J&&Y<Math.min(J+h,X)){let W=w(Q.toString("utf-8",J,v));if(W?.hasPreservedSegment)q.hasPreservedSegment=!0;else if(W)q.out.len=0,q.boundaryStartOffset=q.bufFileOff+J,q.hasPreservedSegment=!1,q.lastSnapSrc=null,G=-1,q.straddleSnapCarryLen=0,$=J;Y=Q.indexOf(V,Y+V.length)}J=X,v=Q.indexOf(C,J)}return H(q.out,Q,$,J),{lastSnapStart:G,lastSnapEnd:K,trailStart:J}}function f(q,Q,V,Y,$){if(Y!==-1){if(q.lastSnapLen=$-Y,q.lastSnapBuf===void 0||q.lastSnapLen>q.lastSnapBuf.length)q.lastSnapBuf=Buffer.allocUnsafe(q.lastSnapLen);Q.copy(q.lastSnapBuf,0,Y,$),q.lastSnapSrc=q.lastSnapBuf}else if(q.straddleSnapCarryLen>0){if(q.lastSnapLen=q.straddleSnapCarryLen+q.straddleSnapTailEnd,q.lastSnapBuf===void 0||q.lastSnapLen>q.lastSnapBuf.length)q.lastSnapBuf=Buffer.allocUnsafe(q.lastSnapLen);q.carryBuf.copy(q.lastSnapBuf,0,0,q.straddleSnapCarryLen),V.copy(q.lastSnapBuf,q.straddleSnapCarryLen,0,q.straddleSnapTailEnd),q.lastSnapSrc=q.lastSnapBuf}}function u(q,Q,V){if(q.carryLen=Q.length-V,q.carryLen>0){if(q.carryBuf===void 0||q.carryLen>q.carryBuf.length)q.carryBuf=Buffer.allocUnsafe(q.carryLen);Q.copy(q.carryBuf,0,V,Q.length)}}function d(q){if(q.carryLen>0){let Q=q.carryBuf;if(Z(Q,O,0,q.carryLen))q.lastSnapSrc=Q,q.lastSnapLen=q.carryLen;else H(q.out,Q,0,q.carryLen)}if(q.lastSnapSrc){if(q.out.len>0&&q.out.buf[q.out.len-1]!==C)H(q.out,b,0,1);H(q.out,q.lastSnapSrc,0,q.lastSnapLen)}}async function Hq(q,Q){let V=p(),Y=P,$={out:{buf:Buffer.allocUnsafe(Math.min(Q,8388608)),len:0,cap:Q+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},J=Buffer.allocUnsafe(Y),G=await N(q,"r");try{let K=0;while(K<Q){let{bytesRead:v}=await G.read(J,0,Math.min(Y,Q-K),K);if(v===0)break;K+=v;let X=o($,J,v),W;if($.carryLen>0){let T=$.carryLen+(v-X);W=Buffer.allocUnsafe(T),$.carryBuf.copy(W,0,0,$.carryLen),J.copy(W,$.carryLen,X,v)}else W=J.subarray(X,v);let B=c($,W,V);f($,W,J,B.lastSnapStart,B.lastSnapEnd),u($,W,B.trailStart),$.bufFileOff+=B.trailStart}d($)}finally{await G.close()}return{boundaryStartOffset:$.boundaryStartOffset,postBoundaryBuf:$.out.buf.subarray(0,$.out.len),hasPreservedSegment:$.hasPreservedSegment}}var g=65536,_,L=200,P=1048576,Xq=5242880,E,O,S,C=10,b,h=256;var l=z(()=>{I();U();x();_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;O=Buffer.from('{"type":"attribution-snapshot"'),S=Buffer.from('{"type":"system"'),b=Buffer.from([C])});
|
|
4
4
|
export{R as P4,U as Q4,g as R4,Vq as S4,Yq as T4,Gq as U4,vq as V4,Kq as W4,Wq as X4,Xq as Y4,Hq as Z4,l as _4};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{kc as U,mc as B}from"./cli-
|
|
2
|
+
import{kc as U,mc as B}from"./cli-kx3r72jp.js";import{HK as V,Hk as L,IE as Q,Ik as q,JK as F,VE as w}from"./cli-b3k8arn1.js";import{T3 as K,Y3 as k}from"./cli-ca1jmr8f.js";import{A_ as $,Z9 as G,d_ as _,x_ as I}from"./cli-awb77t95.js";import{hda as Z}from"./cli-qwx84m9c.js";async function h(W,X){let E=U(W);if(!E)return null;try{let A=await V({systemPrompt:L(['Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.']),userPrompt:E,outputFormat:{type:"json_schema",schema:{type:"object",properties:{name:{type:"string"}},required:["name"],additionalProperties:!1}},signal:X,options:{querySource:"rename_generate_name",agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),Y=Q(A.message.content),z=K(Y);if(z&&typeof z==="object"&&"name"in z&&typeof z.name==="string")return z.name;return null}catch(A){return I(`generateSessionName failed: ${G(A)}`,{level:"error"}),null}}var D=Z(()=>{F();$();_();k();w();B();q()});
|
|
3
3
|
export{h as ic,D as jc};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{hda as K}from"./cli-qwx84m9c.js";function M(F,q,k){return new Promise((w,z)=>{if(q?.aborted){if(k?.throwOnAbort||k?.abortError)z(k.abortError?.()??Error("aborted"));else w();return}let B=setTimeout((G,H,I)=>{G?.removeEventListener("abort",H),I()},F,q,D,w);function D(){if(clearTimeout(B),k?.throwOnAbort||k?.abortError)z(k.abortError?.()??Error("aborted"));else w()}if(q?.addEventListener("abort",D,{once:!0}),k?.unref)B.unref()})}var L=()=>{};
|
|
3
3
|
export{M as D5,L as E5};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{F as
|
|
2
|
+
import{hda as H}from"./cli-qwx84m9c.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 C6,K as D6,M as E6,N as F6,O as G6,P as H6,J as I6};
|