@claudiolabs/claudin 1.0.0 → 1.0.4

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 (909) hide show
  1. package/cli-wrapper.cjs +132 -0
  2. package/dist/chunks/AgentTool-1.0.4-hb5yf83k.mjs +1 -0
  3. package/dist/chunks/App-1.0.4-ee5phav9.mjs +1 -0
  4. package/dist/chunks/ApproveApiKey-1.0.4-cc8qfn6m.mjs +1 -0
  5. package/dist/chunks/AssistantSessionChooser-1.0.4-k5b5pnrd.mjs +1 -0
  6. package/dist/chunks/AutoModeOptInDialog-1.0.4-jhajeb8a.mjs +1 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-1.0.4-9hz5azec.mjs +1 -0
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog-1.0.4-g51kch7p.mjs +1 -0
  9. package/dist/chunks/ConsoleOAuthFlow-1.0.4-29trpvey.mjs +1 -0
  10. package/dist/chunks/DiffDialog-1.0.4-j8p9yt42.mjs +7 -0
  11. package/dist/chunks/Doctor-1.0.4-wzrsp6wf.mjs +1 -0
  12. package/dist/chunks/ExplorerDialog-1.0.4-nestptq4.mjs +6 -0
  13. package/dist/chunks/Grove-1.0.4-7b2m2711.mjs +1 -0
  14. package/dist/chunks/ITermBackend-1.0.4-hqbevsrb.mjs +1 -0
  15. package/dist/chunks/InvalidConfigDialog-1.0.4-vtmbvxxd.mjs +1 -0
  16. package/dist/chunks/InvalidSettingsDialog-1.0.4-zreb0vxk.mjs +1 -0
  17. package/dist/chunks/MigrationDialog-1.0.4-ed1k11kd.mjs +1 -0
  18. package/dist/chunks/Onboarding-1.0.4-nq3j2bap.mjs +1 -0
  19. package/dist/chunks/ProviderManager-1.0.4-g7qy6jg1.mjs +1 -0
  20. package/dist/chunks/REPL-1.0.4-ne32y8dw.mjs +1 -0
  21. package/dist/chunks/ResumeConversation-1.0.4-fedwb24z.mjs +1 -0
  22. package/dist/chunks/SnapshotUpdateDialog-1.0.4-w95m7f1z.mjs +1 -0
  23. package/dist/chunks/TeleportProgress-1.0.4-ck0a2cmq.mjs +1 -0
  24. package/dist/chunks/TeleportRepoMismatchDialog-1.0.4-w37g1ssr.mjs +1 -0
  25. package/dist/chunks/TeleportResumeWrapper-1.0.4-tk09ztje.mjs +1 -0
  26. package/dist/chunks/TmuxBackend-1.0.4-a4nja4px.mjs +9 -0
  27. package/dist/chunks/ToolSearchTool-1.0.4-q00g76m2.mjs +1 -0
  28. package/dist/chunks/TrustDialog-1.0.4-xce6cp69.mjs +1 -0
  29. package/dist/chunks/activeProvider-1.0.4-w4scey43.mjs +1 -0
  30. package/dist/chunks/add-dir-1.0.4-xm5qwknc.mjs +1 -0
  31. package/dist/chunks/agentTypes-1.0.4-he8e2qfd.mjs +1 -0
  32. package/dist/chunks/agents-1.0.4-k2bdfryr.mjs +110 -0
  33. package/dist/chunks/agents-1.0.4-mt84dfn1.mjs +3 -0
  34. package/dist/chunks/api-1.0.4-h4pnj11w.mjs +1 -0
  35. package/dist/chunks/asciicast-1.0.4-cafbqek9.mjs +1 -0
  36. package/dist/chunks/assistant-1.0.4-cezj138d.mjs +1 -0
  37. package/dist/chunks/auth-1.0.4-0t5pss7v.mjs +1 -0
  38. package/dist/chunks/auth-1.0.4-3y0wgt5g.mjs +1 -0
  39. package/dist/chunks/autoMode-1.0.4-vssxz3fz.mjs +48 -0
  40. package/dist/chunks/autoUpdater-1.0.4-drwc61h2.mjs +1 -0
  41. package/dist/chunks/backgroundHousekeeping-1.0.4-dn72g8zg.mjs +1 -0
  42. package/dist/chunks/branch-1.0.4-4gv6bbzr.mjs +4 -0
  43. package/dist/chunks/bridge-1.0.4-fs3148xw.mjs +2 -0
  44. package/dist/chunks/bridgeConfig-1.0.4-tj7j77dy.mjs +1 -0
  45. package/dist/chunks/bridgeEnabled-1.0.4-g5j98pxj.mjs +1 -0
  46. package/dist/chunks/bridgeMain-1.0.4-47dp2cx1.mjs +88 -0
  47. package/dist/chunks/bridgePointer-1.0.4-rz3s97zd.mjs +1 -0
  48. package/dist/chunks/btw-1.0.4-q0v29hp5.mjs +1 -0
  49. package/dist/chunks/buddy-1.0.4-f6rknpnr.mjs +3 -0
  50. package/dist/chunks/cacache-1.0.4-zqddgev2.mjs +1 -0
  51. package/dist/chunks/cache-probe-1.0.4-qx7ym4r0.mjs +21 -0
  52. package/dist/chunks/cacheStats-1.0.4-q2mcbsr3.mjs +4 -0
  53. package/dist/chunks/caches-1.0.4-bsgbkzpc.mjs +1 -0
  54. package/dist/chunks/claudeDesktop-1.0.4-17ztwd14.mjs +1 -0
  55. package/dist/chunks/claudemd-1.0.4-zdd5de85.mjs +1 -0
  56. package/dist/chunks/clear-1.0.4-g3cfj02y.mjs +1 -0
  57. package/dist/chunks/clearTerminal-1.0.4-xz0azar2.mjs +1 -0
  58. package/dist/chunks/cli-1.0.4-08e3sn18.mjs +2 -0
  59. package/dist/chunks/cli-1.0.4-092qjm5g.mjs +25 -0
  60. package/dist/chunks/cli-1.0.4-09fgpcwb.mjs +2 -0
  61. package/dist/chunks/cli-1.0.4-0gpk6g88.mjs +2 -0
  62. package/dist/chunks/cli-1.0.4-0pqf799x.mjs +2 -0
  63. package/dist/chunks/cli-1.0.4-0vwtrvvh.mjs +16 -0
  64. package/dist/chunks/cli-1.0.4-0wp27vrg.mjs +67 -0
  65. package/dist/chunks/cli-1.0.4-1bg07n68.mjs +4 -0
  66. package/dist/chunks/cli-1.0.4-1ddc8bnh.mjs +2 -0
  67. package/dist/chunks/cli-1.0.4-1j122zyj.mjs +2 -0
  68. package/dist/chunks/cli-1.0.4-1xkgwtah.mjs +20 -0
  69. package/dist/chunks/cli-1.0.4-1ymz8m3g.mjs +2 -0
  70. package/dist/chunks/cli-1.0.4-23n5aaxp.mjs +2 -0
  71. package/dist/chunks/cli-1.0.4-2g15f7sw.mjs +2 -0
  72. package/dist/chunks/cli-1.0.4-2je9hpfv.mjs +50 -0
  73. package/dist/chunks/cli-1.0.4-2m2spkt1.mjs +2 -0
  74. package/dist/chunks/cli-1.0.4-2mqbwapd.mjs +2 -0
  75. package/dist/chunks/cli-1.0.4-2pfh6nzj.mjs +2 -0
  76. package/dist/chunks/cli-1.0.4-2vrfse65.mjs +2 -0
  77. package/dist/chunks/cli-1.0.4-2wh24aeg.mjs +24 -0
  78. package/dist/chunks/cli-1.0.4-3289hbrr.mjs +6 -0
  79. package/dist/chunks/cli-1.0.4-34jdejmp.mjs +2 -0
  80. package/dist/chunks/cli-1.0.4-36qx2z1d.mjs +2 -0
  81. package/dist/chunks/cli-1.0.4-3b0061a4.mjs +2 -0
  82. package/dist/chunks/cli-1.0.4-3gmj1s7h.mjs +3 -0
  83. package/dist/chunks/cli-1.0.4-3k3cpavm.mjs +3 -0
  84. package/dist/chunks/cli-1.0.4-4m4pwdge.mjs +2 -0
  85. package/dist/chunks/cli-1.0.4-4sfp975c.mjs +2 -0
  86. package/dist/chunks/cli-1.0.4-4wmw1p17.mjs +24 -0
  87. package/dist/chunks/cli-1.0.4-54j7kz1n.mjs +2 -0
  88. package/dist/chunks/cli-1.0.4-5663sqrh.mjs +2 -0
  89. package/dist/chunks/cli-1.0.4-5c4tptcb.mjs +2 -0
  90. package/dist/chunks/cli-1.0.4-5e2v63sy.mjs +2 -0
  91. package/dist/chunks/cli-1.0.4-5e9fa04w.mjs +2 -0
  92. package/dist/chunks/cli-1.0.4-618n4yb3.mjs +2 -0
  93. package/dist/chunks/cli-1.0.4-61v9tj7g.mjs +2 -0
  94. package/dist/chunks/cli-1.0.4-75pszwff.mjs +12 -0
  95. package/dist/chunks/cli-1.0.4-7b7qaegg.mjs +2 -0
  96. package/dist/chunks/cli-1.0.4-7hvk5sex.mjs +39 -0
  97. package/dist/chunks/cli-1.0.4-7jd24agk.mjs +2 -0
  98. package/dist/chunks/cli-1.0.4-7pxrd0w5.mjs +4 -0
  99. package/dist/chunks/cli-1.0.4-80hrkybp.mjs +2 -0
  100. package/dist/chunks/cli-1.0.4-85cb91sn.mjs +4 -0
  101. package/dist/chunks/cli-1.0.4-8bmfjgvt.mjs +2 -0
  102. package/dist/chunks/cli-1.0.4-8ed4gxkm.mjs +3 -0
  103. package/dist/chunks/cli-1.0.4-8gkb1zg5.mjs +8 -0
  104. package/dist/chunks/cli-1.0.4-8jya5ew3.mjs +2 -0
  105. package/dist/chunks/cli-1.0.4-8ws7nhff.mjs +2 -0
  106. package/dist/chunks/cli-1.0.4-8x3m3esm.mjs +2 -0
  107. package/dist/chunks/cli-1.0.4-95nw81kz.mjs +2 -0
  108. package/dist/chunks/cli-1.0.4-982xabhy.mjs +2 -0
  109. package/dist/chunks/cli-1.0.4-9ber6pxx.mjs +2 -0
  110. package/dist/chunks/cli-1.0.4-9ra8j4rt.mjs +59 -0
  111. package/dist/chunks/cli-1.0.4-9re52te8.mjs +2 -0
  112. package/dist/chunks/cli-1.0.4-9w88pg39.mjs +12 -0
  113. package/dist/chunks/cli-1.0.4-9ysbahqq.mjs +2 -0
  114. package/dist/chunks/cli-1.0.4-a14svdr8.mjs +1 -0
  115. package/dist/chunks/cli-1.0.4-avmcefxg.mjs +10 -0
  116. package/dist/chunks/cli-1.0.4-azntz5z2.mjs +2 -0
  117. package/dist/chunks/cli-1.0.4-bg0v2cnc.mjs +133 -0
  118. package/dist/chunks/cli-1.0.4-bn5k1yhp.mjs +2 -0
  119. package/dist/chunks/cli-1.0.4-bneycyws.mjs +2 -0
  120. package/dist/chunks/cli-1.0.4-bnsdazas.mjs +3 -0
  121. package/dist/chunks/cli-1.0.4-c9sh44ne.mjs +2 -0
  122. package/dist/chunks/cli-1.0.4-cavq6b0d.mjs +2 -0
  123. package/dist/chunks/cli-1.0.4-cj3nrnbs.mjs +58 -0
  124. package/dist/chunks/cli-1.0.4-ctmzb5aw.mjs +2 -0
  125. package/dist/chunks/cli-1.0.4-cwjz9xzp.mjs +2 -0
  126. package/dist/chunks/cli-1.0.4-d4gb1vbz.mjs +2 -0
  127. package/dist/chunks/cli-1.0.4-d8bjdz7n.mjs +2 -0
  128. package/dist/chunks/cli-1.0.4-dj36xg0v.mjs +2 -0
  129. package/dist/chunks/cli-1.0.4-e26gm32b.mjs +2 -0
  130. package/dist/chunks/cli-1.0.4-e2mkdvw8.mjs +2 -0
  131. package/dist/chunks/cli-1.0.4-e76jy4xn.mjs +2 -0
  132. package/dist/chunks/cli-1.0.4-e86sgy00.mjs +3 -0
  133. package/dist/chunks/cli-1.0.4-ec3dh8bt.mjs +2 -0
  134. package/dist/chunks/cli-1.0.4-edbk5qx2.mjs +5 -0
  135. package/dist/chunks/cli-1.0.4-ef5asahs.mjs +4 -0
  136. package/dist/chunks/cli-1.0.4-emp66cxw.mjs +2 -0
  137. package/dist/chunks/cli-1.0.4-eny7y9k8.mjs +6 -0
  138. package/dist/chunks/cli-1.0.4-ex22h376.mjs +2 -0
  139. package/dist/chunks/cli-1.0.4-f0t68sye.mjs +2 -0
  140. package/dist/chunks/cli-1.0.4-f20q38cw.mjs +2 -0
  141. package/dist/chunks/cli-1.0.4-f2cmhz31.mjs +15 -0
  142. package/dist/chunks/cli-1.0.4-f62zwjj2.mjs +2 -0
  143. package/dist/chunks/cli-1.0.4-f8dd3sqs.mjs +2 -0
  144. package/dist/chunks/cli-1.0.4-f8eaamkf.mjs +2 -0
  145. package/dist/chunks/cli-1.0.4-f965h6gd.mjs +7 -0
  146. package/dist/chunks/cli-1.0.4-fbhgecgx.mjs +2 -0
  147. package/dist/chunks/cli-1.0.4-fc0bzryc.mjs +3 -0
  148. package/dist/chunks/cli-1.0.4-fcswm1md.mjs +2 -0
  149. package/dist/chunks/cli-1.0.4-ffvpb7fz.mjs +2 -0
  150. package/dist/chunks/cli-1.0.4-fsf2c4j5.mjs +2 -0
  151. package/dist/chunks/cli-1.0.4-fv9x8ks1.mjs +2 -0
  152. package/dist/chunks/cli-1.0.4-g3vvvtwh.mjs +2 -0
  153. package/dist/chunks/cli-1.0.4-g9kftkyg.mjs +2 -0
  154. package/dist/chunks/cli-1.0.4-genhzh1b.mjs +2 -0
  155. package/dist/chunks/cli-1.0.4-gf8tchp1.mjs +5 -0
  156. package/dist/chunks/cli-1.0.4-ghv1wb08.mjs +2 -0
  157. package/dist/chunks/cli-1.0.4-ghzbww61.mjs +34 -0
  158. package/dist/chunks/cli-1.0.4-gqc15qng.mjs +6 -0
  159. package/dist/chunks/cli-1.0.4-gssg75hx.mjs +2 -0
  160. package/dist/chunks/cli-1.0.4-gyjecspm.mjs +2 -0
  161. package/dist/chunks/cli-1.0.4-hfn9tnb6.mjs +2 -0
  162. package/dist/chunks/cli-1.0.4-hnrps9q2.mjs +2 -0
  163. package/dist/chunks/cli-1.0.4-hrw2yb74.mjs +2 -0
  164. package/dist/chunks/cli-1.0.4-ht7fqqqw.mjs +2 -0
  165. package/dist/chunks/cli-1.0.4-htrx7sdv.mjs +2 -0
  166. package/dist/chunks/cli-1.0.4-hvgsrtj6.mjs +3 -0
  167. package/dist/chunks/cli-1.0.4-hwje79ka.mjs +2 -0
  168. package/dist/chunks/cli-1.0.4-hyj1dzkq.mjs +3 -0
  169. package/dist/chunks/cli-1.0.4-j17mhs88.mjs +18 -0
  170. package/dist/chunks/cli-1.0.4-jvp0mp87.mjs +5471 -0
  171. package/dist/chunks/cli-1.0.4-jxsb0m86.mjs +2 -0
  172. package/dist/chunks/cli-1.0.4-jy8qt85n.mjs +2 -0
  173. package/dist/chunks/cli-1.0.4-k16cwcs0.mjs +2 -0
  174. package/dist/chunks/cli-1.0.4-k20sr786.mjs +3 -0
  175. package/dist/chunks/cli-1.0.4-k6gh1b1a.mjs +2 -0
  176. package/dist/chunks/cli-1.0.4-kbfs3rn2.mjs +3 -0
  177. package/dist/chunks/cli-1.0.4-kc0ty8k1.mjs +2 -0
  178. package/dist/chunks/cli-1.0.4-kv0e5nm5.mjs +2 -0
  179. package/dist/chunks/cli-1.0.4-m240wvtt.mjs +9 -0
  180. package/dist/chunks/cli-1.0.4-n5mydt2f.mjs +2 -0
  181. package/dist/chunks/cli-1.0.4-ndy339bx.mjs +2 -0
  182. package/dist/chunks/cli-1.0.4-nfpfve45.mjs +2 -0
  183. package/dist/chunks/cli-1.0.4-ng8nc24b.mjs +2 -0
  184. package/dist/chunks/cli-1.0.4-nws4fp34.mjs +2 -0
  185. package/dist/chunks/cli-1.0.4-nz4ff6hn.mjs +18 -0
  186. package/dist/chunks/cli-1.0.4-p618f4eb.mjs +2 -0
  187. package/dist/chunks/cli-1.0.4-pae9c0v0.mjs +18 -0
  188. package/dist/chunks/cli-1.0.4-pxqvx117.mjs +3 -0
  189. package/dist/chunks/cli-1.0.4-q00a51mt.mjs +4 -0
  190. package/dist/chunks/cli-1.0.4-q0rnwhn4.mjs +199 -0
  191. package/dist/chunks/cli-1.0.4-q97cke3f.mjs +2 -0
  192. package/dist/chunks/cli-1.0.4-qdsf8s2n.mjs +5 -0
  193. package/dist/chunks/cli-1.0.4-qka1j546.mjs +4 -0
  194. package/dist/chunks/cli-1.0.4-qng8dpqh.mjs +2 -0
  195. package/dist/chunks/cli-1.0.4-qpymvg0c.mjs +25 -0
  196. package/dist/chunks/cli-1.0.4-r4h3tk3k.mjs +17 -0
  197. package/dist/chunks/cli-1.0.4-r8mtbv7z.mjs +42 -0
  198. package/dist/chunks/cli-1.0.4-r8x4yv46.mjs +2 -0
  199. package/dist/chunks/cli-1.0.4-rf2k7z5d.mjs +2 -0
  200. package/dist/chunks/cli-1.0.4-rjgeb0fh.mjs +12 -0
  201. package/dist/chunks/cli-1.0.4-rkb3rkfa.mjs +2 -0
  202. package/dist/chunks/cli-1.0.4-rkhq9n0r.mjs +12 -0
  203. package/dist/chunks/cli-1.0.4-rkw1vtxv.mjs +2 -0
  204. package/dist/chunks/cli-1.0.4-rmrpsgq6.mjs +24 -0
  205. package/dist/chunks/cli-1.0.4-rntkbdpm.mjs +2 -0
  206. package/dist/chunks/cli-1.0.4-rsdrrjzt.mjs +4 -0
  207. package/dist/chunks/cli-1.0.4-rtwmycp0.mjs +2 -0
  208. package/dist/chunks/cli-1.0.4-s4sdhvre.mjs +2 -0
  209. package/dist/chunks/cli-1.0.4-s6m720bj.mjs +2 -0
  210. package/dist/chunks/cli-1.0.4-s8qwtd3t.mjs +2 -0
  211. package/dist/chunks/cli-1.0.4-scpa8zjb.mjs +2 -0
  212. package/dist/chunks/cli-1.0.4-sm5wfdec.mjs +2 -0
  213. package/dist/chunks/cli-1.0.4-t0zs4sf6.mjs +2 -0
  214. package/dist/chunks/cli-1.0.4-t915kvpv.mjs +2 -0
  215. package/dist/chunks/cli-1.0.4-th3f10e2.mjs +2 -0
  216. package/dist/chunks/cli-1.0.4-tt7ejrct.mjs +2 -0
  217. package/dist/chunks/cli-1.0.4-ttn7e3zf.mjs +3 -0
  218. package/dist/chunks/cli-1.0.4-v2973j5k.mjs +15 -0
  219. package/dist/chunks/cli-1.0.4-vckzcaj2.mjs +2 -0
  220. package/dist/chunks/cli-1.0.4-vde8kvg5.mjs +4 -0
  221. package/dist/chunks/cli-1.0.4-vdykgt7q.mjs +2 -0
  222. package/dist/chunks/cli-1.0.4-vnf5ysx9.mjs +3 -0
  223. package/dist/chunks/cli-1.0.4-vpcfce7x.mjs +6 -0
  224. package/dist/chunks/cli-1.0.4-vrfgjvj8.mjs +15 -0
  225. package/dist/chunks/cli-1.0.4-vwwq0bh3.mjs +2 -0
  226. package/dist/chunks/cli-1.0.4-vxb33mtd.mjs +4 -0
  227. package/dist/chunks/cli-1.0.4-w6bsa7jc.mjs +2 -0
  228. package/dist/chunks/cli-1.0.4-wb91dheq.mjs +2 -0
  229. package/dist/chunks/cli-1.0.4-wfx4vdv5.mjs +2 -0
  230. package/dist/chunks/cli-1.0.4-wryebn9y.mjs +2 -0
  231. package/dist/chunks/cli-1.0.4-x4szzhgq.mjs +2 -0
  232. package/dist/chunks/cli-1.0.4-x8jnn75c.mjs +2 -0
  233. package/dist/chunks/cli-1.0.4-xcegbj23.mjs +21 -0
  234. package/dist/chunks/cli-1.0.4-xjef6vra.mjs +2 -0
  235. package/dist/chunks/cli-1.0.4-xwh8sxe6.mjs +45 -0
  236. package/dist/chunks/cli-1.0.4-xwwr77p3.mjs +2 -0
  237. package/dist/chunks/cli-1.0.4-xxktmt2a.mjs +2 -0
  238. package/dist/chunks/cli-1.0.4-y1kvcxph.mjs +2 -0
  239. package/dist/chunks/cli-1.0.4-y8a3yd57.mjs +2 -0
  240. package/dist/chunks/cli-1.0.4-y9e53xfp.mjs +2 -0
  241. package/dist/chunks/cli-1.0.4-ya22eazw.mjs +2 -0
  242. package/dist/chunks/cli-1.0.4-ya3aqyvx.mjs +2 -0
  243. package/dist/chunks/cli-1.0.4-ygedgw05.mjs +2 -0
  244. package/dist/chunks/cli-1.0.4-yp6300fv.mjs +2 -0
  245. package/dist/chunks/cli-1.0.4-yq119gwk.mjs +2 -0
  246. package/dist/chunks/cli-1.0.4-yq19e16e.mjs +4 -0
  247. package/dist/chunks/cli-1.0.4-yq6mh0a1.mjs +2 -0
  248. package/dist/chunks/cli-1.0.4-yrgjsn2v.mjs +17 -0
  249. package/dist/chunks/cli-1.0.4-ywnv6aw8.mjs +2 -0
  250. package/dist/chunks/cli-1.0.4-z10ppvxj.mjs +133 -0
  251. package/dist/chunks/cli-1.0.4-z5zmw573.mjs +2 -0
  252. package/dist/chunks/cli-1.0.4-zcjfmcay.mjs +2 -0
  253. package/dist/chunks/cli-1.0.4-zka0z8g9.mjs +2 -0
  254. package/dist/chunks/cli-1.0.4-znj63zs7.mjs +2 -0
  255. package/dist/chunks/cli-1.0.4-znmw4kr8.mjs +2 -0
  256. package/dist/chunks/cli-1.0.4-zpvxzd77.mjs +2 -0
  257. package/dist/chunks/cli-1.0.4-ztznpg9h.mjs +2 -0
  258. package/dist/chunks/client-1.0.4-tejrj09r.mjs +1 -0
  259. package/dist/chunks/color-1.0.4-148b97be.mjs +1 -0
  260. package/dist/chunks/compact-1.0.4-ky0tgnkb.mjs +3 -0
  261. package/dist/chunks/config-1.0.4-a5enjc0b.mjs +1 -0
  262. package/dist/chunks/config-1.0.4-q23nqw9d.mjs +1 -0
  263. package/dist/chunks/constants-1.0.4-635bzfez.mjs +1 -0
  264. package/dist/chunks/context-1.0.4-fmdfyxfk.mjs +1 -0
  265. package/dist/chunks/context-noninteractive-1.0.4-j208qvff.mjs +1 -0
  266. package/dist/chunks/conversation-1.0.4-mjwd6es3.mjs +1 -0
  267. package/dist/chunks/copilotHeaders-1.0.4-w8cpfvcn.mjs +1 -0
  268. package/dist/chunks/copy-1.0.4-3zg2v8v9.mjs +9 -0
  269. package/dist/chunks/cost-1.0.4-qbz07cgt.mjs +1 -0
  270. package/dist/chunks/createSSHSession-1.0.4-ck0pjj64.mjs +1 -0
  271. package/dist/chunks/createSession-1.0.4-zn5jgf43.mjs +1 -0
  272. package/dist/chunks/debug-1.0.4-dym46dbc.mjs +1 -0
  273. package/dist/chunks/defaultActionDeps-1.0.4-7b6ynz02.mjs +1446 -0
  274. package/dist/chunks/desktop-1.0.4-b1awqagy.mjs +1 -0
  275. package/dist/chunks/detectRepository-1.0.4-5ce0vhvf.mjs +1 -0
  276. package/dist/chunks/detection-1.0.4-02gwawhp.mjs +1 -0
  277. package/dist/chunks/diff-1.0.4-pn4a7wgt.mjs +1 -0
  278. package/dist/chunks/doctor-1.0.4-79m6h5bd.mjs +1 -0
  279. package/dist/chunks/doctorDiagnostic-1.0.4-kxmkxpsz.mjs +1 -0
  280. package/dist/chunks/earlyInput-1.0.4-xg5zcr37.mjs +1 -0
  281. package/dist/chunks/effort-1.0.4-8sdpyadq.mjs +10 -0
  282. package/dist/chunks/engine-1.0.4-wrn82cfg.mjs +1 -0
  283. package/dist/chunks/envLessBridgeConfig-1.0.4-x998nrnt.mjs +1 -0
  284. package/dist/chunks/envUtils-1.0.4-957dzgjm.mjs +1 -0
  285. package/dist/chunks/environmentSelection-1.0.4-06vjqsxt.mjs +1 -0
  286. package/dist/chunks/environments-1.0.4-4tzw2x67.mjs +1 -0
  287. package/dist/chunks/errors-1.0.4-tb1hnmsh.mjs +1 -0
  288. package/dist/chunks/exampleCommands-1.0.4-hp5tyv1s.mjs +1 -0
  289. package/dist/chunks/exit-1.0.4-0e0pjfe4.mjs +1 -0
  290. package/dist/chunks/explorer-1.0.4-kzv9mf71.mjs +1 -0
  291. package/dist/chunks/export-1.0.4-8yb3xjhz.mjs +2 -0
  292. package/dist/chunks/extra-usage-1.0.4-ren9nv10.mjs +1 -0
  293. package/dist/chunks/extra-usage-noninteractive-1.0.4-s9hgaf3d.mjs +1 -0
  294. package/dist/chunks/fast-1.0.4-qb539j3d.mjs +1 -0
  295. package/dist/chunks/feedback-1.0.4-99yaf8cc.mjs +14 -0
  296. package/dist/chunks/firstPartyEventLogger-1.0.4-qj82we89.mjs +1 -0
  297. package/dist/chunks/git-1.0.4-ag4cdf47.mjs +1 -0
  298. package/dist/chunks/githubModelsCredentials-1.0.4-62p8s6py.mjs +1 -0
  299. package/dist/chunks/goal-1.0.4-w76hde3j.mjs +4 -0
  300. package/dist/chunks/grove-1.0.4-d8k5pbpk.mjs +1 -0
  301. package/dist/chunks/growthbook-1.0.4-qkc749a9.mjs +1 -0
  302. package/dist/chunks/headless-1.0.4-4htsajcx.mjs +2 -0
  303. package/dist/chunks/heapdump-1.0.4-g2n5m54n.mjs +6 -0
  304. package/dist/chunks/help-1.0.4-mb80yzdd.mjs +1 -0
  305. package/dist/chunks/hookChains-1.0.4-bhpn5t16.mjs +3 -0
  306. package/dist/chunks/hooks-1.0.4-3m8at5nd.mjs +1 -0
  307. package/dist/chunks/hooks-1.0.4-vqe5g9z0.mjs +79 -0
  308. package/dist/chunks/ide-1.0.4-8w5pj0k7.mjs +3 -0
  309. package/dist/chunks/image-processor-napi-1.0.4-tn6ykvgm.mjs +1 -0
  310. package/dist/chunks/inboundAttachments-1.0.4-gs14tq2d.mjs +1 -0
  311. package/dist/chunks/index-1.0.4-0ds0yar8.mjs +2 -0
  312. package/dist/chunks/index-1.0.4-0swpjsxv.mjs +1 -0
  313. package/dist/chunks/index-1.0.4-1adr1cev.mjs +1 -0
  314. package/dist/chunks/index-1.0.4-2cqwak8f.mjs +1 -0
  315. package/dist/chunks/index-1.0.4-45r2p2fr.mjs +1 -0
  316. package/dist/chunks/index-1.0.4-578fqjbt.mjs +5 -0
  317. package/dist/chunks/index-1.0.4-ak4tdd7x.mjs +1 -0
  318. package/dist/chunks/index-1.0.4-bq00jtej.mjs +1 -0
  319. package/dist/chunks/index-1.0.4-d3963jrf.mjs +1 -0
  320. package/dist/chunks/index-1.0.4-db6y9w6p.mjs +9 -0
  321. package/dist/chunks/index-1.0.4-eqa6324a.mjs +30 -0
  322. package/dist/chunks/index-1.0.4-fgtct7wa.mjs +1 -0
  323. package/dist/chunks/index-1.0.4-fpxnv2m3.mjs +1 -0
  324. package/dist/chunks/index-1.0.4-kkxqenx5.mjs +17 -0
  325. package/dist/chunks/index-1.0.4-m48vcxbj.mjs +2 -0
  326. package/dist/chunks/index-1.0.4-nb8rr4xb.mjs +9 -0
  327. package/dist/chunks/index-1.0.4-q4bjsgf0.mjs +1 -0
  328. package/dist/chunks/index-1.0.4-qj0raz1t.mjs +1 -0
  329. package/dist/chunks/index-1.0.4-rb8h15jh.mjs +1 -0
  330. package/dist/chunks/index-1.0.4-vhzdmbc5.mjs +1 -0
  331. package/dist/chunks/index-1.0.4-xadhy3m9.mjs +1 -0
  332. package/dist/chunks/index-1.0.4-ynqjejnh.mjs +1 -0
  333. package/dist/chunks/index-1.0.4-zw32d5rq.mjs +1 -0
  334. package/dist/chunks/init-1.0.4-tdv5z99g.mjs +1 -0
  335. package/dist/chunks/initReplBridge-1.0.4-rg2exhh0.mjs +1 -0
  336. package/dist/chunks/ink-1.0.4-w371tr8m.mjs +1 -0
  337. package/dist/chunks/insights-1.0.4-26m6wmhe.mjs +870 -0
  338. package/dist/chunks/install-1.0.4-k86wrfgy.mjs +1 -0
  339. package/dist/chunks/install-github-app-1.0.4-kztkmzd8.mjs +149 -0
  340. package/dist/chunks/install-slack-app-1.0.4-jr818vd2.mjs +1 -0
  341. package/dist/chunks/instrumentation-1.0.4-07hsrhzg.mjs +1 -0
  342. package/dist/chunks/interactiveHelpers-1.0.4-s8cew0a4.mjs +1 -0
  343. package/dist/chunks/keybindings-1.0.4-swcsebxv.mjs +2 -0
  344. package/dist/chunks/knowledge-1.0.4-fmpjrqf4.mjs +2 -0
  345. package/dist/chunks/latestVersionCache-1.0.4-q89arrb0.mjs +1 -0
  346. package/dist/chunks/loadAgentsDir-1.0.4-7pg9fk0z.mjs +1 -0
  347. package/dist/chunks/loadPluginHooks-1.0.4-djam30bs.mjs +1 -0
  348. package/dist/chunks/loadPluginHooks-1.0.4-nntzjww6.mjs +1 -0
  349. package/dist/chunks/log-1.0.4-q4mkknks.mjs +1 -0
  350. package/dist/chunks/main-1.0.4-fpq69x53.mjs +1 -0
  351. package/dist/chunks/managedEnv-1.0.4-50dv7phy.mjs +1 -0
  352. package/dist/chunks/mcp-1.0.4-3fp6t13e.mjs +1 -0
  353. package/dist/chunks/mcp-1.0.4-5g0fetmg.mjs +17 -0
  354. package/dist/chunks/mcp-1.0.4-v67mxtdh.mjs +4 -0
  355. package/dist/chunks/mcpb-1.0.4-bg0cf4nd.mjs +1 -0
  356. package/dist/chunks/memory-1.0.4-a5sjkye9.mjs +3 -0
  357. package/dist/chunks/model-1.0.4-7q33dte0.mjs +2 -0
  358. package/dist/chunks/model-1.0.4-ffc1hzwk.mjs +1 -0
  359. package/dist/chunks/node-1.0.4-t61fwtvv.mjs +12 -0
  360. package/dist/chunks/oauth-1.0.4-wa2f4qb5.mjs +1 -0
  361. package/dist/chunks/openaiShim-1.0.4-j74991mr.mjs +14 -0
  362. package/dist/chunks/output-style-1.0.4-rrajfa4e.mjs +1 -0
  363. package/dist/chunks/package-ZZWOLTXM-1.0.4-y2hbwj02.mjs +1 -0
  364. package/dist/chunks/parseConnectUrl-1.0.4-1krmb0p7.mjs +1 -0
  365. package/dist/chunks/parser-1.0.4-e0yxtz1k.mjs +1 -0
  366. package/dist/chunks/passes-1.0.4-kvwashgz.mjs +1 -0
  367. package/dist/chunks/permissions-1.0.4-apdtqjy6.mjs +3 -0
  368. package/dist/chunks/permissions-1.0.4-pmabr578.mjs +1 -0
  369. package/dist/chunks/plan-1.0.4-fsnspnpd.mjs +1 -0
  370. package/dist/chunks/plist-1.0.4-de9w52d2.mjs +1 -0
  371. package/dist/chunks/plugin-1.0.4-kaxanxvg.mjs +29 -0
  372. package/dist/chunks/pluginStartupCheck-1.0.4-avqbmty1.mjs +1 -0
  373. package/dist/chunks/plugins-1.0.4-h4238mxy.mjs +9 -0
  374. package/dist/chunks/preActionHook-1.0.4-hkk5ypj1.mjs +2 -0
  375. package/dist/chunks/print-1.0.4-zg0pxx71.mjs +57 -0
  376. package/dist/chunks/privacy-settings-1.0.4-7td5d9xf.mjs +1 -0
  377. package/dist/chunks/process-1.0.4-trh5g80m.mjs +1 -0
  378. package/dist/chunks/processBashCommand-1.0.4-vhq5y4b0.mjs +1 -0
  379. package/dist/chunks/processSlashCommand-1.0.4-27w0dvzd.mjs +9 -0
  380. package/dist/chunks/prompt-1.0.4-1j8n4q6b.mjs +1 -0
  381. package/dist/chunks/prompt-1.0.4-p1dmdqgx.mjs +1 -0
  382. package/dist/chunks/prompts-1.0.4-an41ccab.mjs +1 -0
  383. package/dist/chunks/protocolHandler-1.0.4-6pyn2eqy.mjs +13 -0
  384. package/dist/chunks/provider-1.0.4-xz9x5xsf.mjs +2 -0
  385. package/dist/chunks/providerProfiles-1.0.4-qmtqnwxj.mjs +1 -0
  386. package/dist/chunks/providerValidation-1.0.4-5yhz71te.mjs +6 -0
  387. package/dist/chunks/rate-limit-options-1.0.4-71w1mhp8.mjs +1 -0
  388. package/dist/chunks/registerSubcommands-1.0.4-k68vcvz1.mjs +34 -0
  389. package/dist/chunks/registry-1.0.4-5am2gh2r.mjs +1 -0
  390. package/dist/chunks/release-notes-1.0.4-72dkmwym.mjs +5 -0
  391. package/dist/chunks/reload-plugins-1.0.4-6eyjpyz7.mjs +2 -0
  392. package/dist/chunks/remote-env-1.0.4-6a8j2qxd.mjs +1 -0
  393. package/dist/chunks/remoteBridgeCore-1.0.4-ddgvhxxp.mjs +1 -0
  394. package/dist/chunks/remoteSession-1.0.4-3eztyv3e.mjs +1 -0
  395. package/dist/chunks/rename-1.0.4-te7rrrfc.mjs +1 -0
  396. package/dist/chunks/replBridgeHandle-1.0.4-16sm66q5.mjs +1 -0
  397. package/dist/chunks/replLauncher-1.0.4-mt8zvgft.mjs +1 -0
  398. package/dist/chunks/resume-1.0.4-sya6c2c8.mjs +2 -0
  399. package/dist/chunks/rewind-1.0.4-v0yww1mv.mjs +1 -0
  400. package/dist/chunks/rootOptions-1.0.4-t1drtsae.mjs +1 -0
  401. package/dist/chunks/sandbox-adapter-1.0.4-q641tp0g.mjs +1 -0
  402. package/dist/chunks/sandbox-toggle-1.0.4-c1033f07.mjs +1 -0
  403. package/dist/chunks/session-1.0.4-4fb52nd1.mjs +2 -0
  404. package/dist/chunks/sessionDiscovery-1.0.4-0e0rnehv.mjs +1 -0
  405. package/dist/chunks/sessionFileAccessHooks-1.0.4-vk3q8gh9.mjs +1 -0
  406. package/dist/chunks/sessionStorage-1.0.4-eh1zevz7.mjs +1 -0
  407. package/dist/chunks/settings-1.0.4-0jpahg4j.mjs +1 -0
  408. package/dist/chunks/setup-1.0.4-p9hdn98q.mjs +5 -0
  409. package/dist/chunks/sinks-1.0.4-hs2rw9fa.mjs +1 -0
  410. package/dist/chunks/skills-1.0.4-www28gn6.mjs +1 -0
  411. package/dist/chunks/startupProfiler-1.0.4-tngewr6e.mjs +1 -0
  412. package/dist/chunks/startupUpdateCheck-1.0.4-w114jwx9.mjs +1 -0
  413. package/dist/chunks/state-1.0.4-w3xv2kmh.mjs +1 -0
  414. package/dist/chunks/stats-1.0.4-3vm0apd0.mjs +6 -0
  415. package/dist/chunks/status-1.0.4-zymfx8mp.mjs +1 -0
  416. package/dist/chunks/stickers-1.0.4-jwgnam2a.mjs +1 -0
  417. package/dist/chunks/subprocessEnv-1.0.4-3vgqj8gm.mjs +1 -0
  418. package/dist/chunks/tasks-1.0.4-hy7y09mg.mjs +1 -0
  419. package/dist/chunks/teamHelpers-1.0.4-53nq46v0.mjs +1 -0
  420. package/dist/chunks/teammateModeSnapshot-1.0.4-3wmvsb1r.mjs +1 -0
  421. package/dist/chunks/teleport-1.0.4-x93h61td.mjs +1 -0
  422. package/dist/chunks/terminalSetup-1.0.4-fh0en1t5.mjs +1 -0
  423. package/dist/chunks/theme-1.0.4-wr0m9bga.mjs +1 -0
  424. package/dist/chunks/thinkback-1.0.4-75kht0mq.mjs +1 -0
  425. package/dist/chunks/thinkback-play-1.0.4-1b1645q9.mjs +1 -0
  426. package/dist/chunks/toolPool-1.0.4-q895eqqt.mjs +1 -0
  427. package/dist/chunks/toolSearch-1.0.4-3247wmxa.mjs +1 -0
  428. package/dist/chunks/tools-1.0.4-606qnn5t.mjs +1 -0
  429. package/dist/chunks/trustedDevice-1.0.4-c2380whv.mjs +1 -0
  430. package/dist/chunks/turndown.cjs-1.0.4-43jppw9w.mjs +69 -0
  431. package/dist/chunks/types-1.0.4-1kpkjthf.mjs +1 -0
  432. package/dist/chunks/ultrareviewCommand-1.0.4-5v4tpqbq.mjs +4 -0
  433. package/dist/chunks/update-1.0.4-0hj0c9x8.mjs +86 -0
  434. package/dist/chunks/upgrade-1.0.4-sfxyr5z4.mjs +1 -0
  435. package/dist/chunks/upload-1.0.4-bcjf0cbz.mjs +7 -0
  436. package/dist/chunks/upstreamproxy-1.0.4-t76haqj3.mjs +14 -0
  437. package/dist/chunks/url-handler-napi-1.0.4-nn0e71sf.mjs +1 -0
  438. package/dist/chunks/usage-1.0.4-hh2n5we9.mjs +1 -0
  439. package/dist/chunks/util-1.0.4-3cjy2f82.mjs +1 -0
  440. package/dist/chunks/utils-1.0.4-3cv1bh5y.mjs +1 -0
  441. package/dist/chunks/vim-1.0.4-26wbsc0p.mjs +1 -0
  442. package/dist/chunks/watcher-1.0.4-ygqk3k29.mjs +1 -0
  443. package/dist/chunks/wiki-1.0.4-jdevf4fv.mjs +132 -0
  444. package/dist/chunks/workflows-1.0.4-mg9ts0qs.mjs +1 -0
  445. package/dist/chunks/worktree-1.0.4-6849hcw1.mjs +1 -0
  446. package/dist/chunks/worktreeModeEnabled-1.0.4-3m5c48st.mjs +1 -0
  447. package/dist/chunks/wrapper-1.0.4-4czm72m1.mjs +7 -0
  448. package/dist/cli.mjs +2 -2
  449. package/install.cjs +208 -0
  450. package/package.json +29 -136
  451. package/LICENSE +0 -30
  452. package/bin/claudin +0 -272
  453. package/dist/chunks/AgentTool-1.0.0-ntq52h6d.mjs +0 -1
  454. package/dist/chunks/App-1.0.0-pq8rbd4e.mjs +0 -1
  455. package/dist/chunks/ApproveApiKey-1.0.0-qe6dcyn9.mjs +0 -1
  456. package/dist/chunks/AssistantSessionChooser-1.0.0-3hw45tcb.mjs +0 -1
  457. package/dist/chunks/AutoModeOptInDialog-1.0.0-heb61shk.mjs +0 -1
  458. package/dist/chunks/BypassPermissionsModeDialog-1.0.0-2g2zgabd.mjs +0 -1
  459. package/dist/chunks/ClaudeMdExternalIncludesDialog-1.0.0-mnzm8hbn.mjs +0 -1
  460. package/dist/chunks/ConsoleOAuthFlow-1.0.0-y9z3jw7z.mjs +0 -1
  461. package/dist/chunks/DiffDialog-1.0.0-kk3pcd26.mjs +0 -7
  462. package/dist/chunks/Doctor-1.0.0-755sk8gj.mjs +0 -1
  463. package/dist/chunks/ExplorerDialog-1.0.0-f8bm4stx.mjs +0 -6
  464. package/dist/chunks/Grove-1.0.0-bn4z4dsn.mjs +0 -1
  465. package/dist/chunks/ITermBackend-1.0.0-3p9db73m.mjs +0 -1
  466. package/dist/chunks/InvalidConfigDialog-1.0.0-np4sfyve.mjs +0 -1
  467. package/dist/chunks/InvalidSettingsDialog-1.0.0-b0zeynpx.mjs +0 -1
  468. package/dist/chunks/MigrationDialog-1.0.0-sa0s6hcj.mjs +0 -1
  469. package/dist/chunks/Onboarding-1.0.0-tk33ftr2.mjs +0 -1
  470. package/dist/chunks/ProviderManager-1.0.0-www0a3q2.mjs +0 -1
  471. package/dist/chunks/REPL-1.0.0-5fpk6x08.mjs +0 -1
  472. package/dist/chunks/ResumeConversation-1.0.0-4z48k6yg.mjs +0 -1
  473. package/dist/chunks/SnapshotUpdateDialog-1.0.0-zkz0m3fe.mjs +0 -1
  474. package/dist/chunks/TeleportProgress-1.0.0-1aezaedk.mjs +0 -1
  475. package/dist/chunks/TeleportRepoMismatchDialog-1.0.0-2j7rw18b.mjs +0 -1
  476. package/dist/chunks/TeleportResumeWrapper-1.0.0-pz7z1pgn.mjs +0 -1
  477. package/dist/chunks/TmuxBackend-1.0.0-vjdyrm0y.mjs +0 -9
  478. package/dist/chunks/ToolSearchTool-1.0.0-jhpa1rj3.mjs +0 -1
  479. package/dist/chunks/TrustDialog-1.0.0-3j85d31j.mjs +0 -1
  480. package/dist/chunks/activeProvider-1.0.0-7t1gywpg.mjs +0 -1
  481. package/dist/chunks/add-dir-1.0.0-nhb09mp0.mjs +0 -1
  482. package/dist/chunks/agentTypes-1.0.0-31h34p6s.mjs +0 -1
  483. package/dist/chunks/agents-1.0.0-ftn4r7nc.mjs +0 -3
  484. package/dist/chunks/agents-1.0.0-wxrayd6g.mjs +0 -110
  485. package/dist/chunks/api-1.0.0-hbcyzns8.mjs +0 -1
  486. package/dist/chunks/asciicast-1.0.0-m7j1gd58.mjs +0 -1
  487. package/dist/chunks/assistant-1.0.0-ny2wjcg4.mjs +0 -1
  488. package/dist/chunks/auth-1.0.0-3fw6yc7q.mjs +0 -1
  489. package/dist/chunks/auth-1.0.0-fmsdk0rx.mjs +0 -1
  490. package/dist/chunks/autoMode-1.0.0-wdwejfdz.mjs +0 -48
  491. package/dist/chunks/autoUpdater-1.0.0-bn5c22pn.mjs +0 -1
  492. package/dist/chunks/backgroundHousekeeping-1.0.0-kpkedkt2.mjs +0 -1
  493. package/dist/chunks/branch-1.0.0-8ggpsnh8.mjs +0 -4
  494. package/dist/chunks/bridge-1.0.0-yh1c4dwr.mjs +0 -2
  495. package/dist/chunks/bridgeConfig-1.0.0-xst6e45g.mjs +0 -1
  496. package/dist/chunks/bridgeEnabled-1.0.0-hjnyabkn.mjs +0 -1
  497. package/dist/chunks/bridgeMain-1.0.0-ae0hh4es.mjs +0 -88
  498. package/dist/chunks/bridgePointer-1.0.0-tgpvkh92.mjs +0 -1
  499. package/dist/chunks/btw-1.0.0-ajt0vjm0.mjs +0 -1
  500. package/dist/chunks/buddy-1.0.0-e2gfjpdn.mjs +0 -3
  501. package/dist/chunks/cacache-1.0.0-7dtxeghv.mjs +0 -1
  502. package/dist/chunks/cache-probe-1.0.0-cmxc1d7r.mjs +0 -21
  503. package/dist/chunks/cacheStats-1.0.0-z8dgs0e9.mjs +0 -4
  504. package/dist/chunks/caches-1.0.0-gvcmrap6.mjs +0 -1
  505. package/dist/chunks/claudeDesktop-1.0.0-2vtaxmda.mjs +0 -1
  506. package/dist/chunks/claudemd-1.0.0-akcqxpe0.mjs +0 -1
  507. package/dist/chunks/clear-1.0.0-62qzgrfe.mjs +0 -1
  508. package/dist/chunks/clearTerminal-1.0.0-aqvjkfa4.mjs +0 -1
  509. package/dist/chunks/cli-1.0.0-0dqeaz06.mjs +0 -2
  510. package/dist/chunks/cli-1.0.0-0kyhvhc6.mjs +0 -2
  511. package/dist/chunks/cli-1.0.0-0m6s3jt3.mjs +0 -2
  512. package/dist/chunks/cli-1.0.0-0p8bwg81.mjs +0 -2
  513. package/dist/chunks/cli-1.0.0-0x4h2sfq.mjs +0 -3
  514. package/dist/chunks/cli-1.0.0-12y1q97z.mjs +0 -2
  515. package/dist/chunks/cli-1.0.0-1bt8054k.mjs +0 -8
  516. package/dist/chunks/cli-1.0.0-1q0yqt9x.mjs +0 -2
  517. package/dist/chunks/cli-1.0.0-1x587n9v.mjs +0 -2
  518. package/dist/chunks/cli-1.0.0-28qtk65x.mjs +0 -2
  519. package/dist/chunks/cli-1.0.0-297t0qb9.mjs +0 -2
  520. package/dist/chunks/cli-1.0.0-29a7q2zb.mjs +0 -2
  521. package/dist/chunks/cli-1.0.0-2a3rav9m.mjs +0 -2
  522. package/dist/chunks/cli-1.0.0-2c2dsvya.mjs +0 -39
  523. package/dist/chunks/cli-1.0.0-2f0cvt2p.mjs +0 -133
  524. package/dist/chunks/cli-1.0.0-2nvg7hgb.mjs +0 -2
  525. package/dist/chunks/cli-1.0.0-35dzz6zy.mjs +0 -2
  526. package/dist/chunks/cli-1.0.0-3d490aq5.mjs +0 -18
  527. package/dist/chunks/cli-1.0.0-3e1zzw2m.mjs +0 -5
  528. package/dist/chunks/cli-1.0.0-3eq56cz0.mjs +0 -2
  529. package/dist/chunks/cli-1.0.0-3gd6wkw6.mjs +0 -2
  530. package/dist/chunks/cli-1.0.0-3jv0xeqb.mjs +0 -5471
  531. package/dist/chunks/cli-1.0.0-3kakpmsw.mjs +0 -2
  532. package/dist/chunks/cli-1.0.0-3qrwy40k.mjs +0 -2
  533. package/dist/chunks/cli-1.0.0-3yzpgsfy.mjs +0 -10
  534. package/dist/chunks/cli-1.0.0-45ac6b6k.mjs +0 -2
  535. package/dist/chunks/cli-1.0.0-45z8brfz.mjs +0 -2
  536. package/dist/chunks/cli-1.0.0-46ah6a0n.mjs +0 -2
  537. package/dist/chunks/cli-1.0.0-48ghprgx.mjs +0 -2
  538. package/dist/chunks/cli-1.0.0-4tct38wk.mjs +0 -2
  539. package/dist/chunks/cli-1.0.0-4yjxekjw.mjs +0 -2
  540. package/dist/chunks/cli-1.0.0-51wmpx7c.mjs +0 -5
  541. package/dist/chunks/cli-1.0.0-5e3vbyk9.mjs +0 -133
  542. package/dist/chunks/cli-1.0.0-5ezvw655.mjs +0 -2
  543. package/dist/chunks/cli-1.0.0-5kgtgydk.mjs +0 -4
  544. package/dist/chunks/cli-1.0.0-5vhgrhcv.mjs +0 -3
  545. package/dist/chunks/cli-1.0.0-5w5nt80s.mjs +0 -2
  546. package/dist/chunks/cli-1.0.0-5x9hk2tv.mjs +0 -4
  547. package/dist/chunks/cli-1.0.0-62vc4cav.mjs +0 -2
  548. package/dist/chunks/cli-1.0.0-64nxj808.mjs +0 -2
  549. package/dist/chunks/cli-1.0.0-69wwn8fm.mjs +0 -2
  550. package/dist/chunks/cli-1.0.0-6fjfz856.mjs +0 -3
  551. package/dist/chunks/cli-1.0.0-6krf0eds.mjs +0 -45
  552. package/dist/chunks/cli-1.0.0-6m5b3qer.mjs +0 -4
  553. package/dist/chunks/cli-1.0.0-6pspgzt0.mjs +0 -25
  554. package/dist/chunks/cli-1.0.0-6pzwhya1.mjs +0 -2
  555. package/dist/chunks/cli-1.0.0-71121zr3.mjs +0 -24
  556. package/dist/chunks/cli-1.0.0-77vk468r.mjs +0 -2
  557. package/dist/chunks/cli-1.0.0-79g0drwx.mjs +0 -2
  558. package/dist/chunks/cli-1.0.0-7apq9k1c.mjs +0 -2
  559. package/dist/chunks/cli-1.0.0-7bq8c23g.mjs +0 -2
  560. package/dist/chunks/cli-1.0.0-7bwjq7kx.mjs +0 -18
  561. package/dist/chunks/cli-1.0.0-7j0wzrc8.mjs +0 -2
  562. package/dist/chunks/cli-1.0.0-7sjrgxed.mjs +0 -2
  563. package/dist/chunks/cli-1.0.0-7svyqyyr.mjs +0 -2
  564. package/dist/chunks/cli-1.0.0-7xw741kc.mjs +0 -3
  565. package/dist/chunks/cli-1.0.0-8bfmpb27.mjs +0 -4
  566. package/dist/chunks/cli-1.0.0-8ec1jzr8.mjs +0 -199
  567. package/dist/chunks/cli-1.0.0-8regfprj.mjs +0 -3
  568. package/dist/chunks/cli-1.0.0-8z0fg9j4.mjs +0 -2
  569. package/dist/chunks/cli-1.0.0-90kvzvgh.mjs +0 -2
  570. package/dist/chunks/cli-1.0.0-93cwkf4z.mjs +0 -24
  571. package/dist/chunks/cli-1.0.0-9685x1yk.mjs +0 -2
  572. package/dist/chunks/cli-1.0.0-98eh4zrk.mjs +0 -2
  573. package/dist/chunks/cli-1.0.0-9xst6qgq.mjs +0 -15
  574. package/dist/chunks/cli-1.0.0-9y1mbt32.mjs +0 -3
  575. package/dist/chunks/cli-1.0.0-abpbfhzx.mjs +0 -2
  576. package/dist/chunks/cli-1.0.0-ac7bwh96.mjs +0 -2
  577. package/dist/chunks/cli-1.0.0-acmjhzf5.mjs +0 -3
  578. package/dist/chunks/cli-1.0.0-annneepc.mjs +0 -2
  579. package/dist/chunks/cli-1.0.0-aqy9kydk.mjs +0 -2
  580. package/dist/chunks/cli-1.0.0-ar6eqxs2.mjs +0 -2
  581. package/dist/chunks/cli-1.0.0-b06n54f5.mjs +0 -2
  582. package/dist/chunks/cli-1.0.0-b4fv5ph0.mjs +0 -5
  583. package/dist/chunks/cli-1.0.0-be8kad81.mjs +0 -2
  584. package/dist/chunks/cli-1.0.0-bh3rbgwa.mjs +0 -2
  585. package/dist/chunks/cli-1.0.0-br6mz00q.mjs +0 -2
  586. package/dist/chunks/cli-1.0.0-c2zj0m2f.mjs +0 -2
  587. package/dist/chunks/cli-1.0.0-c85jytxy.mjs +0 -2
  588. package/dist/chunks/cli-1.0.0-cmjm08rk.mjs +0 -2
  589. package/dist/chunks/cli-1.0.0-d1scp5yg.mjs +0 -2
  590. package/dist/chunks/cli-1.0.0-d41qrhvs.mjs +0 -21
  591. package/dist/chunks/cli-1.0.0-dhcpzb62.mjs +0 -2
  592. package/dist/chunks/cli-1.0.0-dj8ks410.mjs +0 -2
  593. package/dist/chunks/cli-1.0.0-djwczpdt.mjs +0 -3
  594. package/dist/chunks/cli-1.0.0-djwtsj09.mjs +0 -2
  595. package/dist/chunks/cli-1.0.0-dpt31cjd.mjs +0 -2
  596. package/dist/chunks/cli-1.0.0-dwvkm03p.mjs +0 -2
  597. package/dist/chunks/cli-1.0.0-dy7maxwy.mjs +0 -2
  598. package/dist/chunks/cli-1.0.0-e5rww26x.mjs +0 -4
  599. package/dist/chunks/cli-1.0.0-ecgsk85a.mjs +0 -12
  600. package/dist/chunks/cli-1.0.0-en8a1449.mjs +0 -2
  601. package/dist/chunks/cli-1.0.0-etm3m8cy.mjs +0 -2
  602. package/dist/chunks/cli-1.0.0-eyetzqvg.mjs +0 -2
  603. package/dist/chunks/cli-1.0.0-f3ch7bmk.mjs +0 -12
  604. package/dist/chunks/cli-1.0.0-f5jmp5qb.mjs +0 -2
  605. package/dist/chunks/cli-1.0.0-f5tk5y04.mjs +0 -2
  606. package/dist/chunks/cli-1.0.0-f7acpaw9.mjs +0 -2
  607. package/dist/chunks/cli-1.0.0-fm59p5cc.mjs +0 -2
  608. package/dist/chunks/cli-1.0.0-fmr252y0.mjs +0 -2
  609. package/dist/chunks/cli-1.0.0-fp9r0gjz.mjs +0 -2
  610. package/dist/chunks/cli-1.0.0-g3a9cmzg.mjs +0 -25
  611. package/dist/chunks/cli-1.0.0-g94rd2t7.mjs +0 -2
  612. package/dist/chunks/cli-1.0.0-gnw5mz7s.mjs +0 -2
  613. package/dist/chunks/cli-1.0.0-gp1bafm1.mjs +0 -67
  614. package/dist/chunks/cli-1.0.0-h2rrpewm.mjs +0 -4
  615. package/dist/chunks/cli-1.0.0-h4wrm2nz.mjs +0 -2
  616. package/dist/chunks/cli-1.0.0-h4zeh5x3.mjs +0 -2
  617. package/dist/chunks/cli-1.0.0-har4xp9r.mjs +0 -58
  618. package/dist/chunks/cli-1.0.0-hdjps260.mjs +0 -2
  619. package/dist/chunks/cli-1.0.0-hxn439m2.mjs +0 -2
  620. package/dist/chunks/cli-1.0.0-j78e3zc8.mjs +0 -2
  621. package/dist/chunks/cli-1.0.0-j7jbk9h5.mjs +0 -2
  622. package/dist/chunks/cli-1.0.0-j9yctg5n.mjs +0 -3
  623. package/dist/chunks/cli-1.0.0-jgsn1xsa.mjs +0 -2
  624. package/dist/chunks/cli-1.0.0-jrp8z07z.mjs +0 -17
  625. package/dist/chunks/cli-1.0.0-jv1yvfcg.mjs +0 -2
  626. package/dist/chunks/cli-1.0.0-k43d4ehr.mjs +0 -2
  627. package/dist/chunks/cli-1.0.0-k89fvwg0.mjs +0 -2
  628. package/dist/chunks/cli-1.0.0-ke4cpjmt.mjs +0 -2
  629. package/dist/chunks/cli-1.0.0-kkb4bnm5.mjs +0 -2
  630. package/dist/chunks/cli-1.0.0-kzvt11ce.mjs +0 -2
  631. package/dist/chunks/cli-1.0.0-kzyp3fra.mjs +0 -42
  632. package/dist/chunks/cli-1.0.0-m36981m8.mjs +0 -3
  633. package/dist/chunks/cli-1.0.0-m541fwsh.mjs +0 -50
  634. package/dist/chunks/cli-1.0.0-m5qbgck6.mjs +0 -2
  635. package/dist/chunks/cli-1.0.0-mer12fv2.mjs +0 -7
  636. package/dist/chunks/cli-1.0.0-mjz09r1b.mjs +0 -2
  637. package/dist/chunks/cli-1.0.0-mtcg2tan.mjs +0 -6
  638. package/dist/chunks/cli-1.0.0-mweaysdm.mjs +0 -18
  639. package/dist/chunks/cli-1.0.0-mwqc8gcg.mjs +0 -2
  640. package/dist/chunks/cli-1.0.0-napcq3jr.mjs +0 -3
  641. package/dist/chunks/cli-1.0.0-nc2a4f04.mjs +0 -2
  642. package/dist/chunks/cli-1.0.0-npyj0h2z.mjs +0 -2
  643. package/dist/chunks/cli-1.0.0-nqwkmsqy.mjs +0 -4
  644. package/dist/chunks/cli-1.0.0-p70q12n6.mjs +0 -2
  645. package/dist/chunks/cli-1.0.0-pfcwdzpj.mjs +0 -2
  646. package/dist/chunks/cli-1.0.0-pgcwemmr.mjs +0 -2
  647. package/dist/chunks/cli-1.0.0-pk60w3x2.mjs +0 -2
  648. package/dist/chunks/cli-1.0.0-pqbmdf25.mjs +0 -2
  649. package/dist/chunks/cli-1.0.0-py32djr3.mjs +0 -2
  650. package/dist/chunks/cli-1.0.0-q07kd3bg.mjs +0 -20
  651. package/dist/chunks/cli-1.0.0-q71pvcjq.mjs +0 -2
  652. package/dist/chunks/cli-1.0.0-q8pp6wqj.mjs +0 -2
  653. package/dist/chunks/cli-1.0.0-qa2wbmrn.mjs +0 -17
  654. package/dist/chunks/cli-1.0.0-qgd6evsp.mjs +0 -15
  655. package/dist/chunks/cli-1.0.0-qgjtkwn2.mjs +0 -2
  656. package/dist/chunks/cli-1.0.0-qsa78b35.mjs +0 -6
  657. package/dist/chunks/cli-1.0.0-r010aq2t.mjs +0 -12
  658. package/dist/chunks/cli-1.0.0-r11e9bqb.mjs +0 -2
  659. package/dist/chunks/cli-1.0.0-r5d672mf.mjs +0 -2
  660. package/dist/chunks/cli-1.0.0-rakrrkxm.mjs +0 -3
  661. package/dist/chunks/cli-1.0.0-rjz9xjd7.mjs +0 -2
  662. package/dist/chunks/cli-1.0.0-rk8cxn4f.mjs +0 -2
  663. package/dist/chunks/cli-1.0.0-rp88rgyq.mjs +0 -59
  664. package/dist/chunks/cli-1.0.0-rqxtzh9t.mjs +0 -2
  665. package/dist/chunks/cli-1.0.0-rr2vc5j8.mjs +0 -2
  666. package/dist/chunks/cli-1.0.0-s1nys8bh.mjs +0 -2
  667. package/dist/chunks/cli-1.0.0-s5zrbn45.mjs +0 -12
  668. package/dist/chunks/cli-1.0.0-s64ptatp.mjs +0 -2
  669. package/dist/chunks/cli-1.0.0-scn3v1zj.mjs +0 -34
  670. package/dist/chunks/cli-1.0.0-sd453erk.mjs +0 -2
  671. package/dist/chunks/cli-1.0.0-sf4v7jmd.mjs +0 -2
  672. package/dist/chunks/cli-1.0.0-ssk9d65p.mjs +0 -6
  673. package/dist/chunks/cli-1.0.0-st65n1ar.mjs +0 -2
  674. package/dist/chunks/cli-1.0.0-staaeymp.mjs +0 -16
  675. package/dist/chunks/cli-1.0.0-t423sc3h.mjs +0 -2
  676. package/dist/chunks/cli-1.0.0-t9nh06qh.mjs +0 -2
  677. package/dist/chunks/cli-1.0.0-tejk4tf3.mjs +0 -2
  678. package/dist/chunks/cli-1.0.0-tjde6y9j.mjs +0 -2
  679. package/dist/chunks/cli-1.0.0-tjdynh97.mjs +0 -4
  680. package/dist/chunks/cli-1.0.0-tzhphp4x.mjs +0 -2
  681. package/dist/chunks/cli-1.0.0-vbj6f50v.mjs +0 -2
  682. package/dist/chunks/cli-1.0.0-vhqghvhx.mjs +0 -2
  683. package/dist/chunks/cli-1.0.0-vm8h1nre.mjs +0 -2
  684. package/dist/chunks/cli-1.0.0-vp4cqpk2.mjs +0 -2
  685. package/dist/chunks/cli-1.0.0-vt4s6vpx.mjs +0 -2
  686. package/dist/chunks/cli-1.0.0-w19t2tz4.mjs +0 -1
  687. package/dist/chunks/cli-1.0.0-w3jaj9sn.mjs +0 -2
  688. package/dist/chunks/cli-1.0.0-w7rfh3wx.mjs +0 -2
  689. package/dist/chunks/cli-1.0.0-wc4nnsk9.mjs +0 -4
  690. package/dist/chunks/cli-1.0.0-wczp00vm.mjs +0 -2
  691. package/dist/chunks/cli-1.0.0-wj4q452x.mjs +0 -2
  692. package/dist/chunks/cli-1.0.0-wmm9nh9b.mjs +0 -3
  693. package/dist/chunks/cli-1.0.0-wqjc5jyn.mjs +0 -9
  694. package/dist/chunks/cli-1.0.0-wr4ttz3n.mjs +0 -2
  695. package/dist/chunks/cli-1.0.0-wredqw14.mjs +0 -4
  696. package/dist/chunks/cli-1.0.0-wxv95d7v.mjs +0 -2
  697. package/dist/chunks/cli-1.0.0-xbf5n35v.mjs +0 -2
  698. package/dist/chunks/cli-1.0.0-xch50hc2.mjs +0 -6
  699. package/dist/chunks/cli-1.0.0-xpmk1ba7.mjs +0 -2
  700. package/dist/chunks/cli-1.0.0-xtkm872y.mjs +0 -2
  701. package/dist/chunks/cli-1.0.0-yrf5zg67.mjs +0 -15
  702. package/dist/chunks/cli-1.0.0-yvkqq8eh.mjs +0 -24
  703. package/dist/chunks/cli-1.0.0-yynk31bk.mjs +0 -2
  704. package/dist/chunks/cli-1.0.0-z0twvqze.mjs +0 -2
  705. package/dist/chunks/cli-1.0.0-z86atemf.mjs +0 -2
  706. package/dist/chunks/cli-1.0.0-zbmxyhrx.mjs +0 -2
  707. package/dist/chunks/cli-1.0.0-zj9rdzv2.mjs +0 -2
  708. package/dist/chunks/cli-1.0.0-zkamzpzd.mjs +0 -2
  709. package/dist/chunks/client-1.0.0-xccnp4kr.mjs +0 -1
  710. package/dist/chunks/color-1.0.0-fdeey90k.mjs +0 -1
  711. package/dist/chunks/compact-1.0.0-emaxjn6h.mjs +0 -3
  712. package/dist/chunks/config-1.0.0-4v7thqrr.mjs +0 -1
  713. package/dist/chunks/config-1.0.0-zqmh15zn.mjs +0 -1
  714. package/dist/chunks/constants-1.0.0-sfnb9ybm.mjs +0 -1
  715. package/dist/chunks/context-1.0.0-69xw60d6.mjs +0 -1
  716. package/dist/chunks/context-noninteractive-1.0.0-03yaakw2.mjs +0 -1
  717. package/dist/chunks/conversation-1.0.0-7ksv0b51.mjs +0 -1
  718. package/dist/chunks/copilotHeaders-1.0.0-0tgt3mar.mjs +0 -1
  719. package/dist/chunks/copy-1.0.0-pzzbqfb6.mjs +0 -9
  720. package/dist/chunks/cost-1.0.0-9pqj2ew4.mjs +0 -1
  721. package/dist/chunks/createSSHSession-1.0.0-ygt1rzrh.mjs +0 -1
  722. package/dist/chunks/createSession-1.0.0-z5m6g5cc.mjs +0 -1
  723. package/dist/chunks/debug-1.0.0-h8tsaat2.mjs +0 -1
  724. package/dist/chunks/defaultActionDeps-1.0.0-ak70f3es.mjs +0 -1446
  725. package/dist/chunks/desktop-1.0.0-ze0rr70s.mjs +0 -1
  726. package/dist/chunks/detectRepository-1.0.0-9v1y5vt2.mjs +0 -1
  727. package/dist/chunks/detection-1.0.0-0ymw9h4g.mjs +0 -1
  728. package/dist/chunks/diff-1.0.0-898gnz7a.mjs +0 -1
  729. package/dist/chunks/doctor-1.0.0-6gjxtnzk.mjs +0 -1
  730. package/dist/chunks/doctorDiagnostic-1.0.0-ak3358qg.mjs +0 -1
  731. package/dist/chunks/earlyInput-1.0.0-9np715kz.mjs +0 -1
  732. package/dist/chunks/effort-1.0.0-hdqhyqe1.mjs +0 -10
  733. package/dist/chunks/engine-1.0.0-4h9qpdat.mjs +0 -1
  734. package/dist/chunks/envLessBridgeConfig-1.0.0-2n3g84k9.mjs +0 -1
  735. package/dist/chunks/envUtils-1.0.0-gmtcf5ah.mjs +0 -1
  736. package/dist/chunks/environmentSelection-1.0.0-49b84j1j.mjs +0 -1
  737. package/dist/chunks/environments-1.0.0-wgvbgtzh.mjs +0 -1
  738. package/dist/chunks/errors-1.0.0-fh1d8zmb.mjs +0 -1
  739. package/dist/chunks/exampleCommands-1.0.0-4bcd7r5n.mjs +0 -1
  740. package/dist/chunks/exit-1.0.0-r63hc1dc.mjs +0 -1
  741. package/dist/chunks/explorer-1.0.0-saw2vg0z.mjs +0 -1
  742. package/dist/chunks/export-1.0.0-z607p5hs.mjs +0 -2
  743. package/dist/chunks/extra-usage-1.0.0-ejd8edpg.mjs +0 -1
  744. package/dist/chunks/extra-usage-noninteractive-1.0.0-q1dqy04v.mjs +0 -1
  745. package/dist/chunks/fast-1.0.0-y7tnqj41.mjs +0 -1
  746. package/dist/chunks/feedback-1.0.0-tk3e1z9n.mjs +0 -14
  747. package/dist/chunks/firstPartyEventLogger-1.0.0-r71b7vn5.mjs +0 -1
  748. package/dist/chunks/git-1.0.0-9wqsr2qa.mjs +0 -1
  749. package/dist/chunks/githubModelsCredentials-1.0.0-tk5f8pvy.mjs +0 -1
  750. package/dist/chunks/goal-1.0.0-qszqydb1.mjs +0 -4
  751. package/dist/chunks/grove-1.0.0-m0s7ggvn.mjs +0 -1
  752. package/dist/chunks/growthbook-1.0.0-arv5fn2h.mjs +0 -1
  753. package/dist/chunks/headless-1.0.0-meswzvsh.mjs +0 -2
  754. package/dist/chunks/heapdump-1.0.0-f91a8s85.mjs +0 -6
  755. package/dist/chunks/help-1.0.0-1fdb6kdg.mjs +0 -1
  756. package/dist/chunks/hookChains-1.0.0-e7pzez0v.mjs +0 -3
  757. package/dist/chunks/hooks-1.0.0-eyh2gqps.mjs +0 -1
  758. package/dist/chunks/hooks-1.0.0-m36t0bwv.mjs +0 -79
  759. package/dist/chunks/ide-1.0.0-a45jrbns.mjs +0 -3
  760. package/dist/chunks/image-processor-napi-1.0.0-n9qvjksa.mjs +0 -1
  761. package/dist/chunks/inboundAttachments-1.0.0-0k3ggjjb.mjs +0 -1
  762. package/dist/chunks/index-1.0.0-0x87b661.mjs +0 -1
  763. package/dist/chunks/index-1.0.0-12jzjwrf.mjs +0 -1
  764. package/dist/chunks/index-1.0.0-1kczyxet.mjs +0 -1
  765. package/dist/chunks/index-1.0.0-1q7wjdcp.mjs +0 -1
  766. package/dist/chunks/index-1.0.0-35p583e0.mjs +0 -5
  767. package/dist/chunks/index-1.0.0-4afenhhx.mjs +0 -1
  768. package/dist/chunks/index-1.0.0-6bpq28pw.mjs +0 -9
  769. package/dist/chunks/index-1.0.0-9hwag4qs.mjs +0 -1
  770. package/dist/chunks/index-1.0.0-aajs5s0v.mjs +0 -1
  771. package/dist/chunks/index-1.0.0-cm1gbgtz.mjs +0 -1
  772. package/dist/chunks/index-1.0.0-dby08tym.mjs +0 -1
  773. package/dist/chunks/index-1.0.0-eeyp0gkv.mjs +0 -1
  774. package/dist/chunks/index-1.0.0-ffjzppt2.mjs +0 -1
  775. package/dist/chunks/index-1.0.0-h95rvp8v.mjs +0 -2
  776. package/dist/chunks/index-1.0.0-hb819mjc.mjs +0 -17
  777. package/dist/chunks/index-1.0.0-j0dsw617.mjs +0 -1
  778. package/dist/chunks/index-1.0.0-k061j8pm.mjs +0 -1
  779. package/dist/chunks/index-1.0.0-nc9zj7q7.mjs +0 -1
  780. package/dist/chunks/index-1.0.0-rjjn0ajb.mjs +0 -9
  781. package/dist/chunks/index-1.0.0-s3d5ad8r.mjs +0 -1
  782. package/dist/chunks/index-1.0.0-v2r7cb7k.mjs +0 -2
  783. package/dist/chunks/index-1.0.0-vdcbsd89.mjs +0 -30
  784. package/dist/chunks/index-1.0.0-wakr5z2p.mjs +0 -1
  785. package/dist/chunks/init-1.0.0-yqwagfgg.mjs +0 -1
  786. package/dist/chunks/initReplBridge-1.0.0-0z3jp40b.mjs +0 -1
  787. package/dist/chunks/ink-1.0.0-f8gtgh6f.mjs +0 -1
  788. package/dist/chunks/insights-1.0.0-25jmcb16.mjs +0 -870
  789. package/dist/chunks/install-1.0.0-gr1zdp38.mjs +0 -1
  790. package/dist/chunks/install-github-app-1.0.0-zrkc4x64.mjs +0 -149
  791. package/dist/chunks/install-slack-app-1.0.0-4ve59vsv.mjs +0 -1
  792. package/dist/chunks/instrumentation-1.0.0-ek6xg9q7.mjs +0 -1
  793. package/dist/chunks/interactiveHelpers-1.0.0-s4sbr7g0.mjs +0 -1
  794. package/dist/chunks/keybindings-1.0.0-g0aveg3f.mjs +0 -2
  795. package/dist/chunks/knowledge-1.0.0-f9ey2z66.mjs +0 -2
  796. package/dist/chunks/latestVersionCache-1.0.0-15prka1s.mjs +0 -1
  797. package/dist/chunks/loadAgentsDir-1.0.0-6z2k3s42.mjs +0 -1
  798. package/dist/chunks/loadPluginHooks-1.0.0-6mnwy6c7.mjs +0 -1
  799. package/dist/chunks/loadPluginHooks-1.0.0-qsqj3hj6.mjs +0 -1
  800. package/dist/chunks/log-1.0.0-a5a1xjnt.mjs +0 -1
  801. package/dist/chunks/main-1.0.0-0nmbm00m.mjs +0 -1
  802. package/dist/chunks/managedEnv-1.0.0-140efz1s.mjs +0 -1
  803. package/dist/chunks/mcp-1.0.0-jr4w72y9.mjs +0 -1
  804. package/dist/chunks/mcp-1.0.0-rn41ec11.mjs +0 -4
  805. package/dist/chunks/mcp-1.0.0-zkhfmd8z.mjs +0 -17
  806. package/dist/chunks/mcpb-1.0.0-6sfb9ej1.mjs +0 -1
  807. package/dist/chunks/memory-1.0.0-37w6bxgd.mjs +0 -3
  808. package/dist/chunks/model-1.0.0-5ax7t010.mjs +0 -2
  809. package/dist/chunks/model-1.0.0-vc0h6tnp.mjs +0 -1
  810. package/dist/chunks/node-1.0.0-0sjjakz0.mjs +0 -12
  811. package/dist/chunks/oauth-1.0.0-xjpfqct6.mjs +0 -1
  812. package/dist/chunks/openaiShim-1.0.0-h0y24sem.mjs +0 -14
  813. package/dist/chunks/output-style-1.0.0-2y4p3m2w.mjs +0 -1
  814. package/dist/chunks/package-ZZWOLTXM-1.0.0-xp874gc5.mjs +0 -1
  815. package/dist/chunks/parseConnectUrl-1.0.0-5e424bck.mjs +0 -1
  816. package/dist/chunks/parser-1.0.0-5bw2dabv.mjs +0 -1
  817. package/dist/chunks/passes-1.0.0-1hw5an0y.mjs +0 -1
  818. package/dist/chunks/permissions-1.0.0-y7cd1b76.mjs +0 -3
  819. package/dist/chunks/permissions-1.0.0-yz3kfsp9.mjs +0 -1
  820. package/dist/chunks/plan-1.0.0-3c6hg8t7.mjs +0 -1
  821. package/dist/chunks/plist-1.0.0-5kvt3t8e.mjs +0 -1
  822. package/dist/chunks/plugin-1.0.0-5qwfnnnm.mjs +0 -29
  823. package/dist/chunks/pluginStartupCheck-1.0.0-1mamcvnp.mjs +0 -1
  824. package/dist/chunks/plugins-1.0.0-bpgkjtj3.mjs +0 -9
  825. package/dist/chunks/preActionHook-1.0.0-rvnnh09t.mjs +0 -2
  826. package/dist/chunks/print-1.0.0-44vptjwh.mjs +0 -57
  827. package/dist/chunks/privacy-settings-1.0.0-ad9vfc9j.mjs +0 -1
  828. package/dist/chunks/process-1.0.0-dfbz10ag.mjs +0 -1
  829. package/dist/chunks/processBashCommand-1.0.0-95dptbrf.mjs +0 -1
  830. package/dist/chunks/processSlashCommand-1.0.0-y0cd8ktm.mjs +0 -9
  831. package/dist/chunks/prompt-1.0.0-5nkyts11.mjs +0 -1
  832. package/dist/chunks/prompt-1.0.0-m750sc14.mjs +0 -1
  833. package/dist/chunks/prompts-1.0.0-yra8htke.mjs +0 -1
  834. package/dist/chunks/protocolHandler-1.0.0-7y6wpp13.mjs +0 -13
  835. package/dist/chunks/provider-1.0.0-52fg53xh.mjs +0 -2
  836. package/dist/chunks/providerProfiles-1.0.0-0tppxprb.mjs +0 -1
  837. package/dist/chunks/providerValidation-1.0.0-wmykyaet.mjs +0 -6
  838. package/dist/chunks/rate-limit-options-1.0.0-h5ep1y3x.mjs +0 -1
  839. package/dist/chunks/registerSubcommands-1.0.0-fhxesqta.mjs +0 -34
  840. package/dist/chunks/registry-1.0.0-a377ezpb.mjs +0 -1
  841. package/dist/chunks/release-notes-1.0.0-by3y8nsy.mjs +0 -5
  842. package/dist/chunks/reload-plugins-1.0.0-e0edaepa.mjs +0 -2
  843. package/dist/chunks/remote-env-1.0.0-kx005xj7.mjs +0 -1
  844. package/dist/chunks/remoteBridgeCore-1.0.0-gz0dh84p.mjs +0 -1
  845. package/dist/chunks/remoteSession-1.0.0-2dy8n18d.mjs +0 -1
  846. package/dist/chunks/rename-1.0.0-k72zv7kp.mjs +0 -1
  847. package/dist/chunks/replBridgeHandle-1.0.0-y08dx49q.mjs +0 -1
  848. package/dist/chunks/replLauncher-1.0.0-r2kc80z9.mjs +0 -1
  849. package/dist/chunks/resume-1.0.0-jtkxpggj.mjs +0 -2
  850. package/dist/chunks/rewind-1.0.0-k6rq30hm.mjs +0 -1
  851. package/dist/chunks/rootOptions-1.0.0-36x1070w.mjs +0 -1
  852. package/dist/chunks/sandbox-adapter-1.0.0-2dtwtw2j.mjs +0 -1
  853. package/dist/chunks/sandbox-toggle-1.0.0-tcagvw90.mjs +0 -1
  854. package/dist/chunks/session-1.0.0-rq99e0dg.mjs +0 -2
  855. package/dist/chunks/sessionDiscovery-1.0.0-hj0n1kre.mjs +0 -1
  856. package/dist/chunks/sessionFileAccessHooks-1.0.0-w6z6wz16.mjs +0 -1
  857. package/dist/chunks/sessionStorage-1.0.0-2es5ey4x.mjs +0 -1
  858. package/dist/chunks/settings-1.0.0-qya7xyjk.mjs +0 -1
  859. package/dist/chunks/setup-1.0.0-ak5hj34y.mjs +0 -5
  860. package/dist/chunks/sinks-1.0.0-2qtkb9qf.mjs +0 -1
  861. package/dist/chunks/skills-1.0.0-aj92mfft.mjs +0 -1
  862. package/dist/chunks/startupProfiler-1.0.0-6fxanvvw.mjs +0 -1
  863. package/dist/chunks/startupUpdateCheck-1.0.0-snyfk316.mjs +0 -1
  864. package/dist/chunks/state-1.0.0-fg5z7kma.mjs +0 -1
  865. package/dist/chunks/stats-1.0.0-5d06z7x3.mjs +0 -6
  866. package/dist/chunks/status-1.0.0-jhk2fnne.mjs +0 -1
  867. package/dist/chunks/stickers-1.0.0-whf68r6d.mjs +0 -1
  868. package/dist/chunks/subprocessEnv-1.0.0-fyjqfgdk.mjs +0 -1
  869. package/dist/chunks/tasks-1.0.0-gk7dvt1v.mjs +0 -1
  870. package/dist/chunks/teamHelpers-1.0.0-y8yt4e97.mjs +0 -1
  871. package/dist/chunks/teammateModeSnapshot-1.0.0-jh735d3n.mjs +0 -1
  872. package/dist/chunks/teleport-1.0.0-bzwkasyj.mjs +0 -1
  873. package/dist/chunks/terminalSetup-1.0.0-2qt7jmby.mjs +0 -1
  874. package/dist/chunks/theme-1.0.0-816wk46b.mjs +0 -1
  875. package/dist/chunks/thinkback-1.0.0-pd8j75pe.mjs +0 -1
  876. package/dist/chunks/thinkback-play-1.0.0-12vzc4z7.mjs +0 -1
  877. package/dist/chunks/toolPool-1.0.0-t2zxxykn.mjs +0 -1
  878. package/dist/chunks/toolSearch-1.0.0-rbhxbka0.mjs +0 -1
  879. package/dist/chunks/tools-1.0.0-nrq3vd97.mjs +0 -1
  880. package/dist/chunks/trustedDevice-1.0.0-6g29zvt4.mjs +0 -1
  881. package/dist/chunks/turndown.cjs-1.0.0-t4z74ffh.mjs +0 -69
  882. package/dist/chunks/types-1.0.0-r57xzz3c.mjs +0 -1
  883. package/dist/chunks/ultrareviewCommand-1.0.0-6pf7httb.mjs +0 -4
  884. package/dist/chunks/update-1.0.0-1w4hdnvy.mjs +0 -86
  885. package/dist/chunks/upgrade-1.0.0-mhees3sb.mjs +0 -1
  886. package/dist/chunks/upload-1.0.0-ygzb4x1e.mjs +0 -7
  887. package/dist/chunks/upstreamproxy-1.0.0-45c7jm65.mjs +0 -14
  888. package/dist/chunks/url-handler-napi-1.0.0-70v3ac60.mjs +0 -1
  889. package/dist/chunks/usage-1.0.0-dsczssy3.mjs +0 -1
  890. package/dist/chunks/util-1.0.0-850fye79.mjs +0 -1
  891. package/dist/chunks/utils-1.0.0-h1hjbg4p.mjs +0 -1
  892. package/dist/chunks/vim-1.0.0-c11dkxg5.mjs +0 -1
  893. package/dist/chunks/watcher-1.0.0-1ebvkj1f.mjs +0 -1
  894. package/dist/chunks/wiki-1.0.0-98wnrwr1.mjs +0 -132
  895. package/dist/chunks/workflows-1.0.0-2hsy70he.mjs +0 -1
  896. package/dist/chunks/worktree-1.0.0-jp0532r4.mjs +0 -1
  897. package/dist/chunks/worktreeModeEnabled-1.0.0-2taefyj5.mjs +0 -1
  898. package/dist/chunks/wrapper-1.0.0-ts5ncxbc.mjs +0 -7
  899. package/dist/claudin-vscode.vsix +0 -0
  900. package/scripts/postinstall-warmup.mjs +0 -70
  901. package/scripts/v8cache-gc.mjs +0 -84
  902. /package/dist/chunks/{cli-1.0.0-pjxedgeq.mjs → cli-1.0.4-1eb2472e.mjs} +0 -0
  903. /package/dist/chunks/{cli-1.0.0-23p005ex.mjs → cli-1.0.4-a2brsa8c.mjs} +0 -0
  904. /package/dist/chunks/{cli-1.0.0-ng3sgcf4.mjs → cli-1.0.4-fyekx70j.mjs} +0 -0
  905. /package/dist/chunks/{cli-1.0.0-fdefz72m.mjs → cli-1.0.4-jrvveh6t.mjs} +0 -0
  906. /package/dist/chunks/{cli-1.0.0-pkb60kgh.mjs → cli-1.0.4-rh4j3s0t.mjs} +0 -0
  907. /package/dist/chunks/{cli-1.0.0-2fzd6cys.mjs → cli-1.0.4-rhq4w2pj.mjs} +0 -0
  908. /package/dist/chunks/{cli-1.0.0-msy9nakp.mjs → cli-1.0.4-sx5bf3zy.mjs} +0 -0
  909. /package/dist/chunks/{cli-1.0.0-fgb643ta.mjs → cli-1.0.4-zjh4h68p.mjs} +0 -0
@@ -0,0 +1,50 @@
1
+ import{Ac as Kc,Bc as da}from"./cli-1.0.4-rtwmycp0.mjs";import{Cc as An,Dc as Ht,Ec as Xt,Fc as Zc,Hc as ea}from"./cli-1.0.4-rkb3rkfa.mjs";import{Ic as wt,Lc as ma}from"./cli-1.0.4-t0zs4sf6.mjs";import{Cx as Jc,DH as Hn,EF as yt,EH as Au,Ex as ra,FF as Kn,GH as la,HH as oa,Kp as yc,Lp as Wu,Lw as Qc,Mp as Cc,Mw as Gc,Np as bc,Nw as Vc,OF as V,Op as wc,Ow as Yc,PF as gu,Pp as Oc,Pw as ha,QF as ia,Qp as D,Rp as mn,Sp as Uu,Tp as Lc,Vp as zc,Wp as Nc,Yp as fc,dG as nc,eG as Gu,fG as cc,gG as uc,hG as ac,iG as Vu,nq as Mc,oq as aa}from"./cli-1.0.4-jvp0mp87.mjs";import{GX as v,IX as ca,UX as Fc,VX as ua}from"./cli-1.0.4-c9sh44ne.mjs";import{I0 as Ln,b0 as g,d0 as i}from"./cli-1.0.4-9ra8j4rt.mjs";import{L1 as Nn,M1 as Mn,N1 as Qn,O1 as Gn,P1 as Vn,Q1 as su,T1 as Yn,X1 as Jn,Y1 as $c,Z1 as Zn}from"./cli-1.0.4-gyjecspm.mjs";import{N2 as dt,O2 as u,P2 as y,Q2 as Qt}from"./cli-1.0.4-x8jnn75c.mjs";import{R2 as Vt}from"./cli-1.0.4-5e2v63sy.mjs";import{m3 as lc,n3 as Hu}from"./cli-1.0.4-vnf5ysx9.mjs";import{D3 as $n,F3 as Ou}from"./cli-1.0.4-0vwtrvvh.mjs";import{$da as Rt,Bea as Sc,Cea as gn,Lda as qc,Mda as bt,Nda as ta,Oda as Tt,Pda as nt,Qea as na,Rda as W,Sda as Kt,Uda as ft,Vda as Cn,Wda as ct,Xda as At,Y8 as Ct,Z8 as vu,aea as bn,cea as wn,gea as Fn,lea as hn,mea as xn,nea as jn,oea as Yt,pea as rn,qea as Dn,rea as an,sea as vn,tea as tc,uea as Qu,vea as On,wea as rc,xea as sn,zea as ic}from"./cli-1.0.4-q0rnwhn4.mjs";import{Dja as ut,Lja as on}from"./cli-1.0.4-ex22h376.mjs";import{Tqa as Gt,Uqa as Du,Xqa as j}from"./cli-1.0.4-rhq4w2pj.mjs";function zu(t,c=tn,a){let r=nt().find((m)=>m.provider==="openai"&&m.extras?.githubToken!==void 0);if(r)return At(r.id,{provider:"openai",name:r.name,baseUrl:a||r.baseUrl,model:r.model||c,apiKey:t,extras:{...r.extras,githubToken:t}}),Rt(r.id),{mode:"updated"};return ct({provider:"openai",name:"GitHub Copilot",baseUrl:a||Ru,model:c,apiKey:t,extras:{githubToken:t}},{makeActive:!0}),{mode:"created"}}function Tn({onDone:t,onBack:c,onChangeAPIKey:a}){let r=Yn()?.trim()?"already-authed":"menu",[m,e]=E.useState(r),[A,O]=E.useState(null),[X,w]=E.useState(""),[z,S]=E.useState(0),[L,Z]=E.useState(null),N=E.useCallback(async(Y,q=tn,tt,f)=>{let T=Jn(Y,tt,f?.enterpriseDomain);if(!T.success){O(T.warning??"Could not save token to secure storage."),e("error");return}zu(Y,q,f?.baseUrl),$n(),a?.(),t("GitHub Copilot onboard complete. Copilot token stored in secure storage and as the active /provider profile.",{display:"user"})},[a,t]),C=E.useCallback(async(Y)=>{e("device-busy"),O(null),Z(null);try{let q=await Mn({domain:Y});Z({user_code:q.user_code,verification_uri:q.verification_uri}),await Gn(q.verification_uri);let tt=await Qn(q.device_code,{initialInterval:q.interval,timeoutSeconds:q.expires_in,domain:Y}),f=await Vn(tt,{domain:Y});await N(f.token,tn,tt,{baseUrl:f.endpoints.api?.replace(/\/+$/,"")||void 0,enterpriseDomain:Y})}catch(q){O(q instanceof Error?q.message:String(q)),e("error")}},[N]);if(m==="already-authed")return y(g,{flexDirection:"column",gap:1,children:[u(i,{bold:!0,children:"GitHub Copilot"}),u(i,{children:"You are already signed in to GitHub Copilot."}),u(i,{dimColor:!0,children:'Choose "Sign in again" to refresh your token, or go back to the provider menu.'}),u(V,{options:[{label:"Sign in again",value:"sign-in-again"},{label:"Sign in with GitHub Enterprise",value:"enterprise"},{label:c?"Back to /provider menu":"Cancel",value:"back"}],onChange:(q)=>{if(q==="sign-in-again"){C();return}if(q==="enterprise"){e("enterprise-domain");return}if(c){c();return}t("GitHub onboard cancelled",{display:"system"})}})]});if(m==="enterprise-domain")return y(g,{flexDirection:"column",gap:1,children:[u(i,{bold:!0,children:"GitHub Enterprise sign-in"}),u(i,{dimColor:!0,children:"Enter your GitHub Enterprise domain (e.g. github.acme.com). Leave empty for github.com."}),y(g,{flexDirection:"row",gap:1,children:[u(i,{children:">"}),u(yt,{value:X,onChange:w,onSubmit:()=>{let q=Nn(X);if(!q){C();return}C(q)},onExit:()=>e(r),focus:!0,showCursor:!0,placeholder:"github.acme.com",columns:80,cursorOffset:z,onChangeCursorOffset:S})]}),u(i,{dimColor:!0,children:"Press Enter to continue. Press Esc to go back."})]});if(m==="error"&&A)return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"red",children:A}),u(V,{options:[{label:c?"Back to /provider menu":"Back to menu",value:"back"},{label:"Exit",value:"exit"}],onChange:(q)=>{if(q==="back"){if(c){c();return}e("menu"),O(null);return}t("GitHub onboard cancelled",{display:"system"})}})]});if(m==="device-busy")return y(g,{flexDirection:"column",gap:1,children:[u(i,{children:"GitHub Copilot sign-in"}),L?y(dt,{children:[y(i,{children:["Enter code ",u(i,{bold:!0,children:L.user_code})," at"," ",L.verification_uri]}),u(i,{dimColor:!0,children:"A browser window may have opened. Waiting for authorization..."})]}):u(i,{dimColor:!0,children:"Requesting device code from GitHub..."}),u(Hn,{})]});return y(g,{flexDirection:"column",gap:1,children:[u(i,{bold:!0,children:"GitHub Copilot setup"}),u(i,{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."}),u(V,{options:[{label:"Sign in with browser",value:"device"},{label:"Sign in with GitHub Enterprise",value:"enterprise"},{label:c?"Back to /provider menu":"Cancel",value:"cancel"}],onChange:(Y)=>{if(Y==="cancel"){if(c){c();return}t("GitHub onboard cancelled",{display:"system"});return}if(Y==="enterprise"){e("enterprise-domain");return}C()}})]})}var E,tn="github:copilot",Ru="https://api.githubcopilot.com";var Wn=j(()=>{gu();Au();Kn();Ln();su();Zn();Ou();Fn();Qt();E=Gt(Vt(),1)});function En(t){return[t.name,t.family??"",...t.families??[],t.parameterSize??"",t.quantizationLevel??""].join(" ").toLowerCase()}function zt(t,c){return c.some((a)=>t.includes(a))}function _u(t){return!zt(En(t),Un)}function qu(t){return t.find(_u)??null}function nn(t){let a=`${t.parameterSize??""} ${t.name}`.toLowerCase().match(/(\d+(?:\.\d+)?)\s*b\b/);if(a?.[1])return Number(a[1]);if(typeof t.sizeBytes==="number"&&t.sizeBytes>0)return Number((t.sizeBytes/1e9).toFixed(1));return null}function Su(t){return(t.quantizationLevel??t.name).toLowerCase()}function Fu(t,c,a){if(t===null)return a.push("unknown size"),0;if(c==="latency"){if(t<=4)return a.push("tiny model for low latency"),32;if(t<=8)return a.push("small model for fast responses"),26;if(t<=14)return a.push("mid-sized model with acceptable latency"),16;if(t<=24)return a.push("larger model may be slower"),8;return a.push("large model likely slower locally"),t<=40?0:-8}if(c==="coding"){if(t>=7&&t<=14)return a.push("strong coding size tier"),24;if(t>14&&t<=34)return a.push("large coding-capable size tier"),28;if(t>34)return a.push("very large model with higher quality potential"),18;return a.push("compact model may trade off coding depth"),12}if(t>=7&&t<=14)return a.push("great balanced size tier"),26;if(t>=3&&t<7)return a.push("compact balanced size tier"),18;if(t>14&&t<=24)return a.push("high quality balanced size tier"),20;if(t>24)return a.push("large model for quality-first usage"),10;return a.push("very small model for general usage"),8}function $u(t,c,a){let r=Su(t);if(r.includes("q4"))return a.push("efficient Q4 quantization"),c==="latency"?8:4;if(r.includes("q5"))return a.push("balanced Q5 quantization"),c==="latency"?6:5;if(r.includes("q8"))return a.push("higher quality Q8 quantization"),c==="latency"?2:5;return 0}function Lu(t,c,a){if(c.score!==t.score)return c.score-t.score;let r=nn(t)??Number.POSITIVE_INFINITY,m=nn(c)??Number.POSITIVE_INFINITY;if(a==="latency")return r-m;if(a==="coding")return m-r;let e=14;return Math.abs(r-e)-Math.abs(m-e)}function cn(t,c){return t.map((a)=>{let r=En(a),m=[],e=0;if(zt(r,Un))e-=40,m.push("not a chat-first model");if(zt(r,fu))e+=c==="coding"?24:c==="balanced"?10:4,m.push("coding-oriented model family");if(zt(r,Xu))e+=c==="latency"?4:c==="coding"?6:8,m.push("strong general-purpose model family");if(zt(r,ku))e+=c==="latency"?2:6,m.push("chat/instruct tuned");if(r.includes("vision")||r.includes("vl"))e-=2,m.push("vision model adds extra overhead");e+=Fu(nn(a),c,m),e+=$u(a,c,m);let A=m.slice(0,3).join(", ");return{...a,score:e,reasons:m,summary:A}}).sort((a,r)=>Lu(a,r,c))}function Pn(t,c){return qu(cn(t,c))}var fu,Xu,ku,Un;var Bn=j(()=>{fu=["coder","codellama","codegemma","codestral","devstral","starcoder","deepseek-coder","qwen2.5-coder","qwen-coder"],Xu=["llama","qwen","mistral","gemma","phi","deepseek"],ku=["instruct","chat","assistant"],Un=["embed","embedding","rerank","bge","whisper"]});function Mu(t){let c=t.toLowerCase();return Nu.some((a)=>c.includes(a))}function un(t){try{let c=new URL(t);if(c.username)c.username="redacted";if(c.password)c.password="redacted";for(let a of c.searchParams.keys())if(Mu(a))c.searchParams.set(a,"redacted");return c.toString()}catch{return t.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 Nu;var In=j(()=>{Nu=["api_key","apikey","key","token","access_token","refresh_token","signature","sig","secret","password","passwd","pwd","auth","authorization"]});function Yu(t){let c=`http://localhost:${t.port}/auth/callback`,a=new URL(`${hn}/oauth/authorize`);return a.searchParams.append("response_type","code"),a.searchParams.append("client_id",rn()),a.searchParams.append("redirect_uri",c),a.searchParams.append("scope",xn),a.searchParams.append("code_challenge",t.codeChallenge),a.searchParams.append("code_challenge_method","S256"),a.searchParams.append("id_token_add_organizations","true"),a.searchParams.append("codex_cli_simplified_flow","true"),a.searchParams.append("state",t.state),a.searchParams.append("originator",jn),a.toString()}function Ju(){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 Zu(t){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>${vn(t)}</p>
31
+ <p>You can close this window and try again in Claudin.</p>
32
+ </body>
33
+ </html>`}function pn(){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 Ku(t){let c=`http://localhost:${t.port}/auth/callback`,a=new URLSearchParams({grant_type:"authorization_code",code:t.authorizationCode,redirect_uri:c,client_id:rn(),code_verifier:t.codeVerifier}),r=await fetch(`${hn}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:a,signal:t.signal?AbortSignal.any([t.signal,AbortSignal.timeout(15000)]):AbortSignal.timeout(15000)});if(!r.ok){let w=await r.text().catch(()=>"");throw Error(w.trim()?`Codex OAuth token exchange failed (${r.status}): ${w.trim()}`:`Codex OAuth token exchange failed with status ${r.status}.`)}let m=await r.json(),e=Yt(m.access_token),A=Yt(m.refresh_token);if(!e||!A)throw Error("Codex OAuth completed, but the token response was missing credentials.");let O=Yt(m.id_token);return{apiKey:O?await tc(O).catch(()=>{return}):void 0,accessToken:e,refreshToken:A,idToken:O,accountId:an(O)??an(e)}}class ln{authCodeListener=null;port=null;tokenExchangeAbortController=null;buildCancellationError(){return Error("Codex OAuth flow was cancelled.")}async startOAuthFlow(t){let c=cc(),a=Dn(),r=new nc("/auth/callback");this.authCodeListener=r,this.port=null;try{let m=await r.start(a);this.port=m;let e=ac(),A=await uc(c),O=Yu({port:m,codeChallenge:A,state:e});try{let X=await r.waitForAuthorization(e,async()=>{await t(O)}),w=new AbortController;this.tokenExchangeAbortController=w;let z;try{z=await Ku({authorizationCode:X,codeVerifier:c,port:m,signal:w.signal})}finally{if(this.tokenExchangeAbortController===w)this.tokenExchangeAbortController=null}if(this.authCodeListener!==r)throw this.buildCancellationError();return r.handleSuccessRedirect([],(S)=>{S.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),S.end(Ju())}),z}catch(X){let w=this.authCodeListener===r?X:this.buildCancellationError();if(r.hasPendingResponse()){let z=w instanceof Error&&w.message==="Codex OAuth flow was cancelled.";r.handleErrorRedirect((S)=>{S.writeHead(z?200:400,{"Content-Type":"text/html; charset=utf-8"}),S.end(z?pn():Zu(w instanceof Error?w.message:String(w)))})}throw w}finally{this.cleanup()}}catch(m){let e=m instanceof Error?m.message:String(m);if(e.includes("EADDRINUSE")||e.includes(String(a)))throw Error(`Codex OAuth needs localhost:${a} for its callback. Close any app already using that port and try again.`);throw m}}cleanup(){let t=this.buildCancellationError();if(this.tokenExchangeAbortController?.abort(t),this.tokenExchangeAbortController=null,this.authCodeListener?.hasPendingResponse())this.authCodeListener.handleErrorRedirect((c)=>{c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(pn())});this.authCodeListener?.cancelPendingAuthorization(t),this.authCodeListener=null,this.port=null}}var hc=j(()=>{Gu();Vu();Qu()});function Tu(){return new ln}function oc(t){let{onAuthenticated:c}=t,a=t.deps?.createOAuthService??Tu,r=t.deps?.openBrowser??lc,m=t.deps?.saveCodexCredentials??rc,e=t.deps?.isBareMode??ut,[A,O]=Jt.useState({state:"starting"});return Jt.useEffect(()=>{if(e()){O({state:"error",message:"Codex OAuth is unavailable in --bare because secure storage is disabled."});return}let X=!1,w=a();return w.startOAuthFlow(async(z)=>{if(X)return;O({state:"waiting",authUrl:z,browserOpened:null});let S=await r(z);if(X)return;O({state:"waiting",authUrl:z,browserOpened:S})}).then(async(z)=>{if(X)return;await c(z,(L)=>{let Z=m({apiKey:z.apiKey,accessToken:z.accessToken,refreshToken:z.refreshToken,idToken:z.idToken,accountId:z.accountId,profileId:L?.profileId});if(!Z.success)throw Error(Z.warning??"Codex OAuth succeeded, but credentials could not be saved securely.")})}).catch((z)=>{if(X)return;O({state:"error",message:z instanceof Error?z.message:String(z)})}),()=>{X=!0,w.cleanup()}},[a,e,c,r,m]),A}var Jt;var mc=j(()=>{hc();Hu();ic();on();Jt=Gt(Vt(),1)});function Ac(){return{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":yc()}}function dc(t,c){let a=Number(t);return Number.isFinite(a)&&a>0?a*1000:c}function Iu(t,c){if(c?.aborted)return Promise.resolve();return new Promise((a)=>{let r=setTimeout(()=>{c?.removeEventListener("abort",m),a()},t),m=()=>{clearTimeout(r),a()};c?.addEventListener("abort",m,{once:!0})})}async function pu(t){let c=t?.fetchImpl??fetch,a=t?.signal?AbortSignal.any([t.signal,AbortSignal.timeout(15000)]):AbortSignal.timeout(15000),r=await c(bc,{method:"POST",headers:Ac(),body:new URLSearchParams({client_id:mn(),scope:Oc}).toString(),signal:a});if(!r.ok){let X=await r.text().catch(()=>"");throw Error(`xAI device code request failed (${r.status})${X?`: ${X.trim()}`:""}`)}let m=await r.json(),e=D(m.device_code),A=D(m.user_code),O=D(m.verification_uri);if(!e||!A||!O)throw Error("xAI device code response is missing device_code / user_code / verification_uri.");return{device_code:e,user_code:A,verification_uri:O,verification_uri_complete:D(m.verification_uri_complete),expires_in:typeof m.expires_in==="number"&&m.expires_in>0?m.expires_in:gc/1000,interval:typeof m.interval==="number"&&m.interval>0?m.interval:sc/1000}}async function xu(t,c){let a=c?.fetchImpl??fetch,r=c?.sleep??Iu,m=c?.now??(()=>Date.now()),e=dc(t.expires_in,gc),A=m()+e,O=Math.max(dc(t.interval,sc),Eu);while(m()<A){if(c?.signal?.aborted)throw Error("xAI device authorization was cancelled.");let X=await a(Cc,{method:"POST",headers:Ac(),body:new URLSearchParams({grant_type:wc,client_id:mn(),device_code:t.device_code}).toString(),signal:c?.signal});if(X.ok){let L=await X.json(),Z=D(L.access_token),N=D(L.refresh_token);if(!Z||!N)throw Error("xAI OAuth completed, but the token response was missing credentials.");let C=typeof L.expires_in==="number"&&Number.isFinite(L.expires_in)&&L.expires_in>0?L.expires_in:3600;return{accessToken:Z,refreshToken:N,idToken:D(L.id_token),expiresAt:m()+C*1000}}let w=await X.json().catch(()=>({})),z=Math.max(0,A-m());if(w.error==="authorization_pending"){await r(Math.min(O+ec,z),c?.signal);continue}if(w.error==="slow_down"){O=Math.min(O+Pu,Bu),await r(Math.min(O+ec,z),c?.signal);continue}if(w.error==="access_denied"||w.error==="authorization_denied")throw Error("xAI device authorization was denied.");if(w.error==="expired_token")throw Error("xAI device code expired - please re-run login.");let S=w.error_description??w.error??"";throw Error(`xAI device token exchange failed (${X.status})${S?`: ${S}`:""}`)}throw Error("xAI device authorization timed out.")}class en{abortController=null;async startDeviceFlow(t){let c=new AbortController;this.abortController=c;try{let a=await pu({signal:c.signal});return await t(a),await xu(a,{signal:c.signal})}finally{if(this.abortController===c)this.abortController=null}}cleanup(){this.abortController?.abort(Error("xAI device authorization was cancelled.")),this.abortController=null}}var sc=5000,Eu=1000,Pu=5000,Bu=60000,gc=300000,ec=3000;var Rc=j(()=>{Wu();Uu()});function ju(){return new en}function Xc(t){let{onAuthenticated:c}=t,a=t.deps?.createOAuthService??ju,r=t.deps?.saveXaiCredentials??zc,m=t.deps?.isBareMode??ut,[e,A]=Zt.useState({state:"starting"});return Zt.useEffect(()=>{if(m()){A({state:"error",message:"xAI OAuth is unavailable in --bare because secure storage is disabled."});return}let O=!1,X=a();return X.startDeviceFlow(async(w)=>{if(O)return;A({state:"waiting",userCode:w.user_code,verificationUri:w.verification_uri,verificationUriComplete:w.verification_uri_complete})}).then(async(w)=>{if(O)return;await c(w,(S)=>{let L=r({accessToken:w.accessToken,refreshToken:w.refreshToken,idToken:w.idToken,expiresAt:w.expiresAt,profileId:S?.profileId});if(!L.success)throw Error(L.warning??"xAI OAuth succeeded, but credentials could not be saved securely.")})}).catch((w)=>{if(O)return;A({state:"error",message:w instanceof Error?w.message:String(w)})}),()=>{O=!0,X.cleanup()}},[a,m,c,r]),e}var Zt;var kc=j(()=>{Rc();on();fc();Zt=Gt(Vt(),1)});function sa(t){return{name:t.name,baseUrl:t.baseUrl,model:t.model,apiKey:t.apiKey??""}}function ga(t){let c=Tt(t);return{name:c.name,baseUrl:c.baseUrl,model:c.model,apiKey:c.apiKey??""}}function Aa(t){let c={};for(let a of t.split(/\r?\n/)){let r=a.trim();if(!r)continue;let m=r.indexOf(":");if(m<=0)continue;let e=r.slice(0,m).trim(),A=r.slice(m+1).trim();if(e&&A)c[e]=A}return c}function Ra(t){if(!t)return"";return Object.entries(t).map(([c,a])=>`${c}: ${a}`).join(`
49
+ `)}function za(t,c){let a={},r=t.awsRegion?.trim();if(r)a.awsRegion=r;let m=t.gcpProject?.trim();if(m)a.gcpProject=m;let e=t.gcpRegion?.trim();if(e)a.gcpRegion=e;let A=t.azureResource?.trim();if(A)a.azureResource=A;let O=Aa(c);if(Object.keys(O).length>0)a.customHeaders=O;return Object.keys(a).length>0?a:void 0}function Xa(t,c){let a=c?" (active)":"",r=t.apiKey?"key set":"no key",m=t.provider==="anthropic"?"anthropic":"openai-compatible",e=qc(t.model),A=e.length<=3?e.join(", "):`${e[0]}, ${e[1]} + ${e.length-2} more`;return`${m} · ${t.baseUrl} · ${A} · ${r}${a}`}function ka(t,c){if(t.state==="unreachable")return`Could not reach Atomic Chat at ${un(c)}. Start the Atomic Chat app first, or enter the endpoint manually.`;if(t.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 _a(t,c){if(t.state==="unreachable")return`Could not reach Ollama at ${un(c)}. Start Ollama first, or enter the endpoint manually.`;if(t.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(t.state==="generation_failed"){let a=t.probeModel??"the selected model",r=t.detail?` Details: ${t.detail}.`:"";return`Ollama is reachable and models are installed, but a generation probe failed for ${a}.${r} Run "ollama run ${a}" once and retry, or enter details manually.`}return""}function yn(t,c){if(!c)return;return t.find((a)=>a.id===c)}function _c(t,c){return Boolean(t&&c&&t.id===c)}function qa({onBack:t,onConfigured:c}){let a=b.useCallback(async(m,e)=>{await c(m,e)},[c]);v("confirm:no",t,[t]);let r=oc({onAuthenticated:a});if(r.state==="error")return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"error",bold:!0,children:"Codex OAuth failed"}),u(i,{children:r.message}),u(i,{dimColor:!0,children:"Press Enter or Esc to go back."}),u(V,{options:[{value:"back",label:"Back",description:"Return to provider presets"}],onChange:t,onCancel:t,visibleOptionCount:1})]});return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Codex OAuth"}),u(i,{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"?u(i,{dimColor:!0,children:"Starting local callback and preparing your browser..."}):r.browserOpened===!1?y(dt,{children:[u(i,{color:"warning",children:"Browser did not open automatically. Visit this URL to continue:"}),u(i,{children:r.authUrl})]}):r.browserOpened===!0?y(dt,{children:[u(i,{dimColor:!0,children:"Browser opened. Finish the ChatGPT sign-in there and this setup will complete automatically."}),u(i,{children:r.authUrl})]}):u(i,{dimColor:!0,children:"Opening your browser..."}),u(i,{dimColor:!0,children:"Press Esc to cancel and go back."})]})}function Sa({onBack:t,onConfigured:c}){let a=b.useCallback(async(m,e)=>{await c(m,e)},[c]);v("confirm:no",t,[t]);let r=Xc({onAuthenticated:a});if(r.state==="error")return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"error",bold:!0,children:"xAI OAuth failed"}),u(i,{children:r.message}),u(i,{dimColor:!0,children:"Press Enter or Esc to go back."}),u(V,{options:[{value:"back",label:"Back",description:"Return to provider presets"}],onChange:t,onCancel:t,visibleOptionCount:1})]});return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"xAI / Grok OAuth"}),r.state==="starting"?u(i,{dimColor:!0,children:"Requesting a device code from xAI..."}):y(dt,{children:[y(i,{children:["Open this URL on any device:"," ",u(i,{bold:!0,children:r.verificationUri})]}),y(i,{children:["Enter code ",u(i,{bold:!0,children:r.userCode})]}),r.verificationUriComplete&&r.verificationUriComplete!==r.verificationUri?y(i,{dimColor:!0,children:["Or open this prefilled URL: ",r.verificationUriComplete]}):null,u(i,{dimColor:!0,children:"Waiting for you to authorize in the browser..."})]}),u(i,{dimColor:!0,children:"Press Esc to cancel and go back."})]})}function Sh({mode:t,onDone:c}){let a=Jc(),[r,m]=b.useState([]),[e,A]=b.useState(),[O,X]=b.useState(),[w,z]=b.useState(!1),[S,L]=b.useState(),Z=b.useRef(0),[N,C]=b.useState(t==="first-run"?"select-preset":"menu"),[ht,Y]=b.useState(null),[q,tt]=b.useState("openai"),[f,T]=b.useState(()=>ga("ollama")),[Wt,kt]=b.useState({}),[Rn,Ut]=b.useState(""),[Hc,Tc]=b.useState(0),[Wc,Uc]=b.useState(0),[Et,zn]=b.useState(null),[rt,Ot]=b.useState(0),[it,P]=b.useState(0),[Ec,B]=b.useState(0),[fn,M]=b.useState(),[lt,R]=b.useState(),[Pc,Bc]=b.useState(),[Xn,_t]=b.useState(!1),[st,gt]=b.useState(),[I,qt]=b.useState({state:"idle"}),[p,St]=b.useState({state:"idle"}),[x,Pt]=b.useState({state:"idle"}),[Ic,pc]=b.useState(!0),[xc,H]=b.useState(!1),Bt=b.useRef(!1),[It,pt]=b.useState(()=>Xt()),[kn,jc]=b.useState(()=>Zc());b.useEffect(()=>{queueMicrotask(()=>{let n=nt(),h=W()?.id;m(n),A(h),X(Kt()),L(Cn()),z(ft()),pc(!1)})},[]);let ot=at[it]??at[0],Ft=ot.key,Dc=f[Ft],xt=r.length>0,$t=xt,_n=b.useMemo(()=>[{value:"add",label:"Add provider",description:"Create a new provider profile"},...It?[{value:"import-legacy",label:"Import from Claude Code",description:"Copy ~/.claude/ tokens, settings, skills, agents, plugins."}]:[],{value:"activate",label:"Set active provider (Global)",description:S?`Currently: ${r.find((n)=>n.id===S)?.name??"unknown"}`:"Default profile for projects without an override",disabled:!$t},{value:"activate-project",label:"Set active provider (Project)",description:O?`Currently: ${r.find((n)=>n.id===O)?.name??"unknown"} (this project)`:"Override the global default for this project only",disabled:!$t},...w?[{value:"clear-project-override",label:"Clear project provider override",description:O?"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:!xt},{value:"delete",label:"Delete provider",description:"Remove a provider profile",disabled:!$t},...Xn?[{value:"logout-codex-oauth",label:"Log out Codex OAuth",description:"Clear securely stored Codex OAuth credentials"}]:[],{value:"done",label:"Done",description:"Return to chat"}],[$t,xt,Xn,It,S,O,r]),jt=b.useCallback(()=>{if(ut()){Z.current+=1,_t(!1),gt(void 0);return}let n=++Z.current;(async()=>{let h=await On();if(n!==Z.current)return;_t(Boolean(h?.apiKey||h?.accessToken||h?.refreshToken||h?.idToken)),gt(h?.profileId)})()},[]);b.useEffect(()=>{return jt(),()=>{Z.current+=1}},[jt]),b.useEffect(()=>{if(N!=="select-ollama-model")return;let n=!1;return qt({state:"loading"}),(async()=>{let h=await Yc({baseUrl:f.baseUrl});if(h.state!=="ready"){if(!n)qt({state:"unavailable",message:_a(h,f.baseUrl)});return}let o=cn(h.models,"balanced"),l=Pn(h.models,"balanced");if(!n)qt({state:"ready",defaultValue:l?.name??o[0]?.name,options:o.map((d)=>({label:d.name,value:d.name,description:d.summary}))})})(),()=>{n=!0}},[f.baseUrl,N]),b.useEffect(()=>{if(N!=="select-atomic-chat-model")return;let n=!1;return St({state:"loading"}),(async()=>{let h=await Vc({baseUrl:f.baseUrl});if(h.state!=="ready"){if(!n)St({state:"unavailable",message:ka(h,f.baseUrl)});return}if(!n)St({state:"ready",defaultValue:h.models[0],options:h.models.map((o)=>({label:o,value:o}))})})(),()=>{n=!0}},[f.baseUrl,N]),b.useEffect(()=>{if(N!=="select-openai-model")return;let n=!1;return Pt({state:"loading"}),(async()=>{let h=await Qc({baseUrl:f.baseUrl,apiKey:f.apiKey||void 0});if(n)return;if(!h||h.length===0){Pt({state:"unavailable",message:"Couldn't list models from this provider. Enter the model id manually, or go back to check the base URL and API key."});return}let{options:o,defaultValue:l}=Gc(h,f.model);Pt({state:"ready",options:o,defaultValue:l})})(),()=>{n=!0}},[f.baseUrl,f.apiKey,N]);function Q(){if(Bt.current)return;Bt.current=!0,queueMicrotask(()=>{let n=nt();m(n),A(W()?.id),X(Kt()),L(Cn()),z(ft()),jt(),Bt.current=!1})}function mt(){return null}function Dt(n){if(n.activationWarning)return`${n.prefix}. Saved for next startup. Warning: ${n.warnings.join("; ")}.`;if(n.warnings.length>0)return`${n.prefix}. Claudin switched to it for this session with warnings: ${n.warnings.join("; ")}.`;return`${n.prefix}. Claudin switched to it for this session.`}async function vt(n){if(n?.accessToken&&n.accountId)return null;let h=await On();if(!h)return"stored Codex OAuth credentials could not be loaded";if(!h.accountId)return"stored Codex OAuth credentials are missing a ChatGPT account id";return null}function qn(){Mc()}async function vc(n){let h="provider";H(!0),M("Activating provider...");try{await new Promise((U)=>queueMicrotask(U));let o=ft(),l=Rt(n);if(!l){R("Could not change active provider."),H(!1),k();return}let d=o?W()??l:l,s=bt(d.model);if(!o)a((U)=>({...U,mainLoopModel:s,mainLoopModelForSession:null}));h=l.name;let _=mt(),J=_c(l,st),$=J?await vt():null;Q();let K=o&&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)`:"",F=J?Dt({prefix:`Active provider: ${l.name}${K}`,activationWarning:$,warnings:[$,_?`could not clear startup provider override (${_})`:null].filter((U)=>Boolean(U))}):_?`Active provider: ${l.name}${K}. Warning: could not clear startup provider override (${_}).`:`Active provider: ${l.name}${K}`;M(F),H(!1),c({action:"activated",activeProfileId:l.id,activeProviderName:l.name,activeProviderModel:s,message:`Provider switched to ${l.name} (${s})`}),k()}catch(o){Q(),M(void 0),H(!1);let l=o instanceof Error?o.message:String(o);R(`Could not finish activating ${h}: ${l}`),k()}}async function tu(){H(!0),M("Clearing project provider override...");try{await new Promise((h)=>queueMicrotask(h)),bn(null),Q();let n=W();if(n){let h=bt(n.model);wt(),a((o)=>({...o,mainLoopModel:h,mainLoopModelForSession:null})),M(`Project override cleared. Using global default: ${n.name}.`),H(!1),c({action:"activated",activeProfileId:n.id,activeProviderName:n.name,activeProviderModel:h,message:`Project override cleared — using ${n.name} (${h})`}),k()}else M("Project provider override cleared. No global default set."),H(!1),c({action:"saved",message:"Project provider override cleared. No global default set."}),k()}catch(n){Q(),M(void 0),H(!1);let h=n instanceof Error?n.message:String(n);R(`Could not clear project provider override: ${h}`),k()}}async function nu(n){let h="provider";H(!0),M("Setting provider for this project...");try{await new Promise((F)=>queueMicrotask(F));let o=Kt(),l=bn(n);if(!l){R("Could not set project provider override."),H(!1),k();return}let d=bt(l.model);if(o===l.id)wt();a((F)=>({...F,mainLoopModel:d,mainLoopModelForSession:null})),h=l.name;let s=mt(),_=_c(l,st),J=_?await vt():null;Q();let $=`Active provider for this project: ${l.name}. Other projects keep the global default.`,K=_?Dt({prefix:$,activationWarning:J,warnings:[J,s?`could not clear startup provider override (${s})`:null].filter((F)=>Boolean(F))}):s?`${$} Warning: could not clear startup provider override (${s}).`:$;M(K),H(!1),c({action:"activated",activeProfileId:l.id,activeProviderName:l.name,activeProviderModel:d,message:`Provider switched to ${l.name} (${d}) for this project`}),k()}catch(o){Q(),M(void 0),H(!1);let l=o instanceof Error?o.message:String(o);R(`Could not finish setting ${h} for this project: ${l}`),k()}}function k(){Bc("done"),C("menu")}function Lt(n){c({action:"cancelled",message:n})}function cu(n){let h=Tt(n),o={name:h.name,baseUrl:h.baseUrl,model:h.model,apiKey:h.apiKey??""};if(Y(null),tt(h.provider??"openai"),T(o),kt({}),Ut(""),zn(n),P(0),Ot(0),B(o.name.length),R(void 0),n==="ollama"){qt({state:"loading"}),C("select-ollama-model");return}if(n==="atomic-chat"){St({state:"loading"}),C("select-atomic-chat-model");return}if(n==="anthropic"){C("anthropic-auth-choice");return}if(n==="bedrock"||n==="vertex"||n==="foundry"){C("cloud-extras");return}C("form")}function uu(n){let h=r.find((l)=>l.id===n);if(!h)return;let o=sa(h);Y(n),tt(h.provider??"openai"),T(o),kt({awsRegion:h.extras?.awsRegion,gcpProject:h.extras?.gcpProject,gcpRegion:h.extras?.gcpRegion,azureResource:h.extras?.azureResource}),Ut(Ra(h.extras?.customHeaders)),zn(null),P(0),Ot(0),B(o.name.length),R(void 0),C("form")}function Nt(n=f){let h=za(Wt,Rn),o={provider:q,name:n.name,baseUrl:n.baseUrl,model:n.model,apiKey:n.apiKey,extras:h},l=ht?At(ht,o):ct(o,{makeActive:!0});if(!l){R("Could not save provider. Fill all required fields.");return}let d=W()?.id===l.id;if(d)wt(),a((K)=>({...K,mainLoopModel:bt(l.model),mainLoopModelForSession:null}));let s=d?mt():null;Q();let _=!ht&&ft()&&!d,J=_?W()?.name??"override target":null,$=ht?`Updated provider: ${l.name}`:_?`Added provider: ${l.name} (now global default — project keeps using ${J}; use "Clear project provider override" to apply here)`:`Added provider: ${l.name} (now active)`;if(M(s?`${$}. Warning: could not clear startup provider override (${s}).`:$),t==="first-run"){c({action:"saved",activeProfileId:l.id,message:`Provider configured: ${l.name}`});return}Y(null),P(0),R(void 0),k()}function au(){if(p.state==="loading"||p.state==="idle")return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Checking Atomic Chat"}),u(i,{dimColor:!0,children:"Looking for loaded Atomic Chat models..."})]});if(p.state==="unavailable")return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Atomic Chat setup"}),u(i,{dimColor:!0,children:p.message}),u(V,{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:(n)=>{if(n==="manual"){P(0),B(f.name.length),C("form");return}C("select-preset")},onCancel:()=>C("select-preset"),visibleOptionCount:2})]});return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Choose an Atomic Chat model"}),u(i,{dimColor:!0,children:"Pick one of the models loaded in Atomic Chat to save into a local provider profile."}),u(V,{options:p.options,defaultValue:p.defaultValue,defaultFocusValue:p.defaultValue,inlineDescriptions:!0,visibleOptionCount:Math.min(8,p.options.length),onChange:(n)=>{let h={...f,model:n};T(h),Nt(h)},onCancel:()=>C("select-preset")})]})}function hu(){if(I.state==="loading"||I.state==="idle")return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Checking Ollama"}),u(i,{dimColor:!0,children:"Looking for installed Ollama models..."})]});if(I.state==="unavailable")return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Ollama setup"}),u(i,{dimColor:!0,children:I.message}),u(V,{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:(n)=>{if(n==="manual"){P(0),B(f.name.length),C("form");return}C("select-preset")},onCancel:()=>C("select-preset"),visibleOptionCount:2})]});return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Choose an Ollama model"}),u(i,{dimColor:!0,children:"Pick one of the installed Ollama models to save into a local provider profile."}),u(V,{options:I.options,defaultValue:I.defaultValue,defaultFocusValue:I.defaultValue,inlineDescriptions:!0,visibleOptionCount:Math.min(8,I.options.length),onChange:(n)=>{let h={...f,model:n};T(h),Nt(h)},onCancel:()=>C("select-preset")})]})}function et(n){let h=at.findIndex((o)=>o.key===n);P(h<0?0:h),B(f[n].length),R(void 0),C("form")}function ru(){if(x.state==="loading"||x.state==="idle")return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Fetching models"}),u(i,{dimColor:!0,children:"Looking for models on your OpenAI-compatible provider…"}),u(i,{dimColor:!0,children:"Press Esc to enter the model manually."})]});if(x.state==="unavailable")return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Choose a model"}),u(i,{dimColor:!0,children:x.message}),u(V,{options:[{value:"manual",label:"Enter manually",description:"Type the model id yourself"},{value:"back",label:"Back",description:"Return to the API key step"}],onChange:(o)=>{if(o==="manual"){et("model");return}et("apiKey")},onCancel:()=>et("apiKey"),visibleOptionCount:2})]});let n=[...x.options,{value:dn,label:"Enter a model id manually",description:"Type an id the provider did not list"}],h=x.defaultValue??dn;return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Choose a model"}),u(i,{dimColor:!0,children:"Models from your OpenAI-compatible provider."}),u(V,{options:n,defaultValue:h,defaultFocusValue:h,inlineDescriptions:!0,visibleOptionCount:Math.min(8,n.length),onChange:(o)=>{if(o===dn){et("model");return}let l={...f,model:o};T(l),Sn(l)},onCancel:()=>et("apiKey")}),u(i,{dimColor:!0,children:"Enter to select · Esc to go back"})]})}function Sn(n){if(Et==="anthropic"||Et==="custom"){T(n),C("custom-headers");return}Nt(n)}function iu(n){let h=n.trim();if(!ot.optional&&h.length===0){R(`${ot.label} is required.`);return}let o={...f,[Ft]:h};if(T(o),R(void 0),it<at.length-1){let l=it+1,d=at[l]?.key??"name";if(d==="model"&&!ya.has(q)&&o.baseUrl.trim().length>0){C("select-openai-model");return}P(l),B(o[d].length);return}Sn(o)}function lu(){if(R(void 0),it>0){let n=it-1,h=at[n]?.key??"name";P(n),B(f[h].length);return}if(t==="first-run"){C("select-preset");return}k()}v("confirm:no",lu,{context:"Settings",isActive:N==="form"}),v("confirm:no",()=>et("model"),{context:"Settings",isActive:N==="select-openai-model"&&(x.state==="loading"||x.state==="idle")});function ou(){if(R(void 0),rt>0){Ot(rt-1);return}C("select-preset")}v("confirm:no",ou,{context:"Settings",isActive:N==="cloud-extras"}),v("confirm:no",()=>C("form"),{context:"Settings",isActive:N==="custom-headers"}),v("confirm:no",()=>C("select-preset"),{context:"Settings",isActive:N==="anthropic-auth-choice"||N==="anthropic-oauth"});function mu(){let n=!ut(),h=[...It?[{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)"},{value:"cloudflare-workers-ai",label:"Cloudflare Workers AI",description:"Cloudflare Workers AI (OpenAI-compatible); set your account ID in the base URL"},{value:"cloudflare-ai-gateway",label:"Cloudflare AI Gateway",description:"Cloudflare AI Gateway unified endpoint; set your account ID in the base URL"},...n?[{value:"codex-oauth",label:"Codex OAuth",description:"Sign in with ChatGPT in your browser and store Codex credentials securely"},{value:"xai-oauth",label:"xAI / Grok (OAuth)",description:"Sign in with xAI in your browser and store Grok 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:"zai",label:"Z.AI (GLM Coding Plan)",description:"Z.AI GLM Coding Plan (OpenAI-compatible)"},{value:"custom",label:"Custom",description:"Any OpenAI-compatible provider"},...t==="first-run"?[{value:"skip",label:"Skip for now",description:"Continue with current defaults"}]:[]];return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:t==="first-run"?"Set up provider":"Choose provider preset"}),u(i,{dimColor:!0,children:"Pick a preset, then confirm base URL, model, and API key."}),u(V,{options:h,onChange:(o)=>{if(o==="skip"){Lt("Provider setup skipped");return}if(o==="codex-oauth"){C("codex-oauth");return}if(o==="xai-oauth"){C("xai-oauth");return}if(o==="github-onboard"){C("github-onboard");return}if(o==="import-legacy"){(async()=>{let l=await An({force:!0});pt(Xt()),Q();let d=Ht(l);if(l.errors.length>0){R(d);return}let s=W();if(t==="first-run"&&s){c({action:"saved",activeProfileId:s.id,activeProviderName:s.name,activeProviderModel:s.model,message:d});return}if(M(d),R(void 0),t==="manage")k()})();return}cu(o)},onCancel:()=>{if(t==="first-run"){Lt("Provider setup skipped");return}k()},visibleOptionCount:Math.min(13,h.length)})]})}function eu(){return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Anthropic — choose authentication"}),u(i,{dimColor:!0,children:"Sign in with your Anthropic account in the browser, or paste an API key."}),u(V,{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:(n)=>{if(n==="oauth"){C("anthropic-oauth");return}if(n==="apiKey"){C("form");return}C("select-preset")},onCancel:()=>C("select-preset"),visibleOptionCount:3})]})}function du(){let n=(oa(),Du(la)).ConsoleOAuthFlow;return u(g,{flexDirection:"column",gap:1,children:u(n,{mode:"login",onDone:()=>{let h=Tt("anthropic"),o={provider:"anthropic",name:h.name,baseUrl:h.baseUrl,model:h.model},l=ct(o,{makeActive:!0});if(!l){R("OAuth completed, but the Anthropic profile could not be saved."),C("select-preset");return}let d=`Anthropic OAuth configured: ${l.name}`;if(Q(),t==="first-run"){c({action:"saved",activeProfileId:l.id,message:d});return}M(d),R(void 0),k()}})})}function yu(){let n=Et;if(n!=="bedrock"&&n!=="vertex"&&n!=="foundry")return null;let h=fa[n],o=h[rt]??h[0],l=Wt[o.key]??"";function d(s){let _=s.trim();if(_.length===0){R(`${o.label} is required.`);return}let J={...Wt,[o.key]:_};if(kt(J),R(void 0),rt<h.length-1){Ot(rt+1);return}Ot(0),C("form")}return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:`${n==="bedrock"?"AWS Bedrock":n==="vertex"?"Google Vertex AI":"Azure AI Foundry"} setup`}),u(i,{dimColor:!0,children:o.helpText}),y(i,{dimColor:!0,children:["Step ",rt+1," of ",h.length,": ",o.label]}),y(g,{flexDirection:"row",gap:1,children:[u(i,{children:Ct.pointer}),u(yt,{value:l,onChange:(s)=>kt((_)=>({..._,[o.key]:s})),onSubmit:d,focus:!0,showCursor:!0,placeholder:`${o.placeholder}${Ct.ellipsis}`,columns:80,cursorOffset:Hc,onChangeCursorOffset:Tc})]}),lt&&u(i,{color:"error",children:lt}),u(i,{dimColor:!0,children:"Press Enter to continue. Press Esc to go back."})]})}function Cu(){return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Custom headers (optional)"}),y(i,{dimColor:!0,children:["Add HTTP headers sent on every request. One header per line as"," ",u(i,{children:"Header: Value"}),". Leave empty to skip."]}),y(g,{flexDirection:"row",gap:1,children:[u(i,{children:Ct.pointer}),u(yt,{value:Rn,onChange:Ut,onSubmit:()=>Nt(f),focus:!0,showCursor:!0,placeholder:"X-Header: value",columns:80,multiline:!0,cursorOffset:Wc,onChangeCursorOffset:Uc})]}),lt&&u(i,{color:"error",children:lt}),u(i,{dimColor:!0,children:"Press Enter on a blank line to save. Press Esc to go back."})]})}function bu(){return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:ht?"Edit provider profile":"Create provider profile"}),u(i,{dimColor:!0,children:ot.helpText}),y(i,{dimColor:!0,children:["Provider type:"," ",q==="anthropic"?"Anthropic native API":"OpenAI-compatible API"]}),y(i,{dimColor:!0,children:["Step ",it+1," of ",at.length,": ",ot.label]}),y(g,{flexDirection:"row",gap:1,children:[u(i,{children:Ct.pointer}),u(yt,{value:Dc,onChange:(n)=>T((h)=>({...h,[Ft]:n})),onSubmit:iu,focus:!0,showCursor:!0,placeholder:`${ot.placeholder}${Ct.ellipsis}`,mask:Ft==="apiKey"?"*":void 0,columns:80,cursorOffset:Ec,onChangeCursorOffset:B})]}),lt&&u(i,{color:"error",children:lt}),u(i,{dimColor:!0,children:"Press Enter to continue. Press Esc to go back."})]})}function wu(){let n=r.length>0,h=n;return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Provider manager"}),u(i,{dimColor:!0,children:"Active profile controls base URL, model, and API key used by this session."}),fn&&u(i,{children:fn}),u(g,{flexDirection:"column",children:r.length===0?u(i,{dimColor:!0,children:"No provider profiles configured yet."}):r.map((o)=>y(i,{dimColor:!0,children:["- ",o.name,": ",Xa(o,o.id===e)]},o.id))}),u(V,{options:_n,onChange:(o)=>{switch(R(void 0),o){case"add":C("select-preset");break;case"import-legacy":{(async()=>{let l=await An({force:!0});if(pt(Xt()),Q(),l.errors.length>0)R(Ht(l));else M(Ht(l))})();break}case"activate":if(h)C("select-active");break;case"activate-project":if(h)C("select-active-project");break;case"clear-project-override":tu();break;case"edit":if(n)C("select-edit");break;case"delete":if(h)C("select-delete");break;case"logout-codex-oauth":{let l=sn();if(!l.success){R(l.warning??"Could not clear Codex OAuth credentials.");break}_t(!1),gt(void 0);let d=yn(nt(),st),s=null;if(d){let _=wn(d.id);if(!_.removed){R("Codex OAuth credentials were cleared, but the Codex profile could not be removed."),Q();break}qn(),s=_.activeProfileId?mt():null}Q(),M(s?`Codex OAuth logged out. Warning: could not clear startup provider override (${s}).`:"Codex OAuth logged out.");break}default:Lt("Provider manager closed");break}},onCancel:()=>Lt("Provider manager closed"),defaultFocusValue:Pc,visibleOptionCount:_n.length})]})}function Mt(n,h,o){let l=r.map((d)=>{let s=[];if(d.id===e)s.push("active");if(O&&d.id===O)s.push("this project");if(S&&d.id===S)s.push("global default");let _=s.length>0?` (${s.join(", ")})`:"";return{value:d.id,label:`${d.name}${_}`,description:`${d.provider==="anthropic"?"anthropic":"openai-compatible"} · ${d.baseUrl} · ${d.model}`}});if(l.length===0)return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:n}),u(i,{dimColor:!0,children:h}),u(V,{options:[{value:"back",label:"Back",description:"Return to provider manager"}],onChange:()=>k(),onCancel:()=>k(),visibleOptionCount:1})]});return y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:n}),u(V,{options:l,onChange:o,onCancel:()=>k(),visibleOptionCount:Math.min(10,Math.max(2,l.length))})]})}let G;switch(N){case"select-preset":G=mu();break;case"select-ollama-model":G=hu();break;case"select-openai-model":G=ru();break;case"select-atomic-chat-model":G=au();break;case"codex-oauth":G=u(qa,{onBack:()=>C("select-preset"),onConfigured:async(n,h)=>{let o={provider:"openai",name:Ca,baseUrl:Sc,model:ba,apiKey:""},l=yn(nt(),st),d=l?At(l.id,o):ct(o,{makeActive:!0});if(!d){R("Codex OAuth login finished, but the provider profile could not be saved."),k();return}let s=l&&e!==d.id?Rt(d.id):d;if(!s){R("Codex OAuth login finished, but the provider could not be set as the startup provider."),k();return}h({profileId:d.id});let _=mt(),J=await vt(n);_t(!0),gt(d.id),Q();let $=[J,_?`could not clear startup provider override (${_})`:null].filter((F)=>Boolean(F)),K=Dt({prefix:"Codex OAuth configured",activationWarning:J,warnings:$});if(t==="first-run"){c({action:"saved",activeProfileId:s.id,message:K});return}M(K),R(void 0),k()}});break;case"xai-oauth":G=u(Sa,{onBack:()=>C("select-preset"),onConfigured:async(n,h)=>{let l=ct({provider:"openai",name:wa,baseUrl:gn,model:Oa,apiKey:""},{makeActive:!0});if(!l){R("xAI OAuth login finished, but the provider profile could not be saved."),k();return}try{h({profileId:l.id})}catch(s){R(s instanceof Error?s.message:String(s)),k();return}Q();let d="xAI / Grok configured. Claudin switched to it for this session.";if(t==="first-run"){c({action:"saved",activeProfileId:l.id,message:d});return}M(d),R(void 0),k()}});break;case"github-onboard":G=u(Tn,{onDone:(n)=>{if(n)M(n),R(void 0);Q(),k()},onBack:()=>C("select-preset"),onChangeAPIKey:Q});break;case"anthropic-auth-choice":G=eu();break;case"anthropic-oauth":G=du();break;case"cloud-extras":G=yu();break;case"custom-headers":G=Cu();break;case"form":G=bu();break;case"select-active":G=Mt("Set active provider (Global)","No providers available. Add one first.",(n)=>{vc(n)});break;case"select-active-project":G=Mt("Set active provider (Project)","No providers available. Add one first.",(n)=>{nu(n)});break;case"select-edit":G=Mt("Edit provider","No providers available. Add one first.",(n)=>{uu(n)});break;case"select-delete":G=Mt("Delete provider","No providers available. Add one first.",(n)=>{let h=r.find(($)=>$.id===n),o=h?.provider==="openai"&&h?.extras?.githubToken!==void 0,l=yn(r,st)?.id===n,d=Lc()?.profileId,s=h?.provider==="openai"&&h.baseUrl===gn&&!h.apiKey&&d===n,_=W()?.id===n,J=wn(n);if(!J.removed)R("Could not delete provider.");else{let $=[];if(l){let F=sn();if(!F.success)$.push(F.warning??"could not clear Codex OAuth credentials");else gt(void 0);qn()}if(o){let F=$c();if(!F.success)$.push(F.warning??"could not clear GitHub Copilot token")}if(s){let F=Nc();if(!F.success)$.push(F.warning??"could not clear xAI OAuth credentials")}let K=J.activeProfileId?mt():null;if(K)$.push(`could not clear startup provider override (${K})`);if(Q(),_){let F=W();if(F)wt(),a((U)=>({...U,mainLoopModel:bt(F.model),mainLoopModelForSession:null}));else wt(),a((U)=>({...U,mainLoopModel:null,mainLoopModelForSession:null}))}M($.length>0?`Provider deleted. Warning: ${$.join("; ")}.`:"Provider deleted")}k()});break;case"menu":default:G=wu();break}return y(Fc,{color:"permission",children:[u(Kc,{enabled:kn,onDismiss:(n)=>{pt(Xt()),jc(!1),Q();let h=W();if(n==="migrated"&&t==="first-run"&&h)c({action:"saved",activeProfileId:h.id,activeProviderName:h.name,activeProviderModel:h.model})}}),kn?null:Ic?y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Loading providers..."}),u(i,{dimColor:!0,children:"Reading provider profiles from disk."})]}):xc?y(g,{flexDirection:"column",gap:1,children:[u(i,{color:"remember",bold:!0,children:"Activating provider..."}),u(i,{dimColor:!0,children:"Please wait while the provider is being configured."})]}):G]})}var b,at,dn="\x00__manual__",ya,Ca="Codex OAuth",ba="codexplan",wa="xAI / Grok (OAuth)",Oa="grok-4",fa;var Fa=j(()=>{vu();Wn();na();Ln();ca();ra();ma();ic();on();ta();aa();Fn();Zn();ha();Bn();In();ia();ua();da();Kn();mc();kc();fc();ea();Qt();b=Gt(Vt(),1),at=[{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:"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},{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.'}],ya=new Set(["anthropic","bedrock","vertex","foundry"]);fa={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{un as vc,In as wc,Aa as xc,Sh as yc,Fa as zc};
@@ -0,0 +1,2 @@
1
+ import{Xqa as y}from"./cli-1.0.4-rhq4w2pj.mjs";function $(q){return typeof q==="number"&&Number.isFinite(q)?q:0}function F(q,z){let B=q;for(let K of z){if(B==null||typeof B!=="object")return;B=B[K]}return B}function x(q){if(!q)return!1;let z="";try{z=new URL(q).hostname.toLowerCase()}catch{}if(!z){let W=q.toLowerCase();return W.includes("localhost")||W.includes("127.0.0.1")||W.includes("::1")}let B=z.startsWith("[")&&z.endsWith("]")?z.slice(1,-1):z;if(B==="localhost"||B.endsWith(".localhost")||B.endsWith(".local")||B.endsWith(".lan")||B.endsWith(".internal")||B.endsWith(".intranet")||B.endsWith(".home.arpa"))return!0;let K=B.match(U);if(K){let W=Number(K[1]),j=Number(K[2]);if(W===10)return!0;if(W===172&&j>=16&&j<=31)return!0;if(W===192&&j===168)return!0;if(W===127)return!0;if(W===169&&j===254)return!0;if(W===100&&j>=64&&j<=127)return!0}if(B==="::1"||B==="::")return!0;if(B.startsWith("fe80:")||f.test(B)||A.test(B))return!0;return!1}function N(q,z){if(q==="github")return z?.githubNativeAnthropic?"copilot-claude":"copilot";if(q==="firstParty"||q==="bedrock"||q==="vertex"||q==="foundry")return"anthropic";if(q==="gemini")return"gemini";if(q==="codex")return"codex";if(q==="openai"){let B=z?.openAiBaseUrl??"";if(x(B))return"self-hosted";let K=B.toLowerCase();if(K.includes(":11434"))return"ollama";if(K.includes("moonshot")||K.includes("kimi"))return"kimi";if(K.includes("deepseek"))return"deepseek";return"openai"}return"openai"}function D(q){if(!q||typeof q!=="object")return 0;let z=q,B=$(z.cache_read_input_tokens);if(B>0)return B;let K=$(F(q,["input_tokens_details","cached_tokens"]))||$(F(q,["prompt_tokens_details","cached_tokens"]));if(K>0)return K;let W=$(z.cached_tokens);if(W>0)return W;let j=$(z.prompt_cache_hit_tokens);if(j>0)return j;let Q=$(z.cached_content_token_count);if(Q>0)return Q;return 0}function Y(q){if(!q||typeof q!=="object")return 0;let B=$(q.cache_creation_input_tokens);if(B>0)return B;return $(F(q,["cache_creation","ephemeral_5m_input_tokens"]))+$(F(q,["cache_creation","ephemeral_1h_input_tokens"]))}function P(q){let z=D(q),B=q??{},K=$(B.input_tokens)||$(B.prompt_tokens),W=K>=z?K-z:K,j=$(B.output_tokens)||$(B.completion_tokens);return{input_tokens:W,output_tokens:j,cache_creation_input_tokens:Y(q),cache_read_input_tokens:z}}function M(q,z){if(!q||typeof q!=="object")return X;let B=q,K=$(B.cache_read_input_tokens),W=$(B.cache_creation_input_tokens),j=$(B.input_tokens);if(z==="copilot"||z==="ollama")return X;if(z==="self-hosted"&&K===0&&W===0)return X;let Q=K+W+j;return{read:K,created:W,total:Q,hitRate:Q>0?Math.min(1,K/Q):null,supported:!0}}function C(q){if(!q)return"[Cache: N/A]";if(!q.supported)return"[Cache: N/A]";if(q.read===0&&q.created===0)return"[Cache: cold]";let z=[`${G(q.read)} read`];if(q.hitRate!==null)z.push(`hit ${Math.round(q.hitRate*100)}%`);return`[Cache: ${z.join(" • ")}]`}function I(q){if(!q)return"[Cache: N/A]";if(!q.supported)return"[Cache: N/A]";let z=[`read=${G(q.read)}`,`created=${G(q.created)}`];if(q.hitRate!==null)z.push(`hit=${Math.round(q.hitRate*100)}%`);else z.push("hit=n/a");return`[Cache: ${z.join(" ")}]`}function G(q){if(q<1000)return String(q);if(q<1e6)return`${(q/1000).toFixed(1).replace(Z,"")}k`;return`${(q/1e6).toFixed(1).replace(Z,"")}m`}function H(q,z){if(!q.supported&&!z.supported)return X;if(!q.supported)return z;if(!z.supported)return q;let B=q.read+z.read,K=q.created+z.created,W=q.total+z.total;return{read:B,created:K,total:W,hitRate:W>0?B/W:null,supported:!0}}var X,U,f,A,Z;var L=y(()=>{X={read:0,created:0,total:0,hitRate:null,supported:!1};U=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,f=/^fc[0-9a-f]{0,2}:/,A=/^fd[0-9a-f]{0,2}:/,Z=/\.0$/});function S(q){return{currentTurn:V,session:V,history:Array(q),historyWriteIdx:0,historySize:0,historyMax:q}}function w(q,z){J.currentTurn=H(J.currentTurn,q),J.session=H(J.session,q);let B={timestamp:Date.now(),label:z,metrics:q};if(J.history[J.historyWriteIdx]=B,J.historyWriteIdx=(J.historyWriteIdx+1)%J.historyMax,J.historySize<J.historyMax)J.historySize++}function T(){J.currentTurn=V}function R(){J.currentTurn=V,J.session=V,J.history=Array(J.historyMax),J.historyWriteIdx=0,J.historySize=0}function b(){return J.currentTurn}function g(){return J.session}function l(){if(J.historySize<J.historyMax)return J.history.slice(0,J.historySize);let q=J.history.slice(J.historyWriteIdx),z=J.history.slice(0,J.historyWriteIdx);return q.concat(z)}var O=500,V,J;var k=y(()=>{L();V={read:0,created:0,total:0,hitRate:null,supported:!1};J=S(O)});
2
+ export{N as _1,P as $1,M as a2,C as b2,I as c2,L as d2,w as e2,T as f2,R as g2,b as h2,g as i2,l as j2,k as k2};
@@ -0,0 +1,2 @@
1
+ import{Rh as g,Sh as Uf}from"./cli-1.0.4-4sfp975c.mjs";import{Wh as A,Yh as Kf}from"./cli-1.0.4-pae9c0v0.mjs";import{$B as $f,Cm as Vf,El as y,Gj as W,JQ as l,Ku as m,LB as M,Lu as Zf,MC as c,Or as E,PC as bf,Pr as P,Qr as Xf,Ru as C,Tj as w,US as Hf,Uj as zf,VS as d,Vu as T,XD as u,YD as jf,Zl as Jf,Zu as _f,_B as I,_R as S,jR as Ff,jm as N,lE as v,lS as p,pm as Qf,sE as Df,sS as k,xl as Bf,xm as L,yl as Gf,ys as h,zs as Yf}from"./cli-1.0.4-jvp0mp87.mjs";import{gfa as R,ofa as ff}from"./cli-1.0.4-q0rnwhn4.mjs";import{Nha as O,Qha as e}from"./cli-1.0.4-34jdejmp.mjs";import{boa as H,mpa as s,oma as F,pla as U,qla as q,vla as x}from"./cli-1.0.4-n5mydt2f.mjs";import{Uqa as K,Xqa as t}from"./cli-1.0.4-rhq4w2pj.mjs";import{randomUUID as qf}from"crypto";async function lf({setMessages:V,readFileState:i,discoveredSkillNames:n,loadedNestedMemoryPaths:r,getAppState:G,setAppState:J,setConversationId:X}){let Y=l();await M("clear",{getAppState:G,setAppState:J,signal:AbortSignal.timeout(Y),timeoutMs:Y});let Z=F();if(Z)O("tengu_cache_eviction_hint",{scope:"conversation_clear",last_request_id:Z});let Q=new Set,_=[],$=(f)=>("isBackgrounded"in f)&&f.isBackgrounded===!1;if(G)for(let f of Object.values(G().tasks)){if($(f))continue;if(v(f))Q.add(f.agentId),_.push(f);else if(m(f))Q.add(f.identity.agentId)}if(V(()=>[]),X)X(qf());if(g(Q),I(x()),i.clear(),n?.clear(),r?.clear(),J)J((f)=>{let B={};for(let[D,z]of Object.entries(f.tasks)){if(!$(z)){B[D]=z;continue}try{if(z.status==="running"){if(h(z)){if(z.shellCommand?.kill(),z.shellCommand?.cleanup(),z.cleanupTimeoutId)clearTimeout(z.cleanupTimeoutId)}if("abortController"in z)z.abortController?.abort();if("unregisterCleanup"in z)z.unregisterCleanup?.()}}catch(a){R(a)}E(D)}return{...f,tasks:B,attribution:u(),standaloneAgentContext:void 0,fileHistory:{snapshots:[],trackedFiles:new Set,snapshotSequence:0},mcp:{clients:[],tools:[],commands:[],resources:{},pluginReconnectKey:f.mcp.pluginReconnectKey}}});N(),p(),H(),A(),T(),C();let o=U();q({setCurrentAsParent:!0}),L(o),await S();for(let f of _){if(f.status!=="running")continue;P(f.id,W(w(f.agentId)))}{let{saveMode:f}=(d(),K(Hf)),{isCoordinatorMode:B}=(Gf(),K(Bf));f(B()?"coordinator":"normal")}let b=y();if(b)k(b);let j=await c("clear");if(j.length>0)V(()=>j)}var xf=t(()=>{s();e();Zf();Df();Yf();zf();_f();jf();Ff();ff();Kf();Qf();$f();bf();d();Xf();Vf();Jf();Uf()});
2
+ export{lf as Ph,xf as Qh};
@@ -0,0 +1,2 @@
1
+ import{f3 as N,k3 as $}from"./cli-1.0.4-f8dd3sqs.mjs";import{X6 as M,f4 as L,i4 as Y,v7 as Z}from"./cli-1.0.4-0vwtrvvh.mjs";import{gfa as Q,ofa as X}from"./cli-1.0.4-q0rnwhn4.mjs";import{Lha as J,Mha as V}from"./cli-1.0.4-hfn9tnb6.mjs";import{nja as P,vja as S}from"./cli-1.0.4-7pxrd0w5.mjs";import{gqa as K,yqa as W}from"./cli-1.0.4-j17mhs88.mjs";import{Xqa as R}from"./cli-1.0.4-rhq4w2pj.mjs";async function C(){let F=M()?.accessToken;if(!F)throw Error("Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.");let y=await L();if(!y)throw Error("Unable to get organization UUID");let G=`${J().BASE_API_URL}/v1/environment_providers`;try{let B={...N(F),"x-organization-uuid":y},q=await K.get(G,{headers:B,timeout:15000});if(q.status!==200)throw Error(`Failed to fetch environments: ${q.status} ${q.statusText}`);return q.data.environments}catch(B){let q=P(B);throw Q(q),Error(`Failed to fetch environments: ${q.message}`)}}async function j(F){let y=M()?.accessToken;if(!y)throw Error("No access token available");let G=await L();if(!G)throw Error("Unable to get organization UUID");let B=`${J().BASE_API_URL}/v1/environment_providers/cloud/create`;return(await K.post(B,{name:F,kind:"anthropic_cloud",description:"",config:{environment_type:"anthropic",cwd:"/home/user",init_script:null,environment:{},languages:[{name:"python",version:"3.11"},{name:"node",version:"20"}],network_config:{allowed_hosts:[],allow_default_hosts:!0}}},{headers:{...N(y),"anthropic-beta":"ccr-byoc-2025-07-29","x-organization-uuid":G},timeout:15000})).data}var b=R(()=>{W();V();Y();Z();S();X();$()});
2
+ export{C as mW,j as nW,b as oW};
@@ -0,0 +1,2 @@
1
+ import{Xqa as B}from"./cli-1.0.4-rhq4w2pj.mjs";function F(z){let k=z.trim();if(!k.startsWith("/"))return null;let b=k.slice(1).split(" ");if(!b[0])return null;let j=b[0],l=!1,q=1;if(b.length>1&&b[1]==="(MCP)")j=j+" (MCP)",l=!0,q=2;let A=b.slice(q).join(" ");return{commandName:j,args:A,isMcp:l}}var C=()=>{};
2
+ export{F as Si,C as Ti};
@@ -0,0 +1,24 @@
1
+ import{Zb as DY}from"./cli-1.0.4-zjh4h68p.mjs";import{Tc as LY,Wc as iQ}from"./cli-1.0.4-xxktmt2a.mjs";import{Xh as V0,Yh as p6}from"./cli-1.0.4-pae9c0v0.mjs";import{Si as pY,Ti as A6}from"./cli-1.0.4-2vrfse65.mjs";import{$N as rQ,$k as z9,AB as O6,Av as x0,Bv as u0,Bx as I0,CK as J6,Cv as p0,DH as T0,Dv as pZ,EH as s9,Ev as cZ,Ex as i9,Ft as ZY,Fv as c0,GJ as s,Gt as xQ,Gv as m0,Ht as JY,Hv as g0,IQ as wZ,It as lQ,Iv as d0,Jt as kY,Jv as l0,Km as yZ,Kv as a0,Lv as n0,MJ as gY,Ms as M0,Mv as r0,Nm as $Z,Nv as i0,OF as C0,Om as e0,Ov as GQ,Oy as xY,PF as o9,Ps as b0,Qs as fZ,Ry as D6,TJ as dY,Us as r9,VQ as rY,ZC as HY,ZN as BY,ZO as lY,Zk as L9,_C as aQ,_j as KZ,_k as u6,al as q9,bk as E0,bl as bZ,bq as iZ,cR as iY,cl as Y0,cq as AY,dl as D9,dq as FZ,el as XZ,eq as _Y,fl as Q0,gP as aY,gR as zY,gk as hY,gl as v9,hL as P9,hl as A9,iP as nY,il as sY,jD as NY,jL as F9,jR as qY,kD as nQ,lD as RY,mP as w6,nD as z6,nL as M9,nQ as kZ,oA as uY,qA as v6,rD as n,rQ as xZ,tD as U6,uB as cY,uL as o6,vB as _6,wA as CY,wp as j9,xA as TY,xp as i6,xv as h0,yA as L6,yv as uZ,zB as mY,zK as PY,zv as k0}from"./cli-1.0.4-jvp0mp87.mjs";import{NW as Q9,RW as R6}from"./cli-1.0.4-rmrpsgq6.mjs";import{GX as $0,HX as j0,IX as l9,LX as P0,MX as a9,SX as F0,TX as n9,sX as y0,tX as d9}from"./cli-1.0.4-c9sh44ne.mjs";import{I0 as g9,IY as m9,b0 as p,d0 as M}from"./cli-1.0.4-9ra8j4rt.mjs";import{N2 as a,O2 as E,P2 as b,Q2 as J0}from"./cli-1.0.4-x8jnn75c.mjs";import{R2 as c9}from"./cli-1.0.4-5e2v63sy.mjs";import{W4 as $Y,_4 as K6,v7 as G6,y6 as jY}from"./cli-1.0.4-0vwtrvvh.mjs";import{$ea as U0,B$ as T6,L9 as E9,S_ as TZ,U_ as x9,X_ as y9,Y8 as _Z,Z8 as k9,_aa as $9,cfa as p9,fba as r6,gfa as e,j9 as GY,l9 as dQ,l_ as a6,ofa as w0,pca as yY,qba as wY,rba as EY,s$ as n6,tba as V6,w$ as Y9,yca as W6}from"./cli-1.0.4-q0rnwhn4.mjs";import{Hfa as L0,Lfa as h9,zfa as B0}from"./cli-1.0.4-1bg07n68.mjs";import{Aga as $6,pga as oY}from"./cli-1.0.4-d8bjdz7n.mjs";import{Tga as Y,Uga as h,Vga as JZ,Wga as q,Xga as EZ}from"./cli-1.0.4-0wp27vrg.mjs";import{$ga as X6,Cha as u9,_ga as UY,bha as RZ,eha as z0,fha as q0,gha as D0,hha as v0,jha as A0,kha as _0,wha as O0}from"./cli-1.0.4-8x3m3esm.mjs";import{Nha as g,Qha as UZ}from"./cli-1.0.4-34jdejmp.mjs";import{Qia as I,Tha as Z9,Tia as HZ,Vha as C6,tia as ZZ,uia as WY,yia as PZ}from"./cli-1.0.4-vpcfce7x.mjs";import{Via as KY,Zia as gQ}from"./cli-1.0.4-9ber6pxx.mjs";import{aja as VY,oja as w9,pja as tZ,vja as lZ}from"./cli-1.0.4-7pxrd0w5.mjs";import{$na as X0,Ema as OY,Wna as J9,Xna as DZ,Yna as H9,_na as N9,boa as B9,jpa as IY,mpa as BZ,pla as NZ,vla as W0,wla as eY}from"./cli-1.0.4-n5mydt2f.mjs";import{Tqa as N0,Wqa as hZ,Xqa as OZ,Yqa as rZ}from"./cli-1.0.4-rhq4w2pj.mjs";var WQ={};hZ(WQ,{selectableUserMessagesFilter:()=>S0,messagesAfterAreOnlySynthetic:()=>VQ,MessageSelector:()=>e9});import{randomUUID as t9}from"crypto";import*as QZ from"path";function R0(Q){return Q.type==="text"}function SZ(Q){return Q==="summarize"||Q==="summarize_up_to"}function e9({messages:Q,onPreRestore:Z,onRestoreMessage:X,onRestoreCode:V,onSummarize:W,onClose:H,preselectedMessage:G}){let K=I0((U)=>U.fileHistory),[B,z]=T.useState(void 0),J=M0(),L=T.useMemo(t9,[]),_=T.useMemo(()=>[...Q.filter(S0),{...s({content:""}),uuid:L}],[Q,L]),[w,v]=T.useState(_.length-1),P=Math.max(0,Math.min(w-Math.floor(CZ/2),_.length-CZ)),f=_.length>1,[D,F]=T.useState(G),[y,S]=T.useState(void 0);T.useEffect(()=>{if(!G||!J)return;let U=!1;return fZ(K,G.uuid).then((R)=>{if(!U)S(R)}),()=>{U=!0}},[G,J,K]);let[O,$]=T.useState(!1),[d,i]=T.useState(null),[o,C]=T.useState("both"),[k,x]=T.useState(""),[A,j]=T.useState("");function N(U){let R=U?[{value:"both",label:"Restore code and conversation"},{value:"conversation",label:"Restore conversation"},{value:"code",label:"Restore code"}]:[{value:"conversation",label:"Restore conversation"}],c={type:"input",placeholder:"add context (optional)",initialValue:"",allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:": "};return R.push({value:"summarize",label:"Summarize from here",...c,onChange:x}),R.push({value:"nevermind",label:"Never mind"}),R}T.useEffect(()=>{g("tengu_message_selector_opened",{})},[]);async function u(U){Z(),$(!0);try{await X(U),$(!1),H()}catch(R){e(R),$(!1),z(`Failed to restore the conversation:
2
+ ${R}`)}}async function l(U){let R=Q.indexOf(U),c=Q.length-1-R;if(g("tengu_message_selector_selected",{index_from_end:c,message_type:U.type,is_current_prompt:!1}),!Q.includes(U)){H();return}if(!J){await u(U);return}let m=await fZ(K,U.uuid);F(U),S(m)}async function VZ(U){if(g("tengu_message_selector_restore_option_selected",{option:U}),!D){z("Message not found.");return}if(U==="nevermind"){if(G)H();else F(void 0);return}if(SZ(U)){Z(),$(!0),i(U),z(void 0);try{let m=U==="summarize_up_to"?"up_to":"from",YZ=(m==="up_to"?A:k).trim()||void 0;await W(D,YZ,m),$(!1),i(null),F(void 0),H()}catch(m){e(m),$(!1),i(null),F(void 0),z(`Failed to summarize:
3
+ ${m}`)}return}Z(),$(!0),z(void 0);let R=null,c=null;if(U==="code"||U==="both")try{await V(D)}catch(m){R=m,e(R)}if(U==="conversation"||U==="both")try{await X(D)}catch(m){c=m,e(c)}if($(!1),F(void 0),c&&R)z(`Failed to restore the conversation and code:
4
+ ${c}
5
+ ${R}`);else if(c)z(`Failed to restore the conversation:
6
+ ${c}`);else if(R)z(`Failed to restore the code:
7
+ ${R}`);else H()}let WZ=P0(),t=T.useCallback(()=>{if(D&&!G){F(void 0);return}g("tengu_message_selector_cancelled",{}),H()},[H,D,G]),I9=T.useCallback(()=>v((U)=>Math.max(0,U-1)),[]),C9=T.useCallback(()=>v((U)=>Math.min(_.length-1,U+1)),[_.length]),T9=T.useCallback(()=>v(0),[]),R9=T.useCallback(()=>v(_.length-1),[_.length]),f9=T.useCallback(()=>{let U=_[w];if(U)l(U)},[_,w,l]);$0("confirm:no",t,{context:"Confirmation",isActive:!D}),j0({"messageSelector:up":I9,"messageSelector:down":C9,"messageSelector:top":T9,"messageSelector:bottom":R9,"messageSelector:select":f9},{context:"MessageSelector",isActive:!O&&!B&&!D&&f});let[K0,G0]=T.useState({});T.useEffect(()=>{async function U(){if(!J)return;Promise.all(_.map(async(R,c)=>{if(R.uuid!==L){let m=b0(K,R.uuid),YZ=_.at(c+1),AZ=m?XQ(Q,R.uuid,YZ?.uuid!==L?YZ?.uuid:void 0):void 0;if(AZ!==void 0)G0((r)=>({...r,[c]:AZ}));else G0((r)=>({...r,[c]:void 0}))}}))}U()},[_,Q,L,K,J]);let vZ=J&&y?.filesChanged&&y.filesChanged.length>0,S9=!B&&!D&&!G&&f;return b(p,{flexDirection:"column",width:"100%",children:[E(F0,{color:"suggestion"}),b(p,{flexDirection:"column",marginX:1,gap:1,children:[E(M,{bold:!0,color:"suggestion",children:"Rewind"}),B&&E(a,{children:b(M,{color:"error",children:["Error: ",B]})}),!f&&E(a,{children:E(M,{children:"Nothing to rewind to yet."})}),!B&&D&&f&&b(a,{children:[b(M,{children:["Confirm you want to restore"," ",!y&&"the conversation ","to the point before you sent this message:"]}),b(p,{flexDirection:"column",paddingLeft:1,borderStyle:"single",borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[E(H0,{userMessage:D,color:"text",isCurrent:!1}),b(M,{dimColor:!0,children:["(",L0(new Date(D.timestamp)),")"]})]}),E(YQ,{selectedRestoreOption:o,canRestoreCode:!!vZ,diffStatsForRestore:y}),O&&SZ(d)?b(p,{flexDirection:"row",gap:1,children:[E(T0,{}),E(M,{children:"Summarizing…"})]}):E(C0,{isDisabled:O,options:N(!!vZ),defaultFocusValue:vZ?"both":"conversation",onFocus:(U)=>C(U),onChange:(U)=>VZ(U),onCancel:()=>G?H():F(void 0)}),vZ&&E(p,{marginBottom:1,children:b(M,{dimColor:!0,children:[_Z.warning," Rewinding does not affect files edited manually or via bash."]})})]}),S9&&b(a,{children:[J?E(M,{children:"Restore the code and/or conversation to the point before…"}):E(M,{children:"Restore and fork the conversation to the point before…"}),E(p,{width:"100%",flexDirection:"column",children:_.slice(P,P+CZ).map((U,R)=>{let c=P+R,m=c===w,YZ=U.uuid===L,AZ=c in K0,r=K0[c],IZ=r?.filesChanged&&r.filesChanged.length;return b(p,{height:J?3:2,overflow:"hidden",width:"100%",flexDirection:"row",children:[E(p,{width:2,minWidth:2,children:m?b(M,{color:"permission",bold:!0,children:[_Z.pointer," "]}):E(M,{children:" "})}),b(p,{flexDirection:"column",children:[E(p,{flexShrink:1,height:1,overflow:"hidden",children:E(H0,{userMessage:U,color:m?"suggestion":void 0,isCurrent:YZ,paddingRight:10})}),J&&AZ&&E(p,{height:1,flexDirection:"row",children:r?E(a,{children:E(M,{dimColor:!m,color:"inactive",children:IZ?b(a,{children:[IZ===1&&r.filesChanged[0]?`${QZ.basename(r.filesChanged[0])} `:`${IZ} files changed `,E(f0,{diffStats:r})]}):E(a,{children:"No code changes"})})}):b(M,{dimColor:!0,color:"warning",children:[_Z.warning," No code restore"]})})]})]},U.uuid)})})]}),!D&&E(M,{dimColor:!0,italic:!0,children:WZ.pending?b(a,{children:["Press ",WZ.keyName," again to exit"]}):b(a,{children:[!B&&f&&"Enter to continue · ","Esc to exit"]})})]})]})}function ZQ(Q){switch(Q){case"summarize":return"Messages after this point will be summarized.";case"summarize_up_to":return"Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.";case"both":case"conversation":return"The conversation will be forked.";case"code":case"nevermind":return"The conversation will be unchanged."}}function YQ(Q){let Z=GZ.c(11),{selectedRestoreOption:X,canRestoreCode:V,diffStatsForRestore:W}=Q,H=V&&(X==="both"||X==="code"),G;if(Z[0]!==X)G=ZQ(X),Z[0]=X,Z[1]=G;else G=Z[1];let K;if(Z[2]!==G)K=E(M,{dimColor:!0,children:G}),Z[2]=G,Z[3]=K;else K=Z[3];let B;if(Z[4]!==W||Z[5]!==X||Z[6]!==H)B=!SZ(X)&&(H?E(QQ,{diffStatsForRestore:W}):E(M,{dimColor:!0,children:"The code will be unchanged."})),Z[4]=W,Z[5]=X,Z[6]=H,Z[7]=B;else B=Z[7];let z;if(Z[8]!==K||Z[9]!==B)z=b(p,{flexDirection:"column",children:[K,B]}),Z[8]=K,Z[9]=B,Z[10]=z;else z=Z[10];return z}function QQ(Q){let Z=GZ.c(14),{diffStatsForRestore:X}=Q;if(X===void 0)return;if(!X.filesChanged||!X.filesChanged[0]){let K;if(Z[0]===Symbol.for("react.memo_cache_sentinel"))K=E(M,{dimColor:!0,children:"The code has not changed (nothing will be restored)."}),Z[0]=K;else K=Z[0];return K}let V=X.filesChanged.length,W;if(V===1){let K;if(Z[1]!==X.filesChanged[0])K=QZ.basename(X.filesChanged[0]||""),Z[1]=X.filesChanged[0],Z[2]=K;else K=Z[2];W=K}else if(V===2){let K;if(Z[3]!==X.filesChanged[0])K=QZ.basename(X.filesChanged[0]||""),Z[3]=X.filesChanged[0],Z[4]=K;else K=Z[4];let B=K,z;if(Z[5]!==X.filesChanged[1])z=QZ.basename(X.filesChanged[1]||""),Z[5]=X.filesChanged[1],Z[6]=z;else z=Z[6];W=`${B} and ${z}`}else{let K;if(Z[7]!==X.filesChanged[0])K=QZ.basename(X.filesChanged[0]||""),Z[7]=X.filesChanged[0],Z[8]=K;else K=Z[8];W=`${K} and ${X.filesChanged.length-1} other files`}let H;if(Z[9]!==X)H=E(f0,{diffStats:X}),Z[9]=X,Z[10]=H;else H=Z[10];let G;if(Z[11]!==W||Z[12]!==H)G=E(a,{children:b(M,{dimColor:!0,children:["The code will be restored"," ",H," in ",W,"."]})}),Z[11]=W,Z[12]=H,Z[13]=G;else G=Z[13];return G}function f0(Q){let Z=GZ.c(7),{diffStats:X}=Q;if(!X||!X.filesChanged)return;let V;if(Z[0]!==X.insertions)V=b(M,{color:"diffAddedWord",children:["+",X.insertions," "]}),Z[0]=X.insertions,Z[1]=V;else V=Z[1];let W;if(Z[2]!==X.deletions)W=b(M,{color:"diffRemovedWord",children:["-",X.deletions]}),Z[2]=X.deletions,Z[3]=W;else W=Z[3];let H;if(Z[4]!==V||Z[5]!==W)H=b(a,{children:[V,W]}),Z[4]=V,Z[5]=W,Z[6]=H;else H=Z[6];return H}function H0(Q){let Z=GZ.c(31),{userMessage:X,color:V,dimColor:W,isCurrent:H,paddingRight:G}=Q,{columns:K}=y0();if(H){let S;if(Z[0]!==V||Z[1]!==W)S=E(p,{width:"100%",children:E(M,{italic:!0,color:V,dimColor:W,children:"(current)"})}),Z[0]=V,Z[1]=W,Z[2]=S;else S=Z[2];return S}let B=X.message.content,z=typeof B==="string"?null:B[B.length-1],J,L,_,w,v,P,f,D;if(Z[3]!==V||Z[4]!==K||Z[5]!==B||Z[6]!==W||Z[7]!==z||Z[8]!==G){D=Symbol.for("react.early_return_sentinel");Z:{let S=typeof B==="string"?B.trim():z&&R0(z)?z.text.trim():"(no prompt)",O=U0(S);if(E0(O)){let $;if(Z[17]!==V||Z[18]!==W)$=E(p,{flexDirection:"row",width:"100%",children:E(M,{italic:!0,color:V,dimColor:W,children:"((empty message))"})}),Z[17]=V,Z[18]=W,Z[19]=$;else $=Z[19];D=$;break Z}if(O.includes("<bash-input>")){let $=KZ(O,"bash-input");if($){let d;if(Z[20]===Symbol.for("react.memo_cache_sentinel"))d=E(M,{color:"bashBorder",children:"!"}),Z[20]=d;else d=Z[20];D=b(p,{flexDirection:"row",width:"100%",children:[d,b(M,{color:V,dimColor:W,children:[" ",$]})]});break Z}}if(O.includes(`<${RZ}>`)){let $=KZ(O,RZ),d=KZ(O,"command-args"),i=KZ(O,"skill-format")==="true";if($)if(i){D=E(p,{flexDirection:"row",width:"100%",children:b(M,{color:V,dimColor:W,children:["Skill(",$,")"]})});break Z}else{D=E(p,{flexDirection:"row",width:"100%",children:b(M,{color:V,dimColor:W,children:["/",$," ",d]})});break Z}}L=p,P="row",f="100%",J=M,_=V,w=W,v=G?B0(O,K-G,!0):O.slice(0,500).split(`
8
+ `).slice(0,4).join(`
9
+ `)}Z[3]=V,Z[4]=K,Z[5]=B,Z[6]=W,Z[7]=z,Z[8]=G,Z[9]=J,Z[10]=L,Z[11]=_,Z[12]=w,Z[13]=v,Z[14]=P,Z[15]=f,Z[16]=D}else J=Z[9],L=Z[10],_=Z[11],w=Z[12],v=Z[13],P=Z[14],f=Z[15],D=Z[16];if(D!==Symbol.for("react.early_return_sentinel"))return D;let F;if(Z[21]!==J||Z[22]!==_||Z[23]!==w||Z[24]!==v)F=E(J,{color:_,dimColor:w,children:v}),Z[21]=J,Z[22]=_,Z[23]=w,Z[24]=v,Z[25]=F;else F=Z[25];let y;if(Z[26]!==L||Z[27]!==P||Z[28]!==f||Z[29]!==F)y=E(L,{flexDirection:P,width:f,children:F}),Z[26]=L,Z[27]=P,Z[28]=f,Z[29]=F,Z[30]=y;else y=Z[30];return y}function XQ(Q,Z,X){let V=Q.findIndex((B)=>B.uuid===Z);if(V===-1)return;let W=X?Q.findIndex((B)=>B.uuid===X):Q.length;if(W===-1)W=Q.length;let H=[],G=0,K=0;for(let B=V+1;B<W;B++){let z=Q[B];if(!z||!xZ(z))continue;let J=z.toolUseResult;if(!J||!J.filePath||!J.structuredPatch)continue;if(!H.includes(J.filePath))H.push(J.filePath);try{if("type"in J&&J.type==="create")G+=J.content.split(/\r?\n/).length;else for(let L of J.structuredPatch){let _=TZ(L.lines,(v)=>v.startsWith("+")),w=TZ(L.lines,(v)=>v.startsWith("-"));G+=_,K+=w}}catch{continue}}return{filesChanged:H,insertions:G,deletions:K}}function S0(Q){if(Q.type!=="user")return!1;if(Array.isArray(Q.message.content)&&Q.message.content[0]?.type==="tool_result")return!1;if(kZ(Q))return!1;if(Q.isMeta)return!1;if(Q.isCompactSummary||Q.isVisibleInTranscriptOnly)return!1;let Z=Q.message.content,X=typeof Z==="string"?null:Z[Z.length-1],V=typeof Z==="string"?Z.trim():X&&R0(X)?X.text.trim():"";if(V.indexOf(`<${D0}>`)!==-1||V.indexOf(`<${v0}>`)!==-1||V.indexOf(`<${z0}>`)!==-1||V.indexOf(`<${q0}>`)!==-1||V.indexOf(`<${_0}>`)!==-1||V.indexOf(`<${A0}>`)!==-1||V.indexOf(`<${O0}`)!==-1)return!1;return!0}function VQ(Q,Z){for(let X=Z+1;X<Q.length;X++){let V=Q[X];if(!V)continue;if(kZ(V))continue;if(xZ(V))continue;if(V.type==="progress")continue;if(V.type==="system")continue;if(V.type==="attachment")continue;if(V.type==="user"&&V.isMeta)continue;if(V.type==="assistant"){let W=V.message.content;if(Array.isArray(W)){if(W.some((G)=>G.type==="text"&&G.text.trim()||G.type==="tool_use"))return!1}continue}if(V.type==="user")return!1}return!0}var GZ,T,CZ=7;var KQ=OZ(()=>{k9();UZ();i9();r9();w0();a9();g9();l9();p9();wZ();o9();s9();d9();u9();x9();h9();n9();J0();GZ=N0(m9(),1),T=N0(c9(),1)});var b6={};hZ(b6,{getCronJitterConfig:()=>M6});function M6(){let Q=oY("tengu_kairos_cron_config",XZ,j6),Z=F6().safeParse(Q);return Z.success?Z.data:XZ}var j6=60000,oZ=1800000,P6=2592000000,F6;var I6=OZ(()=>{JZ();$6();sY();EZ();F6=q(()=>Y.object({recurringFrac:Y.number().min(0).max(1),recurringCapMs:Y.number().int().min(0).max(oZ),oneShotMaxMs:Y.number().int().min(0).max(oZ),oneShotFloorMs:Y.number().int().min(0).max(oZ),oneShotMinuteMod:Y.number().int().min(1).max(60),recurringMaxAgeMs:Y.number().int().min(0).max(P6).default(XZ.recurringMaxAgeMs)}).refine((Q)=>Q.oneShotFloorMs<=Q.oneShotMaxMs))});import{mkdir as f6,readFile as S6,unlink as X9,writeFile as eZ}from"fs/promises";import{dirname as h6,join as V9}from"path";function zZ(Q){return V9(Q??eY(),k6)}async function W9(Q){let Z;try{Z=await S6(zZ(Q),"utf8")}catch{return}let X=x6().safeParse(Y9(Z,!1));return X.success?X.data:void 0}async function tY(Q,Z){let X=zZ(Z),V=ZZ(Q);try{return await eZ(X,V,{flag:"wx"}),!0}catch(W){let H=tZ(W);if(H==="EEXIST")return!1;if(H==="ENOENT"){await f6(h6(X),{recursive:!0});try{return await eZ(X,V,{flag:"wx"}),!0}catch(G){if(tZ(G)==="EEXIST")return!1;throw G}}throw W}}function sZ(Q){MZ?.(),MZ=Z9(async()=>{await qZ(Q)})}async function Z0(Q){let Z=Q?.dir,X=Q?.lockIdentity??NZ(),V={sessionId:X,pid:process.pid,acquiredAt:Date.now()};if(await tY(V,Z))return LZ=void 0,sZ(Q),I(`[ScheduledTasks] acquired scheduler lock (PID ${process.pid})`),!0;let W=await W9(Z);if(W?.sessionId===X){if(W.pid!==process.pid)await eZ(zZ(Z),ZZ(V)),sZ(Q);return!0}if(W&&Q9(W.pid)){if(LZ!==W.sessionId)LZ=W.sessionId,I(`[ScheduledTasks] scheduler lock held by session ${W.sessionId} (PID ${W.pid})`);return!1}if(W)I(`[ScheduledTasks] recovering stale scheduler lock from PID ${W.pid}`);if(await X9(zZ(Z)).catch(()=>{}),await tY(V,Z))return LZ=void 0,sZ(Q),!0;return!1}async function qZ(Q){MZ?.(),MZ=void 0,LZ=void 0;let Z=Q?.dir,X=Q?.lockIdentity??NZ(),V=await W9(Z);if(!V||V.sessionId!==X)return;try{await X9(zZ(Z)),I("[ScheduledTasks] released scheduler lock")}catch{}}var k6,x6,MZ,LZ;var K9=OZ(()=>{JZ();BZ();C6();HZ();lZ();R6();T6();EZ();PZ();k6=V9(".claudin","scheduled_tasks.lock"),x6=q(()=>Y.object({sessionId:Y.string(),pid:Y.number(),acquiredAt:Y.number()}))});var d6={};hZ(d6,{takeDueSessionWakeup:()=>O9,isRecurringTaskAged:()=>_9,createCronScheduler:()=>g6,buildMissedTaskNotification:()=>U9});function _9(Q,Z,X){if(X===0)return!1;return Boolean(Q.recurring&&!Q.permanent&&Z-Q.createdAt>=X)}function O9(Q){let Z=X0();if(!Z||Q<Z.fireAtMs)return null;return B9(),{prompt:V0(Z.prompt),reason:Z.reason}}function g6(Q){let{onFire:Z,isLoading:X,assistantMode:V=!1,onFireTask:W,onMissed:H,onWakeupFire:G,dir:K,lockIdentity:B,getJitterConfig:z,isKilled:J,filter:L}=Q,_=K||B?{dir:K,lockIdentity:B}:void 0,w=[],v=new Map,P=new Set,f=new Set,D=null,F=null,y=null,S=null,O=!1,$=!1;async function d(C){let k=await q9(K);if(O)return;if(w=k,!C)return;let x=Date.now(),A=A9(k,x).filter((j)=>!j.recurring&&!P.has(j.id)&&(!L||L(j)));if(A.length>0){for(let j of A)P.add(j.id),v.set(j.id,1/0);if(g("tengu_scheduled_task_missed",{count:A.length,taskIds:A.map((j)=>j.id).join(",")}),H)H(A);else Z(U9(A));Y0(A.map((j)=>j.id),K).catch((j)=>I(`[ScheduledTasks] failed to remove missed tasks: ${j}`)),I(`[ScheduledTasks] surfaced ${A.length} missed one-shot task(s)`)}}function i(){if(J?.())return;if(X()&&!V)return;let C=Date.now(),k=new Set,x=[],A=z?.()??XZ;function j(N,u){if(L&&!L(N))return;if(k.add(N.id),f.has(N.id))return;let l=v.get(N.id);if(l===void 0)l=N.recurring?Q0(N.cron,N.lastFiredAt??N.createdAt,N.id,A)??1/0:v9(N.cron,N.createdAt,N.id,A)??1/0,v.set(N.id,l),I(`[ScheduledTasks] scheduled ${N.id} for ${l===1/0?"never":new Date(l).toISOString()}`);if(C<l)return;I(`[ScheduledTasks] firing ${N.id}${N.recurring?" (recurring)":""}`),g("tengu_scheduled_task_fire",{recurring:N.recurring??!1,taskId:N.id});let VZ=K===void 0?V0(N.prompt,void 0,N.agentId):N.prompt;if(W)W(VZ===N.prompt?N:{...N,prompt:VZ});else Z(VZ);let WZ=_9(N,C,A.recurringMaxAgeMs);if(WZ){let t=Math.floor((C-N.createdAt)/1000/60/60);I(`[ScheduledTasks] recurring task ${N.id} aged out (${t}h since creation), deleting after final fire`),g("tengu_scheduled_task_expired",{taskId:N.id,ageHours:t})}if(N.recurring&&!WZ){let t=Q0(N.cron,C,N.id,A)??1/0;if(v.set(N.id,t),!u)x.push(N.id)}else if(u)N9([N.id]),v.delete(N.id);else f.add(N.id),Y0([N.id],K).catch((t)=>I(`[ScheduledTasks] failed to remove task ${N.id}: ${t}`)).finally(()=>f.delete(N.id)),v.delete(N.id)}if($){for(let N of w)j(N,!1);if(x.length>0){for(let N of x)f.add(N);D9(x,C,K).catch((N)=>I(`[ScheduledTasks] failed to persist lastFiredAt: ${N}`)).finally(()=>{for(let N of x)f.delete(N)})}}if(K===void 0){for(let u of H9())j(u,!0);let N=O9(C);if(N!==null)if(I("[ScheduledTasks] firing pending ScheduleWakeup"),g("tengu_schedule_wakeup_fire",{}),G)G(N.prompt,N.reason);else Z(N.prompt)}if(k.size===0){v.clear();return}for(let N of v.keys())if(!k.has(N))v.delete(N)}async function o(){if(O)return;if(D)clearInterval(D),D=null;let{default:C}=await import("./index-1.0.4-rb8h15jh.mjs");if(O)return;if($=await Z0(_).catch(()=>!1),O){if($)$=!1,qZ(_);return}if(!$)y=setInterval(()=>{Z0(_).then((x)=>{if(O){if(x)qZ(_);return}if(x){if($=!0,y)clearInterval(y),y=null}}).catch((x)=>I(String(x),{level:"error"}))},m6),y.unref?.();d(!0);let k=z9(K);S=C.watch(k,{persistent:!1,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:c6},ignorePermissionErrors:!0}),S.on("add",()=>void d(!1)),S.on("change",()=>void d(!1)),S.on("unlink",()=>{if(!O)w=[],v.clear()}),F=setInterval(i,G9),F.unref?.()}return{start(){if(O=!1,K!==void 0){I(`[ScheduledTasks] scheduler start() — dir=${K}, hasTasks=${bZ(K)}`),o();return}if(I(`[ScheduledTasks] scheduler start() — enabled=${DZ()}, hasTasks=${bZ()}`),!DZ()&&(V||bZ()))J9(!0);if(DZ()){o();return}D=setInterval((C)=>{if(DZ())C()},G9,o),D.unref?.()},stop(){if(O=!0,D)clearInterval(D),D=null;if(F)clearInterval(F),F=null;if(y)clearInterval(y),y=null;if(S?.close(),S=null,$)$=!1,qZ(_)},getNextFireTime(){let C=1/0;for(let k of v.values())if(k<C)C=k;if(K===void 0){let k=X0();if(k&&k.fireAtMs<C)C=k.fireAtMs}return C===1/0?null:C}}}function U9(Q){let Z=Q.length>1,X=`The following one-shot scheduled task${Z?"s were":" was"} missed while Claude was not running. ${Z?"They have":"It has"} already been removed from .claudin/scheduled_tasks.json.
10
+
11
+ Do NOT execute ${Z?"these prompts":"this prompt"} yet. First use the AskUserQuestion tool to ask whether to run ${Z?"each one":"it"} now. Only execute if the user confirms.`,V=Q.map((W)=>{let H=`[${L9(W.cron)}, created ${new Date(W.createdAt).toLocaleString()}]`,G=(W.prompt.match(/`+/g)??[]).reduce((B,z)=>Math.max(B,z.length),0),K="`".repeat(Math.max(3,G+1));return`${H}
12
+ ${K}
13
+ ${W.prompt}
14
+ ${K}`});return`${X}
15
+
16
+ ${V.join(`
17
+
18
+ `)}`}var G9=1000,c6=300,m6=5000;var l6=OZ(()=>{BZ();UZ();u6();sY();K9();HZ();p6()});import{randomUUID as dZ}from"crypto";JZ();EZ();GQ();var JQ=q(()=>Y.unknown()),HQ=q(()=>Y.object({matcher:Y.string().optional(),hookCallbackIds:Y.array(Y.string()),timeout:Y.number().optional()}).describe("Configuration for matching and routing hook callbacks.")),NQ=q(()=>Y.object({subtype:Y.literal("initialize"),hooks:Y.record(u0(),Y.array(HQ())).optional(),sdkMcpServers:Y.array(Y.string()).optional(),jsonSchema:Y.record(Y.string(),Y.unknown()).optional(),systemPrompt:Y.string().optional(),appendSystemPrompt:Y.string().optional(),agents:Y.record(Y.string(),g0()).optional(),promptSuggestions:Y.boolean().optional(),agentProgressSummaries:Y.boolean().optional()}).describe("Initializes the SDK session with hooks, MCP servers, and agent configuration.")),EX=q(()=>Y.object({commands:Y.array(pZ()),agents:Y.array(cZ()),output_style:Y.string(),available_output_styles:Y.array(Y.string()),models:Y.array(c0()),account:m0(),pid:Y.number().optional().describe("@internal CLI process PID for tmux socket isolation"),fast_mode_state:i0().optional()}).describe("Response from session initialization with available commands, models, and account info.")),BQ=q(()=>Y.object({subtype:Y.literal("interrupt")}).describe("Interrupts the currently running conversation turn.")),LQ=q(()=>Y.object({subtype:Y.literal("can_use_tool"),tool_name:Y.string(),input:Y.record(Y.string(),Y.unknown()),permission_suggestions:Y.array(k0()).optional(),blocked_path:Y.string().optional(),decision_reason:Y.string().optional(),title:Y.string().optional(),display_name:Y.string().optional(),tool_use_id:Y.string(),agent_id:Y.string().optional(),description:Y.string().optional()}).describe("Requests permission to use a tool with the given input.")),zQ=q(()=>Y.object({subtype:Y.literal("set_permission_mode"),mode:x0(),ultraplan:Y.boolean().optional().describe("@internal CCR ultraplan session marker.")}).describe("Sets the permission mode for tool execution handling.")),qQ=q(()=>Y.object({subtype:Y.literal("set_model"),model:Y.string().optional()}).describe("Sets the model to use for subsequent conversation turns.")),DQ=q(()=>Y.object({subtype:Y.literal("set_max_thinking_tokens"),max_thinking_tokens:Y.number().nullable()}).describe("Sets the maximum number of thinking tokens for extended thinking.")),vQ=q(()=>Y.object({subtype:Y.literal("mcp_status")}).describe("Requests the current status of all MCP server connections.")),yX=q(()=>Y.object({mcpServers:Y.array(uZ())}).describe("Response containing the current status of all MCP server connections.")),AQ=q(()=>Y.object({subtype:Y.literal("get_context_usage")}).describe("Requests a breakdown of current context window usage by category.")),_Q=q(()=>Y.object({name:Y.string(),tokens:Y.number(),color:Y.string(),isDeferred:Y.boolean().optional()})),OQ=q(()=>Y.object({color:Y.string(),isFilled:Y.boolean(),categoryName:Y.string(),tokens:Y.number(),percentage:Y.number(),squareFullness:Y.number()})),$X=q(()=>Y.object({categories:Y.array(_Q()),totalTokens:Y.number(),maxTokens:Y.number(),rawMaxTokens:Y.number(),percentage:Y.number(),gridRows:Y.array(Y.array(OQ())),model:Y.string(),memoryFiles:Y.array(Y.object({path:Y.string(),type:Y.string(),tokens:Y.number()})),mcpTools:Y.array(Y.object({name:Y.string(),serverName:Y.string(),tokens:Y.number(),isLoaded:Y.boolean().optional()})),deferredBuiltinTools:Y.array(Y.object({name:Y.string(),tokens:Y.number(),isLoaded:Y.boolean()})).optional(),systemTools:Y.array(Y.object({name:Y.string(),tokens:Y.number()})).optional(),systemPromptSections:Y.array(Y.object({name:Y.string(),tokens:Y.number()})).optional(),agents:Y.array(Y.object({agentType:Y.string(),source:Y.string(),tokens:Y.number()})),slashCommands:Y.object({totalCommands:Y.number(),includedCommands:Y.number(),tokens:Y.number()}).optional(),skills:Y.object({totalSkills:Y.number(),includedSkills:Y.number(),tokens:Y.number(),skillFrontmatter:Y.array(Y.object({name:Y.string(),source:Y.string(),tokens:Y.number()}))}).optional(),autoCompactThreshold:Y.number().optional(),isAutoCompactEnabled:Y.boolean(),messageBreakdown:Y.object({toolCallTokens:Y.number(),toolResultTokens:Y.number(),attachmentTokens:Y.number(),assistantMessageTokens:Y.number(),userMessageTokens:Y.number(),toolCallsByType:Y.array(Y.object({name:Y.string(),callTokens:Y.number(),resultTokens:Y.number()})),attachmentsByType:Y.array(Y.object({name:Y.string(),tokens:Y.number()}))}).optional(),apiUsage:Y.object({input_tokens:Y.number(),output_tokens:Y.number(),cache_creation_input_tokens:Y.number(),cache_read_input_tokens:Y.number()}).nullable()}).describe("Breakdown of current context window usage by category (system prompt, tools, messages, etc.).")),UQ=q(()=>Y.object({subtype:Y.literal("rewind_files"),user_message_id:Y.string(),dry_run:Y.boolean().optional()}).describe("Rewinds file changes made since a specific user message.")),jX=q(()=>Y.object({canRewind:Y.boolean(),error:Y.string().optional(),filesChanged:Y.array(Y.string()).optional(),insertions:Y.number().optional(),deletions:Y.number().optional()}).describe("Result of a rewindFiles operation.")),wQ=q(()=>Y.object({subtype:Y.literal("cancel_async_message"),message_uuid:Y.string()}).describe("Drops a pending async user message from the command queue by uuid. No-op if already dequeued for execution.")),PX=q(()=>Y.object({cancelled:Y.boolean()}).describe("Result of a cancel_async_message operation. cancelled=false means the message was not in the queue (already dequeued or never enqueued).")),EQ=q(()=>Y.object({subtype:Y.literal("seed_read_state"),path:Y.string(),mtime:Y.number()}).describe("Seeds the readFileState cache with a path+mtime entry. Use when a prior Read was removed from context (e.g. by snip) so Edit validation would fail despite the client having observed the Read. The mtime lets the CLI detect if the file changed since the seeded Read — same staleness check as the normal path.")),yQ=q(()=>Y.object({subtype:Y.literal("hook_callback"),callback_id:Y.string(),input:p0(),tool_use_id:Y.string().optional()}).describe("Delivers a hook callback with its input data.")),$Q=q(()=>Y.object({subtype:Y.literal("mcp_message"),server_name:Y.string(),message:JQ()}).describe("Sends a JSON-RPC message to a specific MCP server.")),jQ=q(()=>Y.object({subtype:Y.literal("mcp_set_servers"),servers:Y.record(Y.string(),h0())}).describe("Replaces the set of dynamically managed MCP servers.")),FX=q(()=>Y.object({added:Y.array(Y.string()),removed:Y.array(Y.string()),errors:Y.record(Y.string(),Y.string())}).describe("Result of replacing the set of dynamically managed MCP servers.")),PQ=q(()=>Y.object({subtype:Y.literal("reload_plugins")}).describe("Reloads plugins from disk and returns the refreshed session components.")),MX=q(()=>Y.object({commands:Y.array(pZ()),agents:Y.array(cZ()),plugins:Y.array(Y.object({name:Y.string(),path:Y.string(),source:Y.string().optional()})),mcpServers:Y.array(uZ()),error_count:Y.number()}).describe("Refreshed commands, agents, plugins, and MCP server status after reload.")),FQ=q(()=>Y.object({subtype:Y.literal("mcp_reconnect"),serverName:Y.string()}).describe("Reconnects a disconnected or failed MCP server.")),MQ=q(()=>Y.object({subtype:Y.literal("mcp_toggle"),serverName:Y.string(),enabled:Y.boolean()}).describe("Enables or disables an MCP server.")),bQ=q(()=>Y.object({subtype:Y.literal("stop_task"),task_id:Y.string()}).describe("Stops a running task.")),IQ=q(()=>Y.object({subtype:Y.literal("apply_flag_settings"),settings:Y.record(Y.string(),Y.unknown())}).describe("Merges the provided settings into the flag settings layer, updating the active configuration.")),CQ=q(()=>Y.object({subtype:Y.literal("get_settings")}).describe("Returns the effective merged settings and the raw per-source settings.")),bX=q(()=>Y.object({effective:Y.record(Y.string(),Y.unknown()),sources:Y.array(Y.object({source:Y.enum(["userSettings","projectSettings","localSettings","flagSettings","policySettings"]),settings:Y.record(Y.string(),Y.unknown())})).describe("Ordered low-to-high priority — later entries override earlier ones."),applied:Y.object({model:Y.string(),effort:Y.enum(["low","medium","high","max"]).nullable()}).optional().describe("Runtime-resolved values after env overrides, session state, and model-specific defaults are applied. Unlike `effective` (disk merge), these reflect what will actually be sent to the API.")}).describe("Effective merged settings plus raw per-source settings in merge order.")),TQ=q(()=>Y.object({subtype:Y.literal("elicitation"),mcp_server_name:Y.string(),message:Y.string(),mode:Y.enum(["form","url"]).optional(),url:Y.string().optional(),elicitation_id:Y.string().optional(),requested_schema:Y.record(Y.string(),Y.unknown()).optional()}).describe("Requests the SDK consumer to handle an MCP elicitation (user input request).")),o0=q(()=>Y.object({action:Y.enum(["accept","decline","cancel"]),content:Y.record(Y.string(),Y.unknown()).optional()}).describe("Response from the SDK consumer for an elicitation request.")),RQ=q(()=>Y.union([BQ(),LQ(),NQ(),zQ(),qQ(),DQ(),vQ(),AQ(),yQ(),$Q(),UQ(),wQ(),EQ(),jQ(),PQ(),FQ(),MQ(),bQ(),IQ(),CQ(),TQ()])),mZ=q(()=>Y.object({type:Y.literal("control_request"),request_id:Y.string(),request:RQ()})),fQ=q(()=>Y.object({subtype:Y.literal("success"),request_id:Y.string(),response:Y.record(Y.string(),Y.unknown()).optional()})),SQ=q(()=>Y.object({subtype:Y.literal("error"),request_id:Y.string(),error:Y.string(),pending_permission_requests:Y.array(Y.lazy(()=>mZ())).optional()})),s0=q(()=>Y.object({type:Y.literal("control_response"),response:Y.union([fQ(),SQ()])})),hQ=q(()=>Y.object({type:Y.literal("control_cancel_request"),request_id:Y.string()}).describe("Cancels a currently open control request.")),t0=q(()=>Y.object({type:Y.literal("keep_alive")}).describe("Keep-alive message to maintain WebSocket connection.")),kQ=q(()=>Y.object({type:Y.literal("update_environment_variables"),variables:Y.record(Y.string(),Y.string())}).describe("Updates environment variables at runtime.")),IX=q(()=>Y.union([r0(),l0(),a0(),n0(),s0(),mZ(),hQ(),t0()])),CX=q(()=>Y.union([d0(),mZ(),s0(),t0(),kQ()]));lQ();HZ();dQ();lZ();JZ();HZ();EZ();e0();xQ();var xX=q(()=>h.object({tool_name:h.string().describe("The name of the tool requesting permission"),input:h.record(h.string(),h.unknown()).describe("The input for the tool"),tool_use_id:h.string().optional().describe("The unique tool use request ID")})),YY=q(()=>h.enum(["user_temporary","user_permanent","user_reject"]).optional().catch(void 0)),uQ=q(()=>h.object({behavior:h.literal("allow"),updatedInput:h.record(h.string(),h.unknown()),updatedPermissions:h.array(ZY()).optional().catch((Q)=>{I(`Malformed updatedPermissions from SDK host ignored: ${Q.error.issues[0]?.message??"unknown"}`,{level:"warn"});return}),toolUseID:h.string().optional(),decisionClassification:YY()})),pQ=q(()=>h.object({behavior:h.literal("deny"),message:h.string(),interrupt:h.boolean().optional(),toolUseID:h.string().optional(),decisionClassification:YY()})),gZ=q(()=>h.union([uQ(),pQ()]));function jZ(Q,Z,X,V){let W={type:"permissionPromptTool",permissionPromptToolName:Z.name,toolResult:Q};if(Q.behavior==="allow"){let H=Q.updatedPermissions;if(H)V.setAppState((K)=>({...K,toolPermissionContext:yZ(K.toolPermissionContext,H)})),$Z(H);let G=Object.keys(Q.updatedInput).length>0?Q.updatedInput:X;return{...Q,updatedInput:G,decisionReason:W}}else if(Q.behavior==="deny"&&Q.interrupt)I(`SDK permission prompt deny+interrupt: tool=${Z.name} message=${Q.message}`),V.abortController.abort();return{...Q,decisionReason:W}}rQ();gQ();PZ();JZ();aQ();qY();e0();iQ();PZ();nQ();PZ();var cQ=/\u2028|\u2029/g;function mQ(Q){return Q.replace(cQ,(Z)=>Z==="\u2028"?"\\u2028":"\\u2029")}function QY(Q){return mQ(ZZ(Q))}var oQ="SandboxNetworkAccess";function sQ(Q){if(!Q)return;if(Q.type==="classifier")return Q.reason;switch(Q.type){case"rule":case"mode":case"subcommandResults":case"permissionPromptTool":return;case"hook":case"asyncAgent":case"sandboxOverride":case"workingDir":case"safetyCheck":case"other":return Q.reason}}function tQ(Q,Z,X,V){let W;try{W=Q.getActivityDescription?.(Z)??Q.getToolUseSummary?.(Z)??Q.userFacingName(Z)}catch{W=Q.name}return{tool_name:Q.name,action_description:W,tool_use_id:X,request_id:V,input:Z}}var eQ=1000;class Z6{input;replayUserMessages;structuredInput;pendingRequests=new Map;restoredWorkerState=Promise.resolve(null);inputClosed=!1;unexpectedResponseCallback;resolvedToolUseIds=new Set;prependedLines=[];onControlRequestSent;onControlRequestResolved;outbound=new NY;constructor(Q,Z){this.input=Q;this.replayUserMessages=Z;this.input=Q,this.structuredInput=this.read()}trackResolvedToolUseId(Q){if(Q.request.subtype==="can_use_tool"){if(this.resolvedToolUseIds.add(Q.request.tool_use_id),this.resolvedToolUseIds.size>eQ){let Z=this.resolvedToolUseIds.values().next().value;if(Z!==void 0)this.resolvedToolUseIds.delete(Z)}}}flushInternalEvents(){return Promise.resolve()}get internalEventsPending(){return 0}prependUserMessage(Q){this.prependedLines.push(ZZ({type:"user",session_id:"",message:{role:"user",content:Q},parent_tool_use_id:null})+`
19
+ `)}async*read(){let Q="",Z=async function*(){for(;;){if(this.prependedLines.length>0)Q=this.prependedLines.join("")+Q,this.prependedLines=[];let X=Q.indexOf(`
20
+ `);if(X===-1)break;let V=Q.slice(0,X);Q=Q.slice(X+1);let W=await this.processLine(V);if(W)GY("info","cli_stdin_message_parsed",{type:W.type}),yield W}}.bind(this);yield*Z();for await(let X of this.input)Q+=X,yield*Z();if(Q){let X=await this.processLine(Q);if(X)yield X}this.inputClosed=!0;for(let X of this.pendingRequests.values())X.reject(Error("Tool permission stream closed before response received"))}getPendingPermissionRequests(){return Array.from(this.pendingRequests.values()).map((Q)=>Q.request).filter((Q)=>Q.request.subtype==="can_use_tool")}setUnexpectedResponseCallback(Q){this.unexpectedResponseCallback=Q}injectControlResponse(Q){let Z=Q.response?.request_id;if(!Z)return;let X=this.pendingRequests.get(Z);if(!X)return;if(this.trackResolvedToolUseId(X.request),this.pendingRequests.delete(Z),this.write({type:"control_cancel_request",request_id:Z}),Q.response.subtype==="error")X.reject(Error(Q.response.error));else{let V=Q.response.response;if(X.schema)try{X.resolve(X.schema.parse(V))}catch(W){X.reject(W)}else X.resolve({})}}setOnControlRequestSent(Q){this.onControlRequestSent=Q}setOnControlRequestResolved(Q){this.onControlRequestResolved=Q}async processLine(Q){if(!Q)return;try{let Z=DY(WY(Q));if(Z.type==="keep_alive")return;if(Z.type==="update_environment_variables"){let X=Object.keys(Z.variables);for(let[V,W]of Object.entries(Z.variables))process.env[V]=W;I(`[structuredIO] applied update_environment_variables: ${X.join(", ")}`);return}if(Z.type==="control_response"){let X="uuid"in Z&&typeof Z.uuid==="string"?Z.uuid:void 0;if(X)HY(X,"completed");let V=this.pendingRequests.get(Z.response.request_id);if(!V){let G=(Z.response.subtype==="success"?Z.response.response:void 0)?.toolUseID;if(typeof G==="string"&&this.resolvedToolUseIds.has(G)){I(`Ignoring duplicate control_response for already-resolved toolUseID=${G} request_id=${Z.response.request_id}`);return}if(this.unexpectedResponseCallback)await this.unexpectedResponseCallback(Z);return}if(this.trackResolvedToolUseId(V.request),this.pendingRequests.delete(Z.response.request_id),V.request.request.subtype==="can_use_tool"&&this.onControlRequestResolved)this.onControlRequestResolved(Z.response.request_id);if(Z.response.subtype==="error"){V.reject(Error(Z.response.error));return}let W=Z.response.response;if(V.schema)try{V.resolve(V.schema.parse(W))}catch(H){V.reject(H)}else V.resolve({});if(this.replayUserMessages)return Z;return}if(Z.type!=="user"&&Z.type!=="control_request"&&Z.type!=="assistant"&&Z.type!=="system"){I(`Ignoring unknown message type: ${Z.type}`,{level:"warn"});return}if(Z.type==="control_request"){if(!Z.request)XY("Error: Missing request on control_request");return Z}if(Z.type==="assistant"||Z.type==="system")return Z;if(Z.message.role!=="user")XY(`Error: Expected message role 'user', got '${Z.message.role}'`);return Z}catch(Z){console.error(`Error parsing streaming input line: ${Q}: ${Z}`),process.exit(1)}}async write(Q){KY(QY(Q)+`
21
+ `)}async sendRequest(Q,Z,X,V=dZ()){let W={type:"control_request",request_id:V,request:Q};if(this.inputClosed)throw Error("Stream closed");if(X?.aborted)throw Error("Request aborted");if(this.outbound.enqueue(W),Q.subtype==="can_use_tool"&&this.onControlRequestSent)this.onControlRequestSent(W);let H=()=>{this.outbound.enqueue({type:"control_cancel_request",request_id:V});let G=this.pendingRequests.get(V);if(G)this.trackResolvedToolUseId(G.request),G.reject(new VY)};if(X)X.addEventListener("abort",H,{once:!0});try{return await new Promise((G,K)=>{this.pendingRequests.set(V,{request:{type:"control_request",request_id:V,request:Q},resolve:(B)=>{G(B)},reject:K,schema:Z})})}finally{if(X)X.removeEventListener("abort",H);this.pendingRequests.delete(V)}}createCanUseTool(Q){return async(Z,X,V,W,H,G)=>{let K=G??await BY(Z,X,V,W,H);if(K.behavior==="allow"||K.behavior==="deny")return K;let B=new AbortController,z=V.abortController.signal,J=()=>B.abort();z.addEventListener("abort",J,{once:!0});try{let L=Y6(Z.name,H,X,V,K.suggestions).then((P)=>({source:"hook",decision:P})),_=dZ();Q?.(tQ(Z,X,H,_));let w=this.sendRequest({subtype:"can_use_tool",tool_name:Z.name,input:X,permission_suggestions:K.suggestions,blocked_path:K.blockedPath,decision_reason:sQ(K.decisionReason),tool_use_id:H,agent_id:V.agentId},gZ(),B.signal,_).then((P)=>({source:"sdk",result:P})),v=await Promise.race([L,w]);if(v.source==="hook"){if(v.decision)return w.catch(()=>{}),B.abort(),v.decision;let P=await w;return jZ(P.result,Z,X,V)}return jZ(v.result,Z,X,V)}catch(L){return jZ({behavior:"deny",message:`Tool permission request failed: ${L}`,toolUseID:H},Z,X,V)}finally{if(this.getPendingPermissionRequests().length===0)LY("running");z.removeEventListener("abort",J)}}}createHookCallback(Q,Z){return{type:"callback",timeout:Z,callback:async(X,V,W)=>{try{return await this.sendRequest({subtype:"hook_callback",callback_id:Q,input:X,tool_use_id:V||void 0},JY(),W)}catch(H){return console.error(`Error in hook callback ${Q}:`,H),{}}}}}async handleElicitation(Q,Z,X,V,W,H,G){try{return await this.sendRequest({subtype:"elicitation",mcp_server_name:Q,message:Z,mode:W,url:H,elicitation_id:G,requested_schema:X},o0(),V)}catch{return{action:"cancel"}}}createSandboxAskCallback(){return async(Q)=>{try{return(await this.sendRequest({subtype:"can_use_tool",tool_name:oQ,input:{host:Q.host},tool_use_id:dZ(),description:`Allow network connection to ${Q.host}?`},gZ())).behavior==="allow"}catch{return!1}}}async sendMcpMessage(Q,Z){return(await this.sendRequest({subtype:"mcp_message",server_name:Q,message:Z},Y.object({mcp_response:Y.any()}))).mcp_response}}function XY(Q){console.error(Q),process.exit(1)}async function Y6(Q,Z,X,V,W){let G=V.getAppState().toolPermissionContext.mode,K=zY(Q,Z,X,V,G,W,V.abortController.signal);for await(let B of K)if(B.permissionRequestResult&&(B.permissionRequestResult.behavior==="allow"||B.permissionRequestResult.behavior==="deny")){let z=B.permissionRequestResult;if(z.behavior==="allow"){let J=z.updatedInput||X,L=z.updatedPermissions??[];if(L.length>0){$Z(L);let _=V.getAppState(),w=yZ(_.toolPermissionContext,L);V.setAppState((v)=>{if(v.toolPermissionContext===w)return v;return{...v,toolPermissionContext:w}})}return{behavior:"allow",updatedInput:J,userModified:!1,decisionReason:{type:"hook",hookName:"PermissionRequest"}}}else return{behavior:"deny",message:z.message||"Permission denied by PermissionRequest hook",decisionReason:{type:"hook",hookName:"PermissionRequest"}}}return}_Y();function HV(Q){if(Q.type!=="user")return;let Z=Q.message?.content;if(!Z)return;if(Array.isArray(Z)&&Z.length===0)return;let X="uuid"in Q&&typeof Q.uuid==="string"?Q.uuid:void 0;return{content:Array.isArray(Z)?Q6(Z):Z,uuid:X}}function Q6(Q){if(!Q.some(vY))return Q;return Q.map((Z)=>{if(!vY(Z))return Z;let X=Z.source,V=typeof X.mediaType==="string"&&X.mediaType?X.mediaType:AY(Z.source.data);return{...Z,source:{type:"base64",media_type:V,data:Z.source.data}}})}function vY(Q){if(Q.type!=="image"||Q.source?.type!=="base64")return!1;return!Q.source.media_type}BZ();J6();V6();G6();X6();K6();W6();import{randomUUID as H6}from"crypto";function N6(Q){return Q===wY?EY:Q}function OV(Q){let X=yY()?.outputStyle??PY,V={type:"system",subtype:"init",cwd:UY(),session_id:NZ(),tools:Q.tools.map((W)=>N6(W.name)),mcp_servers:Q.mcpClients.map((W)=>({name:W.name,status:W.type})),model:Q.model,permissionMode:Q.permissionMode,slash_commands:Q.commands.filter((W)=>W.userInvocable!==!1).map((W)=>W.name),apiKeySource:jY().source,betas:OY(),claude_code_version:"99.0.0",output_style:X,agents:Q.agents.map((W)=>W.agentType),skills:Q.skills.filter((W)=>W.userInvocable!==!1).map((W)=>W.name),plugins:Q.plugins.map((W)=>({name:W.name,path:W.path,source:W.source})),uuid:H6()};return V.fast_mode_state=$Y(Q.model,Q.fastMode),V}var FY={"`":"`",'"':'"',"<":">","{":"}","[":"]","(":")","'":"'"};function B6(Q,Z){if(!new RegExp(Z,"i").test(Q))return[];if(Q.startsWith("/"))return[];let V=[],W=null,H=0,G=(J)=>!!J&&/[\p{L}\p{N}_]/u.test(J);for(let J=0;J<Q.length;J++){let L=Q[J];if(W){if(W==="["&&L==="["){H=J;continue}if(L!==FY[W])continue;if(W==="'"&&G(Q[J+1]))continue;V.push({start:H,end:J+1}),W=null}else if(L==="<"&&J+1<Q.length&&/[a-zA-Z/]/.test(Q[J+1])||L==="'"&&!G(Q[J-1])||L!=="<"&&L!=="'"&&L in FY)W=L,H=J}let K=[],B=new RegExp(`\\b${Z}\\b`,"gi"),z=Q.matchAll(B);for(let J of z){if(J.index===void 0)continue;let L=J.index,_=L+J[0].length;if(V.some((P)=>L>=P.start&&L<P.end))continue;let w=Q[L-1],v=Q[_];if(w==="/"||w==="\\"||w==="-")continue;if(v==="/"||v==="\\"||v==="-"||v==="?")continue;if(v==="."&&G(Q[_+1]))continue;K.push({word:J[0],start:L,end:_})}return K}function wV(Q){return B6(Q,"ultrareview")}UZ();wZ();w6();_6();O6();v6();qY();_Y();D6();wZ();U6();A6();import{randomUUID as E6}from"crypto";BZ();UZ();wZ();L6();z6();import{randomUUID as q6}from"crypto";function MY(Q){let Z=Q.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(Z)}function bY(Q){let Z=Q.toLowerCase().trim();if(Z==="continue")return!0;return/\b(keep going|go on)\b/.test(Z)}function fY(Q,Z,X,V,W,H,G){let K=q6();IY(K);let B=typeof Q==="string"?Q:Q.find((w)=>w.type==="text")?.text||"";RY(B);let z=typeof Q==="string"?Q:Q.findLast((w)=>w.type==="text")?.text||"";if(z)TY("user_prompt",{prompt_length:String(z.length),prompt:CY(z),"prompt.id":K});let J=MY(B),L=bY(B);if(g("tengu_input_prompt",{is_negative:J,is_keep_going:L}),Z.length>0){let w=typeof Q==="string"?Q.trim()?[{type:"text",text:Q}]:[]:Q;return{messages:[s({content:[...w,...Z],uuid:W,imagePasteIds:X.length>0?X:void 0,permissionMode:H,isMeta:G||void 0}),...V],shouldQuery:!0}}return{messages:[s({content:Q,uuid:W,permissionMode:H,isMeta:G||void 0}),...V],shouldQuery:!0}}async function iV({input:Q,preExpansionInput:Z,mode:X,setToolJSX:V,context:W,pastedContents:H,ideSelection:G,messages:K,setUserInputOnProcessing:B,uuid:z,isAlreadyProcessing:J,querySource:L,canUseTool:_,skipSlashCommands:w,bridgeOrigin:v,isMeta:P,skipAttachments:f}){let D=typeof Q==="string"?Q:null;if(X==="prompt"&&D!==null&&!P)B?.(D);n("query_process_user_input_base_start");let F=W.getAppState(),y=await y6(Q,X,V,W,H,G,K,z,J,L,_,F.toolPermissionContext.mode,w,v,P,f,Z);if(n("query_process_user_input_base_end"),!y.shouldQuery)return y;n("query_hooks_start");let S=hY(Q)||"";for await(let O of iY(S,F.toolPermissionContext.mode,W,W.requestPrompt)){if(O.message?.type==="progress")continue;if(O.blockingError){let $=rY(O.blockingError);return{messages:[gY(`${$}
22
+
23
+ Original prompt: ${Q}`,"warning")],shouldQuery:!1,allowedTools:y.allowedTools}}if(O.preventContinuation){let $=O.stopReason?`Operation stopped by hook: ${O.stopReason}`:"Operation stopped by hook";return y.messages.push(s({content:$})),y.shouldQuery=!1,y}if(O.additionalContexts&&O.additionalContexts.length>0)y.messages.push(kY({type:"hook_additional_context",content:O.additionalContexts.map(SY),hookName:"UserPromptSubmit",toolUseID:`hook-${E6()}`,hookEvent:"UserPromptSubmit"}));if(O.message)switch(O.message.attachment.type){case"hook_success":if(!O.message.attachment.content)break;y.messages.push({...O.message,attachment:{...O.message.attachment,content:SY(O.message.attachment.content)}});break;default:y.messages.push(O.message);break}}return n("query_hooks_end"),y}var aZ=1e4;function SY(Q){if(Q.length>aZ)return`${Q.substring(0,aZ)}… [output truncated - exceeded ${aZ} characters]`;return Q}async function y6(Q,Z,X,V,W,H,G,K,B,z,J,L,_,w,v,P,f){let D=null,F=[],y=[],S=Q;if(typeof Q==="string")D=Q;else if(Q.length>0){n("query_image_processing_start");let A=[];for(let N of Q)if(N.type==="image"){let u=await iZ(N);if(u.dimensions){let l=FZ(u.dimensions);if(l)y.push(l)}A.push(u.block)}else A.push(N);S=A,n("query_image_processing_end");let j=A[A.length-1];if(j?.type==="text")D=j.text,F=A.slice(0,-1);else F=A}if(D===null&&Z!=="prompt")throw Error(`Mode: ${Z} requires a string input.`);let O=W?Object.values(W).filter(cY):[],$=O.map((A)=>A.id),d=W?await xY(W):new Map;n("query_pasted_image_processing_start");let i=await Promise.all(O.map(async(A)=>{let j={type:"image",source:{type:"base64",media_type:A.mediaType||"image/png",data:A.content}};return g("tengu_pasted_image_resize_attempt",{original_size_bytes:A.content.length}),{resized:await iZ(j),originalDimensions:A.dimensions,sourcePath:A.sourcePath??d.get(A.id)}})),o=[];for(let{resized:A,originalDimensions:j,sourcePath:N}of i){if(A.dimensions){let u=FZ(A.dimensions,N);if(u)y.push(u)}else if(j){let u=FZ(j,N);if(u)y.push(u)}else if(N)y.push(`[Image source: ${N}]`);o.push(A.block)}n("query_pasted_image_processing_end");let C=_;if(w&&D!==null&&D.startsWith("/")){let A=pY(D),j=A?nY(A.commandName,V.options.commands):void 0;if(j)if(aY(j))C=!1;else{let N=`/${lY(j)} isn't available over Remote Control.`;return{messages:[s({content:D,uuid:K}),dY(`<local-command-stdout>${N}</local-command-stdout>`)],shouldQuery:!1,resultText:N}}}let k=!P&&D!==null&&(Z!=="prompt"||C||!D.startsWith("/"));n("query_attachment_loading_start");let x=k?await uY(mY(D,V,H??null,[],G,z)):[];if(n("query_attachment_loading_end"),D!==null&&Z==="bash"){let{processBashCommand:A}=await import("./processBashCommand-1.0.4-vhq5y4b0.mjs");return nZ(await A(D,F,x,V,X),y)}if(D!==null&&!C&&D.startsWith("/")){let{processSlashCommand:A}=await import("./processSlashCommand-1.0.4-27w0dvzd.mjs"),j=await A(D,F,o,x,V,X,K,B,J);return nZ(j,y)}if(D!==null&&Z==="prompt"){let A=D.trim(),j=x.find((N)=>N.attachment.type==="agent_mention");if(j){let N=`@agent-${j.attachment.agentType}`,u=A===N,l=A.startsWith(N)&&!u;g("tengu_subagent_at_mention",{is_subagent_only:u,is_prefix:l})}}return nZ(fY(S,o,$,x,K,L,v),y)}function nZ(Q,Z){if(Z.length>0)Q.messages.push(s({content:Z.map((X)=>({type:"text",text:X})),isMeta:!0}));return Q}i6();BZ();HZ();lZ();n6();a6();w0();o6();r6();import{isAbsolute as s6,resolve as t6}from"path";function e6(Q,Z,X){let V=[],W=[],H=[];for(let[G,K]of Object.entries(Q)){let B=Z[G],z=b9(K.source,X?.projectRoot);if(!B)V.push(G);else if(K.sourceIsFallback)H.push(G);else if(!j9(z,B.source))W.push({name:G,declaredSource:z,materializedSource:B.source});else H.push(G)}return{missing:V,sourceChanged:W,upToDate:H}}async function IW(Q){let Z=P9();if(Object.keys(Z).length===0)return{installed:[],updated:[],failed:[],upToDate:[],skipped:[]};let X;try{X=await F9()}catch(J){e(J),X={}}let V=e6(Z,X,{projectRoot:W0()}),W=[...V.missing.map((J)=>({name:J,source:b9(Z[J].source),action:"install"})),...V.sourceChanged.map(({name:J,declaredSource:L})=>({name:J,source:L,action:"update"}))],H=[],G=[];for(let J of W){if(Q?.skip?.(J.name,J.source)){H.push(J.name);continue}if(J.action==="update"&&$9(J.source)&&!await y9(J.source.path)){I(`[reconcile] '${J.name}' declared path does not exist; keeping materialized entry`),H.push(J.name);continue}G.push(J)}if(G.length===0)return{installed:[],updated:[],failed:[],upToDate:V.upToDate,skipped:H};I(`[reconcile] ${G.length} marketplace(s): ${G.map((J)=>`${J.name}(${J.action})`).join(", ")}`);let K=[],B=[],z=[];for(let J=0;J<G.length;J++){let{name:L,source:_,action:w}=G[J];Q?.onProgress?.({type:"installing",name:L,action:w,index:J+1,total:G.length});try{let v=await M9(_);if(w==="install")K.push(L);else B.push(L);Q?.onProgress?.({type:"installed",name:L,alreadyMaterialized:v.alreadyMaterialized})}catch(v){let P=w9(v);z.push({name:L,error:P}),Q?.onProgress?.({type:"failed",name:L,error:P}),e(v)}}return{installed:K,updated:B,failed:z,upToDate:V.upToDate,skipped:H}}function b9(Q,Z){if((Q.source==="directory"||Q.source==="file")&&!s6(Q.path)){let X=Z??W0(),V=E9(X);return{...Q,path:t6(V??X,Q.path)}}return Q}
24
+ export{HV as da,N6 as ea,OV as fa,e9 as ga,S0 as ha,VQ as ia,WQ as ja,KQ as ka,wV as la,iV as ma,gZ as na,jZ as oa,QY as pa,oQ as qa,Z6 as ra,e6 as sa,IW as ta,M6 as ua,b6 as va,I6 as wa,g6 as xa,d6 as ya,l6 as za};
@@ -0,0 +1,6 @@
1
+ import{Xqa as j}from"./cli-1.0.4-rhq4w2pj.mjs";function c(){let q=new Map;for(let[V,z]of Object.entries(J)){for(let[D,H]of Object.entries(z))J[D]={open:`\x1B[${H[0]}m`,close:`\x1B[${H[1]}m`},z[D]=J[D],q.set(H[0],H[1]);Object.defineProperty(J,V,{value:z,enumerable:!1})}return Object.defineProperty(J,"codes",{value:q,enumerable:!1}),J.color.close="\x1B[39m",J.bgColor.close="\x1B[49m",J.color.ansi=M(),J.color.ansi256=Y(),J.color.ansi16m=k(),J.bgColor.ansi=M(10),J.bgColor.ansi256=Y(10),J.bgColor.ansi16m=k(10),Object.defineProperties(J,{rgbToAnsi256:{value(V,z,D){if(V===z&&z===D){if(V<8)return 16;if(V>248)return 231;return Math.round((V-8)/247*24)+232}return 16+36*Math.round(V/255*5)+6*Math.round(z/255*5)+Math.round(D/255*5)},enumerable:!1},hexToRgb:{value(V){let z=/[a-f\d]{6}|[a-f\d]{3}/i.exec(V.toString(16));if(!z)return[0,0,0];let[D]=z;if(D.length===3)D=[...D].map((Q)=>Q+Q).join("");let H=Number.parseInt(D,16);return[H>>16&255,H>>8&255,H&255]},enumerable:!1},hexToAnsi256:{value:(V)=>J.rgbToAnsi256(...J.hexToRgb(V)),enumerable:!1},ansi256ToAnsi:{value(V){if(V<8)return 30+V;if(V<16)return 90+(V-8);let z,D,H;if(V>=232)z=((V-232)*10+8)/255,D=z,H=z;else{V-=16;let N=V%36;z=Math.floor(V/36)/5,D=Math.floor(N/6)/5,H=N%6/5}let Q=Math.max(z,D,H)*2;if(Q===0)return 30;let U=30+(Math.round(H)<<2|Math.round(D)<<1|Math.round(z));if(Q===2)U+=60;return U},enumerable:!1},rgbToAnsi:{value:(V,z,D)=>J.ansi256ToAnsi(J.rgbToAnsi256(V,z,D)),enumerable:!1},hexToAnsi:{value:(V)=>J.ansi256ToAnsi(J.hexToAnsi256(V)),enumerable:!1}}),J}var M=(q=0)=>(V)=>`\x1B[${V+q}m`,Y=(q=0)=>(V)=>`\x1B[${38+q};5;${V}m`,k=(q=0)=>(V,z,D)=>`\x1B[${38+q};2;${V};${z};${D}m`,J,V1,u,m,q1,p,X;var R=j(()=>{J={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},V1=Object.keys(J.modifier),u=Object.keys(J.color),m=Object.keys(J.bgColor),q1=[...u,...m];p=c(),X=p});import I from"node:process";import d from"node:os";import E from"node:tty";function W(q,V=globalThis.Deno?globalThis.Deno.args:I.argv){let z=q.startsWith("-")?"":q.length===1?"-":"--",D=V.indexOf(z+q),H=V.indexOf("--");return D!==-1&&(H===-1||D<H)}function y(){if("FORCE_COLOR"in K){if(K.FORCE_COLOR==="true")return 1;if(K.FORCE_COLOR==="false")return 0;return K.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(K.FORCE_COLOR,10),3)}}function g(q){if(q===0)return!1;return{level:q,hasBasic:!0,has256:q>=2,has16m:q>=3}}function i(q,{streamIsTTY:V,sniffFlags:z=!0}={}){let D=y();if(D!==void 0)B=D;let H=z?B:D;if(H===0)return 0;if(z){if(W("color=16m")||W("color=full")||W("color=truecolor"))return 3;if(W("color=256"))return 2}if("TF_BUILD"in K&&"AGENT_NAME"in K)return 1;if(q&&!V&&H===void 0)return 0;let Q=H||0;if(K.TERM==="dumb")return Q;if(I.platform==="win32"){let U=d.release().split(".");if(Number(U[0])>=10&&Number(U[2])>=10586)return Number(U[2])>=14931?3:2;return 1}if("CI"in K){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((U)=>(U in K)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((U)=>(U in K))||K.CI_NAME==="codeship")return 1;return Q}if("TEAMCITY_VERSION"in K)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(K.TEAMCITY_VERSION)?1:0;if(K.COLORTERM==="truecolor")return 3;if(K.TERM==="xterm-kitty")return 3;if(K.TERM==="xterm-ghostty")return 3;if(K.TERM==="wezterm")return 3;if("TERM_PROGRAM"in K){let U=Number.parseInt((K.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(K.TERM_PROGRAM){case"iTerm.app":return U>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(K.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(K.TERM))return 1;if("COLORTERM"in K)return 1;return Q}function T(q,V={}){let z=i(q,{streamIsTTY:q&&q.isTTY,...V});return g(z)}var K,B,a,A;var C=j(()=>{({env:K}=I);if(W("no-color")||W("no-colors")||W("color=false")||W("color=never"))B=0;else if(W("color")||W("colors")||W("color=true")||W("color=always"))B=1;a={stdout:T({isTTY:E.isatty(1)}),stderr:T({isTTY:E.isatty(2)})},A=a});function F(q,V,z){let D=q.indexOf(V);if(D===-1)return q;let H=V.length,Q=0,U="";do U+=q.slice(Q,D)+V+z,Q=D+H,D=q.indexOf(V,Q);while(D!==-1);return U+=q.slice(Q),U}function _(q,V,z,D){let H=0,Q="";do{let U=q[D-1]==="\r";Q+=q.slice(H,U?D-1:D)+V+(U?`\r
2
+ `:`
3
+ `)+z,H=D+1,D=q.indexOf(`
4
+ `,H)}while(D!==-1);return Q+=q.slice(H),Q}var b=()=>{};class o{constructor(q){return v(q)}}function G(q){return v(q)}var S,h,L,Z,O,f,$,n=(q,V={})=>{if(V.level&&!(Number.isInteger(V.level)&&V.level>=0&&V.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let z=S?S.level:0;q.level=V.level===void 0?z:V.level},v=(q)=>{let V=(...z)=>z.join(" ");return n(V,q),Object.setPrototypeOf(V,G.prototype),V},P=(q,V,z,...D)=>{if(q==="rgb"){if(V==="ansi16m")return X[z].ansi16m(...D);if(V==="ansi256")return X[z].ansi256(X.rgbToAnsi256(...D));return X[z].ansi(X.rgbToAnsi(...D))}if(q==="hex")return P("rgb",V,z,...X.hexToRgb(...D));return X[z][q](...D)},t,r,x=(q,V,z)=>{let D,H;if(z===void 0)D=q,H=V;else D=z.openAll+q,H=V+z.closeAll;return{open:q,close:V,openAll:D,closeAll:H,parent:z}},w=(q,V,z)=>{let D=(...H)=>l(D,H.length===1?""+H[0]:H.join(" "));return Object.setPrototypeOf(D,r),D[L]=q,D[Z]=V,D[O]=z,D},l=(q,V)=>{if(q.level<=0||!V)return q[O]?"":V;let z=q[Z];if(z===void 0)return V;let{openAll:D,closeAll:H}=z;if(V.includes("\x1B"))while(z!==void 0)V=F(V,z.close,z.open),z=z.parent;let Q=V.indexOf(`
5
+ `);if(Q!==-1)V=_(V,H,D,Q);return D+V+H},s,Z1,O1;var e=j(()=>{R();C();b();({stdout:S,stderr:h}=A),L=Symbol("GENERATOR"),Z=Symbol("STYLER"),O=Symbol("IS_EMPTY"),f=["ansi","ansi","ansi256","ansi16m"],$=Object.create(null);Object.setPrototypeOf(G.prototype,Function.prototype);for(let[q,V]of Object.entries(X))$[q]={get(){let z=w(this,x(V.open,V.close,this[Z]),this[O]);return Object.defineProperty(this,q,{value:z}),z}};$.visible={get(){let q=w(this,this[Z],!0);return Object.defineProperty(this,"visible",{value:q}),q}};t=["rgb","hex","ansi256"];for(let q of t){$[q]={get(){let{level:z}=this;return function(...D){let H=x(P(q,f[z],"color",...D),X.color.close,this[Z]);return w(this,H,this[O])}}};let V="bg"+q[0].toUpperCase()+q.slice(1);$[V]={get(){let{level:z}=this;return function(...D){let H=x(P(q,f[z],"bgColor",...D),X.bgColor.close,this[Z]);return w(this,H,this[O])}}}}r=Object.defineProperties(()=>{},{...$,level:{enumerable:!0,get(){return this[L].level},set(q){this[L].level=q}}});Object.defineProperties(G.prototype,$);s=G(),Z1=G({level:h?h.level:0}),O1=s});
6
+ export{o as Q7,O1 as R7,e as S7};
@@ -0,0 +1,2 @@
1
+ import{Wqa as n,Xqa as o}from"./cli-1.0.4-rhq4w2pj.mjs";var p={};n(p,{stripProtoFields:()=>e,logEventAsync:()=>c,logEvent:()=>i,attachAnalyticsSink:()=>r,_resetForTesting:()=>s});function e(t){return t}function r(){}function i(){}async function c(){}function s(){}var u=()=>{};
2
+ export{i as Nha,c as Oha,p as Pha,u as Qha};
@@ -0,0 +1,2 @@
1
+ import{vd as XJ,wd as mJ}from"./cli-1.0.4-fv9x8ks1.mjs";import{$h as dJ,_h as JJ}from"./cli-1.0.4-cj3nrnbs.mjs";import{$E as vJ,Aj as g,CD as e,Cm as OJ,DD as pJ,DG as o,EG as s,FG as FJ,IQ as P,Jk as BJ,Jn as h,ON as I,Qy as i,Ry as TJ,VS as bJ,Wl as c,Zl as HJ,_E as n,_w as x,gD as LJ,km as a,pm as RJ,wD as yJ,wm as l,xD as DJ,zG as T}from"./cli-1.0.4-jvp0mp87.mjs";import{O5 as WJ}from"./cli-1.0.4-0vwtrvvh.mjs";import{Jca as MJ,U_ as VJ,Zea as O,_ea as AJ,gfa as B,ofa as H,pca as f,xca as u,yca as _J}from"./cli-1.0.4-q0rnwhn4.mjs";import{Aga as YJ}from"./cli-1.0.4-d8bjdz7n.mjs";import{$ga as zJ}from"./cli-1.0.4-8x3m3esm.mjs";import{Nha as R,Qha as y}from"./cli-1.0.4-34jdejmp.mjs";import{Cia as V,Gia as UJ,Qia as m,Tia as NJ,yia as QJ}from"./cli-1.0.4-vpcfce7x.mjs";import{vja as C}from"./cli-1.0.4-7pxrd0w5.mjs";import{Lja as wJ,yja as U}from"./cli-1.0.4-ex22h376.mjs";import{dna as b,mpa as j,uma as F}from"./cli-1.0.4-n5mydt2f.mjs";import{Uqa as jJ}from"./cli-1.0.4-rhq4w2pj.mjs";pJ();dJ();j();YJ();y();I();BJ();h();VJ();zJ();C();H();P();WJ();QJ();x();I();h();H();C();P();x();LJ();function D(){}j();y();AJ();NJ();wJ();UJ();TJ();MJ();H();o();vJ();RJ();bJ();FJ();_J();OJ();HJ();import{join as Q}from"path";var SJ=30;function L(){let K=((f()||{}).cleanupPeriodDays??SJ)*24*60*60*1000;return new Date(Date.now()-K)}function r(X,J){return{messages:X.messages+J.messages,errors:X.errors+J.errors}}function kJ(X){let J=X.split(".")[0].replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/,"T$1:$2:$3.$4Z");return new Date(J)}async function p(X,J,K){let $={messages:0,errors:0};try{let G=await V().readdir(X);for(let Z of G)try{if(kJ(Z.name)<J)if(await V().unlink(Q(X,Z.name)),K)$.messages++;else $.errors++}catch(Y){B(Y)}}catch(G){if(G instanceof Error&&"code"in G&&G.code!=="ENOENT")B(G)}return $}async function EJ(){let X=V(),J=L(),K=O.errors(),$=O.baseLogs(),G=await p(K,J,!1);try{let Z;try{Z=await X.readdir($)}catch{return G}let Y=Z.filter((q)=>q.isDirectory()&&q.name.startsWith("mcp-logs-")).map((q)=>Q($,q.name));for(let q of Y)G=r(G,await p(q,J,!0)),await z(q,X)}catch(Z){if(Z instanceof Error&&"code"in Z&&Z.code!=="ENOENT")B(Z)}return G}async function w(X,J,K){if((await K.stat(X)).mtime<J)return await K.unlink(X),!0;return!1}async function z(X,J){try{await J.rmdir(X)}catch{}}async function CJ(){let X=L(),J={messages:0,errors:0},K=g(),$=V(),G;try{G=await $.readdir(K)}catch{return J}for(let Z of G){if(!Z.isDirectory())continue;let Y=Q(K,Z.name),q;try{q=await $.readdir(Y)}catch{J.errors++;continue}for(let W of q)if(W.isFile()){if(!W.name.endsWith(".jsonl")&&!W.name.endsWith(".cast"))continue;try{if(await w(Q(Y,W.name),X,$))J.messages++}catch{J.errors++}}else if(W.isDirectory()){let M=Q(Y,W.name),N=Q(M,l),S;try{S=await $.readdir(N)}catch{await z(M,$);continue}for(let _ of S)if(_.isFile())try{if(await w(Q(N,_.name),X,$))J.messages++}catch{J.errors++}else if(_.isDirectory()){let A=Q(N,_.name),k;try{k=await $.readdir(A)}catch{continue}for(let E of k){if(!E.isFile())continue;try{if(await w(Q(A,E.name),X,$))J.messages++}catch{J.errors++}}await z(A,$)}await z(N,$),await z(M,$)}await z(Y,$)}return J}async function d(X,J,K=!0){let $=L(),G={messages:0,errors:0},Z=V(),Y;try{Y=await Z.readdir(X)}catch{return G}for(let q of Y){if(!q.isFile()||!q.name.endsWith(J))continue;try{if(await w(Q(X,q.name),$,Z))G.messages++}catch{G.errors++}}if(K)await z(X,Z);return G}async function hJ(){let X=a(),J=await d(X,".md"),K=Q(U(),"plans");if(K!==X){let $=await d(K,".md");return r(J,$)}return J}async function xJ(){let X=L(),J={messages:0,errors:0},K=V();try{let $=U(),G=Q($,"file-history"),Z;try{Z=await K.readdir(G)}catch{return J}let Y=Z.filter((q)=>q.isDirectory()).map((q)=>Q(G,q.name));await Promise.all(Y.map(async(q)=>{try{if((await K.stat(q)).mtime<X)await K.rm(q,{recursive:!0,force:!0}),J.messages++}catch{J.errors++}})),await z(G,K)}catch($){B($)}return J}async function IJ(){let X=L(),J={messages:0,errors:0},K=V();try{let $=U(),G=Q($,"session-env"),Z;try{Z=await K.readdir(G)}catch{return J}let Y=Z.filter((q)=>q.isDirectory()).map((q)=>Q(G,q.name));for(let q of Y)try{if((await K.stat(q)).mtime<X)await K.rm(q,{recursive:!0,force:!0}),J.messages++}catch{J.errors++}await z(G,K)}catch($){B($)}return J}async function PJ(){let X=L(),J={messages:0,errors:0},K=V(),$=Q(U(),"debug"),G;try{G=await K.readdir($)}catch{return J}for(let Z of G){if(!Z.isFile()||!Z.name.endsWith(".txt")||Z.name==="latest")continue;try{if(await w(Q($,Z.name),X,K))J.messages++}catch{J.errors++}}return J}async function t(){let{errors:X}=s();if(X.length>0&&u("cleanupPeriodDays")){m("Skipping cleanup: settings have validation errors but cleanupPeriodDays was explicitly set. Fix settings errors to enable cleanup.");return}await EJ(),await CJ(),await hJ(),await xJ(),await IJ(),await PJ(),await i(),await n(L());let J=await c(L());if(J>0)R("tengu_worktree_cleanup",{removed:J})}o();mJ();var fJ=(DJ(),jJ(yJ));var v=600000;function sX(){JJ(),D(),fJ.initExtractMemories(),e(),XJ();let X=!0;async function J(){if(b()&&F()>Date.now()-60000){setTimeout(J,v).unref();return}if(X)X=!1,await t();if(b()&&F()>Date.now()-60000){setTimeout(J,v).unref();return}await T()}setTimeout(J,v).unref()}
2
+ export{sX as La};
@@ -0,0 +1,2 @@
1
+ import{Uo as Z,Zo as G}from"./cli-1.0.4-jvp0mp87.mjs";import{gfa as X,ofa as R}from"./cli-1.0.4-q0rnwhn4.mjs";import{Cia as C,Gia as M,Qia as U,Tia as O,tia as v,uia as B,yia as A}from"./cli-1.0.4-vpcfce7x.mjs";import{Xqa as b}from"./cli-1.0.4-rhq4w2pj.mjs";import{randomBytes as L}from"crypto";import{readFile as N,rename as S,unlink as T,writeFile as _}from"fs/promises";import{join as E}from"path";function Y(){return E(Z(),j)}function k(q){let x=B(q);if(typeof x!=="object"||x===null||!("plugins"in x)||typeof x.plugins!=="object"||x.plugins===null)return{};let z=x.plugins,J={};for(let[Q,K]of Object.entries(z))if(K&&typeof K==="object"&&"flaggedAt"in K&&typeof K.flaggedAt==="string"){let $={flaggedAt:K.flaggedAt};if("seenAt"in K&&typeof K.seenAt==="string")$.seenAt=K.seenAt;J[Q]=$}return J}async function V(){try{let q=await N(Y(),{encoding:"utf-8"});return k(q)}catch{return{}}}async function W(q){let x=Y(),z=`${x}.${L(8).toString("hex")}.tmp`;try{await C().mkdir(Z());let J=v({plugins:q},null,2);await _(z,J,{encoding:"utf-8",mode:384}),await S(z,x),H=q}catch(J){X(J);try{await T(z)}catch{}}}async function o(){let q=await V(),x=Date.now(),z=!1;for(let[J,Q]of Object.entries(q))if(Q.seenAt&&x-new Date(Q.seenAt).getTime()>=f)delete q[J],z=!0;if(H=q,z)await W(q)}function c(){return H??{}}async function p(q){if(H===null)H=await V();let x={...H,[q]:{flaggedAt:new Date().toISOString()}};await W(x),U(`Flagged plugin: ${q}`)}async function d(q){if(H===null)H=await V();let x=new Date().toISOString(),z=!1,J={...H};for(let Q of q){let K=J[Q];if(K&&!K.seenAt)J[Q]={...K,seenAt:x},z=!0}if(z)await W(J)}async function g(q){if(H===null)H=await V();if(!(q in H))return;let{[q]:x,...z}=H;H=z,await W(z)}var j="flagged-plugins.json",f=172800000,H=null;var w=b(()=>{O();M();R();A();G()});
2
+ export{o as xd,c as yd,p as zd,d as Ad,g as Bd,w as Cd};
@@ -0,0 +1,3 @@
1
+ import{$B as qf,DH as v,EH as Bf,Ek as m,El as c,Fk as pf,OF as S,PF as zf,Pl as N,Sl as d,Tl as M,US as Hf,VS as If,Yn as l,Zl as Of,Zn as $f,_B as X,km as V,nR as r,pR as Zf,pm as Yf}from"./cli-1.0.4-jvp0mp87.mjs";import{cU as u,dU as Kf}from"./cli-1.0.4-4m4pwdge.mjs";import{I0 as Af,IY as Jf,b0 as D,d0 as T}from"./cli-1.0.4-9ra8j4rt.mjs";import{O2 as A,P2 as R,Q2 as L}from"./cli-1.0.4-x8jnn75c.mjs";import{R2 as _f}from"./cli-1.0.4-5e2v63sy.mjs";import{n9 as W,p9 as yf}from"./cli-1.0.4-q0rnwhn4.mjs";import{Nha as F,Qha as ff}from"./cli-1.0.4-34jdejmp.mjs";import{Qia as b,Tia as Gf}from"./cli-1.0.4-vpcfce7x.mjs";import{Tqa as g,Uqa as e,Xqa as k}from"./cli-1.0.4-rhq4w2pj.mjs";function E(){(If(),e(Hf)).saveWorktreeState(null),m()}function a({onDone:J,onCancel:O}){let[Y,y]=$.useState("loading"),[p,H]=$.useState([]),[G,q]=$.useState(0),[Z,_]=$.useState(),f=c();if($.useEffect(()=>{async function z(){let I=[],B=await W("git",["status","--porcelain"]);if(B.stdout)I=B.stdout.split(`
2
+ `).filter((Q)=>Q.trim()!==""),H(I);if(f){let{stdout:Q}=await W("git",["rev-list","--count",`${f.originalHeadCommit}..HEAD`]),w=parseInt(Q.trim())||0;if(q(w),I.length===0&&w===0){y("removing"),M().then(()=>{process.chdir(f.originalCwd),X(f.originalCwd),V.cache.clear?.(),_("Worktree removed (no changes)")}).catch((s)=>{b(`Failed to clean up worktree: ${s}`,{level:"error"}),_("Worktree cleanup failed, exiting anyway")}).finally(()=>{E()}).then(()=>{y("done")});return}else y("asking")}}z()},[f]),$.useEffect(()=>{if(Y==="done")J(Z)},[Y,J,Z]),!f)return J("No active worktree session found",{display:"system"}),null;if(Y==="loading"||Y==="done")return null;async function j(z){if(!f)return;let I=Boolean(f.tmuxSessionName);if(z==="keep"||z==="keep-with-tmux"){y("keeping"),F("tengu_worktree_kept",{commits:G,changed_files:p.length}),await d();try{process.chdir(f.originalCwd),X(f.originalCwd)}finally{E()}if(V.cache.clear?.(),I)_(`Worktree kept. Your work is saved at ${f.worktreePath} on branch ${f.worktreeBranch}. Reattach to tmux session with: tmux attach -t ${f.tmuxSessionName}`);else _(`Worktree kept. Your work is saved at ${f.worktreePath} on branch ${f.worktreeBranch}`);y("done")}else if(z==="keep-kill-tmux"){if(y("keeping"),F("tengu_worktree_kept",{commits:G,changed_files:p.length}),f.tmuxSessionName)await N(f.tmuxSessionName);await d();try{process.chdir(f.originalCwd),X(f.originalCwd)}finally{E()}V.cache.clear?.(),_(`Worktree kept at ${f.worktreePath} on branch ${f.worktreeBranch}. Tmux session terminated.`),y("done")}else if(z==="remove"||z==="remove-with-tmux"){if(y("removing"),F("tengu_worktree_removed",{commits:G,changed_files:p.length}),f.tmuxSessionName)await N(f.tmuxSessionName);try{await M(),process.chdir(f.originalCwd),X(f.originalCwd),V.cache.clear?.()}catch(Q){b(`Failed to clean up worktree: ${Q}`,{level:"error"}),_("Worktree cleanup failed, exiting anyway"),y("done");return}finally{E()}let B=I?" Tmux session terminated.":"";if(G>0&&p.length>0)_(`Worktree removed. ${G} ${G===1?"commit":"commits"} and uncommitted changes were discarded.${B}`);else if(G>0)_(`Worktree removed. ${G} ${G===1?"commit":"commits"} on ${f.worktreeBranch} ${G===1?"was":"were"} discarded.${B}`);else if(p.length>0)_(`Worktree removed. Uncommitted changes were discarded.${B}`);else _(`Worktree removed.${B}`);y("done")}}if(Y==="keeping")return R(D,{flexDirection:"row",marginY:1,children:[A(v,{}),A(T,{children:"Keeping worktree…"})]});if(Y==="removing")return R(D,{flexDirection:"row",marginY:1,children:[A(v,{}),A(T,{children:"Removing worktree…"})]});let x=f.worktreeBranch,P=p.length>0,U=G>0,K="";if(P&&U)K=`You have ${p.length} uncommitted ${p.length===1?"file":"files"} and ${G} ${G===1?"commit":"commits"} on ${x}. All will be lost if you remove.`;else if(P)K=`You have ${p.length} uncommitted ${p.length===1?"file":"files"}. These will be lost if you remove the worktree.`;else if(U)K=`You have ${G} ${G===1?"commit":"commits"} on ${x}. The branch will be deleted if you remove the worktree.`;else K="You are working in a worktree. Keep it to continue working there, or remove it to clean up.";function o(){if(O){O();return}j("keep")}let h=P||U?"All changes and commits will be lost.":"Clean up the worktree directory.",C=Boolean(f.tmuxSessionName),t=C?[{label:"Keep worktree and tmux session",value:"keep-with-tmux",description:`Stays at ${f.worktreePath}. Reattach with: tmux attach -t ${f.tmuxSessionName}`},{label:"Keep worktree, kill tmux session",value:"keep-kill-tmux",description:`Keeps worktree at ${f.worktreePath}, terminates tmux session.`},{label:"Remove worktree and tmux session",value:"remove-with-tmux",description:h}]:[{label:"Keep worktree",value:"keep",description:`Stays at ${f.worktreePath}`},{label:"Remove worktree",value:"remove",description:h}];return A(l,{title:"Exiting worktree session",subtitle:K,onCancel:o,children:A(S,{defaultFocusValue:C?"keep-with-tmux":"keep",options:t,onChange:j})})}var $;var i=k(()=>{ff();Gf();Af();yf();Yf();pf();qf();Of();zf();$f();Bf();L();$=g(_f(),1)});function Vf(){return u(Qf)??"Goodbye!"}function wf(J){let O=n.c(5),{showWorktree:Y,onDone:y,onCancel:p}=J,H;if(O[0]!==y)H=async function(Z){y(Z??Vf()),await r(0,"prompt_input_exit")},O[0]=y,O[1]=H;else H=O[1];let G=H;if(Y){let q;if(O[2]!==p||O[3]!==G)q=A(a,{onDone:G,onCancel:p}),O[2]=p,O[3]=G,O[4]=q;else q=O[4];return q}return null}var n,Qf;var Xf=k(()=>{Kf();Zf();i();L();n=g(Jf(),1),Qf=["Goodbye!","See ya!","Bye!","Catch you later!"]});
3
+ export{wf as mc,Xf as nc};
@@ -0,0 +1,3 @@
1
+ import{A1 as d,B1 as X,F1 as N}from"./cli-1.0.4-vckzcaj2.mjs";import{Kca as O,Kda as p,Lca as f,gfa as B,mda as U,ofa as y,pda as G}from"./cli-1.0.4-q0rnwhn4.mjs";import{nja as x,vja as b}from"./cli-1.0.4-7pxrd0w5.mjs";import{Lja as E,yja as H}from"./cli-1.0.4-ex22h376.mjs";import{cna as w,mpa as P}from"./cli-1.0.4-n5mydt2f.mjs";import{gqa as k,yqa as S}from"./cli-1.0.4-j17mhs88.mjs";import{Tqa as M,Xqa as R}from"./cli-1.0.4-rhq4w2pj.mjs";import{mkdir as _,readFile as V,writeFile as A}from"fs/promises";import{dirname as L,join as m}from"path";function W(){return m(H(),"cache","changelog.md")}async function Jq(){let J=G();if(!J.cachedChangelog)return;let q=W();try{await _(L(q),{recursive:!0}),await A(q,J.cachedChangelog,{encoding:"utf-8",flag:"wx"})}catch{}U(({cachedChangelog:Y,...z})=>z)}async function C(){if(w())return;if(O())return;let J=await k.get(v);if(J.status===200){let q=J.data;if(q===$)return;let Y=W();await _(L(Y),{recursive:!0}),await A(Y,q,{encoding:"utf-8"}),$=q;let z=Date.now();U((K)=>({...K,changelogLastFetched:z}))}}async function h(){if($!==null)return $;let J=W();try{let q=await V(J,"utf-8");return $=q,q}catch{return $="",""}}function j(){return $??""}function F(J){try{if(!J)return{};let q={},Y=J.split(/^## /gm).slice(1);for(let z of Y){let K=z.trim().split(`
2
+ `);if(K.length===0)continue;let Q=K[0];if(!Q)continue;let Z=Q.split(" - ")[0]?.trim()||"";if(!Z)continue;let D=K.slice(1).filter((I)=>I.trim().startsWith("- ")).map((I)=>I.trim().substring(2).trim()).filter(Boolean);if(D.length>0)q[Z]=D}return q}catch(q){return B(x(q)),{}}}function l(J,q,Y=j()){try{let z=F(Y),K=T.coerce(J),Q=q?T.coerce(q):null;if(!Q||K&&X(K.version,Q.version))return Object.entries(z).filter(([Z])=>!Q||X(Z,Q.version)).sort(([Z],[D])=>X(Z,D)?-1:1).flatMap(([Z,D])=>D).filter(Boolean).slice(0,u)}catch(z){return B(x(z)),[]}return[]}function Kq(J=j()){try{let q=F(J);return Object.keys(q).sort((z,K)=>X(z,K)?1:-1).map((z)=>{let K=q[z];if(!K||K.length===0)return null;let Q=K.filter(Boolean);if(Q.length===0)return null;return[z,Q]}).filter((z)=>z!==null)}catch(q){return B(x(q)),[]}}async function Qq(J,q="99.0.0"){let Y=await h();if(J!==q||!Y)C().catch((Q)=>B(x(Q)));let z=l(q,J,Y);return{hasReleaseNotes:z.length>0,releaseNotes:z}}var T,u=5,zq="https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md",v="https://raw.githubusercontent.com/anthropics/claude-code/refs/heads/main/CHANGELOG.md",$=null;var g=R(()=>{S();P();p();E();b();y();f();N();T=M(d(),1)});
3
+ export{zq as if,Jq as jf,C as kf,h as lf,Kq as mf,Qq as nf,g as of};
@@ -0,0 +1,2 @@
1
+ import{d7 as Z,g7 as T,m7 as f,v7 as WB}from"./cli-1.0.4-0vwtrvvh.mjs";import{$$ as KB,Bda as v,Kda as QB,_$ as _,b9 as O,c9 as BB,pda as A}from"./cli-1.0.4-q0rnwhn4.mjs";import{$ga as JB,_ga as w}from"./cli-1.0.4-8x3m3esm.mjs";import{Bja as F,Lja as e}from"./cli-1.0.4-ex22h376.mjs";import{Cka as I,Dka as c,Oka as M,Pka as m,Yja as S,Zja as s,mpa as a,pla as R}from"./cli-1.0.4-n5mydt2f.mjs";import{Lpa as q,Mpa as t}from"./cli-1.0.4-z5zmw573.mjs";import{Xqa as K}from"./cli-1.0.4-rhq4w2pj.mjs";function p(B,J){return B+b(h()*(J-B+1))}var b,h,D;var G=K(()=>{b=Math.floor,h=Math.random;D=p});function u(B){var J=B.length;return J?B[D(0,J-1)]:void 0}var Y;var H=K(()=>{G();Y=u});function l(B,J){return M(J,function(X){return B[X]})}var z;var P=K(()=>{m();z=l});function i(B){return B==null?[]:z(B,I(B))}var U;var C=K(()=>{P();c();U=i});function n(B){return Y(U(B))}var k;var E=K(()=>{H();C();k=n});function o(B){var J=S(B)?Y:k;return J(B)}var kB;var r=K(()=>{H();E();s();kB=o});async function vB(){if(W===null&&!Q)Q=YB(),W=await Q,Q=null,d.cache.clear?.()}function TB(){W=null,Q=null,d.cache.clear?.(),g.cache.clear?.()}function XB(){if(W!==null)return W;let B=Z();if(B?.emailAddress)return B.emailAddress;return}async function YB(){let B=Z();if(B?.emailAddress)return B.emailAddress;return g()}var W=null,Q=null,d,g;var ZB=K(()=>{BB();t();a();WB();QB();JB();KB();e();d=q((B)=>{let J=v(),X=A(),$,N,L;if(B){if($=T()??void 0,N=f()??void 0,$&&X.claudeCodeFirstTokenDate){let x=new Date(X.claudeCodeFirstTokenDate).getTime();if(!isNaN(x))L=x}}let V=Z(),j=V?.organizationUuid,y=V?.accountUuid;return{deviceId:J,sessionId:R(),email:XB(),appVersion:"99.0.0",platform:_(),organizationUuid:j,accountUuid:y,userType:void 0,subscriptionType:$,rateLimitTier:N,firstTokenTime:L,...F(process.env.GITHUB_ACTIONS)&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}});g=q(async()=>{let B=await O("git config --get user.email",{shell:!0,reject:!1,cwd:w()});return B.exitCode===0&&B.stdout?B.stdout.trim():void 0})});
2
+ export{kB as cU,r as dU,vB as eU,TB as fU,g as gU,ZB as hU};
@@ -0,0 +1,2 @@
1
+ import{$h as l,Zh as j}from"./cli-1.0.4-cj3nrnbs.mjs";import{di as W,ji as i}from"./cli-1.0.4-vxb33mtd.mjs";import{AB as d,EB as E,FB as C,Ju as _,Py as V,QN as M,Qj as Z,Rj as P,Ry as S,SN as n,Ui as Y,Vi as A,cP as x,cT as G,cx as U,dx as m,mP as s,ow as B,pO as b,pT as r,qO as o,qT as R,rT as f,sT as F,tT as u,tv as $,tw as p,uT as t,uv as D,vC as L,wC as h,ww as N,xw as g}from"./cli-1.0.4-jvp0mp87.mjs";import{J8 as Q,P8 as k}from"./cli-1.0.4-ng8nc24b.mjs";import{V_ as X,W_ as v,s9 as O,z9 as I}from"./cli-1.0.4-q0rnwhn4.mjs";import{Doa as J,Poa as K,mpa as T}from"./cli-1.0.4-n5mydt2f.mjs";import{Xqa as y,Yqa as w}from"./cli-1.0.4-rhq4w2pj.mjs";function Mq(H=new Set){let z=H.size>0;if(u.cache.clear?.(),F.cache.clear?.(),f.cache.clear?.(),Y.cache.clear?.(),W(),x(),!z)N();if(R(null),K(null),b(),_(),G("session_start"),V(),X.clear(),Z(),!z)B();if(Q(),M(),!z)U();J(H),O(),L(),$(),j(),E(),import("./utils-1.0.4-3cv1bh5y.mjs").then(({clearWebFetchCache:q})=>q()),import("./ToolSearchTool-1.0.4-q00g76m2.mjs").then(({clearToolSearchDescriptionCache:q})=>q()),import("./loadAgentsDir-1.0.4-7pg9fk0z.mjs").then(({clearAgentDefinitionsCache:q})=>q()),import("./prompt-1.0.4-p1dmdqgx.mjs").then(({clearPromptCache:q})=>q())}var c=y(()=>{T();s();A();t();i();p();m();g();P();o();D();l();h();d();n();r();k();I();v();S();C()});
2
+ export{Mq as Rh,c as Sh};
@@ -0,0 +1,24 @@
1
+ import{Cg as _Q,Eg as iQ}from"./cli-1.0.4-qdsf8s2n.mjs";import{ri as WQ,si as zX}from"./cli-1.0.4-092qjm5g.mjs";import{AJ as gQ,Ap as uQ,EF as SJ,FF as YQ,Zr as CQ,hs as qX,iJ as JJ,jJ as mJ,qJ as GQ,rJ as KQ,sJ as VQ,tJ as OQ,uJ as NQ,xJ as IJ,yJ as nJ,zJ as rJ,zp as ZQ}from"./cli-1.0.4-jvp0mp87.mjs";import{GX as AQ,IX as ZX,LX as FQ,MX as $X,SX as zJ,TX as iJ,sX as bJ,tX as aJ}from"./cli-1.0.4-c9sh44ne.mjs";import{I0 as WJ,RY as AJ,YZ as FJ,ZZ as CJ,_Z as oJ,b0 as N,d0 as M,n0 as t,x0 as e,yY as LJ,zY as lJ}from"./cli-1.0.4-9ra8j4rt.mjs";import{O2 as q,P2 as _,Q2 as s}from"./cli-1.0.4-x8jnn75c.mjs";import{R2 as BJ}from"./cli-1.0.4-5e2v63sy.mjs";import{R7 as i,S7 as dJ}from"./cli-1.0.4-3289hbrr.mjs";import{gfa as x,ofa as DJ}from"./cli-1.0.4-q0rnwhn4.mjs";import{Afa as uJ,Ffa as vJ,Lfa as kQ,tfa as f,ufa as pJ,wfa as n}from"./cli-1.0.4-1bg07n68.mjs";import{$ga as aQ,_ga as UQ}from"./cli-1.0.4-8x3m3esm.mjs";import{Tqa as OJ,Xqa as qJ,Yqa as oQ}from"./cli-1.0.4-rhq4w2pj.mjs";import{writeFile as fQ}from"fs/promises";import{join as hQ}from"path";function PJ(J){if(J<1000)return`${J}ms`;let U=Math.round(J/1000);if(U<60)return`${U}s`;return`${Math.floor(U/60)}m ${U%60}s`}function sJ(J){if(J==="done")return"success";if(J==="stalled"||J==="failed")return"error";if(J==="cancelled")return"warning";return"permission"}function cQ(J){if(J==="running")return"▸";if(J==="failed"||J==="stalled")return"✗";if(J==="cancelled")return"⊘";return"✓"}function tJ(J){let U=0,K=0;for(let H of J.history)for(let B of HJ(H.agents))if(K+=1,!B.failed)U+=1;return{done:U,total:K}}function eJ(J){let U=J.history.map((K)=>{let H=HJ(K.agents);return{step:K.step,done:H.filter((B)=>!B.failed).length,total:H.length,agents:K.agents,decision:K.decision}});if(J.status==="running"&&!J.history.some((K)=>K.step===J.currentStep))U.push({step:J.currentStep,done:J.agentsDone??0,total:J.agentsInPhase??0,agents:null,decision:null});return U}function JQ(J,U){return`${CJ(J)}${U}\x1B[39m`}function jJ(J,U,K){return J+" ".repeat(Math.max(0,K-U))}function xQ(J,U,K){let H=J.failed?"✗ ":"✓ ",B=JQ(J.failed?K.error:K.success,H.trimEnd())+" ",W=PJ(J.ms),X=f(W),I=Math.max(4,U-f(H)-X-1),w=n(`${J.label} ${J.model||"inherit"} · ${vJ(J.tokens)} tok`,I),S=w.length<=J.label.length?i.bold(w):i.bold(w.slice(0,J.label.length))+i.dim(w.slice(J.label.length)),F=Math.max(1,U-f(H)-f(w)-X);return B+S+" ".repeat(F)+i.dim(W)}function pQ({run:J,phaseIndex:U}){let{columns:K,rows:H}=bJ(),B=eJ(J),W=Math.min(U,Math.max(0,B.length-1)),X=B[W],{done:I,total:w}=tJ(J),[S]=AJ(),F=FJ(S),g=Math.max(6,H-6),R=g-2,l=TJ-4,v=Math.max(20,K-4-TJ-1-4-4),k=X?` ${X.step} · ${X.agents?HJ(X.agents).length:X.total} agents `:" phase ",C=B.map((D,L)=>{let V=L===W,O=D.total>0&&D.done===D.total?"✓":D.agents===null?"▸":"✓",m=n(`${V?") ":" "}${O} ${D.step}${D.total>0?` ${D.done}/${D.total}`:""}`,l);return jJ(V?JQ(F.permission,m):m,f(m),l)});while(C.length<R)C.push(" ".repeat(l));let j=!X?[jJ(i.dim("starting…"),f("starting…"),v)]:X.agents===null?[jJ(i.dim(`running… ${X.done}/${X.total} done`),f(`running… ${X.done}/${X.total} done`),v)]:HJ(X.agents).map((D)=>xQ(D,v,F));while(j.length<R)j.push(" ".repeat(v));return _(N,{flexDirection:"column",marginTop:1,children:[_(N,{flexDirection:"row",justifyContent:"space-between",children:[_(N,{flexDirection:"column",flexShrink:1,minWidth:0,children:[q(M,{bold:!0,color:"permission",wrap:"truncate",children:J.workflow}),J.description?q(M,{dimColor:!0,wrap:"truncate",children:J.description}):null]}),_(M,{color:sJ(J.status),wrap:"truncate",children:[I,"/",w," agents · ",PJ(J.updatedAt-J.startedAt)," · ",J.status]})]}),_(N,{flexDirection:"row",marginTop:1,gap:1,children:[q(N,{flexDirection:"column",flexShrink:0,width:TJ,height:g,overflow:"hidden",borderStyle:"round",borderColor:"subtle",paddingX:1,borderText:{content:" Phases ",position:"top",align:"start"},children:q(t,{lines:C.slice(0,R),width:l})}),q(N,{flexDirection:"column",flexGrow:1,height:g,overflow:"hidden",borderStyle:"round",borderColor:"subtle",paddingX:1,borderText:{content:k,position:"top",align:"start"},children:q(t,{lines:j.slice(0,R),width:v})})]})]})}function QQ({liveRun:J,onStop:U,initialRunId:K,onViewChange:H}){let[B,W]=y.useState([]),[X,I]=y.useState(0),[w,S]=y.useState(0),[F,g]=y.useState(K?{mode:"detail",runId:K}:{mode:"list"}),[R,l]=y.useState(null),[v,k]=y.useState(!1),[C,j]=y.useState(new Set);y.useEffect(()=>{IJ().then(W).catch(($)=>x($))},[J?.runId,J?.updatedAt]);let D=(J?[J,...B.filter(($)=>$.runId!==J.runId)]:B).filter(($)=>!C.has($.runId)),L=D[Math.min(X,Math.max(0,D.length-1))],V=F.mode==="detail"?D.find(($)=>$.runId===F.runId):void 0;y.useEffect(()=>{H?.(F.mode==="detail")},[F.mode,H]);let O=y.useCallback(()=>{LJ.get(process.stdout)?.prepareFullRepaint()},[]),m=y.useRef(!1);y.useEffect(()=>{if(m.current||!K)return;let $=D.findIndex((Y)=>Y.runId===K);if($>=0)I($),m.current=!0},[K,D]);let T=F.mode==="detail"?V:L,h=y.useCallback(async()=>{if(!T)return;try{let $=hQ(JJ(),`run-${T.runId}.md`);await fQ($,rJ(T)),l($)}catch($){x($)}},[T]),c=y.useCallback(async()=>{if(!L)return;try{await nJ(L.runId),j(($)=>new Set($).add(L.runId)),I(($)=>Math.max(0,Math.min($,D.length-2))),W(await IJ())}catch($){x($)}},[L,D.length]);if(e(($,Y)=>{if(F.mode==="detail"){let P=V?eJ(V).length:0;if(Y.escape)O(),g({mode:"list"});else if(Y.upArrow)O(),S((A)=>Math.max(0,A-1));else if(Y.downArrow)O(),S((A)=>Math.min(Math.max(0,P-1),A+1));else if($==="s")h();else if($==="x"&&V&&J&&V.runId===J.runId)U();return}if(v){if(k(!1),$==="y")c();return}if(Y.upArrow)I((P)=>Math.max(0,P-1));else if(Y.downArrow)I((P)=>Math.min(D.length-1,P+1));else if(Y.return&&L)O(),S(0),g({mode:"detail",runId:L.runId});else if($==="s")h();else if($==="x"&&L&&J&&L.runId===J.runId)U();else if($==="d"&&L&&L.status!=="running")k(!0)},{isActive:!0}),F.mode==="detail"){if(!V)return q(N,{paddingX:2,paddingTop:1,children:q(M,{dimColor:!0,children:"Run not found."})});return _(N,{flexDirection:"column",paddingX:2,children:[q(pQ,{run:V,phaseIndex:w}),R&&_(M,{color:"success",children:["Saved → ",R]})]})}return _(N,{flexDirection:"column",paddingTop:1,children:[q(zJ,{color:"permission",padding:4}),D.length===0?q(N,{paddingX:2,marginTop:1,children:q(M,{dimColor:!0,children:"No workflow runs yet. Start one from the Library tab."})}):_(N,{flexDirection:"column",paddingX:2,marginTop:1,children:[D.map(($,Y)=>{let{total:P}=tJ($);return _(M,{inverse:Y===X,wrap:"truncate",children:[Y===X?"▸ ":" ",q(M,{color:sJ($.status),children:cQ($.status)})," ",$.workflow," ",P," agents · ",vJ($.totalTokens)," tok · ",PJ($.updatedAt-$.startedAt)]},$.runId)}),R&&q(N,{marginTop:1,children:_(M,{color:"success",children:["Saved → ",R]})}),v&&L&&q(N,{marginTop:1,children:_(M,{color:"warning",children:['Delete run "',L.workflow,'" (',PJ(L.updatedAt-L.startedAt),")? (y/n)"]})})]})]})}var y,HJ=(J)=>J.filter((U)=>U.label!=="main"),TJ=26;var XQ=qJ(()=>{dJ();WJ();lJ();pJ();kQ();DJ();oJ();uJ();aJ();iJ();gQ();mJ();s();y=OJ(BJ(),1)});function lQ(J){let U={name:J.name};if(J.agents.length>0)U.agents=J.agents;if(J.handbackTo?.length)U.handbackTo=J.handbackTo;return U}function $Q(J,U={}){let K={name:J.name,description:J.description};if(J.main)K.main=J.main;K.steps=J.steps.map(lQ);for(let[W,X]of Object.entries(U))if(!dQ.has(W))K[W]=X;let H=ZQ(K).trimEnd(),B=J.instructions.trim();return`---
2
+ ${H}
3
+ ---
4
+ ${B?`${B}
5
+ `:""}`}function qQ(J,U,K){let H=J[U]?.name;return J.map((B,W)=>({...B,name:W===U?K:B.name,handbackTo:B.handbackTo?.map((X)=>X===H?K:X)}))}var dQ;var zQ=qJ(()=>{uQ();dQ=new Set(["name","description","main","steps"])});import{unlinkSync as nQ,writeFileSync as rQ}from"fs";import{readFile as sQ,writeFile as tQ}from"fs/promises";import{tmpdir as eQ}from"os";import{join as yJ}from"path";function UJ(J,U){return`${CJ(J)}${U}\x1B[39m`}function ZJ(J,U,K){return J+" ".repeat(Math.max(0,K-U))}function EJ(J,U,K){let H=J.slice(0,U);while(H.length<U)H.push(" ".repeat(K));return H}function MQ({sourceFile:J,onClose:U}){let{columns:K,rows:H}=bJ(),[B]=AJ(),W=FJ(B),[X,I]=E.useState(null),[w,S]=E.useState({}),[F,g]=E.useState(null),[R,l]=E.useState(!1),[v,k]=E.useState("phases"),[C,j]=E.useState(0),[D,L]=E.useState(0),[V,O]=E.useState(null),[m,T]=E.useState(null),[h,c]=E.useState(null),$=E.useCallback(()=>{LJ.get(process.stdout)?.prepareFullRepaint()},[]);E.useEffect(()=>{sQ(yJ(JJ(),J),"utf-8").then((Q)=>{let Z=GQ(Q,J.replace(/\.md$/,""));if(Z.def)I(Z.def),S(Z.rawFrontmatter);else g(Z.errors.join("; "))}).catch((Q)=>{x(Q),g("Failed to read workflow file.")})},[J]),E.useEffect(()=>{import("./agentTypes-1.0.4-he8e2qfd.mjs").then((Q)=>Q.getKnownAgentTypes(UQ())).then(c).catch((Q)=>x(Q))},[]);let Y=E.useMemo(()=>{if(!X)return[];let Q=KQ(X);if(h)Q.push(...VQ(X,h));return Q},[X,h]),P=E.useCallback((Q)=>{$(),I((Z)=>Z?Q(Z):Z),l(!0),T(null)},[$]),A=C-1,u=X&&A>=0?X.steps[A]:void 0,YJ=C===0?["description","main"]:["name","agents","handbackTo"],bQ=E.useCallback(async()=>{if(!X)return;try{let Q=yJ(JJ(),J);await tQ(Q,$Q(X,w)),l(!1),T(`Saved → ${Q}`)}catch(Q){x(Q),T("Failed to save.")}},[X,w,J]),EQ=E.useCallback(()=>{if(!X)return;let Q=yJ(eQ(),`claudin-wf-prompt-${Date.now()}.md`);try{rQ(Q,X.instructions?`${X.instructions}
6
+ `:"");let Z=_Q(Q);if(Z.error)T(Z.error);else if(Z.content===null)T("No external editor available — set $EDITOR or $VISUAL.");else{let z=Z.content.trim();if(z!==X.instructions)P((G)=>({...G,instructions:z}))}}catch(Z){x(Z),T("Failed to open editor.")}finally{try{nQ(Q)}catch{}}},[X,P]),SQ=E.useCallback(()=>{if(!X)return;let Q=YJ[D];if($(),C===0){if(Q==="description")O({kind:"input",target:"description",value:X.description,cursor:X.description.length});else{let Z=["(default)",...[...h??[]].sort()];O({kind:"picker",target:"main",options:Z,checked:new Set([X.main??"(default)"]),cursor:Math.max(0,Z.indexOf(X.main??"(default)")),multi:!1})}return}if(!u)return;if(Q==="name")O({kind:"input",target:"name",value:u.name,cursor:u.name.length});else if(Q==="agents"){let Z=[...new Set([...[...h??[]].sort(),...u.agents])];O({kind:"picker",target:"agents",options:Z,checked:new Set(u.agents),cursor:0,multi:!0})}else{let Z=X.steps.slice(0,A).map((z)=>z.name);if(Z.length===0){T("No earlier phases to hand back to.");return}O({kind:"picker",target:"handbackTo",options:Z,checked:new Set(u.handbackTo??[]),cursor:0,multi:!0})}},[X,YJ,D,C,u,A,h,$]),RQ=E.useCallback((Q,Z)=>{let z=Z.trim();if($(),O(null),!z)return;if(Q==="description")P((G)=>({...G,description:z}));else if(Q==="name"&&A>=0)P((G)=>({...G,steps:qQ(G.steps,A,z)}));else if(Q==="addStep"){let G=C===0?0:C;P((b)=>({...b,steps:[...b.steps.slice(0,G),{name:z,agents:[]},...b.steps.slice(G)]})),j(G+1),k("phases")}},[$,C,A,P]),TQ=E.useCallback((Q)=>{if($(),O(null),Q.target==="main"){let z=Q.options[Q.cursor];P((G)=>({...G,main:z==="(default)"?void 0:z}));return}let Z=Q.options.filter((z)=>Q.checked.has(z));if(Q.target==="agents"&&A>=0)P((z)=>({...z,steps:z.steps.map((G,b)=>b===A?{...G,agents:Z}:G)}));else if(Q.target==="handbackTo"&&A>=0)P((z)=>({...z,steps:z.steps.map((G,b)=>b===A?{...G,handbackTo:Z.length?Z:void 0}:G)}))},[$,A,P]),jQ=E.useCallback(()=>{if(A<0)return;P((Q)=>({...Q,steps:Q.steps.filter((Z,z)=>z!==A)})),j((Q)=>Math.max(0,Math.min(Q,(X?.steps.length??1)-1))),k("phases")},[X,A,P]),gJ=E.useCallback((Q)=>{if(!X||A<0)return;let Z=A+Q;if(Z<0||Z>=X.steps.length)return;P((z)=>{let G=[...z.steps],[b]=G.splice(A,1);return G.splice(Z,0,b),{...z,steps:G}}),j(Z+1)},[X,A,P]);if(e((Q,Z)=>{if(!X){if(Z.escape)U();return}if(V?.kind==="input")return;if(V?.kind==="confirmDelete"){if($(),O(null),Q==="y")jQ();return}if(V?.kind==="confirmDiscard"){if($(),O(null),Q==="y")U();return}if(V?.kind==="picker"){let z=(G)=>{$(),O((b)=>b?.kind==="picker"?G(b):b)};if(Z.upArrow)z((G)=>({...G,cursor:Math.max(0,G.cursor-1)}));else if(Z.downArrow)z((G)=>({...G,cursor:Math.min(G.options.length-1,G.cursor+1)}));else if(Q===" "&&V.multi)z((G)=>{let b=G.options[G.cursor];if(b===void 0)return G;let a=new Set(G.checked);if(a.has(b))a.delete(b);else a.add(b);return{...G,checked:a}});else if(Z.return)TQ(V);else if(Z.escape)$(),O(null);return}if(Q==="s"){bQ();return}if(Q==="p"){EQ();return}if(v==="fields"){if(Z.escape)$(),k("phases");else if(Z.upArrow)$(),L((z)=>Math.max(0,z-1));else if(Z.downArrow)$(),L((z)=>Math.min(YJ.length-1,z+1));else if(Z.return)SQ();return}if(Z.escape)if(R)$(),O({kind:"confirmDiscard"});else U();else if(Z.upArrow)$(),j((z)=>Math.max(0,z-1));else if(Z.downArrow)$(),j((z)=>Math.min(X.steps.length,z+1));else if(Z.return)$(),k("fields"),L(0);else if(Q==="a")$(),O({kind:"input",target:"addStep",value:"",cursor:0});else if(Q==="d"&&C>0)$(),O({kind:"confirmDelete"});else if(Q==="K")gJ(-1);else if(Q==="J")gJ(1)},{isActive:!0}),F)return _(N,{flexDirection:"column",paddingX:2,paddingTop:1,children:[_(M,{color:"error",children:["⚠ ",F]}),_(M,{dimColor:!0,children:["Esc to go back — fix the file by hand at .claudin/workflows/",J,"."]})]});if(!X)return q(N,{paddingX:2,paddingTop:1,children:q(M,{dimColor:!0,children:"Loading…"})});let $J=Math.max(6,H-6),r=wJ-4,o=Math.max(20,K-4-wJ-1-4-4),IQ=$J-2,GJ=(Q)=>Q?") ":" ",KJ=[];{let Q=n(`${GJ(C===0)}${X.name}`,r);KJ.push(ZJ(C===0?UJ(W.permission,Q):i.bold(Q),f(Q),r));let Z=` ${"─".repeat(Math.max(1,r-2))}`;KJ.push(ZJ(i.dim(Z),f(Z),r)),X.steps.forEach((z,G)=>{let b=C===G+1,a=n(`${GJ(b)}${z.name} ${z.agents.length}`,r);KJ.push(ZJ(b?UJ(W.permission,a):a,f(a),r))})}let fJ=V?.kind==="picker",VJ,NJ,vQ=" Prompt (p to edit) ",_J=[],mQ=kJ-2,hJ=Math.max(3,$J-kJ),cJ=hJ-2;if(fJ){let Q=V;VJ=Q.target==="main"?" main orchestrator ":` ${Q.target==="agents"?"agents":"hand back to"} · ${u?.name??X.name} `;let Z=$J-2,z=Math.max(0,Math.min(Q.cursor-Math.floor(Z/2),Q.options.length-Z));NJ=Q.options.slice(z,z+Z).map((G,b)=>{let XJ=z+b===Q.cursor,RJ=Q.multi?Q.checked.has(G)?"[x] ":"[ ] ":"",xJ=Q.target==="agents"&&h&&!h.has(G),MJ=n(`${GJ(XJ)}${RJ}${G}${xJ?" (unknown)":""}`,o),wQ=XJ?UJ(W.permission,MJ):xJ?UJ(W.error,MJ):MJ;return ZJ(wQ,f(MJ),o)})}else{VJ=C===0?` ${X.name} `:` phase: ${u?.name??""} `;let Q=(z)=>{if(z==="description")return X.description||"(empty)";if(z==="main")return X.main??"(default)";if(z==="name")return u?.name??"";if(z==="agents")return u?.agents.join(", ")||"(none)";return u?.handbackTo?.join(", ")??"—"};if(NJ=YJ.map((z,G)=>{let b=v==="fields"&&G===D,a=z==="handbackTo"?"handback":z,XJ=n(`${GJ(b)}${a}: ${Q(z)}`,o),RJ=b?UJ(W.permission,XJ):i.dim(XJ.slice(0,2+a.length+1))+XJ.slice(2+a.length+1);return ZJ(RJ,f(XJ),o)}),_J=(X.instructions?X.instructions.split(`
7
+ `):[]).slice(0,cJ).map((z)=>{let G=n(z,o);return ZJ(i.dim(G),f(G),o)}),_J.length===0)_J=[ZJ(i.dim("(empty — press p to write the prompt)"),f("(empty — press p to write the prompt)"),o)]}let QJ=V?.kind==="input"?V:null,yQ=QJ?.target==="addStep"?"New phase name:":QJ?.target==="name"?"Rename phase:":"Description:";return _(N,{flexDirection:"column",marginTop:1,children:[_(N,{flexDirection:"row",justifyContent:"space-between",children:[q(M,{bold:!0,color:"permission",wrap:"truncate",children:X.name}),q(M,{color:R?"warning":"success",wrap:"truncate",children:R?"● unsaved":"saved"})]}),_(N,{flexDirection:"row",marginTop:1,gap:1,children:[q(N,{flexDirection:"column",flexShrink:0,width:wJ,height:$J,overflow:"hidden",borderStyle:"round",borderColor:"subtle",paddingX:1,borderText:{content:" Phases ",position:"top",align:"start"},children:q(t,{lines:EJ(KJ,IQ,r),width:r})}),fJ?q(N,{flexDirection:"column",flexGrow:1,height:$J,overflow:"hidden",borderStyle:"round",borderColor:"subtle",paddingX:1,borderText:{content:VJ,position:"top",align:"start"},children:q(t,{lines:EJ(NJ,$J-2,o),width:o})}):_(N,{flexDirection:"column",flexGrow:1,children:[q(N,{flexDirection:"column",height:kJ,overflow:"hidden",borderStyle:"round",borderColor:"subtle",paddingX:1,borderText:{content:VJ,position:"top",align:"start"},children:q(t,{lines:EJ(NJ,mQ,o),width:o})}),q(N,{flexDirection:"column",height:hJ,overflow:"hidden",borderStyle:"round",borderColor:"subtle",paddingX:1,borderText:{content:vQ,position:"top",align:"start"},children:q(t,{lines:EJ(_J,cJ,o),width:o})})]})]}),QJ&&_(N,{flexDirection:"column",children:[q(M,{children:yQ}),q(N,{borderStyle:"round",borderDimColor:!0,paddingLeft:1,children:q(SJ,{value:QJ.value,onChange:(Q)=>O((Z)=>Z?.kind==="input"?{...Z,value:Q}:Z),onSubmit:()=>RQ(QJ.target,QJ.value),columns:80,cursorOffset:QJ.cursor,onChangeCursorOffset:(Q)=>O((Z)=>Z?.kind==="input"?{...Z,cursor:Q}:Z),showCursor:!0})}),q(M,{dimColor:!0,children:"Enter to confirm · empty + Enter to cancel"})]}),V?.kind==="confirmDelete"&&u&&_(M,{color:"warning",children:['Delete phase "',u.name,'"? (y/n)']}),V?.kind==="confirmDiscard"&&q(M,{color:"warning",children:"Discard unsaved changes? (y/n)"}),Y.length>0&&_(M,{color:"error",wrap:"truncate",children:["⚠ ",Y.join(" · ")]}),m&&q(M,{dimColor:!0,wrap:"truncate",children:m})]})}var E,wJ=26,kJ=7;var PQ=qJ(()=>{dJ();WJ();lJ();pJ();YQ();aJ();aQ();DJ();iQ();oJ();uJ();NQ();mJ();zQ();s();E=OJ(BJ(),1)});import{unlink as JX,writeFile as QX}from"fs/promises";import{join as HQ}from"path";function DQ({onRun:J,onInputActiveChange:U,onViewChange:K}){let[H,B]=p.useState([]),[W,X]=p.useState({}),[I,w]=p.useState(0),[S,F]=p.useState("list"),[g,R]=p.useState(""),[l,v]=p.useState(0),[k,C]=p.useState(null),[j,D]=p.useState(null),L=p.useCallback(()=>{OQ().then(({defs:Y,errorsByFile:P})=>{B(Y),X(P)}).catch((Y)=>x(Y))},[]);p.useEffect(L,[L]),p.useEffect(()=>{U(S!=="list")},[S,U]),p.useEffect(()=>{K?.(j!==null)},[j,K]);let V=H[Math.min(I,Math.max(0,H.length-1))],O=(Y)=>Y.sourceFile??`${Y.name}.md`,m=V?W[O(V)]:void 0,T=(Y)=>{R(""),v(0),C(null),F(Y)},h=()=>{if(V&&g.trim())J(V,g.trim());F("list")},c=async()=>{let Y=g.trim();if(!Y){F("list");return}try{let P=HQ(JJ(),`${Y}.md`);await QX(P,XX(Y)),L(),D(`${Y}.md`)}catch(P){x(P),C("Failed to create workflow.")}F("list")},$=async()=>{if(V)try{await JX(HQ(JJ(),O(V))),C(`Deleted ${V.name}.`),L()}catch(Y){x(Y),C("Failed to delete workflow.")}F("list")};if(e((Y,P)=>{if(j!==null)return;if(S==="confirmDelete"){if(Y==="y")$();else F("list");return}if(S!=="list")return;if(P.upArrow)w((A)=>Math.max(0,A-1));else if(P.downArrow)w((A)=>Math.min(H.length-1,A+1));else if(P.return&&V)T("task");else if(Y==="n")T("new");else if(Y==="d"&&V)F("confirmDelete");else if(Y==="e"&&V)C(null),D(O(V));else if(Y==="r")L()},{isActive:!0}),j!==null)return q(N,{paddingX:2,children:q(MQ,{sourceFile:j,onClose:()=>{D(null),L()}})});if(S==="task"||S==="new"){let Y=S==="task"?`Task for "${V?.name}":`:"New workflow name:";return _(N,{flexDirection:"column",paddingTop:1,paddingX:2,children:[q(zJ,{color:"permission"}),q(N,{marginTop:1,children:q(M,{children:Y})}),q(N,{borderStyle:"round",borderDimColor:!0,marginY:1,paddingLeft:1,children:q(SJ,{value:g,onChange:R,onSubmit:S==="task"?h:()=>void c(),columns:80,cursorOffset:l,onChangeCursorOffset:v,showCursor:!0})}),q(M,{dimColor:!0,children:"Enter to confirm · empty + Enter to cancel"})]})}return _(N,{flexDirection:"column",paddingTop:1,children:[q(zJ,{color:"permission"}),_(N,{flexDirection:"column",paddingX:2,marginTop:1,children:[H.length===0?q(M,{dimColor:!0,children:'No workflows. Press "n" to create one at .claudin/workflows/.'}):H.map((Y,P)=>{let A=Boolean(W[O(Y)]?.length);return _(M,{inverse:P===I,children:[P===I?"▸ ":" ",Y.name,A?" ⚠":""," ",_(M,{dimColor:!0,children:["· ",Y.steps.length," phases"]})]},Y.name)}),V&&_(N,{flexDirection:"column",marginTop:1,children:[q(M,{dimColor:!0,children:V.description}),V.steps.map((Y)=>_(M,{dimColor:!0,children:[" ",Y.name,": ",Y.agents.join(", ")||"(terminal)",Y.handbackTo?.length?` ↩ ${Y.handbackTo.join(",")}`:""]},Y.name)),m?.length?_(M,{color:"error",children:["⚠ ",m.join("; ")]}):null]}),S==="confirmDelete"&&V&&q(N,{marginTop:1,children:_(M,{color:"warning",children:['Delete "',V.name,'"? (y/n)']})}),k&&q(N,{marginTop:1,children:q(M,{dimColor:!0,children:k})})]})]})}var p,XX=(J)=>`---
8
+ name: ${J}
9
+ description: What this workflow does
10
+ steps:
11
+ - name: explore
12
+ agents: [explorer]
13
+ - name: synthesize
14
+ agents: [synthesizer]
15
+ handbackTo: [explore]
16
+ - name: done
17
+ ---
18
+ Describe the goal and any house rules for this workflow.
19
+ `;var LQ=qJ(()=>{WJ();YQ();DJ();iJ();NQ();mJ();PQ();s();p=OJ(BJ(),1)});function BQ({hint:J,onExit:U,escActive:K=!0}){let H=FQ();return AQ("confirm:no",U,{context:"Settings",isActive:K}),q(N,{marginLeft:2,marginTop:1,children:q(M,{dimColor:!0,children:H.pending?`Press ${H.keyName} again to exit`:J})})}function NZ({context:J,onExit:U,initialTab:K,initialRunId:H}){let[B,W]=d.useState(K??"library"),[X,I]=d.useState(null),[w,S]=d.useState(!1),[F,g]=d.useState(!1),[R,l]=d.useState(!1),v=d.useRef(null),k=d.useRef(!0);d.useEffect(()=>{return k.current=!0,()=>{k.current=!1}},[]);let C=J.canUseTool??UX,j=d.useCallback((O,m)=>{v.current?.abort();let T=new AbortController;v.current=T,W("running");let h={...J,setAppState:()=>{},setAppStateForTasks:J.setAppStateForTasks??J.setAppState};WQ({def:O,task:m,toolUseContext:h,canUseTool:C,signal:T.signal,onProgress:(c)=>{if(k.current)I({...c})}}).then((c)=>{if(k.current)I({...c});let $=(c.artifact||"").slice(0,2000);CQ({value:`<task-notification>
20
+ <status>${c.status}</status>
21
+ <summary>Workflow "${O.name}" ${c.status} (run ${c.runId})</summary>
22
+ <result>${$}</result>
23
+ </task-notification>`,mode:"task-notification"})}).catch((c)=>x(c))},[J,C]),D=d.useCallback(()=>{v.current?.abort()},[]);e((O,m)=>{if(m.tab||m.leftArrow)W((T)=>T==="running"?"library":"running");else if(m.rightArrow)W("running")},{isActive:!w&&!F&&!R});let L=_(N,{flexDirection:"row",gap:1,children:[q(M,{bold:!0,color:"permission",children:"Workflows"}),_(M,{bold:B==="running",inverse:B==="running",children:[" ","Running"," "]}),_(M,{bold:B==="library",inverse:B==="library",children:[" ","Library"," "]})]}),V=()=>U("Workflows dialog dismissed",{display:"system"});if(B==="running")return _(N,{flexDirection:"column",children:[!F&&L,q(QQ,{liveRun:X,onStop:D,initialRunId:H,onViewChange:g}),q(BQ,{hint:F?"↑↓ select · esc back · s save":"Tab tabs · ↑↓ select · Enter view · s save · x stop · d delete · Esc close",escActive:!F,onExit:V})]});return _(N,{flexDirection:"column",children:[!R&&L,q(DQ,{onRun:j,onInputActiveChange:S,onViewChange:l}),q(BQ,{hint:R?"↑↓ nav · Enter edit · a add · d del · K/J move · p prompt · s save · Esc back":"Tab tabs · ↑↓ select · Enter run · n new · e edit · d delete · Esc close",escActive:!R,onExit:V})]})}var d,UX=async(J,U)=>({behavior:"allow",updatedInput:U});var YX=qJ(()=>{WJ();$X();ZX();DJ();qX();zX();XQ();LQ();s();d=OJ(BJ(),1)});
24
+ export{NZ as _b,YX as $b};
@@ -0,0 +1,2 @@
1
+ import{Xqa as r}from"./cli-1.0.4-rhq4w2pj.mjs";var i,a=(s,e)=>function(){try{return e||(0,s[i(s)[0]])((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},c;var p=r(()=>{i=Object.getOwnPropertyNames,c=a({"package.json"(s,e){e.exports={name:"@mendable/firecrawl-js",version:"4.30.0",description:"JavaScript SDK for Firecrawl API",main:"dist/index.js",types:"dist/index.d.ts",exports:{"./package.json":"./package.json",".":{import:"./dist/index.js",default:"./dist/index.cjs"}},type:"module",scripts:{build:"tsup","build-and-publish":"pnpm run build && pnpm publish --access public","publish-beta":"pnpm run build && pnpm publish --access public --tag beta",test:"NODE_OPTIONS=--experimental-vm-modules jest --verbose src/__tests__/e2e/v2/*.test.ts --detectOpenHandles","test:unit":"NODE_OPTIONS=--experimental-vm-modules jest --verbose src/__tests__/unit/v2/*.test.ts"},repository:{type:"git",url:"git+https://github.com/firecrawl/firecrawl.git"},author:"Mendable.ai",license:"MIT",dependencies:{axios:"1.18.0",firecrawl:"4.16.0","typescript-event-target":"^1.1.1",zod:"^3.23.8","zod-to-json-schema":"^3.23.0"},bugs:{url:"https://github.com/firecrawl/firecrawl/issues"},homepage:"https://github.com/firecrawl/firecrawl#readme",devDependencies:{"@jest/globals":"^30.2.0","@types/dotenv":"^8.2.0","@types/jest":"^30.0.0","@types/mocha":"^10.0.6","@types/node":"^20.12.12","@types/uuid":"^9.0.8",dotenv:"^16.4.5",jest:"^30.2.0","ts-jest":"^29.4.5",tsup:"^8.5.0",typescript:"^5.4.5",uuid:"^14.0.0"},keywords:["firecrawl","mendable","crawler","web","scraper","api","sdk"],engines:{node:">=22.0.0"},pnpm:{overrides:{"@isaacs/brace-expansion@<=5.0.0":">=5.0.1","minimatch@<10.2.3":">=10.2.3","rollup@<4.59.0":">=4.59.0","picomatch@<4.0.4":">=4.0.4",handlebars:">=4.7.9","brace-expansion":">=5.0.6","js-yaml@>=3.0.0 <3.15.0":"3.15.0","axios@>=1.0.0 <1.16.0":"1.16.1","follow-redirects@<1.16.0":">=1.16.0 <2.0.0","form-data@>=4.0.0 <4.0.6":"4.0.6","@babel/core@>=7.0.0 <7.29.6":"7.29.7","esbuild@>=0.17.0 <0.28.1":"0.28.1"}}}}})});
2
+ export{c as ki,p as li};
@@ -0,0 +1,2 @@
1
+ import{Xqa as j}from"./cli-1.0.4-rhq4w2pj.mjs";function C(){return`claude-swarm-${process.pid}`}var x="team-lead",y="claude-swarm",z="swarm-view",A="tmux",B="claude-hidden",D="CLAUDE_CODE_TEAMMATE_COMMAND";var k=()=>{};
2
+ export{x as E2,y as F2,z as G2,A as H2,B as I2,C as J2,D as K2,k as L2};
@@ -0,0 +1,2 @@
1
+ import{j9 as B,l9 as p}from"./cli-1.0.4-q0rnwhn4.mjs";import{Nha as C,Qha as y}from"./cli-1.0.4-34jdejmp.mjs";import{Qia as V,Tia as M,uia as T,yia as x}from"./cli-1.0.4-vpcfce7x.mjs";import{oja as L,vja as c}from"./cli-1.0.4-7pxrd0w5.mjs";y();M();p();c();x();function N(W){if(W<60000)return`${Math.round(W/1000)}s`;let Z=Math.floor(W/60000),z=Math.round(W%60000/1000);return z>0?`${Z}m ${z}s`:`${Z}m`}function h(W){let z=(W.startsWith("sk-ant-si-")?W.slice(10):W).split(".");if(z.length!==3||!z[1])return null;try{return T(Buffer.from(z[1],"base64url").toString("utf8"))}catch{return null}}function E(W){let Z=h(W);if(Z!==null&&typeof Z==="object"&&"exp"in Z&&typeof Z.exp==="number")return Z.exp;return null}var F=300000,j=1800000,H=3,R=60000;function I({getAccessToken:W,onRefresh:Z,label:z,refreshBufferMs:P=F}){let O=new Map,v=new Map,w=new Map;function U(q){let Q=(w.get(q)??0)+1;return w.set(q,Q),Q}function A(q,Q){let $=E(Q);if(!$){V(`[${z}:token] Could not decode JWT expiry for sessionId=${q}, token prefix=${Q.slice(0,15)}…, keeping existing timer`);return}let X=O.get(q);if(X)clearTimeout(X);let J=U(q),Y=new Date($*1000).toISOString(),G=$*1000-Date.now()-P;if(G<=0){V(`[${z}:token] Token for sessionId=${q} expires=${Y} (past or within buffer), refreshing immediately`),K(q,J);return}V(`[${z}:token] Scheduled token refresh for sessionId=${q} in ${N(G)} (expires=${Y}, buffer=${P/1000}s)`);let k=setTimeout(K,G,q,J);O.set(q,k)}function D(q,Q){let $=O.get(q);if($)clearTimeout($);let X=U(q),J=Math.max(Q*1000-P,30000);V(`[${z}:token] Scheduled token refresh for sessionId=${q} in ${N(J)} (expires_in=${Q}s, buffer=${P/1000}s)`);let Y=setTimeout(K,J,q,X);O.set(q,Y)}async function K(q,Q){let $;try{$=await W()}catch(J){V(`[${z}:token] getAccessToken threw for sessionId=${q}: ${L(J)}`,{level:"error"})}if(w.get(q)!==Q){V(`[${z}:token] doRefresh for sessionId=${q} stale (gen ${Q} vs ${w.get(q)}), skipping`);return}if(!$){let J=(v.get(q)??0)+1;if(v.set(q,J),V(`[${z}:token] No OAuth token available for refresh, sessionId=${q} (failure ${J}/${H})`,{level:"error"}),B("error","bridge_token_refresh_no_oauth"),J<H){let Y=setTimeout(K,R,q,Q);O.set(q,Y)}return}v.delete(q),V(`[${z}:token] Refreshing token for sessionId=${q}: new token prefix=${$.slice(0,15)}…`),C("tengu_bridge_token_refreshed",{}),Z(q,$);let X=setTimeout(K,j,q,Q);O.set(q,X),V(`[${z}:token] Scheduled follow-up refresh for sessionId=${q} in ${N(j)}`)}function S(q){U(q);let Q=O.get(q);if(Q)clearTimeout(Q),O.delete(q);v.delete(q)}function _(){for(let q of w.keys())U(q);for(let q of O.values())clearTimeout(q);O.clear(),v.clear()}return{schedule:A,scheduleFromExpiresIn:D,cancel:S,cancelAll:_}}
2
+ export{E as Rb,I as Sb};