@unieai/code 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (447) hide show
  1. package/README.md +18 -0
  2. package/dist/chunks/App-6wcwb5pc.js +2 -0
  3. package/dist/chunks/ApproveApiKey-d97zej3m.js +2 -0
  4. package/dist/chunks/{assistant-bmwndz7j.js → AssistantSessionChooser-vygv3jdr.js} +1 -1
  5. package/dist/chunks/BypassPermissionsModeDialog-p7yq2zap.js +2 -0
  6. package/dist/chunks/{ClaudeInChromeOnboarding-ckjppjhr.js → ClaudeInChromeOnboarding-n11q2368.js} +1 -1
  7. package/dist/chunks/ClaudeMdExternalIncludesDialog-6afdc75a.js +2 -0
  8. package/dist/chunks/ConsoleOAuthFlow-7na5hhyn.js +2 -0
  9. package/dist/chunks/{DiffDialog-ptnc4sgx.js → DiffDialog-0gfe5ew5.js} +1 -1
  10. package/dist/chunks/Doctor-q03grp6g.js +2 -0
  11. package/dist/chunks/Grove-2hdgsj42.js +2 -0
  12. package/dist/chunks/{ITermBackend-wgbbpgpy.js → ITermBackend-d4maa39x.js} +1 -1
  13. package/dist/chunks/{InProcessTransport-vgh7qgjn.js → InProcessTransport-7sr7467h.js} +1 -1
  14. package/dist/chunks/InvalidConfigDialog-qe8rkhkj.js +2 -0
  15. package/dist/chunks/InvalidSettingsDialog-tmhmy5tf.js +2 -0
  16. package/dist/chunks/Onboarding-hp8hb5kc.js +2 -0
  17. package/dist/chunks/REPL-5ppdjgag.js +2 -0
  18. package/dist/chunks/{ResumeConversation-ymc529y6.js → ResumeConversation-sr90x948.js} +1 -1
  19. package/dist/chunks/{SnapshotUpdateDialog-aya2c2f9.js → SnapshotUpdateDialog-wt6b6ee8.js} +1 -1
  20. package/dist/chunks/{TeleportProgress-kn3qgvd9.js → TeleportProgress-yv82g5fx.js} +1 -1
  21. package/dist/chunks/{TeleportRepoMismatchDialog-01v6e2qz.js → TeleportRepoMismatchDialog-hdzhp1cy.js} +1 -1
  22. package/dist/chunks/{TeleportResumeWrapper-48dsm503.js → TeleportResumeWrapper-m93f8nva.js} +1 -1
  23. package/dist/chunks/{TmuxBackend-s0bt8zqj.js → TmuxBackend-5ajj7r7b.js} +1 -1
  24. package/dist/chunks/ToolSearchTool-e8x4b1xy.js +2 -0
  25. package/dist/chunks/{TrustDialog-xtn3kq0n.js → TrustDialog-m74p2tm4.js} +1 -1
  26. package/dist/chunks/TungstenTool-3f5rj0vm.js +2 -0
  27. package/dist/chunks/{add-dir-z0kz5nf7.js → add-dir-fswbbep3.js} +1 -1
  28. package/dist/chunks/{agents-ex4cdx64.js → agents-ftrmk7h2.js} +1 -1
  29. package/dist/chunks/agents-wg0hfr30.js +4 -0
  30. package/dist/chunks/ant-claude-for-chrome-mcp-p12dy6z6.js +2 -0
  31. package/dist/chunks/api-94eda39h.js +2 -0
  32. package/dist/chunks/asciicast-ktxrxtw6.js +2 -0
  33. package/dist/chunks/{AssistantSessionChooser-wxmyvgcf.js → assistant-kae6ttkn.js} +1 -1
  34. package/dist/chunks/{auth-g2p039wk.js → auth-2kpz51np.js} +1 -1
  35. package/dist/chunks/auth-xw8gbsgb.js +2 -0
  36. package/dist/chunks/backgroundHousekeeping-zxf9qg70.js +2 -0
  37. package/dist/chunks/{branch-rdvbhvts.js → branch-takyqck5.js} +1 -1
  38. package/dist/chunks/{bridgePointer-9rqn5tp6.js → bridgePointer-73w5dbak.js} +1 -1
  39. package/dist/chunks/{btw-xts6twbq.js → btw-jdp39tx4.js} +1 -1
  40. package/dist/chunks/{buddy-yc09g048.js → buddy-m4zdx3bb.js} +1 -1
  41. package/dist/chunks/{cachedMicrocompact-fa2mdnyh.js → cachedMicrocompact-6agq4j15.js} +1 -1
  42. package/dist/chunks/caches-zfq2xyng.js +2 -0
  43. package/dist/chunks/{chrome-gb6g0d5p.js → chrome-6nn58sx4.js} +1 -1
  44. package/dist/chunks/{chromeNativeHost-jsntnc29.js → chromeNativeHost-zww6nc8m.js} +1 -1
  45. package/dist/chunks/{claudeDesktop-me56qerx.js → claudeDesktop-mbfy989f.js} +1 -1
  46. package/dist/chunks/{cleanup-hxj6tm50.js → cleanup-b1j2gz00.js} +1 -1
  47. package/dist/chunks/clear-gcgpc454.js +2 -0
  48. package/dist/chunks/{cli-63wps6p0.js → cli-01hdyy20.js} +1 -1
  49. package/dist/chunks/{cli-fnt125we.js → cli-024t0qj5.js} +2 -2
  50. package/dist/chunks/{cli-xqqnx8gk.js → cli-05d7kjwb.js} +1 -1
  51. package/dist/chunks/{cli-z02gsrtd.js → cli-0gt2xz4m.js} +2 -2
  52. package/dist/chunks/{cli-hp5gs22f.js → cli-0hyd6spd.js} +1 -1
  53. package/dist/chunks/{cli-3619x17q.js → cli-0p0bgg1c.js} +1 -1
  54. package/dist/chunks/{cli-j4r75xsd.js → cli-0qjhtnek.js} +1 -1
  55. package/dist/chunks/{cli-7ed2q42n.js → cli-0th9dbz0.js} +2 -2
  56. package/dist/chunks/{cli-8j0b3b55.js → cli-0vb8t8wq.js} +1 -1
  57. package/dist/chunks/{cli-7jw2qe69.js → cli-0ybyvcx6.js} +2 -2
  58. package/dist/chunks/{cli-8xyb31dy.js → cli-10j9svm7.js} +2 -2
  59. package/dist/chunks/{cli-2sbq6ggm.js → cli-16j5x50q.js} +2 -2
  60. package/dist/chunks/{cli-3tkd82y4.js → cli-19s45qns.js} +1 -1
  61. package/dist/chunks/{cli-zwn9x1p2.js → cli-1pwyw30a.js} +1 -1
  62. package/dist/chunks/{cli-h2t2hyz7.js → cli-1px0m0pt.js} +2 -2
  63. package/dist/chunks/{cli-e9t5kfxm.js → cli-2540qh2b.js} +1 -1
  64. package/dist/chunks/{cli-ps5qshk4.js → cli-259ff8gy.js} +1 -1
  65. package/dist/chunks/{cli-rc3w6tqd.js → cli-26y0jfks.js} +2 -2
  66. package/dist/chunks/{cli-qwx84m9c.js → cli-2afdzhna.js} +1 -1
  67. package/dist/chunks/{cli-e5yek4vx.js → cli-2dkq8dre.js} +2 -2
  68. package/dist/chunks/{cli-1eejy071.js → cli-2q9p0rr5.js} +1 -1
  69. package/dist/chunks/{cli-awe5yg6m.js → cli-39xs60x2.js} +2 -2
  70. package/dist/chunks/{cli-mx33m3gs.js → cli-3he638yr.js} +1 -1
  71. package/dist/chunks/{cli-an97yxg9.js → cli-3q4bcd9y.js} +2 -2
  72. package/dist/chunks/{cli-swrtc7tv.js → cli-40cqn5s4.js} +1 -1
  73. package/dist/chunks/cli-461ebjmk.js +3 -0
  74. package/dist/chunks/{cli-n5wt59z1.js → cli-4c9nnszs.js} +2 -2
  75. package/dist/chunks/{cli-64x5ghm5.js → cli-4dj4x3mr.js} +1 -1
  76. package/dist/chunks/{cli-zxe1a0ey.js → cli-4r0qxxn2.js} +2 -2
  77. package/dist/chunks/{cli-jz50hv3m.js → cli-4v73qw68.js} +1 -1
  78. package/dist/chunks/{cli-bfm3f0yw.js → cli-5pn327m7.js} +1 -1
  79. package/dist/chunks/{cli-jrwh6rs0.js → cli-5rxvwnb0.js} +1 -1
  80. package/dist/chunks/{cli-93sm9n17.js → cli-5t8cqq40.js} +1 -1
  81. package/dist/chunks/{cli-b3k8arn1.js → cli-63389c5w.js} +589 -589
  82. package/dist/chunks/{cli-609dp2ck.js → cli-6376p7cj.js} +1 -1
  83. package/dist/chunks/{cli-8h10q2x8.js → cli-6fmt7dye.js} +1 -1
  84. package/dist/chunks/{cli-9e8f55fp.js → cli-6xn8gqp2.js} +1 -1
  85. package/dist/chunks/{cli-a2d962bq.js → cli-7dm5ex18.js} +3 -3
  86. package/dist/chunks/{cli-9hqmq5g6.js → cli-7q6tcs56.js} +1 -1
  87. package/dist/chunks/{cli-6cqemsm9.js → cli-7xgc2882.js} +1 -1
  88. package/dist/chunks/{cli-wznsj6nb.js → cli-884gn8px.js} +1 -1
  89. package/dist/chunks/cli-8ayzxqxm.js +3 -0
  90. package/dist/chunks/{cli-33tchr20.js → cli-8hpg8nq4.js} +2 -2
  91. package/dist/chunks/{cli-5c6e6txh.js → cli-9m758wb1.js} +48 -48
  92. package/dist/chunks/{cli-192xnkcx.js → cli-9sjvqgf1.js} +39 -39
  93. package/dist/chunks/{cli-bj0csmzs.js → cli-a1ejrtbd.js} +2 -2
  94. package/dist/chunks/{cli-fdjfk8yq.js → cli-a2f4j8s5.js} +2 -2
  95. package/dist/chunks/cli-aevjtty8.js +3 -0
  96. package/dist/chunks/{cli-601zv0wv.js → cli-ajnshm3j.js} +2 -2
  97. package/dist/chunks/{cli-q2g5mjv6.js → cli-aw71bpta.js} +1 -1
  98. package/dist/chunks/{cli-brr3bnrj.js → cli-b2fkrk49.js} +2 -2
  99. package/dist/chunks/{cli-7k17xstr.js → cli-bavw7hk5.js} +1 -1
  100. package/dist/chunks/{cli-5ajcy93q.js → cli-bbt5chja.js} +2 -2
  101. package/dist/chunks/{cli-awb77t95.js → cli-bqs5smsv.js} +2 -2
  102. package/dist/chunks/{cli-yt4ezhhk.js → cli-btsq7ax8.js} +1 -1
  103. package/dist/chunks/{cli-yktdhy9p.js → cli-cmfxv0fb.js} +2 -2
  104. package/dist/chunks/{cli-nqvfpxp6.js → cli-d287m3xt.js} +1 -1
  105. package/dist/chunks/{cli-0nz8v3dj.js → cli-d5tdpnv2.js} +1 -1
  106. package/dist/chunks/{cli-jmq1x925.js → cli-d8qkvmdn.js} +2 -2
  107. package/dist/chunks/{cli-9xtyh8c7.js → cli-dc6wqdxq.js} +2 -2
  108. package/dist/chunks/{cli-rjy86nps.js → cli-djvr12vv.js} +1 -1
  109. package/dist/chunks/{cli-e4a4fjx9.js → cli-dp2jt8fs.js} +2 -2
  110. package/dist/chunks/{cli-e3q6b1cv.js → cli-e1e1m0pp.js} +1 -1
  111. package/dist/chunks/{cli-szxfz15b.js → cli-e1gmbexn.js} +1 -1
  112. package/dist/chunks/{cli-2428yw99.js → cli-e5vc9y1s.js} +2 -2
  113. package/dist/chunks/{cli-8kpqq0ea.js → cli-eehgc06t.js} +2 -2
  114. package/dist/chunks/{cli-a1cx6p3g.js → cli-ehchpnvs.js} +1 -1
  115. package/dist/chunks/{cli-6qt2xm18.js → cli-epetmtbs.js} +2 -2
  116. package/dist/chunks/{cli-m6amgxq3.js → cli-ex1phpwq.js} +1 -1
  117. package/dist/chunks/{cli-8ykv66e4.js → cli-ey3ajcbm.js} +2 -2
  118. package/dist/chunks/{cli-wvctks7e.js → cli-eys4epws.js} +2 -2
  119. package/dist/chunks/{cli-2fqrjjs9.js → cli-ezm83s1g.js} +1 -1
  120. package/dist/chunks/{cli-dx0pk7k2.js → cli-f2vabz18.js} +1 -1
  121. package/dist/chunks/{cli-7wxv39ry.js → cli-fg3rb4dg.js} +2 -2
  122. package/dist/chunks/{cli-t7sx6zqn.js → cli-fn58ekhc.js} +1 -1
  123. package/dist/chunks/{cli-6ee37m6j.js → cli-ft5hkwbj.js} +1 -1
  124. package/dist/chunks/{cli-eh1wx76n.js → cli-ftpdmdw5.js} +1 -1
  125. package/dist/chunks/{cli-df5r5xrp.js → cli-fvr47wt6.js} +1 -1
  126. package/dist/chunks/{cli-a1dqnvy2.js → cli-g85dpwpq.js} +1 -1
  127. package/dist/chunks/{cli-d1w21hsm.js → cli-gd0f1rtp.js} +1 -1
  128. package/dist/chunks/{cli-bpj9na88.js → cli-gh3w0z1t.js} +1 -1
  129. package/dist/chunks/{cli-ktzyyx91.js → cli-gpsc6dvd.js} +1 -1
  130. package/dist/chunks/{cli-zqrzc3qx.js → cli-gv71wq8a.js} +1 -1
  131. package/dist/chunks/{cli-67azkkwm.js → cli-h2e1scnk.js} +1 -1
  132. package/dist/chunks/{cli-bdgrtpsy.js → cli-h3vttdhj.js} +2 -2
  133. package/dist/chunks/{cli-sbm8tsyq.js → cli-h5hm4rsb.js} +1 -1
  134. package/dist/chunks/cli-h7tdk5fx.js +3 -0
  135. package/dist/chunks/{cli-yaxs01at.js → cli-h9xmkhdq.js} +2 -2
  136. package/dist/chunks/{cli-b8j8bm5m.js → cli-hs95nqb0.js} +1 -1
  137. package/dist/chunks/{cli-rz03bav0.js → cli-hsnk77dk.js} +1 -1
  138. package/dist/chunks/{cli-q8zmmp6z.js → cli-hy0se8fa.js} +2 -2
  139. package/dist/chunks/{cli-3tmtx9ka.js → cli-jr0hzh2w.js} +1 -1
  140. package/dist/chunks/{cli-hpxspent.js → cli-jy20hqk9.js} +2 -2
  141. package/dist/chunks/{cli-ez2xsd4m.js → cli-k3b5ctgk.js} +2 -2
  142. package/dist/chunks/{cli-yxsn8ang.js → cli-kc4b0z3x.js} +1 -1
  143. package/dist/chunks/{cli-d2pn0xfj.js → cli-krmacmt6.js} +1 -1
  144. package/dist/chunks/{cli-tafg3e9w.js → cli-ktzb7cwm.js} +2 -2
  145. package/dist/chunks/{cli-sr25begm.js → cli-m09f7s7e.js} +1 -1
  146. package/dist/chunks/{cli-kx3r72jp.js → cli-mae5am6a.js} +1 -1
  147. package/dist/chunks/{cli-z2ewnqgr.js → cli-mhza34xq.js} +2 -2
  148. package/dist/chunks/{cli-qpjkqhg2.js → cli-mky8bjey.js} +1 -1
  149. package/dist/chunks/{cli-fz053waw.js → cli-mqkqq3ye.js} +2 -2
  150. package/dist/chunks/{cli-vtsy70mz.js → cli-ms2tdrrf.js} +1 -1
  151. package/dist/chunks/{cli-hrmzaf5d.js → cli-n0xnhnx9.js} +2 -2
  152. package/dist/chunks/{cli-cfbfexxj.js → cli-ncbagd2h.js} +1 -1
  153. package/dist/chunks/{cli-vfh77r55.js → cli-ndp9j4vm.js} +1 -1
  154. package/dist/chunks/{cli-4pwyex04.js → cli-ndrvqgnc.js} +2 -2
  155. package/dist/chunks/{cli-jz8jcrhh.js → cli-nhks97kf.js} +1 -1
  156. package/dist/chunks/{cli-ry9g546q.js → cli-p2ngs1jm.js} +1 -1
  157. package/dist/chunks/{cli-qrmc38f8.js → cli-p853vxnx.js} +2 -2
  158. package/dist/chunks/{cli-gfweqbpz.js → cli-pmfc2886.js} +1 -1
  159. package/dist/chunks/{cli-1p7nc6zb.js → cli-q33bj7n5.js} +2 -2
  160. package/dist/chunks/{cli-t4see9hh.js → cli-q5arj6fm.js} +2 -2
  161. package/dist/chunks/{cli-vb6aa4jk.js → cli-q6atnwff.js} +2 -2
  162. package/dist/chunks/{cli-cmh6qwg8.js → cli-q93jv7x6.js} +2 -2
  163. package/dist/chunks/{cli-dy9qrrps.js → cli-qa0qmmg4.js} +2 -2
  164. package/dist/chunks/{cli-222ywgt0.js → cli-qhefvb54.js} +2 -2
  165. package/dist/chunks/{cli-sxe9wke0.js → cli-qxtxfn2z.js} +1 -1
  166. package/dist/chunks/{cli-bnr79ddy.js → cli-r29k5h5x.js} +2 -2
  167. package/dist/chunks/{cli-a826q5zk.js → cli-rm2gppbh.js} +1 -1
  168. package/dist/chunks/{cli-a25jeqs8.js → cli-rv4z0bsv.js} +2 -2
  169. package/dist/chunks/{cli-g2s3391y.js → cli-s5ee96g6.js} +1 -1
  170. package/dist/chunks/{cli-5kehgkgh.js → cli-sqtf9njc.js} +1 -1
  171. package/dist/chunks/{cli-3hrmwgsv.js → cli-stjsr4fx.js} +2 -2
  172. package/dist/chunks/{cli-tpjr1pz9.js → cli-svyc36nr.js} +1 -1
  173. package/dist/chunks/{cli-j403r21v.js → cli-sw84zjvc.js} +1 -1
  174. package/dist/chunks/{cli-vm7dr5aa.js → cli-tbp8513t.js} +2 -2
  175. package/dist/chunks/{cli-7n4d5yzr.js → cli-tez2hmqw.js} +1 -1
  176. package/dist/chunks/{cli-hs2k9997.js → cli-tfs3as1v.js} +1 -1
  177. package/dist/chunks/{cli-2j6cv2kz.js → cli-tj8fyjds.js} +2 -2
  178. package/dist/chunks/{cli-phwbqkv7.js → cli-tnbyhfne.js} +2 -2
  179. package/dist/chunks/{cli-97vx3m99.js → cli-ttxhmsvc.js} +1 -1
  180. package/dist/chunks/{cli-yb5m6jwq.js → cli-v86f53k0.js} +3 -3
  181. package/dist/chunks/{cli-07f2hk9d.js → cli-v8wqc6y3.js} +1 -1
  182. package/dist/chunks/{cli-m3r80gy0.js → cli-v9wwx1rc.js} +1 -1
  183. package/dist/chunks/{cli-8jym9hp6.js → cli-vbn35zp3.js} +2 -2
  184. package/dist/chunks/{cli-ca1jmr8f.js → cli-vj1rywde.js} +2 -2
  185. package/dist/chunks/cli-vq0ktbx3.js +3 -0
  186. package/dist/chunks/{cli-pgjnzqk4.js → cli-vrs8hpz4.js} +1 -1
  187. package/dist/chunks/{cli-r43jhzwm.js → cli-vzcpa5mx.js} +2 -2
  188. package/dist/chunks/{cli-q0vret0x.js → cli-w0jxph8x.js} +1 -1
  189. package/dist/chunks/{cli-x9s7jxq5.js → cli-w1y2zvbw.js} +2 -2
  190. package/dist/chunks/{cli-vy3e90k9.js → cli-w4zkh280.js} +1 -1
  191. package/dist/chunks/{cli-chvks6bg.js → cli-w8jvw417.js} +1 -1
  192. package/dist/chunks/{cli-ax0ckqpv.js → cli-w8pfefka.js} +1 -1
  193. package/dist/chunks/{cli-rd5ax7sn.js → cli-x0jht735.js} +1 -1
  194. package/dist/chunks/{cli-gypyp608.js → cli-x4rgkedw.js} +1 -1
  195. package/dist/chunks/{cli-asc9xmsr.js → cli-xabdpk7s.js} +1 -1
  196. package/dist/chunks/{cli-1q1b8rgs.js → cli-xq9g16gt.js} +1 -1
  197. package/dist/chunks/{cli-vqne1z50.js → cli-xw96dapq.js} +1 -1
  198. package/dist/chunks/{cli-b29enbbc.js → cli-xza1mmh1.js} +1 -1
  199. package/dist/chunks/{cli-b5z57an7.js → cli-y2g1asak.js} +1 -1
  200. package/dist/chunks/{cli-mcbntv3p.js → cli-yaw2d4zq.js} +1 -1
  201. package/dist/chunks/{cli-yfb8bk69.js → cli-ymqdnbx2.js} +2 -2
  202. package/dist/chunks/{cli-shsgq494.js → cli-yps4pn87.js} +1 -1
  203. package/dist/chunks/{cli-bzrat9yd.js → cli-z1f33m31.js} +2 -2
  204. package/dist/chunks/cli-z6eshqx6.js +3 -0
  205. package/dist/chunks/{cli-9tbmrp89.js → cli-zjznn7cc.js} +1 -1
  206. package/dist/chunks/{cli-ceas97gw.js → cli-zqj1my2v.js} +2 -2
  207. package/dist/chunks/{cli-psqvdh1r.js → cli-zrth7vt6.js} +1 -1
  208. package/dist/chunks/{cli-8z8d5bgb.js → cli-zxrt2zch.js} +2 -2
  209. package/dist/chunks/cli-zxz1xm2y.js +3 -0
  210. package/dist/chunks/client-syew3mvc.js +2 -0
  211. package/dist/chunks/color-qatz507k.js +2 -0
  212. package/dist/chunks/commitAttribution-shckr1cq.js +2 -0
  213. package/dist/chunks/common-jh4pavb6.js +2 -0
  214. package/dist/chunks/{compact-kysg5kxd.js → compact-sxghgg9n.js} +1 -1
  215. package/dist/chunks/config-25r8er6j.js +2 -0
  216. package/dist/chunks/config-ahnc48yv.js +2 -0
  217. package/dist/chunks/{context-aat04hqp.js → context-8vmnhkcn.js} +1 -1
  218. package/dist/chunks/context-noninteractive-r3easde9.js +2 -0
  219. package/dist/chunks/conversation-5j4eggm2.js +2 -0
  220. package/dist/chunks/{copy-zpvnnk85.js → copy-kkwp50xa.js} +1 -1
  221. package/dist/chunks/cost-jpq9rbzx.js +5 -0
  222. package/dist/chunks/createSession-q0a53mn0.js +2 -0
  223. package/dist/chunks/desktop-k6291p1x.js +2 -0
  224. package/dist/chunks/detectRepository-h3gr8gdb.js +2 -0
  225. package/dist/chunks/detection-b0zsvwnb.js +2 -0
  226. package/dist/chunks/{devtools-7jd4m7th.js → devtools-8zc2m716.js} +1 -1
  227. package/dist/chunks/{diff-xaw6ebj0.js → diff-vm40nyxd.js} +1 -1
  228. package/dist/chunks/doctor-y45fmac9.js +2 -0
  229. package/dist/chunks/earlyInput-pegekfhn.js +2 -0
  230. package/dist/chunks/{effort-bj5x7fcg.js → effort-9xnbtb27.js} +1 -1
  231. package/dist/chunks/executor-kx69dfy3.js +2 -0
  232. package/dist/chunks/exit-8r8kx8hm.js +2 -0
  233. package/dist/chunks/{export-tjrkechp.js → export-0wr0abd0.js} +1 -1
  234. package/dist/chunks/extra-usage-nbgas106.js +2 -0
  235. package/dist/chunks/extra-usage-noninteractive-66zmwx05.js +2 -0
  236. package/dist/chunks/fast-8ymdvfm8.js +2 -0
  237. package/dist/chunks/feedback-n8vwr3z9.js +2 -0
  238. package/dist/chunks/{files-n3b22fs2.js → files-mhx9cc10.js} +1 -1
  239. package/dist/chunks/firstPartyEventLogger-paerdr2m.js +2 -0
  240. package/dist/chunks/gates-wngyk842.js +2 -0
  241. package/dist/chunks/git-r7sca128.js +2 -0
  242. package/dist/chunks/goal-zqeb4rnv.js +2 -0
  243. package/dist/chunks/growthbook-z0km1xj1.js +2 -0
  244. package/dist/chunks/{heapdump-2y7wcy1r.js → heapdump-rcge2q0e.js} +1 -1
  245. package/dist/chunks/{help-a7mc9946.js → help-zba127jm.js} +1 -1
  246. package/dist/chunks/{hooks-22nm9hn0.js → hooks-kwyxgfnh.js} +1 -1
  247. package/dist/chunks/hooks-sd4knstw.js +2 -0
  248. package/dist/chunks/{ide-9x5zsk63.js → ide-ph9revqg.js} +1 -1
  249. package/dist/chunks/index-y2qvpmjn.js +2 -0
  250. package/dist/chunks/{initReplBridge-xjc6eaan.js → initReplBridge-0fb0sdd0.js} +1 -1
  251. package/dist/chunks/ink-qfs553mf.js +2 -0
  252. package/dist/chunks/{insights-n7k1ty4n.js → insights-mc3fr5tq.js} +1 -1
  253. package/dist/chunks/{install-github-app-zdsmjft8.js → install-github-app-8bpx4gak.js} +1 -1
  254. package/dist/chunks/{install-rhzcmymh.js → install-jnwzbh9n.js} +1 -1
  255. package/dist/chunks/install-slack-app-mq18xdh4.js +2 -0
  256. package/dist/chunks/instrumentation-r6m6cpwq.js +13 -0
  257. package/dist/chunks/keybindings-5xfde34t.js +3 -0
  258. package/dist/chunks/loadAgentsDir-858gc42y.js +2 -0
  259. package/dist/chunks/loadPluginHooks-nye2wnjd.js +2 -0
  260. package/dist/chunks/login-d806meeh.js +2 -0
  261. package/dist/chunks/logout-7eab6ep8.js +2 -0
  262. package/dist/chunks/{main-6h6y0rzf.js → main-r6t52mjc.js} +14 -14
  263. package/dist/chunks/{mcp-yqhzespv.js → mcp-0vwtqwa6.js} +1 -1
  264. package/dist/chunks/mcp-r18hhy02.js +3 -0
  265. package/dist/chunks/{mcp-yrt7dbxp.js → mcp-y8q5yb60.js} +3 -3
  266. package/dist/chunks/{mcpServer-f90a93nt.js → mcpServer-17f7qjpf.js} +1 -1
  267. package/dist/chunks/{mcpServer-v1dy489g.js → mcpServer-za0c5qxf.js} +1 -1
  268. package/dist/chunks/{memory-mdwb22wh.js → memory-cygg4exk.js} +1 -1
  269. package/dist/chunks/{mobile-j4jwvavn.js → mobile-3b85d257.js} +1 -1
  270. package/dist/chunks/{model-tf1ne2j9.js → model-159q4y9p.js} +1 -1
  271. package/dist/chunks/model-m251ahzh.js +2 -0
  272. package/dist/chunks/{oauth-1b0qpxz4.js → oauth-0bwqgx9q.js} +1 -1
  273. package/dist/chunks/{output-style-t39s3jqx.js → output-style-93keyt16.js} +1 -1
  274. package/dist/chunks/parser-hwq42bt6.js +2 -0
  275. package/dist/chunks/{passes-s3fqswrg.js → passes-q304cea1.js} +1 -1
  276. package/dist/chunks/{permissions-a050zfqv.js → permissions-tyasy9cv.js} +1 -1
  277. package/dist/chunks/plan-24nj1sc9.js +2 -0
  278. package/dist/chunks/plugin-6vddyvyh.js +2 -0
  279. package/dist/chunks/pluginStartupCheck-0vse6r56.js +2 -0
  280. package/dist/chunks/{plugins-4py04yzf.js → plugins-0c98naeb.js} +2 -2
  281. package/dist/chunks/{preauthorizedConfig-hmxcgb8e.js → preauthorizedConfig-et34h6tr.js} +1 -1
  282. package/dist/chunks/{print-pmzxgktf.js → print-z6k6yas1.js} +4 -4
  283. package/dist/chunks/privacy-settings-8j5mffff.js +2 -0
  284. package/dist/chunks/process-22t1nv1h.js +2 -0
  285. package/dist/chunks/{processBashCommand-zkztsgn4.js → processBashCommand-z4dv10xe.js} +1 -1
  286. package/dist/chunks/{processSlashCommand-mfh1h592.js → processSlashCommand-3d7jy9zn.js} +1 -1
  287. package/dist/chunks/prompt-2vc9x4tz.js +2 -0
  288. package/dist/chunks/prompt-n672rb6v.js +2 -0
  289. package/dist/chunks/provider-prompt-cyzsv35w.js +2 -0
  290. package/dist/chunks/{rate-limit-options-kd432dap.js → rate-limit-options-sj78r287.js} +1 -1
  291. package/dist/chunks/registry-eh3nbvrw.js +2 -0
  292. package/dist/chunks/release-notes-242sqhds.js +6 -0
  293. package/dist/chunks/reload-plugins-bnwgt3b2.js +3 -0
  294. package/dist/chunks/{remote-env-rg4k5em5.js → remote-env-gpwv8c1y.js} +1 -1
  295. package/dist/chunks/{remoteBridgeCore-t980tt3v.js → remoteBridgeCore-5f92ewk3.js} +1 -1
  296. package/dist/chunks/rename-q0t9qmps.js +2 -0
  297. package/dist/chunks/{resume-3tc40yn9.js → resume-707rbm95.js} +1 -1
  298. package/dist/chunks/{rewind-b6vg7dxs.js → rewind-2ghm1ys8.js} +1 -1
  299. package/dist/chunks/sandbox-adapter-z2sedaea.js +2 -0
  300. package/dist/chunks/{sandbox-toggle-eke03mr8.js → sandbox-toggle-r0nsvjfe.js} +1 -1
  301. package/dist/chunks/{session-53f3eza5.js → session-7jy47tfh.js} +1 -1
  302. package/dist/chunks/sessionFileAccessHooks-0h2dzr6d.js +2 -0
  303. package/dist/chunks/sessionStorage-na71kng7.js +2 -0
  304. package/dist/chunks/settings-jnqec2t4.js +2 -0
  305. package/dist/chunks/{setup-z05dsr8q.js → setup-exrj5apq.js} +2 -2
  306. package/dist/chunks/{setup-gravfzvg.js → setup-hhnqt5m4.js} +1 -1
  307. package/dist/chunks/setup-sv1h7c9x.js +2 -0
  308. package/dist/chunks/sinks-h5jqp76t.js +2 -0
  309. package/dist/chunks/{skills-41mfq71n.js → skills-7cx810ev.js} +1 -1
  310. package/dist/chunks/startupProfiler-qkkwmx3e.js +2 -0
  311. package/dist/chunks/state-9t5rddcc.js +2 -0
  312. package/dist/chunks/{stats-7qg84dw1.js → stats-4trmdgr9.js} +1 -1
  313. package/dist/chunks/status-qvn7jn0p.js +2 -0
  314. package/dist/chunks/stickers-p4yrfr32.js +2 -0
  315. package/dist/chunks/subprocessEnv-x1xd9x7k.js +2 -0
  316. package/dist/chunks/{systemPromptSections-jxxyhnxe.js → systemPromptSections-pcrphkzc.js} +1 -1
  317. package/dist/chunks/{tag-58ndeaa9.js → tag-bexktcx4.js} +1 -1
  318. package/dist/chunks/tasks-a0mx2drp.js +2 -0
  319. package/dist/chunks/teamHelpers-bfbx13m0.js +2 -0
  320. package/dist/chunks/teammateModeSnapshot-x1dc2d00.js +2 -0
  321. package/dist/chunks/teleport-y1mmes2t.js +2 -0
  322. package/dist/chunks/terminalSetup-a0a8wgbj.js +2 -0
  323. package/dist/chunks/theme-1wm2bpaf.js +2 -0
  324. package/dist/chunks/thinkback-3sz6bf5t.js +2 -0
  325. package/dist/chunks/thinkback-play-swd1vjqn.js +2 -0
  326. package/dist/chunks/toolSearch-8mgqzknz.js +2 -0
  327. package/dist/chunks/trustedDevice-9yp8mttk.js +2 -0
  328. package/dist/chunks/{ultrareviewCommand-qwnsjdez.js → ultrareviewCommand-dj716ryk.js} +1 -1
  329. package/dist/chunks/update-r3pdnfg1.js +82 -0
  330. package/dist/chunks/upgrade-adym17ka.js +2 -0
  331. package/dist/chunks/{upstreamproxy-34wva0r5.js → upstreamproxy-39e2hgq3.js} +1 -1
  332. package/dist/chunks/usage-gehxyrfj.js +2 -0
  333. package/dist/chunks/util-qk39hg9x.js +2 -0
  334. package/dist/chunks/utils-5nwk1214.js +2 -0
  335. package/dist/chunks/vim-zqzf0xh8.js +2 -0
  336. package/dist/chunks/worktree-17wb4yc5.js +2 -0
  337. package/dist/chunks/worktreeModeEnabled-pjb4srr0.js +2 -0
  338. package/dist/cli.js +1 -1
  339. package/package.json +2 -1
  340. package/dist/chunks/App-ncpmz34p.js +0 -2
  341. package/dist/chunks/ApproveApiKey-fqzjf1j3.js +0 -2
  342. package/dist/chunks/BypassPermissionsModeDialog-3ksmd8pp.js +0 -2
  343. package/dist/chunks/ClaudeMdExternalIncludesDialog-rrsfavte.js +0 -2
  344. package/dist/chunks/ConsoleOAuthFlow-04xt4sby.js +0 -2
  345. package/dist/chunks/Doctor-kg5m2zma.js +0 -2
  346. package/dist/chunks/Grove-rf9xhe2e.js +0 -2
  347. package/dist/chunks/InvalidConfigDialog-6spqsgmr.js +0 -2
  348. package/dist/chunks/InvalidSettingsDialog-m6y6esgz.js +0 -2
  349. package/dist/chunks/Onboarding-j1m69bqm.js +0 -2
  350. package/dist/chunks/REPL-bpg86z4h.js +0 -2
  351. package/dist/chunks/ToolSearchTool-4rm3kr13.js +0 -2
  352. package/dist/chunks/TungstenTool-3wjjz6cf.js +0 -2
  353. package/dist/chunks/agents-w6zde2j9.js +0 -4
  354. package/dist/chunks/ant-claude-for-chrome-mcp-gr0b0jr4.js +0 -2
  355. package/dist/chunks/api-07pqphw5.js +0 -2
  356. package/dist/chunks/asciicast-2k1ztt6v.js +0 -2
  357. package/dist/chunks/auth-g509w5pr.js +0 -2
  358. package/dist/chunks/backgroundHousekeeping-hw0chw1d.js +0 -2
  359. package/dist/chunks/caches-3qzm958c.js +0 -2
  360. package/dist/chunks/clear-ssfbry3k.js +0 -2
  361. package/dist/chunks/cli-16k24hzp.js +0 -3
  362. package/dist/chunks/cli-8xz7dd7z.js +0 -3
  363. package/dist/chunks/cli-geka8fb7.js +0 -3
  364. package/dist/chunks/cli-rwh0a2m1.js +0 -3
  365. package/dist/chunks/cli-t5ddsvmv.js +0 -3
  366. package/dist/chunks/cli-t5yqvdb3.js +0 -3
  367. package/dist/chunks/cli-t8ydjjs7.js +0 -3
  368. package/dist/chunks/client-qxx2ja27.js +0 -2
  369. package/dist/chunks/color-k1ew8kzn.js +0 -2
  370. package/dist/chunks/commitAttribution-nsa26sdx.js +0 -2
  371. package/dist/chunks/common-7t28qq0q.js +0 -2
  372. package/dist/chunks/config-d4kj5q8e.js +0 -2
  373. package/dist/chunks/config-txzzncm9.js +0 -2
  374. package/dist/chunks/context-noninteractive-w54t6xnc.js +0 -2
  375. package/dist/chunks/conversation-brecqh0t.js +0 -2
  376. package/dist/chunks/cost-5fbyws6x.js +0 -5
  377. package/dist/chunks/createSession-hsp3x7vw.js +0 -2
  378. package/dist/chunks/desktop-7kdmxet0.js +0 -2
  379. package/dist/chunks/detectRepository-9xqead5f.js +0 -2
  380. package/dist/chunks/detection-z3cdks0s.js +0 -2
  381. package/dist/chunks/doctor-nbm4z0tx.js +0 -2
  382. package/dist/chunks/earlyInput-e8zh4d2d.js +0 -2
  383. package/dist/chunks/executor-e1744nra.js +0 -2
  384. package/dist/chunks/exit-894g29w2.js +0 -2
  385. package/dist/chunks/extra-usage-noninteractive-577ac873.js +0 -2
  386. package/dist/chunks/extra-usage-tfwmdc7z.js +0 -2
  387. package/dist/chunks/fast-1krm57mn.js +0 -2
  388. package/dist/chunks/feedback-2421cbpm.js +0 -2
  389. package/dist/chunks/firstPartyEventLogger-1kwwcqdn.js +0 -2
  390. package/dist/chunks/gates-sd1cp8f2.js +0 -2
  391. package/dist/chunks/git-t6e9xdt2.js +0 -2
  392. package/dist/chunks/goal-0sxyk3va.js +0 -2
  393. package/dist/chunks/growthbook-4hx0kbpq.js +0 -2
  394. package/dist/chunks/hooks-tf9v5b0x.js +0 -2
  395. package/dist/chunks/index-p1k4dhfc.js +0 -2
  396. package/dist/chunks/ink-9n8bszp5.js +0 -2
  397. package/dist/chunks/install-slack-app-vhfe2dsf.js +0 -2
  398. package/dist/chunks/instrumentation-5jjvsvke.js +0 -13
  399. package/dist/chunks/keybindings-tqnmw7ng.js +0 -3
  400. package/dist/chunks/loadAgentsDir-j7pntb5v.js +0 -2
  401. package/dist/chunks/loadPluginHooks-sta7ra57.js +0 -2
  402. package/dist/chunks/login-j7x2fjw8.js +0 -2
  403. package/dist/chunks/logout-53bvwba1.js +0 -2
  404. package/dist/chunks/mcp-3mjagnnt.js +0 -3
  405. package/dist/chunks/model-hz3nn362.js +0 -2
  406. package/dist/chunks/parser-8venanpw.js +0 -2
  407. package/dist/chunks/plan-gjaybyvb.js +0 -2
  408. package/dist/chunks/plugin-trf2388p.js +0 -2
  409. package/dist/chunks/pluginStartupCheck-wxmc7h98.js +0 -2
  410. package/dist/chunks/privacy-settings-b2rz35r5.js +0 -2
  411. package/dist/chunks/process-n5355p53.js +0 -2
  412. package/dist/chunks/prompt-2jyjhkwg.js +0 -2
  413. package/dist/chunks/prompt-b34a0h5z.js +0 -2
  414. package/dist/chunks/provider-prompt-qe4s2yzh.js +0 -2
  415. package/dist/chunks/registry-d7cd5dqg.js +0 -2
  416. package/dist/chunks/release-notes-rwgbn4pp.js +0 -6
  417. package/dist/chunks/reload-plugins-9axdwaaj.js +0 -3
  418. package/dist/chunks/rename-xap3rpbv.js +0 -2
  419. package/dist/chunks/sandbox-adapter-1z8xktva.js +0 -2
  420. package/dist/chunks/sessionFileAccessHooks-xscvsvqt.js +0 -2
  421. package/dist/chunks/sessionStorage-rb63e8bn.js +0 -2
  422. package/dist/chunks/settings-hp0ksjn9.js +0 -2
  423. package/dist/chunks/setup-ssq8b1e6.js +0 -2
  424. package/dist/chunks/sinks-agafqaxj.js +0 -2
  425. package/dist/chunks/startupProfiler-wmf8nvfd.js +0 -2
  426. package/dist/chunks/state-rhxyy4qm.js +0 -2
  427. package/dist/chunks/status-sran2y9h.js +0 -2
  428. package/dist/chunks/stickers-hythmrsd.js +0 -2
  429. package/dist/chunks/subprocessEnv-b12dkzky.js +0 -2
  430. package/dist/chunks/tasks-52g28x72.js +0 -2
  431. package/dist/chunks/teamHelpers-rxt9rvmd.js +0 -2
  432. package/dist/chunks/teammateModeSnapshot-2782d4w9.js +0 -2
  433. package/dist/chunks/teleport-8gjys6yn.js +0 -2
  434. package/dist/chunks/terminalSetup-bbftxeqk.js +0 -2
  435. package/dist/chunks/theme-b38te5rz.js +0 -2
  436. package/dist/chunks/thinkback-05a9q24j.js +0 -2
  437. package/dist/chunks/thinkback-play-1nbagfm5.js +0 -2
  438. package/dist/chunks/toolSearch-7rnke366.js +0 -2
  439. package/dist/chunks/trustedDevice-2dn4981h.js +0 -2
  440. package/dist/chunks/update-ney1krzn.js +0 -82
  441. package/dist/chunks/upgrade-zxxxfq8c.js +0 -2
  442. package/dist/chunks/usage-82ghrfb3.js +0 -2
  443. package/dist/chunks/util-xm9cs164.js +0 -2
  444. package/dist/chunks/utils-zs0ft181.js +0 -2
  445. package/dist/chunks/vim-6gxdrp1k.js +0 -2
  446. package/dist/chunks/worktree-xjxz4ndt.js +0 -2
  447. package/dist/chunks/worktreeModeEnabled-8ndm5yfs.js +0 -2
@@ -1,3 +1,3 @@
1
1
  // @bun
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
- 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};
2
+ import{_R as AJ,fS as oJ}from"./cli-rv4z0bsv.js";import{F4 as qJ,h4 as PJ,i4 as U,m4 as ZJ,n4 as $J,r4 as bJ,v4 as SJ,w4 as h,x4 as zJ}from"./cli-vzcpa5mx.js";import{b5 as w,c5 as YJ}from"./cli-461ebjmk.js";import{E7 as gJ,h7 as vJ}from"./cli-v86f53k0.js";import{L7 as xJ,M7 as lJ}from"./cli-fg3rb4dg.js";import{I8 as L,N8 as fJ}from"./cli-eehgc06t.js";import{$9 as W,C_ as XJ,a_ as x,f_ as QJ,h_ as v,i_ as y,l_ as VJ,z_ as G}from"./cli-bqs5smsv.js";import{J_ as a,K_ as l,M_ as e,W_ as JJ}from"./cli-hy0se8fa.js";import{Xaa as s,fda as t,g$ as i,h$ as DJ,i$ as m,sca as N}from"./cli-ktzb7cwm.js";import{jda as I,kda as CJ}from"./cli-2afdzhna.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-eh3nbvrw.js"),import("./detection-b0zsvwnb.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
+ export{EQ as iM,UQ as jM,BQ as kM,LJ as lM,OQ as mM,CQ as nM,xQ as oM,HJ as pM,H as qM,FJ as rM,vQ as sM,C as tM,j as uM,SQ as vM,F as wM,zQ as xM,AQ as yM,MQ as zM,jQ as AM,BJ as BM,k as CM,OJ as DM,nQ as EM,yJ as FM,kQ as GM,b as HM,c as IM,E as JM,wJ as KM,rJ as LM,dQ as MM,rQ as NM,iQ as OM,mQ as PM,sQ as QM,tQ as RM,iJ as SM,aQ as TM,eQ as UM,JV as VM,QV as WM,VV as XM,XV as YM,tJ as ZM,aJ as _M};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{w as T}from"./cli-pgjnzqk4.js";import{Ax as m,zx as F}from"./cli-b3k8arn1.js";import{MK as S,PK as o,QK as k,RK as z,WK as c}from"./cli-7jw2qe69.js";import{R2 as N,a3 as b}from"./cli-192xnkcx.js";import{$4 as E,a5 as f}from"./cli-t5ddsvmv.js";import{l5 as W,o5 as w,t5 as y,u5 as U,z5 as p}from"./cli-2428yw99.js";import{Q6 as Z,S6 as R}from"./cli-yb5m6jwq.js";import{$8 as C,_8 as q}from"./cli-e5yek4vx.js";import{A_ as _,f_ as O,j_ as h,x_ as Y}from"./cli-awb77t95.js";import{K_ as H,U_ as u}from"./cli-q8zmmp6z.js";import{ida as v}from"./cli-qwx84m9c.js";b();f();import{z as V}from"zod/v4";var j={poll_interval_ms_not_at_capacity:2000,poll_interval_ms_at_capacity:600000,non_exclusive_heartbeat_interval_ms:0,multisession_poll_interval_ms_not_at_capacity:2000,multisession_poll_interval_ms_partial_capacity:2000,multisession_poll_interval_ms_at_capacity:600000,reclaim_older_than_ms:5000,session_keepalive_interval_v2_ms:120000};var x={message:"must be 0 (disabled) or \u2265100ms"},I=E(()=>V.object({poll_interval_ms_not_at_capacity:V.number().int().min(100),poll_interval_ms_at_capacity:V.number().int().refine((J)=>J===0||J>=100,x),non_exclusive_heartbeat_interval_ms:V.number().int().min(0).default(0),multisession_poll_interval_ms_not_at_capacity:V.number().int().min(100).default(j.multisession_poll_interval_ms_not_at_capacity),multisession_poll_interval_ms_partial_capacity:V.number().int().min(100).default(j.multisession_poll_interval_ms_partial_capacity),multisession_poll_interval_ms_at_capacity:V.number().int().refine((J)=>J===0||J>=100,x).default(j.multisession_poll_interval_ms_at_capacity),reclaim_older_than_ms:V.number().int().min(1).default(5000),session_keepalive_interval_v2_ms:V.number().int().min(0).default(120000)}).refine((J)=>J.non_exclusive_heartbeat_interval_ms>0||J.poll_interval_ms_at_capacity>0,{message:"at-capacity liveness requires non_exclusive_heartbeat_interval_ms > 0 or poll_interval_ms_at_capacity > 0"}).refine((J)=>J.non_exclusive_heartbeat_interval_ms>0||J.multisession_poll_interval_ms_at_capacity>0,{message:"at-capacity liveness requires non_exclusive_heartbeat_interval_ms > 0 or multisession_poll_interval_ms_at_capacity > 0"}));function VJ(){let J=N("tengu_bridge_poll_interval_config",j,300000),K=I().safeParse(J);return K.success?K.data:j}_();R();o();import a from"axios";C();m();_();R();u();w();p();c();h();var i=`{"type":"keep_alive"}
2
+ import{w as T}from"./cli-vrs8hpz4.js";import{Bx as F,Cx as m}from"./cli-63389c5w.js";import{OK as S,RK as o,SK as k,TK as z,YK as c}from"./cli-0ybyvcx6.js";import{T2 as N,c3 as b}from"./cli-9sjvqgf1.js";import{b5 as E,c5 as f}from"./cli-461ebjmk.js";import{B5 as p,n5 as W,q5 as w,v5 as y,w5 as U}from"./cli-e5vc9y1s.js";import{S6 as Z,U6 as R}from"./cli-v86f53k0.js";import{a9 as q,b9 as C}from"./cli-2dkq8dre.js";import{C_ as _,h_ as O,l_ as h,z_ as Y}from"./cli-bqs5smsv.js";import{M_ as H,W_ as u}from"./cli-hy0se8fa.js";import{kda as v}from"./cli-2afdzhna.js";b();f();import{z as V}from"zod/v4";var j={poll_interval_ms_not_at_capacity:2000,poll_interval_ms_at_capacity:600000,non_exclusive_heartbeat_interval_ms:0,multisession_poll_interval_ms_not_at_capacity:2000,multisession_poll_interval_ms_partial_capacity:2000,multisession_poll_interval_ms_at_capacity:600000,reclaim_older_than_ms:5000,session_keepalive_interval_v2_ms:120000};var x={message:"must be 0 (disabled) or \u2265100ms"},I=E(()=>V.object({poll_interval_ms_not_at_capacity:V.number().int().min(100),poll_interval_ms_at_capacity:V.number().int().refine((J)=>J===0||J>=100,x),non_exclusive_heartbeat_interval_ms:V.number().int().min(0).default(0),multisession_poll_interval_ms_not_at_capacity:V.number().int().min(100).default(j.multisession_poll_interval_ms_not_at_capacity),multisession_poll_interval_ms_partial_capacity:V.number().int().min(100).default(j.multisession_poll_interval_ms_partial_capacity),multisession_poll_interval_ms_at_capacity:V.number().int().refine((J)=>J===0||J>=100,x).default(j.multisession_poll_interval_ms_at_capacity),reclaim_older_than_ms:V.number().int().min(1).default(5000),session_keepalive_interval_v2_ms:V.number().int().min(0).default(120000)}).refine((J)=>J.non_exclusive_heartbeat_interval_ms>0||J.poll_interval_ms_at_capacity>0,{message:"at-capacity liveness requires non_exclusive_heartbeat_interval_ms > 0 or poll_interval_ms_at_capacity > 0"}).refine((J)=>J.non_exclusive_heartbeat_interval_ms>0||J.multisession_poll_interval_ms_at_capacity>0,{message:"at-capacity liveness requires non_exclusive_heartbeat_interval_ms > 0 or multisession_poll_interval_ms_at_capacity > 0"}));function VJ(){let J=N("tengu_bridge_poll_interval_config",j,300000),K=I().safeParse(J);return K.success?K.data:j}_();R();o();import a from"axios";C();m();_();R();u();w();p();c();h();var i=`{"type":"keep_alive"}
3
3
  `,d=1000,g=1000,D=30000,t=600000,l=1e4,n=300000,A=D*2,r=new Set([1002,4001,4003]);class L{ws=null;lastSentId=null;url;state="idle";onData;onCloseCallback;onConnectCallback;headers;sessionId;autoReconnect;isBridge;reconnectAttempts=0;reconnectStartTime=null;reconnectTimer=null;lastReconnectAttemptTime=null;lastActivityTime=0;pingInterval=null;pongReceived=!0;keepAliveInterval=null;messageBuffer;isBunWs=!1;connectStartTime=0;refreshHeaders;constructor(J,K={},Q,X,$){this.url=J,this.headers=K,this.sessionId=Q,this.refreshHeaders=X,this.autoReconnect=$?.autoReconnect??!0,this.isBridge=$?.isBridge??!1,this.messageBuffer=new F(d)}async connect(){if(this.state!=="idle"&&this.state!=="reconnecting"){Y(`WebSocketTransport: Cannot connect, current state is ${this.state}`,{level:"error"}),Z("error","cli_websocket_connect_failed");return}this.state="reconnecting",this.connectStartTime=Date.now(),Y(`WebSocketTransport: Opening ${this.url.href}`),Z("info","cli_websocket_connect_opening");let J={...this.headers};if(this.lastSentId)J["X-Last-Request-Id"]=this.lastSentId,Y(`WebSocketTransport: Adding X-Last-Request-Id header: ${this.lastSentId}`);if(typeof Bun<"u"){let K=new globalThis.WebSocket(this.url.href,{headers:J,proxy:U(this.url.href),tls:W()||void 0});this.ws=K,this.isBunWs=!0,K.addEventListener("open",this.onBunOpen),K.addEventListener("message",this.onBunMessage),K.addEventListener("error",this.onBunError),K.addEventListener("close",this.onBunClose),K.addEventListener("pong",this.onPong)}else{let{default:K}=await import("ws"),Q=new K(this.url.href,{headers:J,agent:y(this.url.href),...W()});this.ws=Q,this.isBunWs=!1,Q.on("open",this.onNodeOpen),Q.on("message",this.onNodeMessage),Q.on("error",this.onNodeError),Q.on("close",this.onNodeClose),Q.on("pong",this.onPong)}}onBunOpen=()=>{if(this.handleOpenEvent(),this.lastSentId)this.replayBufferedMessages("")};onBunMessage=(J)=>{let K=typeof J.data==="string"?J.data:String(J.data);if(this.lastActivityTime=Date.now(),Z("info","cli_websocket_message_received",{length:K.length}),this.onData)this.onData(K)};onBunError=()=>{Y("WebSocketTransport: Error",{level:"error"}),Z("error","cli_websocket_connect_error")};onBunClose=(J)=>{let K=J.code===1000||J.code===1001;Y(`WebSocketTransport: Closed: ${J.code}`,K?void 0:{level:"error"}),Z("error","cli_websocket_connect_closed"),this.handleConnectionError(J.code)};onNodeOpen=()=>{let J=this.ws;if(this.handleOpenEvent(),!J)return;let Q=J.upgradeReq;if(Q?.headers?.["x-last-request-id"]){let X=Q.headers["x-last-request-id"];this.replayBufferedMessages(X)}};onNodeMessage=(J)=>{let K=J.toString();if(this.lastActivityTime=Date.now(),Z("info","cli_websocket_message_received",{length:K.length}),this.onData)this.onData(K)};onNodeError=(J)=>{Y(`WebSocketTransport: Error: ${J.message}`,{level:"error"}),Z("error","cli_websocket_connect_error")};onNodeClose=(J,K)=>{let Q=J===1000||J===1001;Y(`WebSocketTransport: Closed: ${J}`,Q?void 0:{level:"error"}),Z("error","cli_websocket_connect_closed"),this.handleConnectionError(J)};onPong=()=>{this.pongReceived=!0};handleOpenEvent(){let J=Date.now()-this.connectStartTime;if(Y("WebSocketTransport: Connected"),Z("info","cli_websocket_connect_connected",{duration_ms:J}),this.isBridge&&this.reconnectStartTime!==null)q("tengu_ws_transport_reconnected",{attempts:this.reconnectAttempts,downtimeMs:Date.now()-this.reconnectStartTime});this.reconnectAttempts=0,this.reconnectStartTime=null,this.lastReconnectAttemptTime=null,this.lastActivityTime=Date.now(),this.state="connected",this.onConnectCallback?.(),this.startPingInterval(),this.startKeepaliveInterval(),k(()=>{this.write({type:"keep_alive"})})}sendLine(J){if(!this.ws||this.state!=="connected")return Y("WebSocketTransport: Not connected"),Z("info","cli_websocket_send_not_connected"),!1;try{return this.ws.send(J),this.lastActivityTime=Date.now(),!0}catch(K){return Y(`WebSocketTransport: Failed to send: ${K}`,{level:"error"}),Z("error","cli_websocket_send_error"),this.handleConnectionError(),!1}}removeWsListeners(J){if(this.isBunWs){let K=J;K.removeEventListener("open",this.onBunOpen),K.removeEventListener("message",this.onBunMessage),K.removeEventListener("error",this.onBunError),K.removeEventListener("close",this.onBunClose),K.removeEventListener("pong",this.onPong)}else{let K=J;K.off("open",this.onNodeOpen),K.off("message",this.onNodeMessage),K.off("error",this.onNodeError),K.off("close",this.onNodeClose),K.off("pong",this.onPong)}}doDisconnect(){if(this.stopPingInterval(),this.stopKeepaliveInterval(),z(),this.ws)this.removeWsListeners(this.ws),this.ws.close(),this.ws=null}handleConnectionError(J){if(Y(`WebSocketTransport: Disconnected from ${this.url.href}`+(J!=null?` (code ${J})`:"")),Z("info","cli_websocket_disconnected"),this.isBridge)q("tengu_ws_transport_closed",{closeCode:J,msSinceLastActivity:this.lastActivityTime>0?Date.now()-this.lastActivityTime:-1,wasConnected:this.state==="connected",reconnectAttempts:this.reconnectAttempts});if(this.doDisconnect(),this.state==="closing"||this.state==="closed")return;let K=!1;if(J===4003&&this.refreshHeaders){let $=this.refreshHeaders();if($.Authorization!==this.headers.Authorization)Object.assign(this.headers,$),K=!0,Y("WebSocketTransport: 4003 received but headers refreshed, scheduling reconnect"),Z("info","cli_websocket_4003_token_refreshed")}if(J!=null&&r.has(J)&&!K){Y(`WebSocketTransport: Permanent close code ${J}, not reconnecting`,{level:"error"}),Z("error","cli_websocket_permanent_close",{closeCode:J}),this.state="closed",this.onCloseCallback?.(J);return}if(!this.autoReconnect){this.state="closed",this.onCloseCallback?.(J);return}let Q=Date.now();if(!this.reconnectStartTime)this.reconnectStartTime=Q;if(this.lastReconnectAttemptTime!==null&&Q-this.lastReconnectAttemptTime>A)Y(`WebSocketTransport: Detected system sleep (${Math.round((Q-this.lastReconnectAttemptTime)/1000)}s gap), resetting reconnection budget`),Z("info","cli_websocket_sleep_detected",{gapMs:Q-this.lastReconnectAttemptTime}),this.reconnectStartTime=Q,this.reconnectAttempts=0;this.lastReconnectAttemptTime=Q;let X=Q-this.reconnectStartTime;if(X<t){if(this.reconnectTimer)clearTimeout(this.reconnectTimer),this.reconnectTimer=null;if(!K&&this.refreshHeaders){let B=this.refreshHeaders();Object.assign(this.headers,B),Y("WebSocketTransport: Refreshed headers for reconnect")}this.state="reconnecting",this.reconnectAttempts++;let $=Math.min(g*Math.pow(2,this.reconnectAttempts-1),D),G=Math.max(0,$+$*0.25*(2*Math.random()-1));if(Y(`WebSocketTransport: Reconnecting in ${Math.round(G)}ms (attempt ${this.reconnectAttempts}, ${Math.round(X/1000)}s elapsed)`),Z("error","cli_websocket_reconnect_attempt",{reconnectAttempts:this.reconnectAttempts}),this.isBridge)q("tengu_ws_transport_reconnecting",{attempt:this.reconnectAttempts,elapsedMs:X,delayMs:Math.round(G)});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},G)}else if(Y(`WebSocketTransport: Reconnection time budget exhausted after ${Math.round(X/1000)}s for ${this.url.href}`,{level:"error"}),Z("error","cli_websocket_reconnect_exhausted",{reconnectAttempts:this.reconnectAttempts,elapsedMs:X}),this.state="closed",this.onCloseCallback)this.onCloseCallback(J)}close(){if(this.reconnectTimer)clearTimeout(this.reconnectTimer),this.reconnectTimer=null;this.stopPingInterval(),this.stopKeepaliveInterval(),z(),this.state="closing",this.doDisconnect()}replayBufferedMessages(J){let K=this.messageBuffer.toArray();if(K.length===0)return;let Q=0;if(J){let $=K.findIndex((G)=>("uuid"in G)&&G.uuid===J);if($>=0){Q=$+1;let G=K.slice(Q);if(this.messageBuffer.clear(),this.messageBuffer.addAll(G),G.length===0)this.lastSentId=null;Y(`WebSocketTransport: Evicted ${Q} confirmed messages, ${G.length} remaining`),Z("info","cli_websocket_evicted_confirmed_messages",{evicted:Q,remaining:G.length})}}let X=K.slice(Q);if(X.length===0){Y("WebSocketTransport: No new messages to replay"),Z("info","cli_websocket_no_messages_to_replay");return}Y(`WebSocketTransport: Replaying ${X.length} buffered messages`),Z("info","cli_websocket_messages_to_replay",{count:X.length});for(let $ of X){let G=O($)+`
4
4
  `;if(!this.sendLine(G)){this.handleConnectionError();break}}}isConnectedStatus(){return this.state==="connected"}isClosedStatus(){return this.state==="closed"}setOnData(J){this.onData=J}setOnConnect(J){this.onConnectCallback=J}setOnClose(J){this.onCloseCallback=J}getStateLabel(){return this.state}async write(J){if("uuid"in J&&typeof J.uuid==="string")this.messageBuffer.add(J),this.lastSentId=J.uuid;let K=O(J)+`
5
5
  `;if(this.state!=="connected")return;let Q=this.sessionId?` session=${this.sessionId}`:"",X=this.getControlMessageDetailLabel(J);Y(`WebSocketTransport: Sending message type=${J.type}${Q}${X}`),this.sendLine(K)}getControlMessageDetailLabel(J){if(J.type==="control_request"){let{request_id:K,request:Q}=J,X=Q.subtype==="can_use_tool"?Q.tool_name:"";return` subtype=${Q.subtype} request_id=${K}${X?` tool=${X}`:""}`}if(J.type==="control_response"){let{subtype:K,request_id:Q}=J.response;return` subtype=${K} request_id=${Q}`}return""}startPingInterval(){this.stopPingInterval(),this.pongReceived=!0;let J=Date.now();this.pingInterval=setInterval(()=>{if(this.state==="connected"&&this.ws){let K=Date.now(),Q=K-J;if(J=K,Q>A){Y(`WebSocketTransport: ${Math.round(Q/1000)}s tick gap detected \u2014 process was suspended, forcing reconnect`),Z("info","cli_websocket_sleep_detected_on_ping",{gapMs:Q}),this.handleConnectionError();return}if(!this.pongReceived){Y("WebSocketTransport: No pong received, connection appears dead",{level:"error"}),Z("error","cli_websocket_pong_timeout"),this.handleConnectionError();return}this.pongReceived=!1;try{this.ws.ping?.()}catch(X){Y(`WebSocketTransport: Ping failed: ${X}`,{level:"error"}),Z("error","cli_websocket_ping_failed")}}},l)}stopPingInterval(){if(this.pingInterval)clearInterval(this.pingInterval),this.pingInterval=null}startKeepaliveInterval(){if(this.stopKeepaliveInterval(),H(process.env.CLAUDE_CODE_REMOTE))return;this.keepAliveInterval=setInterval(()=>{if(this.state==="connected"&&this.ws)try{this.ws.send(i),this.lastActivityTime=Date.now(),Y("WebSocketTransport: Sent periodic keep_alive data frame")}catch(J){Y(`WebSocketTransport: Periodic keep_alive failed: ${J}`,{level:"error"}),Z("error","cli_websocket_keepalive_failed")}},n)}stopKeepaliveInterval(){if(this.keepAliveInterval)clearInterval(this.keepAliveInterval),this.keepAliveInterval=null}}var s=100,e=15000,JJ=3000;class KJ extends L{postUrl;uploader;streamEventBuffer=[];streamEventTimer=null;constructor(J,K={},Q,X,$){super(J,K,Q,X,$);let{maxConsecutiveFailures:G,onBatchDropped:B}=$??{};this.postUrl=QJ(J),this.uploader=new T({maxBatchSize:500,maxQueueSize:1e5,baseDelayMs:500,maxDelayMs:8000,jitterMs:1000,maxConsecutiveFailures:G,onBatchDropped:(M,P)=>{Z("error","cli_hybrid_batch_dropped_max_failures",{batchSize:M,failures:P}),B?.(M,P)},send:(M)=>this.postOnce(M)}),Y(`HybridTransport: POST URL = ${this.postUrl}`),Z("info","cli_hybrid_transport_initialized")}async write(J){if(J.type==="stream_event"){if(this.streamEventBuffer.push(J),!this.streamEventTimer)this.streamEventTimer=setTimeout(()=>this.flushStreamEvents(),s);return}return await this.uploader.enqueue([...this.takeStreamEvents(),J]),this.uploader.flush()}async writeBatch(J){return await this.uploader.enqueue([...this.takeStreamEvents(),...J]),this.uploader.flush()}get droppedBatchCount(){return this.uploader.droppedBatchCount}flush(){return this.uploader.enqueue(this.takeStreamEvents()),this.uploader.flush()}takeStreamEvents(){if(this.streamEventTimer)clearTimeout(this.streamEventTimer),this.streamEventTimer=null;let J=this.streamEventBuffer;return this.streamEventBuffer=[],J}flushStreamEvents(){this.streamEventTimer=null,this.uploader.enqueue(this.takeStreamEvents())}close(){if(this.streamEventTimer)clearTimeout(this.streamEventTimer),this.streamEventTimer=null;this.streamEventBuffer=[];let J=this.uploader,K;Promise.race([J.flush(),new Promise((Q)=>{K=setTimeout(Q,JJ)})]).finally(()=>{clearTimeout(K),J.close()}),super.close()}async postOnce(J){let K=S();if(!K){Y("HybridTransport: No session token available for POST"),Z("warn","cli_hybrid_post_no_token");return}let Q={Authorization:`Bearer ${K}`,"Content-Type":"application/json"},X;try{X=await a.post(this.postUrl,{events:J},{headers:Q,validateStatus:()=>!0,timeout:e})}catch($){throw Y(`HybridTransport: POST error: ${$.message}`),Z("warn","cli_hybrid_post_network_error"),$}if(X.status>=200&&X.status<300){Y(`HybridTransport: POST success count=${J.length}`);return}if(X.status>=400&&X.status<500&&X.status!==429){Y(`HybridTransport: POST returned ${X.status} (permanent), dropping`),Z("warn","cli_hybrid_post_client_error",{status:X.status});return}throw Y(`HybridTransport: POST returned ${X.status} (retryable)`),Z("warn","cli_hybrid_post_retryable_error",{status:X.status}),Error(`POST failed with ${X.status}`)}}function QJ(J){let K=J.protocol==="wss:"?"https:":"http:",Q=J.pathname;if(Q=Q.replace("/ws/","/session/"),!Q.endsWith("/events"))Q=Q.endsWith("/")?Q+"events":Q+"/events";return`${K}//${J.host}${Q}${J.search}`}
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{nd as oq}from"./cli-g2s3391y.js";import{AF as t,BF as Xq,CF as Gq,Cn as Aq,DF as mq,Dn as Hq,EF as fq,FF as aq,Fn as gq,Hn as jq,In as Dq,Ip as a,Kp as o,Lp as i,Mp as c,Nn as r,Op as F,Pp as n,Rn as Yq,Sp as pq,Tn as T,Un as s,Vn as Cq,Xn as hq,Zk as Nq,ao as Mq,jo as uq,lp as Jq,op as dq}from"./cli-b3k8arn1.js";import{EV as bq,a3 as xq,zV as wq}from"./cli-192xnkcx.js";import{I8 as R,J8 as G,L8 as vq}from"./cli-8kpqq0ea.js";import{$8 as Iq,_8 as x}from"./cli-e5yek4vx.js";import{A_ as Sq,Z9 as I,d_ as Vq,j_ as Zq,x_ as kq}from"./cli-awb77t95.js";import{dda as zq,g$ as Pq}from"./cli-tafg3e9w.js";import{hda as l}from"./cli-qwx84m9c.js";var _q=l(()=>{Zq();xq()});import{basename as Fq}from"path";import{useCallback as g,useEffect as m,useRef as C}from"react";import{PromptListChangedNotificationSchema as Uq,ResourceListChangedNotificationSchema as Qq,ToolListChangedNotificationSchema as lq}from"@modelcontextprotocol/sdk/types.js";import rq from"lodash-es/omit.js";import $q from"lodash-es/reject.js";function Kq(w){let k="plugin"in w?w.plugin:"no-plugin";return`${w.type}:${w.source}:${k}`}function Oq(w,k){if(k.length===0)return;w((X)=>{let v=new Set(X.plugins.errors.map((D)=>Kq(D))),Z=k.filter((D)=>!v.has(Kq(D)));if(Z.length===0)return X;return{...X,plugins:{...X.plugins,errors:[...X.plugins.errors,...Z]}}})}function Wq(w,k=!1){let X=Gq(),v=t((q)=>q.authVersion),Z=t((q)=>q.mcp.pluginReconnectKey),D=Xq(),Y=C(new Map),b=C(new Set),u=C(null);m(()=>{},[D]);let{addNotification:N}=fq(),Eq=16,B=C([]),V=C(null),d=g(()=>{V.current=null;let q=B.current;if(q.length===0)return;B.current=[],D((z)=>{let P=z.mcp;for(let h of q){let{tools:$,commands:A,resources:M,..._}=h,H=_.type==="disabled"||_.type==="failed"?$??[]:$,K=_.type==="disabled"||_.type==="failed"?A??[]:A,J=_.type==="disabled"||_.type==="failed"?M??[]:M,j=wq(_.name),U=P.clients.findIndex((L)=>L.name===_.name)===-1?[...P.clients,_]:P.clients.map((L)=>L.name===_.name?_:L),p=H===void 0?P.tools:[...$q(P.tools,(L)=>L.name?.startsWith(j)),...H],y=K===void 0?P.commands:[...$q(P.commands,(L)=>hq(L,_.name)),...K],Q=J===void 0?P.resources:{...P.resources,...J.length>0?{[_.name]:J}:rq(P.resources,_.name)};P={...P,clients:U,tools:p,commands:y,resources:Q}}return{...z,mcp:P}})},[D]),f=g((q)=>{if(B.current.push(q),V.current===null)V.current=setTimeout(d,Eq)},[d]),W=g(({client:q,tools:z,commands:P,resources:h})=>{switch(f({...q,tools:z,commands:P,resources:h}),q.type){case"connected":{if(Jq(q.client,q.name,D),q.client.onclose=()=>{let $=q.config.type??"stdio";if(a(q.name,q.config).catch(()=>{kq(`Failed to invalidate the server cache: ${q.name}`)}),T(q.name)){G(q.name,"Server is disabled, skipping automatic reconnection");return}if($!=="stdio"&&$!=="sdk"){let A=cq($);G(q.name,`${A} transport closed/disconnected, attempting automatic reconnection`);let M=Y.current.get(q.name);if(M)clearTimeout(M),Y.current.delete(q.name);(async()=>{for(let H=1;H<=S;H++){if(T(q.name)){G(q.name,"Server disabled during reconnection, stopping retry"),Y.current.delete(q.name);return}f({...q,type:"pending",reconnectAttempt:H,maxReconnectAttempts:S});let K=Date.now();try{let j=await F(q.name,q.config),O=Date.now()-K;if(j.client.type==="connected"){G(q.name,`${A} reconnection successful after ${O}ms (attempt ${H})`),Y.current.delete(q.name),W(j);return}if(G(q.name,`${A} reconnection attempt ${H} completed with status: ${j.client.type}`),H===S){G(q.name,`Max reconnection attempts (${S}) reached, giving up`),Y.current.delete(q.name),W(j);return}}catch(j){let O=Date.now()-K;if(R(q.name,`${A} reconnection attempt ${H} failed after ${O}ms: ${j}`),H===S){G(q.name,`Max reconnection attempts (${S}) reached, giving up`),Y.current.delete(q.name),f({...q,type:"failed"});return}}let J=Math.min(sq*Math.pow(2,H-1),iq);G(q.name,`Scheduling reconnection attempt ${H+1} in ${J}ms`),await new Promise((j)=>{let O=setTimeout(j,J);Y.current.set(q.name,O)})}})()}else f({...q,type:"failed"})},!1)switch($.action){case"register":case"skip":}if(q.capabilities?.tools?.listChanged)q.client.setNotificationHandler(lq,async()=>{G(q.name,"Received tools/list_changed notification, refreshing tools");try{let $=o.cache.get(q.name);o.cache.delete(q.name);let A=await o(q),M=A.length;if($)$.then((_)=>{x("tengu_mcp_list_changed",{type:"tools",previousCount:_.length,newCount:M})},()=>{x("tengu_mcp_list_changed",{type:"tools",newCount:M})});else x("tengu_mcp_list_changed",{type:"tools",newCount:M});f({...q,tools:A})}catch($){R(q.name,`Failed to refresh tools after list_changed notification: ${I($)}`)}});if(q.capabilities?.prompts?.listChanged)q.client.setNotificationHandler(Uq,async()=>{G(q.name,"Received prompts/list_changed notification, refreshing prompts"),x("tengu_mcp_list_changed",{type:"prompts"});try{c.cache.delete(q.name);let[$,A]=await Promise.all([c(q),Promise.resolve([])]);f({...q,commands:[...$,...A]}),Bq?.()}catch($){R(q.name,`Failed to refresh prompts after list_changed notification: ${I($)}`)}});if(q.capabilities?.resources?.listChanged)q.client.setNotificationHandler(Qq,async()=>{G(q.name,"Received resources/list_changed notification, refreshing resources"),x("tengu_mcp_list_changed",{type:"resources"});try{i.cache.delete(q.name);{let $=await i(q);f({...q,resources:$})}}catch($){R(q.name,`Failed to refresh resources after list_changed notification: ${I($)}`)}});break}case"needs-auth":case"failed":case"pending":case"disabled":break}},[f]),qq=Pq();m(()=>{async function q(){let{servers:z,errors:P}=k?{servers:{},errors:[]}:await r(w),h={...z,...w};Oq(D,P),D(($)=>{let{stale:A,...M}=Mq($.mcp,h);for(let K of A){let J=Y.current.get(K.name);if(J)clearTimeout(J),Y.current.delete(K.name);if(K.type==="connected")K.client.onclose=void 0,a(K.name,K.config).catch(()=>{})}let _=new Set(M.clients.map((K)=>K.name)),H=Object.entries(h).filter(([K])=>!_.has(K)).map(([K,J])=>({name:K,type:T(K)?"disabled":"pending",config:J}));if(H.length===0&&A.length===0)return $;return{...$,mcp:{...$.mcp,...M,clients:[...M.clients,...H]}}})}q().catch((z)=>{R("useManageMCPConnections",`Failed to initialize servers as pending: ${I(z)}`)})},[k,w,D,qq,Z]),m(()=>{let q=!1;async function z(){let P;if(k||Yq())P=Promise.resolve({});else Hq(),P=Aq();let{servers:h,errors:$}=k?{servers:{},errors:[]}:await r(w,P);if(q)return;Oq(D,$);let A={...h,...w},M=Object.fromEntries(Object.entries(A).filter(([j])=>!T(j)));n(W,M).catch((j)=>{R("useManageMcpConnections",`Failed to get MCP resources: ${I(j)}`)});let _={};if(!k){if(_=Dq(await P).allowed,q)return;if(Object.keys(_).length>0){let{servers:j}=jq(_,A);_=j}if(Object.keys(_).length>0){D((O)=>{let U=new Set(O.mcp.clients.map((y)=>y.name)),p=Object.entries(_).filter(([y])=>!U.has(y)).map(([y,Q])=>({name:y,type:T(y)?"disabled":"pending",config:Q}));if(p.length===0)return O;return{...O,mcp:{...O.mcp,clients:[...O.mcp.clients,...p]}}});let j=Object.fromEntries(Object.entries(_).filter(([O])=>!T(O)));n(W,j).catch((O)=>{R("useManageMcpConnections",`Failed to get claude.ai MCP resources: ${I(O)}`)})}}let H={...A,..._},K={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0},J=[];for(let[j,O]of Object.entries(H)){if(O.scope==="enterprise")K.enterprise++;else if(O.scope==="user")K.global++;else if(O.scope==="project")K.project++;else if(O.scope==="local")K.user++;else if(O.scope==="dynamic")K.plugin++;else if(O.scope==="claudeai")K.claudeai++;if(process.env.USER_TYPE==="ant"&&!T(j)&&(O.type===void 0||O.type==="stdio")&&"command"in O)J.push(Fq(O.command))}x("tengu_mcp_servers",{...K,...process.env.USER_TYPE==="ant"&&J.length>0?{stdio_commands:J.sort().join(",")}:{}})}return z(),()=>{q=!0}},[k,w,W,D,v,qq,Z]),m(()=>{let q=Y.current;return()=>{for(let z of q.values())clearTimeout(z);if(q.clear(),V.current!==null)clearTimeout(V.current),V.current=null,d()}},[d]);let Rq=g(async(q)=>{let z=X.getState().mcp.clients.find(($)=>$.name===q);if(!z)throw Error(`MCP server ${q} not found`);let P=Y.current.get(q);if(P)clearTimeout(P),Y.current.delete(q);let h=await F(q,z.config);return W(h),h},[X,W]),Tq=g(async(q)=>{let z=X.getState().mcp.clients.find((h)=>h.name===q);if(!z)throw Error(`MCP server ${q} not found`);if(z.type!=="disabled"){let h=Y.current.get(q);if(h)clearTimeout(h),Y.current.delete(q);if(s(q,!1),z.type==="connected")await a(q,z.config);f({name:q,type:"disabled",config:z.config})}else{s(q,!0),f({name:q,type:"pending",config:z.config});let h=await F(q,z.config);W(h)}},[X,f,W]);return{reconnectMcpServer:Rq,toggleMcpServer:Tq}}function cq(w){switch(w){case"http":return"HTTP";case"ws":case"ws-ide":return"WebSocket";default:return"SSE"}}var Bq=null,S=5,sq=1000,iq=30000;var yq=l(()=>{zq();pq();Iq();Cq();Sq();zq();aq();mq();Vq();vq();Nq();oq();_q();gq();dq();bq();uq()});import{c as nq}from"react/compiler-runtime";import{createContext as tq,useContext as Lq}from"react";import{jsxDEV as eq}from"react/jsx-dev-runtime";function U6(){let w=Lq(e);if(!w)throw Error("useMcpReconnect must be used within MCPConnectionManager");return w.reconnectMcpServer}function Q6(){let w=Lq(e);if(!w)throw Error("useMcpToggleEnabled must be used within MCPConnectionManager");return w.toggleMcpServer}function l6(w){let k=nq(6),{children:X,dynamicMcpConfig:v,isStrictMcpConfig:Z}=w,{reconnectMcpServer:D,toggleMcpServer:Y}=Wq(v,Z),b;if(k[0]!==D||k[1]!==Y)b={reconnectMcpServer:D,toggleMcpServer:Y},k[0]=D,k[1]=Y,k[2]=b;else b=k[2];let u=b,N;if(k[3]!==X||k[4]!==u)N=eq(e.Provider,{value:u,children:X},void 0,!1,void 0,this),k[3]=X,k[4]=u,k[5]=N;else N=k[5];return N}var e;var q6=l(()=>{yq();e=tq(null)});
2
+ import{nd as oq}from"./cli-s5ee96g6.js";import{CF as t,Cn as Aq,DF as Xq,Dn as Hq,EF as Gq,FF as mq,Fn as gq,GF as fq,HF as aq,Hn as jq,In as Dq,Ip as a,Kp as o,Lp as i,Mp as c,Nn as r,Op as F,Pp as n,Rn as Yq,Sp as pq,Tn as T,Un as s,Vn as Cq,Xn as hq,Zk as Nq,ao as Mq,jo as uq,lp as Jq,op as dq}from"./cli-63389c5w.js";import{EV as wq,JV as bq,c3 as xq}from"./cli-9sjvqgf1.js";import{K8 as R,L8 as G,N8 as vq}from"./cli-eehgc06t.js";import{a9 as x,b9 as Iq}from"./cli-2dkq8dre.js";import{$9 as I,C_ as Sq,f_ as Vq,l_ as Zq,z_ as kq}from"./cli-bqs5smsv.js";import{fda as zq,i$ as Pq}from"./cli-ktzb7cwm.js";import{jda as l}from"./cli-2afdzhna.js";var _q=l(()=>{Zq();xq()});import{basename as Fq}from"path";import{useCallback as g,useEffect as m,useRef as C}from"react";import{PromptListChangedNotificationSchema as Uq,ResourceListChangedNotificationSchema as Qq,ToolListChangedNotificationSchema as lq}from"@modelcontextprotocol/sdk/types.js";import rq from"lodash-es/omit.js";import $q from"lodash-es/reject.js";function Kq(w){let k="plugin"in w?w.plugin:"no-plugin";return`${w.type}:${w.source}:${k}`}function Oq(w,k){if(k.length===0)return;w((X)=>{let v=new Set(X.plugins.errors.map((D)=>Kq(D))),Z=k.filter((D)=>!v.has(Kq(D)));if(Z.length===0)return X;return{...X,plugins:{...X.plugins,errors:[...X.plugins.errors,...Z]}}})}function Wq(w,k=!1){let X=Gq(),v=t((q)=>q.authVersion),Z=t((q)=>q.mcp.pluginReconnectKey),D=Xq(),Y=C(new Map),b=C(new Set),u=C(null);m(()=>{},[D]);let{addNotification:N}=fq(),Eq=16,B=C([]),V=C(null),d=g(()=>{V.current=null;let q=B.current;if(q.length===0)return;B.current=[],D((z)=>{let P=z.mcp;for(let h of q){let{tools:$,commands:A,resources:M,..._}=h,H=_.type==="disabled"||_.type==="failed"?$??[]:$,K=_.type==="disabled"||_.type==="failed"?A??[]:A,J=_.type==="disabled"||_.type==="failed"?M??[]:M,j=wq(_.name),U=P.clients.findIndex((L)=>L.name===_.name)===-1?[...P.clients,_]:P.clients.map((L)=>L.name===_.name?_:L),p=H===void 0?P.tools:[...$q(P.tools,(L)=>L.name?.startsWith(j)),...H],y=K===void 0?P.commands:[...$q(P.commands,(L)=>hq(L,_.name)),...K],Q=J===void 0?P.resources:{...P.resources,...J.length>0?{[_.name]:J}:rq(P.resources,_.name)};P={...P,clients:U,tools:p,commands:y,resources:Q}}return{...z,mcp:P}})},[D]),f=g((q)=>{if(B.current.push(q),V.current===null)V.current=setTimeout(d,Eq)},[d]),W=g(({client:q,tools:z,commands:P,resources:h})=>{switch(f({...q,tools:z,commands:P,resources:h}),q.type){case"connected":{if(Jq(q.client,q.name,D),q.client.onclose=()=>{let $=q.config.type??"stdio";if(a(q.name,q.config).catch(()=>{kq(`Failed to invalidate the server cache: ${q.name}`)}),T(q.name)){G(q.name,"Server is disabled, skipping automatic reconnection");return}if($!=="stdio"&&$!=="sdk"){let A=cq($);G(q.name,`${A} transport closed/disconnected, attempting automatic reconnection`);let M=Y.current.get(q.name);if(M)clearTimeout(M),Y.current.delete(q.name);(async()=>{for(let H=1;H<=S;H++){if(T(q.name)){G(q.name,"Server disabled during reconnection, stopping retry"),Y.current.delete(q.name);return}f({...q,type:"pending",reconnectAttempt:H,maxReconnectAttempts:S});let K=Date.now();try{let j=await F(q.name,q.config),O=Date.now()-K;if(j.client.type==="connected"){G(q.name,`${A} reconnection successful after ${O}ms (attempt ${H})`),Y.current.delete(q.name),W(j);return}if(G(q.name,`${A} reconnection attempt ${H} completed with status: ${j.client.type}`),H===S){G(q.name,`Max reconnection attempts (${S}) reached, giving up`),Y.current.delete(q.name),W(j);return}}catch(j){let O=Date.now()-K;if(R(q.name,`${A} reconnection attempt ${H} failed after ${O}ms: ${j}`),H===S){G(q.name,`Max reconnection attempts (${S}) reached, giving up`),Y.current.delete(q.name),f({...q,type:"failed"});return}}let J=Math.min(sq*Math.pow(2,H-1),iq);G(q.name,`Scheduling reconnection attempt ${H+1} in ${J}ms`),await new Promise((j)=>{let O=setTimeout(j,J);Y.current.set(q.name,O)})}})()}else f({...q,type:"failed"})},!1)switch($.action){case"register":case"skip":}if(q.capabilities?.tools?.listChanged)q.client.setNotificationHandler(lq,async()=>{G(q.name,"Received tools/list_changed notification, refreshing tools");try{let $=o.cache.get(q.name);o.cache.delete(q.name);let A=await o(q),M=A.length;if($)$.then((_)=>{x("tengu_mcp_list_changed",{type:"tools",previousCount:_.length,newCount:M})},()=>{x("tengu_mcp_list_changed",{type:"tools",newCount:M})});else x("tengu_mcp_list_changed",{type:"tools",newCount:M});f({...q,tools:A})}catch($){R(q.name,`Failed to refresh tools after list_changed notification: ${I($)}`)}});if(q.capabilities?.prompts?.listChanged)q.client.setNotificationHandler(Uq,async()=>{G(q.name,"Received prompts/list_changed notification, refreshing prompts"),x("tengu_mcp_list_changed",{type:"prompts"});try{c.cache.delete(q.name);let[$,A]=await Promise.all([c(q),Promise.resolve([])]);f({...q,commands:[...$,...A]}),Bq?.()}catch($){R(q.name,`Failed to refresh prompts after list_changed notification: ${I($)}`)}});if(q.capabilities?.resources?.listChanged)q.client.setNotificationHandler(Qq,async()=>{G(q.name,"Received resources/list_changed notification, refreshing resources"),x("tengu_mcp_list_changed",{type:"resources"});try{i.cache.delete(q.name);{let $=await i(q);f({...q,resources:$})}}catch($){R(q.name,`Failed to refresh resources after list_changed notification: ${I($)}`)}});break}case"needs-auth":case"failed":case"pending":case"disabled":break}},[f]),qq=Pq();m(()=>{async function q(){let{servers:z,errors:P}=k?{servers:{},errors:[]}:await r(w),h={...z,...w};Oq(D,P),D(($)=>{let{stale:A,...M}=Mq($.mcp,h);for(let K of A){let J=Y.current.get(K.name);if(J)clearTimeout(J),Y.current.delete(K.name);if(K.type==="connected")K.client.onclose=void 0,a(K.name,K.config).catch(()=>{})}let _=new Set(M.clients.map((K)=>K.name)),H=Object.entries(h).filter(([K])=>!_.has(K)).map(([K,J])=>({name:K,type:T(K)?"disabled":"pending",config:J}));if(H.length===0&&A.length===0)return $;return{...$,mcp:{...$.mcp,...M,clients:[...M.clients,...H]}}})}q().catch((z)=>{R("useManageMCPConnections",`Failed to initialize servers as pending: ${I(z)}`)})},[k,w,D,qq,Z]),m(()=>{let q=!1;async function z(){let P;if(k||Yq())P=Promise.resolve({});else Hq(),P=Aq();let{servers:h,errors:$}=k?{servers:{},errors:[]}:await r(w,P);if(q)return;Oq(D,$);let A={...h,...w},M=Object.fromEntries(Object.entries(A).filter(([j])=>!T(j)));n(W,M).catch((j)=>{R("useManageMcpConnections",`Failed to get MCP resources: ${I(j)}`)});let _={};if(!k){if(_=Dq(await P).allowed,q)return;if(Object.keys(_).length>0){let{servers:j}=jq(_,A);_=j}if(Object.keys(_).length>0){D((O)=>{let U=new Set(O.mcp.clients.map((y)=>y.name)),p=Object.entries(_).filter(([y])=>!U.has(y)).map(([y,Q])=>({name:y,type:T(y)?"disabled":"pending",config:Q}));if(p.length===0)return O;return{...O,mcp:{...O.mcp,clients:[...O.mcp.clients,...p]}}});let j=Object.fromEntries(Object.entries(_).filter(([O])=>!T(O)));n(W,j).catch((O)=>{R("useManageMcpConnections",`Failed to get claude.ai MCP resources: ${I(O)}`)})}}let H={...A,..._},K={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0},J=[];for(let[j,O]of Object.entries(H)){if(O.scope==="enterprise")K.enterprise++;else if(O.scope==="user")K.global++;else if(O.scope==="project")K.project++;else if(O.scope==="local")K.user++;else if(O.scope==="dynamic")K.plugin++;else if(O.scope==="claudeai")K.claudeai++;if(process.env.USER_TYPE==="ant"&&!T(j)&&(O.type===void 0||O.type==="stdio")&&"command"in O)J.push(Fq(O.command))}x("tengu_mcp_servers",{...K,...process.env.USER_TYPE==="ant"&&J.length>0?{stdio_commands:J.sort().join(",")}:{}})}return z(),()=>{q=!0}},[k,w,W,D,v,qq,Z]),m(()=>{let q=Y.current;return()=>{for(let z of q.values())clearTimeout(z);if(q.clear(),V.current!==null)clearTimeout(V.current),V.current=null,d()}},[d]);let Rq=g(async(q)=>{let z=X.getState().mcp.clients.find(($)=>$.name===q);if(!z)throw Error(`MCP server ${q} not found`);let P=Y.current.get(q);if(P)clearTimeout(P),Y.current.delete(q);let h=await F(q,z.config);return W(h),h},[X,W]),Tq=g(async(q)=>{let z=X.getState().mcp.clients.find((h)=>h.name===q);if(!z)throw Error(`MCP server ${q} not found`);if(z.type!=="disabled"){let h=Y.current.get(q);if(h)clearTimeout(h),Y.current.delete(q);if(s(q,!1),z.type==="connected")await a(q,z.config);f({name:q,type:"disabled",config:z.config})}else{s(q,!0),f({name:q,type:"pending",config:z.config});let h=await F(q,z.config);W(h)}},[X,f,W]);return{reconnectMcpServer:Rq,toggleMcpServer:Tq}}function cq(w){switch(w){case"http":return"HTTP";case"ws":case"ws-ide":return"WebSocket";default:return"SSE"}}var Bq=null,S=5,sq=1000,iq=30000;var yq=l(()=>{zq();pq();Iq();Cq();Sq();zq();aq();mq();Vq();vq();Nq();oq();_q();gq();dq();bq();uq()});import{c as nq}from"react/compiler-runtime";import{createContext as tq,useContext as Lq}from"react";import{jsxDEV as eq}from"react/jsx-dev-runtime";function U6(){let w=Lq(e);if(!w)throw Error("useMcpReconnect must be used within MCPConnectionManager");return w.reconnectMcpServer}function Q6(){let w=Lq(e);if(!w)throw Error("useMcpToggleEnabled must be used within MCPConnectionManager");return w.toggleMcpServer}function l6(w){let k=nq(6),{children:X,dynamicMcpConfig:v,isStrictMcpConfig:Z}=w,{reconnectMcpServer:D,toggleMcpServer:Y}=Wq(v,Z),b;if(k[0]!==D||k[1]!==Y)b={reconnectMcpServer:D,toggleMcpServer:Y},k[0]=D,k[1]=Y,k[2]=b;else b=k[2];let u=b,N;if(k[3]!==X||k[4]!==u)N=eq(e.Provider,{value:u,children:X},void 0,!1,void 0,this),k[3]=X,k[4]=u,k[5]=N;else N=k[5];return N}var e;var q6=l(()=>{yq();e=tq(null)});
3
3
  export{_q as dd,U6 as ed,Q6 as fd,l6 as gd,q6 as hd};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{hda as j}from"./cli-qwx84m9c.js";import{randomUUID as Y}from"crypto";var w=()=>{};function l(){return b}function i(G){b=G}function n(G){return H.has(G)?H.get(G):void 0}function r(G,J){H.set(G,J)}function s(G){return q.get(G)}function a(G,J){q.set(G,J)}function y(){b=null,H.clear(),q.clear()}function o(){return F}function E(G){F=G}function t(){F=void 0}var b=null,H,q,F;var L=j(()=>{H=new Map;q=new Map});function O(){let G=new Set;return{subscribe(J){return G.add(J),()=>{G.delete(J)}},emit(...J){for(let Q of G)Q(...J)},clear(){G.clear()}}}var _=()=>{};import{realpathSync as h}from"fs";import z from"lodash-es/sumBy.js";import{cwd as m}from"process";function k(){let G="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof h==="function"){let Q=m();try{G=h(Q).normalize("NFC")}catch{G=Q.normalize("NFC")}}return{originalCwd:G,projectRoot:G,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,turnHookDurationMs:0,turnToolDurationMs:0,turnClassifierDurationMs:0,turnToolCount:0,turnHookCount:0,turnClassifierCount:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:G,modelUsage:{},mainLoopModelOverride:void 0,initialMainLoopModel:null,modelStrings:null,isInteractive:!1,kairosActive:!1,strictToolResultPairing:!1,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,clientType:"cli",sessionSource:void 0,questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,flagSettingsInline:null,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:Y(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],chromeFlagOverride:void 0,useCoworkPlugins:!1,sessionBypassPermissionsMode:!1,scheduledTasksEnabled:!1,sessionCronTasks:[],sessionCreatedTeams:new Set,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,mainThreadAgentType:void 0,isRemoteMode:!1,replBridgeActive:!1,directConnectServerUrl:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],allowedChannels:[],hasDevChannels:!1,sessionProjectDir:null,promptCache1hAllowlist:null,promptCache1hEligible:null,afkModeHeaderLatched:null,fastModeHeaderLatched:null,cacheEditingHeaderLatched:null,thinkingClearLatched:null,promptId:null,lastMainRequestId:void 0,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}function Vx(){return x.sessionId}function Zx(G={}){if(G.setCurrentAsParent)x.parentSessionId=x.sessionId;return x.planSlugCache.delete(x.sessionId),x.sessionId=Y(),x.sessionProjectDir=null,x.sessionId}function $x(){return x.parentSessionId}function zx(G,J=null){x.planSlugCache.delete(x.sessionId),x.sessionId=G,x.sessionProjectDir=J,B.emit(G)}function Hx(){return x.sessionProjectDir}function Kx(){return x.originalCwd}function Xx(){return x.projectRoot}function Yx(G){x.originalCwd=G.normalize("NFC")}function bx(G){x.projectRoot=G.normalize("NFC")}function qx(){return x.cwd}function Fx(G){x.cwd=G.normalize("NFC")}function Ux(){return x.directConnectServerUrl}function Bx(G){x.directConnectServerUrl=G}function Wx(G,J){x.totalAPIDuration+=G,x.totalAPIDurationWithoutRetries+=J}function Nx(){x.totalAPIDuration=0,x.totalAPIDurationWithoutRetries=0,x.totalCostUSD=0}function fx(G,J,Q){x.modelUsage[Q]=J,x.totalCostUSD+=G}function Px(){return x.totalCostUSD}function Rx(){return x.totalAPIDuration}function wx(){return Date.now()-x.startTime}function yx(){return x.totalAPIDurationWithoutRetries}function Lx(){return x.totalToolDuration}function Ox(G){x.totalToolDuration+=G,x.turnToolDurationMs+=G,x.turnToolCount++}function _x(){return x.turnHookDurationMs}function hx(G){x.turnHookDurationMs+=G,x.turnHookCount++}function Dx(){x.turnHookDurationMs=0,x.turnHookCount=0}function Mx(){return x.turnHookCount}function kx(){return x.turnToolDurationMs}function Ix(){x.turnToolDurationMs=0,x.turnToolCount=0}function Cx(){return x.turnToolCount}function px(){return x.turnClassifierDurationMs}function gx(G){x.turnClassifierDurationMs+=G,x.turnClassifierCount++}function mx(){x.turnClassifierDurationMs=0,x.turnClassifierCount=0}function vx(){return x.turnClassifierCount}function cx(){return x.statsStore}function dx(G){x.statsStore=G}function ux(G){if(G)I();else W=!0}function lx(){if(W)I()}function I(){x.lastInteractionTime=Date.now(),W=!1}function ix(G,J){x.totalLinesAdded+=G,x.totalLinesRemoved+=J}function nx(){return x.totalLinesAdded}function rx(){return x.totalLinesRemoved}function sx(){return z(Object.values(x.modelUsage),"inputTokens")}function C(){return z(Object.values(x.modelUsage),"outputTokens")}function ax(){return z(Object.values(x.modelUsage),"cacheReadInputTokens")}function ox(){return z(Object.values(x.modelUsage),"cacheCreationInputTokens")}function Ex(){return z(Object.values(x.modelUsage),"webSearchRequests")}function tx(){return C()-N}function Ax(){return f}function Sx(G){N=C(),f=G,X=0}function ex(){return X}function Tx(){X++}function x0(){x.hasUnknownModelCost=!0}function G0(){return x.hasUnknownModelCost}function J0(){return x.lastMainRequestId}function Q0(G){x.lastMainRequestId=G}function V0(){return x.lastApiCompletionTimestamp}function Z0(G){x.lastApiCompletionTimestamp=G}function $0(){x.pendingPostCompaction=!0}function z0(){let G=x.pendingPostCompaction;return x.pendingPostCompaction=!1,G}function j0(){return x.lastInteractionTime}function H0(){if(K=!0,$)clearTimeout($);$=setTimeout(()=>{K=!1,$=void 0},p),$.unref?.()}function K0(){return K}async function X0(){while(K)await new Promise((G)=>setTimeout(G,p).unref?.())}function Y0(){return x.modelUsage}function b0(G){return x.modelUsage[G]}function q0(){return x.mainLoopModelOverride}function F0(){return x.initialMainLoopModel}function U0(G){x.mainLoopModelOverride=G}function B0(G){x.initialMainLoopModel=G}function W0(){return x.sdkBetas}function N0(G){x.sdkBetas=G}function f0(){x.totalCostUSD=0,x.totalAPIDuration=0,x.totalAPIDurationWithoutRetries=0,x.totalToolDuration=0,x.startTime=Date.now(),x.totalLinesAdded=0,x.totalLinesRemoved=0,x.hasUnknownModelCost=!1,x.modelUsage={},x.promptId=null}function P0({totalCostUSD:G,totalAPIDuration:J,totalAPIDurationWithoutRetries:Q,totalToolDuration:V,totalLinesAdded:Z,totalLinesRemoved:g,lastDuration:P,modelUsage:R}){if(x.totalCostUSD=G,x.totalAPIDuration=J,x.totalAPIDurationWithoutRetries=Q,x.totalToolDuration=V,x.totalLinesAdded=Z,x.totalLinesRemoved=g,R)x.modelUsage=R;if(P)x.startTime=Date.now()-P}function R0(){throw Error("resetStateForTests can only be called in tests")}function w0(){return x.modelStrings}function y0(G){x.modelStrings=G}function L0(){x.modelStrings=null}function O0(G,J){x.meter=G,x.sessionCounter=J("claude_code.session.count",{description:"Count of CLI sessions started"}),x.locCounter=J("claude_code.lines_of_code.count",{description:"Count of lines of code modified, with the 'type' attribute indicating whether lines were added or removed"}),x.prCounter=J("claude_code.pull_request.count",{description:"Number of pull requests created"}),x.commitCounter=J("claude_code.commit.count",{description:"Number of git commits created"}),x.costCounter=J("claude_code.cost.usage",{description:"Cost of the Claude Code session",unit:"USD"}),x.tokenCounter=J("claude_code.token.usage",{description:"Number of tokens used",unit:"tokens"}),x.codeEditToolDecisionCounter=J("claude_code.code_edit_tool.decision",{description:"Count of code editing tool permission decisions (accept/reject) for Edit, Write, and NotebookEdit tools"}),x.activeTimeCounter=J("claude_code.active_time.total",{description:"Total active time in seconds",unit:"s"})}function _0(){return x.meter}function h0(){return x.sessionCounter}function D0(){return x.locCounter}function M0(){return x.prCounter}function k0(){return x.commitCounter}function I0(){return x.costCounter}function C0(){return x.tokenCounter}function p0(){return x.codeEditToolDecisionCounter}function g0(){return x.activeTimeCounter}function m0(){return x.loggerProvider}function v0(G){x.loggerProvider=G}function c0(){return x.eventLogger}function d0(G){x.eventLogger=G}function u0(){return x.meterProvider}function l0(G){x.meterProvider=G}function i0(){return x.tracerProvider}function n0(G){x.tracerProvider=G}function v(){return!x.isInteractive}function r0(){return x.isInteractive}function s0(G){x.isInteractive=G}function a0(){return x.clientType}function o0(G){x.clientType=G}function E0(){return x.sdkAgentProgressSummariesEnabled}function t0(G){x.sdkAgentProgressSummariesEnabled=G}function A0(){return x.kairosActive}function S0(G){x.kairosActive=G}function e0(){return x.replBridgeActive}function T0(G){x.replBridgeActive=G}function x1(){return x.strictToolResultPairing}function G1(G){x.strictToolResultPairing=G}function J1(){return x.userMsgOptIn}function Q1(G){x.userMsgOptIn=G}function V1(){return x.sessionSource}function Z1(G){x.sessionSource=G}function $1(){return x.questionPreviewFormat}function z1(G){x.questionPreviewFormat=G}function j1(){return x.agentColorMap}function H1(){return x.flagSettingsPath}function K1(G){x.flagSettingsPath=G}function X1(){return x.flagSettingsInline}function Y1(G){x.flagSettingsInline=G}function b1(){return x.sessionIngressToken}function q1(G){x.sessionIngressToken=G}function F1(){return x.oauthTokenFromFd}function U1(G){x.oauthTokenFromFd=G}function B1(){return x.apiKeyFromFd}function W1(G){x.apiKeyFromFd=G}function N1(G){x.lastAPIRequest=G}function f1(){return x.lastAPIRequest}function P1(G){x.lastAPIRequestMessages=G}function R1(){return x.lastAPIRequestMessages}function w1(G){x.lastClassifierRequests=G}function y1(){return x.lastClassifierRequests}function L1(G){x.cachedClaudeMdContent=G}function O1(){return x.cachedClaudeMdContent}function _1(G){if(x.inMemoryErrorLog.length>=100)x.inMemoryErrorLog.shift();x.inMemoryErrorLog.push(G)}function h1(){return x.allowedSettingSources}function D1(G){x.allowedSettingSources=G}function M1(){return v()&&x.clientType!=="claude-vscode"}function k1(G){x.inlinePlugins=G}function I1(){return x.inlinePlugins}function C1(G){x.chromeFlagOverride=G}function p1(){return x.chromeFlagOverride}function g1(G){x.useCoworkPlugins=G,y()}function m1(){return x.useCoworkPlugins}function v1(G){x.sessionBypassPermissionsMode=G}function c1(){return x.sessionBypassPermissionsMode}function d1(G){x.scheduledTasksEnabled=G}function u1(){return x.scheduledTasksEnabled}function l1(){return x.sessionCronTasks}function i1(G){x.sessionCronTasks.push(G)}function n1(G){if(G.length===0)return 0;let J=new Set(G),Q=x.sessionCronTasks.filter((Z)=>!J.has(Z.id)),V=x.sessionCronTasks.length-Q.length;if(V===0)return 0;return x.sessionCronTasks=Q,V}function r1(G){x.sessionTrustAccepted=G}function s1(){return x.sessionTrustAccepted}function a1(G){x.sessionPersistenceDisabled=G}function o1(){return x.sessionPersistenceDisabled}function E1(){return x.hasExitedPlanMode}function t1(G){x.hasExitedPlanMode=G}function A1(){return x.needsPlanModeExitAttachment}function S1(G){x.needsPlanModeExitAttachment=G}function e1(G,J){if(J==="plan"&&G!=="plan")x.needsPlanModeExitAttachment=!1;if(G==="plan"&&J!=="plan")x.needsPlanModeExitAttachment=!0}function T1(){return x.needsAutoModeExitAttachment}function x2(G){x.needsAutoModeExitAttachment=G}function G2(G,J){if(G==="auto"&&J==="plan"||G==="plan"&&J==="auto")return;let Q=G==="auto",V=J==="auto";if(V&&!Q)x.needsAutoModeExitAttachment=!1;if(Q&&!V)x.needsAutoModeExitAttachment=!0}function J2(){return x.lspRecommendationShownThisSession}function Q2(G){x.lspRecommendationShownThisSession=G}function V2(G){x.initJsonSchema=G}function Z2(){return x.initJsonSchema}function $2(G){if(!x.registeredHooks)x.registeredHooks={};for(let[J,Q]of Object.entries(G)){let V=J;if(!x.registeredHooks[V])x.registeredHooks[V]=[];x.registeredHooks[V].push(...Q)}}function z2(){return x.registeredHooks}function j2(){x.registeredHooks=null}function H2(){if(!x.registeredHooks)return;let G={};for(let[J,Q]of Object.entries(x.registeredHooks)){let V=Q.filter((Z)=>!("pluginRoot"in Z));if(V.length>0)G[J]=V}x.registeredHooks=Object.keys(G).length>0?G:null}function K2(){x.initJsonSchema=null,x.registeredHooks=null}function X2(){return x.planSlugCache}function Y2(){return x.sessionCreatedTeams}function b2(G){x.teleportedSessionInfo={isTeleported:!0,hasLoggedFirstMessage:!1,sessionId:G.sessionId}}function q2(){return x.teleportedSessionInfo}function F2(){if(x.teleportedSessionInfo)x.teleportedSessionInfo.hasLoggedFirstMessage=!0}function U2(G,J,Q,V=null){let Z=`${V??""}:${G}`;x.invokedSkills.set(Z,{skillName:G,skillPath:J,content:Q,invokedAt:Date.now(),agentId:V})}function B2(){return x.invokedSkills}function W2(G){let J=G??null,Q=new Map;for(let[V,Z]of x.invokedSkills)if(Z.agentId===J)Q.set(V,Z);return Q}function N2(G){if(!G||G.size===0){x.invokedSkills.clear();return}for(let[J,Q]of x.invokedSkills)if(Q.agentId===null||!G.has(Q.agentId))x.invokedSkills.delete(J)}function f2(G){for(let[J,Q]of x.invokedSkills)if(Q.agentId===G)x.invokedSkills.delete(J)}function P2(G,J){if(process.env.USER_TYPE!=="ant")return;if(G.includes("exec")&&G.includes("claude-prompt-"))return;let Q=Date.now();if(x.slowOperations=x.slowOperations.filter((V)=>Q-V.timestamp<U),x.slowOperations.push({operation:G,durationMs:J,timestamp:Q}),x.slowOperations.length>D)x.slowOperations=x.slowOperations.slice(-D)}function R2(){if(x.slowOperations.length===0)return M;let G=Date.now();if(x.slowOperations.some((J)=>G-J.timestamp>=U)){if(x.slowOperations=x.slowOperations.filter((J)=>G-J.timestamp<U),x.slowOperations.length===0)return M}return x.slowOperations}function w2(){return x.mainThreadAgentType}function y2(G){x.mainThreadAgentType=G}function L2(){return x.isRemoteMode}function O2(G){x.isRemoteMode=G}function _2(){return x.systemPromptSectionCache}function h2(G,J){x.systemPromptSectionCache.set(G,J)}function D2(){x.systemPromptSectionCache.clear()}function M2(){return x.lastEmittedDate}function k2(G){x.lastEmittedDate=G}function I2(){return x.additionalDirectoriesForClaudeMd}function C2(G){x.additionalDirectoriesForClaudeMd=G}function p2(){return x.allowedChannels}function g2(G){x.allowedChannels=G}function m2(){return x.hasDevChannels}function v2(G){x.hasDevChannels=G}function c2(){return x.promptCache1hAllowlist}function d2(G){x.promptCache1hAllowlist=G}function u2(){return x.promptCache1hEligible}function l2(G){x.promptCache1hEligible=G}function i2(){return x.afkModeHeaderLatched}function n2(G){x.afkModeHeaderLatched=G}function r2(){return x.fastModeHeaderLatched}function s2(G){x.fastModeHeaderLatched=G}function a2(){return x.cacheEditingHeaderLatched}function o2(G){x.cacheEditingHeaderLatched=G}function E2(){return x.thinkingClearLatched}function t2(G){x.thinkingClearLatched=G}function A2(){x.afkModeHeaderLatched=null,x.fastModeHeaderLatched=null,x.cacheEditingHeaderLatched=null,x.thinkingClearLatched=null}function S2(){return x.promptId}function e2(G){x.promptId=G}var x,B,jx,W=!1,N=0,f=null,X=0,K=!1,$,p=150,D=10,U=1e4,M;var c=j(()=>{w();L();_();x=k();B=O(),jx=B.subscribe;M=[]});
3
- export{l as V_,i as W_,n as X_,r as Y_,s as Z_,a as __,y as $_,o as a$,E as b$,t as c$,L as d$,O as e$,_ as f$,Vx as g$,Zx as h$,$x as i$,zx as j$,jx as k$,Hx as l$,Kx as m$,Xx as n$,Yx as o$,bx as p$,qx as q$,Fx as r$,Ux as s$,Bx as t$,Wx as u$,Nx as v$,fx as w$,Px as x$,Rx as y$,wx as z$,yx as A$,Lx as B$,Ox as C$,_x as D$,hx as E$,Dx as F$,Mx as G$,kx as H$,Ix as I$,Cx as J$,px as K$,gx as L$,mx as M$,vx as N$,cx as O$,dx as P$,ux as Q$,lx as R$,ix as S$,nx as T$,rx as U$,sx as V$,C as W$,ax as X$,ox as Y$,Ex as Z$,tx as _$,Ax as $$,Sx as aaa,ex as baa,Tx as caa,x0 as daa,G0 as eaa,J0 as faa,Q0 as gaa,V0 as haa,Z0 as iaa,$0 as jaa,z0 as kaa,j0 as laa,H0 as maa,K0 as naa,X0 as oaa,Y0 as paa,b0 as qaa,q0 as raa,F0 as saa,U0 as taa,B0 as uaa,W0 as vaa,N0 as waa,f0 as xaa,P0 as yaa,R0 as zaa,w0 as Aaa,y0 as Baa,L0 as Caa,O0 as Daa,_0 as Eaa,h0 as Faa,D0 as Gaa,M0 as Haa,k0 as Iaa,I0 as Jaa,C0 as Kaa,p0 as Laa,g0 as Maa,m0 as Naa,v0 as Oaa,c0 as Paa,d0 as Qaa,u0 as Raa,l0 as Saa,i0 as Taa,n0 as Uaa,v as Vaa,r0 as Waa,s0 as Xaa,a0 as Yaa,o0 as Zaa,E0 as _aa,t0 as $aa,A0 as aba,S0 as bba,e0 as cba,T0 as dba,x1 as eba,G1 as fba,J1 as gba,Q1 as hba,V1 as iba,Z1 as jba,$1 as kba,z1 as lba,j1 as mba,H1 as nba,K1 as oba,X1 as pba,Y1 as qba,b1 as rba,q1 as sba,F1 as tba,U1 as uba,B1 as vba,W1 as wba,N1 as xba,f1 as yba,P1 as zba,R1 as Aba,w1 as Bba,y1 as Cba,L1 as Dba,O1 as Eba,_1 as Fba,h1 as Gba,D1 as Hba,M1 as Iba,k1 as Jba,I1 as Kba,C1 as Lba,p1 as Mba,g1 as Nba,m1 as Oba,v1 as Pba,c1 as Qba,d1 as Rba,u1 as Sba,l1 as Tba,i1 as Uba,n1 as Vba,r1 as Wba,s1 as Xba,a1 as Yba,o1 as Zba,E1 as _ba,t1 as $ba,A1 as aca,S1 as bca,e1 as cca,T1 as dca,x2 as eca,G2 as fca,J2 as gca,Q2 as hca,V2 as ica,Z2 as jca,$2 as kca,z2 as lca,j2 as mca,H2 as nca,K2 as oca,X2 as pca,Y2 as qca,b2 as rca,q2 as sca,F2 as tca,U2 as uca,B2 as vca,W2 as wca,N2 as xca,f2 as yca,P2 as zca,R2 as Aca,w2 as Bca,y2 as Cca,L2 as Dca,O2 as Eca,_2 as Fca,h2 as Gca,D2 as Hca,M2 as Ica,k2 as Jca,I2 as Kca,C2 as Lca,p2 as Mca,g2 as Nca,m2 as Oca,v2 as Pca,c2 as Qca,d2 as Rca,u2 as Sca,l2 as Tca,i2 as Uca,n2 as Vca,r2 as Wca,s2 as Xca,a2 as Yca,o2 as Zca,E2 as _ca,t2 as $ca,A2 as ada,S2 as bda,e2 as cda,c as dda};
2
+ import{jda as j}from"./cli-2afdzhna.js";import{randomUUID as Y}from"crypto";var w=()=>{};function l(){return b}function i(G){b=G}function n(G){return H.has(G)?H.get(G):void 0}function r(G,J){H.set(G,J)}function s(G){return q.get(G)}function a(G,J){q.set(G,J)}function y(){b=null,H.clear(),q.clear()}function o(){return F}function E(G){F=G}function t(){F=void 0}var b=null,H,q,F;var L=j(()=>{H=new Map;q=new Map});function O(){let G=new Set;return{subscribe(J){return G.add(J),()=>{G.delete(J)}},emit(...J){for(let Q of G)Q(...J)},clear(){G.clear()}}}var _=()=>{};import{realpathSync as h}from"fs";import z from"lodash-es/sumBy.js";import{cwd as m}from"process";function k(){let G="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof h==="function"){let Q=m();try{G=h(Q).normalize("NFC")}catch{G=Q.normalize("NFC")}}return{originalCwd:G,projectRoot:G,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,turnHookDurationMs:0,turnToolDurationMs:0,turnClassifierDurationMs:0,turnToolCount:0,turnHookCount:0,turnClassifierCount:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:G,modelUsage:{},mainLoopModelOverride:void 0,initialMainLoopModel:null,modelStrings:null,isInteractive:!1,kairosActive:!1,strictToolResultPairing:!1,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,clientType:"cli",sessionSource:void 0,questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,flagSettingsInline:null,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:Y(),parentSessionId:void 0,loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],chromeFlagOverride:void 0,useCoworkPlugins:!1,sessionBypassPermissionsMode:!1,scheduledTasksEnabled:!1,sessionCronTasks:[],sessionCreatedTeams:new Set,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,mainThreadAgentType:void 0,isRemoteMode:!1,replBridgeActive:!1,directConnectServerUrl:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],allowedChannels:[],hasDevChannels:!1,sessionProjectDir:null,promptCache1hAllowlist:null,promptCache1hEligible:null,afkModeHeaderLatched:null,fastModeHeaderLatched:null,cacheEditingHeaderLatched:null,thinkingClearLatched:null,promptId:null,lastMainRequestId:void 0,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}function Vx(){return x.sessionId}function Zx(G={}){if(G.setCurrentAsParent)x.parentSessionId=x.sessionId;return x.planSlugCache.delete(x.sessionId),x.sessionId=Y(),x.sessionProjectDir=null,x.sessionId}function $x(){return x.parentSessionId}function zx(G,J=null){x.planSlugCache.delete(x.sessionId),x.sessionId=G,x.sessionProjectDir=J,B.emit(G)}function Hx(){return x.sessionProjectDir}function Kx(){return x.originalCwd}function Xx(){return x.projectRoot}function Yx(G){x.originalCwd=G.normalize("NFC")}function bx(G){x.projectRoot=G.normalize("NFC")}function qx(){return x.cwd}function Fx(G){x.cwd=G.normalize("NFC")}function Ux(){return x.directConnectServerUrl}function Bx(G){x.directConnectServerUrl=G}function Wx(G,J){x.totalAPIDuration+=G,x.totalAPIDurationWithoutRetries+=J}function Nx(){x.totalAPIDuration=0,x.totalAPIDurationWithoutRetries=0,x.totalCostUSD=0}function fx(G,J,Q){x.modelUsage[Q]=J,x.totalCostUSD+=G}function Px(){return x.totalCostUSD}function Rx(){return x.totalAPIDuration}function wx(){return Date.now()-x.startTime}function yx(){return x.totalAPIDurationWithoutRetries}function Lx(){return x.totalToolDuration}function Ox(G){x.totalToolDuration+=G,x.turnToolDurationMs+=G,x.turnToolCount++}function _x(){return x.turnHookDurationMs}function hx(G){x.turnHookDurationMs+=G,x.turnHookCount++}function Dx(){x.turnHookDurationMs=0,x.turnHookCount=0}function Mx(){return x.turnHookCount}function kx(){return x.turnToolDurationMs}function Ix(){x.turnToolDurationMs=0,x.turnToolCount=0}function Cx(){return x.turnToolCount}function px(){return x.turnClassifierDurationMs}function gx(G){x.turnClassifierDurationMs+=G,x.turnClassifierCount++}function mx(){x.turnClassifierDurationMs=0,x.turnClassifierCount=0}function vx(){return x.turnClassifierCount}function cx(){return x.statsStore}function dx(G){x.statsStore=G}function ux(G){if(G)I();else W=!0}function lx(){if(W)I()}function I(){x.lastInteractionTime=Date.now(),W=!1}function ix(G,J){x.totalLinesAdded+=G,x.totalLinesRemoved+=J}function nx(){return x.totalLinesAdded}function rx(){return x.totalLinesRemoved}function sx(){return z(Object.values(x.modelUsage),"inputTokens")}function C(){return z(Object.values(x.modelUsage),"outputTokens")}function ax(){return z(Object.values(x.modelUsage),"cacheReadInputTokens")}function ox(){return z(Object.values(x.modelUsage),"cacheCreationInputTokens")}function Ex(){return z(Object.values(x.modelUsage),"webSearchRequests")}function tx(){return C()-N}function Ax(){return f}function Sx(G){N=C(),f=G,X=0}function ex(){return X}function Tx(){X++}function x0(){x.hasUnknownModelCost=!0}function G0(){return x.hasUnknownModelCost}function J0(){return x.lastMainRequestId}function Q0(G){x.lastMainRequestId=G}function V0(){return x.lastApiCompletionTimestamp}function Z0(G){x.lastApiCompletionTimestamp=G}function $0(){x.pendingPostCompaction=!0}function z0(){let G=x.pendingPostCompaction;return x.pendingPostCompaction=!1,G}function j0(){return x.lastInteractionTime}function H0(){if(K=!0,$)clearTimeout($);$=setTimeout(()=>{K=!1,$=void 0},p),$.unref?.()}function K0(){return K}async function X0(){while(K)await new Promise((G)=>setTimeout(G,p).unref?.())}function Y0(){return x.modelUsage}function b0(G){return x.modelUsage[G]}function q0(){return x.mainLoopModelOverride}function F0(){return x.initialMainLoopModel}function U0(G){x.mainLoopModelOverride=G}function B0(G){x.initialMainLoopModel=G}function W0(){return x.sdkBetas}function N0(G){x.sdkBetas=G}function f0(){x.totalCostUSD=0,x.totalAPIDuration=0,x.totalAPIDurationWithoutRetries=0,x.totalToolDuration=0,x.startTime=Date.now(),x.totalLinesAdded=0,x.totalLinesRemoved=0,x.hasUnknownModelCost=!1,x.modelUsage={},x.promptId=null}function P0({totalCostUSD:G,totalAPIDuration:J,totalAPIDurationWithoutRetries:Q,totalToolDuration:V,totalLinesAdded:Z,totalLinesRemoved:g,lastDuration:P,modelUsage:R}){if(x.totalCostUSD=G,x.totalAPIDuration=J,x.totalAPIDurationWithoutRetries=Q,x.totalToolDuration=V,x.totalLinesAdded=Z,x.totalLinesRemoved=g,R)x.modelUsage=R;if(P)x.startTime=Date.now()-P}function R0(){throw Error("resetStateForTests can only be called in tests")}function w0(){return x.modelStrings}function y0(G){x.modelStrings=G}function L0(){x.modelStrings=null}function O0(G,J){x.meter=G,x.sessionCounter=J("claude_code.session.count",{description:"Count of CLI sessions started"}),x.locCounter=J("claude_code.lines_of_code.count",{description:"Count of lines of code modified, with the 'type' attribute indicating whether lines were added or removed"}),x.prCounter=J("claude_code.pull_request.count",{description:"Number of pull requests created"}),x.commitCounter=J("claude_code.commit.count",{description:"Number of git commits created"}),x.costCounter=J("claude_code.cost.usage",{description:"Cost of the Claude Code session",unit:"USD"}),x.tokenCounter=J("claude_code.token.usage",{description:"Number of tokens used",unit:"tokens"}),x.codeEditToolDecisionCounter=J("claude_code.code_edit_tool.decision",{description:"Count of code editing tool permission decisions (accept/reject) for Edit, Write, and NotebookEdit tools"}),x.activeTimeCounter=J("claude_code.active_time.total",{description:"Total active time in seconds",unit:"s"})}function _0(){return x.meter}function h0(){return x.sessionCounter}function D0(){return x.locCounter}function M0(){return x.prCounter}function k0(){return x.commitCounter}function I0(){return x.costCounter}function C0(){return x.tokenCounter}function p0(){return x.codeEditToolDecisionCounter}function g0(){return x.activeTimeCounter}function m0(){return x.loggerProvider}function v0(G){x.loggerProvider=G}function c0(){return x.eventLogger}function d0(G){x.eventLogger=G}function u0(){return x.meterProvider}function l0(G){x.meterProvider=G}function i0(){return x.tracerProvider}function n0(G){x.tracerProvider=G}function v(){return!x.isInteractive}function r0(){return x.isInteractive}function s0(G){x.isInteractive=G}function a0(){return x.clientType}function o0(G){x.clientType=G}function E0(){return x.sdkAgentProgressSummariesEnabled}function t0(G){x.sdkAgentProgressSummariesEnabled=G}function A0(){return x.kairosActive}function S0(G){x.kairosActive=G}function e0(){return x.replBridgeActive}function T0(G){x.replBridgeActive=G}function x1(){return x.strictToolResultPairing}function G1(G){x.strictToolResultPairing=G}function J1(){return x.userMsgOptIn}function Q1(G){x.userMsgOptIn=G}function V1(){return x.sessionSource}function Z1(G){x.sessionSource=G}function $1(){return x.questionPreviewFormat}function z1(G){x.questionPreviewFormat=G}function j1(){return x.agentColorMap}function H1(){return x.flagSettingsPath}function K1(G){x.flagSettingsPath=G}function X1(){return x.flagSettingsInline}function Y1(G){x.flagSettingsInline=G}function b1(){return x.sessionIngressToken}function q1(G){x.sessionIngressToken=G}function F1(){return x.oauthTokenFromFd}function U1(G){x.oauthTokenFromFd=G}function B1(){return x.apiKeyFromFd}function W1(G){x.apiKeyFromFd=G}function N1(G){x.lastAPIRequest=G}function f1(){return x.lastAPIRequest}function P1(G){x.lastAPIRequestMessages=G}function R1(){return x.lastAPIRequestMessages}function w1(G){x.lastClassifierRequests=G}function y1(){return x.lastClassifierRequests}function L1(G){x.cachedClaudeMdContent=G}function O1(){return x.cachedClaudeMdContent}function _1(G){if(x.inMemoryErrorLog.length>=100)x.inMemoryErrorLog.shift();x.inMemoryErrorLog.push(G)}function h1(){return x.allowedSettingSources}function D1(G){x.allowedSettingSources=G}function M1(){return v()&&x.clientType!=="claude-vscode"}function k1(G){x.inlinePlugins=G}function I1(){return x.inlinePlugins}function C1(G){x.chromeFlagOverride=G}function p1(){return x.chromeFlagOverride}function g1(G){x.useCoworkPlugins=G,y()}function m1(){return x.useCoworkPlugins}function v1(G){x.sessionBypassPermissionsMode=G}function c1(){return x.sessionBypassPermissionsMode}function d1(G){x.scheduledTasksEnabled=G}function u1(){return x.scheduledTasksEnabled}function l1(){return x.sessionCronTasks}function i1(G){x.sessionCronTasks.push(G)}function n1(G){if(G.length===0)return 0;let J=new Set(G),Q=x.sessionCronTasks.filter((Z)=>!J.has(Z.id)),V=x.sessionCronTasks.length-Q.length;if(V===0)return 0;return x.sessionCronTasks=Q,V}function r1(G){x.sessionTrustAccepted=G}function s1(){return x.sessionTrustAccepted}function a1(G){x.sessionPersistenceDisabled=G}function o1(){return x.sessionPersistenceDisabled}function E1(){return x.hasExitedPlanMode}function t1(G){x.hasExitedPlanMode=G}function A1(){return x.needsPlanModeExitAttachment}function S1(G){x.needsPlanModeExitAttachment=G}function e1(G,J){if(J==="plan"&&G!=="plan")x.needsPlanModeExitAttachment=!1;if(G==="plan"&&J!=="plan")x.needsPlanModeExitAttachment=!0}function T1(){return x.needsAutoModeExitAttachment}function x2(G){x.needsAutoModeExitAttachment=G}function G2(G,J){if(G==="auto"&&J==="plan"||G==="plan"&&J==="auto")return;let Q=G==="auto",V=J==="auto";if(V&&!Q)x.needsAutoModeExitAttachment=!1;if(Q&&!V)x.needsAutoModeExitAttachment=!0}function J2(){return x.lspRecommendationShownThisSession}function Q2(G){x.lspRecommendationShownThisSession=G}function V2(G){x.initJsonSchema=G}function Z2(){return x.initJsonSchema}function $2(G){if(!x.registeredHooks)x.registeredHooks={};for(let[J,Q]of Object.entries(G)){let V=J;if(!x.registeredHooks[V])x.registeredHooks[V]=[];x.registeredHooks[V].push(...Q)}}function z2(){return x.registeredHooks}function j2(){x.registeredHooks=null}function H2(){if(!x.registeredHooks)return;let G={};for(let[J,Q]of Object.entries(x.registeredHooks)){let V=Q.filter((Z)=>!("pluginRoot"in Z));if(V.length>0)G[J]=V}x.registeredHooks=Object.keys(G).length>0?G:null}function K2(){x.initJsonSchema=null,x.registeredHooks=null}function X2(){return x.planSlugCache}function Y2(){return x.sessionCreatedTeams}function b2(G){x.teleportedSessionInfo={isTeleported:!0,hasLoggedFirstMessage:!1,sessionId:G.sessionId}}function q2(){return x.teleportedSessionInfo}function F2(){if(x.teleportedSessionInfo)x.teleportedSessionInfo.hasLoggedFirstMessage=!0}function U2(G,J,Q,V=null){let Z=`${V??""}:${G}`;x.invokedSkills.set(Z,{skillName:G,skillPath:J,content:Q,invokedAt:Date.now(),agentId:V})}function B2(){return x.invokedSkills}function W2(G){let J=G??null,Q=new Map;for(let[V,Z]of x.invokedSkills)if(Z.agentId===J)Q.set(V,Z);return Q}function N2(G){if(!G||G.size===0){x.invokedSkills.clear();return}for(let[J,Q]of x.invokedSkills)if(Q.agentId===null||!G.has(Q.agentId))x.invokedSkills.delete(J)}function f2(G){for(let[J,Q]of x.invokedSkills)if(Q.agentId===G)x.invokedSkills.delete(J)}function P2(G,J){if(process.env.USER_TYPE!=="ant")return;if(G.includes("exec")&&G.includes("claude-prompt-"))return;let Q=Date.now();if(x.slowOperations=x.slowOperations.filter((V)=>Q-V.timestamp<U),x.slowOperations.push({operation:G,durationMs:J,timestamp:Q}),x.slowOperations.length>D)x.slowOperations=x.slowOperations.slice(-D)}function R2(){if(x.slowOperations.length===0)return M;let G=Date.now();if(x.slowOperations.some((J)=>G-J.timestamp>=U)){if(x.slowOperations=x.slowOperations.filter((J)=>G-J.timestamp<U),x.slowOperations.length===0)return M}return x.slowOperations}function w2(){return x.mainThreadAgentType}function y2(G){x.mainThreadAgentType=G}function L2(){return x.isRemoteMode}function O2(G){x.isRemoteMode=G}function _2(){return x.systemPromptSectionCache}function h2(G,J){x.systemPromptSectionCache.set(G,J)}function D2(){x.systemPromptSectionCache.clear()}function M2(){return x.lastEmittedDate}function k2(G){x.lastEmittedDate=G}function I2(){return x.additionalDirectoriesForClaudeMd}function C2(G){x.additionalDirectoriesForClaudeMd=G}function p2(){return x.allowedChannels}function g2(G){x.allowedChannels=G}function m2(){return x.hasDevChannels}function v2(G){x.hasDevChannels=G}function c2(){return x.promptCache1hAllowlist}function d2(G){x.promptCache1hAllowlist=G}function u2(){return x.promptCache1hEligible}function l2(G){x.promptCache1hEligible=G}function i2(){return x.afkModeHeaderLatched}function n2(G){x.afkModeHeaderLatched=G}function r2(){return x.fastModeHeaderLatched}function s2(G){x.fastModeHeaderLatched=G}function a2(){return x.cacheEditingHeaderLatched}function o2(G){x.cacheEditingHeaderLatched=G}function E2(){return x.thinkingClearLatched}function t2(G){x.thinkingClearLatched=G}function A2(){x.afkModeHeaderLatched=null,x.fastModeHeaderLatched=null,x.cacheEditingHeaderLatched=null,x.thinkingClearLatched=null}function S2(){return x.promptId}function e2(G){x.promptId=G}var x,B,jx,W=!1,N=0,f=null,X=0,K=!1,$,p=150,D=10,U=1e4,M;var c=j(()=>{w();L();_();x=k();B=O(),jx=B.subscribe;M=[]});
3
+ export{l as X_,i as Y_,n as Z_,r as __,s as $_,a as a$,y as b$,o as c$,E as d$,t as e$,L as f$,O as g$,_ as h$,Vx as i$,Zx as j$,$x as k$,zx as l$,jx as m$,Hx as n$,Kx as o$,Xx as p$,Yx as q$,bx as r$,qx as s$,Fx as t$,Ux as u$,Bx as v$,Wx as w$,Nx as x$,fx as y$,Px as z$,Rx as A$,wx as B$,yx as C$,Lx as D$,Ox as E$,_x as F$,hx as G$,Dx as H$,Mx as I$,kx as J$,Ix as K$,Cx as L$,px as M$,gx as N$,mx as O$,vx as P$,cx as Q$,dx as R$,ux as S$,lx as T$,ix as U$,nx as V$,rx as W$,sx as X$,C as Y$,ax as Z$,ox as _$,Ex as $$,tx as aaa,Ax as baa,Sx as caa,ex as daa,Tx as eaa,x0 as faa,G0 as gaa,J0 as haa,Q0 as iaa,V0 as jaa,Z0 as kaa,$0 as laa,z0 as maa,j0 as naa,H0 as oaa,K0 as paa,X0 as qaa,Y0 as raa,b0 as saa,q0 as taa,F0 as uaa,U0 as vaa,B0 as waa,W0 as xaa,N0 as yaa,f0 as zaa,P0 as Aaa,R0 as Baa,w0 as Caa,y0 as Daa,L0 as Eaa,O0 as Faa,_0 as Gaa,h0 as Haa,D0 as Iaa,M0 as Jaa,k0 as Kaa,I0 as Laa,C0 as Maa,p0 as Naa,g0 as Oaa,m0 as Paa,v0 as Qaa,c0 as Raa,d0 as Saa,u0 as Taa,l0 as Uaa,i0 as Vaa,n0 as Waa,v as Xaa,r0 as Yaa,s0 as Zaa,a0 as _aa,o0 as $aa,E0 as aba,t0 as bba,A0 as cba,S0 as dba,e0 as eba,T0 as fba,x1 as gba,G1 as hba,J1 as iba,Q1 as jba,V1 as kba,Z1 as lba,$1 as mba,z1 as nba,j1 as oba,H1 as pba,K1 as qba,X1 as rba,Y1 as sba,b1 as tba,q1 as uba,F1 as vba,U1 as wba,B1 as xba,W1 as yba,N1 as zba,f1 as Aba,P1 as Bba,R1 as Cba,w1 as Dba,y1 as Eba,L1 as Fba,O1 as Gba,_1 as Hba,h1 as Iba,D1 as Jba,M1 as Kba,k1 as Lba,I1 as Mba,C1 as Nba,p1 as Oba,g1 as Pba,m1 as Qba,v1 as Rba,c1 as Sba,d1 as Tba,u1 as Uba,l1 as Vba,i1 as Wba,n1 as Xba,r1 as Yba,s1 as Zba,a1 as _ba,o1 as $ba,E1 as aca,t1 as bca,A1 as cca,S1 as dca,e1 as eca,T1 as fca,x2 as gca,G2 as hca,J2 as ica,Q2 as jca,V2 as kca,Z2 as lca,$2 as mca,z2 as nca,j2 as oca,H2 as pca,K2 as qca,X2 as rca,Y2 as sca,b2 as tca,q2 as uca,F2 as vca,U2 as wca,B2 as xca,W2 as yca,N2 as zca,f2 as Aca,P2 as Bca,R2 as Cca,w2 as Dca,y2 as Eca,L2 as Fca,O2 as Gca,_2 as Hca,h2 as Ica,D2 as Jca,M2 as Kca,k2 as Lca,I2 as Mca,C2 as Nca,p2 as Oca,g2 as Pca,m2 as Qca,v2 as Rca,c2 as Sca,d2 as Tca,u2 as Uca,l2 as Vca,i2 as Wca,n2 as Xca,r2 as Yca,s2 as Zca,a2 as _ca,o2 as $ca,E2 as ada,t2 as bda,A2 as cda,S2 as dda,e2 as eda,c as fda};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{qa as P}from"./cli-b8j8bm5m.js";import{pd as M,td as Bq}from"./cli-g2s3391y.js";import{AF as h,BC as s,BF as A,Bn as o,DF as e,EF as _,FF as qq,PD as f,Pi as O,Qi as p,SD as r,dx as L,ex as t,ix as N,kx as a,qw as k,ww as n,zC as E,zn as R}from"./cli-b3k8arn1.js";import{d4 as K,f4 as l}from"./cli-r43jhzwm.js";import{Q6 as I,S6 as d}from"./cli-yb5m6jwq.js";import{G8 as F,L8 as i}from"./cli-8kpqq0ea.js";import{$8 as b,_8 as y}from"./cli-e5yek4vx.js";import{A_ as m,Y9 as D,d_ as g,x_ as H}from"./cli-awb77t95.js";qq();b();a();e();l();m();d();g();i();p();s();n();t();o();import{useCallback as Gq,useEffect as x}from"react";Bq();r();function Iq({enabled:Y=!0}={}){let $=A(),U=h((G)=>G.plugins.needsRefresh),{addNotification:Z}=_(),j=Gq(async()=>{try{let{enabled:G,disabled:T,errors:Q}=await f();await P();let V=M();if(Object.keys(V).length>0)Z({key:"plugin-delisted-flagged",text:"Plugins flagged. Check /plugins",color:"warning",priority:"high"});let W=[],X=[];try{W=await E()}catch(q){let B=q instanceof Error?q.message:String(q);Q.push({type:"generic-error",source:"plugin-commands",error:`Failed to load plugin commands: ${B}`})}try{X=await O()}catch(q){let B=q instanceof Error?q.message:String(q);Q.push({type:"generic-error",source:"plugin-agents",error:`Failed to load plugin agents: ${B}`})}try{await k()}catch(q){let B=q instanceof Error?q.message:String(q);Q.push({type:"generic-error",source:"plugin-hooks",error:`Failed to load plugin hooks: ${B}`})}let S=(await Promise.all(G.map(async(q)=>{if(q.mcpServers)return Object.keys(q.mcpServers).length;let B=await R(q,Q);if(B)q.mcpServers=B;return B?Object.keys(B).length:0}))).reduce((q,B)=>q+B,0),u=(await Promise.all(G.map(async(q)=>{if(q.lspServers)return Object.keys(q.lspServers).length;let B=await L(q,Q);if(B)q.lspServers=B;return B?Object.keys(B).length:0}))).reduce((q,B)=>q+B,0);N(),$((q)=>{let B=q.plugins.errors.filter((J)=>J.source==="lsp-manager"||J.source.startsWith("plugin:")),z=new Set(Q.map((J)=>J.type==="generic-error"?`generic-error:${J.source}:${J.error}`:`${J.type}:${J.source}`)),C=[...B.filter((J)=>{let v=J.type==="generic-error"?`generic-error:${J.source}:${J.error}`:`${J.type}:${J.source}`;return!z.has(v)}),...Q];return{...q,plugins:{...q.plugins,enabled:G,disabled:T,commands:W,errors:C}}}),H(`Loaded plugins - Enabled: ${G.length}, Disabled: ${T.length}, Commands: ${W.length}, Agents: ${X.length}, Errors: ${Q.length}`);let c=G.reduce((q,B)=>{if(!B.hooksConfig)return q;return q+Object.values(B.hooksConfig).reduce((z,w)=>z+(w?.reduce((C,J)=>C+J.hooks.length,0)??0),0)},0);return{enabled_count:G.length,disabled_count:T.length,inline_count:K(G,(q)=>q.source.endsWith("@inline")),marketplace_count:K(G,(q)=>!q.source.endsWith("@inline")),error_count:Q.length,skill_count:W.length,agent_count:X.length,hook_count:c,mcp_count:S,lsp_count:u,ant_enabled_names:process.env.USER_TYPE==="ant"&&G.length>0?G.map((q)=>q.name).sort().join(","):void 0}}catch(G){let T=D(G);return F(T),H(`Error loading plugins: ${G}`),$((Q)=>{let V=Q.plugins.errors.filter((X)=>X.source==="lsp-manager"||X.source.startsWith("plugin:")),W={type:"generic-error",source:"plugin-system",error:T.message};return{...Q,plugins:{...Q.plugins,enabled:[],disabled:[],commands:[],errors:[...V,W]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[$,Z]);x(()=>{if(!Y)return;j().then((G)=>{let{ant_enabled_names:T,...Q}=G,V={...Q,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};y("tengu_plugins_loaded",{...V,...T!==void 0&&{enabled_names:T}}),I("info","tengu_plugins_loaded",V)})},[j,Y]),x(()=>{if(!Y||!U)return;Z({key:"plugin-reload-pending",text:"Plugins changed. Run /reload-plugins to activate.",color:"suggestion",priority:"low"})},[Y,U,Z])}
2
+ import{qa as P}from"./cli-hs95nqb0.js";import{pd as M,td as Bq}from"./cli-s5ee96g6.js";import{BC as E,Bn as o,CF as h,DC as s,DF as A,FF as e,GF as _,HF as qq,Pi as O,Qi as p,RD as f,UD as r,fx as L,gx as t,kx as N,mx as a,sw as k,yw as n,zn as R}from"./cli-63389c5w.js";import{f4 as K,h4 as l}from"./cli-vzcpa5mx.js";import{S6 as I,U6 as d}from"./cli-v86f53k0.js";import{I8 as F,N8 as i}from"./cli-eehgc06t.js";import{a9 as y,b9 as b}from"./cli-2dkq8dre.js";import{C_ as m,_9 as D,f_ as g,z_ as H}from"./cli-bqs5smsv.js";qq();b();a();e();l();m();d();g();i();p();s();n();t();o();import{useCallback as Gq,useEffect as x}from"react";Bq();r();function Iq({enabled:Y=!0}={}){let $=A(),U=h((G)=>G.plugins.needsRefresh),{addNotification:Z}=_(),j=Gq(async()=>{try{let{enabled:G,disabled:T,errors:Q}=await f();await P();let V=M();if(Object.keys(V).length>0)Z({key:"plugin-delisted-flagged",text:"Plugins flagged. Check /plugins",color:"warning",priority:"high"});let W=[],X=[];try{W=await E()}catch(q){let B=q instanceof Error?q.message:String(q);Q.push({type:"generic-error",source:"plugin-commands",error:`Failed to load plugin commands: ${B}`})}try{X=await O()}catch(q){let B=q instanceof Error?q.message:String(q);Q.push({type:"generic-error",source:"plugin-agents",error:`Failed to load plugin agents: ${B}`})}try{await k()}catch(q){let B=q instanceof Error?q.message:String(q);Q.push({type:"generic-error",source:"plugin-hooks",error:`Failed to load plugin hooks: ${B}`})}let S=(await Promise.all(G.map(async(q)=>{if(q.mcpServers)return Object.keys(q.mcpServers).length;let B=await R(q,Q);if(B)q.mcpServers=B;return B?Object.keys(B).length:0}))).reduce((q,B)=>q+B,0),u=(await Promise.all(G.map(async(q)=>{if(q.lspServers)return Object.keys(q.lspServers).length;let B=await L(q,Q);if(B)q.lspServers=B;return B?Object.keys(B).length:0}))).reduce((q,B)=>q+B,0);N(),$((q)=>{let B=q.plugins.errors.filter((J)=>J.source==="lsp-manager"||J.source.startsWith("plugin:")),z=new Set(Q.map((J)=>J.type==="generic-error"?`generic-error:${J.source}:${J.error}`:`${J.type}:${J.source}`)),C=[...B.filter((J)=>{let v=J.type==="generic-error"?`generic-error:${J.source}:${J.error}`:`${J.type}:${J.source}`;return!z.has(v)}),...Q];return{...q,plugins:{...q.plugins,enabled:G,disabled:T,commands:W,errors:C}}}),H(`Loaded plugins - Enabled: ${G.length}, Disabled: ${T.length}, Commands: ${W.length}, Agents: ${X.length}, Errors: ${Q.length}`);let c=G.reduce((q,B)=>{if(!B.hooksConfig)return q;return q+Object.values(B.hooksConfig).reduce((z,w)=>z+(w?.reduce((C,J)=>C+J.hooks.length,0)??0),0)},0);return{enabled_count:G.length,disabled_count:T.length,inline_count:K(G,(q)=>q.source.endsWith("@inline")),marketplace_count:K(G,(q)=>!q.source.endsWith("@inline")),error_count:Q.length,skill_count:W.length,agent_count:X.length,hook_count:c,mcp_count:S,lsp_count:u,ant_enabled_names:process.env.USER_TYPE==="ant"&&G.length>0?G.map((q)=>q.name).sort().join(","):void 0}}catch(G){let T=D(G);return F(T),H(`Error loading plugins: ${G}`),$((Q)=>{let V=Q.plugins.errors.filter((X)=>X.source==="lsp-manager"||X.source.startsWith("plugin:")),W={type:"generic-error",source:"plugin-system",error:T.message};return{...Q,plugins:{...Q.plugins,enabled:[],disabled:[],commands:[],errors:[...V,W]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[$,Z]);x(()=>{if(!Y)return;j().then((G)=>{let{ant_enabled_names:T,...Q}=G,V={...Q,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};y("tengu_plugins_loaded",{...V,...T!==void 0&&{enabled_names:T}}),I("info","tengu_plugins_loaded",V)})},[j,Y]),x(()=>{if(!Y||!U)return;Z({key:"plugin-reload-pending",text:"Plugins changed. Run /reload-plugins to activate.",color:"suggestion",priority:"low"})},[Y,U,Z])}
3
3
  export{Iq as P};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{HK as z,Hk as I,IE as L,Ik as v,JK as x,VE as X}from"./cli-b3k8arn1.js";import{T3 as P,Y3 as w}from"./cli-ca1jmr8f.js";import{$4 as R,a5 as j}from"./cli-t5ddsvmv.js";import{$8 as A,_8 as F}from"./cli-e5yek4vx.js";import{A_ as b,x_ as k}from"./cli-awb77t95.js";import{Vaa as C,dda as y}from"./cli-tafg3e9w.js";import{hda as H}from"./cli-qwx84m9c.js";function O(Q){return Q.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&amp;/g,"&")}function K(Q,Y){let U=Q.match(new RegExp(`<${Y}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${Y}>`,"i"))?.[1]?.trim();return U?O(U):void 0}function D(Q){return Q.replace(/\s+/g," ").trim()}function B(Q){let Y=K(Q,"command-name"),Z=K(Q,"command-args");if(Y)return D([Y,Z].filter(Boolean).join(" "));let U=Q.replace(M," ");return D(U)}function V(Q){return/<([a-z][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/.test(Q)}var M;var W=H(()=>{M=/<([a-z][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n?/g});import{z as f}from"zod/v4";function n(Q){let Y=[];for(let U of Q){if(U.type!=="user"&&U.type!=="assistant")continue;if("isMeta"in U&&U.isMeta)continue;if("origin"in U&&U.origin&&U.origin.kind!=="human")continue;let q=U.message.content;if(typeof q==="string")Y.push(q);else if(Array.isArray(q)){for(let $ of q)if("type"in $&&$.type==="text"&&"text"in $)Y.push($.text)}}let Z=Y.join(`
2
+ import{Hk as I,Ik as v,JK as z,KE as L,LK as x,XE as X}from"./cli-63389c5w.js";import{V3 as P,_3 as w}from"./cli-vj1rywde.js";import{b5 as R,c5 as j}from"./cli-461ebjmk.js";import{a9 as F,b9 as A}from"./cli-2dkq8dre.js";import{C_ as b,z_ as k}from"./cli-bqs5smsv.js";import{Xaa as C,fda as y}from"./cli-ktzb7cwm.js";import{jda as H}from"./cli-2afdzhna.js";function O(Q){return Q.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&amp;/g,"&")}function K(Q,Y){let U=Q.match(new RegExp(`<${Y}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${Y}>`,"i"))?.[1]?.trim();return U?O(U):void 0}function D(Q){return Q.replace(/\s+/g," ").trim()}function B(Q){let Y=K(Q,"command-name"),Z=K(Q,"command-args");if(Y)return D([Y,Z].filter(Boolean).join(" "));let U=Q.replace(M," ");return D(U)}function V(Q){return/<([a-z][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/.test(Q)}var M;var W=H(()=>{M=/<([a-z][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n?/g});import{z as f}from"zod/v4";function n(Q){let Y=[];for(let U of Q){if(U.type!=="user"&&U.type!=="assistant")continue;if("isMeta"in U&&U.isMeta)continue;if("origin"in U&&U.origin&&U.origin.kind!=="human")continue;let q=U.message.content;if(typeof q==="string")Y.push(q);else if(Array.isArray(q)){for(let $ of q)if("type"in $&&$.type==="text"&&"text"in $)Y.push($.text)}}let Z=Y.join(`
3
3
  `);return Z.length>G?Z.slice(-G):Z}function E(Q){let Y=B(Q);if(!Y)return null;if(Y.length>N)return null;if(V(Y))return null;return Y}async function a(Q,Y){let Z=B(Q);if(!Z)return null;try{let U=await z({systemPrompt:I([_]),userPrompt:Z,outputFormat:{type:"json_schema",schema:{type:"object",properties:{title:{type:"string"}},required:["title"],additionalProperties:!1}},signal:Y,options:{querySource:"generate_session_title",agents:[],isNonInteractiveSession:C(),hasAppendSystemPrompt:!1,mcpTools:[]}}),q=L(U.message.content),$=h().safeParse(P(q)),J=$.success?E($.data.title):null;return F("tengu_session_title_generated",{success:J!==null}),J}catch(U){return k(`generateSessionTitle failed: ${U}`,{level:"error"}),F("tengu_session_title_generated",{success:!1}),null}}var G=1000,N=80,_=`Generate a concise, sentence-case title (3-7 words) that captures the main topic or goal of this coding session. The title should be clear enough that the user recognizes the session in a list. Use sentence case: capitalize only the first word and proper nouns.
4
4
 
5
5
  Return JSON with a single "title" field.
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{hda as v,ida as k}from"./cli-qwx84m9c.js";function z(f){let g=0;for(let j=0;j<f.length;j++)g=(g<<5)-g+f.charCodeAt(j)|0;return g}function A(f){if(typeof Bun<"u")return Bun.hash(f).toString();return k("crypto").createHash("sha256").update(f).digest("hex")}function B(f,g){if(typeof Bun<"u")return Bun.hash(g,Bun.hash(f)).toString();return k("crypto").createHash("sha256").update(f).update("\x00").update(g).digest("hex")}var w=()=>{};
3
- export{z as M8,A as N8,B as O8,w as P8};
2
+ import{jda as v,kda as k}from"./cli-2afdzhna.js";function z(f){let g=0;for(let j=0;j<f.length;j++)g=(g<<5)-g+f.charCodeAt(j)|0;return g}function A(f){if(typeof Bun<"u")return Bun.hash(f).toString();return k("crypto").createHash("sha256").update(f).digest("hex")}function B(f,g){if(typeof Bun<"u")return Bun.hash(g,Bun.hash(f)).toString();return k("crypto").createHash("sha256").update(f).update("\x00").update(g).digest("hex")}var w=()=>{};
3
+ export{z as O8,A as P8,B as Q8,w as R8};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{FQ as e,fR as o}from"./cli-a2d962bq.js";import{hda as M}from"./cli-qwx84m9c.js";import{c as A}from"react/compiler-runtime";import q from"figures";import{jsxDEV as n}from"react/jsx-dev-runtime";function H(k){let _=A(5),{status:v,withSpace:P}=k,w=P===void 0?!1:P,$=h[v],K=!$.color,f=w&&" ",r;if(_[0]!==$.color||_[1]!==$.icon||_[2]!==K||_[3]!==f)r=n(e,{color:$.color,dimColor:K,children:[$.icon,f]},void 0,!0,void 0,this),_[0]=$.color,_[1]=$.icon,_[2]=K,_[3]=f,_[4]=r;else r=_[4];return r}var h;var p=M(()=>{o();h={success:{icon:q.tick,color:"success"},error:{icon:q.cross,color:"error"},warning:{icon:q.warning,color:"warning"},info:{icon:q.info,color:"suggestion"},pending:{icon:q.circle,color:void 0},loading:{icon:"\u2026",color:void 0}}});
2
+ import{HQ as e,hR as o}from"./cli-7dm5ex18.js";import{jda as M}from"./cli-2afdzhna.js";import{c as A}from"react/compiler-runtime";import q from"figures";import{jsxDEV as n}from"react/jsx-dev-runtime";function H(k){let _=A(5),{status:v,withSpace:P}=k,w=P===void 0?!1:P,$=h[v],K=!$.color,f=w&&" ",r;if(_[0]!==$.color||_[1]!==$.icon||_[2]!==K||_[3]!==f)r=n(e,{color:$.color,dimColor:K,children:[$.icon,f]},void 0,!0,void 0,this),_[0]=$.color,_[1]=$.icon,_[2]=K,_[3]=f,_[4]=r;else r=_[4];return r}var h;var p=M(()=>{o();h={success:{icon:q.tick,color:"success"},error:{icon:q.cross,color:"error"},warning:{icon:q.warning,color:"warning"},info:{icon:q.info,color:"suggestion"},pending:{icon:q.circle,color:void 0},loading:{icon:"\u2026",color:void 0}}});
3
3
  export{H as lf,p as mf};