@caspian2026/agent-sdk 0.0.8 → 0.0.9

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 (312) hide show
  1. package/dist/chunk-04h360ha.js +57 -0
  2. package/dist/{chunk-jmkn11my.js → chunk-04pw5akr.js} +20 -20
  3. package/dist/{chunk-veap97he.js → chunk-0gpem3pk.js} +46 -45
  4. package/dist/{chunk-0mej3p7q.js → chunk-0txtpamh.js} +14 -14
  5. package/dist/{chunk-4m9df5ef.js → chunk-0v89r445.js} +17 -21
  6. package/dist/chunk-0vp3wfab.js +12 -0
  7. package/dist/{chunk-268jd0rc.js → chunk-1486qzk5.js} +6 -4
  8. package/dist/chunk-1efrnkxx.js +468 -0
  9. package/dist/chunk-1gaw18rz.js +93 -0
  10. package/dist/{chunk-69r3hm9b.js → chunk-1hqb50ne.js} +13 -19
  11. package/dist/chunk-1hqvvvrt.js +96 -0
  12. package/dist/{chunk-qjyg1dv7.js → chunk-1hx5g6qy.js} +6 -10
  13. package/dist/{chunk-3g1vqhyx.js → chunk-1kmwf4vn.js} +17 -21
  14. package/dist/{chunk-naybw0p0.js → chunk-1nhnn2rg.js} +8 -8
  15. package/dist/{chunk-jjh7m5sg.js → chunk-1nvcmzj1.js} +66 -77
  16. package/dist/{chunk-2f21meep.js → chunk-1v01c96r.js} +1 -1
  17. package/dist/{chunk-7n51wk9k.js → chunk-1vp22nex.js} +2 -2
  18. package/dist/{chunk-jcwkgtbp.js → chunk-1yfc1d48.js} +52 -90
  19. package/dist/{chunk-83e71kz6.js → chunk-2072dpbx.js} +2 -2
  20. package/dist/{chunk-7rnqsng2.js → chunk-22mfb6bp.js} +19 -19
  21. package/dist/{chunk-d7886r6a.js → chunk-26wtxbdc.js} +7774 -7774
  22. package/dist/{chunk-x94btg29.js → chunk-2m32xn94.js} +17 -21
  23. package/dist/{chunk-mw1kpeg9.js → chunk-2nrarbza.js} +1909 -1377
  24. package/dist/chunk-2vbash3m.js +331 -0
  25. package/dist/{chunk-c11swzas.js → chunk-2vteceqh.js} +5 -5
  26. package/dist/{chunk-3zxswxtg.js → chunk-2y8x7xt7.js} +2 -2
  27. package/dist/{chunk-s7q42kp2.js → chunk-2yxqz99n.js} +9 -9
  28. package/dist/{chunk-qyqpb15f.js → chunk-35nft36d.js} +205 -261
  29. package/dist/{chunk-88xc4d7f.js → chunk-35z2vxep.js} +49 -48
  30. package/dist/{chunk-15m49c67.js → chunk-3e28fvn0.js} +2 -2
  31. package/dist/{chunk-2xvc97x4.js → chunk-3e4r5pmc.js} +3 -3
  32. package/dist/{chunk-a3ws4gae.js → chunk-3fn3ysvs.js} +47 -46
  33. package/dist/{chunk-4hv90qcz.js → chunk-3mgywd32.js} +1 -1
  34. package/dist/{chunk-pwqm47kn.js → chunk-3npsy4c4.js} +46 -45
  35. package/dist/{chunk-xz655xxa.js → chunk-3pzwd6qq.js} +2 -2
  36. package/dist/{chunk-70eey1nh.js → chunk-40s88wdg.js} +2 -2
  37. package/dist/{chunk-w0gmf6bv.js → chunk-42a0nyrq.js} +47 -46
  38. package/dist/{chunk-jvmybb06.js → chunk-44t1xk05.js} +46 -45
  39. package/dist/{chunk-0awwmrwr.js → chunk-4ayjwyqj.js} +2 -2
  40. package/dist/{chunk-a4npwxvb.js → chunk-4myad919.js} +46 -45
  41. package/dist/{chunk-8g747a8x.js → chunk-4pbx3g7s.js} +1 -1
  42. package/dist/chunk-4vtvwg7e.js +99 -0
  43. package/dist/{chunk-qcnhb4cd.js → chunk-54wn2jdr.js} +3 -3
  44. package/dist/{chunk-1nk93fqz.js → chunk-5cxjxxx8.js} +2 -7
  45. package/dist/chunk-5m3m7hr5.js +108 -0
  46. package/dist/{chunk-a3wczqrp.js → chunk-5mrc0ps5.js} +37 -41
  47. package/dist/{chunk-zmra45az.js → chunk-5tw3gj5z.js} +47 -46
  48. package/dist/{chunk-87e209aj.js → chunk-5zcygjb2.js} +46 -45
  49. package/dist/{chunk-mk1y74w7.js → chunk-65q3hqkw.js} +17 -21
  50. package/dist/{chunk-vajwapkf.js → chunk-67wms97m.js} +17 -23
  51. package/dist/chunk-6cfcqjty.js +441 -0
  52. package/dist/{chunk-rc9x0raa.js → chunk-6hs0cptm.js} +56 -55
  53. package/dist/{chunk-bmbq6nt1.js → chunk-6wzg2hpc.js} +2 -2
  54. package/dist/chunk-72qa16xm.js +91 -0
  55. package/dist/chunk-7cdy4aj6.js +150 -0
  56. package/dist/chunk-7cje7scj.js +1534 -0
  57. package/dist/{chunk-e7h4qxgw.js → chunk-7etkb4pr.js} +4 -4
  58. package/dist/{chunk-1ax1znzj.js → chunk-7hrmxpha.js} +6 -6
  59. package/dist/{chunk-wha6v7za.js → chunk-7krg0dkt.js} +2 -2
  60. package/dist/{chunk-vvsbvz2b.js → chunk-7skyagc2.js} +2 -2
  61. package/dist/{chunk-hzknr99c.js → chunk-83b2frat.js} +4 -4
  62. package/dist/{chunk-qvd3hbqs.js → chunk-84cdy41j.js} +5 -5
  63. package/dist/{chunk-bxcfz5gy.js → chunk-87xg6yb4.js} +1 -1
  64. package/dist/{chunk-nrtksr2p.js → chunk-8b2y3x7a.js} +1 -1
  65. package/dist/{chunk-c9dmpdss.js → chunk-8ckwc9k8.js} +46 -45
  66. package/dist/{chunk-67a4147x.js → chunk-8jy18nx9.js} +1 -1
  67. package/dist/{chunk-f2hbn5rk.js → chunk-93vwm44t.js} +100420 -57118
  68. package/dist/{chunk-cfgha78n.js → chunk-9957ffjc.js} +2 -2
  69. package/dist/{chunk-cdj51xbj.js → chunk-9byfzaeq.js} +46 -45
  70. package/dist/chunk-9ewnsd7f.js +31 -0
  71. package/dist/{chunk-xwg327ys.js → chunk-9w114071.js} +6 -6
  72. package/dist/chunk-9wf3fc4t.js +29 -0
  73. package/dist/chunk-9z9teq7p.js +87 -0
  74. package/dist/{chunk-6p4cyhb3.js → chunk-a6d2q415.js} +2 -2
  75. package/dist/{chunk-jgzxmtpf.js → chunk-ay5fvc2r.js} +52 -52
  76. package/dist/{chunk-1ybvj5df.js → chunk-ayx9aq2k.js} +47 -46
  77. package/dist/{chunk-23fkapww.js → chunk-azv68vk1.js} +2 -2
  78. package/dist/chunk-b547q41s.js +92 -0
  79. package/dist/{chunk-jgjqa49s.js → chunk-b56smerd.js} +3 -3
  80. package/dist/{chunk-enkdxqas.js → chunk-b5asw4tj.js} +6 -6
  81. package/dist/{chunk-nk82j7r2.js → chunk-b6prbsae.js} +7 -7
  82. package/dist/{chunk-ya40p6vj.js → chunk-b89ese8r.js} +46 -45
  83. package/dist/{chunk-byb2mn1c.js → chunk-be77bcs8.js} +118 -450
  84. package/dist/{chunk-m46xyqr6.js → chunk-bf03a1w7.js} +48 -47
  85. package/dist/{chunk-dmqeqxfz.js → chunk-bjdknxqn.js} +46 -45
  86. package/dist/{chunk-m87bhhqv.js → chunk-bzatg35k.js} +1 -1
  87. package/dist/{chunk-8ybw2s0h.js → chunk-c4d52460.js} +4 -4
  88. package/dist/{chunk-6g5qbbxk.js → chunk-c5zkrd7r.js} +47 -46
  89. package/dist/{chunk-4140c8xy.js → chunk-c6hsz5ey.js} +20 -24
  90. package/dist/{chunk-wqvr37xp.js → chunk-cay13mxk.js} +15 -31
  91. package/dist/{chunk-s3hsqf80.js → chunk-cexw1jmv.js} +30 -81
  92. package/dist/{chunk-cvm2tmwg.js → chunk-ckh4f9ry.js} +20 -24
  93. package/dist/{chunk-qn8z4r79.js → chunk-cr1dv2js.js} +50 -48
  94. package/dist/{chunk-88cekjja.js → chunk-d8z7pyrb.js} +47 -46
  95. package/dist/chunk-dexkgxt4.js +211 -0
  96. package/dist/{chunk-xxw9a0bq.js → chunk-dhwr4fz4.js} +2 -2
  97. package/dist/{chunk-0ym2z0c7.js → chunk-dj7d67ya.js} +1 -1
  98. package/dist/chunk-djfq8ws0.js +124 -0
  99. package/dist/{chunk-x2pvw7xw.js → chunk-dmyedkpw.js} +8 -8
  100. package/dist/{chunk-v0bykh19.js → chunk-dngfdsm9.js} +108 -102
  101. package/dist/{chunk-8nfn89nz.js → chunk-dt3epnwj.js} +9 -9
  102. package/dist/{chunk-4r50c14n.js → chunk-dz6zxh89.js} +46 -45
  103. package/dist/{chunk-jh965sa0.js → chunk-e7ag583m.js} +47 -46
  104. package/dist/{chunk-th4y838y.js → chunk-ec6ga5ey.js} +51 -50
  105. package/dist/{chunk-4g0nj78p.js → chunk-ecbh4n6q.js} +46 -45
  106. package/dist/{chunk-ydcsbj4t.js → chunk-ecv9kbtk.js} +11 -9
  107. package/dist/{chunk-nvwwtq1w.js → chunk-ecvy1ng2.js} +49 -48
  108. package/dist/{chunk-s4zb3f1b.js → chunk-ef2m4xyz.js} +46 -45
  109. package/dist/{chunk-psnsve7m.js → chunk-etbb3dss.js} +49 -48
  110. package/dist/{chunk-jgpmpgx6.js → chunk-etdt1xz3.js} +1 -1
  111. package/dist/{chunk-jxfp3g9b.js → chunk-ev7h351p.js} +4 -4
  112. package/dist/{chunk-njxgct8f.js → chunk-ey0n4emm.js} +46 -45
  113. package/dist/{chunk-af868wet.js → chunk-f4tdn7yr.js} +46 -45
  114. package/dist/{chunk-bd5sqj86.js → chunk-f4v7t54y.js} +11 -11
  115. package/dist/{chunk-8ywngxqt.js → chunk-fesvrjhd.js} +10 -10
  116. package/dist/{chunk-j4m8fd76.js → chunk-frm7mphm.js} +7 -11
  117. package/dist/{chunk-kek5v6ef.js → chunk-frwznxnf.js} +3 -3
  118. package/dist/{chunk-030rqd3a.js → chunk-ftsdm7y7.js} +54 -53
  119. package/dist/{chunk-vdcm8hz6.js → chunk-g597bz1j.js} +47 -46
  120. package/dist/chunk-g5pe8dew.js +25 -0
  121. package/dist/{chunk-tvzr9c8a.js → chunk-g78fetxa.js} +46 -45
  122. package/dist/{chunk-ga86yjm1.js → chunk-gdwdqewd.js} +3 -3
  123. package/dist/{chunk-dvcwahst.js → chunk-ghwvqhx9.js} +51 -50
  124. package/dist/chunk-gkn3jgqn.js +123 -0
  125. package/dist/{chunk-23q4jpn2.js → chunk-grqhgr2b.js} +3 -3
  126. package/dist/chunk-grqkx44z.js +90 -0
  127. package/dist/{chunk-21jsjcfa.js → chunk-gzj94jgg.js} +46 -45
  128. package/dist/{chunk-g5pgham9.js → chunk-h3vyya5n.js} +20 -14
  129. package/dist/{chunk-15edybe0.js → chunk-h4xfadhf.js} +1 -1
  130. package/dist/chunk-h61d4awv.js +95 -0
  131. package/dist/{chunk-w05jpkkr.js → chunk-hae34yd0.js} +5 -9
  132. package/dist/{chunk-rtmh0v4c.js → chunk-hb1gr101.js} +6 -6
  133. package/dist/{chunk-5a5w0ygx.js → chunk-hg45r671.js} +2 -2
  134. package/dist/{chunk-d9yghsfg.js → chunk-hg6fwhj1.js} +1 -1
  135. package/dist/{chunk-1cq2vrzq.js → chunk-hgmhngje.js} +4 -4
  136. package/dist/{chunk-vvjgdzhn.js → chunk-hparkfvt.js} +55 -51
  137. package/dist/{chunk-ahrhwpm9.js → chunk-hqjdgc6c.js} +2 -2
  138. package/dist/{chunk-37p5p94r.js → chunk-hrhp26d7.js} +55 -54
  139. package/dist/{chunk-xrpstt41.js → chunk-hzbr9543.js} +4 -4
  140. package/dist/{chunk-1dwvgrfc.js → chunk-j0gke393.js} +46 -45
  141. package/dist/{chunk-yyf72f78.js → chunk-j35mw64g.js} +4 -2
  142. package/dist/{chunk-425w66ka.js → chunk-j99ms5ep.js} +4 -4
  143. package/dist/{chunk-dtgh4te6.js → chunk-jgvmjwnx.js} +46 -45
  144. package/dist/{chunk-87scz097.js → chunk-jj4zs4gr.js} +46 -45
  145. package/dist/{chunk-am3qcgzp.js → chunk-jjz3hs34.js} +56 -55
  146. package/dist/{chunk-1a6ez1mg.js → chunk-jksf0ax9.js} +51 -49
  147. package/dist/{chunk-gdhz1652.js → chunk-jqfrz5g9.js} +27 -30
  148. package/dist/{chunk-q7jnesv8.js → chunk-jsj3fx0g.js} +5 -5
  149. package/dist/{chunk-vawgyev5.js → chunk-jtgyzqbq.js} +3 -3
  150. package/dist/{chunk-xfkfh5sd.js → chunk-jwpp2bq2.js} +1808 -1643
  151. package/dist/{chunk-zq6ezxh2.js → chunk-jwwpfq76.js} +49 -45
  152. package/dist/{chunk-qq5d2s0d.js → chunk-jxp2j9t5.js} +46 -45
  153. package/dist/{chunk-zctfbr1v.js → chunk-k7cw1a8a.js} +1 -1
  154. package/dist/chunk-k8jpbz31.js +62 -0
  155. package/dist/{chunk-tdbz9gbm.js → chunk-kjqyhxz7.js} +6 -6
  156. package/dist/{chunk-yc23zxmj.js → chunk-kxrrtr3p.js} +1 -1
  157. package/dist/chunk-m70n19dz.js +93 -0
  158. package/dist/{chunk-4nspekjp.js → chunk-mcws22k3.js} +1 -28
  159. package/dist/{chunk-a1bf2kh4.js → chunk-mewywsar.js} +46 -45
  160. package/dist/{chunk-k7g9gcr9.js → chunk-mmhkcj7c.js} +64 -58
  161. package/dist/{chunk-rm2vtv77.js → chunk-msxggy37.js} +22 -25
  162. package/dist/{chunk-s1tg295x.js → chunk-njw0haha.js} +10 -8
  163. package/dist/{chunk-5rv9c8yd.js → chunk-nrjtxhyr.js} +1 -1
  164. package/dist/{chunk-nqn45znr.js → chunk-ns7x6xam.js} +9 -9
  165. package/dist/{chunk-jaaxk89e.js → chunk-nsc89h0n.js} +2 -22
  166. package/dist/{chunk-z19sd3bt.js → chunk-p4196wzm.js} +5 -5
  167. package/dist/{chunk-1dgdjrm1.js → chunk-p791ydbm.js} +4 -4
  168. package/dist/{chunk-1zhy5cbc.js → chunk-p9ny0p2a.js} +13 -13
  169. package/dist/{chunk-phd1qfpc.js → chunk-pd2vy8hx.js} +5 -5
  170. package/dist/{chunk-gnj7tyj6.js → chunk-pddf0719.js} +49 -48
  171. package/dist/{chunk-6t5zvnrg.js → chunk-pfarypfq.js} +48 -46
  172. package/dist/{chunk-w4yn8cq7.js → chunk-psm26hv7.js} +8 -8
  173. package/dist/{chunk-hwn8vetn.js → chunk-pwpk3gm6.js} +10 -10
  174. package/dist/{chunk-va8drjmv.js → chunk-q14wrksq.js} +48 -47
  175. package/dist/{chunk-twqzmqsn.js → chunk-q4f1g9y6.js} +31 -27
  176. package/dist/{chunk-23jzrwsw.js → chunk-q6tdxy8v.js} +5 -5
  177. package/dist/chunk-q8hxwh48.js +445 -0
  178. package/dist/{chunk-eenq3avg.js → chunk-qcrpqjya.js} +1 -1
  179. package/dist/{chunk-e7efcp3k.js → chunk-qctsv1d7.js} +257 -2857
  180. package/dist/{chunk-ck0ap688.js → chunk-qkczt8cr.js} +4 -4
  181. package/dist/{chunk-2fxpd35d.js → chunk-qkp4ygnk.js} +2 -2
  182. package/dist/{chunk-c3d2cnz5.js → chunk-qqs58ywv.js} +7 -7
  183. package/dist/{chunk-qdnxk7d7.js → chunk-qxjhw1dt.js} +29 -30
  184. package/dist/{chunk-rkg741k3.js → chunk-qz0xdht6.js} +14 -14
  185. package/dist/chunk-r3ehjkj5.js +123 -0
  186. package/dist/{chunk-wbbykfdd.js → chunk-r5nd93kc.js} +1 -1
  187. package/dist/{chunk-yzcjz0gg.js → chunk-r6nnp8mj.js} +46 -45
  188. package/dist/{chunk-bm5rc541.js → chunk-r7684mmh.js} +5 -5
  189. package/dist/chunk-ratnrv9v.js +517 -0
  190. package/dist/{chunk-nx7c354z.js → chunk-rfbbcx5s.js} +46 -45
  191. package/dist/{chunk-z9n0183s.js → chunk-rfq9kmsy.js} +9 -9
  192. package/dist/{chunk-qsc98gbe.js → chunk-rhvn1rqs.js} +2 -2
  193. package/dist/{chunk-gvrjgq1n.js → chunk-rjq5nf1c.js} +16 -20
  194. package/dist/{chunk-xp61y5ba.js → chunk-rkv8bdtr.js} +2 -2
  195. package/dist/{chunk-tff58196.js → chunk-rmpaj37q.js} +48 -47
  196. package/dist/{chunk-k1crm94z.js → chunk-rn1s097c.js} +46 -45
  197. package/dist/{chunk-c42pqnxx.js → chunk-rnxpvm3m.js} +1 -1
  198. package/dist/{chunk-k0v0cz71.js → chunk-rpsqtvkx.js} +46 -45
  199. package/dist/{chunk-t5vbqd9d.js → chunk-rx4mcfg1.js} +55 -54
  200. package/dist/{chunk-30smv00b.js → chunk-rygxwjtc.js} +47 -46
  201. package/dist/{chunk-jpc9zwsk.js → chunk-rz94yg8c.js} +3 -3
  202. package/dist/{chunk-0m9w9esf.js → chunk-s19b0bc7.js} +46 -45
  203. package/dist/{chunk-wayfjcwt.js → chunk-sdfvr9ps.js} +4 -4
  204. package/dist/{chunk-fkhs3myp.js → chunk-sh2v9ywv.js} +5 -3
  205. package/dist/{chunk-1avzakfd.js → chunk-sjpqw47t.js} +3 -3
  206. package/dist/{chunk-7mqab3z7.js → chunk-skp5w8bq.js} +1 -1
  207. package/dist/{chunk-76j2e9vy.js → chunk-snxp8mxj.js} +2 -2
  208. package/dist/{chunk-vsqwd13w.js → chunk-ssb4wba6.js} +17 -19
  209. package/dist/{chunk-kva79cra.js → chunk-szzff973.js} +7 -5
  210. package/dist/{chunk-st73prx0.js → chunk-t1pygy19.js} +47 -46
  211. package/dist/{chunk-q1ah9nbq.js → chunk-t1s91wrk.js} +1 -1
  212. package/dist/{chunk-3skj4gfg.js → chunk-t3gmfcy7.js} +47 -46
  213. package/dist/{chunk-xw8pjerk.js → chunk-t9eeyrkn.js} +48 -47
  214. package/dist/{chunk-0jtbeesf.js → chunk-tf859h88.js} +16 -20
  215. package/dist/{chunk-denyma1s.js → chunk-thenr6b3.js} +14 -12
  216. package/dist/{chunk-234668cb.js → chunk-thmtkfgj.js} +5 -5
  217. package/dist/chunk-tj7v47cp.js +20 -0
  218. package/dist/{chunk-12k745vf.js → chunk-tpk67mjc.js} +3 -3
  219. package/dist/chunk-trvc6jh7.js +92 -0
  220. package/dist/{chunk-9v13f3gm.js → chunk-ttyfhx12.js} +524 -195
  221. package/dist/{chunk-q87kegxh.js → chunk-txgbs4hp.js} +49 -48
  222. package/dist/{chunk-25bwa70y.js → chunk-ty1cyqr7.js} +49 -48
  223. package/dist/{chunk-r6kaak61.js → chunk-v0tgjdx0.js} +16 -20
  224. package/dist/chunk-v3s93bzd.js +34 -0
  225. package/dist/{chunk-4cp6193g.js → chunk-v4t6dyyh.js} +2 -2
  226. package/dist/{chunk-fape0yfp.js → chunk-v4wba09w.js} +46 -45
  227. package/dist/{chunk-h02gcdx5.js → chunk-v5g8nf5h.js} +8 -8
  228. package/dist/{chunk-jtztm8f5.js → chunk-v6hbqcmr.js} +44 -43
  229. package/dist/{chunk-21gmrwhs.js → chunk-vajsk9ya.js} +17 -21
  230. package/dist/{chunk-8hpq2659.js → chunk-vbtm9g57.js} +1 -1
  231. package/dist/{chunk-q7e0106d.js → chunk-vk3nb2xe.js} +51 -56
  232. package/dist/{chunk-ad3v6mzw.js → chunk-vmbht6ec.js} +12 -12
  233. package/dist/{chunk-as5rvw4n.js → chunk-vmp5rk8q.js} +17 -21
  234. package/dist/{chunk-1x0y4426.js → chunk-vtmxgm1m.js} +4 -4
  235. package/dist/{chunk-pb92bj1h.js → chunk-vw5jzpcm.js} +6 -6
  236. package/dist/{chunk-5cem2v7n.js → chunk-vyz3v0qx.js} +5 -5
  237. package/dist/{chunk-hxzt3r84.js → chunk-w3782jck.js} +51 -50
  238. package/dist/{chunk-1vnd9s2j.js → chunk-w3gnkyfc.js} +57 -66
  239. package/dist/chunk-w6mcmmt5.js +1457 -0
  240. package/dist/chunk-wa0xgm6m.js +988 -0
  241. package/dist/{chunk-vrjbc8ap.js → chunk-wa8yn2p0.js} +1 -1
  242. package/dist/{chunk-hya4c599.js → chunk-wg47eg7y.js} +46 -45
  243. package/dist/{chunk-y7we499r.js → chunk-wgd4n1q7.js} +8 -8
  244. package/dist/{chunk-0g5cy3wj.js → chunk-wgk9sxk7.js} +4 -4
  245. package/dist/{chunk-wr3pd88n.js → chunk-wkt2q02c.js} +40 -9
  246. package/dist/{chunk-gbte7d7h.js → chunk-wm1zm5xj.js} +4 -2
  247. package/dist/{chunk-3hwa20vg.js → chunk-wtpgjmjd.js} +49 -46
  248. package/dist/{chunk-dbwmzvfj.js → chunk-wxkrq9eb.js} +46 -45
  249. package/dist/{chunk-d00mfc1e.js → chunk-x2bnzvd6.js} +46 -45
  250. package/dist/{chunk-2xbyb015.js → chunk-x3jthbjq.js} +47 -46
  251. package/dist/chunk-x7fdwq3d.js +33 -0
  252. package/dist/{chunk-zhk465tg.js → chunk-xcrzgyce.js} +46 -45
  253. package/dist/{chunk-chsyvavm.js → chunk-xeb6075z.js} +1 -1
  254. package/dist/{chunk-6ksdp40n.js → chunk-xffb3dsw.js} +1 -1
  255. package/dist/{chunk-2j3v2dgk.js → chunk-xgbd6ec5.js} +47 -46
  256. package/dist/{chunk-n7pnyq43.js → chunk-xhfmdq1y.js} +16 -0
  257. package/dist/{chunk-2v4x8kaq.js → chunk-xhn4ptjn.js} +51 -50
  258. package/dist/{chunk-w1sv7j01.js → chunk-xs7zsmzk.js} +46 -45
  259. package/dist/chunk-xswyz2es.js +118 -0
  260. package/dist/{chunk-ky39hkg1.js → chunk-xtdm6ejq.js} +9 -7
  261. package/dist/{chunk-hh3k5s1s.js → chunk-xvk90wpt.js} +3 -3
  262. package/dist/{chunk-5awgsvrw.js → chunk-xw99fqv1.js} +14 -6
  263. package/dist/{chunk-xnv6kb39.js → chunk-y32em34x.js} +22 -23
  264. package/dist/chunk-y5wfy524.js +94 -0
  265. package/dist/{chunk-fk8crdnk.js → chunk-ya9dxex0.js} +48 -46
  266. package/dist/{chunk-97wgdsab.js → chunk-z16txqz0.js} +3 -3
  267. package/dist/{chunk-yvtzznds.js → chunk-z6wm96eh.js} +2 -2
  268. package/dist/{chunk-nqrc7pc4.js → chunk-zcgprbyy.js} +29 -27
  269. package/dist/chunk-zqbnw3n2.js +197 -0
  270. package/dist/{chunk-d6rypdxt.js → chunk-zxywawr7.js} +1 -1
  271. package/dist/{chunk-jj5wj46b.js → chunk-zyjkg76f.js} +7 -7
  272. package/dist/cli.js +8 -8
  273. package/dist/gateway/index.js +326 -0
  274. package/dist/gateway/worker.js +482241 -0
  275. package/package.json +1 -1
  276. package/dist/chunk-11cz07kz.js +0 -93
  277. package/dist/chunk-1pbtp2z2.js +0 -92
  278. package/dist/chunk-25y2dtzf.js +0 -91
  279. package/dist/chunk-3hyj0zpy.js +0 -95
  280. package/dist/chunk-4kqjjakw.js +0 -73
  281. package/dist/chunk-4zwqbg7s.js +0 -87
  282. package/dist/chunk-5be33wja.js +0 -120
  283. package/dist/chunk-70mgxhkz.js +0 -369
  284. package/dist/chunk-7gmk09cq.js +0 -116
  285. package/dist/chunk-8dprcdra.js +0 -92
  286. package/dist/chunk-8xwx1xtg.js +0 -120
  287. package/dist/chunk-a579wjd2.js +0 -436
  288. package/dist/chunk-axqk3mxk.js +0 -116
  289. package/dist/chunk-c0ckmxr1.js +0 -86
  290. package/dist/chunk-c6t24y8q.js +0 -94
  291. package/dist/chunk-cfv996bs.js +0 -22
  292. package/dist/chunk-e5t5eefc.js +0 -62
  293. package/dist/chunk-eyph0250.js +0 -88
  294. package/dist/chunk-f825x57v.js +0 -91
  295. package/dist/chunk-h9xx5bj6.js +0 -91
  296. package/dist/chunk-j1dg659r.js +0 -89
  297. package/dist/chunk-jk8seqkk.js +0 -90
  298. package/dist/chunk-jzg4nddc.js +0 -92
  299. package/dist/chunk-k5vy0s3c.js +0 -93
  300. package/dist/chunk-ke820fjw.js +0 -91
  301. package/dist/chunk-kyzd4p8z.js +0 -111
  302. package/dist/chunk-njrt3tac.js +0 -640
  303. package/dist/chunk-pavb6a7w.js +0 -516
  304. package/dist/chunk-q268gpa0.js +0 -145
  305. package/dist/chunk-qvh1w3t7.js +0 -157
  306. package/dist/chunk-qy1es4jj.js +0 -95
  307. package/dist/chunk-qz2x630m.js +0 -49145
  308. package/dist/chunk-tw48evtr.js +0 -40
  309. package/dist/chunk-w0gfctyc.js +0 -117
  310. package/dist/chunk-y0fhjxef.js +0 -276
  311. package/dist/chunk-y275vgmw.js +0 -654
  312. package/dist/chunk-zq7pmdas.js +0 -1003
@@ -1,640 +0,0 @@
1
- // @bun
2
- import {
3
- getAnthropicApiKey,
4
- getClaudeAIOAuthTokens,
5
- getGlobalConfig,
6
- hasProfileScope,
7
- init_auth,
8
- init_config,
9
- saveApiKey,
10
- saveGlobalConfig
11
- } from "./chunk-e7efcp3k.js";
12
- import {
13
- init_lazySchema,
14
- lazySchema
15
- } from "./chunk-64c1avct.js";
16
- import {
17
- init_sleep,
18
- sleep
19
- } from "./chunk-8g5pe1gr.js";
20
- import {
21
- init_v4,
22
- v4_default
23
- } from "./chunk-8g747a8x.js";
24
- import {
25
- ALL_OAUTH_SCOPES,
26
- CLAUDE_AI_INFERENCE_SCOPE,
27
- CLAUDE_AI_OAUTH_SCOPES,
28
- OAUTH_BETA_HEADER,
29
- getOauthConfig,
30
- init_oauth
31
- } from "./chunk-s3hsqf80.js";
32
- import {
33
- init_analytics,
34
- logEvent
35
- } from "./chunk-x8d2ehd7.js";
36
- import {
37
- init_detectRepository,
38
- parseGitHubRepository
39
- } from "./chunk-15m49c67.js";
40
- import {
41
- init_log,
42
- logError
43
- } from "./chunk-1nk93fqz.js";
44
- import {
45
- errorMessage,
46
- init_debug,
47
- init_errors,
48
- init_slowOperations,
49
- jsonStringify,
50
- logForDebugging,
51
- toError
52
- } from "./chunk-phd1qfpc.js";
53
- import {
54
- axios_default,
55
- init_axios
56
- } from "./chunk-55raexh7.js";
57
- import {
58
- __esm
59
- } from "./chunk-qp2qdcda.js";
60
-
61
- // src/services/oauth/getOauthProfile.ts
62
- async function getOauthProfileFromApiKey() {
63
- const config = getGlobalConfig();
64
- const accountUuid = config.oauthAccount?.accountUuid;
65
- const apiKey = getAnthropicApiKey();
66
- if (!accountUuid || !apiKey) {
67
- return;
68
- }
69
- const endpoint = `${getOauthConfig().BASE_API_URL}/api/claude_cli_profile`;
70
- try {
71
- const response = await axios_default.get(endpoint, {
72
- headers: {
73
- "x-api-key": apiKey,
74
- "anthropic-beta": OAUTH_BETA_HEADER
75
- },
76
- params: {
77
- account_uuid: accountUuid
78
- },
79
- timeout: 1e4
80
- });
81
- return response.data;
82
- } catch (error) {
83
- logError(error);
84
- }
85
- }
86
- async function getOauthProfileFromOauthToken(accessToken) {
87
- const endpoint = `${getOauthConfig().BASE_API_URL}/api/oauth/profile`;
88
- try {
89
- const response = await axios_default.get(endpoint, {
90
- headers: {
91
- Authorization: `Bearer ${accessToken}`,
92
- "Content-Type": "application/json"
93
- },
94
- timeout: 1e4
95
- });
96
- return response.data;
97
- } catch (error) {
98
- logError(error);
99
- }
100
- }
101
- var init_getOauthProfile = __esm(() => {
102
- init_axios();
103
- init_oauth();
104
- init_auth();
105
- init_config();
106
- init_log();
107
- });
108
-
109
- // src/services/oauth/client.ts
110
- function shouldUseClaudeAIAuth(scopes) {
111
- return Boolean(scopes?.includes(CLAUDE_AI_INFERENCE_SCOPE));
112
- }
113
- function parseScopes(scopeString) {
114
- return scopeString?.split(" ").filter(Boolean) ?? [];
115
- }
116
- function buildAuthUrl({
117
- codeChallenge,
118
- state,
119
- port,
120
- isManual,
121
- loginWithClaudeAi,
122
- inferenceOnly,
123
- orgUUID,
124
- loginHint,
125
- loginMethod
126
- }) {
127
- const authUrlBase = loginWithClaudeAi ? getOauthConfig().CLAUDE_AI_AUTHORIZE_URL : getOauthConfig().CONSOLE_AUTHORIZE_URL;
128
- const authUrl = new URL(authUrlBase);
129
- authUrl.searchParams.append("code", "true");
130
- authUrl.searchParams.append("client_id", getOauthConfig().CLIENT_ID);
131
- authUrl.searchParams.append("response_type", "code");
132
- authUrl.searchParams.append("redirect_uri", isManual ? getOauthConfig().MANUAL_REDIRECT_URL : `http://localhost:${port}/callback`);
133
- const scopesToUse = inferenceOnly ? [CLAUDE_AI_INFERENCE_SCOPE] : ALL_OAUTH_SCOPES;
134
- authUrl.searchParams.append("scope", scopesToUse.join(" "));
135
- authUrl.searchParams.append("code_challenge", codeChallenge);
136
- authUrl.searchParams.append("code_challenge_method", "S256");
137
- authUrl.searchParams.append("state", state);
138
- if (orgUUID) {
139
- authUrl.searchParams.append("orgUUID", orgUUID);
140
- }
141
- if (loginHint) {
142
- authUrl.searchParams.append("login_hint", loginHint);
143
- }
144
- if (loginMethod) {
145
- authUrl.searchParams.append("login_method", loginMethod);
146
- }
147
- return authUrl.toString();
148
- }
149
- async function exchangeCodeForTokens(authorizationCode, state, codeVerifier, port, useManualRedirect = false, expiresIn) {
150
- const requestBody = {
151
- grant_type: "authorization_code",
152
- code: authorizationCode,
153
- redirect_uri: useManualRedirect ? getOauthConfig().MANUAL_REDIRECT_URL : `http://localhost:${port}/callback`,
154
- client_id: getOauthConfig().CLIENT_ID,
155
- code_verifier: codeVerifier,
156
- state
157
- };
158
- if (expiresIn !== undefined) {
159
- requestBody.expires_in = expiresIn;
160
- }
161
- const response = await axios_default.post(getOauthConfig().TOKEN_URL, requestBody, {
162
- headers: { "Content-Type": "application/json" },
163
- timeout: 15000
164
- });
165
- if (response.status !== 200) {
166
- throw new Error(response.status === 401 ? "Authentication failed: Invalid authorization code" : `Token exchange failed (${response.status}): ${response.statusText}`);
167
- }
168
- logEvent("tengu_oauth_token_exchange_success", {});
169
- return response.data;
170
- }
171
- async function refreshOAuthToken(refreshToken, { scopes: requestedScopes } = {}) {
172
- const requestBody = {
173
- grant_type: "refresh_token",
174
- refresh_token: refreshToken,
175
- client_id: getOauthConfig().CLIENT_ID,
176
- scope: ((requestedScopes?.length) ? requestedScopes : CLAUDE_AI_OAUTH_SCOPES).join(" ")
177
- };
178
- try {
179
- const response = await axios_default.post(getOauthConfig().TOKEN_URL, requestBody, {
180
- headers: { "Content-Type": "application/json" },
181
- timeout: 15000
182
- });
183
- if (response.status !== 200) {
184
- throw new Error(`Token refresh failed: ${response.statusText}`);
185
- }
186
- const data = response.data;
187
- const {
188
- access_token: accessToken,
189
- refresh_token: newRefreshToken = refreshToken,
190
- expires_in: expiresIn
191
- } = data;
192
- const expiresAt = Date.now() + expiresIn * 1000;
193
- const scopes = parseScopes(data.scope);
194
- logEvent("tengu_oauth_token_refresh_success", {});
195
- const config = getGlobalConfig();
196
- const existing = getClaudeAIOAuthTokens();
197
- const haveProfileAlready = config.oauthAccount?.billingType !== undefined && config.oauthAccount?.accountCreatedAt !== undefined && config.oauthAccount?.subscriptionCreatedAt !== undefined && existing?.subscriptionType != null && existing?.rateLimitTier != null;
198
- const profileInfo = haveProfileAlready ? null : await fetchProfileInfo(accessToken);
199
- if (profileInfo && config.oauthAccount) {
200
- const updates = {};
201
- if (profileInfo.displayName !== undefined) {
202
- updates.displayName = profileInfo.displayName;
203
- }
204
- if (typeof profileInfo.hasExtraUsageEnabled === "boolean") {
205
- updates.hasExtraUsageEnabled = profileInfo.hasExtraUsageEnabled;
206
- }
207
- if (profileInfo.billingType !== null) {
208
- updates.billingType = profileInfo.billingType;
209
- }
210
- if (profileInfo.accountCreatedAt !== undefined) {
211
- updates.accountCreatedAt = profileInfo.accountCreatedAt;
212
- }
213
- if (profileInfo.subscriptionCreatedAt !== undefined) {
214
- updates.subscriptionCreatedAt = profileInfo.subscriptionCreatedAt;
215
- }
216
- if (Object.keys(updates).length > 0) {
217
- saveGlobalConfig((current) => ({
218
- ...current,
219
- oauthAccount: current.oauthAccount ? { ...current.oauthAccount, ...updates } : current.oauthAccount
220
- }));
221
- }
222
- }
223
- return {
224
- accessToken,
225
- refreshToken: newRefreshToken,
226
- expiresAt,
227
- scopes,
228
- subscriptionType: profileInfo?.subscriptionType ?? existing?.subscriptionType ?? null,
229
- rateLimitTier: profileInfo?.rateLimitTier ?? existing?.rateLimitTier ?? null,
230
- profile: profileInfo?.rawProfile,
231
- tokenAccount: data.account ? {
232
- uuid: data.account.uuid,
233
- emailAddress: data.account.email_address,
234
- organizationUuid: data.organization?.uuid
235
- } : undefined
236
- };
237
- } catch (error) {
238
- const responseBody = axios_default.isAxiosError(error) && error.response?.data ? JSON.stringify(error.response.data) : undefined;
239
- logEvent("tengu_oauth_token_refresh_failure", {
240
- error: error.message,
241
- ...responseBody && {
242
- responseBody
243
- }
244
- });
245
- throw error;
246
- }
247
- }
248
- async function fetchAndStoreUserRoles(accessToken) {
249
- const response = await axios_default.get(getOauthConfig().ROLES_URL, {
250
- headers: { Authorization: `Bearer ${accessToken}` }
251
- });
252
- if (response.status !== 200) {
253
- throw new Error(`Failed to fetch user roles: ${response.statusText}`);
254
- }
255
- const data = response.data;
256
- const config = getGlobalConfig();
257
- if (!config.oauthAccount) {
258
- throw new Error("OAuth account information not found in config");
259
- }
260
- saveGlobalConfig((current) => ({
261
- ...current,
262
- oauthAccount: current.oauthAccount ? {
263
- ...current.oauthAccount,
264
- organizationRole: data.organization_role,
265
- workspaceRole: data.workspace_role,
266
- organizationName: data.organization_name
267
- } : current.oauthAccount
268
- }));
269
- logEvent("tengu_oauth_roles_stored", {
270
- org_role: data.organization_role
271
- });
272
- }
273
- async function createAndStoreApiKey(accessToken) {
274
- try {
275
- const response = await axios_default.post(getOauthConfig().API_KEY_URL, null, {
276
- headers: { Authorization: `Bearer ${accessToken}` }
277
- });
278
- const apiKey = response.data?.raw_key;
279
- if (apiKey) {
280
- await saveApiKey(apiKey);
281
- logEvent("tengu_oauth_api_key", {
282
- status: "success",
283
- statusCode: response.status
284
- });
285
- return apiKey;
286
- }
287
- return null;
288
- } catch (error) {
289
- logEvent("tengu_oauth_api_key", {
290
- status: "failure",
291
- error: error instanceof Error ? error.message : String(error)
292
- });
293
- throw error;
294
- }
295
- }
296
- function isOAuthTokenExpired(expiresAt) {
297
- if (expiresAt === null) {
298
- return false;
299
- }
300
- const bufferTime = 5 * 60 * 1000;
301
- const now = Date.now();
302
- const expiresWithBuffer = now + bufferTime;
303
- return expiresWithBuffer >= expiresAt;
304
- }
305
- async function fetchProfileInfo(accessToken) {
306
- const profile = await getOauthProfileFromOauthToken(accessToken);
307
- const orgType = profile?.organization?.organization_type;
308
- let subscriptionType = null;
309
- switch (orgType) {
310
- case "claude_max":
311
- subscriptionType = "max";
312
- break;
313
- case "claude_pro":
314
- subscriptionType = "pro";
315
- break;
316
- case "claude_enterprise":
317
- subscriptionType = "enterprise";
318
- break;
319
- case "claude_team":
320
- subscriptionType = "team";
321
- break;
322
- default:
323
- subscriptionType = null;
324
- break;
325
- }
326
- const result = {
327
- subscriptionType,
328
- rateLimitTier: profile?.organization?.rate_limit_tier ?? null,
329
- hasExtraUsageEnabled: profile?.organization?.has_extra_usage_enabled ?? null,
330
- billingType: profile?.organization?.billing_type ?? null
331
- };
332
- if (profile?.account?.display_name) {
333
- result.displayName = profile.account.display_name;
334
- }
335
- if (profile?.account?.created_at) {
336
- result.accountCreatedAt = profile.account.created_at;
337
- }
338
- if (profile?.organization?.subscription_created_at) {
339
- result.subscriptionCreatedAt = profile.organization.subscription_created_at;
340
- }
341
- logEvent("tengu_oauth_profile_fetch_success", {});
342
- return { ...result, rawProfile: profile };
343
- }
344
- async function getOrganizationUUID() {
345
- const globalConfig = getGlobalConfig();
346
- const orgUUID = globalConfig.oauthAccount?.organizationUuid;
347
- if (orgUUID) {
348
- return orgUUID;
349
- }
350
- const accessToken = getClaudeAIOAuthTokens()?.accessToken;
351
- if (accessToken === undefined || !hasProfileScope()) {
352
- return null;
353
- }
354
- const profile = await getOauthProfileFromOauthToken(accessToken);
355
- const profileOrgUUID = profile?.organization?.uuid;
356
- if (!profileOrgUUID) {
357
- return null;
358
- }
359
- return profileOrgUUID;
360
- }
361
- function storeOAuthAccountInfo({
362
- accountUuid,
363
- emailAddress,
364
- organizationUuid,
365
- displayName,
366
- hasExtraUsageEnabled,
367
- billingType,
368
- accountCreatedAt,
369
- subscriptionCreatedAt
370
- }) {
371
- const accountInfo = {
372
- accountUuid,
373
- emailAddress,
374
- organizationUuid,
375
- hasExtraUsageEnabled,
376
- billingType,
377
- accountCreatedAt,
378
- subscriptionCreatedAt
379
- };
380
- if (displayName) {
381
- accountInfo.displayName = displayName;
382
- }
383
- saveGlobalConfig((current) => {
384
- if (current.oauthAccount?.accountUuid === accountInfo.accountUuid && current.oauthAccount?.emailAddress === accountInfo.emailAddress && current.oauthAccount?.organizationUuid === accountInfo.organizationUuid && current.oauthAccount?.displayName === accountInfo.displayName && current.oauthAccount?.hasExtraUsageEnabled === accountInfo.hasExtraUsageEnabled && current.oauthAccount?.billingType === accountInfo.billingType && current.oauthAccount?.accountCreatedAt === accountInfo.accountCreatedAt && current.oauthAccount?.subscriptionCreatedAt === accountInfo.subscriptionCreatedAt) {
385
- return current;
386
- }
387
- return { ...current, oauthAccount: accountInfo };
388
- });
389
- }
390
- var init_client = __esm(() => {
391
- init_axios();
392
- init_analytics();
393
- init_oauth();
394
- init_auth();
395
- init_config();
396
- init_debug();
397
- init_getOauthProfile();
398
- });
399
-
400
- // src/utils/teleport/api.ts
401
- import { randomUUID } from "crypto";
402
- function isTransientNetworkError(error) {
403
- if (!axios_default.isAxiosError(error)) {
404
- return false;
405
- }
406
- if (!error.response) {
407
- return true;
408
- }
409
- if (error.response.status >= 500) {
410
- return true;
411
- }
412
- return false;
413
- }
414
- async function axiosGetWithRetry(url, config) {
415
- let lastError;
416
- for (let attempt = 0;attempt <= MAX_TELEPORT_RETRIES; attempt++) {
417
- try {
418
- return await axios_default.get(url, config);
419
- } catch (error) {
420
- lastError = error;
421
- if (!isTransientNetworkError(error)) {
422
- throw error;
423
- }
424
- if (attempt >= MAX_TELEPORT_RETRIES) {
425
- logForDebugging(`Teleport request failed after ${attempt + 1} attempts: ${errorMessage(error)}`);
426
- throw error;
427
- }
428
- const delay = TELEPORT_RETRY_DELAYS[attempt] ?? 2000;
429
- logForDebugging(`Teleport request failed (attempt ${attempt + 1}/${MAX_TELEPORT_RETRIES + 1}), retrying in ${delay}ms: ${errorMessage(error)}`);
430
- await sleep(delay);
431
- }
432
- }
433
- throw lastError;
434
- }
435
- async function prepareApiRequest() {
436
- const accessToken = getClaudeAIOAuthTokens()?.accessToken;
437
- if (accessToken === undefined) {
438
- throw new 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.");
439
- }
440
- const orgUUID = await getOrganizationUUID();
441
- if (!orgUUID) {
442
- throw new Error("Unable to get organization UUID");
443
- }
444
- return { accessToken, orgUUID };
445
- }
446
- async function fetchCodeSessionsFromSessionsAPI() {
447
- const { accessToken, orgUUID } = await prepareApiRequest();
448
- const url = `${getOauthConfig().BASE_API_URL}/v1/sessions`;
449
- try {
450
- const headers = {
451
- ...getOAuthHeaders(accessToken),
452
- "anthropic-beta": "ccr-byoc-2025-07-29",
453
- "x-organization-uuid": orgUUID
454
- };
455
- const response = await axiosGetWithRetry(url, {
456
- headers
457
- });
458
- if (response.status !== 200) {
459
- throw new Error(`Failed to fetch code sessions: ${response.statusText}`);
460
- }
461
- const sessions = response.data.data.map((session) => {
462
- const gitSource = session.session_context.sources.find((source) => source.type === "git_repository");
463
- let repo = null;
464
- if (gitSource?.url) {
465
- const repoPath = parseGitHubRepository(gitSource.url);
466
- if (repoPath) {
467
- const [owner, name] = repoPath.split("/");
468
- if (owner && name) {
469
- repo = {
470
- name,
471
- owner: {
472
- login: owner
473
- },
474
- default_branch: gitSource.revision || undefined
475
- };
476
- }
477
- }
478
- }
479
- return {
480
- id: session.id,
481
- title: session.title || "Untitled",
482
- description: "",
483
- status: session.session_status,
484
- repo,
485
- turns: [],
486
- created_at: session.created_at,
487
- updated_at: session.updated_at
488
- };
489
- });
490
- return sessions;
491
- } catch (error) {
492
- const err = toError(error);
493
- logError(err);
494
- throw error;
495
- }
496
- }
497
- function getOAuthHeaders(accessToken) {
498
- return {
499
- Authorization: `Bearer ${accessToken}`,
500
- "Content-Type": "application/json",
501
- "anthropic-version": "2023-06-01"
502
- };
503
- }
504
- async function fetchSession(sessionId) {
505
- const { accessToken, orgUUID } = await prepareApiRequest();
506
- const url = `${getOauthConfig().BASE_API_URL}/v1/sessions/${sessionId}`;
507
- const headers = {
508
- ...getOAuthHeaders(accessToken),
509
- "anthropic-beta": "ccr-byoc-2025-07-29",
510
- "x-organization-uuid": orgUUID
511
- };
512
- const response = await axios_default.get(url, {
513
- headers,
514
- timeout: 15000,
515
- validateStatus: (status) => status < 500
516
- });
517
- if (response.status !== 200) {
518
- const errorData = response.data;
519
- const apiMessage = errorData?.error?.message;
520
- if (response.status === 404) {
521
- throw new Error(`Session not found: ${sessionId}`);
522
- }
523
- if (response.status === 401) {
524
- throw new Error("Session expired. Please run /login to sign in again.");
525
- }
526
- throw new Error(apiMessage || `Failed to fetch session: ${response.status} ${response.statusText}`);
527
- }
528
- return response.data;
529
- }
530
- function getBranchFromSession(session) {
531
- const gitOutcome = session.session_context.outcomes?.find((outcome) => outcome.type === "git_repository");
532
- return gitOutcome?.git_info?.branches[0];
533
- }
534
- async function sendEventToRemoteSession(sessionId, messageContent, opts) {
535
- try {
536
- const { accessToken, orgUUID } = await prepareApiRequest();
537
- const url = `${getOauthConfig().BASE_API_URL}/v1/sessions/${sessionId}/events`;
538
- const headers = {
539
- ...getOAuthHeaders(accessToken),
540
- "anthropic-beta": "ccr-byoc-2025-07-29",
541
- "x-organization-uuid": orgUUID
542
- };
543
- const userEvent = {
544
- uuid: opts?.uuid ?? randomUUID(),
545
- session_id: sessionId,
546
- type: "user",
547
- parent_tool_use_id: null,
548
- message: {
549
- role: "user",
550
- content: messageContent
551
- }
552
- };
553
- const requestBody = {
554
- events: [userEvent]
555
- };
556
- logForDebugging(`[sendEventToRemoteSession] Sending event to session ${sessionId}`);
557
- const response = await axios_default.post(url, requestBody, {
558
- headers,
559
- validateStatus: (status) => status < 500,
560
- timeout: 30000
561
- });
562
- if (response.status === 200 || response.status === 201) {
563
- logForDebugging(`[sendEventToRemoteSession] Successfully sent event to session ${sessionId}`);
564
- return true;
565
- }
566
- logForDebugging(`[sendEventToRemoteSession] Failed with status ${response.status}: ${jsonStringify(response.data)}`);
567
- return false;
568
- } catch (error) {
569
- logForDebugging(`[sendEventToRemoteSession] Error: ${errorMessage(error)}`);
570
- return false;
571
- }
572
- }
573
- async function updateSessionTitle(sessionId, title) {
574
- try {
575
- const { accessToken, orgUUID } = await prepareApiRequest();
576
- const url = `${getOauthConfig().BASE_API_URL}/v1/sessions/${sessionId}`;
577
- const headers = {
578
- ...getOAuthHeaders(accessToken),
579
- "anthropic-beta": "ccr-byoc-2025-07-29",
580
- "x-organization-uuid": orgUUID
581
- };
582
- logForDebugging(`[updateSessionTitle] Updating title for session ${sessionId}: "${title}"`);
583
- const response = await axios_default.patch(url, { title }, {
584
- headers,
585
- validateStatus: (status) => status < 500
586
- });
587
- if (response.status === 200) {
588
- logForDebugging(`[updateSessionTitle] Successfully updated title for session ${sessionId}`);
589
- return true;
590
- }
591
- logForDebugging(`[updateSessionTitle] Failed with status ${response.status}: ${jsonStringify(response.data)}`);
592
- return false;
593
- } catch (error) {
594
- logForDebugging(`[updateSessionTitle] Error: ${errorMessage(error)}`);
595
- return false;
596
- }
597
- }
598
- var TELEPORT_RETRY_DELAYS, MAX_TELEPORT_RETRIES, CodeSessionSchema;
599
- var init_api = __esm(() => {
600
- init_axios();
601
- init_oauth();
602
- init_client();
603
- init_v4();
604
- init_auth();
605
- init_debug();
606
- init_detectRepository();
607
- init_errors();
608
- init_lazySchema();
609
- init_log();
610
- init_sleep();
611
- init_slowOperations();
612
- TELEPORT_RETRY_DELAYS = [2000, 4000, 8000, 16000];
613
- MAX_TELEPORT_RETRIES = TELEPORT_RETRY_DELAYS.length;
614
- CodeSessionSchema = lazySchema(() => v4_default.object({
615
- id: v4_default.string(),
616
- title: v4_default.string(),
617
- description: v4_default.string(),
618
- status: v4_default.enum([
619
- "idle",
620
- "working",
621
- "waiting",
622
- "completed",
623
- "archived",
624
- "cancelled",
625
- "rejected"
626
- ]),
627
- repo: v4_default.object({
628
- name: v4_default.string(),
629
- owner: v4_default.object({
630
- login: v4_default.string()
631
- }),
632
- default_branch: v4_default.string().optional()
633
- }).nullable(),
634
- turns: v4_default.array(v4_default.string()),
635
- created_at: v4_default.string(),
636
- updated_at: v4_default.string()
637
- }));
638
- });
639
-
640
- export { getOauthProfileFromApiKey, getOauthProfileFromOauthToken, init_getOauthProfile, shouldUseClaudeAIAuth, parseScopes, buildAuthUrl, exchangeCodeForTokens, refreshOAuthToken, fetchAndStoreUserRoles, createAndStoreApiKey, isOAuthTokenExpired, fetchProfileInfo, getOrganizationUUID, storeOAuthAccountInfo, init_client, isTransientNetworkError, prepareApiRequest, fetchCodeSessionsFromSessionsAPI, getOAuthHeaders, fetchSession, getBranchFromSession, sendEventToRemoteSession, updateSessionTitle, init_api };