@claudiolabs/claudin 0.5.8 → 0.5.10

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 (844) hide show
  1. package/bin/claudin +62 -0
  2. package/dist/chunks/AgentTool-0.5.10-k5mymxpj.mjs +1 -0
  3. package/dist/chunks/App-0.5.10-yzg0d70f.mjs +1 -0
  4. package/dist/chunks/ApproveApiKey-0.5.10-mpm24aq5.mjs +1 -0
  5. package/dist/chunks/AssistantSessionChooser-0.5.10-jbgn5s9r.mjs +1 -0
  6. package/dist/chunks/AutoModeOptInDialog-0.5.10-tk2jpgdr.mjs +1 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-0.5.10-2gqvp73t.mjs +1 -0
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog-0.5.10-mwwqh2cz.mjs +1 -0
  9. package/dist/chunks/ConsoleOAuthFlow-0.5.10-f4wd3yew.mjs +1 -0
  10. package/dist/chunks/DiffDialog-0.5.10-f28xdhns.mjs +3 -0
  11. package/dist/chunks/Doctor-0.5.10-dz3ndek3.mjs +1 -0
  12. package/dist/chunks/Grove-0.5.10-f2m596r7.mjs +1 -0
  13. package/dist/chunks/ITermBackend-0.5.10-k9sjxv27.mjs +1 -0
  14. package/dist/chunks/InvalidConfigDialog-0.5.10-d5f0ba3j.mjs +1 -0
  15. package/dist/chunks/InvalidSettingsDialog-0.5.10-vyexdzf7.mjs +1 -0
  16. package/dist/chunks/MigrationDialog-0.5.10-fxhfd566.mjs +1 -0
  17. package/dist/chunks/Onboarding-0.5.10-61c4a01v.mjs +1 -0
  18. package/dist/chunks/ProviderManager-0.5.10-mhnze07c.mjs +1 -0
  19. package/dist/chunks/REPL-0.5.10-qag06ykw.mjs +1 -0
  20. package/dist/chunks/ResumeConversation-0.5.10-ax66yat2.mjs +1 -0
  21. package/dist/chunks/SnapshotUpdateDialog-0.5.10-mkzs7881.mjs +1 -0
  22. package/dist/chunks/TeleportProgress-0.5.10-762m6e6b.mjs +1 -0
  23. package/dist/chunks/TeleportRepoMismatchDialog-0.5.10-mr8ddjsn.mjs +1 -0
  24. package/dist/chunks/TeleportResumeWrapper-0.5.10-rs9vs3j0.mjs +1 -0
  25. package/dist/chunks/TmuxBackend-0.5.10-s7yrx34h.mjs +9 -0
  26. package/dist/chunks/ToolSearchTool-0.5.10-8tejm808.mjs +1 -0
  27. package/dist/chunks/TrustDialog-0.5.10-v09an4xe.mjs +1 -0
  28. package/dist/chunks/activeProvider-0.5.10-1c68rtzb.mjs +1 -0
  29. package/dist/chunks/add-dir-0.5.10-6hyjyege.mjs +1 -0
  30. package/dist/chunks/agents-0.5.10-34zhsd0m.mjs +110 -0
  31. package/dist/chunks/agents-0.5.10-fa6mrf84.mjs +3 -0
  32. package/dist/chunks/api-0.5.10-hvafwq9b.mjs +1 -0
  33. package/dist/chunks/asciicast-0.5.10-c2nfaps4.mjs +1 -0
  34. package/dist/chunks/assistant-0.5.10-w55twa4a.mjs +1 -0
  35. package/dist/chunks/auth-0.5.10-dmv8dcy1.mjs +1 -0
  36. package/dist/chunks/auth-0.5.10-tqm37j6k.mjs +1 -0
  37. package/dist/chunks/autoMode-0.5.10-bew44c3j.mjs +48 -0
  38. package/dist/chunks/autoUpdater-0.5.10-dav9gs0x.mjs +1 -0
  39. package/dist/chunks/backgroundHousekeeping-0.5.10-rsyjn0x7.mjs +1 -0
  40. package/dist/chunks/branch-0.5.10-k81z6new.mjs +4 -0
  41. package/dist/chunks/bridgePointer-0.5.10-h727df9t.mjs +1 -0
  42. package/dist/chunks/btw-0.5.10-f1syxkz1.mjs +1 -0
  43. package/dist/chunks/buddy-0.5.10-a15r3a8e.mjs +3 -0
  44. package/dist/chunks/cacache-0.5.10-1hz9d6s8.mjs +1 -0
  45. package/dist/chunks/cache-probe-0.5.10-fcxj2wy5.mjs +21 -0
  46. package/dist/chunks/cacheStats-0.5.10-vedv1qp4.mjs +4 -0
  47. package/dist/chunks/caches-0.5.10-fmadrqb1.mjs +1 -0
  48. package/dist/chunks/claudeDesktop-0.5.10-mz1s1yqp.mjs +1 -0
  49. package/dist/chunks/claudemd-0.5.10-9mb95kbb.mjs +1 -0
  50. package/dist/chunks/clear-0.5.10-tshbmj0g.mjs +1 -0
  51. package/dist/chunks/clearTerminal-0.5.10-bjqnvfmf.mjs +1 -0
  52. package/dist/chunks/cli-0.5.10-0ar26ct8.mjs +2 -0
  53. package/dist/chunks/cli-0.5.10-0p24d24e.mjs +2 -0
  54. package/dist/chunks/cli-0.5.10-0sg20shr.mjs +2 -0
  55. package/dist/chunks/cli-0.5.10-0twjtft5.mjs +2 -0
  56. package/dist/chunks/cli-0.5.10-0vs5gmpe.mjs +4 -0
  57. package/dist/chunks/cli-0.5.10-0xb1405m.mjs +2 -0
  58. package/dist/chunks/cli-0.5.10-0yn5x3m6.mjs +2 -0
  59. package/dist/chunks/cli-0.5.10-1gafefn2.mjs +3 -0
  60. package/dist/chunks/cli-0.5.10-1sd567wn.mjs +2 -0
  61. package/dist/chunks/cli-0.5.10-207502x5.mjs +2 -0
  62. package/dist/chunks/cli-0.5.10-20w5v1ja.mjs +2 -0
  63. package/dist/chunks/cli-0.5.10-20x96vwq.mjs +2 -0
  64. package/dist/chunks/cli-0.5.10-2c19pn7b.mjs +2 -0
  65. package/dist/chunks/cli-0.5.10-2es9q9n1.mjs +2 -0
  66. package/dist/chunks/cli-0.5.10-2fqes7gy.mjs +193 -0
  67. package/dist/chunks/cli-0.5.10-2qxn5ad9.mjs +2 -0
  68. package/dist/chunks/cli-0.5.10-2yqdkew6.mjs +3 -0
  69. package/dist/chunks/cli-0.5.10-2yrgbmd1.mjs +9 -0
  70. package/dist/chunks/cli-0.5.10-347yjq4a.mjs +2 -0
  71. package/dist/chunks/cli-0.5.10-3xnh04c6.mjs +2 -0
  72. package/dist/chunks/cli-0.5.10-4ekf1v4x.mjs +2 -0
  73. package/dist/chunks/cli-0.5.10-57andxje.mjs +26 -0
  74. package/dist/chunks/cli-0.5.10-58erwwbz.mjs +3 -0
  75. package/dist/chunks/cli-0.5.10-5m76kmzk.mjs +2 -0
  76. package/dist/chunks/cli-0.5.10-5mp7dx81.mjs +2 -0
  77. package/dist/chunks/cli-0.5.10-5nzsgwh2.mjs +2 -0
  78. package/dist/chunks/cli-0.5.10-5stz3dbm.mjs +2 -0
  79. package/dist/chunks/cli-0.5.10-5w3eaafz.mjs +2 -0
  80. package/dist/chunks/cli-0.5.10-661g0gft.mjs +2 -0
  81. package/dist/chunks/cli-0.5.10-68wvhytx.mjs +10 -0
  82. package/dist/chunks/cli-0.5.10-6c055y30.mjs +2 -0
  83. package/dist/chunks/cli-0.5.10-6g0257t2.mjs +2 -0
  84. package/dist/chunks/cli-0.5.10-6jarntdq.mjs +2 -0
  85. package/dist/chunks/cli-0.5.10-6twsf5qs.mjs +2 -0
  86. package/dist/chunks/cli-0.5.10-6wzddpjt.mjs +42 -0
  87. package/dist/chunks/cli-0.5.10-6y9d3fye.mjs +45 -0
  88. package/dist/chunks/cli-0.5.10-6z4j2qja.mjs +24 -0
  89. package/dist/chunks/cli-0.5.10-6zwxmza2.mjs +4 -0
  90. package/dist/chunks/cli-0.5.10-7f5q1zvk.mjs +2 -0
  91. package/dist/chunks/cli-0.5.10-7j4590js.mjs +2 -0
  92. package/dist/chunks/cli-0.5.10-7shp24xv.mjs +3 -0
  93. package/dist/chunks/cli-0.5.10-7tpa30tv.mjs +3 -0
  94. package/dist/chunks/cli-0.5.10-84q7z5hq.mjs +2 -0
  95. package/dist/chunks/cli-0.5.10-84z0ztsf.mjs +18 -0
  96. package/dist/chunks/cli-0.5.10-87sd2pqh.mjs +3 -0
  97. package/dist/chunks/cli-0.5.10-8f53zcp3.mjs +2 -0
  98. package/dist/chunks/cli-0.5.10-8jjacn05.mjs +5262 -0
  99. package/dist/chunks/cli-0.5.10-8kpt6897.mjs +3 -0
  100. package/dist/chunks/cli-0.5.10-8wqagr68.mjs +4 -0
  101. package/dist/chunks/cli-0.5.10-8zwd1xme.mjs +25 -0
  102. package/dist/chunks/cli-0.5.10-948wwm63.mjs +2 -0
  103. package/dist/chunks/cli-0.5.10-9dazv3hg.mjs +2 -0
  104. package/dist/chunks/cli-0.5.10-9ek8f4vk.mjs +2 -0
  105. package/dist/chunks/cli-0.5.10-9h23hhgb.mjs +2 -0
  106. package/dist/chunks/cli-0.5.10-9mt7ynrh.mjs +2 -0
  107. package/dist/chunks/cli-0.5.10-9xc8zhxg.mjs +59 -0
  108. package/dist/chunks/cli-0.5.10-9ynpb3y0.mjs +21 -0
  109. package/dist/chunks/cli-0.5.10-a1hh6v31.mjs +2 -0
  110. package/dist/chunks/cli-0.5.10-a38pnxbz.mjs +2 -0
  111. package/dist/chunks/cli-0.5.10-a542fww1.mjs +2 -0
  112. package/dist/chunks/cli-0.5.10-a8ecfnq0.mjs +2 -0
  113. package/dist/chunks/cli-0.5.10-atkghjt0.mjs +2 -0
  114. package/dist/chunks/cli-0.5.10-ax0fmeqk.mjs +2 -0
  115. package/dist/chunks/cli-0.5.10-azhfv28d.mjs +2 -0
  116. package/dist/chunks/cli-0.5.10-b4j3x063.mjs +4 -0
  117. package/dist/chunks/cli-0.5.10-b761m5q2.mjs +2 -0
  118. package/dist/chunks/cli-0.5.10-b7r8mjbd.mjs +9 -0
  119. package/dist/chunks/cli-0.5.10-ba15gakh.mjs +2 -0
  120. package/dist/chunks/cli-0.5.10-bad3yv4c.mjs +2 -0
  121. package/dist/chunks/cli-0.5.10-bhb8rt9y.mjs +2 -0
  122. package/dist/chunks/cli-0.5.10-bj0bm26b.mjs +4 -0
  123. package/dist/chunks/cli-0.5.10-bmc43e4g.mjs +2 -0
  124. package/dist/chunks/cli-0.5.10-bsqvacka.mjs +2 -0
  125. package/dist/chunks/cli-0.5.10-c0xtw3q0.mjs +34 -0
  126. package/dist/chunks/cli-0.5.10-c82cgdm7.mjs +133 -0
  127. package/dist/chunks/cli-0.5.10-c9z4tdw2.mjs +2 -0
  128. package/dist/chunks/cli-0.5.10-cm0r4pkd.mjs +3 -0
  129. package/dist/chunks/cli-0.5.10-cw4ykvbj.mjs +2 -0
  130. package/dist/chunks/cli-0.5.10-cz6csv1p.mjs +2 -0
  131. package/dist/chunks/cli-0.5.10-d1y749qy.mjs +2 -0
  132. package/dist/chunks/cli-0.5.10-d2cw91xn.mjs +3 -0
  133. package/dist/chunks/cli-0.5.10-d4d9x2de.mjs +2 -0
  134. package/dist/chunks/cli-0.5.10-d609fanf.mjs +2 -0
  135. package/dist/chunks/cli-0.5.10-d64hr722.mjs +3 -0
  136. package/dist/chunks/cli-0.5.10-d9xf1jnz.mjs +12 -0
  137. package/dist/chunks/cli-0.5.10-dkt8bbmm.mjs +3 -0
  138. package/dist/chunks/cli-0.5.10-dmmckmyf.mjs +12 -0
  139. package/dist/chunks/cli-0.5.10-dvmddb7c.mjs +6 -0
  140. package/dist/chunks/cli-0.5.10-dz26120x.mjs +2 -0
  141. package/dist/chunks/cli-0.5.10-dzr8kmx4.mjs +2 -0
  142. package/dist/chunks/cli-0.5.10-e8tz9596.mjs +2 -0
  143. package/dist/chunks/cli-0.5.10-e8wz8kc0.mjs +58 -0
  144. package/dist/chunks/cli-0.5.10-eh9hq9n3.mjs +2 -0
  145. package/dist/chunks/cli-0.5.10-ewcdy4pj.mjs +2 -0
  146. package/dist/chunks/cli-0.5.10-f3fj7f3q.mjs +2 -0
  147. package/dist/chunks/cli-0.5.10-fcbrnw81.mjs +2 -0
  148. package/dist/chunks/cli-0.5.10-fjvz4bt0.mjs +8 -0
  149. package/dist/chunks/cli-0.5.10-fzx10svb.mjs +2 -0
  150. package/dist/chunks/cli-0.5.10-g4khh98h.mjs +2 -0
  151. package/dist/chunks/cli-0.5.10-gekw3xnm.mjs +2 -0
  152. package/dist/chunks/cli-0.5.10-gk9n4zev.mjs +2 -0
  153. package/dist/chunks/cli-0.5.10-gs8dx67v.mjs +2 -0
  154. package/dist/chunks/cli-0.5.10-hmp23q7z.mjs +2 -0
  155. package/dist/chunks/cli-0.5.10-hzh8tpg0.mjs +2 -0
  156. package/dist/chunks/cli-0.5.10-j1aznw8b.mjs +2 -0
  157. package/dist/chunks/cli-0.5.10-jd7ff66n.mjs +2 -0
  158. package/dist/chunks/cli-0.5.10-jhtht51h.mjs +4 -0
  159. package/dist/chunks/cli-0.5.10-jsnrvena.mjs +2 -0
  160. package/dist/chunks/cli-0.5.10-k0mnqs0g.mjs +15 -0
  161. package/dist/chunks/cli-0.5.10-k1s62rww.mjs +2 -0
  162. package/dist/chunks/cli-0.5.10-k3qbvfj5.mjs +2 -0
  163. package/dist/chunks/cli-0.5.10-kj2g5r8c.mjs +15 -0
  164. package/dist/chunks/cli-0.5.10-kyt82zt5.mjs +2 -0
  165. package/dist/chunks/cli-0.5.10-m0hghx42.mjs +2 -0
  166. package/dist/chunks/cli-0.5.10-mcw01p8b.mjs +2 -0
  167. package/dist/chunks/cli-0.5.10-mgkc1jay.mjs +15 -0
  168. package/dist/chunks/cli-0.5.10-mrgw2c00.mjs +2 -0
  169. package/dist/chunks/cli-0.5.10-mvckg6zv.mjs +17 -0
  170. package/dist/chunks/cli-0.5.10-mxzdkm6r.mjs +2 -0
  171. package/dist/chunks/cli-0.5.10-n70d8n1f.mjs +2 -0
  172. package/dist/chunks/cli-0.5.10-neaex6bh.mjs +2 -0
  173. package/dist/chunks/cli-0.5.10-npmmxjts.mjs +5 -0
  174. package/dist/chunks/cli-0.5.10-nqvng39w.mjs +2 -0
  175. package/dist/chunks/cli-0.5.10-nvmq8pez.mjs +2 -0
  176. package/dist/chunks/cli-0.5.10-nx3m5sa2.mjs +2 -0
  177. package/dist/chunks/cli-0.5.10-p3g04417.mjs +20 -0
  178. package/dist/chunks/cli-0.5.10-p4wmnjhz.mjs +6 -0
  179. package/dist/chunks/cli-0.5.10-p5j82v0t.mjs +2 -0
  180. package/dist/chunks/cli-0.5.10-p7jd1z33.mjs +2 -0
  181. package/dist/chunks/cli-0.5.10-p8hbe96w.mjs +133 -0
  182. package/dist/chunks/cli-0.5.10-pk91q3s6.mjs +4 -0
  183. package/dist/chunks/cli-0.5.10-pq8nhdeq.mjs +2 -0
  184. package/dist/chunks/cli-0.5.10-pr0nkqpw.mjs +2 -0
  185. package/dist/chunks/cli-0.5.10-pr8yqs5v.mjs +2 -0
  186. package/dist/chunks/cli-0.5.10-pxhw9mwz.mjs +2 -0
  187. package/dist/chunks/cli-0.5.10-qvp1fb5n.mjs +2 -0
  188. package/dist/chunks/cli-0.5.10-qw9y3mst.mjs +2 -0
  189. package/dist/chunks/cli-0.5.10-qx17jbqj.mjs +2 -0
  190. package/dist/chunks/cli-0.5.10-r0jt3zrj.mjs +2 -0
  191. package/dist/chunks/cli-0.5.10-ra711jkk.mjs +2 -0
  192. package/dist/chunks/cli-0.5.10-rhmrff22.mjs +2 -0
  193. package/dist/chunks/cli-0.5.10-rk7at2tn.mjs +2 -0
  194. package/dist/chunks/cli-0.5.10-rq5mv7xq.mjs +2 -0
  195. package/dist/chunks/cli-0.5.10-rwqvbtg3.mjs +18 -0
  196. package/dist/chunks/cli-0.5.10-rxnwkka5.mjs +24 -0
  197. package/dist/chunks/cli-0.5.10-rzshk2m6.mjs +6 -0
  198. package/dist/chunks/cli-0.5.10-rzz4tgvw.mjs +12 -0
  199. package/dist/chunks/cli-0.5.10-s8bv5q7m.mjs +2 -0
  200. package/dist/chunks/cli-0.5.10-srd78kpc.mjs +7 -0
  201. package/dist/chunks/cli-0.5.10-syb1bnb2.mjs +4 -0
  202. package/dist/chunks/cli-0.5.10-t11my4jb.mjs +2 -0
  203. package/dist/chunks/cli-0.5.10-t2s1mxyn.mjs +2 -0
  204. package/dist/chunks/cli-0.5.10-t9d916t1.mjs +39 -0
  205. package/dist/chunks/cli-0.5.10-tbpqmp1s.mjs +2 -0
  206. package/dist/chunks/cli-0.5.10-tkjtbv56.mjs +2 -0
  207. package/dist/chunks/cli-0.5.10-tqpg21eq.mjs +2 -0
  208. package/dist/chunks/cli-0.5.10-tqyytkxn.mjs +2 -0
  209. package/dist/chunks/cli-0.5.10-tr692cqd.mjs +2 -0
  210. package/dist/chunks/cli-0.5.10-v36c5nnr.mjs +2 -0
  211. package/dist/chunks/cli-0.5.10-v6kj3ej2.mjs +2 -0
  212. package/dist/chunks/cli-0.5.10-vhn14p7a.mjs +2 -0
  213. package/dist/chunks/cli-0.5.10-vhrqqvdz.mjs +5 -0
  214. package/dist/chunks/cli-0.5.10-vpfctkxf.mjs +2 -0
  215. package/dist/chunks/cli-0.5.10-vqkn3pgf.mjs +17 -0
  216. package/dist/chunks/cli-0.5.10-vqrqhas6.mjs +2 -0
  217. package/dist/chunks/cli-0.5.10-vsgznv7p.mjs +2 -0
  218. package/dist/chunks/cli-0.5.10-vyem3gpm.mjs +2 -0
  219. package/dist/chunks/cli-0.5.10-w29mv5e9.mjs +4 -0
  220. package/dist/chunks/cli-0.5.10-w41wxn5f.mjs +50 -0
  221. package/dist/chunks/cli-0.5.10-w698y5mp.mjs +5 -0
  222. package/dist/chunks/cli-0.5.10-w93v7bhm.mjs +2 -0
  223. package/dist/chunks/cli-0.5.10-xfqxbzc6.mjs +4 -0
  224. package/dist/chunks/cli-0.5.10-xg27xawf.mjs +2 -0
  225. package/dist/chunks/cli-0.5.10-xhy1yx61.mjs +2 -0
  226. package/dist/chunks/cli-0.5.10-xk6v4sy0.mjs +2 -0
  227. package/dist/chunks/cli-0.5.10-xnmg1qwd.mjs +2 -0
  228. package/dist/chunks/cli-0.5.10-xrwj7982.mjs +67 -0
  229. package/dist/chunks/cli-0.5.10-xy780m03.mjs +2 -0
  230. package/dist/chunks/cli-0.5.10-xyscak5q.mjs +16 -0
  231. package/dist/chunks/cli-0.5.10-y0sfzz9t.mjs +2 -0
  232. package/dist/chunks/cli-0.5.10-y0sr20nf.mjs +2 -0
  233. package/dist/chunks/cli-0.5.10-y4tn070k.mjs +1 -0
  234. package/dist/chunks/cli-0.5.10-y7j4tsb5.mjs +2 -0
  235. package/dist/chunks/cli-0.5.10-y9qd4psg.mjs +2 -0
  236. package/dist/chunks/cli-0.5.10-ytqna8q4.mjs +2 -0
  237. package/dist/chunks/cli-0.5.10-yvjnvgky.mjs +2 -0
  238. package/dist/chunks/cli-0.5.10-yxxbgd59.mjs +2 -0
  239. package/dist/chunks/cli-0.5.10-yzqkgb55.mjs +2 -0
  240. package/dist/chunks/cli-0.5.10-z4bzn8vh.mjs +2 -0
  241. package/dist/chunks/cli-0.5.10-z5ysspq8.mjs +2 -0
  242. package/dist/chunks/cli-0.5.10-zk1h67jm.mjs +2 -0
  243. package/dist/chunks/client-0.5.10-a5rmwz53.mjs +1 -0
  244. package/dist/chunks/color-0.5.10-3mtfm5rv.mjs +1 -0
  245. package/dist/chunks/compact-0.5.10-7zdm8hke.mjs +3 -0
  246. package/dist/chunks/config-0.5.10-ns9jcqxp.mjs +1 -0
  247. package/dist/chunks/config-0.5.10-vtf1kzhz.mjs +1 -0
  248. package/dist/chunks/context-0.5.10-qjjyyqx9.mjs +1 -0
  249. package/dist/chunks/context-noninteractive-0.5.10-244bgmbj.mjs +1 -0
  250. package/dist/chunks/conversation-0.5.10-zza66sgq.mjs +1 -0
  251. package/dist/chunks/copy-0.5.10-d6nstaxy.mjs +9 -0
  252. package/dist/chunks/cost-0.5.10-k89r76j7.mjs +1 -0
  253. package/dist/chunks/createSSHSession-0.5.10-xy3z3tdw.mjs +1 -0
  254. package/dist/chunks/createSession-0.5.10-ntrenxk4.mjs +1 -0
  255. package/dist/chunks/debug-0.5.10-bxkhvfc6.mjs +1 -0
  256. package/dist/chunks/defaultActionDeps-0.5.10-h673vq05.mjs +1177 -0
  257. package/dist/chunks/desktop-0.5.10-v0j5w6e8.mjs +1 -0
  258. package/dist/chunks/detectRepository-0.5.10-z29dy30r.mjs +1 -0
  259. package/dist/chunks/detection-0.5.10-jhy1kffq.mjs +1 -0
  260. package/dist/chunks/diff-0.5.10-14m8b77v.mjs +1 -0
  261. package/dist/chunks/doctor-0.5.10-pn374er7.mjs +1 -0
  262. package/dist/chunks/doctorDiagnostic-0.5.10-wkjtp4z5.mjs +1 -0
  263. package/dist/chunks/earlyInput-0.5.10-9nxfn64h.mjs +1 -0
  264. package/dist/chunks/effort-0.5.10-sjn55ka6.mjs +10 -0
  265. package/dist/chunks/envUtils-0.5.10-sdrg5j2r.mjs +1 -0
  266. package/dist/chunks/environmentSelection-0.5.10-nkxtjsa6.mjs +1 -0
  267. package/dist/chunks/environments-0.5.10-j3cwt63g.mjs +1 -0
  268. package/dist/chunks/errors-0.5.10-k3a2vs5j.mjs +1 -0
  269. package/dist/chunks/exampleCommands-0.5.10-s4q3ndpx.mjs +1 -0
  270. package/dist/chunks/exit-0.5.10-aaqjsrb3.mjs +1 -0
  271. package/dist/chunks/export-0.5.10-g3n84jha.mjs +2 -0
  272. package/dist/chunks/extra-usage-0.5.10-1k8453hn.mjs +1 -0
  273. package/dist/chunks/extra-usage-noninteractive-0.5.10-h0s4j23t.mjs +1 -0
  274. package/dist/chunks/fast-0.5.10-6jg8q83t.mjs +1 -0
  275. package/dist/chunks/feedback-0.5.10-f4cms77n.mjs +14 -0
  276. package/dist/chunks/firstPartyEventLogger-0.5.10-mtcdee5x.mjs +1 -0
  277. package/dist/chunks/git-0.5.10-5yr5z4ap.mjs +1 -0
  278. package/dist/chunks/githubModelsCredentials-0.5.10-pfeadzx7.mjs +1 -0
  279. package/dist/chunks/grove-0.5.10-4vzycmmm.mjs +1 -0
  280. package/dist/chunks/growthbook-0.5.10-nf8eqz7k.mjs +1 -0
  281. package/dist/chunks/headless-0.5.10-kqpgc4q6.mjs +2 -0
  282. package/dist/chunks/heapdump-0.5.10-zedkfpnn.mjs +6 -0
  283. package/dist/chunks/help-0.5.10-a3vhmv05.mjs +1 -0
  284. package/dist/chunks/hookChains-0.5.10-yc93jx3d.mjs +3 -0
  285. package/dist/chunks/hooks-0.5.10-negsdbpw.mjs +1 -0
  286. package/dist/chunks/hooks-0.5.10-t26wz67x.mjs +79 -0
  287. package/dist/chunks/ide-0.5.10-qsh8k0we.mjs +3 -0
  288. package/dist/chunks/image-processor-napi-0.5.10-8kz0m2nd.mjs +1 -0
  289. package/dist/chunks/index-0.5.10-0j9kz8a6.mjs +1 -0
  290. package/dist/chunks/index-0.5.10-0wzdjjzk.mjs +5 -0
  291. package/dist/chunks/index-0.5.10-5fsxcv9a.mjs +1 -0
  292. package/dist/chunks/index-0.5.10-6v1h8fb2.mjs +17 -0
  293. package/dist/chunks/index-0.5.10-7t36m4fw.mjs +30 -0
  294. package/dist/chunks/index-0.5.10-8t5phmpa.mjs +9 -0
  295. package/dist/chunks/index-0.5.10-ak9fnp4h.mjs +2 -0
  296. package/dist/chunks/index-0.5.10-asj7h5d6.mjs +9 -0
  297. package/dist/chunks/index-0.5.10-dxkhh5bg.mjs +1 -0
  298. package/dist/chunks/index-0.5.10-eh8w8ayw.mjs +2 -0
  299. package/dist/chunks/index-0.5.10-fjf8d5vq.mjs +1 -0
  300. package/dist/chunks/index-0.5.10-fyt0d84h.mjs +1 -0
  301. package/dist/chunks/index-0.5.10-m8cjzf6y.mjs +1 -0
  302. package/dist/chunks/index-0.5.10-marrtwvx.mjs +1 -0
  303. package/dist/chunks/index-0.5.10-n7zsm7mc.mjs +1 -0
  304. package/dist/chunks/index-0.5.10-p69q9n6x.mjs +1 -0
  305. package/dist/chunks/index-0.5.10-rv6kfzr0.mjs +1 -0
  306. package/dist/chunks/index-0.5.10-s5ttsdnm.mjs +1 -0
  307. package/dist/chunks/index-0.5.10-thyhdy51.mjs +1 -0
  308. package/dist/chunks/index-0.5.10-tncm271j.mjs +1 -0
  309. package/dist/chunks/index-0.5.10-wzxzkrhk.mjs +1 -0
  310. package/dist/chunks/index-0.5.10-x3apane6.mjs +1 -0
  311. package/dist/chunks/init-0.5.10-ef7yaw4p.mjs +1 -0
  312. package/dist/chunks/initReplBridge-0.5.10-we7sga8z.mjs +1 -0
  313. package/dist/chunks/ink-0.5.10-chpcjhk0.mjs +1 -0
  314. package/dist/chunks/insights-0.5.10-advkjwjk.mjs +870 -0
  315. package/dist/chunks/install-0.5.10-znt3x5wn.mjs +1 -0
  316. package/dist/chunks/install-github-app-0.5.10-jg0eqhv0.mjs +149 -0
  317. package/dist/chunks/install-slack-app-0.5.10-ryvy8j96.mjs +1 -0
  318. package/dist/chunks/instrumentation-0.5.10-36atfc3f.mjs +1 -0
  319. package/dist/chunks/interactiveHelpers-0.5.10-asvens6h.mjs +1 -0
  320. package/dist/chunks/keybindings-0.5.10-csc1yzpg.mjs +2 -0
  321. package/dist/chunks/knowledge-0.5.10-tg7cvbym.mjs +2 -0
  322. package/dist/chunks/latestVersionCache-0.5.10-wjt7dbqy.mjs +1 -0
  323. package/dist/chunks/loadAgentsDir-0.5.10-7zwxynjb.mjs +1 -0
  324. package/dist/chunks/loadPluginHooks-0.5.10-c8kk1n2h.mjs +1 -0
  325. package/dist/chunks/loadPluginHooks-0.5.10-qx8rwccw.mjs +1 -0
  326. package/dist/chunks/log-0.5.10-ews8b6yn.mjs +1 -0
  327. package/dist/chunks/main-0.5.10-dxwhwf46.mjs +1 -0
  328. package/dist/chunks/managedEnv-0.5.10-5jce9mqj.mjs +1 -0
  329. package/dist/chunks/mcp-0.5.10-1wxhgtsr.mjs +17 -0
  330. package/dist/chunks/mcp-0.5.10-5wsj8fv2.mjs +1 -0
  331. package/dist/chunks/mcp-0.5.10-ydcjrb4p.mjs +4 -0
  332. package/dist/chunks/mcpb-0.5.10-120rqrb1.mjs +1 -0
  333. package/dist/chunks/memory-0.5.10-0pqjdjed.mjs +3 -0
  334. package/dist/chunks/mobile-0.5.10-kp63nfej.mjs +2 -0
  335. package/dist/chunks/model-0.5.10-9zszn74v.mjs +2 -0
  336. package/dist/chunks/model-0.5.10-b64fg4gd.mjs +1 -0
  337. package/dist/chunks/node-0.5.10-tny076t5.mjs +12 -0
  338. package/dist/chunks/oauth-0.5.10-fccp2x7y.mjs +1 -0
  339. package/dist/chunks/openaiShim-0.5.10-gwjyjn7m.mjs +14 -0
  340. package/dist/chunks/output-style-0.5.10-526tregy.mjs +1 -0
  341. package/dist/chunks/package-D6422PQU-0.5.10-we8amhca.mjs +1 -0
  342. package/dist/chunks/parseConnectUrl-0.5.10-nhkxeakd.mjs +1 -0
  343. package/dist/chunks/parser-0.5.10-m4aj9jm7.mjs +1 -0
  344. package/dist/chunks/passes-0.5.10-vwhmhxn9.mjs +1 -0
  345. package/dist/chunks/permissions-0.5.10-b7p2zxt8.mjs +3 -0
  346. package/dist/chunks/plan-0.5.10-s8612fw1.mjs +1 -0
  347. package/dist/chunks/plist-0.5.10-e8k2gtwm.mjs +1 -0
  348. package/dist/chunks/plugin-0.5.10-pjh90f93.mjs +29 -0
  349. package/dist/chunks/pluginStartupCheck-0.5.10-mamzxaj6.mjs +1 -0
  350. package/dist/chunks/plugins-0.5.10-3zq96m7k.mjs +9 -0
  351. package/dist/chunks/preActionHook-0.5.10-6x12np60.mjs +2 -0
  352. package/dist/chunks/print-0.5.10-5a31vx9j.mjs +57 -0
  353. package/dist/chunks/privacy-settings-0.5.10-rdfd63af.mjs +1 -0
  354. package/dist/chunks/process-0.5.10-nf4cmk34.mjs +1 -0
  355. package/dist/chunks/processBashCommand-0.5.10-mw974xep.mjs +1 -0
  356. package/dist/chunks/processSlashCommand-0.5.10-e8c6n292.mjs +9 -0
  357. package/dist/chunks/prompt-0.5.10-6pbxq1g3.mjs +1 -0
  358. package/dist/chunks/prompt-0.5.10-n31de4d4.mjs +1 -0
  359. package/dist/chunks/prompts-0.5.10-0cxg5rvf.mjs +1 -0
  360. package/dist/chunks/protocolHandler-0.5.10-n15zj80n.mjs +13 -0
  361. package/dist/chunks/provider-0.5.10-0chtqqq3.mjs +2 -0
  362. package/dist/chunks/providerProfiles-0.5.10-kk39f15h.mjs +1 -0
  363. package/dist/chunks/providerValidation-0.5.10-5b2bmm6k.mjs +6 -0
  364. package/dist/chunks/rate-limit-options-0.5.10-qen28djd.mjs +1 -0
  365. package/dist/chunks/registerSubcommands-0.5.10-xmgpzx1a.mjs +34 -0
  366. package/dist/chunks/registry-0.5.10-q3yb1jt6.mjs +1 -0
  367. package/dist/chunks/release-notes-0.5.10-3m0mwzvq.mjs +5 -0
  368. package/dist/chunks/reload-plugins-0.5.10-2ngnamq3.mjs +2 -0
  369. package/dist/chunks/remote-env-0.5.10-gm9a4ms5.mjs +1 -0
  370. package/dist/chunks/remoteBridgeCore-0.5.10-s9tnpv93.mjs +1 -0
  371. package/dist/chunks/remoteSession-0.5.10-mk8be8a3.mjs +1 -0
  372. package/dist/chunks/rename-0.5.10-9ecwm2ar.mjs +1 -0
  373. package/dist/chunks/replBridgeHandle-0.5.10-9956kd4a.mjs +1 -0
  374. package/dist/chunks/replLauncher-0.5.10-94wyag0m.mjs +1 -0
  375. package/dist/chunks/resume-0.5.10-nc3z5h15.mjs +2 -0
  376. package/dist/chunks/rewind-0.5.10-wbs4stfg.mjs +1 -0
  377. package/dist/chunks/rootOptions-0.5.10-8ky1y6hv.mjs +1 -0
  378. package/dist/chunks/sandbox-adapter-0.5.10-jg0fj7ss.mjs +1 -0
  379. package/dist/chunks/sandbox-toggle-0.5.10-yy9272d9.mjs +1 -0
  380. package/dist/chunks/session-0.5.10-jqzxp3r3.mjs +2 -0
  381. package/dist/chunks/sessionDiscovery-0.5.10-7va0srxq.mjs +1 -0
  382. package/dist/chunks/sessionFileAccessHooks-0.5.10-bykpya1w.mjs +1 -0
  383. package/dist/chunks/sessionStorage-0.5.10-yy69cv78.mjs +1 -0
  384. package/dist/chunks/settings-0.5.10-kx3ep0z5.mjs +1 -0
  385. package/dist/chunks/setup-0.5.10-w0byw3fs.mjs +5 -0
  386. package/dist/chunks/sinks-0.5.10-289qngp8.mjs +1 -0
  387. package/dist/chunks/skills-0.5.10-6kvsqc69.mjs +1 -0
  388. package/dist/chunks/startupProfiler-0.5.10-e0mg4v8r.mjs +1 -0
  389. package/dist/chunks/startupUpdateCheck-0.5.10-08eextv5.mjs +1 -0
  390. package/dist/chunks/state-0.5.10-7xqjnrdw.mjs +1 -0
  391. package/dist/chunks/stats-0.5.10-fafdyc91.mjs +6 -0
  392. package/dist/chunks/status-0.5.10-y9t6rf31.mjs +1 -0
  393. package/dist/chunks/stickers-0.5.10-ta1pq624.mjs +1 -0
  394. package/dist/chunks/subprocessEnv-0.5.10-zv2wcv5q.mjs +1 -0
  395. package/dist/chunks/tasks-0.5.10-d0y0wvjj.mjs +1 -0
  396. package/dist/chunks/teamHelpers-0.5.10-qpwpfv94.mjs +1 -0
  397. package/dist/chunks/teammateModeSnapshot-0.5.10-92d1devr.mjs +1 -0
  398. package/dist/chunks/teleport-0.5.10-rkxj6c9z.mjs +1 -0
  399. package/dist/chunks/terminalSetup-0.5.10-xtrfcff1.mjs +1 -0
  400. package/dist/chunks/theme-0.5.10-5rz8k2g9.mjs +1 -0
  401. package/dist/chunks/thinkback-0.5.10-pmdfhfhz.mjs +1 -0
  402. package/dist/chunks/thinkback-play-0.5.10-051qtb4m.mjs +1 -0
  403. package/dist/chunks/toolPool-0.5.10-702w7qvh.mjs +1 -0
  404. package/dist/chunks/toolSearch-0.5.10-emqjgdkv.mjs +1 -0
  405. package/dist/chunks/tools-0.5.10-2msmk0nf.mjs +1 -0
  406. package/dist/chunks/trustedDevice-0.5.10-rc23c6gy.mjs +1 -0
  407. package/dist/chunks/turndown.cjs-0.5.10-a87sftz7.mjs +69 -0
  408. package/dist/chunks/ultrareviewCommand-0.5.10-z29nftnt.mjs +4 -0
  409. package/dist/chunks/update-0.5.10-52yyras3.mjs +86 -0
  410. package/dist/chunks/upgrade-0.5.10-xqdpemsf.mjs +1 -0
  411. package/dist/chunks/upstreamproxy-0.5.10-154q742m.mjs +14 -0
  412. package/dist/chunks/url-handler-napi-0.5.10-8af5etcc.mjs +1 -0
  413. package/dist/chunks/usage-0.5.10-hhg47trs.mjs +1 -0
  414. package/dist/chunks/util-0.5.10-0zqyyf2e.mjs +1 -0
  415. package/dist/chunks/utils-0.5.10-36gnsqbk.mjs +1 -0
  416. package/dist/chunks/vim-0.5.10-0zas1t6x.mjs +1 -0
  417. package/dist/chunks/watcher-0.5.10-9etw516s.mjs +1 -0
  418. package/dist/chunks/wiki-0.5.10-rwktf7fm.mjs +132 -0
  419. package/dist/chunks/worktree-0.5.10-afdnv059.mjs +1 -0
  420. package/dist/chunks/worktreeModeEnabled-0.5.10-n0bmqq02.mjs +1 -0
  421. package/dist/chunks/wrapper-0.5.10-0bca9c3g.mjs +7 -0
  422. package/dist/claudin-vscode.vsix +0 -0
  423. package/dist/cli.mjs +2 -2
  424. package/package.json +24 -24
  425. package/dist/chunks/AgentTool-0.5.8-161prcqd.mjs +0 -1
  426. package/dist/chunks/App-0.5.8-s4939y9q.mjs +0 -1
  427. package/dist/chunks/ApproveApiKey-0.5.8-kyzt3tyh.mjs +0 -1
  428. package/dist/chunks/AssistantSessionChooser-0.5.8-0fws1s48.mjs +0 -1
  429. package/dist/chunks/AutoModeOptInDialog-0.5.8-v373fzha.mjs +0 -1
  430. package/dist/chunks/BypassPermissionsModeDialog-0.5.8-pbv15kg8.mjs +0 -1
  431. package/dist/chunks/ClaudeMdExternalIncludesDialog-0.5.8-rmcm4b5v.mjs +0 -1
  432. package/dist/chunks/ConsoleOAuthFlow-0.5.8-q3djee4h.mjs +0 -1
  433. package/dist/chunks/DiffDialog-0.5.8-1gvdqrt3.mjs +0 -3
  434. package/dist/chunks/Doctor-0.5.8-5k5vqf8q.mjs +0 -1
  435. package/dist/chunks/Grove-0.5.8-g2xzefay.mjs +0 -1
  436. package/dist/chunks/ITermBackend-0.5.8-j209yx9z.mjs +0 -1
  437. package/dist/chunks/InvalidConfigDialog-0.5.8-98nc303h.mjs +0 -1
  438. package/dist/chunks/InvalidSettingsDialog-0.5.8-p5qzw710.mjs +0 -1
  439. package/dist/chunks/MigrationDialog-0.5.8-gp57r21r.mjs +0 -1
  440. package/dist/chunks/Onboarding-0.5.8-m0r6a4s2.mjs +0 -1
  441. package/dist/chunks/ProviderManager-0.5.8-6tfnxyse.mjs +0 -1
  442. package/dist/chunks/REPL-0.5.8-sf0q46pa.mjs +0 -1
  443. package/dist/chunks/ResumeConversation-0.5.8-0j8mw0eh.mjs +0 -1
  444. package/dist/chunks/SnapshotUpdateDialog-0.5.8-13b725ee.mjs +0 -1
  445. package/dist/chunks/TeleportProgress-0.5.8-3fxrymde.mjs +0 -1
  446. package/dist/chunks/TeleportRepoMismatchDialog-0.5.8-1dqx0hnb.mjs +0 -1
  447. package/dist/chunks/TeleportResumeWrapper-0.5.8-84pek3s7.mjs +0 -1
  448. package/dist/chunks/TmuxBackend-0.5.8-rcwm1j6z.mjs +0 -9
  449. package/dist/chunks/ToolSearchTool-0.5.8-fp493kvp.mjs +0 -1
  450. package/dist/chunks/TrustDialog-0.5.8-j0h8y92c.mjs +0 -1
  451. package/dist/chunks/activeProvider-0.5.8-y1zsxh1g.mjs +0 -1
  452. package/dist/chunks/add-dir-0.5.8-sz3kyvkz.mjs +0 -1
  453. package/dist/chunks/agents-0.5.8-cm3hzc60.mjs +0 -3
  454. package/dist/chunks/agents-0.5.8-qg1s69va.mjs +0 -110
  455. package/dist/chunks/api-0.5.8-pcde65dc.mjs +0 -1
  456. package/dist/chunks/asciicast-0.5.8-tgmb7g4m.mjs +0 -1
  457. package/dist/chunks/assistant-0.5.8-4mak6nq9.mjs +0 -1
  458. package/dist/chunks/auth-0.5.8-70ks8nc4.mjs +0 -1
  459. package/dist/chunks/auth-0.5.8-82vx5hkw.mjs +0 -1
  460. package/dist/chunks/autoMode-0.5.8-xjwjh2k5.mjs +0 -48
  461. package/dist/chunks/autoUpdater-0.5.8-rf164ggm.mjs +0 -1
  462. package/dist/chunks/backgroundHousekeeping-0.5.8-ak5ca2cx.mjs +0 -1
  463. package/dist/chunks/branch-0.5.8-n82xbsmg.mjs +0 -4
  464. package/dist/chunks/bridgePointer-0.5.8-m7nwe7sd.mjs +0 -1
  465. package/dist/chunks/btw-0.5.8-0yftty6m.mjs +0 -1
  466. package/dist/chunks/buddy-0.5.8-4dvkprbs.mjs +0 -3
  467. package/dist/chunks/cacache-0.5.8-vj95fs26.mjs +0 -1
  468. package/dist/chunks/cache-probe-0.5.8-944hef3p.mjs +0 -21
  469. package/dist/chunks/cacheStats-0.5.8-jdya51jg.mjs +0 -4
  470. package/dist/chunks/caches-0.5.8-xkrjxp25.mjs +0 -1
  471. package/dist/chunks/claudeDesktop-0.5.8-fpb40wzd.mjs +0 -1
  472. package/dist/chunks/claudemd-0.5.8-eyztrzk8.mjs +0 -1
  473. package/dist/chunks/clear-0.5.8-kgvzdkgq.mjs +0 -1
  474. package/dist/chunks/clearTerminal-0.5.8-xv1faw7c.mjs +0 -1
  475. package/dist/chunks/cli-0.5.8-01yjahnz.mjs +0 -2
  476. package/dist/chunks/cli-0.5.8-07dyymev.mjs +0 -2
  477. package/dist/chunks/cli-0.5.8-0a4sdrgm.mjs +0 -2
  478. package/dist/chunks/cli-0.5.8-0bys4xae.mjs +0 -2
  479. package/dist/chunks/cli-0.5.8-0cmtavcs.mjs +0 -2
  480. package/dist/chunks/cli-0.5.8-0dkx0fh2.mjs +0 -2
  481. package/dist/chunks/cli-0.5.8-0hybhk72.mjs +0 -2
  482. package/dist/chunks/cli-0.5.8-0we2hm7d.mjs +0 -2
  483. package/dist/chunks/cli-0.5.8-1bp61y3p.mjs +0 -2
  484. package/dist/chunks/cli-0.5.8-1gm5vdye.mjs +0 -2
  485. package/dist/chunks/cli-0.5.8-1heha1zs.mjs +0 -2
  486. package/dist/chunks/cli-0.5.8-1x4w18nq.mjs +0 -2
  487. package/dist/chunks/cli-0.5.8-20gjzt7v.mjs +0 -2
  488. package/dist/chunks/cli-0.5.8-221e7v67.mjs +0 -2
  489. package/dist/chunks/cli-0.5.8-23ep6z70.mjs +0 -2
  490. package/dist/chunks/cli-0.5.8-2bq72da9.mjs +0 -2
  491. package/dist/chunks/cli-0.5.8-2f1ewq8w.mjs +0 -2
  492. package/dist/chunks/cli-0.5.8-2g8p9sae.mjs +0 -2
  493. package/dist/chunks/cli-0.5.8-2nr7eh5e.mjs +0 -2
  494. package/dist/chunks/cli-0.5.8-396k3ymm.mjs +0 -25
  495. package/dist/chunks/cli-0.5.8-3a6g7wmx.mjs +0 -58
  496. package/dist/chunks/cli-0.5.8-3fnpjffd.mjs +0 -2
  497. package/dist/chunks/cli-0.5.8-3ndh3gtc.mjs +0 -2
  498. package/dist/chunks/cli-0.5.8-3p5h46hv.mjs +0 -2
  499. package/dist/chunks/cli-0.5.8-3qjtx8w8.mjs +0 -2
  500. package/dist/chunks/cli-0.5.8-3y8x0dx3.mjs +0 -2
  501. package/dist/chunks/cli-0.5.8-3zg1gkde.mjs +0 -2
  502. package/dist/chunks/cli-0.5.8-402vctdy.mjs +0 -2
  503. package/dist/chunks/cli-0.5.8-42eyjvs8.mjs +0 -2
  504. package/dist/chunks/cli-0.5.8-4hvxb5dp.mjs +0 -5286
  505. package/dist/chunks/cli-0.5.8-4jrb4x7b.mjs +0 -9
  506. package/dist/chunks/cli-0.5.8-4mn881k7.mjs +0 -2
  507. package/dist/chunks/cli-0.5.8-4n26wzd5.mjs +0 -2
  508. package/dist/chunks/cli-0.5.8-4rgg1zqd.mjs +0 -6
  509. package/dist/chunks/cli-0.5.8-4xn4yjaa.mjs +0 -8
  510. package/dist/chunks/cli-0.5.8-4yyy85fr.mjs +0 -2
  511. package/dist/chunks/cli-0.5.8-510vqc09.mjs +0 -4
  512. package/dist/chunks/cli-0.5.8-57qan5v8.mjs +0 -2
  513. package/dist/chunks/cli-0.5.8-5a9k7mja.mjs +0 -2
  514. package/dist/chunks/cli-0.5.8-5bdfv4z2.mjs +0 -2
  515. package/dist/chunks/cli-0.5.8-5gzkph9c.mjs +0 -2
  516. package/dist/chunks/cli-0.5.8-5h92528m.mjs +0 -4
  517. package/dist/chunks/cli-0.5.8-5zqpfyqq.mjs +0 -2
  518. package/dist/chunks/cli-0.5.8-60e57smp.mjs +0 -2
  519. package/dist/chunks/cli-0.5.8-665mfjfq.mjs +0 -5
  520. package/dist/chunks/cli-0.5.8-69frkjjq.mjs +0 -2
  521. package/dist/chunks/cli-0.5.8-69swpyae.mjs +0 -2
  522. package/dist/chunks/cli-0.5.8-6epmns99.mjs +0 -2
  523. package/dist/chunks/cli-0.5.8-6nc6hmng.mjs +0 -3
  524. package/dist/chunks/cli-0.5.8-6t480jt6.mjs +0 -2
  525. package/dist/chunks/cli-0.5.8-6tfvmmwd.mjs +0 -2
  526. package/dist/chunks/cli-0.5.8-78y711gq.mjs +0 -7
  527. package/dist/chunks/cli-0.5.8-7fm71y20.mjs +0 -2
  528. package/dist/chunks/cli-0.5.8-7t6q11qp.mjs +0 -3
  529. package/dist/chunks/cli-0.5.8-7teqphwt.mjs +0 -2
  530. package/dist/chunks/cli-0.5.8-7w4sv41z.mjs +0 -2
  531. package/dist/chunks/cli-0.5.8-7wzh55d5.mjs +0 -2
  532. package/dist/chunks/cli-0.5.8-8b40nd32.mjs +0 -3
  533. package/dist/chunks/cli-0.5.8-8c0hade9.mjs +0 -2
  534. package/dist/chunks/cli-0.5.8-8h4z9e0a.mjs +0 -2
  535. package/dist/chunks/cli-0.5.8-8jfx4hd4.mjs +0 -24
  536. package/dist/chunks/cli-0.5.8-8jzc3wsz.mjs +0 -2
  537. package/dist/chunks/cli-0.5.8-8n05q2cg.mjs +0 -4
  538. package/dist/chunks/cli-0.5.8-903jgg2t.mjs +0 -2
  539. package/dist/chunks/cli-0.5.8-959n5v33.mjs +0 -44
  540. package/dist/chunks/cli-0.5.8-96p83b7z.mjs +0 -2
  541. package/dist/chunks/cli-0.5.8-99pnpzq7.mjs +0 -2
  542. package/dist/chunks/cli-0.5.8-9ffdsmw1.mjs +0 -2
  543. package/dist/chunks/cli-0.5.8-9fpm1ms3.mjs +0 -2
  544. package/dist/chunks/cli-0.5.8-9jzc13yp.mjs +0 -2
  545. package/dist/chunks/cli-0.5.8-a03sqccb.mjs +0 -2
  546. package/dist/chunks/cli-0.5.8-at01jfw3.mjs +0 -2
  547. package/dist/chunks/cli-0.5.8-axp2p1sa.mjs +0 -2
  548. package/dist/chunks/cli-0.5.8-bfynw1rm.mjs +0 -2
  549. package/dist/chunks/cli-0.5.8-bhc8vwxd.mjs +0 -2
  550. package/dist/chunks/cli-0.5.8-bjqx8j31.mjs +0 -67
  551. package/dist/chunks/cli-0.5.8-bnqvgx16.mjs +0 -18
  552. package/dist/chunks/cli-0.5.8-brnwv1s4.mjs +0 -2
  553. package/dist/chunks/cli-0.5.8-bv6qegpr.mjs +0 -2
  554. package/dist/chunks/cli-0.5.8-bv8mzvsr.mjs +0 -2
  555. package/dist/chunks/cli-0.5.8-bwsasv3j.mjs +0 -12
  556. package/dist/chunks/cli-0.5.8-cc6m9nm7.mjs +0 -2
  557. package/dist/chunks/cli-0.5.8-cctz1t07.mjs +0 -2
  558. package/dist/chunks/cli-0.5.8-cgt1fvs7.mjs +0 -2
  559. package/dist/chunks/cli-0.5.8-chb0m9py.mjs +0 -17
  560. package/dist/chunks/cli-0.5.8-chdp8e1b.mjs +0 -15
  561. package/dist/chunks/cli-0.5.8-cm551a1y.mjs +0 -2
  562. package/dist/chunks/cli-0.5.8-cv8hrynt.mjs +0 -2
  563. package/dist/chunks/cli-0.5.8-d3t3qcax.mjs +0 -2
  564. package/dist/chunks/cli-0.5.8-dn2c6x2n.mjs +0 -2
  565. package/dist/chunks/cli-0.5.8-dtn5ax3v.mjs +0 -2
  566. package/dist/chunks/cli-0.5.8-e5dnz0q6.mjs +0 -2
  567. package/dist/chunks/cli-0.5.8-e6gpyhnf.mjs +0 -39
  568. package/dist/chunks/cli-0.5.8-edf7e65a.mjs +0 -2
  569. package/dist/chunks/cli-0.5.8-eq34z9xf.mjs +0 -133
  570. package/dist/chunks/cli-0.5.8-erk0zvwn.mjs +0 -3
  571. package/dist/chunks/cli-0.5.8-et8r95zv.mjs +0 -15
  572. package/dist/chunks/cli-0.5.8-etf1n11s.mjs +0 -2
  573. package/dist/chunks/cli-0.5.8-ex39bk3p.mjs +0 -3
  574. package/dist/chunks/cli-0.5.8-f0cc21nk.mjs +0 -34
  575. package/dist/chunks/cli-0.5.8-f1znt77k.mjs +0 -2
  576. package/dist/chunks/cli-0.5.8-f54hhqdn.mjs +0 -4
  577. package/dist/chunks/cli-0.5.8-fbja9vc0.mjs +0 -2
  578. package/dist/chunks/cli-0.5.8-fhebd13f.mjs +0 -12
  579. package/dist/chunks/cli-0.5.8-fmyr9f7x.mjs +0 -18
  580. package/dist/chunks/cli-0.5.8-fr90cgpy.mjs +0 -4
  581. package/dist/chunks/cli-0.5.8-gf6svxra.mjs +0 -27
  582. package/dist/chunks/cli-0.5.8-gm4jqzfs.mjs +0 -2
  583. package/dist/chunks/cli-0.5.8-gnw67m2e.mjs +0 -3
  584. package/dist/chunks/cli-0.5.8-gp6x9qmw.mjs +0 -2
  585. package/dist/chunks/cli-0.5.8-gr2yrqhs.mjs +0 -21
  586. package/dist/chunks/cli-0.5.8-haddssvq.mjs +0 -17
  587. package/dist/chunks/cli-0.5.8-he3sfaey.mjs +0 -2
  588. package/dist/chunks/cli-0.5.8-hkfwdsmy.mjs +0 -2
  589. package/dist/chunks/cli-0.5.8-hz85a3w7.mjs +0 -2
  590. package/dist/chunks/cli-0.5.8-j5n54z7y.mjs +0 -2
  591. package/dist/chunks/cli-0.5.8-j5nn8m2r.mjs +0 -2
  592. package/dist/chunks/cli-0.5.8-jcm5hsqp.mjs +0 -6
  593. package/dist/chunks/cli-0.5.8-je6yq94p.mjs +0 -2
  594. package/dist/chunks/cli-0.5.8-jjmb10ns.mjs +0 -10
  595. package/dist/chunks/cli-0.5.8-jtqyf6nz.mjs +0 -9
  596. package/dist/chunks/cli-0.5.8-kbjtm14d.mjs +0 -2
  597. package/dist/chunks/cli-0.5.8-kdatn7ch.mjs +0 -2
  598. package/dist/chunks/cli-0.5.8-kmzftyt4.mjs +0 -2
  599. package/dist/chunks/cli-0.5.8-m3186fr3.mjs +0 -5
  600. package/dist/chunks/cli-0.5.8-m7f68vhz.mjs +0 -2
  601. package/dist/chunks/cli-0.5.8-m9yn90fe.mjs +0 -4
  602. package/dist/chunks/cli-0.5.8-mf9m22v5.mjs +0 -2
  603. package/dist/chunks/cli-0.5.8-mgzx32hk.mjs +0 -3
  604. package/dist/chunks/cli-0.5.8-ntjmzc72.mjs +0 -4
  605. package/dist/chunks/cli-0.5.8-nwe7yne9.mjs +0 -59
  606. package/dist/chunks/cli-0.5.8-p2n1sz9e.mjs +0 -2
  607. package/dist/chunks/cli-0.5.8-p596xr80.mjs +0 -2
  608. package/dist/chunks/cli-0.5.8-p72phgsn.mjs +0 -2
  609. package/dist/chunks/cli-0.5.8-p84q1yp2.mjs +0 -2
  610. package/dist/chunks/cli-0.5.8-p9vc4jd4.mjs +0 -2
  611. package/dist/chunks/cli-0.5.8-pbvqqyq3.mjs +0 -133
  612. package/dist/chunks/cli-0.5.8-pmsd92jp.mjs +0 -2
  613. package/dist/chunks/cli-0.5.8-ppmhyhcf.mjs +0 -2
  614. package/dist/chunks/cli-0.5.8-pwcy1yf9.mjs +0 -2
  615. package/dist/chunks/cli-0.5.8-qdnr3r07.mjs +0 -2
  616. package/dist/chunks/cli-0.5.8-qf19nfhv.mjs +0 -193
  617. package/dist/chunks/cli-0.5.8-qgd7he6r.mjs +0 -3
  618. package/dist/chunks/cli-0.5.8-qrbzvxe2.mjs +0 -2
  619. package/dist/chunks/cli-0.5.8-qvy0n26p.mjs +0 -2
  620. package/dist/chunks/cli-0.5.8-r3r9r1x8.mjs +0 -2
  621. package/dist/chunks/cli-0.5.8-r3zjfgs5.mjs +0 -2
  622. package/dist/chunks/cli-0.5.8-r88abafr.mjs +0 -15
  623. package/dist/chunks/cli-0.5.8-rddkqxh8.mjs +0 -16
  624. package/dist/chunks/cli-0.5.8-rjn66mdx.mjs +0 -4
  625. package/dist/chunks/cli-0.5.8-rtmc93gs.mjs +0 -2
  626. package/dist/chunks/cli-0.5.8-rvxqss4v.mjs +0 -12
  627. package/dist/chunks/cli-0.5.8-s3j6qsck.mjs +0 -3
  628. package/dist/chunks/cli-0.5.8-s7px34xg.mjs +0 -2
  629. package/dist/chunks/cli-0.5.8-sbqgh2ca.mjs +0 -2
  630. package/dist/chunks/cli-0.5.8-t3x9v2fr.mjs +0 -2
  631. package/dist/chunks/cli-0.5.8-tc6ssmvg.mjs +0 -2
  632. package/dist/chunks/cli-0.5.8-tknpvwjq.mjs +0 -24
  633. package/dist/chunks/cli-0.5.8-tp8vvk8a.mjs +0 -4
  634. package/dist/chunks/cli-0.5.8-v274erpp.mjs +0 -2
  635. package/dist/chunks/cli-0.5.8-v5gbzf09.mjs +0 -2
  636. package/dist/chunks/cli-0.5.8-vax2sw0y.mjs +0 -2
  637. package/dist/chunks/cli-0.5.8-vck50j66.mjs +0 -2
  638. package/dist/chunks/cli-0.5.8-vhpgdwvb.mjs +0 -45
  639. package/dist/chunks/cli-0.5.8-w36atn94.mjs +0 -2
  640. package/dist/chunks/cli-0.5.8-w75qbypx.mjs +0 -2
  641. package/dist/chunks/cli-0.5.8-w7g735pf.mjs +0 -2
  642. package/dist/chunks/cli-0.5.8-was67jgw.mjs +0 -2
  643. package/dist/chunks/cli-0.5.8-wcjp9e8f.mjs +0 -50
  644. package/dist/chunks/cli-0.5.8-wcyjzsha.mjs +0 -2
  645. package/dist/chunks/cli-0.5.8-wdyh9mqa.mjs +0 -3
  646. package/dist/chunks/cli-0.5.8-wkcmqhde.mjs +0 -2
  647. package/dist/chunks/cli-0.5.8-wm9jby2t.mjs +0 -2
  648. package/dist/chunks/cli-0.5.8-wtz636rz.mjs +0 -20
  649. package/dist/chunks/cli-0.5.8-x8fzgqvs.mjs +0 -2
  650. package/dist/chunks/cli-0.5.8-x9q7q10d.mjs +0 -2
  651. package/dist/chunks/cli-0.5.8-xs1gy1tk.mjs +0 -6
  652. package/dist/chunks/cli-0.5.8-xvf56w0z.mjs +0 -2
  653. package/dist/chunks/cli-0.5.8-xwpp4ts7.mjs +0 -2
  654. package/dist/chunks/cli-0.5.8-xwzk13b3.mjs +0 -2
  655. package/dist/chunks/cli-0.5.8-yfpy2mmj.mjs +0 -2
  656. package/dist/chunks/cli-0.5.8-ywfvs57d.mjs +0 -2
  657. package/dist/chunks/cli-0.5.8-z14ncgt9.mjs +0 -2
  658. package/dist/chunks/cli-0.5.8-z3ev1ken.mjs +0 -3
  659. package/dist/chunks/cli-0.5.8-z447z8t0.mjs +0 -2
  660. package/dist/chunks/cli-0.5.8-zervw1k3.mjs +0 -5
  661. package/dist/chunks/cli-0.5.8-zf5yzqn5.mjs +0 -1
  662. package/dist/chunks/cli-0.5.8-zhydxkm6.mjs +0 -2
  663. package/dist/chunks/cli-0.5.8-zkn5gecs.mjs +0 -2
  664. package/dist/chunks/cli-0.5.8-zy590bkh.mjs +0 -2
  665. package/dist/chunks/client-0.5.8-9axd4w58.mjs +0 -1
  666. package/dist/chunks/color-0.5.8-resv1z9m.mjs +0 -1
  667. package/dist/chunks/compact-0.5.8-4rtxsg5x.mjs +0 -3
  668. package/dist/chunks/config-0.5.8-1j4xyj57.mjs +0 -1
  669. package/dist/chunks/config-0.5.8-ettscama.mjs +0 -1
  670. package/dist/chunks/context-0.5.8-fpg3fcmt.mjs +0 -1
  671. package/dist/chunks/context-noninteractive-0.5.8-zaspwvjm.mjs +0 -1
  672. package/dist/chunks/conversation-0.5.8-hfvm0eqb.mjs +0 -1
  673. package/dist/chunks/copy-0.5.8-wzb7pjzr.mjs +0 -9
  674. package/dist/chunks/cost-0.5.8-f2m9t7ye.mjs +0 -1
  675. package/dist/chunks/createSSHSession-0.5.8-615sh7tx.mjs +0 -1
  676. package/dist/chunks/createSession-0.5.8-v7srm5ea.mjs +0 -1
  677. package/dist/chunks/debug-0.5.8-c84dbamw.mjs +0 -1
  678. package/dist/chunks/defaultActionDeps-0.5.8-b94dtwtd.mjs +0 -1177
  679. package/dist/chunks/desktop-0.5.8-46z10hnt.mjs +0 -1
  680. package/dist/chunks/detectRepository-0.5.8-rwc4rjfg.mjs +0 -1
  681. package/dist/chunks/detection-0.5.8-hydnvzf4.mjs +0 -1
  682. package/dist/chunks/diff-0.5.8-p7d54hn7.mjs +0 -1
  683. package/dist/chunks/doctor-0.5.8-894mdsxc.mjs +0 -1
  684. package/dist/chunks/doctorDiagnostic-0.5.8-c12xcayk.mjs +0 -1
  685. package/dist/chunks/earlyInput-0.5.8-fwa1r2va.mjs +0 -1
  686. package/dist/chunks/effort-0.5.8-7gcwya2k.mjs +0 -10
  687. package/dist/chunks/envUtils-0.5.8-20c2f8v3.mjs +0 -1
  688. package/dist/chunks/environmentSelection-0.5.8-t6hzsc8z.mjs +0 -1
  689. package/dist/chunks/environments-0.5.8-fcp8bfe3.mjs +0 -1
  690. package/dist/chunks/errors-0.5.8-ev3jqbjj.mjs +0 -1
  691. package/dist/chunks/exampleCommands-0.5.8-d38qs6k2.mjs +0 -1
  692. package/dist/chunks/exit-0.5.8-f5v7cstg.mjs +0 -1
  693. package/dist/chunks/export-0.5.8-a8fg7991.mjs +0 -2
  694. package/dist/chunks/extra-usage-0.5.8-r5qs5fjk.mjs +0 -1
  695. package/dist/chunks/extra-usage-noninteractive-0.5.8-f8mch55k.mjs +0 -1
  696. package/dist/chunks/fast-0.5.8-5yfvbb7d.mjs +0 -1
  697. package/dist/chunks/feedback-0.5.8-j9xstj5q.mjs +0 -14
  698. package/dist/chunks/firstPartyEventLogger-0.5.8-tmpw0mgj.mjs +0 -1
  699. package/dist/chunks/git-0.5.8-vvd1b8x0.mjs +0 -1
  700. package/dist/chunks/githubModelsCredentials-0.5.8-de9f7e7s.mjs +0 -1
  701. package/dist/chunks/grove-0.5.8-rewcpbks.mjs +0 -1
  702. package/dist/chunks/growthbook-0.5.8-tt3wbrct.mjs +0 -1
  703. package/dist/chunks/headless-0.5.8-h1tn9ee3.mjs +0 -2
  704. package/dist/chunks/heapdump-0.5.8-e0vshas9.mjs +0 -6
  705. package/dist/chunks/help-0.5.8-mhhgyvqz.mjs +0 -1
  706. package/dist/chunks/hookChains-0.5.8-ewzfdp91.mjs +0 -3
  707. package/dist/chunks/hooks-0.5.8-mgp708m9.mjs +0 -1
  708. package/dist/chunks/hooks-0.5.8-p1mz2zy1.mjs +0 -79
  709. package/dist/chunks/ide-0.5.8-pzfhr27w.mjs +0 -3
  710. package/dist/chunks/image-processor-napi-0.5.8-1skckgt6.mjs +0 -1
  711. package/dist/chunks/index-0.5.8-0dkn7rr7.mjs +0 -9
  712. package/dist/chunks/index-0.5.8-26yrjbk0.mjs +0 -1
  713. package/dist/chunks/index-0.5.8-5cr4y9wx.mjs +0 -1
  714. package/dist/chunks/index-0.5.8-5mgzpm7c.mjs +0 -1
  715. package/dist/chunks/index-0.5.8-b4p3af9y.mjs +0 -1
  716. package/dist/chunks/index-0.5.8-b7tvbbzv.mjs +0 -2
  717. package/dist/chunks/index-0.5.8-bk6ejev9.mjs +0 -1
  718. package/dist/chunks/index-0.5.8-cmyhdm8s.mjs +0 -9
  719. package/dist/chunks/index-0.5.8-egkksjaj.mjs +0 -1
  720. package/dist/chunks/index-0.5.8-hr8aqgvc.mjs +0 -1
  721. package/dist/chunks/index-0.5.8-jf20nzsg.mjs +0 -1
  722. package/dist/chunks/index-0.5.8-m6exk6z6.mjs +0 -30
  723. package/dist/chunks/index-0.5.8-mpm6xxk3.mjs +0 -5
  724. package/dist/chunks/index-0.5.8-nt058ay0.mjs +0 -1
  725. package/dist/chunks/index-0.5.8-qdwcg9cv.mjs +0 -10
  726. package/dist/chunks/index-0.5.8-rdk757cq.mjs +0 -1
  727. package/dist/chunks/index-0.5.8-red1reev.mjs +0 -1
  728. package/dist/chunks/index-0.5.8-rehfpmcw.mjs +0 -1
  729. package/dist/chunks/index-0.5.8-s3k17n65.mjs +0 -1
  730. package/dist/chunks/index-0.5.8-xpaaycp7.mjs +0 -1
  731. package/dist/chunks/index-0.5.8-ydqh8xbm.mjs +0 -2
  732. package/dist/chunks/index-0.5.8-yp0fpaqf.mjs +0 -1
  733. package/dist/chunks/init-0.5.8-kmfn7vay.mjs +0 -1
  734. package/dist/chunks/initReplBridge-0.5.8-f9ezc1jk.mjs +0 -1
  735. package/dist/chunks/ink-0.5.8-y01565nf.mjs +0 -1
  736. package/dist/chunks/insights-0.5.8-mwq5z31x.mjs +0 -870
  737. package/dist/chunks/install-0.5.8-se0j5qte.mjs +0 -1
  738. package/dist/chunks/install-github-app-0.5.8-zqhhg1fw.mjs +0 -149
  739. package/dist/chunks/install-slack-app-0.5.8-9qpwy0z9.mjs +0 -1
  740. package/dist/chunks/instrumentation-0.5.8-gbnaaqp3.mjs +0 -1
  741. package/dist/chunks/interactiveHelpers-0.5.8-wrn95m3j.mjs +0 -1
  742. package/dist/chunks/keybindings-0.5.8-j070t67n.mjs +0 -2
  743. package/dist/chunks/knowledge-0.5.8-fhr55cqh.mjs +0 -2
  744. package/dist/chunks/latestVersionCache-0.5.8-rmkxtaea.mjs +0 -1
  745. package/dist/chunks/loadAgentsDir-0.5.8-f3j27p5s.mjs +0 -1
  746. package/dist/chunks/loadPluginHooks-0.5.8-7401ty3k.mjs +0 -1
  747. package/dist/chunks/loadPluginHooks-0.5.8-yhhkejwz.mjs +0 -1
  748. package/dist/chunks/log-0.5.8-78h0x7qg.mjs +0 -1
  749. package/dist/chunks/main-0.5.8-4ddjgz4x.mjs +0 -1
  750. package/dist/chunks/managedEnv-0.5.8-rxnh3nhr.mjs +0 -1
  751. package/dist/chunks/mcp-0.5.8-9ts7qrcv.mjs +0 -4
  752. package/dist/chunks/mcp-0.5.8-hhnpsgvh.mjs +0 -17
  753. package/dist/chunks/mcp-0.5.8-md6hzter.mjs +0 -1
  754. package/dist/chunks/mcpb-0.5.8-ebcb4nn4.mjs +0 -1
  755. package/dist/chunks/memory-0.5.8-ph5hb81n.mjs +0 -3
  756. package/dist/chunks/mobile-0.5.8-f04nmet1.mjs +0 -2
  757. package/dist/chunks/model-0.5.8-aqzt03nd.mjs +0 -1
  758. package/dist/chunks/model-0.5.8-nmcrv393.mjs +0 -2
  759. package/dist/chunks/oauth-0.5.8-n75mrvf3.mjs +0 -1
  760. package/dist/chunks/openaiShim-0.5.8-95kwrgpv.mjs +0 -14
  761. package/dist/chunks/output-style-0.5.8-zy932aj1.mjs +0 -1
  762. package/dist/chunks/package-APBHZ5F3-0.5.8-c4xw21z8.mjs +0 -1
  763. package/dist/chunks/parseConnectUrl-0.5.8-0dgzrde4.mjs +0 -1
  764. package/dist/chunks/parser-0.5.8-g6wgq5z2.mjs +0 -1
  765. package/dist/chunks/passes-0.5.8-jkdncmr5.mjs +0 -1
  766. package/dist/chunks/permissions-0.5.8-tesg1fmt.mjs +0 -3
  767. package/dist/chunks/plan-0.5.8-4h4wazbm.mjs +0 -1
  768. package/dist/chunks/plist-0.5.8-ygsvkws5.mjs +0 -1
  769. package/dist/chunks/plugin-0.5.8-meszp93t.mjs +0 -29
  770. package/dist/chunks/pluginStartupCheck-0.5.8-8c49aq53.mjs +0 -1
  771. package/dist/chunks/plugins-0.5.8-zh9wq5by.mjs +0 -9
  772. package/dist/chunks/preActionHook-0.5.8-r8zrjby2.mjs +0 -2
  773. package/dist/chunks/print-0.5.8-dbcfsrdg.mjs +0 -57
  774. package/dist/chunks/privacy-settings-0.5.8-zj36f0ve.mjs +0 -1
  775. package/dist/chunks/process-0.5.8-1yf78q4y.mjs +0 -1
  776. package/dist/chunks/processBashCommand-0.5.8-pdnzd9ry.mjs +0 -1
  777. package/dist/chunks/processSlashCommand-0.5.8-kmv9fs8d.mjs +0 -9
  778. package/dist/chunks/prompt-0.5.8-aa1v4zh0.mjs +0 -1
  779. package/dist/chunks/prompt-0.5.8-wabf0exz.mjs +0 -1
  780. package/dist/chunks/prompts-0.5.8-n865vxaw.mjs +0 -1
  781. package/dist/chunks/protocolHandler-0.5.8-6k7ma4yf.mjs +0 -13
  782. package/dist/chunks/provider-0.5.8-qsr51mc2.mjs +0 -2
  783. package/dist/chunks/providerProfiles-0.5.8-he8tbnf5.mjs +0 -1
  784. package/dist/chunks/providerValidation-0.5.8-6cjh43zv.mjs +0 -6
  785. package/dist/chunks/rate-limit-options-0.5.8-pvbwwt4v.mjs +0 -1
  786. package/dist/chunks/registerSubcommands-0.5.8-8jq52atf.mjs +0 -34
  787. package/dist/chunks/registry-0.5.8-ynn6qxq6.mjs +0 -1
  788. package/dist/chunks/release-notes-0.5.8-yydjz710.mjs +0 -5
  789. package/dist/chunks/reload-plugins-0.5.8-64ybz2n4.mjs +0 -2
  790. package/dist/chunks/remote-env-0.5.8-1f4tf3ch.mjs +0 -1
  791. package/dist/chunks/remoteBridgeCore-0.5.8-qnrtc8aw.mjs +0 -1
  792. package/dist/chunks/remoteSession-0.5.8-kxsfx9gd.mjs +0 -1
  793. package/dist/chunks/rename-0.5.8-j4c6dg9n.mjs +0 -1
  794. package/dist/chunks/replBridgeHandle-0.5.8-w33fvpqt.mjs +0 -1
  795. package/dist/chunks/replLauncher-0.5.8-7jzc54fq.mjs +0 -1
  796. package/dist/chunks/resume-0.5.8-373epwyd.mjs +0 -2
  797. package/dist/chunks/rewind-0.5.8-b9qe0mwn.mjs +0 -1
  798. package/dist/chunks/rootOptions-0.5.8-h1ddt4ry.mjs +0 -1
  799. package/dist/chunks/sandbox-adapter-0.5.8-ma6nv5dg.mjs +0 -1
  800. package/dist/chunks/sandbox-toggle-0.5.8-1cc5m303.mjs +0 -1
  801. package/dist/chunks/session-0.5.8-rxft524k.mjs +0 -2
  802. package/dist/chunks/sessionDiscovery-0.5.8-r4eg8g3r.mjs +0 -1
  803. package/dist/chunks/sessionFileAccessHooks-0.5.8-jm3bmvt7.mjs +0 -1
  804. package/dist/chunks/sessionStorage-0.5.8-kfghwskw.mjs +0 -1
  805. package/dist/chunks/settings-0.5.8-qxr7dgzb.mjs +0 -1
  806. package/dist/chunks/setup-0.5.8-769vnffz.mjs +0 -5
  807. package/dist/chunks/sinks-0.5.8-jcq0kgny.mjs +0 -1
  808. package/dist/chunks/skills-0.5.8-5qxr2p94.mjs +0 -1
  809. package/dist/chunks/startupProfiler-0.5.8-cpbf91zs.mjs +0 -1
  810. package/dist/chunks/startupUpdateCheck-0.5.8-bctkpcea.mjs +0 -1
  811. package/dist/chunks/state-0.5.8-cppqmrbf.mjs +0 -1
  812. package/dist/chunks/stats-0.5.8-zcfm59db.mjs +0 -6
  813. package/dist/chunks/status-0.5.8-5v4y485z.mjs +0 -1
  814. package/dist/chunks/stickers-0.5.8-9gr6e2xg.mjs +0 -1
  815. package/dist/chunks/subprocessEnv-0.5.8-wf4cta06.mjs +0 -1
  816. package/dist/chunks/tasks-0.5.8-30z30sqv.mjs +0 -1
  817. package/dist/chunks/teamHelpers-0.5.8-vcng2y7m.mjs +0 -1
  818. package/dist/chunks/teammateModeSnapshot-0.5.8-48p5p451.mjs +0 -1
  819. package/dist/chunks/teleport-0.5.8-650m4rks.mjs +0 -1
  820. package/dist/chunks/terminalSetup-0.5.8-ew1ax86g.mjs +0 -1
  821. package/dist/chunks/theme-0.5.8-7a06760x.mjs +0 -1
  822. package/dist/chunks/thinkback-0.5.8-xrvqhj8w.mjs +0 -1
  823. package/dist/chunks/thinkback-play-0.5.8-vkpn13f3.mjs +0 -1
  824. package/dist/chunks/toolPool-0.5.8-ntbr808f.mjs +0 -1
  825. package/dist/chunks/toolSearch-0.5.8-ybxz2f7f.mjs +0 -1
  826. package/dist/chunks/tools-0.5.8-egnmkxt7.mjs +0 -1
  827. package/dist/chunks/trustedDevice-0.5.8-422swdjw.mjs +0 -1
  828. package/dist/chunks/turndown.cjs-0.5.8-tkat2x5p.mjs +0 -69
  829. package/dist/chunks/ultrareviewCommand-0.5.8-e7b2408n.mjs +0 -4
  830. package/dist/chunks/update-0.5.8-a285y5j4.mjs +0 -86
  831. package/dist/chunks/upgrade-0.5.8-8nxejvyv.mjs +0 -1
  832. package/dist/chunks/upstreamproxy-0.5.8-6a2g1s50.mjs +0 -14
  833. package/dist/chunks/url-handler-napi-0.5.8-83a2qhsf.mjs +0 -1
  834. package/dist/chunks/usage-0.5.8-9dha8gsc.mjs +0 -1
  835. package/dist/chunks/util-0.5.8-c7zdhrd1.mjs +0 -1
  836. package/dist/chunks/utils-0.5.8-e8pfjkrb.mjs +0 -1
  837. package/dist/chunks/vim-0.5.8-pgsav8je.mjs +0 -1
  838. package/dist/chunks/watcher-0.5.8-w3q8518m.mjs +0 -1
  839. package/dist/chunks/wiki-0.5.8-1sa2h258.mjs +0 -132
  840. package/dist/chunks/worktree-0.5.8-59wmpecg.mjs +0 -1
  841. package/dist/chunks/worktreeModeEnabled-0.5.8-pexygrty.mjs +0 -1
  842. package/dist/chunks/wrapper-0.5.8-kmv5mk0m.mjs +0 -7
  843. /package/dist/chunks/{cli-0.5.8-kegk7gdp.mjs → cli-0.5.10-5kz0qdsz.mjs} +0 -0
  844. /package/dist/chunks/{cli-0.5.8-j77twbsq.mjs → cli-0.5.10-n8pz2na8.mjs} +0 -0
@@ -0,0 +1,7 @@
1
+ import{$Q as a,YQ as t,ZQ as E,aR as o,bR as s,gR as GQ}from"./cli-0.5.10-0ar26ct8.mjs";import{wZ as N,yZ as r}from"./cli-0.5.10-p5j82v0t.mjs";import{N2 as U,O2 as I}from"./cli-0.5.10-xyscak5q.mjs";import{e4 as n,l4 as KQ}from"./cli-0.5.10-2yrgbmd1.mjs";import{x6 as Y,z6 as h}from"./cli-0.5.10-2fqes7gy.mjs";import{Oea as u,Qea as ZQ}from"./cli-0.5.10-y9qd4psg.mjs";import{Qfa as K,Tfa as b,tfa as k,ufa as R,yfa as y}from"./cli-0.5.10-p4wmnjhz.mjs";import{iga as H,jga as i,pga as F}from"./cli-0.5.10-8wqagr68.mjs";import{Wma as e,mna as jQ}from"./cli-0.5.10-rwqvbtg3.mjs";ZQ();b();h();F();y();function D(Q){if(Q<60000)return`${Math.round(Q/1000)}s`;let W=Math.floor(Q/60000),Z=Math.round(Q%60000/1000);return Z>0?`${W}m ${Z}s`:`${W}m`}function $Q(Q){let Z=(Q.startsWith("sk-ant-si-")?Q.slice(10):Q).split(".");if(Z.length!==3||!Z[1])return null;try{return R(Buffer.from(Z[1],"base64url").toString("utf8"))}catch{return null}}function f(Q){let W=$Q(Q);if(W!==null&&typeof W==="object"&&"exp"in W&&typeof W.exp==="number")return W.exp;return null}var zQ=300000,p=1800000,m=3,JQ=60000;function FQ({getAccessToken:Q,onRefresh:W,label:Z,refreshBufferMs:z=zQ}){let $=new Map,J=new Map,G=new Map;function X(V){let w=(G.get(V)??0)+1;return G.set(V,w),w}function q(V,w){let j=f(w);if(!j){K(`[${Z}:token] Could not decode JWT expiry for sessionId=${V}, token prefix=${w.slice(0,15)}…, keeping existing timer`);return}let C=$.get(V);if(C)clearTimeout(C);let B=X(V),P=new Date(j*1000).toISOString(),v=j*1000-Date.now()-z;if(v<=0){K(`[${Z}:token] Token for sessionId=${V} expires=${P} (past or within buffer), refreshing immediately`),O(V,B);return}K(`[${Z}:token] Scheduled token refresh for sessionId=${V} in ${D(v)} (expires=${P}, buffer=${z/1000}s)`);let WQ=setTimeout(O,v,V,B);$.set(V,WQ)}function L(V,w){let j=$.get(V);if(j)clearTimeout(j);let C=X(V),B=Math.max(w*1000-z,30000);K(`[${Z}:token] Scheduled token refresh for sessionId=${V} in ${D(B)} (expires_in=${w}s, buffer=${z/1000}s)`);let P=setTimeout(O,B,V,C);$.set(V,P)}async function O(V,w){let j;try{j=await Q()}catch(B){K(`[${Z}:token] getAccessToken threw for sessionId=${V}: ${H(B)}`,{level:"error"})}if(G.get(V)!==w){K(`[${Z}:token] doRefresh for sessionId=${V} stale (gen ${w} vs ${G.get(V)}), skipping`);return}if(!j){let B=(J.get(V)??0)+1;if(J.set(V,B),K(`[${Z}:token] No OAuth token available for refresh, sessionId=${V} (failure ${B}/${m})`,{level:"error"}),Y("error","bridge_token_refresh_no_oauth"),B<m){let P=setTimeout(O,JQ,V,w);$.set(V,P)}return}J.delete(V),K(`[${Z}:token] Refreshing token for sessionId=${V}: new token prefix=${j.slice(0,15)}…`),u("tengu_bridge_token_refreshed",{}),W(V,j);let C=setTimeout(O,p,V,w);$.set(V,C),K(`[${Z}:token] Scheduled follow-up refresh for sessionId=${V} in ${D(p)}`)}function _(V){X(V);let w=$.get(V);if(w)clearTimeout(w),$.delete(V);J.delete(V)}function QQ(){for(let V of G.keys())X(V);for(let V of $.values())clearTimeout(V);$.clear(),J.clear()}return{schedule:q,scheduleFromExpiresIn:L,cancel:_,cancelAll:QQ}}import{randomUUID as g}from"crypto";b();h();F();KQ();GQ();a();I();r();y();class T extends Error{retryAfterMs;constructor(Q,W){super(Q);this.retryAfterMs=W}}class x{pending=[];pendingAtClose=0;draining=!1;closed=!1;backpressureResolvers=[];sleepResolve=null;flushResolvers=[];droppedBatches=0;config;constructor(Q){this.config=Q}get droppedBatchCount(){return this.droppedBatches}get pendingCount(){return this.closed?this.pendingAtClose:this.pending.length}async enqueue(Q){if(this.closed)return;let W=Array.isArray(Q)?Q:[Q];if(W.length===0)return;while(this.pending.length+W.length>this.config.maxQueueSize&&!this.closed)await new Promise((Z)=>{this.backpressureResolvers.push(Z)});if(this.closed)return;this.pending.push(...W),this.drain()}flush(){if(this.pending.length===0&&!this.draining)return Promise.resolve();return this.drain(),new Promise((Q)=>{this.flushResolvers.push(Q)})}close(){if(this.closed)return;this.closed=!0,this.pendingAtClose=this.pending.length,this.pending=[],this.sleepResolve?.(),this.sleepResolve=null;for(let Q of this.backpressureResolvers)Q();this.backpressureResolvers=[];for(let Q of this.flushResolvers)Q();this.flushResolvers=[]}async drain(){if(this.draining||this.closed)return;this.draining=!0;let Q=0;try{while(this.pending.length>0&&!this.closed){let W=this.takeBatch();if(W.length===0)continue;try{await this.config.send(W),Q=0}catch(Z){if(Q++,this.config.maxConsecutiveFailures!==void 0&&Q>=this.config.maxConsecutiveFailures){this.droppedBatches++,this.config.onBatchDropped?.(W.length,Q),Q=0,this.releaseBackpressure();continue}this.pending=W.concat(this.pending);let z=Z instanceof T?Z.retryAfterMs:void 0;await this.sleep(this.retryDelay(Q,z));continue}this.releaseBackpressure()}}finally{if(this.draining=!1,this.pending.length===0){for(let W of this.flushResolvers)W();this.flushResolvers=[]}}}takeBatch(){let{maxBatchSize:Q,maxBatchBytes:W}=this.config;if(W===void 0)return this.pending.splice(0,Q);let Z=0,z=0;while(z<this.pending.length&&z<Q){let $;try{$=Buffer.byteLength(k(this.pending[z]))}catch{this.pending.splice(z,1);continue}if(z>0&&Z+$>W)break;Z+=$,z++}return this.pending.splice(0,z)}retryDelay(Q,W){let Z=Math.random()*this.config.jitterMs;if(W!==void 0)return Math.max(this.config.baseDelayMs,Math.min(W,this.config.maxDelayMs))+Z;return Math.min(this.config.baseDelayMs*2**(Q-1),this.config.maxDelayMs)+Z}releaseBackpressure(){let Q=this.backpressureResolvers;this.backpressureResolvers=[];for(let W of Q)W()}sleep(Q){return new Promise((W)=>{this.sleepResolve=W,setTimeout((Z,z)=>{Z.sleepResolve=null,z()},Q,this,W)})}}I();class c{inflight=null;pending=null;closed=!1;config;constructor(Q){this.config=Q}enqueue(Q){if(this.closed)return;this.pending=this.pending?d(this.pending,Q):Q,this.drain()}close(){this.closed=!0,this.pending=null}async drain(){if(this.inflight||this.closed)return;if(!this.pending)return;let Q=this.pending;this.pending=null,this.inflight=this.sendWithRetry(Q).then(()=>{if(this.inflight=null,this.pending&&!this.closed)this.drain()})}async sendWithRetry(Q){let W=Q,Z=0;while(!this.closed){if(await this.config.send(W))return;if(Z++,await U(this.retryDelay(Z)),this.pending&&!this.closed)W=d(W,this.pending),this.pending=null}}retryDelay(Q){let W=Math.min(this.config.baseDelayMs*2**(Q-1),this.config.maxDelayMs),Z=Math.random()*this.config.jitterMs;return W+Z}}function d(Q,W){let Z={...Q};for(let[z,$]of Object.entries(W))if((z==="external_metadata"||z==="internal_metadata")&&Z[z]&&typeof Z[z]==="object"&&typeof $==="object"&&$!==null)Z[z]={...Z[z],...$};else Z[z]=$;return Z}var VQ=20000,YQ=100;function l(){return!0}class M extends Error{reason;constructor(Q){super(`CCRClient init failed: ${Q}`);this.reason=Q}}var XQ=10;function qQ(){return{byMessage:new Map,scopeToMessage:new Map}}function S(Q){return`${Q.session_id}:${Q.parent_tool_use_id??""}`}function wQ(Q,W){let Z=[],z=new Map;for(let $ of Q)switch($.event.type){case"message_start":{let J=$.event.message.id,G=W.scopeToMessage.get(S($));if(G)W.byMessage.delete(G);W.scopeToMessage.set(S($),J),W.byMessage.set(J,[]),Z.push($);break}case"content_block_delta":{if($.event.delta.type!=="text_delta"){Z.push($);break}let J=W.scopeToMessage.get(S($)),G=J?W.byMessage.get(J):void 0;if(!G){Z.push($);break}let X=G[$.event.index]??=[];X.push($.event.delta.text);let q=z.get(X);if(q){q.event.delta.text=X.join("");break}let L={type:"stream_event",uuid:$.uuid,session_id:$.session_id,parent_tool_use_id:$.parent_tool_use_id,event:{type:"content_block_delta",index:$.event.index,delta:{type:"text_delta",text:X.join("")}}};z.set(X,L),Z.push(L);break}default:Z.push($)}return Z}function LQ(Q,W){Q.byMessage.delete(W.message.id);let Z=S(W);if(Q.scopeToMessage.get(Z)===W.message.id)Q.scopeToMessage.delete(Z)}class OQ{workerEpoch=0;heartbeatIntervalMs;heartbeatJitterFraction;heartbeatTimer=null;heartbeatInFlight=!1;closed=!1;consecutiveAuthFailures=0;currentState=null;sessionBaseUrl;sessionId;http=n({keepAlive:!0});streamEventBuffer=[];streamEventTimer=null;streamTextAccumulator=qQ();workerState;eventUploader;internalEventUploader;deliveryUploader;onEpochMismatch;getAuthHeaders;constructor(Q,W,Z){if(this.onEpochMismatch=Z?.onEpochMismatch??(()=>{process.exit(1)}),this.heartbeatIntervalMs=Z?.heartbeatIntervalMs??VQ,this.heartbeatJitterFraction=Z?.heartbeatJitterFraction??0,this.getAuthHeaders=Z?.getAuthHeaders??E,W.protocol!=="http:"&&W.protocol!=="https:")throw Error(`CCRClient: Expected http(s) URL, got ${W.protocol}`);let z=W.pathname.replace(/\/$/,"");this.sessionBaseUrl=`${W.protocol}//${W.host}${z}`,this.sessionId=z.split("/").pop()||"",this.workerState=new c({send:($)=>this.request("put","/worker",{worker_epoch:this.workerEpoch,...$},"PUT worker").then((J)=>J.ok),baseDelayMs:500,maxDelayMs:30000,jitterMs:500}),this.eventUploader=new x({maxBatchSize:100,maxBatchBytes:10485760,maxQueueSize:1e5,send:async($)=>{let J=await this.request("post","/worker/events",{worker_epoch:this.workerEpoch,events:$},"client events");if(!J.ok)throw new T("client event POST failed",J.retryAfterMs)},baseDelayMs:500,maxDelayMs:30000,jitterMs:500}),this.internalEventUploader=new x({maxBatchSize:100,maxBatchBytes:10485760,maxQueueSize:200,send:async($)=>{let J=await this.request("post","/worker/internal-events",{worker_epoch:this.workerEpoch,events:$},"internal events");if(!J.ok)throw new T("internal event POST failed",J.retryAfterMs)},baseDelayMs:500,maxDelayMs:30000,jitterMs:500}),this.deliveryUploader=new x({maxBatchSize:64,maxQueueSize:64,send:async($)=>{let J=await this.request("post","/worker/events/delivery",{worker_epoch:this.workerEpoch,updates:$.map((G)=>({event_id:G.eventId,status:G.status}))},"delivery batch");if(!J.ok)throw new T("delivery POST failed",J.retryAfterMs)},baseDelayMs:500,maxDelayMs:30000,jitterMs:500}),Q.setOnEvent(($)=>{this.reportDelivery($.event_id,"received")})}async initialize(Q){let W=Date.now();if(Object.keys(this.getAuthHeaders()).length===0)throw new M("no_auth_headers");if(Q===void 0){let G=process.env.CLAUDE_CODE_WORKER_EPOCH;Q=G?parseInt(G,10):NaN}if(isNaN(Q))throw new M("missing_epoch");this.workerEpoch=Q;let Z=this.getWorkerState();if(!(await this.request("put","/worker",{worker_status:"idle",worker_epoch:this.workerEpoch,external_metadata:{pending_action:null,task_summary:null}},"PUT worker (init)")).ok)throw new M("worker_register_failed");this.currentState="idle",this.startHeartbeat(),o(()=>{this.writeEvent({type:"keep_alive"})}),K(`CCRClient: initialized, epoch=${this.workerEpoch}`),Y("info","cli_worker_lifecycle_initialized",{epoch:this.workerEpoch,duration_ms:Date.now()-W});let{metadata:$,durationMs:J}=await Z;if(!this.closed)Y("info","cli_worker_state_restored",{duration_ms:J,had_state:$!==null});return $}async getWorkerState(){let Q=Date.now(),W=this.getAuthHeaders();if(Object.keys(W).length===0)return{metadata:null,durationMs:0};return{metadata:(await this.getWithRetry(`${this.sessionBaseUrl}/worker`,W,"worker_state"))?.worker?.external_metadata??null,durationMs:Date.now()-Q}}async request(Q,W,Z,z,{timeout:$=1e4}={}){let J=this.getAuthHeaders();if(Object.keys(J).length===0)return{ok:!1};try{let G=await this.http[Q](`${this.sessionBaseUrl}${W}`,Z,{headers:{...J,"Content-Type":"application/json","anthropic-version":"2023-06-01","User-Agent":N()},validateStatus:l,timeout:$});if(G.status>=200&&G.status<300)return this.consecutiveAuthFailures=0,{ok:!0};if(G.status===409)this.handleEpochMismatch();if(G.status===401||G.status===403){let X=t(),q=X?f(X):null;if(q!==null&&q*1000<Date.now())K(`CCRClient: session_token expired (exp=${new Date(q*1000).toISOString()}) — no refresh was delivered, exiting`,{level:"error"}),Y("error","cli_worker_token_expired_no_refresh"),this.onEpochMismatch();if(this.consecutiveAuthFailures++,this.consecutiveAuthFailures>=XQ)K(`CCRClient: ${this.consecutiveAuthFailures} consecutive auth failures with a valid-looking token — server-side auth unrecoverable, exiting`,{level:"error"}),Y("error","cli_worker_auth_failures_exhausted"),this.onEpochMismatch()}if(K(`CCRClient: ${z} returned ${G.status}`,{level:"warn"}),Y("warn","cli_worker_request_failed",{method:Q,path:W,status:G.status}),G.status===429){let X=G.headers?.["retry-after"],q=typeof X==="string"?parseInt(X,10):NaN;if(!isNaN(q)&&q>=0)return{ok:!1,retryAfterMs:q*1000}}return{ok:!1}}catch(G){return K(`CCRClient: ${z} failed: ${H(G)}`,{level:"warn"}),Y("warn","cli_worker_request_error",{method:Q,path:W,error_code:i(G)}),{ok:!1}}}reportState(Q,W){if(Q===this.currentState&&!W)return;this.currentState=Q,this.workerState.enqueue({worker_status:Q,requires_action_details:W?{tool_name:W.tool_name,action_description:W.action_description,request_id:W.request_id}:null})}reportMetadata(Q){this.workerState.enqueue({external_metadata:Q})}handleEpochMismatch(){K("CCRClient: Epoch mismatch (409), shutting down",{level:"error"}),Y("error","cli_worker_epoch_mismatch"),this.onEpochMismatch()}startHeartbeat(){this.stopHeartbeat();let Q=()=>{let Z=this.heartbeatIntervalMs*this.heartbeatJitterFraction*(2*Math.random()-1);this.heartbeatTimer=setTimeout(W,this.heartbeatIntervalMs+Z)},W=()=>{if(this.sendHeartbeat(),this.heartbeatTimer===null)return;Q()};Q()}stopHeartbeat(){if(this.heartbeatTimer)clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null}async sendHeartbeat(){if(this.heartbeatInFlight)return;this.heartbeatInFlight=!0;try{if((await this.request("post","/worker/heartbeat",{session_id:this.sessionId,worker_epoch:this.workerEpoch},"Heartbeat",{timeout:5000})).ok)K("CCRClient: Heartbeat sent")}finally{this.heartbeatInFlight=!1}}async writeEvent(Q){if(Q.type==="stream_event"){if(this.streamEventBuffer.push(Q),!this.streamEventTimer)this.streamEventTimer=setTimeout(()=>void this.flushStreamEventBuffer(),YQ);return}if(await this.flushStreamEventBuffer(),Q.type==="assistant")LQ(this.streamTextAccumulator,Q);await this.eventUploader.enqueue(this.toClientEvent(Q))}toClientEvent(Q){let W=Q;return{payload:{...W,uuid:typeof W.uuid==="string"?W.uuid:g()}}}async flushStreamEventBuffer(){if(this.streamEventTimer)clearTimeout(this.streamEventTimer),this.streamEventTimer=null;if(this.streamEventBuffer.length===0)return;let Q=this.streamEventBuffer;this.streamEventBuffer=[];let W=wQ(Q,this.streamTextAccumulator);await this.eventUploader.enqueue(W.map((Z)=>({payload:Z,ephemeral:!0})))}async writeInternalEvent(Q,W,{isCompaction:Z=!1,agentId:z}={}){let $={payload:{type:Q,...W,uuid:typeof W.uuid==="string"?W.uuid:g()},...Z&&{is_compaction:!0},...z&&{agent_id:z}};await this.internalEventUploader.enqueue($)}flushInternalEvents(){return this.internalEventUploader.flush()}async flush(){return await this.flushStreamEventBuffer(),this.eventUploader.flush()}async readInternalEvents(){return this.paginatedGet("/worker/internal-events",{},"internal_events")}async readSubagentInternalEvents(){return this.paginatedGet("/worker/internal-events",{subagents:"true"},"subagent_events")}async paginatedGet(Q,W,Z){let z=this.getAuthHeaders();if(Object.keys(z).length===0)return null;let $=[],J;do{let G=new URL(`${this.sessionBaseUrl}${Q}`);for(let[q,L]of Object.entries(W))G.searchParams.set(q,L);if(J)G.searchParams.set("cursor",J);let X=await this.getWithRetry(G.toString(),z,Z);if(!X)return null;$.push(...X.data??[]),J=X.next_cursor}while(J);return K(`CCRClient: Read ${$.length} internal events from ${Q}${W.subagents?" (subagents)":""}`),$}async getWithRetry(Q,W,Z){for(let z=1;z<=10;z++){let $;try{$=await this.http.get(Q,{headers:{...W,"anthropic-version":"2023-06-01","User-Agent":N()},validateStatus:l,timeout:30000})}catch(J){if(K(`CCRClient: GET ${Q} failed (attempt ${z}/10): ${H(J)}`,{level:"warn"}),z<10){let G=Math.min(500*2**(z-1),30000)+Math.random()*500;await U(G)}continue}if($.status>=200&&$.status<300)return $.data;if($.status===409)this.handleEpochMismatch();if(K(`CCRClient: GET ${Q} returned ${$.status} (attempt ${z}/10)`,{level:"warn"}),z<10){let J=Math.min(500*2**(z-1),30000)+Math.random()*500;await U(J)}}return K("CCRClient: GET retries exhausted",{level:"error"}),Y("error","cli_worker_get_retries_exhausted",{context:Z}),null}reportDelivery(Q,W){this.deliveryUploader.enqueue({eventId:Q,status:W})}getWorkerEpoch(){return this.workerEpoch}get internalEventsPending(){return this.internalEventUploader.pendingCount}close(){if(this.closed=!0,this.stopHeartbeat(),s(),this.streamEventTimer)clearTimeout(this.streamEventTimer),this.streamEventTimer=null;this.streamEventBuffer=[],this.streamTextAccumulator.byMessage.clear(),this.streamTextAccumulator.scopeToMessage.clear(),this.workerState.close(),this.eventUploader.close(),this.internalEventUploader.close(),this.deliveryUploader.close()}}jQ();b();h();F();a();I();y();r();var BQ=1000,HQ=30000,UQ=600000,CQ=45000,PQ=new Set([401,403,404]),A=10,TQ=500,NQ=8000,kQ={stream:!0};function xQ(){return!0}function AQ(Q){let W=[],Z=0,z;while((z=Q.indexOf(`
2
+
3
+ `,Z))!==-1){let $=Q.slice(Z,z);if(Z=z+2,!$.trim())continue;let J={},G=!1;for(let X of $.split(`
4
+ `)){if(X.startsWith(":")){G=!0;continue}let q=X.indexOf(":");if(q===-1)continue;let L=X.slice(0,q),O=X[q+1]===" "?X.slice(q+2):X.slice(q+1);switch(L){case"event":J.event=O;break;case"id":J.id=O;break;case"data":J.data=J.data?J.data+`
5
+ `+O:O;break}}if(J.data||G)W.push(J)}return{frames:W,remaining:Q.slice(Z)}}class _Q{url;state="idle";onData;onCloseCallback;onEventCallback;headers;sessionId;refreshHeaders;getAuthHeaders;abortController=null;lastSequenceNum=0;seenSequenceNums=new Set;reconnectAttempts=0;reconnectStartTime=null;reconnectTimer=null;livenessTimer=null;postUrl;constructor(Q,W={},Z,z,$,J){this.url=Q;if(this.headers=W,this.sessionId=Z,this.refreshHeaders=z,this.getAuthHeaders=J??E,this.postUrl=RQ(Q),$!==void 0&&$>0)this.lastSequenceNum=$;K(`SSETransport: SSE URL = ${Q.href}`),K(`SSETransport: POST URL = ${this.postUrl}`),Y("info","cli_sse_transport_initialized")}getLastSequenceNum(){return this.lastSequenceNum}async connect(){if(this.state!=="idle"&&this.state!=="reconnecting"){K(`SSETransport: Cannot connect, current state is ${this.state}`,{level:"error"}),Y("error","cli_sse_connect_failed");return}this.state="reconnecting";let Q=Date.now(),W=new URL(this.url.href);if(this.lastSequenceNum>0)W.searchParams.set("from_sequence_num",String(this.lastSequenceNum));let Z=this.getAuthHeaders(),z={...this.headers,...Z,Accept:"text/event-stream","anthropic-version":"2023-06-01","User-Agent":N()};if(Z.Cookie)delete z.Authorization;if(this.lastSequenceNum>0)z["Last-Event-ID"]=String(this.lastSequenceNum);K(`SSETransport: Opening ${W.href}`),Y("info","cli_sse_connect_opening"),this.abortController=new AbortController;try{let $=await fetch(W.href,{headers:z,signal:this.abortController.signal});if(!$.ok){let G=PQ.has($.status);if(K(`SSETransport: HTTP ${$.status}${G?" (permanent)":""}`,{level:"error"}),Y("error","cli_sse_connect_http_error",{status:$.status}),G){this.state="closed",this.onCloseCallback?.($.status);return}this.handleConnectionError();return}if(!$.body){K("SSETransport: No response body"),this.handleConnectionError();return}let J=Date.now()-Q;K("SSETransport: Connected"),Y("info","cli_sse_connect_connected",{duration_ms:J}),this.state="connected",this.reconnectAttempts=0,this.reconnectStartTime=null,this.resetLivenessTimer(),await this.readStream($.body)}catch($){if(this.abortController?.signal.aborted)return;K(`SSETransport: Connection error: ${H($)}`,{level:"error"}),Y("error","cli_sse_connect_error"),this.handleConnectionError()}}async readStream(Q){let W=Q.getReader(),Z=new TextDecoder,z="";try{while(!0){let{done:$,value:J}=await W.read();if($)break;z+=Z.decode(J,kQ);let{frames:G,remaining:X}=AQ(z);z=X;for(let q of G){if(this.resetLivenessTimer(),q.id){let L=parseInt(q.id,10);if(!isNaN(L)){if(this.seenSequenceNums.has(L))K(`SSETransport: DUPLICATE frame seq=${L} (lastSequenceNum=${this.lastSequenceNum}, seenCount=${this.seenSequenceNums.size})`,{level:"warn"}),Y("warn","cli_sse_duplicate_sequence");else if(this.seenSequenceNums.add(L),this.seenSequenceNums.size>1000){let O=this.lastSequenceNum-200;for(let _ of this.seenSequenceNums)if(_<O)this.seenSequenceNums.delete(_)}if(L>this.lastSequenceNum)this.lastSequenceNum=L}}if(q.event&&q.data)this.handleSSEFrame(q.event,q.data);else if(q.data)K("SSETransport: Frame has data: but no event: field — dropped",{level:"warn"}),Y("warn","cli_sse_frame_missing_event_field")}}}catch($){if(this.abortController?.signal.aborted)return;K(`SSETransport: Stream read error: ${H($)}`,{level:"error"}),Y("error","cli_sse_stream_read_error")}finally{W.releaseLock()}if(this.state!=="closing"&&this.state!=="closed")K("SSETransport: Stream ended, reconnecting"),this.handleConnectionError()}handleSSEFrame(Q,W){if(Q!=="client_event"){K(`SSETransport: Unexpected SSE event type '${Q}' on worker stream`,{level:"warn"}),Y("warn","cli_sse_unexpected_event_type",{event_type:Q});return}let Z;try{Z=R(W)}catch($){K(`SSETransport: Failed to parse client_event data: ${H($)}`,{level:"error"});return}let z=Z.payload;if(z&&typeof z==="object"&&"type"in z){let $=this.sessionId?` session=${this.sessionId}`:"";K(`SSETransport: Event seq=${Z.sequence_num} event_id=${Z.event_id} event_type=${Z.event_type} payload_type=${String(z.type)}${$}`),Y("info","cli_sse_message_received"),this.onData?.(k(z)+`
6
+ `)}else K(`SSETransport: Ignoring client_event with no type in payload: event_id=${Z.event_id}`);this.onEventCallback?.(Z)}handleConnectionError(){if(this.clearLivenessTimer(),this.state==="closing"||this.state==="closed")return;this.abortController?.abort(),this.abortController=null;let Q=Date.now();if(!this.reconnectStartTime)this.reconnectStartTime=Q;let W=Q-this.reconnectStartTime;if(W<UQ){if(this.reconnectTimer)clearTimeout(this.reconnectTimer),this.reconnectTimer=null;if(this.refreshHeaders){let $=this.refreshHeaders();Object.assign(this.headers,$),K("SSETransport: Refreshed headers for reconnect")}this.state="reconnecting",this.reconnectAttempts++;let Z=Math.min(BQ*Math.pow(2,this.reconnectAttempts-1),HQ),z=Math.max(0,Z+Z*0.25*(2*Math.random()-1));K(`SSETransport: Reconnecting in ${Math.round(z)}ms (attempt ${this.reconnectAttempts}, ${Math.round(W/1000)}s elapsed)`),Y("error","cli_sse_reconnect_attempt",{reconnectAttempts:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},z)}else K(`SSETransport: Reconnection time budget exhausted after ${Math.round(W/1000)}s`,{level:"error"}),Y("error","cli_sse_reconnect_exhausted",{reconnectAttempts:this.reconnectAttempts,elapsedMs:W}),this.state="closed",this.onCloseCallback?.()}onLivenessTimeout=()=>{this.livenessTimer=null,K("SSETransport: Liveness timeout, reconnecting",{level:"error"}),Y("error","cli_sse_liveness_timeout"),this.abortController?.abort(),this.handleConnectionError()};resetLivenessTimer(){this.clearLivenessTimer(),this.livenessTimer=setTimeout(this.onLivenessTimeout,CQ)}clearLivenessTimer(){if(this.livenessTimer)clearTimeout(this.livenessTimer),this.livenessTimer=null}async write(Q){let W=this.getAuthHeaders();if(Object.keys(W).length===0){K("SSETransport: No session token available for POST"),Y("warn","cli_sse_post_no_token");return}let Z={...W,"Content-Type":"application/json","anthropic-version":"2023-06-01","User-Agent":N()};K(`SSETransport: POST body keys=${Object.keys(Q).join(",")}`);for(let z=1;z<=A;z++){try{let J=await e.post(this.postUrl,Q,{headers:Z,validateStatus:xQ});if(J.status===200||J.status===201){K(`SSETransport: POST success type=${Q.type}`);return}if(K(`SSETransport: POST ${J.status} body=${k(J.data).slice(0,200)}`),J.status>=400&&J.status<500&&J.status!==429){K(`SSETransport: POST returned ${J.status} (client error), not retrying`),Y("warn","cli_sse_post_client_error",{status:J.status});return}K(`SSETransport: POST returned ${J.status}, attempt ${z}/${A}`),Y("warn","cli_sse_post_retryable_error",{status:J.status,attempt:z})}catch(J){K(`SSETransport: POST error: ${J.message}, attempt ${z}/${A}`),Y("warn","cli_sse_post_network_error",{attempt:z})}if(z===A){K(`SSETransport: POST failed after ${A} attempts, continuing`),Y("warn","cli_sse_post_retries_exhausted");return}let $=Math.min(TQ*Math.pow(2,z-1),NQ);await U($)}}isConnectedStatus(){return this.state==="connected"}isClosedStatus(){return this.state==="closed"}setOnData(Q){this.onData=Q}setOnClose(Q){this.onCloseCallback=Q}setOnEvent(Q){this.onEventCallback=Q}close(){if(this.reconnectTimer)clearTimeout(this.reconnectTimer),this.reconnectTimer=null;this.clearLivenessTimer(),this.state="closing",this.abortController?.abort(),this.abortController=null}}function RQ(Q){let W=Q.pathname;if(W.endsWith("/stream"))W=W.slice(0,-7);return`${Q.protocol}//${Q.host}${W}`}
7
+ export{FQ as n,x as o,M as p,OQ as q,_Q as r};
@@ -0,0 +1,4 @@
1
+ import{_d as c,ee as Eq}from"./cli-0.5.10-k3qbvfj5.mjs";import{$H as e,AH as m,AI as y,An as A,BI as Qq,CH as Oq,CI as Xq,Cn as D,DI as Yq,Dn as Aq,EI as $q,En as h,FI as d,Fn as S,Gn as Fq,II as Dq,VH as n,Wq as l,Xq as wq,aI as P,eI as jq,fI as O,gI as qq,iI as I,jI as Gq,kn as s,ln as Tq,on as t,pI as Cq,qn as Mq,sI as b,tI as Lq,un as i,wI as Hq,wn as Rq,xI as Jq,zH as v,zI as vq}from"./cli-0.5.10-8jjacn05.mjs";import{H$ as _q,P_ as V,X_ as Kq,kca as a,s$ as F,sca as Bq,u$ as L}from"./cli-0.5.10-2fqes7gy.mjs";import{Cfa as p,Gfa as Wq}from"./cli-0.5.10-p4wmnjhz.mjs";import{hga as o,kga as N,pga as Uq}from"./cli-0.5.10-8wqagr68.mjs";import{ama as xq,pia as f}from"./cli-0.5.10-atkghjt0.mjs";import{Lna as Zq}from"./cli-0.5.10-1sd567wn.mjs";import{dirname as Nq,join as u}from"path";function g(q){if(!k.includes(q))throw Error(`Invalid scope "${q}". Must be one of: ${k.join(", ")}`)}function JG(q){return k.includes(q)}function zq(q){return q==="project"||q==="local"?f():void 0}function QG(q){return F("projectSettings")?.enabledPlugins?.[q]===!0}function Vq(q){let H=q.includes("@"),G=["local","project","user"];for(let X of G){let J=F(D(X))?.enabledPlugins;if(!J)continue;for(let Y of Object.keys(J))if(H?Y===q:Y.startsWith(`${q}@`))return{pluginId:Y,scope:X}}return null}function bq(q,H){let{name:G,marketplace:X}=A(q);return H.find((J)=>{if(J.name===q||J.name===G)return!0;if(X&&J.source)return J.name===G&&J.source.includes(`@${X}`);return!1})}function yq(q){let{name:H}=A(q),G=O();if(G.plugins[q]?.length)return{pluginId:q,pluginName:H};let X=Object.keys(G.plugins).find((J)=>{let{name:Y}=A(J);return Y===H&&(G.plugins[J]?.length??0)>0});if(X)return{pluginId:X,pluginName:H};return null}function kq(q){let G=O().plugins[q];if(!G||G.length===0)return{scope:"user"};let X=f(),J=G.find((Z)=>Z.scope==="local"&&Z.projectPath===X);if(J)return{scope:J.scope,projectPath:J.projectPath};let Y=G.find((Z)=>Z.scope==="project"&&Z.projectPath===X);if(Y)return{scope:Y.scope,projectPath:Y.projectPath};let z=G.find((Z)=>Z.scope==="user");if(z)return{scope:z.scope};return{scope:G[0].scope,projectPath:G[0].projectPath}}async function XG(q,H="user"){g(H);let{name:G,marketplace:X}=A(q),J,Y,z;if(X){let $=await P(q);if($)J=$.entry,Y=X,z=$.marketplaceInstallLocation}else{let $=await n();for(let[B,K]of Object.entries($))try{let M=(await e(B)).plugins.find((R)=>R.name===G);if(M){J=M,Y=B,z=K.installLocation;break}}catch(x){a(o(x));continue}}if(!J||!Y){let $=X?`marketplace "${X}"`:"any configured marketplace";return{success:!1,message:`Plugin "${G}" not found in ${$}`}}let Z=J,W=`${Z.name}@${Y}`,Q=await Jq({pluginId:W,entry:Z,scope:H,marketplaceInstallLocation:z});if(!Q.ok)switch(Q.reason){case"local-source-no-location":return{success:!1,message:`Cannot install local plugin "${Q.pluginName}" without marketplace install location`};case"settings-write-failed":return{success:!1,message:`Failed to update settings: ${Q.message}`};case"resolution-failed":return{success:!1,message:Hq(Q.resolution)};case"blocked-by-policy":return{success:!1,message:`Plugin "${Q.pluginName}" is blocked by your organization's policy and cannot be installed`};case"dependency-blocked-by-policy":return{success:!1,message:`Plugin "${Q.pluginName}" depends on "${Q.blockedDependency}", which is blocked by your organization's policy`}}return{success:!0,message:`Successfully installed plugin: ${W} (scope: ${H})${Q.depNote}`,pluginId:W,pluginName:Z.name,scope:H}}async function YG(q,H="user",G=!0){g(H);let{enabled:X,disabled:J}=await d(),Y=[...X,...J],z=bq(q,Y),Z=D(H),W=F(Z),Q,$;if(z)Q=Object.keys(W?.enabledPlugins??{}).find((U)=>U===q||U===z.name||U.startsWith(`${z.name}@`))??(q.includes("@")?q:z.name),$=z.name;else{let U=yq(q);if(!U)return{success:!1,message:`Plugin "${q}" not found in installed plugins`};Q=U.pluginId,$=U.pluginName}let B=zq(H),x=O().plugins[Q],M=x?.find((U)=>U.scope===H&&U.projectPath===B);if(!M){let{scope:U}=kq(Q);if(U!==H&&x&&x.length>0){if(U==="project")return{success:!1,message:`Plugin "${q}" is enabled at project scope (.claudin/settings.json, shared with your team). To disable just for you: claudin plugin disable ${q} --scope local`};return{success:!1,message:`Plugin "${q}" is installed in ${U} scope, not ${H}. Use --scope ${U} to uninstall.`}}return{success:!1,message:`Plugin "${q}" is not installed in ${H} scope. Use --scope to specify the correct scope.`}}let R=M.installPath,_={...W?.enabledPlugins};_[Q]=void 0,L(Z,{enabledPlugins:_}),v(),qq(Q,H,B);let w=O().plugins[Q],j=!w||w.length===0;if(j&&R)await m(R);if(j){if(t(Q),G)await s(Q)}let C=h(Q,Y),E=S(C);return{success:!0,message:`Successfully uninstalled plugin: ${$} (scope: ${H})${E}`,pluginId:Q,pluginName:$,scope:H,reverseDependents:C.length>0?C:void 0}}async function r(q,H,G){let X=H?"enable":"disable";if(i(q)){let{error:_}=L("userSettings",{enabledPlugins:{...F("userSettings")?.enabledPlugins,[q]:H}});if(_)return{success:!1,message:`Failed to ${X} built-in plugin: ${_.message}`};v();let{name:T}=A(q);return{success:!0,message:`Successfully ${X}d built-in plugin: ${T}`,pluginId:q,pluginName:T,scope:"user"}}if(G)g(G);let J,Y,z=Vq(q);if(G)if(Y=G,z)J=z.pluginId;else if(q.includes("@"))J=q;else return{success:!1,message:`Plugin "${q}" not found in settings. Use plugin@marketplace format.`};else if(z)J=z.pluginId,Y=z.scope;else if(q.includes("@"))J=q,Y="user";else return{success:!1,message:`Plugin "${q}" not found in any editable settings scope. Use plugin@marketplace format.`};if(H&&l(J))return{success:!1,message:`Plugin "${J}" is blocked by your organization's policy and cannot be enabled`};let Z=D(Y),W=F(Z)?.enabledPlugins?.[J],Q={user:0,project:1,local:2},$=G&&z&&Q[G]>Q[z.scope];if(G&&W===void 0&&z&&z.scope!==G&&!$)return{success:!1,message:`Plugin "${q}" is installed at ${z.scope} scope, not ${G}. Use --scope ${z.scope} or omit --scope to auto-detect.`};let B=G&&!$?W===!0:c().has(J);if(H===B)return{success:!1,message:`Plugin "${q}" is already ${H?"enabled":"disabled"}${G?` at ${G} scope`:""}`};let K;if(!H){let{enabled:_,disabled:T}=await d(),w=h(J,[..._,...T]);if(w.length>0)K=w}let{error:x}=L(Z,{enabledPlugins:{...F(Z)?.enabledPlugins,[J]:H}});if(x)return{success:!1,message:`Failed to ${X} plugin: ${x.message}`};v();let{name:M}=A(J),R=S(K);return{success:!0,message:`Successfully ${X}d plugin: ${M} (scope: ${Y})${R}`,pluginId:J,pluginName:M,scope:Y,reverseDependents:K}}async function $G(q,H){return r(q,!0,H)}async function zG(q,H){return r(q,!1,H)}async function ZG(){let q=c();if(q.size===0)return{success:!0,message:"No enabled plugins to disable"};let H=[],G=[];for(let[X]of q){let J=await r(X,!1);if(J.success)H.push(X);else G.push(`${X}: ${J.message}`)}if(G.length>0)return{success:!1,message:`Disabled ${H.length} ${V(H.length,"plugin")}, ${G.length} failed:
2
+ ${G.join(`
3
+ `)}`};return{success:!0,message:`Disabled ${H.length} ${V(H.length,"plugin")}`}}async function xG(q,H){let{name:G,marketplace:X}=A(q),J=X?`${G}@${X}`:q,Y=await P(q);if(!Y)return{success:!1,message:`Plugin "${G}" not found`,pluginId:J,scope:H};let{entry:z,marketplaceInstallLocation:Z}=Y,Q=I().plugins[J];if(!Q||Q.length===0)return{success:!1,message:`Plugin "${G}" is not installed`,pluginId:J,scope:H};let $=zq(H),B=Q.find((K)=>K.scope===H&&K.projectPath===$);if(!B){let K=$?`${H} (${$})`:H;return{success:!1,message:`Plugin "${G}" is not installed at scope ${K}`,pluginId:J,scope:H}}return fq({pluginId:J,pluginName:G,entry:z,marketplaceInstallLocation:Z,installation:B,scope:H,projectPath:$})}async function fq({pluginId:q,pluginName:H,entry:G,marketplaceInstallLocation:X,installation:J,scope:Y,projectPath:z}){let Z=p(),W=J.version,Q,$,B=!1,K;if(typeof G.source!=="string"){let x=await Yq(G.source,{manifest:{name:G.name}});Q=x.path,B=!0,K=x.gitCommitSha,$=await b(q,G.source,x.manifest,x.path,G.version,x.gitCommitSha)}else{let x;try{x=await Z.stat(X)}catch(T){if(N(T))return{success:!1,message:`Marketplace directory not found at ${X}`,pluginId:q,scope:Y};throw T}let M=x.isDirectory()?X:Nq(X);Q=u(M,G.source);try{await Z.stat(Q)}catch(T){if(N(T))return{success:!1,message:`Plugin source not found at ${Q}`,pluginId:q,scope:Y};throw T}let R,_=u(Q,".claude-plugin","plugin.json");try{R=await $q(_,G.name,G.source)}catch{}$=await b(q,G.source,R,Q,G.version)}try{let x=y(q,$),M=Qq(q,$);if(J.version===$||J.installPath===x||J.installPath===M)return{success:!0,message:`${H} is already at the latest version (${$}).`,pluginId:q,newVersion:$,oldVersion:W,alreadyUpToDate:!0,scope:Y};x=await Xq(Q,q,$,G);let _=J.installPath;if(Gq(q,Y,z,x,$,K),_&&_!==x){let j=I();if(!Object.values(j.plugins).some((E)=>E.some((U)=>U.installPath===_)))await m(_)}let T=z?`${Y} (${z})`:Y;return{success:!0,message:`Plugin "${H}" updated from ${W||"unknown"} to ${$} for scope ${T}. Restart to apply changes.`,pluginId:q,newVersion:$,oldVersion:W,scope:Y}}finally{if(B&&Q!==y(q,$))await Z.rm(Q,{recursive:!0,force:!0})}}var k,HG;var hq=Zq(()=>{xq();Rq();Uq();Wq();Bq();Oq();Fq();Cq();jq();Tq();Aq();vq();Dq();Mq();wq();Eq();Lq();_q();Kq();k=["user","project","local"],HG=["user","project","local","managed"]});
4
+ export{k as Nd,HG as Od,JG as Pd,QG as Qd,kq as Rd,XG as Sd,YG as Td,$G as Ud,zG as Vd,ZG as Wd,xG as Xd,hq as Yd};
@@ -0,0 +1,2 @@
1
+ import{Fga as U,vga as q}from"./cli-0.5.10-jsnrvena.mjs";import{Kna as L,Lna as X}from"./cli-0.5.10-1sd567wn.mjs";import{AsyncLocalStorage as F}from"async_hooks";function G(){return O.getStore()}function Y(z,B){return O.run(z,B)}function Z(){return O.getStore()!==void 0}function $(z){return{...z,isInProcess:!0}}var O;var Q=X(()=>{O=new F});var y={};L(y,{waitForTeammatesToBecomeIdle:()=>l,setDynamicTeamContext:()=>b,runWithTeammateContext:()=>Y,isTeammate:()=>u,isTeamLead:()=>S,isPlanModeRequired:()=>w,isInProcessTeammate:()=>Z,hasWorkingInProcessTeammates:()=>I,hasActiveInProcessTeammates:()=>P,getTeammateContext:()=>G,getTeammateColor:()=>f,getTeamName:()=>h,getParentSessionId:()=>_,getDynamicTeamContext:()=>v,getAgentName:()=>A,getAgentId:()=>E,createTeammateContext:()=>$,clearDynamicTeamContext:()=>j});function _(){let z=G();if(z)return z.parentSessionId;return D?.parentSessionId}function b(z){D=z}function j(){D=null}function v(){return D}function E(){let z=G();if(z)return z.agentId;return D?.agentId}function A(){let z=G();if(z)return z.agentName;return D?.agentName}function h(z){let B=G();if(B)return B.teamName;if(D?.teamName)return D.teamName;return z?.teamName}function u(){if(G())return!0;return!!(D?.agentId&&D?.teamName)}function f(){let z=G();if(z)return z.color;return D?.color}function w(){let z=G();if(z)return z.planModeRequired;if(D!==null)return D.planModeRequired;return q(process.env.CLAUDE_CODE_PLAN_MODE_REQUIRED)}function S(z){if(!z?.leadAgentId)return!1;let B=E(),H=z.leadAgentId;if(B===H)return!0;if(!B)return!0;return!1}function P(z){for(let B of Object.values(z.tasks))if(B.type==="in_process_teammate"&&B.status==="running")return!0;return!1}function I(z){for(let B of Object.values(z.tasks))if(B.type==="in_process_teammate"&&B.status==="running"&&!B.isIdle)return!0;return!1}function l(z,B){let H=[];for(let[M,J]of Object.entries(B.tasks))if(J.type==="in_process_teammate"&&J.status==="running"&&!J.isIdle)H.push(M);if(H.length===0)return Promise.resolve();return new Promise((M)=>{let J=H.length,R=()=>{if(J--,J===0)M()};z((V)=>{let N={...V.tasks};for(let W of H){let K=N[W];if(K&&K.type==="in_process_teammate")if(K.isIdle)R();else N[W]={...K,onIdleCallbacks:[...K.onIdleCallbacks??[],R]}}return{...V,tasks:N}})})}var D=null;var g=X(()=>{Q();U();Q()});
2
+ export{G as MT,Y as NT,Z as OT,$ as PT,Q as QT,_ as RT,v as ST,E as TT,A as UT,h as VT,u as WT,f as XT,w as YT,S as ZT,P as _T,I as $T,l as aU,y as bU,g as cU};
@@ -0,0 +1,2 @@
1
+ var o=()=>null,t=o,l=o;
2
+ export{l as eb,t as fb};
@@ -0,0 +1,39 @@
1
+ import{DN as d,hw as B,iw as U,pM as L,pN as N,qM as w}from"./cli-0.5.10-8jjacn05.mjs";import{N8 as z,U8 as F,X_ as P}from"./cli-0.5.10-2fqes7gy.mjs";import{Jca as H,Pca as v}from"./cli-0.5.10-6zwxmza2.mjs";import{Lna as j}from"./cli-0.5.10-1sd567wn.mjs";async function V(R){let{messages:I,getAppState:O,options:{mainLoopModel:J,tools:Y,agentDefinitions:Z,customSystemPrompt:W,appendSystemPrompt:X}}=R,Q=N(I),{messages:K}=await B(Q),h=O();return L(K,J,async()=>h.toolPermissionContext,Y,Z,void 0,{options:{customSystemPrompt:W,appendSystemPrompt:X}},void 0,Q)}async function g(R,I){let O=await V(I);return{type:"text",value:b(O)}}function b(R){let{categories:I,totalTokens:O,rawMaxTokens:J,percentage:Y,model:Z,memoryFiles:W,mcpTools:X,agents:Q,skills:K}=R,h=`## Context Usage
2
+
3
+ `;h+=`**Model:** ${Z}
4
+ `,h+=`**Tokens:** ${H(O)} / ${H(J)} (${Y}%)
5
+ `,h+=`
6
+ `;let _=I.filter((q)=>q.tokens>0&&q.name!=="Free space"&&q.name!=="Autocompact buffer");if(_.length>0){h+=`### Estimated usage by category
7
+
8
+ `,h+=`| Category | Tokens | Percentage |
9
+ `,h+=`|----------|--------|------------|
10
+ `;for(let G of _){let $=(G.tokens/J*100).toFixed(1);h+=`| ${G.name} | ${H(G.tokens)} | ${$}% |
11
+ `}let q=I.find((G)=>G.name==="Free space");if(q&&q.tokens>0){let G=(q.tokens/J*100).toFixed(1);h+=`| Free space | ${H(q.tokens)} | ${G}% |
12
+ `}let E=I.find((G)=>G.name==="Autocompact buffer");if(E&&E.tokens>0){let G=(E.tokens/J*100).toFixed(1);h+=`| Autocompact buffer | ${H(E.tokens)} | ${G}% |
13
+ `}h+=`
14
+ `}if(X.length>0){h+=`### MCP Tools
15
+
16
+ `,h+=`| Tool | Server | Tokens |
17
+ `,h+=`|------|--------|--------|
18
+ `;for(let q of X)h+=`| ${q.name} | ${q.serverName} | ${H(q.tokens)} |
19
+ `;h+=`
20
+ `}if(Q.length>0){h+=`### Custom Agents
21
+
22
+ `,h+=`| Agent Type | Source | Tokens |
23
+ `,h+=`|------------|--------|--------|
24
+ `;for(let q of Q){let E;switch(q.source){case"projectSettings":E="Project";break;case"userSettings":E="User";break;case"localSettings":E="Local";break;case"flagSettings":E="Flag";break;case"policySettings":E="Policy";break;case"plugin":E="Plugin";break;case"built-in":E="Built-in";break;default:E=String(q.source)}h+=`| ${q.agentType} | ${E} | ${H(q.tokens)} |
25
+ `}h+=`
26
+ `}if(W.length>0){h+=`### Memory Files
27
+
28
+ `,h+=`| Type | Path | Tokens |
29
+ `,h+=`|------|------|--------|
30
+ `;for(let q of W)h+=`| ${q.type} | ${q.path} | ${H(q.tokens)} |
31
+ `;h+=`
32
+ `}if(K&&K.tokens>0&&K.skillFrontmatter.length>0){h+=`### Skills
33
+
34
+ `,h+=`| Skill | Source | Tokens |
35
+ `,h+=`|-------|--------|--------|
36
+ `;for(let q of K.skillFrontmatter)h+=`| ${q.name} | ${z(q.source)} | ${H(q.tokens)} |
37
+ `;h+=`
38
+ `}return h}var A=j(()=>{U();w();v();d();F();P()});
39
+ export{V as ig,g as jg,A as kg};
@@ -0,0 +1,2 @@
1
+ import{Yc as l,Zc as m,ad as u,bd as y}from"./cli-0.5.10-kyt82zt5.mjs";import{uD as p,wD as b}from"./cli-0.5.10-8jjacn05.mjs";import{JX as C,cX as s,eX as e}from"./cli-0.5.10-9xc8zhxg.mjs";import{mZ as i,nZ as r,oZ as g}from"./cli-0.5.10-gs8dx67v.mjs";import{pZ as M}from"./cli-0.5.10-9ek8f4vk.mjs";import{Hna as h,Lna as f}from"./cli-0.5.10-1sd567wn.mjs";function T({enabled:c,onDismiss:a}){let[n,t]=k.useState(()=>c?{kind:"prompt"}:{kind:"hidden"});if(!c||n.kind==="hidden")return null;if(n.kind==="running")return r(s,{flexDirection:"column",marginBottom:1,children:[i(e,{color:"warning",bold:!0,children:"Migrating ~/.claude/ to ~/.claudin/..."}),i(e,{dimColor:!0,children:"Copying tokens, settings, theme, MCP servers, skills, agents, slash commands, plugins, and keybindings."})]});if(n.kind==="success"||n.kind==="error"){let d=n.kind==="success"?"success":"warning",o=n.kind==="success"?"Migration complete":"Migration finished with warnings";return r(s,{flexDirection:"column",marginBottom:1,children:[i(e,{color:d,bold:!0,children:o}),i(e,{children:m(n.report)})]})}return r(s,{flexDirection:"column",marginBottom:1,children:[i(e,{color:"warning",bold:!0,children:"Found Claude Code config at ~/.claude/"}),i(e,{children:"Import API tokens, settings, theme, MCP servers, skills, agents, slash commands, plugins, and keybindings into ~/.claudin/?"}),i(p,{options:[{value:"migrate",label:"Migrate now",description:"Copy tokens, settings, CLAUDE.md, skills, agents, commands, plugins, keybindings."},{value:"skip",label:"Skip — start fresh",description:"Don't ask again this profile."}],onChange:(d)=>{if(d==="skip"){u(),t({kind:"hidden"}),a?.("skipped");return}t({kind:"running"}),(async()=>{let o=await l();t({kind:o.errors.length===0?"success":"error",report:o}),a?.("migrated")})()},onCancel:()=>{t({kind:"hidden"}),a?.("skipped")},visibleOptionCount:2})]})}var k;var w=f(()=>{C();y();b();g();k=h(M(),1)});
2
+ export{T as Wc,w as Xc};
@@ -0,0 +1,2 @@
1
+ import{F7 as F,J7 as f,O6 as K,P6 as E,kca as U,sca as m}from"./cli-0.5.10-2fqes7gy.mjs";import{$da as x,_da as v}from"./cli-0.5.10-d609fanf.mjs";import{Cfa as D,Gfa as g}from"./cli-0.5.10-p4wmnjhz.mjs";import{Lna as S}from"./cli-0.5.10-1sd567wn.mjs";import{basename as H,dirname as b,join as I,sep as O}from"path";function _(q,B){if(!q)return{directory:B||v(),prefix:""};let G=F(q,B);if(q.endsWith("/")||q.endsWith(O))return{directory:G,prefix:""};let N=b(G),J=H(q);return{directory:N,prefix:J}}async function k(q){let B=Z.get(q);if(B)return B;try{let J=(await D().readdir(q)).filter((M)=>M.isDirectory()&&!M.name.startsWith(".")).map((M)=>({name:M.name,path:I(q,M.name),type:"directory"})).slice(0,100);return Z.set(q,J),J}catch(G){return U(G),[]}}async function P(q,B={}){let{basePath:G=v(),maxResults:N=10}=B,{directory:J,prefix:M}=_(q,G),V=await k(J),z=M.toLowerCase();return V.filter((X)=>X.name.toLowerCase().startsWith(z)).slice(0,N).map((X)=>({id:X.path,displayText:X.name+"/",description:"directory",metadata:{type:"directory"}}))}function o(q){return q.startsWith("~/")||q.startsWith("/")||q.startsWith("./")||q.startsWith("../")||q==="~"||q==="."||q===".."}async function u(q,B=!1){let G=`${q}:${B}`,N=A.get(G);if(N)return N;try{let V=(await D().readdir(q)).filter((z)=>B||!z.name.startsWith(".")).map((z)=>({name:z.name,path:I(q,z.name),type:z.isDirectory()?"directory":"file"})).sort((z,W)=>{if(z.type==="directory"&&W.type!=="directory")return-1;if(z.type!=="directory"&&W.type==="directory")return 1;return z.name.localeCompare(W.name)}).slice(0,100);return A.set(G,V),V}catch(J){return U(J),[]}}async function h(q,B={}){let{basePath:G=v(),maxResults:N=10,includeFiles:J=!0,includeHidden:M=!1}=B,{directory:V,prefix:z}=_(q,G),W=await u(V,M),X=z.toLowerCase(),j=W.filter((Q)=>{if(!J&&Q.type==="file")return!1;return Q.name.toLowerCase().startsWith(X)}).slice(0,N),w=q.includes("/")||q.includes(O),Y="";if(w){let Q=q.lastIndexOf("/"),$=q.lastIndexOf(O),L=Math.max(Q,$);Y=q.substring(0,L+1)}if(Y.startsWith("./")||Y.startsWith("."+O))Y=Y.slice(2);return j.map((Q)=>{let $=Y+Q.name;return{id:$,displayText:Q.type==="directory"?$+"/":$,metadata:{type:Q.type}}})}var R=500,T=300000,Z,A;var C=S(()=>{E();x();g();m();f();Z=new K({max:R,ttl:T}),A=new K({max:R,ttl:T})});
2
+ export{P as Wg,o as Xg,h as Yg,C as Zg};
@@ -0,0 +1,2 @@
1
+ import{wZ as N,xZ as V,yZ as D}from"./cli-0.5.10-p5j82v0t.mjs";import{T3 as x,U2 as Z,b0 as Y,g0 as _,t3 as J,v3 as $,y3 as B}from"./cli-0.5.10-xyscak5q.mjs";import{Hea as Q,Nea as P}from"./cli-0.5.10-jd7ff66n.mjs";import{Wma as X,mna as R}from"./cli-0.5.10-rwqvbtg3.mjs";import{Lna as W}from"./cli-0.5.10-1sd567wn.mjs";function E(){let z=process.env.CLAUDE_AGENT_SDK_VERSION?`, agent-sdk/${process.env.CLAUDE_AGENT_SDK_VERSION}`:"",F=process.env.CLAUDE_AGENT_SDK_CLIENT_APP?`, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`:"";return`claude-cli/99.0.0 (${process.env.CLAUDE_CODE_ENTRYPOINT??"cli"}${z}${F})`}function I(){let z=[];if(process.env.CLAUDE_CODE_ENTRYPOINT)z.push(process.env.CLAUDE_CODE_ENTRYPOINT);if(process.env.CLAUDE_AGENT_SDK_VERSION)z.push(`agent-sdk/${process.env.CLAUDE_AGENT_SDK_VERSION}`);if(process.env.CLAUDE_AGENT_SDK_CLIENT_APP)z.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);return`claude-code/99.0.0${z.length>0?` (${z.join(", ")})`:""}`}function w(){if(Y()==="firstParty")return`Claude-User (${N()}; +https://support.anthropic.com/)`;return`Claudin-User (${V()})`}function C(){if(B()){let F=J();if(!F?.accessToken)return{headers:{},error:"No OAuth token available"};return{headers:{Authorization:`Bearer ${F.accessToken}`,"anthropic-beta":Q}}}let z=Z();if(!z)return{headers:{},error:"No API key available"};return{headers:{"x-api-key":z}}}async function O(z,F){try{return await z()}catch(G){if(!X.isAxiosError(G))throw G;let L=G.response?.status;if(!(L===401||F?.also403Revoked&&L===403&&typeof G.response?.data==="string"&&G.response.data.includes("OAuth token has been revoked")))throw G;let M=J()?.accessToken;if(!M)throw G;return await $(M),await z()}}var H=W(()=>{R();P();x();_();D()});
2
+ export{E as qZ,I as rZ,w as sZ,C as tZ,O as uZ,H as vZ};
@@ -0,0 +1,2 @@
1
+ import{kE as z,lE as M,ut as J,vt as Z,yC as L,zC as h}from"./cli-0.5.10-8jjacn05.mjs";import{LV as X}from"./cli-0.5.10-9xc8zhxg.mjs";import{pZ as W}from"./cli-0.5.10-9ek8f4vk.mjs";import{Cla as H,ama as V}from"./cli-0.5.10-atkghjt0.mjs";import{Hna as D,Lna as U}from"./cli-0.5.10-1sd567wn.mjs";function v(){let b=P.c(6),{addNotification:k,removeNotification:l}=L(),[j,Q]=x.useState(u),p;if(b[0]===Symbol.for("react.memo_cache_sentinel"))p=()=>{let{errors:y}=z();Q(y)},b[0]=p;else p=b[0];J(p);let q,w;if(b[1]!==k||b[2]!==j||b[3]!==l)q=()=>{if(H())return;if(j.length>0){let y=`Found ${j.length} settings ${j.length===1?"issue":"issues"} · /doctor for details`;k({key:B,text:y,color:"warning",priority:"high",timeoutMs:60000})}else l(B)},w=[j,k,l],b[1]=k,b[2]=j,b[3]=l,b[4]=q,b[5]=w;else q=b[4],w=b[5];return x.useEffect(q,w),j}function u(){let{errors:b}=z();return b}var P,x,B="settings-errors";var A=U(()=>{h();V();M();Z();P=D(X(),1),x=D(W(),1)});
2
+ export{v as rg,A as sg};
@@ -0,0 +1,2 @@
1
+ import{K as D}from"./cli-0.5.10-n8pz2na8.mjs";import{U as x}from"./cli-0.5.10-fjvz4bt0.mjs";import{mb as A}from"./cli-0.5.10-xfqxbzc6.mjs";import{nb as L}from"./cli-0.5.10-z4bzn8vh.mjs";import{Vm as k,Wm as U,Zm as F,_m as p,nQ as b,oQ as u}from"./cli-0.5.10-8jjacn05.mjs";import{lR as O,oR as c}from"./cli-0.5.10-b761m5q2.mjs";import{T3 as m,b0 as Y,g0 as I,l2 as w,m2 as M,m3 as E,n3 as G}from"./cli-0.5.10-xyscak5q.mjs";import{T$ as X,U$ as B,Xba as $,_ba as z}from"./cli-0.5.10-2fqes7gy.mjs";import{$da as y,_da as _}from"./cli-0.5.10-d609fanf.mjs";import{Qfa as K,Tfa as T}from"./cli-0.5.10-p4wmnjhz.mjs";import{iga as V,pga as S}from"./cli-0.5.10-8wqagr68.mjs";import{Fga as v,vga as J,xga as N}from"./cli-0.5.10-jsnrvena.mjs";import{Wma as W,mna as j}from"./cli-0.5.10-rwqvbtg3.mjs";v();c();u();z();m();p();y();j();T();S();I();B();var C=void 0;function h(q){try{let H=new URL(q);return H.search="",H.toString().replace(/\/$/,"")}catch{return}}async function Z(){if(X())return;if(Y()!=="firstParty")return;try{let q=await W.get("https://api.anthropic.com/mcp-registry/v0/servers?version=latest&visibility=commercial",{timeout:5000}),H=new Set;for(let P of q.data.servers)for(let R of P.server.remotes??[]){let Q=h(R.url);if(Q)H.add(Q)}C=H,K(`[mcp-registry] Loaded ${H.size} official MCP URLs`)}catch(q){K(`Failed to fetch MCP registry: ${V(q)}`,{level:"error"})}}M();U();function Xq(){if(J(process.env.CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER)||N())return;O(),b(),x(),A();let q=$()?.transport;if(q==="bedrock"&&!J(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH))G();if(q==="vertex"&&!J(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH))E();if(F(_(),AbortSignal.timeout(3000),[]),D(),Z(),w(),k.initialize(),!N())L.initialize()}
2
+ export{Xq as I};
@@ -0,0 +1,2 @@
1
+ import{JX as e2,LV as u2,UV as Z,cX as Y,eX as u}from"./cli-0.5.10-9xc8zhxg.mjs";import{mZ as t,nZ as o,oZ as U}from"./cli-0.5.10-gs8dx67v.mjs";import{g9 as X,i9 as j}from"./cli-0.5.10-2fqes7gy.mjs";import{Hna as s}from"./cli-0.5.10-1sd567wn.mjs";e2();j();U();var Q=s(u2(),1),K=58;function c2(){let l=Q.c(35),[e]=Z();if(X.terminal==="Apple_Terminal"){let c;if(l[0]!==e)c=t(t2,{theme:e,welcomeMessage:"Welcome to Claude Code"}),l[0]=e,l[1]=c;else c=l[1];return c}if(["light","light-daltonized","light-ansi"].includes(e)){let c,R,k,p,A,a,I,i,M;if(l[2]===Symbol.for("react.memo_cache_sentinel"))c=o(u,{children:[o(u,{color:"claude",children:["Welcome to Claudin"," "]}),o(u,{dimColor:!0,children:["v","0.5.10"," "]})]}),R=t(u,{children:"…………………………………………………………………………………………………………………………………………………………"}),k=t(u,{children:" "}),p=t(u,{children:" "}),A=t(u,{children:" "}),a=t(u,{children:" ░░░░░░ "}),I=t(u,{children:" ░░░ ░░░░░░░░░░ "}),i=t(u,{children:" ░░░░░░░░░░░░░░░░░░░ "}),M=t(u,{children:" "}),l[2]=c,l[3]=R,l[4]=k,l[5]=p,l[6]=A,l[7]=a,l[8]=I,l[9]=i,l[10]=M;else c=l[2],R=l[3],k=l[4],p=l[5],A=l[6],a=l[7],I=l[8],i=l[9],M=l[10];let V;if(l[11]===Symbol.for("react.memo_cache_sentinel"))V=o(u,{children:[t(u,{dimColor:!0,children:" ░░░░"}),t(u,{children:" ██ "})]}),l[11]=V;else V=l[11];let E,N;if(l[12]===Symbol.for("react.memo_cache_sentinel"))E=o(u,{children:[t(u,{dimColor:!0,children:" ░░░░░░░░░░"}),t(u,{children:" ██▒▒██ "})]}),N=t(u,{children:" ▒▒ ██ ▒"}),l[12]=E,l[13]=N;else E=l[12],N=l[13];let W;if(l[14]===Symbol.for("react.memo_cache_sentinel"))W=o(u,{children:[" ",t(u,{color:"clawd_body",children:" █████████ "})," ▒▒░░▒▒ ▒ ▒▒"]}),l[14]=W;else W=l[14];let L;if(l[15]===Symbol.for("react.memo_cache_sentinel"))L=o(u,{children:[" ",t(u,{color:"clawd_body",backgroundColor:"clawd_background",children:"██▄█████▄██"})," ▒▒ ▒▒ "]}),l[15]=L;else L=l[15];let v;if(l[16]===Symbol.for("react.memo_cache_sentinel"))v=o(u,{children:[" ",t(u,{color:"clawd_body",children:" █████████ "})," ░ ▒ "]}),l[16]=v;else v=l[16];let B;if(l[17]===Symbol.for("react.memo_cache_sentinel"))B=t(Y,{width:K,children:o(u,{children:[c,R,k,p,A,a,I,i,M,V,E,N,W,L,v,o(u,{children:["…………………",t(u,{color:"clawd_body",children:"█ █ █ █"}),"……………………………………………………………………░…………………………▒…………"]})]})}),l[17]=B;else B=l[17];return B}let D,r,P,T,d,m,n;if(l[18]===Symbol.for("react.memo_cache_sentinel"))D=o(u,{children:[o(u,{color:"claude",children:["Welcome to Claudin"," "]}),o(u,{dimColor:!0,children:["v","0.5.10"," "]})]}),r=t(u,{children:"…………………………………………………………………………………………………………………………………………………………"}),P=t(u,{children:" "}),T=t(u,{children:" * █████▓▓░ "}),d=t(u,{children:" * ███▓░ ░░ "}),m=t(u,{children:" ░░░░░░ ███▓░ "}),n=t(u,{children:" ░░░ ░░░░░░░░░░ ███▓░ "}),l[18]=D,l[19]=r,l[20]=P,l[21]=T,l[22]=d,l[23]=m,l[24]=n;else D=l[18],r=l[19],P=l[20],T=l[21],d=l[22],m=l[23],n=l[24];let b,f,_,y,h;if(l[25]===Symbol.for("react.memo_cache_sentinel"))_=o(u,{children:[t(u,{children:" ░░░░░░░░░░░░░░░░░░░ "}),t(u,{bold:!0,children:"*"}),t(u,{children:" ██▓░░ ▓ "})]}),y=t(u,{children:" ░▓▓███▓▓░ "}),h=t(u,{dimColor:!0,children:" * ░░░░ "}),b=t(u,{dimColor:!0,children:" ░░░░░░░░ "}),f=t(u,{dimColor:!0,children:" ░░░░░░░░░░░░░░░░ "}),l[25]=b,l[26]=f,l[27]=_,l[28]=y,l[29]=h;else b=l[25],f=l[26],_=l[27],y=l[28],h=l[29];let C;if(l[30]===Symbol.for("react.memo_cache_sentinel"))C=t(u,{color:"clawd_body",children:" █████████ "}),l[30]=C;else C=l[30];let S;if(l[31]===Symbol.for("react.memo_cache_sentinel"))S=o(u,{children:[" ",C," ",t(u,{dimColor:!0,children:"*"}),t(u,{children:" "})]}),l[31]=S;else S=l[31];let w;if(l[32]===Symbol.for("react.memo_cache_sentinel"))w=o(u,{children:[" ",t(u,{color:"clawd_body",children:"██▄█████▄██"}),t(u,{children:" "}),t(u,{bold:!0,children:"*"}),t(u,{children:" "})]}),l[32]=w;else w=l[32];let g;if(l[33]===Symbol.for("react.memo_cache_sentinel"))g=o(u,{children:[" ",t(u,{color:"clawd_body",children:" █████████ "})," * "]}),l[33]=g;else g=l[33];let O;if(l[34]===Symbol.for("react.memo_cache_sentinel"))O=t(Y,{width:K,children:o(u,{children:[D,r,P,T,d,m,n,_,y,h,b,f,S,w,g,o(u,{children:["…………………",t(u,{color:"clawd_body",children:"█ █ █ █"}),"………………………………………………………………………………………………………………"]})]})}),l[34]=O;else O=l[34];return O}function t2(l){let e=Q.c(44),{theme:D,welcomeMessage:r}=l;if(["light","light-daltonized","light-ansi"].includes(D)){let a;if(e[0]!==r)a=o(u,{color:"claude",children:[r," "]}),e[0]=r,e[1]=a;else a=e[1];let I;if(e[2]===Symbol.for("react.memo_cache_sentinel"))I=o(u,{dimColor:!0,children:["v","0.5.10"," "]}),e[2]=I;else I=e[2];let i;if(e[3]!==a)i=o(u,{children:[a,I]}),e[3]=a,e[4]=i;else i=e[4];let M,V,E,N,W,L,v,B;if(e[5]===Symbol.for("react.memo_cache_sentinel"))E=t(u,{children:"…………………………………………………………………………………………………………………………………………………………"}),N=t(u,{children:" "}),W=t(u,{children:" "}),L=t(u,{children:" "}),v=t(u,{children:" ░░░░░░ "}),B=t(u,{children:" ░░░ ░░░░░░░░░░ "}),M=t(u,{children:" ░░░░░░░░░░░░░░░░░░░ "}),V=t(u,{children:" "}),e[5]=M,e[6]=V,e[7]=E,e[8]=N,e[9]=W,e[10]=L,e[11]=v,e[12]=B;else M=e[5],V=e[6],E=e[7],N=e[8],W=e[9],L=e[10],v=e[11],B=e[12];let z;if(e[13]===Symbol.for("react.memo_cache_sentinel"))z=o(u,{children:[t(u,{dimColor:!0,children:" ░░░░"}),t(u,{children:" ██ "})]}),e[13]=z;else z=e[13];let $,x,H;if(e[14]===Symbol.for("react.memo_cache_sentinel"))$=o(u,{children:[t(u,{dimColor:!0,children:" ░░░░░░░░░░"}),t(u,{children:" ██▒▒██ "})]}),x=t(u,{children:" ▒▒ ██ ▒"}),H=t(u,{children:" ▒▒░░▒▒ ▒ ▒▒"}),e[14]=$,e[15]=x,e[16]=H;else $=e[14],x=e[15],H=e[16];let q;if(e[17]===Symbol.for("react.memo_cache_sentinel"))q=o(u,{children:[" ",t(u,{color:"clawd_body",children:"▗"}),o(u,{color:"clawd_background",backgroundColor:"clawd_body",children:[" ","▗"," ","▖"," "]}),t(u,{color:"clawd_body",children:"▖"})," ▒▒ ▒▒ "]}),e[17]=q;else q=e[17];let F;if(e[18]===Symbol.for("react.memo_cache_sentinel"))F=o(u,{children:[" ",t(u,{backgroundColor:"clawd_body",children:" ".repeat(9)})," ░ ▒ "]}),e[18]=F;else F=e[18];let G;if(e[19]===Symbol.for("react.memo_cache_sentinel"))G=o(u,{children:["…………………",t(u,{backgroundColor:"clawd_body",children:" "}),t(u,{children:" "}),t(u,{backgroundColor:"clawd_body",children:" "}),t(u,{children:" "}),t(u,{backgroundColor:"clawd_body",children:" "}),t(u,{children:" "}),t(u,{backgroundColor:"clawd_body",children:" "}),"……………………………………………………………………░…………………………▒…………"]}),e[19]=G;else G=e[19];let J;if(e[20]!==i)J=t(Y,{width:K,children:o(u,{children:[i,E,N,W,L,v,B,M,V,z,$,x,H,q,F,G]})}),e[20]=i,e[21]=J;else J=e[21];return J}let T;if(e[22]!==r)T=o(u,{color:"claude",children:[r," "]}),e[22]=r,e[23]=T;else T=e[23];let d;if(e[24]===Symbol.for("react.memo_cache_sentinel"))d=o(u,{dimColor:!0,children:["v","0.5.10"," "]}),e[24]=d;else d=e[24];let m;if(e[25]!==T)m=o(u,{children:[T,d]}),e[25]=T,e[26]=m;else m=e[26];let n,b,f,_,y,h;if(e[27]===Symbol.for("react.memo_cache_sentinel"))n=t(u,{children:"…………………………………………………………………………………………………………………………………………………………"}),b=t(u,{children:" "}),f=t(u,{children:" * █████▓▓░ "}),_=t(u,{children:" * ███▓░ ░░ "}),y=t(u,{children:" ░░░░░░ ███▓░ "}),h=t(u,{children:" ░░░ ░░░░░░░░░░ ███▓░ "}),e[27]=n,e[28]=b,e[29]=f,e[30]=_,e[31]=y,e[32]=h;else n=e[27],b=e[28],f=e[29],_=e[30],y=e[31],h=e[32];let C,S,w,g,O;if(e[33]===Symbol.for("react.memo_cache_sentinel"))C=o(u,{children:[t(u,{children:" ░░░░░░░░░░░░░░░░░░░ "}),t(u,{bold:!0,children:"*"}),t(u,{children:" ██▓░░ ▓ "})]}),S=t(u,{children:" ░▓▓███▓▓░ "}),w=t(u,{dimColor:!0,children:" * ░░░░ "}),g=t(u,{dimColor:!0,children:" ░░░░░░░░ "}),O=t(u,{dimColor:!0,children:" ░░░░░░░░░░░░░░░░ "}),e[33]=C,e[34]=S,e[35]=w,e[36]=g,e[37]=O;else C=e[33],S=e[34],w=e[35],g=e[36],O=e[37];let c;if(e[38]===Symbol.for("react.memo_cache_sentinel"))c=o(u,{children:[" ",t(u,{dimColor:!0,children:"*"}),t(u,{children:" "})]}),e[38]=c;else c=e[38];let R;if(e[39]===Symbol.for("react.memo_cache_sentinel"))R=o(u,{children:[" ",t(u,{color:"clawd_body",children:"▗"}),o(u,{color:"clawd_background",backgroundColor:"clawd_body",children:[" ","▗"," ","▖"," "]}),t(u,{color:"clawd_body",children:"▖"}),t(u,{children:" "}),t(u,{bold:!0,children:"*"}),t(u,{children:" "})]}),e[39]=R;else R=e[39];let k;if(e[40]===Symbol.for("react.memo_cache_sentinel"))k=o(u,{children:[" ",t(u,{backgroundColor:"clawd_body",children:" ".repeat(9)})," * "]}),e[40]=k;else k=e[40];let p;if(e[41]===Symbol.for("react.memo_cache_sentinel"))p=o(u,{children:["…………………",t(u,{backgroundColor:"clawd_body",children:" "}),t(u,{children:" "}),t(u,{backgroundColor:"clawd_body",children:" "}),t(u,{children:" "}),t(u,{backgroundColor:"clawd_body",children:" "}),t(u,{children:" "}),t(u,{backgroundColor:"clawd_body",children:" "}),"………………………………………………………………………………………………………………"]}),e[41]=p;else p=e[41];let A;if(e[42]!==m)A=t(Y,{width:K,children:o(u,{children:[m,n,b,f,_,y,h,C,S,w,g,O,c,R,k,p]})}),e[42]=m,e[43]=A;else A=e[43];return A}
2
+ export{c2 as ba};
@@ -0,0 +1,2 @@
1
+ import{Bc as x,Cc as o}from"./cli-0.5.10-84q7z5hq.mjs";import{Bs as u,CH as i,FI as W,II as t,au as K,cu as m,fs as Z,ls as v,nH as O,oH as a,qA as M,rn as Y,ss as $,tn as g,ts as d,wA as l,zH as R,zs as y}from"./cli-0.5.10-8jjacn05.mjs";import{kca as X,sca as h}from"./cli-0.5.10-2fqes7gy.mjs";import{Qfa as I,Tfa as c}from"./cli-0.5.10-p4wmnjhz.mjs";import{iga as V,pga as f}from"./cli-0.5.10-8wqagr68.mjs";import{ama as _,pia as U}from"./cli-0.5.10-atkghjt0.mjs";import{Lna as C}from"./cli-0.5.10-1sd567wn.mjs";async function Lj(w){I("refreshActivePlugins: clearing all plugin caches"),R(),K();let G=await W(),[E,F]=await Promise.all([O(),Z(U())]),{enabled:z,disabled:B,errors:H}=G;x(E);let[P,S]=await Promise.all([Promise.all(z.map(async(j)=>{if(j.mcpServers)return Object.keys(j.mcpServers).length;let q=await Y(j,H);if(q)j.mcpServers=q;return q?Object.keys(q).length:0})),Promise.all(z.map(async(j)=>{if(j.lspServers)return Object.keys(j.lspServers).length;let q=await $(j,H);if(q)j.lspServers=q;return q?Object.keys(q).length:0}))]),J=P.reduce((j,q)=>j+q,0),L=S.reduce((j,q)=>j+q,0);w((j)=>({...j,plugins:{...j.plugins,enabled:z,disabled:B,commands:[],errors:n(j.plugins.errors,H),needsRefresh:!1},agentDefinitions:F,mcp:{...j.mcp,pluginReconnectKey:j.mcp.pluginReconnectKey+1}})),y();let N=!1;try{await M()}catch(j){N=!0,X(j),I(`refreshActivePlugins: loadPluginHooks failed: ${V(j)}`)}let Q=z.reduce((j,q)=>{if(!q.hooksConfig)return j;return j+Object.values(q.hooksConfig).reduce((k,A)=>k+(A?.reduce((D,b)=>D+b.hooks.length,0)??0),0)},0);return I(`refreshActivePlugins: ${z.length} enabled, ${E.length} commands, ${F.allAgents.length} agents, ${Q} hooks, ${J} MCP, ${L} LSP`),{enabled_count:z.length,disabled_count:B.length,command_count:E.length,agent_count:F.allAgents.length,hook_count:Q,mcp_count:J,lsp_count:L,error_count:H.length+(N?1:0),agentDefinitions:F,pluginCommands:E}}function n(w,G){let E=w.filter((B)=>B.source==="lsp-manager"||B.source.startsWith("plugin:")),F=new Set(G.map(T));return[...E.filter((B)=>!F.has(T(B))),...G]}function T(w){return w.type==="generic-error"?`generic-error:${w.source}:${w.error}`:`${w.type}:${w.source}`}var p=C(()=>{_();u();o();v();c();f();h();i();a();l();d();g();m();t()});
2
+ export{Lj as xc,p as yc};
@@ -0,0 +1,2 @@
1
+ import{kga as G,pga as X}from"./cli-0.5.10-8wqagr68.mjs";import{Fga as W,sga as z}from"./cli-0.5.10-jsnrvena.mjs";W();X();import{readFileSync as Y}from"node:fs";import{mkdir as Z,writeFile as Q}from"node:fs/promises";import{join as $}from"node:path";var k="latest-version.json";function R(){return $(z(),k)}function B(x){if(!x||typeof x!=="object")return!1;let q=x;return typeof q.latest==="string"&&q.latest.length>0&&typeof q.current==="string"&&q.current.length>0&&typeof q.checkedAt==="number"&&Number.isFinite(q.checkedAt)}function V(){try{let x=Y(R(),"utf8"),q=JSON.parse(x);return B(q)?q:null}catch(x){if(G(x))return null;return null}}async function _(x){let q=R(),J=JSON.stringify(x);try{await Q(q,J,"utf8")}catch(K){if(G(K)){await Z(z(),{recursive:!0}),await Q(q,J,"utf8");return}throw K}}
2
+ export{V as ia,_ as ja};
@@ -0,0 +1,5 @@
1
+ import{Cm as D,Gm as r,IC as F,JC as y,MC as S,SC as o}from"./cli-0.5.10-8jjacn05.mjs";import{AV as l,BV as z,CV as O,zV as A}from"./cli-0.5.10-9xc8zhxg.mjs";import{T6 as x,U6 as d,W6 as b,X6 as g}from"./cli-0.5.10-2fqes7gy.mjs";import{Cfa as L,Gfa as c,Qfa as V,Tfa as I,wfa as k,yfa as p}from"./cli-0.5.10-p4wmnjhz.mjs";import{Ama as C,zma as T}from"./cli-0.5.10-c9z4tdw2.mjs";import{Lna as w}from"./cli-0.5.10-1sd567wn.mjs";import{spawn as G,spawnSync as _}from"child_process";import{basename as R}from"path";function u(q){return!!b(q)}function N(q){let H=R(q.split(" ")[0]??"");return h.find((B)=>H.includes(B))}function m(q,H,B){if(!B)return[H];if(f.has(q))return["-g",`${H}:${B}`];if(q==="subl")return[`${H}:${B}`];return[H]}function Qq(q,H){let B=v();if(!B)return!1;let J=B.split(" "),X=J[0]??B,K=J.slice(1),Q=N(B);if(Q){let W=m(Q,q,H),Z={detached:!0,stdio:"ignore"},M;if(process.platform==="win32"){let U=W.map((E)=>`"${E}"`).join(" ");M=G(`${B} ${U}`,{...Z,shell:!0})}else M=G(X,[...K,...W],Z);return M.on("error",(U)=>V(`editor spawn failed: ${U}`,{level:"error"})),M.unref(),!0}let $=z.get(process.stdout);if(!$)return!1;let Y=H&&P.test(R(X));$.enterAlternateScreen();try{let W={stdio:"inherit"},Z;if(process.platform==="win32"){let M=Y?`+${H} `:"";Z=_(`${B} ${M}"${q}"`,{...W,shell:!0})}else{let M=[...K,...Y?[`+${H}`,q]:[q]];Z=_(X,M,W)}if(Z.error)return V(`editor spawn failed: ${Z.error}`,{level:"error"}),!1;return!0}finally{$.exitAlternateScreen()}}var h,P,f,v;var j=w(()=>{C();O();I();g();h=["code","cursor","windsurf","codium","subl","atom","gedit","notepad++","notepad"],P=/\b(vi|vim|nvim|nano|emacs|pico|micro|helix|hx)\b/,f=new Set(["code","cursor","windsurf","codium"]);v=T(()=>{if(process.env.VISUAL?.trim())return process.env.VISUAL.trim();if(process.env.EDITOR?.trim())return process.env.EDITOR.trim();if(process.platform==="win32")return"start /wait notepad";return["code","vi","nano"].find((H)=>u(H))})});function a(q){return N(q)!==void 0}function i(q){let H=L(),B=z.get(process.stdout);if(!B)throw Error("Ink instance not found - cannot pause rendering");let J=v();if(!J)return{content:null};try{H.statSync(q)}catch{return{content:null}}let X=!a(J);if(X)B.enterAlternateScreen();else B.pause(),B.suspendStdin();try{let K=s[J]??J;return x(`${K} "${q}"`,{stdio:"inherit"}),{content:H.readFileSync(q,{encoding:"utf-8"})}}catch(K){if(typeof K==="object"&&K!==null&&"status"in K&&typeof K.status==="number"){let Q=K.status;if(Q!==0)return{content:null,error:`${D(J)} exited with code ${Q}`}}return{content:null}}finally{if(X)B.exitAlternateScreen();else B.resumeStdin(),B.resume()}}function n(q,H,B){let J=q;for(let[X,K]of Object.entries(B))if(K.type==="text"){let Q=parseInt(X),$=K.content,Y=J.indexOf($);if(Y!==-1){let W=F($),Z=y(Q,W);J=J.slice(0,Y)+Z+J.slice(Y+$.length)}}return J}function Nq(q,H){let B=L(),J=A();try{let X=H?S(q,H):q;k(J,X,{encoding:"utf-8",flush:!0});let K=i(J);if(K.content===null)return K;let Q=K.content;if(Q.endsWith(`
2
+ `)&&!Q.endsWith(`
3
+
4
+ `))Q=Q.slice(0,-1);if(H)Q=n(Q,q,H);return{content:Q}}finally{try{B.unlinkSync(J)}catch{}}}var s;var t=w(()=>{o();O();j();d();c();r();p();l();s={code:"code -w",subl:"subl --wait"}});
5
+ export{Qq as wf,v as xf,j as yf,i as zf,Nq as Af,t as Bf};
@@ -0,0 +1,2 @@
1
+ import{Lna as e}from"./cli-0.5.10-1sd567wn.mjs";function o(){return!0}var t=()=>{};
2
+ export{o as pQ,t as qQ};
@@ -0,0 +1,17 @@
1
+ import{G2 as x,M2 as K}from"./cli-0.5.10-xyscak5q.mjs";import{H$ as J,x$ as w}from"./cli-0.5.10-2fqes7gy.mjs";import{Lda as v,Xda as I}from"./cli-0.5.10-rk7at2tn.mjs";import{Fga as G,vga as q}from"./cli-0.5.10-jsnrvena.mjs";import{Lna as z}from"./cli-0.5.10-1sd567wn.mjs";function W(b){return b.type==="advisor_tool_result"||b.type==="server_tool_use"&&b.name==="advisor"}function j(){return v("tengu_sage_compass",{})}function k(){if(q(process.env.CLAUDE_CODE_DISABLE_ADVISOR_TOOL))return!1;if(!x())return!1;return j().enabled??!1}function N(){return k()&&(j().canUserConfigure??!1)}function X(){let b=j();return k()&&!N()&&b.baseModel&&b.advisorModel?{baseModel:b.baseModel,advisorModel:b.advisorModel}:void 0}function Z(b){let h=b.toLowerCase();return h.includes("opus-4-8")||h.includes("opus-4-7")||h.includes("opus-4-6")||h.includes("sonnet-4-6")}function $(b){let h=b.toLowerCase();return h.includes("opus-4-8")||h.includes("opus-4-7")||h.includes("opus-4-6")||h.includes("sonnet-4-6")}function B(){if(!k())return;return w().advisorModel}function D(b){let h=b.iterations;if(!h)return[];return h.filter((y)=>y.type==="advisor_message")}var F=`# Advisor Tool
2
+
3
+ You have access to an \`advisor\` tool backed by a stronger reviewer model. It takes NO parameters -- when you call it, your entire conversation history is automatically forwarded. The advisor sees the task, every tool call you've made, every result you've seen.
4
+
5
+ Call advisor BEFORE substantive work -- before writing code, before committing to an interpretation, before building on an assumption. If the task requires orientation first (finding files, reading code, seeing what's there), do that, then call advisor. Orientation is not substantive work. Writing, editing, and declaring an answer are.
6
+
7
+ Also call advisor:
8
+ - When you believe the task is complete. BEFORE this call, make your deliverable durable: write the file, stage the change, save the result. The advisor call takes time; if the session ends during it, a durable result persists and an unwritten one doesn't.
9
+ - When stuck -- errors recurring, approach not converging, results that don't fit.
10
+ - When considering a change of approach.
11
+
12
+ On tasks longer than a few steps, call advisor at least once before committing to an approach and once before declaring done. On short reactive tasks where the next action is dictated by tool output you just read, you don't need to keep calling -- the advisor adds most of its value on the first call, before the approach crystallizes.
13
+
14
+ Give the advice serious weight. If you follow a step and it fails empirically, or you have primary-source evidence that contradicts a specific claim (the file says X, the code does Y), adapt. A passing self-test is not evidence the advice is wrong -- it's evidence your test doesn't check what the advice is checking.
15
+
16
+ If you've already retrieved data pointing one way and the advisor points another: don't silently switch. Surface the conflict in one more advisor call -- "I found X, you suggest Y, which constraint breaks the tie?" The advisor saw your evidence but may have underweighted it; a reconcile call is cheaper than committing to the wrong branch.`;var O=z(()=>{I();K();G();J()});
17
+ export{W as BR,k as CR,N as DR,X as ER,Z as FR,$ as GR,B as HR,D as IR,F as JR,O as KR};
@@ -0,0 +1,2 @@
1
+ import{Lna as H}from"./cli-0.5.10-1sd567wn.mjs";function F(){if(!A)A=new Intl.Segmenter(void 0,{granularity:"grapheme"});return A}function K(b){if(!b)return"";return F().segment(b)[Symbol.iterator]().next().value?.segment??""}function M(b){if(!b)return"";let j="";for(let{segment:q}of F().segment(b))j=q;return j}function N(){if(!B)B=new Intl.Segmenter(void 0,{granularity:"word"});return B}function O(b,j){let q=`${b}:${j}`,z=E.get(q);if(!z)z=new Intl.RelativeTimeFormat("en",{style:b,numeric:j}),E.set(q,z);return z}function P(){if(!D)D=Intl.DateTimeFormat().resolvedOptions().timeZone;return D}var A=null,B=null,E,D=null;var J=H(()=>{E=new Map});
2
+ export{F as _ca,K as $ca,M as ada,N as bda,O as cda,P as dda,J as eda};
@@ -0,0 +1,2 @@
1
+ function B(z,q=process.argv){for(let k=0;k<q.length;k++){let A=q[k];if(A?.startsWith(`${z}=`))return A.slice(z.length+1);if(A===z&&k+1<q.length)return q[k+1]}return}
2
+ export{B as ob};
@@ -0,0 +1,2 @@
1
+ import{MT as YJ,QT as DJ,UT as vJ,VT as c,WT as SJ,cU as ZJ}from"./cli-0.5.10-t11my4jb.mjs";import{dZ as CJ,kZ as TJ}from"./cli-0.5.10-m0hghx42.mjs";import{C6 as OJ,D6 as FJ,Q$ as S,S$ as yJ,_6 as xJ,d8 as jJ,kca as p,sca as wJ,w7 as NJ}from"./cli-0.5.10-2fqes7gy.mjs";import{Ada as w,Bda as XJ,xda as R,zda as VJ}from"./cli-0.5.10-xrwj7982.mjs";import{Qfa as G,Tfa as QJ,tfa as v,ufa as y,yfa as JJ}from"./cli-0.5.10-p4wmnjhz.mjs";import{iga as W,jga as C,pga as e}from"./cli-0.5.10-8wqagr68.mjs";import{Fga as a,sga as s,tga as I,vga as t}from"./cli-0.5.10-jsnrvena.mjs";import{Yja as i,ama as m,fia as r,gia as MJ,jia as d,pla as L}from"./cli-0.5.10-atkghjt0.mjs";import{Lna as T,Mna as BJ}from"./cli-0.5.10-1sd567wn.mjs";import{mkdir as PJ,readdir as l,readFile as $J,unlink as qJ,writeFile as b}from"fs/promises";import{join as D}from"path";function HQ(J){if(M===J)return;M=J,U()}function UQ(){if(M===void 0)return;M=void 0,U()}function U(){try{GJ.emit()}catch{}}function KJ(J){return D(E(J),cJ)}async function g(J){let Q=KJ(J);try{let V=(await $J(Q,"utf-8")).trim(),X=parseInt(V,10);return isNaN(X)?0:X}catch{return 0}}async function RJ(J,Q){let V=KJ(J);await b(V,String(Q))}function OQ(){if(t(process.env.CLAUDE_CODE_ENABLE_TASKS))return!0;return!i()}async function xQ(J){let Q=E(J),V=await o(J),X;try{X=await S(V,P);let Z=await WJ(J);if(Z>0){let $=await g(J);if(Z>$)await RJ(J,Z)}let Y;try{Y=await l(Q)}catch{Y=[]}for(let $ of Y)if($.endsWith(".json")&&!$.startsWith(".")){let q=D(Q,$);try{await qJ(q)}catch{}}U()}finally{if(X)await X()}}function CQ(){if(process.env.CLAUDE_CODE_TASK_LIST_ID)return process.env.CLAUDE_CODE_TASK_LIST_ID;let J=YJ();if(J)return J.teamName;return c()||M||d()}function _J(J){return J.replace(/[^a-zA-Z0-9_-]/g,"-")}function E(J){return D(s(),"tasks",_J(J))}function A(J,Q){return D(E(J),`${_J(Q)}.json`)}async function bJ(J){let Q=E(J);try{await PJ(Q,{recursive:!0})}catch{}}async function WJ(J){let Q=E(J),V;try{V=await l(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 hJ(J){let[Q,V]=await Promise.all([WJ(J),g(J)]);return Math.max(Q,V)}async function vQ(J,Q){let V=await o(J),X;try{X=await S(V,P);let Z=await hJ(J),Y=String(Z+1),$={id:Y,...Q},q=A(J,Y);return await b(q,v($,null,2)),U(),Y}finally{if(X)await X()}}async function O(J,Q){let V=A(J,Q);try{let X=await $J(V,"utf-8"),Z=y(X),Y=pJ().safeParse(Z);if(!Y.success)return G(`[Tasks] Task ${Q} failed schema validation: ${Y.error.message}`),null;return Y.data}catch(X){if(C(X)==="ENOENT")return null;return G(`[Tasks] Failed to read task ${Q}: ${W(X)}`),p(X),null}}async function EJ(J,Q,V){let X=await O(J,Q);if(!X)return null;let Z={...X,...V,id:Q},Y=A(J,Q);return await b(Y,v(Z,null,2)),U(),Z}async function j(J,Q,V){let X=A(J,Q);if(!await O(J,Q))return null;let Y;try{return Y=await S(X,P),await EJ(J,Q,V)}finally{await Y?.()}}async function SQ(J,Q){let V=A(J,Q);try{let X=parseInt(Q,10);if(!isNaN(X)){let Y=await g(J);if(X>Y)await RJ(J,X)}try{await qJ(V)}catch(Y){if(C(Y)==="ENOENT")return!1;throw Y}let Z=await h(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 U(),!0}catch{return!1}}async function h(J){let Q=E(J),V;try{V=await l(Q)}catch{return[]}let X=V.filter((Y)=>Y.endsWith(".json")).map((Y)=>Y.replace(".json",""));return(await Promise.all(X.map((Y)=>O(J,Y)))).filter((Y)=>Y!==null)}async function AQ(J,Q,V){let[X,Z]=await Promise.all([O(J,Q),O(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 LJ(J){return D(E(J),".lock")}async function o(J){await bJ(J);let Q=LJ(J);try{await b(Q,"",{flag:"wx"})}catch{}return Q}async function zQ(J,Q,V,X={}){let Z=A(J,Q);if(!await O(J,Q))return{success:!1,reason:"task_not_found"};if(X.checkAgentBusy)return uJ(J,Q,V);let $;try{$=await S(Z,P);let q=await O(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 h(J),B=new Set(K.filter((z)=>z.status!=="completed").map((z)=>z.id)),N=q.blockedBy.filter((z)=>B.has(z));if(N.length>0)return{success:!1,reason:"blocked",task:q,blockedByTasks:N};return{success:!0,task:await EJ(J,Q,{owner:V})}}catch(q){return G(`[Tasks] Failed to claim task ${Q}: ${W(q)}`),p(q),{success:!1,reason:"task_not_found"}}finally{if($)await $()}}async function uJ(J,Q,V){let X=await o(J),Z;try{Z=await S(X,P);let Y=await h(J),$=Y.find((_)=>_.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((_)=>_.status!=="completed").map((_)=>_.id)),K=$.blockedBy.filter((_)=>q.has(_));if(K.length>0)return{success:!1,reason:"blocked",task:$,blockedByTasks:K};let B=Y.filter((_)=>_.status!=="completed"&&_.owner===V&&_.id!==Q);if(B.length>0)return{success:!1,reason:"agent_busy",task:$,busyWithTasks:B.map((_)=>_.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)}`),p(Y),{success:!1,reason:"task_not_found"}}finally{if(Z)await Z()}}async function MQ(J,Q,V,X){let Y=(await h(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((B)=>`#${B.id} "${B.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 GJ,M,BQ,fJ,pJ,cJ=".highwatermark",P;var HJ=T(()=>{VJ();m();jJ();QJ();a();e();XJ();yJ();wJ();MJ();JJ();ZJ();DJ();GJ=r();BQ=GJ.subscribe;fJ=w(()=>R.enum(["pending","in_progress","completed"])),pJ=w(()=>R.object({id:R.string(),subject:R.string(),description:R.string(),activeForm:R.string().optional(),owner:R.string().optional(),status:fJ(),blocks:R.array(R.string()),blockedBy:R.array(R.string()),metadata:R.record(R.string(),R.unknown()).optional()})),P={retries:{retries:30,minTimeout:5,maxTimeout:100}}});function n(J){return J==="tmux"||J==="iterm2"}var UJ=()=>{};import{mkdirSync as IJ,readFileSync as lJ,writeFileSync as gJ}from"fs";import{mkdir as oJ,readFile as AJ,rm as k,writeFile as nJ}from"fs/promises";import{join as f}from"path";function zJ(J){return J.replace(/[^a-zA-Z0-9]/g,"-").toLowerCase()}function nQ(J){return J.replace(/@/g,"-")}function u(J){return f(I(),zJ(J))}function F(J){return f(u(J),"config.json")}function H(J){try{let Q=lJ(F(J),"utf-8");return y(Q)}catch(Q){if(C(Q)==="ENOENT")return null;return G(`[TeammateTool] Failed to read team file for ${J}: ${W(Q)}`),null}}async function kJ(J){try{let Q=await AJ(F(J),"utf-8");return y(Q)}catch(Q){if(C(Q)==="ENOENT")return null;return G(`[TeammateTool] Failed to read team file for ${J}: ${W(Q)}`),null}}function x(J,Q){let V=u(J);IJ(V,{recursive:!0}),gJ(F(J),v(Q,null,2))}async function rJ(J,Q){let V=u(J);await oJ(V,{recursive:!0}),await nJ(F(J),v(Q,null,2))}function kQ(J,Q){let V=Q.agentId||Q.name;if(!V)return G("[TeammateTool] removeTeammateFromTeamFile called with no identifier"),!1;let X=H(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 x(J,X),G(`[TeammateTool] Removed teammate from team file: ${V}`),!0}function rQ(J,Q){let V=H(J);if(!V)return!1;let X=V.hiddenPaneIds??[];if(!X.includes(Q))X.push(Q),V.hiddenPaneIds=X,x(J,V),G(`[TeammateTool] Added ${Q} to hidden panes for team ${J}`);return!0}function dQ(J,Q){let V=H(J);if(!V)return!1;let X=V.hiddenPaneIds??[],Z=X.indexOf(Q);if(Z!==-1)X.splice(Z,1),V.hiddenPaneIds=X,x(J,V),G(`[TeammateTool] Removed ${Q} from hidden panes for team ${J}`);return!0}function iQ(J,Q){let V=H(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 x(J,V),G(`[TeammateTool] Removed member with pane ${Q} from team ${J}`),!0}function mQ(J,Q){let V=H(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),x(J,V),G(`[TeammateTool] Removed member ${Q} from team ${J}`),!0}function dJ(J,Q,V){let X=H(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 x(J,{...X,members:Y}),G(`[TeammateTool] Set member ${Q} in team ${J} to mode: ${V}`),!0}function sQ(J,Q){if(!SJ())return;let V=Q??c(),X=vJ();if(V&&X)dJ(V,X,J)}function tQ(J,Q){let V=H(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)x(J,{...V,members:Y}),G(`[TeammateTool] Set ${Q.length} member modes in team ${J}`);return!0}async function aQ(J,Q,V){let X=await kJ(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 iJ(J){let Q=f(J,".git"),V=null;try{let Z=(await AJ(Q,"utf-8")).trim().match(/^gitdir:\s*(.+)$/);if(Z&&Z[1]){let Y=Z[1],$=f(Y,"..","..");V=f($,"..")}}catch{}if(V){let X=await OJ(xJ(),["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 k(J,{recursive:!0,force:!0}),G(`[TeammateTool] Removed worktree directory manually: ${J}`)}catch(X){G(`[TeammateTool] Failed to remove worktree ${J}: ${W(X)}`)}}function eQ(J){L().add(J)}function JV(J){L().delete(J)}async function QV(){let J=L();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)=>mJ(V))),await Promise.allSettled(Q.map((V)=>sJ(V))),J.clear()}async function mJ(J){let Q=H(J);if(!Q)return;let V=Q.members.filter((q)=>q.name!==CJ&&q.tmuxPaneId&&q.backendType&&n(q.backendType));if(V.length===0)return;let[{ensureBackendsRegistered:X,getBackendByType:Z},{isInsideTmux:Y}]=await Promise.all([import("./registry-0.5.10-q3yb1jt6.mjs"),import("./detection-0.5.10-jhy1kffq.mjs")]);await X();let $=!await Y();await Promise.allSettled(V.map(async(q)=>{if(!q.tmuxPaneId||!q.backendType||!n(q.backendType))return;let K=await Z(q.backendType).killPane(q.tmuxPaneId,$);G(`cleanupSessionTeams: killPane ${q.name} (${q.backendType} ${q.tmuxPaneId}) → ${K}`)}))}async function sJ(J){let Q=zJ(J),V=H(J),X=[];if(V){for(let $ of V.members)if($.worktreePath)X.push($.worktreePath)}for(let $ of X)await iJ($);let Z=u(J);try{await k(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=E(Q);try{await k(Y,{recursive:!0,force:!0}),G(`[TeammateTool] Cleaned up tasks directory: ${Y}`),U()}catch($){G(`[TeammateTool] Failed to clean up tasks directory ${Y}: ${W($)}`)}}var oQ;var tJ=T(()=>{VJ();m();QJ();a();e();FJ();NJ();XJ();JJ();HJ();ZJ();UJ();TJ();oQ=w(()=>R.strictObject({operation:R.enum(["spawnTeam","cleanup"]).describe("Operation: spawnTeam to create a team, cleanup to remove team and task directories."),agent_type:R.string().optional().describe('Type/role of the team lead (e.g., "researcher", "test-runner"). Used for team file and inter-agent coordination.'),team_name:R.string().optional().describe("Name for the new team to create (required for spawnTeam)."),description:R.string().optional().describe("Team description/purpose (only used with spawnTeam).")}))});
2
+ export{HQ as XR,UQ as YR,BQ as ZR,fJ as _R,OQ as $R,xQ as aS,CQ as bS,_J as cS,E as dS,bJ as eS,vQ as fS,O as gS,j as hS,SQ as iS,h as jS,AQ as kS,zQ as lS,MQ as mS,HJ as nS,n as oS,UJ as pS,oQ as qS,zJ as rS,nQ as sS,u as tS,F as uS,H as vS,kJ as wS,rJ as xS,kQ as yS,rQ as zS,dQ as AS,iQ as BS,mQ as CS,dJ as DS,sQ as ES,tQ as FS,aQ as GS,eQ as HS,JV as IS,QV as JS,sJ as KS,tJ as LS};
@@ -0,0 +1,4 @@
1
+ import{Dh as dJ,GN as TJ,Ym as DJ,_m as cJ,cO as jJ,dO as ZV,gH as IJ,hH as BJ,iH as pJ}from"./cli-0.5.10-8jjacn05.mjs";import{C6 as c,D6 as PJ,F7 as qJ,H$ as gJ,J7 as mJ,Raa as uJ,Y6 as VJ,_6 as p,kca as L,sca as hJ,w7 as fJ,x$ as WJ,xaa as NJ}from"./cli-0.5.10-2fqes7gy.mjs";import{$da as kJ,_da as j}from"./cli-0.5.10-d609fanf.mjs";import{Oea as f,Qea as zJ}from"./cli-0.5.10-y9qd4psg.mjs";import{Cfa as JJ,Gfa as bJ,Qfa as Q,Tfa as yJ}from"./cli-0.5.10-p4wmnjhz.mjs";import{iga as e,pga as SJ}from"./cli-0.5.10-8wqagr68.mjs";import{fia as AJ,gia as wJ}from"./cli-0.5.10-atkghjt0.mjs";import{Hna as LJ,Lna as XJ}from"./cli-0.5.10-1sd567wn.mjs";class d{paths=[];lowerPaths=[];charBits=new Int32Array(0);pathLens=new Uint16Array(0);topLevelCache=null;readyCount=0;loadFromFileList(J){let W=new Set,Z=[];for(let V of J)if(V.length>0&&!W.has(V))W.add(V),Z.push(V);this.buildIndex(Z)}loadFromFileListAsync(J){let W=()=>{},Z=new Promise((Y)=>{W=Y}),V=this.buildAsync(J,W);return{queryable:Z,done:V}}async buildAsync(J,W){let Z=new Set,V=[],Y=performance.now();for(let $=0;$<J.length;$++){let _=J[$];if(_.length>0&&!Z.has(_))Z.add(_),V.push(_);if(($&255)===255&&performance.now()-Y>4)await y(),Y=performance.now()}this.resetArrays(V),Y=performance.now();let H=!0;for(let $=0;$<V.length;$++)if(this.indexPath($),($&255)===255&&performance.now()-Y>4){if(this.readyCount=$+1,H)W(),H=!1;await y(),Y=performance.now()}this.readyCount=V.length,W()}buildIndex(J){this.resetArrays(J);for(let W=0;W<J.length;W++)this.indexPath(W);this.readyCount=J.length}resetArrays(J){let W=J.length;this.paths=J,this.lowerPaths=Array(W),this.charBits=new Int32Array(W),this.pathLens=new Uint16Array(W),this.readyCount=0,this.topLevelCache=CJ(J,100)}indexPath(J){let W=this.paths[J].toLowerCase();this.lowerPaths[J]=W;let Z=W.length;this.pathLens[J]=Z;let V=0;for(let Y=0;Y<Z;Y++){let H=W.charCodeAt(Y);if(H>=97&&H<=122)V|=1<<H-97}this.charBits[J]=V}search(J,W){if(W<=0)return[];if(J.length===0){if(this.topLevelCache)return this.topLevelCache.slice(0,W);return[]}let Z=J!==J.toLowerCase(),V=Z?J:J.toLowerCase(),Y=Math.min(V.length,64),H=Array(Y),$=0;for(let M=0;M<Y;M++){let B=V.charAt(M);H[M]=B;let E=B.charCodeAt(0);if(E>=97&&E<=122)$|=1<<E-97}let _=Y*24+8+32,X=[],N=-1/0,{paths:D,lowerPaths:q,charBits:x,pathLens:U,readyCount:m}=this;J:for(let M=0;M<m;M++){if((x[M]&$)!==$)continue;let B=Z?D[M]:q[M],E=B.indexOf(H[0]);if(E===-1)continue;b[0]=E;let R=0,g=0,u=E;for(let A=1;A<Y;A++){if(E=B.indexOf(H[A],u+1),E===-1)continue J;b[A]=E;let F=E-u-1;if(F===0)g+=4;else R+=3+F*1;u=E}if(X.length===W&&_+g-R<=N)continue;let S=D[M],UJ=U[M],T=Y*16+g-R;T+=HJ(S,b[0],!0);for(let A=1;A<Y;A++)T+=HJ(S,b[A],!1);if(T+=Math.max(0,32-(UJ>>2)),X.length<W){if(X.push({path:S,fuzzScore:T}),X.length===W)X.sort((A,F)=>A.fuzzScore-F.fuzzScore),N=X[0].fuzzScore}else if(T>N){let A=0,F=X.length;while(A<F){let h=A+F>>1;if(X[h].fuzzScore<T)A=h+1;else F=h}X.splice(A,0,{path:S,fuzzScore:T}),X.shift(),N=X[0].fuzzScore}}X.sort((M,B)=>B.fuzzScore-M.fuzzScore);let I=X.length,w=Math.max(I,1),z=Array(I);for(let M=0;M<I;M++){let B=X[M].path,E=M/w,R=B.includes("test")?Math.min(E*1.05,1):E;z[M]={path:B,score:R}}return z}}function HJ(J,W,Z){if(W===0)return Z?8:0;let V=J.charCodeAt(W-1);if(vJ(V))return 8;if(GJ(V)&&RJ(J.charCodeAt(W)))return 6;return 0}function vJ(J){return J===47||J===92||J===45||J===95||J===46||J===32}function GJ(J){return J>=97&&J<=122}function RJ(J){return J>=65&&J<=90}function y(){return new Promise((J)=>setImmediate(J))}function CJ(J,W){let Z=new Set;for(let Y of J){let H=Y.length;for(let _=0;_<Y.length;_++){let X=Y.charCodeAt(_);if(X===47||X===92){H=_;break}}let $=Y.slice(0,H);if($.length>0){if(Z.add($),Z.size>=W)break}}let V=Array.from(Z);return V.sort((Y,H)=>{let $=Y.length-H.length;if($!==0)return $;return Y<H?-1:Y>H?1:0}),V.slice(0,W).map((Y)=>({path:Y,score:0}))}var _J=4,b;var QJ=XJ(()=>{b=new Int32Array(64)});import{statSync as lJ}from"fs";import*as O from"path";function l(){if(!K)K=new d;return K}function UV(){K=null,v=null,G++,k=null,C=[],ZJ=[],$J=[],YJ.clear(),n=null,s=null,o=0,a=null,i=null,P=null}function xJ(J){let W=J.length,Z=Math.max(1,Math.floor(W/500)),V=-2128831035;for(let Y=0;Y<W;Y+=Z){let H=J[Y];for(let $=0;$<H.length;$++)V=(V^H.charCodeAt($))*16777619|0;V=V*16777619|0}if(W>0){let Y=J[W-1];for(let H=0;H<Y.length;H++)V=(V^Y.charCodeAt(H))*16777619|0}return`${W}:${(V>>>0).toString(16)}`}function nJ(){let J=VJ(j());if(!J)return null;try{return lJ(O.join(J,".git","index")).mtimeMs}catch{return null}}function MJ(J,W,Z){if(Z===W)return J;return J.map((V)=>{let Y=O.join(W,V);return O.relative(Z,Y)})}async function sJ(J){if(J.length===0)return;if(!K||C.length===0)return;let W=await FJ(J),Z=[...C,...ZJ,...$J,...J,...W],V=xJ(Z);if(V===P){Q("[FileIndex] skipped index rebuild — merged paths unchanged");return}await K.loadFromFileListAsync(Z).done,P=V,Q(`[FileIndex] rebuilt index with ${C.length} tracked + ${J.length} untracked files`)}async function OJ(J,W){let Z=`${J}:${W}`;if(s===Z)return n;let V=JJ(),Y=[".ignore",".rgignore"],H=[...new Set([J,W])],$=KJ.default(),_=!1,X=H.flatMap((q)=>Y.map((x)=>O.join(q,x))),N=await Promise.all(X.map((q)=>V.readFile(q,{encoding:"utf8"}).catch(()=>null)));for(let[q,x]of N.entries()){if(x===null)continue;$.add(x),_=!0,Q(`[FileIndex] loaded ignore patterns from ${X[q]}`)}let D=_?$:null;return n=D,s=Z,D}async function oJ(J,W){let Z=Date.now();Q("[FileIndex] getFilesUsingGit called");let V=VJ(j());if(!V)return Q("[FileIndex] not a git repo, returning null"),null;try{let Y=j(),H=Date.now(),$=await c(p(),["-c","core.quotepath=false","ls-files","--recurse-submodules"],{timeout:5000,abortSignal:J,cwd:V});if(Q(`[FileIndex] git ls-files (tracked) took ${Date.now()-H}ms`),$.code!==0)return Q(`[FileIndex] git ls-files failed (code=${$.code}, stderr=${$.stderr}), falling back to ripgrep`),null;let _=$.stdout.trim().split(`
2
+ `).filter(Boolean),X=MJ(_,V,Y),N=await OJ(V,Y);if(N){let q=X.length;X=N.filter(X),Q(`[FileIndex] applied ignore patterns: ${q} -> ${X.length} files`)}C=X;let D=Date.now()-Z;if(Q(`[FileIndex] git ls-files: ${X.length} tracked files in ${D}ms`),f("tengu_file_suggestions_git_ls_files",{file_count:X.length,tracked_count:X.length,untracked_count:0,duration_ms:D}),!k){let q=W?["-c","core.quotepath=false","ls-files","--others","--exclude-standard"]:["-c","core.quotepath=false","ls-files","--others"],x=G;k=c(p(),q,{timeout:1e4,cwd:V}).then(async(U)=>{if(x!==G)return;if(U.code===0){let m=U.stdout.trim().split(`
3
+ `).filter(Boolean),I=MJ(m,V,Y),w=await OJ(V,Y);if(w&&I.length>0){let z=I.length;I=w.filter(I),Q(`[FileIndex] applied ignore patterns to untracked: ${z} -> ${I.length} files`)}Q(`[FileIndex] background untracked fetch: ${I.length} files`),sJ(I)}}).catch((U)=>{Q(`[FileIndex] background untracked fetch failed: ${U}`)}).finally(()=>{k=null})}return X}catch(Y){return Q(`[FileIndex] git ls-files error: ${e(Y)}`),null}}async function FJ(J){let W=new Set,Z=performance.now();for(let V=0;V<J.length;V++)if(aJ(J,V,V+1,W),(V&255)===255&&performance.now()-Z>_J)await y(),Z=performance.now();return[...W].map((V)=>V+O.sep)}function aJ(J,W,Z,V){for(let Y=W;Y<Z;Y++){let H=O.dirname(J[Y]);while(H!=="."&&!V.has(H)){let $=O.dirname(H);if($===H)break;V.add(H),H=$}}}async function iJ(J){return(await Promise.all(IJ.map((Z)=>BJ(Z,J)))).flatMap((Z)=>Z.map((V)=>V.filePath))}async function rJ(J,W){Q(`[FileIndex] getProjectFiles called, respectGitignore=${W}`);let Z=await oJ(J,W);if(Z!==null)return Q(`[FileIndex] using git ls-files result (${Z.length} files)`),Z;Q("[FileIndex] git ls-files returned null, falling back to ripgrep");let V=Date.now(),Y=["--files","--follow","--hidden","--glob","!.git/","--glob","!.svn/","--glob","!.hg/","--glob","!.bzr/","--glob","!.jj/","--glob","!.sl/"];if(!W)Y.push("--no-ignore-vcs");let $=(await DJ(Y,".",J)).map((X)=>O.relative(j(),X)),_=Date.now()-V;return Q(`[FileIndex] ripgrep: ${$.length} files in ${_}ms`),f("tengu_file_suggestions_ripgrep",{file_count:$.length,duration_ms:_}),$}async function tJ(){let J=AbortSignal.timeout(1e4),W=l();try{let Z=WJ(),V=NJ(),Y=Z.respectGitignore??V.respectGitignore??!0,H=j(),[$,_]=await Promise.all([rJ(J,Y),iJ(H)]);ZJ=_;let X=[...$,..._],N=await FJ(X);$J=N;let D=[...N,...X],q=xJ(D);if(q!==i)await W.loadFromFileListAsync(D).done,i=q,P=null;else Q("[FileIndex] skipped index rebuild — tracked paths unchanged")}catch(Z){L(Z)}return W}function eJ(J,W){let Z=Math.min(J.length,W.length),V=0;while(V<Z&&J[V]===W[V])V++;return J.substring(0,V)}function vV(J){if(J.length===0)return"";let W=J.map((V)=>V.displayText),Z=W[0];for(let V=1;V<W.length;V++){let Y=W[V];if(Z=eJ(Z,Y),Z==="")return""}return Z}function r(J,W){return{id:`file-${J}`,displayText:J,metadata:W!==void 0?{score:W}:void 0}}function JV(J,W){return J.search(W,t).map((V)=>r(V.path,V.score))}function EJ(){if(v)return;let J=nJ();if(K){if(!(J!==null&&J!==a)&&Date.now()-o<VV)return}let W=G,Z=Date.now();l(),v=tJ().then((V)=>{if(W!==G)return V;return v=null,YJ.emit(),a=J,o=Date.now(),Q(`[FileIndex] cache refresh completed in ${Date.now()-Z}ms`),V}).catch((V)=>{if(Q(`[FileIndex] Cache refresh failed: ${e(V)}`),L(V),W===G)v=null;return l()})}async function WV(){let J=JJ(),W=j();try{return(await J.readdir(W)).map((V)=>{let Y=O.join(W,V.name),H=O.relative(W,Y);return V.isDirectory()?H+O.sep:H})}catch(Z){return L(Z),[]}}async function GV(J,W=!1){if(!J&&!W)return[];if(WJ().fileSuggestion?.type==="command"){let V={...TJ(),query:J};return(await jJ(V)).slice(0,t).map(r)}if(J===""||J==="."||J==="./"){let V=await WV();return EJ(),V.slice(0,t).map(r)}let Z=Date.now();try{let V=v!==null;EJ();let Y=J,H="."+O.sep;if(J.startsWith(H))Y=J.substring(2);if(Y.startsWith("~"))Y=qJ(Y);let $=K?JV(K,Y):[],_=Date.now()-Z;return Q(`[FileIndex] generateFileSuggestions: ${$.length} results in ${_}ms (${V?"partial":"full"} index)`),f("tengu_file_suggestions_query",{duration_ms:_,cache_hit:!V,result_count:$.length,query_length:J.length}),$}catch(V){return L(V),[]}}function RV(J,W,Z,V,Y,H){let $=typeof J==="string"?J:J.displayText,_=W.substring(0,V)+$+W.substring(V+Z.length);Y(_);let X=V+$.length;H(X)}var KJ,K=null,v=null,YJ,jV,G=0,k=null,C,ZJ,$J,n=null,s=null,o=0,a=null,i=null,P=null,t=15,VV=5000;var YV=XJ(()=>{pJ();QJ();zJ();uJ();kJ();yJ();SJ();PJ();bJ();fJ();ZV();hJ();mJ();cJ();gJ();wJ();KJ=LJ(dJ(),1);YJ=AJ(),jV=YJ.subscribe,C=[],ZJ=[],$J=[]});
4
+ export{jV as Eg,UV as Fg,vV as Gg,EJ as Hg,GV as Ig,RV as Jg,YV as Kg};
@@ -0,0 +1,50 @@
1
+ import{Wc as la,Xc as fc}from"./cli-0.5.10-tbpqmp1s.mjs";import{$c as ra,Yc as lt,Zc as Tn,_c as wn,bd as _c}from"./cli-0.5.10-kyt82zt5.mjs";import{cd as un,fd as Ac}from"./cli-0.5.10-s8bv5q7m.mjs";import{Ct as ua,Et as bc,LD as Jt,MD as tc,ND as Zt,OD as Kt,PD as Et,QD as ac,fF as qt,gF as Ha,iF as zc,jF as Rc,kD as Mn,lD as wc,ow as ha,pw as oa,qw as gc,uD as G,vD as Xa,wD as Oc,yo as ca,zo as Cc}from"./cli-0.5.10-8jjacn05.mjs";import{fV as hn,hV as sc,pV as ta,qV as yc}from"./cli-0.5.10-dzr8kmx4.mjs";import{JX as Ot,cX as w,eX as o}from"./cli-0.5.10-9xc8zhxg.mjs";import{GY as zt,HY as Rt,IY as At,JY as _t,KY as Qa,NY as ft,RY as kt,SY as aa,TY as pt}from"./cli-0.5.10-5mp7dx81.mjs";import{lZ as yn,mZ as h,nZ as C,oZ as Sn}from"./cli-0.5.10-gs8dx67v.mjs";import{pZ as In}from"./cli-0.5.10-9ek8f4vk.mjs";import{MZ as xt,NZ as rc}from"./cli-0.5.10-d1y749qy.mjs";import{$aa as gn,Aba as nc,Bba as ot,Cba as Pt,Dba as rt,Fba as It,Hba as na,Saa as vt,Taa as cn,Uaa as mc,Uba as dc,Vaa as Fn,Waa as P,Yaa as Q,Zaa as $n,aba as ct,bba as nn,cba as dn,gba as sn,hba as ut,iba as ht,k6 as an,l6 as ec,mba as wt,rba as vn,sba as Vt,tba as Yt,uba as Ln,vba as nt,wba as Qt,xba as Dn,yba as Xt,zba as Ht}from"./cli-0.5.10-2fqes7gy.mjs";import{Fga as Wt,xga as bn}from"./cli-0.5.10-jsnrvena.mjs";import{Hna as Pn,Ina as ic,Lna as v}from"./cli-0.5.10-1sd567wn.mjs";function Za(n,a=Wn){let c=P().find((r)=>r.provider==="openai"&&r.extras?.githubToken!==void 0);if(c)return dn(c.id,{provider:"openai",name:c.name,baseUrl:c.baseUrl,model:c.model||a,apiKey:n,extras:{...c.extras,githubToken:n}}),sn(c.id),{mode:"updated"};return nn({provider:"openai",name:"GitHub Copilot",baseUrl:Ja,model:a,apiKey:n,extras:{githubToken:n}},{makeActive:!0}),{mode:"created"}}function St({onDone:n,onBack:a,onChangeAPIKey:c}){let r=ft()?.trim()?"already-authed":"menu",[e,m]=W.useState(r),[_,z]=W.useState(null),[L,k]=W.useState(null),R=W.useCallback(async(A,p=Wn,y)=>{let H=kt(A,y);if(!H.success){z(H.warning??"Could not save token to secure storage."),m("error");return}Za(A,p),c?.(),n("GitHub Copilot onboard complete. Copilot token stored in secure storage and as the active /provider profile.",{display:"user"})},[c,n]),N=W.useCallback(async()=>{m("device-busy"),z(null),k(null);try{let A=await zt();k({user_code:A.user_code,verification_uri:A.verification_uri}),await At(A.verification_uri);let p=await Rt(A.device_code,{initialInterval:A.interval,timeoutSeconds:A.expires_in}),y=await _t(p);await R(y.token,Wn,p)}catch(A){z(A instanceof Error?A.message:String(A)),m("error")}},[R]);if(e==="already-authed")return C(w,{flexDirection:"column",gap:1,children:[h(o,{bold:!0,children:"GitHub Copilot"}),h(o,{children:"You are already signed in to GitHub Copilot."}),h(o,{dimColor:!0,children:'Choose "Sign in again" to refresh your token, or go back to the provider menu.'}),h(G,{options:[{label:"Sign in again",value:"sign-in-again"},{label:a?"Back to /provider menu":"Cancel",value:"back"}],onChange:(p)=>{if(p==="sign-in-again"){N();return}if(a){a();return}n("GitHub onboard cancelled",{display:"system"})}})]});if(e==="error"&&_)return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"red",children:_}),h(G,{options:[{label:a?"Back to /provider menu":"Back to menu",value:"back"},{label:"Exit",value:"exit"}],onChange:(p)=>{if(p==="back"){if(a){a();return}m("menu"),z(null);return}n("GitHub onboard cancelled",{display:"system"})}})]});if(e==="device-busy")return C(w,{flexDirection:"column",gap:1,children:[h(o,{children:"GitHub Copilot sign-in"}),L?C(yn,{children:[C(o,{children:["Enter code ",h(o,{bold:!0,children:L.user_code})," at"," ",L.verification_uri]}),h(o,{dimColor:!0,children:"A browser window may have opened. Waiting for authorization..."})]}):h(o,{dimColor:!0,children:"Requesting device code from GitHub..."}),h(qt,{})]});return C(w,{flexDirection:"column",gap:1,children:[h(o,{bold:!0,children:"GitHub Copilot setup"}),h(o,{dimColor:!0,children:"Stores your token in the OS credential store (macOS Keychain when available) and creates a /provider profile so Copilot is the active provider — no manual env exports required."}),h(G,{options:[{label:"Sign in with browser",value:"device"},{label:a?"Back to /provider menu":"Cancel",value:"cancel"}],onChange:(A)=>{if(A==="cancel"){if(a){a();return}n("GitHub onboard cancelled",{display:"system"});return}N()}})]})}var W,Wn="github:copilot",Ja="https://api.githubcopilot.com";var Lt=v(()=>{Xa();Ha();Ot();Qa();pt();wt();Sn();W=Pn(In(),1)});function $t(n){return[n.name,n.family??"",...n.families??[],n.parameterSize??"",n.quantizationLevel??""].join(" ").toLowerCase()}function Cn(n,a){return a.some((c)=>n.includes(c))}function Wa(n){return!Cn($t(n),Nt)}function Pa(n){return n.find(Wa)??null}function xn(n){let c=`${n.parameterSize??""} ${n.name}`.toLowerCase().match(/(\d+(?:\.\d+)?)\s*b\b/);if(c?.[1])return Number(c[1]);if(typeof n.sizeBytes==="number"&&n.sizeBytes>0)return Number((n.sizeBytes/1e9).toFixed(1));return null}function Ia(n){return(n.quantizationLevel??n.name).toLowerCase()}function xa(n,a,c){if(n===null)return c.push("unknown size"),0;if(a==="latency"){if(n<=4)return c.push("tiny model for low latency"),32;if(n<=8)return c.push("small model for fast responses"),26;if(n<=14)return c.push("mid-sized model with acceptable latency"),16;if(n<=24)return c.push("larger model may be slower"),8;return c.push("large model likely slower locally"),n<=40?0:-8}if(a==="coding"){if(n>=7&&n<=14)return c.push("strong coding size tier"),24;if(n>14&&n<=34)return c.push("large coding-capable size tier"),28;if(n>34)return c.push("very large model with higher quality potential"),18;return c.push("compact model may trade off coding depth"),12}if(n>=7&&n<=14)return c.push("great balanced size tier"),26;if(n>=3&&n<7)return c.push("compact balanced size tier"),18;if(n>14&&n<=24)return c.push("high quality balanced size tier"),20;if(n>24)return c.push("large model for quality-first usage"),10;return c.push("very small model for general usage"),8}function ja(n,a,c){let r=Ia(n);if(r.includes("q4"))return c.push("efficient Q4 quantization"),a==="latency"?8:4;if(r.includes("q5"))return c.push("balanced Q5 quantization"),a==="latency"?6:5;if(r.includes("q8"))return c.push("higher quality Q8 quantization"),a==="latency"?2:5;return 0}function Ba(n,a,c){if(a.score!==n.score)return a.score-n.score;let r=xn(n)??Number.POSITIVE_INFINITY,e=xn(a)??Number.POSITIVE_INFINITY;if(c==="latency")return r-e;if(c==="coding")return e-r;let m=14;return Math.abs(r-m)-Math.abs(e-m)}function jn(n,a){return n.map((c)=>{let r=$t(c),e=[],m=0;if(Cn(r,Nt))m-=40,e.push("not a chat-first model");if(Cn(r,Ka))m+=a==="coding"?24:a==="balanced"?10:4,e.push("coding-oriented model family");if(Cn(r,Ea))m+=a==="latency"?4:a==="coding"?6:8,e.push("strong general-purpose model family");if(Cn(r,Ua))m+=a==="latency"?2:6,e.push("chat/instruct tuned");if(r.includes("vision")||r.includes("vl"))m-=2,e.push("vision model adds extra overhead");m+=xa(xn(c),a,e),m+=ja(c,a,e);let _=e.slice(0,3).join(", ");return{...c,score:m,reasons:e,summary:_}}).sort((c,r)=>Ba(c,r,a))}function Mt(n,a){return Pa(jn(n,a))}var Ka,Ea,Ua,Nt;var Tt=v(()=>{Ka=["coder","codellama","codegemma","codestral","devstral","starcoder","deepseek-coder","qwen2.5-coder","qwen-coder"],Ea=["llama","qwen","mistral","gemma","phi","deepseek"],Ua=["instruct","chat","assistant"],Nt=["embed","embedding","rerank","bge","whisper"]});function va(n){let a=n.toLowerCase();return Da.some((c)=>a.includes(c))}function Bn(n){try{let a=new URL(n);if(a.username)a.username="redacted";if(a.password)a.password="redacted";for(let c of a.searchParams.keys())if(va(c))a.searchParams.set(c,"redacted");return a.toString()}catch{return n.replace(/\/\/[^/@\s]+(?::[^/@\s]*)?@/g,"//redacted@").replace(/([?&](?:token|access_token|refresh_token|api_key|apikey|key|password|passwd|pwd|auth|authorization|signature|sig|secret)=)[^&#]*/gi,"$1redacted")}}var Da;var Ft=v(()=>{Da=["api_key","apikey","key","token","access_token","refresh_token","signature","sig","secret","password","passwd","pwd","auth","authorization"]});function cc(n){let a=`http://localhost:${n.port}/auth/callback`,c=new URL(`${vn}/oauth/authorize`);return c.searchParams.append("response_type","code"),c.searchParams.append("client_id",nt()),c.searchParams.append("redirect_uri",a),c.searchParams.append("scope",Vt),c.searchParams.append("code_challenge",n.codeChallenge),c.searchParams.append("code_challenge_method","S256"),c.searchParams.append("id_token_add_organizations","true"),c.searchParams.append("codex_cli_simplified_flow","true"),c.searchParams.append("state",n.state),c.searchParams.append("originator",Yt),c.toString()}function uc(){return`<!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>Codex Login Complete</title>
6
+ <style>
7
+ body { font-family: sans-serif; padding: 32px; line-height: 1.5; color: #111827; }
8
+ h1 { margin: 0 0 12px; font-size: 22px; }
9
+ p { margin: 0 0 10px; }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <h1>Codex login complete</h1>
14
+ <p>You can return to Claudin now.</p>
15
+ <p>Claudin will finish activating your new Codex OAuth login.</p>
16
+ </body>
17
+ </html>`}function hc(n){return`<!doctype html>
18
+ <html lang="en">
19
+ <head>
20
+ <meta charset="utf-8" />
21
+ <title>Codex Login Failed</title>
22
+ <style>
23
+ body { font-family: sans-serif; padding: 32px; line-height: 1.5; color: #111827; }
24
+ h1 { margin: 0 0 12px; font-size: 22px; color: #991b1b; }
25
+ p { margin: 0 0 10px; }
26
+ </style>
27
+ </head>
28
+ <body>
29
+ <h1>Codex login failed</h1>
30
+ <p>${Xt(n)}</p>
31
+ <p>You can close this window and try again in Claudin.</p>
32
+ </body>
33
+ </html>`}function Gt(){return`<!doctype html>
34
+ <html lang="en">
35
+ <head>
36
+ <meta charset="utf-8" />
37
+ <title>Codex Login Cancelled</title>
38
+ <style>
39
+ body { font-family: sans-serif; padding: 32px; line-height: 1.5; color: #111827; }
40
+ h1 { margin: 0 0 12px; font-size: 22px; }
41
+ p { margin: 0 0 10px; }
42
+ </style>
43
+ </head>
44
+ <body>
45
+ <h1>Codex login cancelled</h1>
46
+ <p>You can close this window and retry in Claudin.</p>
47
+ </body>
48
+ </html>`}async function oc(n){let a=`http://localhost:${n.port}/auth/callback`,c=new URLSearchParams({grant_type:"authorization_code",code:n.authorizationCode,redirect_uri:a,client_id:nt(),code_verifier:n.codeVerifier}),r=await fetch(`${vn}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:c,signal:n.signal?AbortSignal.any([n.signal,AbortSignal.timeout(15000)]):AbortSignal.timeout(15000)});if(!r.ok){let k=await r.text().catch(()=>"");throw Error(k.trim()?`Codex OAuth token exchange failed (${r.status}): ${k.trim()}`:`Codex OAuth token exchange failed with status ${r.status}.`)}let e=await r.json(),m=Ln(e.access_token),_=Ln(e.refresh_token);if(!m||!_)throw Error("Codex OAuth completed, but the token response was missing credentials.");let z=Ln(e.id_token);return{apiKey:z?await Ht(z).catch(()=>{return}):void 0,accessToken:m,refreshToken:_,idToken:z,accountId:Dn(z)??Dn(m)}}class tt{authCodeListener=null;port=null;tokenExchangeAbortController=null;buildCancellationError(){return Error("Codex OAuth flow was cancelled.")}async startOAuthFlow(n){let a=Zt(),c=Qt(),r=new Jt("/auth/callback");this.authCodeListener=r,this.port=null;try{let e=await r.start(c);this.port=e;let m=Et(),_=await Kt(a),z=cc({port:e,codeChallenge:_,state:m});try{let L=await r.waitForAuthorization(m,async()=>{await n(z)}),k=new AbortController;this.tokenExchangeAbortController=k;let R;try{R=await oc({authorizationCode:L,codeVerifier:a,port:e,signal:k.signal})}finally{if(this.tokenExchangeAbortController===k)this.tokenExchangeAbortController=null}if(this.authCodeListener!==r)throw this.buildCancellationError();return r.handleSuccessRedirect([],(N)=>{N.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),N.end(uc())}),R}catch(L){let k=this.authCodeListener===r?L:this.buildCancellationError();if(r.hasPendingResponse()){let R=k instanceof Error&&k.message==="Codex OAuth flow was cancelled.";r.handleErrorRedirect((N)=>{N.writeHead(R?200:400,{"Content-Type":"text/html; charset=utf-8"}),N.end(R?Gt():hc(k instanceof Error?k.message:String(k)))})}throw k}finally{this.cleanup()}}catch(e){let m=e instanceof Error?e.message:String(e);if(m.includes("EADDRINUSE")||m.includes(String(c)))throw Error(`Codex OAuth needs localhost:${c} for its callback. Close any app already using that port and try again.`);throw e}}cleanup(){let n=this.buildCancellationError();if(this.tokenExchangeAbortController?.abort(n),this.tokenExchangeAbortController=null,this.authCodeListener?.hasPendingResponse())this.authCodeListener.handleErrorRedirect((a)=>{a.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),a.end(Gt())});this.authCodeListener?.cancelPendingAuthorization(n),this.authCodeListener=null,this.port=null}}var Ut=v(()=>{tc();ac();nc()});function lc(){return new tt}function jt(n){let{onAuthenticated:a}=n,c=n.deps?.createOAuthService??lc,r=n.deps?.openBrowser??xt,e=n.deps?.saveCodexCredentials??Pt,m=n.deps?.isBareMode??bn,[_,z]=Nn.useState({state:"starting"});return Nn.useEffect(()=>{if(m()){z({state:"error",message:"Codex OAuth is unavailable in --bare because secure storage is disabled."});return}let L=!1,k=c();return k.startOAuthFlow(async(R)=>{if(L)return;z({state:"waiting",authUrl:R,browserOpened:null});let N=await r(R);if(L)return;z({state:"waiting",authUrl:R,browserOpened:N})}).then(async(R)=>{if(L)return;await a(R,(on)=>{let A=e({apiKey:R.apiKey,accessToken:R.accessToken,refreshToken:R.refreshToken,idToken:R.idToken,accountId:R.accountId,profileId:on?.profileId});if(!A.success)throw Error(A.warning??"Codex OAuth succeeded, but credentials could not be saved securely.")})}).catch((R)=>{if(L)return;z({state:"error",message:R instanceof Error?R.message:String(R)})}),()=>{L=!0,k.cleanup()}},[c,m,a,r,e]),_}var Nn;var Bt=v(()=>{Ut();rc();It();Wt();Nn=Pn(In(),1)});function qc(n){return{name:n.name,baseUrl:n.baseUrl,model:n.model,apiKey:n.apiKey??""}}function Sc(n){let a=Fn(n);return{name:a.name,baseUrl:a.baseUrl,model:a.model,apiKey:a.apiKey??""}}function Lc(n){let a={};for(let c of n.split(/\r?\n/)){let r=c.trim();if(!r)continue;let e=r.indexOf(":");if(e<=0)continue;let m=r.slice(0,e).trim(),_=r.slice(e+1).trim();if(m&&_)a[m]=_}return a}function Nc(n){if(!n)return"";return Object.entries(n).map(([a,c])=>`${a}: ${c}`).join(`
49
+ `)}function $c(n,a){let c={},r=n.awsRegion?.trim();if(r)c.awsRegion=r;let e=n.gcpProject?.trim();if(e)c.gcpProject=e;let m=n.gcpRegion?.trim();if(m)c.gcpRegion=m;let _=n.azureResource?.trim();if(_)c.azureResource=_;let z=Lc(a);if(Object.keys(z).length>0)c.customHeaders=z;return Object.keys(c).length>0?c:void 0}function Tc(n,a){let c=a?" (active)":"",r=n.apiKey?"key set":"no key",e=n.provider==="anthropic"?"anthropic":"openai-compatible",m=vt(n.model),_=m.length<=3?m.join(", "):`${m[0]}, ${m[1]} + ${m.length-2} more`;return`${e} · ${n.baseUrl} · ${_} · ${r}${c}`}function Fc(n,a){if(n.state==="unreachable")return`Could not reach Atomic Chat at ${Bn(a)}. Start the Atomic Chat app first, or enter the endpoint manually.`;if(n.state==="no_models")return"Atomic Chat is running, but no models are loaded. Download and load a model inside the Atomic Chat app first, or enter details manually.";return""}function Gc(n,a){if(n.state==="unreachable")return`Could not reach Ollama at ${Bn(a)}. Start Ollama first, or enter the endpoint manually.`;if(n.state==="no_models")return"Ollama is running, but no installed models were found. Pull a chat model such as qwen2.5-coder:7b or llama3.1:8b first, or enter details manually.";if(n.state==="generation_failed"){let c=n.probeModel??"the selected model",r=n.detail?` Details: ${n.detail}.`:"";return`Ollama is reachable and models are installed, but a generation probe failed for ${c}.${r} Run "ollama run ${c}" once and retry, or enter details manually.`}return""}function at(n,a){if(!a)return;return n.find((c)=>c.id===a)}function Dt(n,a){return Boolean(n&&a&&n.id===a)}function Vc({onBack:n,onConfigured:a}){let c=s.useCallback(async(e,m)=>{await a(e,m)},[a]);hn("confirm:no",n,[n]);let r=jt({onAuthenticated:c});if(r.state==="error")return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"error",bold:!0,children:"Codex OAuth failed"}),h(o,{children:r.message}),h(o,{dimColor:!0,children:"Press Enter or Esc to go back."}),h(G,{options:[{value:"back",label:"Back",description:"Return to provider presets"}],onChange:n,onCancel:n,visibleOptionCount:1})]});return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:"Codex OAuth"}),h(o,{children:"Sign in with your ChatGPT account in the browser. Claudin will store the resulting Codex credentials securely and switch this session to the new Codex login when setup completes."}),r.state==="starting"?h(o,{dimColor:!0,children:"Starting local callback and preparing your browser..."}):r.browserOpened===!1?C(yn,{children:[h(o,{color:"warning",children:"Browser did not open automatically. Visit this URL to continue:"}),h(o,{children:r.authUrl})]}):r.browserOpened===!0?C(yn,{children:[h(o,{dimColor:!0,children:"Browser opened. Finish the ChatGPT sign-in there and this setup will complete automatically."}),h(o,{children:r.authUrl})]}):h(o,{dimColor:!0,children:"Opening your browser..."}),h(o,{dimColor:!0,children:"Press Esc to cancel and go back."})]})}function ku({mode:n,onDone:a}){let c=ua(),[r,e]=s.useState([]),[m,_]=s.useState(),[z,L]=s.useState(),[k,R]=s.useState(!1),[N,on]=s.useState(),A=s.useRef(0),[p,y]=s.useState(n==="first-run"?"select-preset":"menu"),[H,Gn]=s.useState(null),[it,et]=s.useState("openai"),[T,K]=s.useState(()=>Sc("ollama")),[Vn,On]=s.useState({}),[mt,Yn]=s.useState(""),[ia,ea]=s.useState(0),[ma,da]=s.useState(0),[Qn,dt]=s.useState(null),[I,rn]=s.useState(0),[x,E]=s.useState(0),[sa,U]=s.useState(0),[st,S]=s.useState(),[j,O]=s.useState(),[ya,Ca]=s.useState(),[yt,zn]=s.useState(!1),[ln,en]=s.useState(),[J,Rn]=s.useState({state:"idle"}),[Z,An]=s.useState({state:"idle"}),[ba,ga]=s.useState(!0),[wa,Y]=s.useState(!1),Xn=s.useRef(!1),[Hn,Jn]=s.useState(()=>wn()),[Ct,Oa]=s.useState(()=>ra());s.useEffect(()=>{queueMicrotask(()=>{let t=P(),u=Q()?.id;e(t),_(u),L($n()),on(ct()),R(gn()),ga(!1)})},[]);let B=tn[x]??tn[0],_n=B.key,za=T[_n],Zn=r.length>0,fn=Zn,bt=s.useMemo(()=>[{value:"add",label:"Add provider",description:"Create a new provider profile"},...Hn?[{value:"import-legacy",label:"Import from Claude Code",description:"Copy ~/.claude/ tokens, settings, skills, agents, plugins."}]:[],{value:"activate",label:"Set active provider (Global)",description:N?`Currently: ${r.find((t)=>t.id===N)?.name??"unknown"}`:"Default profile for projects without an override",disabled:!fn},{value:"activate-project",label:"Set active provider (Project)",description:z?`Currently: ${r.find((t)=>t.id===z)?.name??"unknown"} (this project)`:"Override the global default for this project only",disabled:!fn},...k?[{value:"clear-project-override",label:"Clear project provider override",description:z?"Stop overriding for this project; fall back to global":"Project override points to a missing profile; clear it"}]:[],{value:"edit",label:"Edit provider",description:"Update URL, model, or key",disabled:!Zn},{value:"delete",label:"Delete provider",description:"Remove a provider profile",disabled:!fn},...yt?[{value:"logout-codex-oauth",label:"Log out Codex OAuth",description:"Clear securely stored Codex OAuth credentials"}]:[],{value:"done",label:"Done",description:"Return to chat"}],[fn,Zn,yt,Hn,N,z,r]),Kn=s.useCallback(()=>{if(bn()){A.current+=1,zn(!1),en(void 0);return}let t=++A.current;(async()=>{let u=await ot();if(t!==A.current)return;zn(Boolean(u?.apiKey||u?.accessToken||u?.refreshToken||u?.idToken)),en(u?.profileId)})()},[]);s.useEffect(()=>{return Kn(),()=>{A.current+=1}},[Kn]),s.useEffect(()=>{if(p!=="select-ollama-model")return;let t=!1;return Rn({state:"loading"}),(async()=>{let u=await oa({baseUrl:T.baseUrl});if(u.state!=="ready"){if(!t)Rn({state:"unavailable",message:Gc(u,T.baseUrl)});return}let i=jn(u.models,"balanced"),l=Mt(u.models,"balanced");if(!t)Rn({state:"ready",defaultValue:l?.name??i[0]?.name,options:i.map((d)=>({label:d.name,value:d.name,description:d.summary}))})})(),()=>{t=!0}},[T.baseUrl,p]),s.useEffect(()=>{if(p!=="select-atomic-chat-model")return;let t=!1;return An({state:"loading"}),(async()=>{let u=await ha({baseUrl:T.baseUrl});if(u.state!=="ready"){if(!t)An({state:"unavailable",message:Fc(u,T.baseUrl)});return}if(!t)An({state:"ready",defaultValue:u.models[0],options:u.models.map((i)=>({label:i,value:i}))})})(),()=>{t=!0}},[T.baseUrl,p]);function $(){if(Xn.current)return;Xn.current=!0,queueMicrotask(()=>{let t=P();e(t),_(Q()?.id),L($n()),on(ct()),R(gn()),Kn(),Xn.current=!1})}function D(){return null}function En(t){if(t.activationWarning)return`${t.prefix}. Saved for next startup. Warning: ${t.warnings.join("; ")}.`;if(t.warnings.length>0)return`${t.prefix}. Claudin switched to it for this session with warnings: ${t.warnings.join("; ")}.`;return`${t.prefix}. Claudin switched to it for this session.`}async function Un(t){if(t?.accessToken&&t.accountId)return null;let u=await ot();if(!u)return"stored Codex OAuth credentials could not be loaded";if(!u.accountId)return"stored Codex OAuth credentials are missing a ChatGPT account id";return null}function gt(){ca()}async function Ra(t){let u="provider";Y(!0),S("Activating provider...");try{await new Promise((mn)=>queueMicrotask(mn));let i=gn(),l=sn(t);if(!l){O("Could not change active provider."),Y(!1),f();return}let d=i?Q()??l:l,b=cn(d.model);if(!i)c((mn)=>({...mn,mainLoopModel:b,mainLoopModelForSession:null}));u=l.name;let g=D(),F=Dt(l,ln),q=F?await Un():null;$();let V=i&&d.id!==l.id?` (project override still active — this project keeps using ${d.name}; use "Clear project provider override" to apply the new default here)`:"",X=F?En({prefix:`Active provider: ${l.name}${V}`,activationWarning:q,warnings:[q,g?`could not clear startup provider override (${g})`:null].filter((mn)=>Boolean(mn))}):g?`Active provider: ${l.name}${V}. Warning: could not clear startup provider override (${g}).`:`Active provider: ${l.name}${V}`;S(X),Y(!1),a({action:"activated",activeProfileId:l.id,activeProviderName:l.name,activeProviderModel:b,message:`Provider switched to ${l.name} (${b})`}),f()}catch(i){$(),S(void 0),Y(!1);let l=i instanceof Error?i.message:String(i);O(`Could not finish activating ${u}: ${l}`),f()}}async function Aa(){Y(!0),S("Clearing project provider override...");try{await new Promise((u)=>queueMicrotask(u)),ut(null),$();let t=Q();if(t){let u=cn(t.model);un(),c((i)=>({...i,mainLoopModel:u,mainLoopModelForSession:null})),S(`Project override cleared. Using global default: ${t.name}.`),Y(!1),a({action:"activated",activeProfileId:t.id,activeProviderName:t.name,activeProviderModel:u,message:`Project override cleared — using ${t.name} (${u})`}),f()}else S("Project provider override cleared. No global default set."),Y(!1),a({action:"saved",message:"Project provider override cleared. No global default set."}),f()}catch(t){$(),S(void 0),Y(!1);let u=t instanceof Error?t.message:String(t);O(`Could not clear project provider override: ${u}`),f()}}async function _a(t){let u="provider";Y(!0),S("Setting provider for this project...");try{await new Promise((X)=>queueMicrotask(X));let i=$n(),l=ut(t);if(!l){O("Could not set project provider override."),Y(!1),f();return}let d=cn(l.model);if(i===l.id)un();c((X)=>({...X,mainLoopModel:d,mainLoopModelForSession:null})),u=l.name;let b=D(),g=Dt(l,ln),F=g?await Un():null;$();let q=`Active provider for this project: ${l.name}. Other projects keep the global default.`,V=g?En({prefix:q,activationWarning:F,warnings:[F,b?`could not clear startup provider override (${b})`:null].filter((X)=>Boolean(X))}):b?`${q} Warning: could not clear startup provider override (${b}).`:q;S(V),Y(!1),a({action:"activated",activeProfileId:l.id,activeProviderName:l.name,activeProviderModel:d,message:`Provider switched to ${l.name} (${d}) for this project`}),f()}catch(i){$(),S(void 0),Y(!1);let l=i instanceof Error?i.message:String(i);O(`Could not finish setting ${u} for this project: ${l}`),f()}}function f(){Ca("done"),y("menu")}function kn(t){a({action:"cancelled",message:t})}function fa(t){let u=Fn(t),i={name:u.name,baseUrl:u.baseUrl,model:u.model,apiKey:u.apiKey??""};if(Gn(null),et(u.provider??"openai"),K(i),On({}),Yn(""),dt(t),E(0),rn(0),U(i.name.length),O(void 0),t==="ollama"){Rn({state:"loading"}),y("select-ollama-model");return}if(t==="atomic-chat"){An({state:"loading"}),y("select-atomic-chat-model");return}if(t==="anthropic"){y("anthropic-auth-choice");return}if(t==="bedrock"||t==="vertex"||t==="foundry"){y("cloud-extras");return}y("form")}function ka(t){let u=r.find((l)=>l.id===t);if(!u)return;let i=qc(u);Gn(t),et(u.provider??"openai"),K(i),On({awsRegion:u.extras?.awsRegion,gcpProject:u.extras?.gcpProject,gcpRegion:u.extras?.gcpRegion,azureResource:u.extras?.azureResource}),Yn(Nc(u.extras?.customHeaders)),dt(null),E(0),rn(0),U(i.name.length),O(void 0),y("form")}function pn(t=T){let u=$c(Vn,mt),i={provider:it,name:t.name,baseUrl:t.baseUrl,model:t.model,apiKey:t.apiKey,extras:u},l=H?dn(H,i):nn(i,{makeActive:!0});if(!l){O("Could not save provider. Fill all required fields.");return}let d=Q()?.id===l.id;if(d)un(),c((V)=>({...V,mainLoopModel:cn(l.model),mainLoopModelForSession:null}));let b=d?D():null;$();let g=!H&&gn()&&!d,F=g?Q()?.name??"override target":null,q=H?`Updated provider: ${l.name}`:g?`Added provider: ${l.name} (now global default — project keeps using ${F}; use "Clear project provider override" to apply here)`:`Added provider: ${l.name} (now active)`;if(S(b?`${q}. Warning: could not clear startup provider override (${b}).`:q),n==="first-run"){a({action:"saved",activeProfileId:l.id,message:`Provider configured: ${l.name}`});return}Gn(null),E(0),O(void 0),f()}function pa(){if(Z.state==="loading"||Z.state==="idle")return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:"Checking Atomic Chat"}),h(o,{dimColor:!0,children:"Looking for loaded Atomic Chat models..."})]});if(Z.state==="unavailable")return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:"Atomic Chat setup"}),h(o,{dimColor:!0,children:Z.message}),h(G,{options:[{value:"manual",label:"Enter manually",description:"Fill in the base URL and model yourself"},{value:"back",label:"Back",description:"Choose another provider preset"}],onChange:(t)=>{if(t==="manual"){E(0),U(T.name.length),y("form");return}y("select-preset")},onCancel:()=>y("select-preset"),visibleOptionCount:2})]});return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:"Choose an Atomic Chat model"}),h(o,{dimColor:!0,children:"Pick one of the models loaded in Atomic Chat to save into a local provider profile."}),h(G,{options:Z.options,defaultValue:Z.defaultValue,defaultFocusValue:Z.defaultValue,inlineDescriptions:!0,visibleOptionCount:Math.min(8,Z.options.length),onChange:(t)=>{let u={...T,model:t};K(u),pn(u)},onCancel:()=>y("select-preset")})]})}function qa(){if(J.state==="loading"||J.state==="idle")return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:"Checking Ollama"}),h(o,{dimColor:!0,children:"Looking for installed Ollama models..."})]});if(J.state==="unavailable")return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:"Ollama setup"}),h(o,{dimColor:!0,children:J.message}),h(G,{options:[{value:"manual",label:"Enter manually",description:"Fill in the base URL and model yourself"},{value:"back",label:"Back",description:"Choose another provider preset"}],onChange:(t)=>{if(t==="manual"){E(0),U(T.name.length),y("form");return}y("select-preset")},onCancel:()=>y("select-preset"),visibleOptionCount:2})]});return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:"Choose an Ollama model"}),h(o,{dimColor:!0,children:"Pick one of the installed Ollama models to save into a local provider profile."}),h(G,{options:J.options,defaultValue:J.defaultValue,defaultFocusValue:J.defaultValue,inlineDescriptions:!0,visibleOptionCount:Math.min(8,J.options.length),onChange:(t)=>{let u={...T,model:t};K(u),pn(u)},onCancel:()=>y("select-preset")})]})}function Sa(t){let u=t.trim();if(!B.optional&&u.length===0){O(`${B.label} is required.`);return}let i={...T,[_n]:u};if(K(i),O(void 0),x<tn.length-1){let l=x+1,d=tn[l]?.key??"name";E(l),U(i[d].length);return}if((Qn==="anthropic"||Qn==="custom")&&p==="form"){K(i),y("custom-headers");return}pn(i)}function La(){if(O(void 0),x>0){let t=x-1,u=tn[t]?.key??"name";E(t),U(T[u].length);return}if(n==="first-run"){y("select-preset");return}f()}hn("confirm:no",La,{context:"Settings",isActive:p==="form"});function Na(){if(O(void 0),I>0){rn(I-1);return}y("select-preset")}hn("confirm:no",Na,{context:"Settings",isActive:p==="cloud-extras"}),hn("confirm:no",()=>y("form"),{context:"Settings",isActive:p==="custom-headers"}),hn("confirm:no",()=>y("select-preset"),{context:"Settings",isActive:p==="anthropic-auth-choice"||p==="anthropic-oauth"});function $a(){let t=!bn(),u=[...Hn?[{value:"import-legacy",label:"Import from Claude Code",description:"Reuse ~/.claude/ tokens, settings, theme, MCP, skills, agents, plugins."}]:[],{value:"dashscope-intl",label:"Alibaba Coding Plan",description:"Alibaba DashScope International endpoint"},{value:"dashscope-cn",label:"Alibaba Coding Plan (China)",description:"Alibaba DashScope China endpoint"},{value:"anthropic",label:"Anthropic",description:"Native Claude API (x-api-key auth)"},{value:"atomic-chat",label:"Atomic Chat",description:"Local Model Provider"},{value:"azure-openai",label:"Azure OpenAI",description:"Azure OpenAI endpoint (model=deployment name)"},{value:"foundry",label:"Azure AI Foundry",description:"Anthropic models hosted on Azure AI Foundry (resource-scoped)"},{value:"bedrock",label:"AWS Bedrock",description:"Anthropic models on AWS Bedrock (region-scoped, AWS creds)"},{value:"bankr",label:"Bankr",description:"Bankr LLM Gateway (OpenAI-compatible)"},...t?[{value:"codex-oauth",label:"Codex OAuth",description:"Sign in with ChatGPT in your browser and store Codex credentials securely"}]:[],{value:"github-onboard",label:"GitHub Copilot",description:"Sign in with GitHub in your browser to use Copilot models"},{value:"deepseek",label:"DeepSeek",description:"DeepSeek OpenAI-compatible endpoint"},{value:"gemini",label:"Google Gemini",description:"Gemini OpenAI-compatible endpoint"},{value:"vertex",label:"Google Vertex AI",description:"Anthropic models on Vertex AI (project + region, ADC)"},{value:"groq",label:"Groq",description:"Groq OpenAI-compatible endpoint"},{value:"lmstudio",label:"LM Studio",description:"Local LM Studio endpoint"},{value:"minimax",label:"MiniMax",description:"MiniMax API endpoint"},{value:"mistral",label:"Mistral",description:"Mistral OpenAI-compatible endpoint"},{value:"moonshotai",label:"Moonshot AI - API",description:"Moonshot AI - API endpoint"},{value:"kimi-code",label:"Moonshot AI - Kimi Code",description:"Moonshot AI - Kimi Code Subscription endpoint"},{value:"nvidia-nim",label:"NVIDIA NIM",description:"NVIDIA NIM endpoint"},{value:"opencode-go",label:"OpenCode GO",description:"OpenCode GO OpenAI-compatible endpoint"},{value:"opencode-zen",label:"OpenCode Zen",description:"OpenCode Zen OpenAI-compatible endpoint"},{value:"ollama",label:"Ollama",description:"Local or remote Ollama endpoint"},{value:"openai",label:"OpenAI",description:"OpenAI API with API key"},{value:"openrouter",label:"OpenRouter",description:"OpenRouter OpenAI-compatible endpoint"},{value:"together",label:"Together AI",description:"Together chat/completions endpoint"},{value:"custom",label:"Custom",description:"Any OpenAI-compatible provider"},...n==="first-run"?[{value:"skip",label:"Skip for now",description:"Continue with current defaults"}]:[]];return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:n==="first-run"?"Set up provider":"Choose provider preset"}),h(o,{dimColor:!0,children:"Pick a preset, then confirm base URL, model, and API key."}),h(G,{options:u,onChange:(i)=>{if(i==="skip"){kn("Provider setup skipped");return}if(i==="codex-oauth"){y("codex-oauth");return}if(i==="github-onboard"){y("github-onboard");return}if(i==="import-legacy"){(async()=>{let l=await lt({force:!0});Jn(wn()),$();let d=Tn(l);if(l.errors.length>0){O(d);return}let b=Q();if(n==="first-run"&&b){a({action:"saved",activeProfileId:b.id,activeProviderName:b.name,activeProviderModel:b.model,message:d});return}if(S(d),O(void 0),n==="manage")f()})();return}fa(i)},onCancel:()=>{if(n==="first-run"){kn("Provider setup skipped");return}f()},visibleOptionCount:Math.min(13,u.length)})]})}function Ma(){return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:"Anthropic — choose authentication"}),h(o,{dimColor:!0,children:"Sign in with your Anthropic account in the browser, or paste an API key."}),h(G,{options:[{value:"oauth",label:"Sign in with web (OAuth)",description:"Open a browser, sign in to Claude, and store tokens in ~/.claudin/.credentials.json"},{value:"apiKey",label:"Use API key",description:"Paste an x-api-key value (sk-ant-…)"},{value:"back",label:"Back",description:"Choose a different provider"}],onChange:(t)=>{if(t==="oauth"){y("anthropic-oauth");return}if(t==="apiKey"){y("form");return}y("select-preset")},onCancel:()=>y("select-preset"),visibleOptionCount:3})]})}function Ta(){let t=(Rc(),ic(zc)).ConsoleOAuthFlow;return h(w,{flexDirection:"column",gap:1,children:h(t,{mode:"login",onDone:()=>{let u=Fn("anthropic"),i={provider:"anthropic",name:u.name,baseUrl:u.baseUrl,model:u.model},l=nn(i,{makeActive:!0});if(!l){O("OAuth completed, but the Anthropic profile could not be saved."),y("select-preset");return}let d=`Anthropic OAuth configured: ${l.name}`;if($(),n==="first-run"){a({action:"saved",activeProfileId:l.id,message:d});return}S(d),O(void 0),f()}})})}function Fa(){let t=Qn;if(t!=="bedrock"&&t!=="vertex"&&t!=="foundry")return null;let u=Mc[t],i=u[I]??u[0],l=Vn[i.key]??"";function d(b){let g=b.trim();if(g.length===0){O(`${i.label} is required.`);return}let F={...Vn,[i.key]:g};if(On(F),O(void 0),I<u.length-1){rn(I+1);return}rn(0),y("form")}return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:`${t==="bedrock"?"AWS Bedrock":t==="vertex"?"Google Vertex AI":"Azure AI Foundry"} setup`}),h(o,{dimColor:!0,children:i.helpText}),C(o,{dimColor:!0,children:["Step ",I+1," of ",u.length,": ",i.label]}),C(w,{flexDirection:"row",gap:1,children:[h(o,{children:an.pointer}),h(Mn,{value:l,onChange:(b)=>On((g)=>({...g,[i.key]:b})),onSubmit:d,focus:!0,showCursor:!0,placeholder:`${i.placeholder}${an.ellipsis}`,columns:80,cursorOffset:ia,onChangeCursorOffset:ea})]}),j&&h(o,{color:"error",children:j}),h(o,{dimColor:!0,children:"Press Enter to continue. Press Esc to go back."})]})}function Ga(){return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:"Custom headers (optional)"}),C(o,{dimColor:!0,children:["Add HTTP headers sent on every request. One header per line as"," ",h(o,{children:"Header: Value"}),". Leave empty to skip."]}),C(w,{flexDirection:"row",gap:1,children:[h(o,{children:an.pointer}),h(Mn,{value:mt,onChange:Yn,onSubmit:()=>pn(T),focus:!0,showCursor:!0,placeholder:"X-Header: value",columns:80,multiline:!0,cursorOffset:ma,onChangeCursorOffset:da})]}),j&&h(o,{color:"error",children:j}),h(o,{dimColor:!0,children:"Press Enter on a blank line to save. Press Esc to go back."})]})}function Va(){return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:H?"Edit provider profile":"Create provider profile"}),h(o,{dimColor:!0,children:B.helpText}),C(o,{dimColor:!0,children:["Provider type:"," ",it==="anthropic"?"Anthropic native API":"OpenAI-compatible API"]}),C(o,{dimColor:!0,children:["Step ",x+1," of ",tn.length,": ",B.label]}),C(w,{flexDirection:"row",gap:1,children:[h(o,{children:an.pointer}),h(Mn,{value:za,onChange:(t)=>K((u)=>({...u,[_n]:t})),onSubmit:Sa,focus:!0,showCursor:!0,placeholder:`${B.placeholder}${an.ellipsis}`,mask:_n==="apiKey"?"*":void 0,columns:80,cursorOffset:sa,onChangeCursorOffset:U})]}),j&&h(o,{color:"error",children:j}),h(o,{dimColor:!0,children:"Press Enter to continue. Press Esc to go back."})]})}function Ya(){let t=r.length>0,u=t;return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:"Provider manager"}),h(o,{dimColor:!0,children:"Active profile controls base URL, model, and API key used by this session."}),st&&h(o,{children:st}),h(w,{flexDirection:"column",children:r.length===0?h(o,{dimColor:!0,children:"No provider profiles configured yet."}):r.map((i)=>C(o,{dimColor:!0,children:["- ",i.name,": ",Tc(i,i.id===m)]},i.id))}),h(G,{options:bt,onChange:(i)=>{switch(O(void 0),i){case"add":y("select-preset");break;case"import-legacy":{(async()=>{let l=await lt({force:!0});if(Jn(wn()),$(),l.errors.length>0)O(Tn(l));else S(Tn(l))})();break}case"activate":if(u)y("select-active");break;case"activate-project":if(u)y("select-active-project");break;case"clear-project-override":Aa();break;case"edit":if(t)y("select-edit");break;case"delete":if(u)y("select-delete");break;case"logout-codex-oauth":{let l=rt();if(!l.success){O(l.warning??"Could not clear Codex OAuth credentials.");break}zn(!1),en(void 0);let d=at(P(),ln),b=null;if(d){let g=ht(d.id);if(!g.removed){O("Codex OAuth credentials were cleared, but the Codex profile could not be removed."),$();break}gt(),b=g.activeProfileId?D():null}$(),S(b?`Codex OAuth logged out. Warning: could not clear startup provider override (${b}).`:"Codex OAuth logged out.");break}default:kn("Provider manager closed");break}},onCancel:()=>kn("Provider manager closed"),defaultFocusValue:ya,visibleOptionCount:bt.length})]})}function qn(t,u,i){let l=r.map((d)=>{let b=[];if(d.id===m)b.push("active");if(z&&d.id===z)b.push("this project");if(N&&d.id===N)b.push("global default");let g=b.length>0?` (${b.join(", ")})`:"";return{value:d.id,label:`${d.name}${g}`,description:`${d.provider==="anthropic"?"anthropic":"openai-compatible"} · ${d.baseUrl} · ${d.model}`}});if(l.length===0)return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:t}),h(o,{dimColor:!0,children:u}),h(G,{options:[{value:"back",label:"Back",description:"Return to provider manager"}],onChange:()=>f(),onCancel:()=>f(),visibleOptionCount:1})]});return C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:t}),h(G,{options:l,onChange:i,onCancel:()=>f(),visibleOptionCount:Math.min(10,Math.max(2,l.length))})]})}let M;switch(p){case"select-preset":M=$a();break;case"select-ollama-model":M=qa();break;case"select-atomic-chat-model":M=pa();break;case"codex-oauth":M=h(Vc,{onBack:()=>y("select-preset"),onConfigured:async(t,u)=>{let i={provider:"openai",name:kc,baseUrl:na,model:pc,apiKey:""},l=at(P(),ln),d=l?dn(l.id,i):nn(i,{makeActive:!0});if(!d){O("Codex OAuth login finished, but the provider profile could not be saved."),f();return}let b=l&&m!==d.id?sn(d.id):d;if(!b){O("Codex OAuth login finished, but the provider could not be set as the startup provider."),f();return}u({profileId:d.id});let g=D(),F=await Un(t);zn(!0),en(d.id),$();let q=[F,g?`could not clear startup provider override (${g})`:null].filter((X)=>Boolean(X)),V=En({prefix:"Codex OAuth configured",activationWarning:F,warnings:q});if(n==="first-run"){a({action:"saved",activeProfileId:b.id,message:V});return}S(V),O(void 0),f()}});break;case"github-onboard":M=h(St,{onDone:(t)=>{if(t)S(t),O(void 0);$(),f()},onBack:()=>y("select-preset"),onChangeAPIKey:$});break;case"anthropic-auth-choice":M=Ma();break;case"anthropic-oauth":M=Ta();break;case"cloud-extras":M=Fa();break;case"custom-headers":M=Ga();break;case"form":M=Va();break;case"select-active":M=qn("Set active provider (Global)","No providers available. Add one first.",(t)=>{Ra(t)});break;case"select-active-project":M=qn("Set active provider (Project)","No providers available. Add one first.",(t)=>{_a(t)});break;case"select-edit":M=qn("Edit provider","No providers available. Add one first.",(t)=>{ka(t)});break;case"select-delete":M=qn("Delete provider","No providers available. Add one first.",(t)=>{let u=r.find((g)=>g.id===t),i=u?.provider==="openai"&&u?.extras?.githubToken!==void 0,l=at(r,ln)?.id===t,d=Q()?.id===t,b=ht(t);if(!b.removed)O("Could not delete provider.");else{let g=[];if(l){let q=rt();if(!q.success)g.push(q.warning??"could not clear Codex OAuth credentials");else en(void 0);gt()}if(i){let q=aa();if(!q.success)g.push(q.warning??"could not clear GitHub Copilot token")}let F=b.activeProfileId?D():null;if(F)g.push(`could not clear startup provider override (${F})`);if($(),d){let q=Q();if(q)un(),c((V)=>({...V,mainLoopModel:cn(q.model),mainLoopModelForSession:null}));else un(),c((V)=>({...V,mainLoopModel:null,mainLoopModelForSession:null}))}S(g.length>0?`Provider deleted. Warning: ${g.join("; ")}.`:"Provider deleted")}f()});break;case"menu":default:M=Ya();break}return C(ta,{color:"permission",children:[h(la,{enabled:Ct,onDismiss:(t)=>{Jn(wn()),Oa(!1),$();let u=Q();if(t==="migrated"&&n==="first-run"&&u)a({action:"saved",activeProfileId:u.id,activeProviderName:u.name,activeProviderModel:u.model})}}),Ct?null:ba?C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:"Loading providers..."}),h(o,{dimColor:!0,children:"Reading provider profiles from disk."})]}):wa?C(w,{flexDirection:"column",gap:1,children:[h(o,{color:"remember",bold:!0,children:"Activating provider..."}),h(o,{dimColor:!0,children:"Please wait while the provider is being configured."})]}):M]})}var s,tn,kc="Codex OAuth",pc="codexplan",Mc;var Yc=v(()=>{ec();Lt();dc();Ot();sc();bc();Ac();It();Wt();mc();Cc();wt();pt();gc();Tt();Ft();Oc();yc();fc();wc();Bt();_c();Sn();s=Pn(In(),1),tn=[{key:"name",label:"Provider name",placeholder:"e.g. Ollama Home, OpenAI Work",helpText:"A short label shown in /provider and startup setup."},{key:"baseUrl",label:"Base URL",placeholder:"e.g. http://localhost:11434/v1",helpText:"API base URL used for this provider profile."},{key:"model",label:"Default model",placeholder:"e.g. llama3.1:8b or glm-4.7; glm-4.7-flash",helpText:'Model name(s) to use. Separate multiple with ";" or ","; first is default.'},{key:"apiKey",label:"API key",placeholder:"Leave empty if your provider does not require one",helpText:"Optional. Press Enter with empty value to skip.",optional:!0}];Mc={bedrock:[{key:"awsRegion",label:"AWS region",placeholder:"e.g. us-east-1",helpText:"Region of your Bedrock-enabled AWS account. Credentials are picked up from the AWS SDK chain."}],vertex:[{key:"gcpProject",label:"GCP project ID",placeholder:"e.g. my-project-123456",helpText:"Google Cloud project where Vertex AI is enabled. Credentials are picked up from ADC."},{key:"gcpRegion",label:"GCP region",placeholder:"e.g. us-central1",helpText:"Vertex AI region for the model."}],foundry:[{key:"azureResource",label:"Azure resource",placeholder:"e.g. my-foundry-resource",helpText:"Name of your Azure AI Foundry resource. Credentials are picked up from DefaultAzureCredential."}]}});
50
+ export{Bn as Rc,Ft as Sc,Lc as Tc,ku as Uc,Yc as Vc};
@@ -0,0 +1,5 @@
1
+ import{o as f}from"./cli-0.5.10-srd78kpc.mjs";import{ar as F,br as i}from"./cli-0.5.10-8jjacn05.mjs";import{$Q as e,YQ as T,aR as k,bR as z,gR as d}from"./cli-0.5.10-0ar26ct8.mjs";import{X3 as W,_3 as m,f4 as y,g4 as U,l4 as c}from"./cli-0.5.10-2yrgbmd1.mjs";import{x6 as Z,z6 as R}from"./cli-0.5.10-2fqes7gy.mjs";import{Ada as N,Bda as v,xda as V,zda as I}from"./cli-0.5.10-xrwj7982.mjs";import{Mda as E,Xda as b}from"./cli-0.5.10-rk7at2tn.mjs";import{Oea as q,Qea as h}from"./cli-0.5.10-y9qd4psg.mjs";import{Qfa as Y,Tfa as _,tfa as O,yfa as p}from"./cli-0.5.10-p4wmnjhz.mjs";import{Fga as w,vga as H}from"./cli-0.5.10-jsnrvena.mjs";import{Wma as S,mna as s}from"./cli-0.5.10-rwqvbtg3.mjs";import{Mna as u}from"./cli-0.5.10-1sd567wn.mjs";I();b();v();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 ≥100ms"},C=N(()=>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 BJ(){let J=E("tengu_bridge_poll_interval_config",j,300000),K=C().safeParse(J);return K.success?K.data:j}s();_();R();e();h();i();_();R();w();m();c();d();p();var g=`{"type":"keep_alive"}
2
+ `,t=1000,l=1000,D=30000,n=600000,r=1e4,o=300000,A=D*2,a=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(t)}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("./wrapper-0.5.10-0bca9c3g.mjs"),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&&a.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<n){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(l*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($)+`
3
+ `;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)+`
4
+ `;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 — 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")}}},r)}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(g),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")}},o)}stopKeepaliveInterval(){if(this.keepAliveInterval)clearInterval(this.keepAliveInterval),this.keepAliveInterval=null}}var JJ=100,KJ=15000,QJ=3000;class XJ extends L{postUrl;uploader;streamEventBuffer=[];streamEventTimer=null;constructor(J,K={},Q,X,$){super(J,K,Q,X,$);let{maxConsecutiveFailures:G,onBatchDropped:B}=$??{};this.postUrl=YJ(J),this.uploader=new f({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(),JJ);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,QJ)})]).finally(()=>{clearTimeout(K),J.close()}),super.close()}async postOnce(J){let K=T();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 S.post(this.postUrl,{events:J},{headers:Q,validateStatus:()=>!0,timeout:KJ})}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 YJ(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}`}
5
+ export{j as a,BJ as b,L as c,XJ as d};
@@ -0,0 +1,2 @@
1
+ import{Bt as u,Ct as g,Et as Wq,Ht as c,It as T,Jt as _q,Kt as r,Lt as Vq,am as S,bm as Zq,cm as V,dm as $q,gm as p,hO as a,hm as zq,jO as Uq,uD as h,wD as Fq}from"./cli-0.5.10-8jjacn05.mjs";import{fU as d,gU as Yq}from"./cli-0.5.10-z5ysspq8.mjs";import{TU as w,UU as Nq,dV as j,eV as Qq,fV as m,hV as Xq}from"./cli-0.5.10-dzr8kmx4.mjs";import{JX as Lq,UV as v,VV as H,WV as y,cX as J,eX as N}from"./cli-0.5.10-9xc8zhxg.mjs";import{lZ as _,mZ as q,nZ as G,oZ as B}from"./cli-0.5.10-gs8dx67v.mjs";import{pZ as Jq}from"./cli-0.5.10-9ek8f4vk.mjs";import{H$ as Gq,u$ as b}from"./cli-0.5.10-2fqes7gy.mjs";import{Hna as e,Lna as qq}from"./cli-0.5.10-1sd567wn.mjs";function mq({onThemeSelect:F,showIntroText:I=!1,helpText:X="",showHelpTextBelow:O=!1,hideEscToCancel:x=!1,skipExitHandling:$=!1,onCancel:A}){let[U]=v(),k=H(),{columns:l}=w(),Y=Q.useMemo(()=>c(),[]),Z=Y===null?T(U):null,{setPreviewTheme:K,savePreview:M,cancelPreview:R}=y(),z=u((L)=>L.settings.syntaxHighlightingDisabled??!1),E=g();j("ThemePicker",!0);let W=S("theme:toggleSyntaxHighlighting","ThemePicker","ctrl+t"),i=Q.useCallback(()=>{if(Y===null){let L=!z;b("userSettings",{syntaxHighlightingDisabled:L}),E((P)=>({...P,settings:{...P.settings,syntaxHighlightingDisabled:L}}))}},[Y,z,E]);m("theme:toggleSyntaxHighlighting",i,{context:"ThemePicker"});let f=d($?()=>{}:void 0),D=Q.useMemo(()=>[...[],{label:"Dark mode",value:"dark"},{label:"Light mode",value:"light"},{label:"Dark mode (colorblind-friendly)",value:"dark-daltonized"},{label:"Light mode (colorblind-friendly)",value:"light-daltonized"},{label:"Dark mode (ANSI colors only)",value:"dark-ansi"},{label:"Light mode (ANSI colors only)",value:"light-ansi"}],[]),o=Q.useCallback((L)=>{K(L)},[K]),n=Q.useCallback((L)=>{M(),F(L)},[M,F]),s=Q.useCallback(()=>{if(R(),$)A?.();else a(0)},[R,A,$]),t=Y==="env"?`Syntax highlighting disabled (via CLAUDE_CODE_SYNTAX_HIGHLIGHT=${process.env.CLAUDE_CODE_SYNTAX_HIGHLIGHT})`:z?`Syntax highlighting disabled (${W} to enable)`:Z?`Syntax theme: ${Z.theme}${Z.source?` (from ${Z.source})`:""} (${W} to disable)`:`Syntax highlighting enabled (${W} to disable)`,C=G(J,{flexDirection:"column",gap:1,children:[G(J,{flexDirection:"column",gap:1,children:[I?q(N,{children:"Let's get started."}):q(N,{bold:!0,color:"permission",children:"Theme"}),G(J,{flexDirection:"column",children:[q(N,{bold:!0,children:"Choose the text style that looks best with your terminal"}),X&&!O?q(N,{dimColor:!0,children:X}):null]}),q(h,{options:D,onFocus:o,onChange:n,onCancel:s,visibleOptionCount:D.length,defaultValue:k,defaultFocusValue:k})]}),G(J,{flexDirection:"column",width:"100%",children:[q(J,{flexDirection:"column",borderTop:!0,borderBottom:!0,borderLeft:!1,borderRight:!1,borderStyle:"dashed",borderColor:"subtle",children:q(Iq,{patch:Oq,dim:!1,filePath:"demo.js",firstLine:null,width:l})},U),G(N,{dimColor:!0,children:[" ",t]})]})]});if(!I)return G(_,{children:[q(J,{flexDirection:"column",children:C}),O&&X?q(J,{marginLeft:3,children:q(N,{dimColor:!0,children:X})}):null,!x?q(J,{marginTop:1,children:q(N,{dimColor:!0,italic:!0,children:f.pending?G(_,{children:["Press ",f.keyName," again to exit"]}):G(p,{children:[q(V,{shortcut:"Enter",action:"select"}),q(V,{shortcut:"Esc",action:"cancel"})]})})}):null]});return C}var Q,Iq,Oq;var Aq=qq(()=>{Yq();Nq();Lq();Qq();Xq();Zq();Wq();Uq();Gq();Fq();zq();$q();_q();Vq();B();Q=e(Jq(),1),Iq=r,Oq={oldStart:1,newStart:1,oldLines:3,newLines:3,lines:[" function greet() {",'- console.log("Hello, World!");','+ console.log("Hello, Claude!");'," }"]}});
2
+ export{mq as Xf,Aq as Yf};