@caspian2026/agent-sdk 0.0.25 → 0.0.27

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 (362) hide show
  1. package/dist/gateway/index.js +98 -22
  2. package/dist/gateway/worker.js +1005 -982
  3. package/dist/sdk/query.cjs +2 -362
  4. package/dist/sdk/query.js +2 -367
  5. package/package.json +126 -128
  6. package/dist/chunk-04n4fe72.js +0 -107
  7. package/dist/chunk-04ys66ej.js +0 -344
  8. package/dist/chunk-07069jq1.js +0 -30
  9. package/dist/chunk-0731m51q.js +0 -8
  10. package/dist/chunk-086x4ct4.js +0 -26
  11. package/dist/chunk-0btqb97n.js +0 -295
  12. package/dist/chunk-0paqc2yw.js +0 -15
  13. package/dist/chunk-0r1rjydx.js +0 -145
  14. package/dist/chunk-0r5bb9j4.js +0 -477
  15. package/dist/chunk-0t81d427.js +0 -41
  16. package/dist/chunk-0teq2mz0.js +0 -420
  17. package/dist/chunk-0vkfrmqm.js +0 -690
  18. package/dist/chunk-0vp3wfab.js +0 -12
  19. package/dist/chunk-0warp8dx.js +0 -253
  20. package/dist/chunk-0xjaqda8.js +0 -1124
  21. package/dist/chunk-10gzv316.js +0 -62
  22. package/dist/chunk-11pq9n08.js +0 -168
  23. package/dist/chunk-1ae3nt9j.js +0 -31
  24. package/dist/chunk-1fmb0njn.js +0 -396
  25. package/dist/chunk-1gx78081.js +0 -66
  26. package/dist/chunk-1h2famwb.js +0 -49
  27. package/dist/chunk-1ng8xwxz.js +0 -276
  28. package/dist/chunk-1v7jp29h.js +0 -206
  29. package/dist/chunk-1xxy5zhb.js +0 -673
  30. package/dist/chunk-20b73w7w.js +0 -117
  31. package/dist/chunk-20qxd83a.js +0 -1161
  32. package/dist/chunk-2239ny9q.js +0 -90
  33. package/dist/chunk-22d4rnef.js +0 -226
  34. package/dist/chunk-26wtxbdc.js +0 -13870
  35. package/dist/chunk-27225bjh.js +0 -618
  36. package/dist/chunk-2b0e32an.js +0 -5822
  37. package/dist/chunk-2bfa9w1y.js +0 -323
  38. package/dist/chunk-2epq04w1.js +0 -63
  39. package/dist/chunk-2fwze72g.js +0 -24
  40. package/dist/chunk-2gzv8nrw.js +0 -205
  41. package/dist/chunk-2mexte1r.js +0 -349
  42. package/dist/chunk-2mzaqh5g.js +0 -338
  43. package/dist/chunk-2tb6mzfc.js +0 -81
  44. package/dist/chunk-2xq0g43w.js +0 -558
  45. package/dist/chunk-334aeqg9.js +0 -90
  46. package/dist/chunk-34jx4rjd.js +0 -995
  47. package/dist/chunk-35w5nhex.js +0 -132
  48. package/dist/chunk-3c25bcsw.js +0 -17
  49. package/dist/chunk-3eaxj8dg.js +0 -151
  50. package/dist/chunk-3fdgrwd2.js +0 -111
  51. package/dist/chunk-3jw0r58d.js +0 -121
  52. package/dist/chunk-3mgywd32.js +0 -8
  53. package/dist/chunk-3nk79af8.js +0 -8
  54. package/dist/chunk-3vy1jt9p.js +0 -1010
  55. package/dist/chunk-3x78pd4j.js +0 -153
  56. package/dist/chunk-47x3dsmn.js +0 -95
  57. package/dist/chunk-49pqt48n.js +0 -108
  58. package/dist/chunk-4f7m9fjw.js +0 -317
  59. package/dist/chunk-4jm600zv.js +0 -13
  60. package/dist/chunk-4k9d7gxv.js +0 -118
  61. package/dist/chunk-4net8san.js +0 -155
  62. package/dist/chunk-4pbx3g7s.js +0 -26
  63. package/dist/chunk-4v125j4z.js +0 -58
  64. package/dist/chunk-4vxkv5vz.js +0 -1438
  65. package/dist/chunk-51fqpjy3.js +0 -121
  66. package/dist/chunk-52e64f2h.js +0 -439
  67. package/dist/chunk-52e9mdjv.js +0 -684
  68. package/dist/chunk-55raexh7.js +0 -14358
  69. package/dist/chunk-59pq5122.js +0 -269
  70. package/dist/chunk-5bsj67v1.js +0 -349
  71. package/dist/chunk-5ccdsxgy.js +0 -74
  72. package/dist/chunk-5ekyhb1w.js +0 -422
  73. package/dist/chunk-5gcqdn8x.js +0 -867
  74. package/dist/chunk-5h5kx2jd.js +0 -34
  75. package/dist/chunk-5hf3werb.js +0 -193
  76. package/dist/chunk-5n1jc02d.js +0 -87
  77. package/dist/chunk-5wfxvxm8.js +0 -127
  78. package/dist/chunk-5wjebwmn.js +0 -89
  79. package/dist/chunk-5z28bqne.js +0 -6748
  80. package/dist/chunk-5zwsxpjn.js +0 -671
  81. package/dist/chunk-60phw466.js +0 -29
  82. package/dist/chunk-64c1avct.js +0 -13
  83. package/dist/chunk-64r16v22.js +0 -162
  84. package/dist/chunk-65t1r7zs.js +0 -418
  85. package/dist/chunk-66zry909.js +0 -11
  86. package/dist/chunk-67hxjjgc.js +0 -731
  87. package/dist/chunk-68ffk5qa.js +0 -14
  88. package/dist/chunk-69dr6rrd.js +0 -177
  89. package/dist/chunk-69n11zng.js +0 -436
  90. package/dist/chunk-6dj5t602.js +0 -341
  91. package/dist/chunk-6dngjwkh.js +0 -63
  92. package/dist/chunk-6dp8sz55.js +0 -3561
  93. package/dist/chunk-6hqgg0sv.js +0 -103
  94. package/dist/chunk-6nsd9606.js +0 -790
  95. package/dist/chunk-6p0hbwz3.js +0 -65
  96. package/dist/chunk-6ywdv5vg.js +0 -97
  97. package/dist/chunk-6zc758qw.js +0 -640
  98. package/dist/chunk-7aw745vx.js +0 -40175
  99. package/dist/chunk-7fxaphbq.js +0 -116
  100. package/dist/chunk-7sgtxrsc.js +0 -1059
  101. package/dist/chunk-7wm5s02e.js +0 -216
  102. package/dist/chunk-7xdk4109.js +0 -442
  103. package/dist/chunk-7xyswgjh.js +0 -8
  104. package/dist/chunk-83hfzbx3.js +0 -10
  105. package/dist/chunk-87m69h0v.js +0 -219
  106. package/dist/chunk-8g5pe1gr.js +0 -37
  107. package/dist/chunk-8jbw0fnf.js +0 -167
  108. package/dist/chunk-8jf9se66.js +0 -321
  109. package/dist/chunk-8p65embj.js +0 -875
  110. package/dist/chunk-8qrmaff1.js +0 -2669
  111. package/dist/chunk-8r975mwc.js +0 -93
  112. package/dist/chunk-8yhf030a.js +0 -69
  113. package/dist/chunk-93emz367.js +0 -107
  114. package/dist/chunk-948mn975.js +0 -460
  115. package/dist/chunk-99chkt7r.js +0 -54
  116. package/dist/chunk-9f7c1hzz.js +0 -50
  117. package/dist/chunk-9fk9ps1g.js +0 -178
  118. package/dist/chunk-9rh0k0aq.js +0 -90
  119. package/dist/chunk-9x5zgy22.js +0 -12
  120. package/dist/chunk-a0k2vj5b.js +0 -460
  121. package/dist/chunk-a0m57ssq.js +0 -325
  122. package/dist/chunk-a0nsmmz1.js +0 -133
  123. package/dist/chunk-a25jh1v4.js +0 -105
  124. package/dist/chunk-a4j5ekv0.js +0 -83
  125. package/dist/chunk-a8k3zf58.js +0 -313
  126. package/dist/chunk-ah0zarbq.js +0 -260
  127. package/dist/chunk-ase86y73.js +0 -15
  128. package/dist/chunk-b0kf00ff.js +0 -637
  129. package/dist/chunk-b1kcd3ss.js +0 -27
  130. package/dist/chunk-b8kcqqds.js +0 -93
  131. package/dist/chunk-bg4x9ex0.js +0 -21
  132. package/dist/chunk-bh5zqvyc.js +0 -36
  133. package/dist/chunk-bqrkfekw.js +0 -267
  134. package/dist/chunk-brjd9zmk.js +0 -42
  135. package/dist/chunk-byfawrfx.js +0 -121
  136. package/dist/chunk-c6sjhj89.js +0 -1284
  137. package/dist/chunk-c7e5yv0q.js +0 -212
  138. package/dist/chunk-c7jwbe76.js +0 -29030
  139. package/dist/chunk-cb5v8w7k.js +0 -289
  140. package/dist/chunk-cdef9v7b.js +0 -27
  141. package/dist/chunk-cdz5yb0r.js +0 -57
  142. package/dist/chunk-cgfdkzhb.js +0 -12
  143. package/dist/chunk-cgqw4x5z.js +0 -155
  144. package/dist/chunk-cnsj3vq2.js +0 -35
  145. package/dist/chunk-cqxm7ggc.js +0 -123
  146. package/dist/chunk-cxrktb5g.js +0 -51
  147. package/dist/chunk-d089t7dk.js +0 -312
  148. package/dist/chunk-d1z934cp.js +0 -71
  149. package/dist/chunk-d4mdda98.js +0 -94
  150. package/dist/chunk-d7xw8v91.js +0 -332
  151. package/dist/chunk-dc06c3rw.js +0 -1154
  152. package/dist/chunk-ddsjkqs4.js +0 -39
  153. package/dist/chunk-dfzkwynj.js +0 -5368
  154. package/dist/chunk-dnmp7s85.js +0 -20
  155. package/dist/chunk-dqqwjkv3.js +0 -8583
  156. package/dist/chunk-dt2mr4vf.js +0 -2962
  157. package/dist/chunk-dztm97gg.js +0 -150
  158. package/dist/chunk-e0abab5b.js +0 -445
  159. package/dist/chunk-e0ragz46.js +0 -209386
  160. package/dist/chunk-e9w9zc0g.js +0 -392
  161. package/dist/chunk-ebwskmsr.js +0 -107
  162. package/dist/chunk-efztk52j.js +0 -114
  163. package/dist/chunk-ehd8wacx.js +0 -40
  164. package/dist/chunk-ehtwnxpg.js +0 -1591
  165. package/dist/chunk-eqp1rfft.js +0 -17
  166. package/dist/chunk-etdt1xz3.js +0 -19
  167. package/dist/chunk-eva785x8.js +0 -88
  168. package/dist/chunk-ewadzrm8.js +0 -103
  169. package/dist/chunk-f2ajmcav.js +0 -92
  170. package/dist/chunk-fajg8x36.js +0 -8158
  171. package/dist/chunk-fbv4apne.js +0 -51
  172. package/dist/chunk-fcynwjpm.js +0 -1072
  173. package/dist/chunk-fev86f95.js +0 -1052
  174. package/dist/chunk-feyzykye.js +0 -10
  175. package/dist/chunk-ff85rwvc.js +0 -180
  176. package/dist/chunk-fk6ktvg2.js +0 -275
  177. package/dist/chunk-fqak69ft.js +0 -458
  178. package/dist/chunk-fqwas4jk.js +0 -281
  179. package/dist/chunk-fs35fdpj.js +0 -439
  180. package/dist/chunk-fvr3f9s3.js +0 -55
  181. package/dist/chunk-fyc5fepv.js +0 -10
  182. package/dist/chunk-g2g9cwt9.js +0 -54
  183. package/dist/chunk-g4znz46v.js +0 -2335
  184. package/dist/chunk-g5ts4e6k.js +0 -697
  185. package/dist/chunk-g6een9wr.js +0 -654
  186. package/dist/chunk-g7cmtx8r.js +0 -77
  187. package/dist/chunk-g9f19ttm.js +0 -15
  188. package/dist/chunk-gc7ap41t.js +0 -516
  189. package/dist/chunk-gdwdqewd.js +0 -19
  190. package/dist/chunk-gg14h3n4.js +0 -131
  191. package/dist/chunk-gg55fns0.js +0 -6440
  192. package/dist/chunk-gq7zab4e.js +0 -418
  193. package/dist/chunk-gydw3qy3.js +0 -169
  194. package/dist/chunk-gz1e8y1w.js +0 -33
  195. package/dist/chunk-h19r628d.js +0 -91
  196. package/dist/chunk-h2k8mt3z.js +0 -329
  197. package/dist/chunk-h9n54swm.js +0 -27
  198. package/dist/chunk-hakdhagh.js +0 -16606
  199. package/dist/chunk-hc2chp3g.js +0 -308
  200. package/dist/chunk-hemcv9t7.js +0 -153
  201. package/dist/chunk-hm62ntv3.js +0 -20
  202. package/dist/chunk-hmq09ytj.js +0 -100
  203. package/dist/chunk-hmv4hhqt.js +0 -2718
  204. package/dist/chunk-hwfknpxv.js +0 -39
  205. package/dist/chunk-j5bth84e.js +0 -97
  206. package/dist/chunk-j64ga6ta.js +0 -8035
  207. package/dist/chunk-j6v3w4yf.js +0 -244
  208. package/dist/chunk-jc29d2nm.js +0 -130
  209. package/dist/chunk-jd32zbps.js +0 -15
  210. package/dist/chunk-jd4sx4wh.js +0 -594
  211. package/dist/chunk-jha8n8b9.js +0 -33118
  212. package/dist/chunk-jj71qx7m.js +0 -122
  213. package/dist/chunk-jka9vpak.js +0 -114
  214. package/dist/chunk-jkf6ayv0.js +0 -32
  215. package/dist/chunk-jpz6t2tt.js +0 -61
  216. package/dist/chunk-jqt3sw12.js +0 -9114
  217. package/dist/chunk-jswd1q63.js +0 -101
  218. package/dist/chunk-jtc4aa2y.js +0 -1543
  219. package/dist/chunk-jyx3h86z.js +0 -635
  220. package/dist/chunk-jzthz1bx.js +0 -15
  221. package/dist/chunk-k0p9w03v.js +0 -4957
  222. package/dist/chunk-k6x3s7x5.js +0 -211
  223. package/dist/chunk-k7kmvnnx.js +0 -942
  224. package/dist/chunk-k8vp0atq.js +0 -2331
  225. package/dist/chunk-k9vm6x6z.js +0 -257
  226. package/dist/chunk-kb1edvhs.js +0 -120
  227. package/dist/chunk-kbhbe33q.js +0 -113
  228. package/dist/chunk-kgcgpp7z.js +0 -140
  229. package/dist/chunk-kvywbvqs.js +0 -261
  230. package/dist/chunk-kwekc97v.js +0 -18
  231. package/dist/chunk-kwyk9zp1.js +0 -74
  232. package/dist/chunk-ky1z78ve.js +0 -119
  233. package/dist/chunk-mcws22k3.js +0 -42
  234. package/dist/chunk-mr2z79r3.js +0 -1385
  235. package/dist/chunk-mst9nmns.js +0 -642
  236. package/dist/chunk-mswx2nma.js +0 -103
  237. package/dist/chunk-n1e3fjpz.js +0 -266
  238. package/dist/chunk-n6vjp9yg.js +0 -138
  239. package/dist/chunk-n84tqtvv.js +0 -120
  240. package/dist/chunk-n8ssddbw.js +0 -105
  241. package/dist/chunk-na35whkd.js +0 -227
  242. package/dist/chunk-netzwgv1.js +0 -154
  243. package/dist/chunk-ng7j0yy1.js +0 -100
  244. package/dist/chunk-nmgj86tt.js +0 -24
  245. package/dist/chunk-ns7x6xam.js +0 -22820
  246. package/dist/chunk-p7vkh4wx.js +0 -15
  247. package/dist/chunk-p8na2wwp.js +0 -14
  248. package/dist/chunk-pe3rkfp2.js +0 -74
  249. package/dist/chunk-pf0152j3.js +0 -40
  250. package/dist/chunk-pgtnj1mt.js +0 -705
  251. package/dist/chunk-ppwjyveh.js +0 -8
  252. package/dist/chunk-pq5qp2y4.js +0 -388
  253. package/dist/chunk-pqqxdk5f.js +0 -543
  254. package/dist/chunk-ps49ymvj.js +0 -43
  255. package/dist/chunk-pws8gq7m.js +0 -7422
  256. package/dist/chunk-pwwa7s62.js +0 -11
  257. package/dist/chunk-pyq0fabn.js +0 -860
  258. package/dist/chunk-q0p1m40t.js +0 -79
  259. package/dist/chunk-q0vhv550.js +0 -393
  260. package/dist/chunk-q7r0kt08.js +0 -1809
  261. package/dist/chunk-qajrkk97.js +0 -298
  262. package/dist/chunk-qatfdxvd.js +0 -34
  263. package/dist/chunk-qb6k2afy.js +0 -153
  264. package/dist/chunk-qg2qgx8h.js +0 -266
  265. package/dist/chunk-qkczt8cr.js +0 -24
  266. package/dist/chunk-qnfx3qtx.js +0 -617
  267. package/dist/chunk-qp2qdcda.js +0 -100
  268. package/dist/chunk-qtwgzej9.js +0 -85
  269. package/dist/chunk-r1dh0ymt.js +0 -91
  270. package/dist/chunk-r36xvgvv.js +0 -407
  271. package/dist/chunk-r48he8g3.js +0 -251
  272. package/dist/chunk-r63tqmtk.js +0 -146
  273. package/dist/chunk-rbdd3q5k.js +0 -101
  274. package/dist/chunk-rmbbmd3s.js +0 -68
  275. package/dist/chunk-rn0v1hk8.js +0 -34
  276. package/dist/chunk-rnxctq9p.js +0 -1646
  277. package/dist/chunk-rrs2mchs.js +0 -183
  278. package/dist/chunk-rtrybvnp.js +0 -209
  279. package/dist/chunk-rw2wkn45.js +0 -494
  280. package/dist/chunk-s4kzkdhd.js +0 -847
  281. package/dist/chunk-s7a0zn7b.js +0 -55
  282. package/dist/chunk-s8gy4ky9.js +0 -122
  283. package/dist/chunk-s8kj6ajy.js +0 -32
  284. package/dist/chunk-sag785ad.js +0 -283
  285. package/dist/chunk-scqjyben.js +0 -174
  286. package/dist/chunk-sd36yzx8.js +0 -954
  287. package/dist/chunk-sdtqm0nm.js +0 -374
  288. package/dist/chunk-sg60xg0x.js +0 -52
  289. package/dist/chunk-sgpmpn90.js +0 -35
  290. package/dist/chunk-sh02d2qn.js +0 -38
  291. package/dist/chunk-sz9y6z13.js +0 -61
  292. package/dist/chunk-szj5wvdy.js +0 -28
  293. package/dist/chunk-t29a6zb5.js +0 -45
  294. package/dist/chunk-t2b49hcf.js +0 -87
  295. package/dist/chunk-t2wqdppz.js +0 -445
  296. package/dist/chunk-t4khqff1.js +0 -16
  297. package/dist/chunk-t70t2gne.js +0 -121
  298. package/dist/chunk-t9p85zff.js +0 -24
  299. package/dist/chunk-tkrstmwz.js +0 -94
  300. package/dist/chunk-tnyb4exc.js +0 -74
  301. package/dist/chunk-tpn8jsvw.js +0 -71
  302. package/dist/chunk-tt7x5j1q.js +0 -111
  303. package/dist/chunk-tw1p628z.js +0 -984
  304. package/dist/chunk-twvdafcz.js +0 -528
  305. package/dist/chunk-tzwjafgn.js +0 -24
  306. package/dist/chunk-v140t8ay.js +0 -152
  307. package/dist/chunk-v1kzp02e.js +0 -785
  308. package/dist/chunk-v4t6dyyh.js +0 -9076
  309. package/dist/chunk-v78fj8by.js +0 -145
  310. package/dist/chunk-v8kjswxt.js +0 -61
  311. package/dist/chunk-v9smspw2.js +0 -4301
  312. package/dist/chunk-vcfbjkk9.js +0 -201
  313. package/dist/chunk-ve167rcs.js +0 -148
  314. package/dist/chunk-vf612n57.js +0 -472
  315. package/dist/chunk-vhffyae8.js +0 -895
  316. package/dist/chunk-vkhrrvfq.js +0 -44
  317. package/dist/chunk-vybkmfhf.js +0 -91
  318. package/dist/chunk-vyjeh50y.js +0 -2149
  319. package/dist/chunk-w6m6trzq.js +0 -58
  320. package/dist/chunk-w9b6kngq.js +0 -234
  321. package/dist/chunk-wa8yn2p0.js +0 -2007
  322. package/dist/chunk-wanceff6.js +0 -2840
  323. package/dist/chunk-wcze2nea.js +0 -336
  324. package/dist/chunk-wgk9sxk7.js +0 -329
  325. package/dist/chunk-wnxcgfsd.js +0 -253
  326. package/dist/chunk-wyjerrr6.js +0 -565
  327. package/dist/chunk-wz9brkq5.js +0 -60
  328. package/dist/chunk-x47h283a.js +0 -56
  329. package/dist/chunk-x59j3x9c.js +0 -98
  330. package/dist/chunk-x6r4v44b.js +0 -8
  331. package/dist/chunk-x7fdwq3d.js +0 -33
  332. package/dist/chunk-x8d2ehd7.js +0 -19
  333. package/dist/chunk-xeb6075z.js +0 -3435
  334. package/dist/chunk-xfw2pxwd.js +0 -223
  335. package/dist/chunk-xh06jc72.js +0 -200
  336. package/dist/chunk-xhfmdq1y.js +0 -147
  337. package/dist/chunk-xkwyg1d2.js +0 -195
  338. package/dist/chunk-xv3era3s.js +0 -8
  339. package/dist/chunk-xyapc58m.js +0 -87
  340. package/dist/chunk-xzgnc76g.js +0 -107
  341. package/dist/chunk-y1784krc.js +0 -19
  342. package/dist/chunk-y4ca9kqz.js +0 -3830
  343. package/dist/chunk-y9bhjjdz.js +0 -145
  344. package/dist/chunk-yb3bxv3w.js +0 -30
  345. package/dist/chunk-yddek6xk.js +0 -146
  346. package/dist/chunk-ypaq3d12.js +0 -4265
  347. package/dist/chunk-yq8z040g.js +0 -111
  348. package/dist/chunk-yqs481qq.js +0 -1163
  349. package/dist/chunk-ys9a9c9h.js +0 -105
  350. package/dist/chunk-yyex5gsf.js +0 -269
  351. package/dist/chunk-yzn396hn.js +0 -89
  352. package/dist/chunk-z2dp53wn.js +0 -17
  353. package/dist/chunk-zay4xp4n.js +0 -251
  354. package/dist/chunk-zc8bwy57.js +0 -212
  355. package/dist/chunk-zhx88cfx.js +0 -97
  356. package/dist/chunk-zkh6f4ct.js +0 -385
  357. package/dist/chunk-zq56gcca.js +0 -206
  358. package/dist/chunk-zrkefd22.js +0 -490
  359. package/dist/chunk-zs5p0yq1.js +0 -1030
  360. package/dist/chunk-zxh62ved.js +0 -31
  361. package/dist/chunk-zzm33q8x.js +0 -8
  362. package/dist/cli.js +0 -220
@@ -1,654 +0,0 @@
1
- // @bun
2
- import {
3
- ConfigurableShortcutHint,
4
- MAX_TRANSCRIPT_READ_BYTES,
5
- TextInput,
6
- asSystemPrompt,
7
- extractTeammateTranscriptsFromTasks,
8
- getLastAssistantMessage,
9
- getTranscriptPath,
10
- init_ConfigurableShortcutHint,
11
- init_TextInput,
12
- init_claude,
13
- init_errors,
14
- init_messages1 as init_messages,
15
- init_sessionStorage,
16
- init_systemPromptType,
17
- init_useTerminalSize,
18
- loadAllSubagentTranscriptsFromDisk,
19
- normalizeMessagesForAPI,
20
- queryHaiku,
21
- startsWithApiErrorPrefix
22
- } from "./chunk-e0ragz46.js";
23
- import {
24
- init_useKeybinding
25
- } from "./chunk-68ffk5qa.js";
26
- import {
27
- init_browser,
28
- openBrowser
29
- } from "./chunk-v8kjswxt.js";
30
- import {
31
- getAuthHeaders,
32
- getUserAgent,
33
- init_firstPartyEventLogger,
34
- init_http,
35
- logEventTo1P
36
- } from "./chunk-2b0e32an.js";
37
- import {
38
- env,
39
- init_env
40
- } from "./chunk-5ekyhb1w.js";
41
- import {
42
- Byline,
43
- Dialog,
44
- KeyboardShortcutHint,
45
- ThemedBox_default,
46
- ThemedText,
47
- init_src,
48
- useKeybinding,
49
- useTerminalSize,
50
- use_input_default
51
- } from "./chunk-c7jwbe76.js";
52
- import {
53
- require_jsx_dev_runtime,
54
- require_react
55
- } from "./chunk-7sgtxrsc.js";
56
- import {
57
- init_analytics,
58
- logEvent
59
- } from "./chunk-x8d2ehd7.js";
60
- import {
61
- getGitState,
62
- getIsGit,
63
- init_git
64
- } from "./chunk-3vy1jt9p.js";
65
- import {
66
- getInMemoryErrors,
67
- init_debug,
68
- init_log,
69
- init_privacyLevel,
70
- init_slowOperations,
71
- isEssentialTrafficOnly,
72
- jsonStringify,
73
- logError,
74
- logForDebugging
75
- } from "./chunk-gg55fns0.js";
76
- import {
77
- getLastAPIRequest,
78
- init_state
79
- } from "./chunk-k8vp0atq.js";
80
- import {
81
- axios_default,
82
- init_axios
83
- } from "./chunk-55raexh7.js";
84
- import {
85
- __esm,
86
- __toESM
87
- } from "./chunk-qp2qdcda.js";
88
-
89
- // src/components/Feedback.tsx
90
- import { readFile, stat } from "fs/promises";
91
- function redactSensitiveInfo(text) {
92
- let redacted = text;
93
- redacted = redacted.replace(/"(sk-ant[^\s"']{24,})"/g, '"[REDACTED_API_KEY]"');
94
- redacted = redacted.replace(/(?<![A-Za-z0-9"'])(sk-ant-?[A-Za-z0-9_-]{10,})(?![A-Za-z0-9"'])/g, "[REDACTED_API_KEY]");
95
- redacted = redacted.replace(/AWS key: "(AWS[A-Z0-9]{20,})"/g, 'AWS key: "[REDACTED_AWS_KEY]"');
96
- redacted = redacted.replace(/(AKIA[A-Z0-9]{16})/g, "[REDACTED_AWS_KEY]");
97
- redacted = redacted.replace(/(?<![A-Za-z0-9])(AIza[A-Za-z0-9_-]{35})(?![A-Za-z0-9])/g, "[REDACTED_GCP_KEY]");
98
- redacted = redacted.replace(/(?<![A-Za-z0-9])([a-z0-9-]+@[a-z0-9-]+\.iam\.gserviceaccount\.com)(?![A-Za-z0-9])/g, "[REDACTED_GCP_SERVICE_ACCOUNT]");
99
- redacted = redacted.replace(/(["']?x-api-key["']?\s*[:=]\s*["']?)[^"',\s)}\]]+/gi, "$1[REDACTED_API_KEY]");
100
- redacted = redacted.replace(/(["']?authorization["']?\s*[:=]\s*["']?(bearer\s+)?)[^"',\s)}\]]+/gi, "$1[REDACTED_TOKEN]");
101
- redacted = redacted.replace(/(AWS[_-][A-Za-z0-9_]+\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi, "$1[REDACTED_AWS_VALUE]");
102
- redacted = redacted.replace(/(GOOGLE[_-][A-Za-z0-9_]+\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi, "$1[REDACTED_GCP_VALUE]");
103
- redacted = redacted.replace(/((API[-_]?KEY|TOKEN|SECRET|PASSWORD)\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi, "$1[REDACTED]");
104
- return redacted;
105
- }
106
- function getSanitizedErrorLogs() {
107
- return getInMemoryErrors().map((errorInfo) => {
108
- const errorCopy = { ...errorInfo };
109
- if (errorCopy && typeof errorCopy.error === "string") {
110
- errorCopy.error = redactSensitiveInfo(errorCopy.error);
111
- }
112
- return errorCopy;
113
- });
114
- }
115
- async function loadRawTranscriptJsonl() {
116
- try {
117
- const transcriptPath = getTranscriptPath();
118
- const { size } = await stat(transcriptPath);
119
- if (size > MAX_TRANSCRIPT_READ_BYTES) {
120
- logForDebugging(`Skipping raw transcript read: file too large (${size} bytes)`, { level: "warn" });
121
- return null;
122
- }
123
- return await readFile(transcriptPath, "utf-8");
124
- } catch {
125
- return null;
126
- }
127
- }
128
- function Feedback({
129
- abortSignal,
130
- messages,
131
- initialDescription,
132
- onDone,
133
- backgroundTasks = {}
134
- }) {
135
- const [step, setStep] = import_react.useState("userInput");
136
- const [cursorOffset, setCursorOffset] = import_react.useState(0);
137
- const [description, setDescription] = import_react.useState(initialDescription ?? "");
138
- const [feedbackId, setFeedbackId] = import_react.useState(null);
139
- const [error, setError] = import_react.useState(null);
140
- const [envInfo, setEnvInfo] = import_react.useState({ isGit: false, gitState: null });
141
- const [title, setTitle] = import_react.useState(null);
142
- const textInputColumns = useTerminalSize().columns - 4;
143
- import_react.useEffect(() => {
144
- async function loadEnvInfo() {
145
- const isGit = await getIsGit();
146
- let gitState = null;
147
- if (isGit) {
148
- gitState = await getGitState();
149
- }
150
- setEnvInfo({ isGit, gitState });
151
- }
152
- loadEnvInfo();
153
- }, []);
154
- const submitReport = import_react.useCallback(async () => {
155
- setStep("submitting");
156
- setError(null);
157
- setFeedbackId(null);
158
- const sanitizedErrors = getSanitizedErrorLogs();
159
- const lastAssistantMessage = getLastAssistantMessage(messages);
160
- const lastAssistantMessageId = lastAssistantMessage?.requestId ?? null;
161
- const [diskTranscripts, rawTranscriptJsonl] = await Promise.all([
162
- loadAllSubagentTranscriptsFromDisk(),
163
- loadRawTranscriptJsonl()
164
- ]);
165
- const teammateTranscripts = extractTeammateTranscriptsFromTasks(backgroundTasks);
166
- const subagentTranscripts = { ...diskTranscripts, ...teammateTranscripts };
167
- const reportData = {
168
- latestAssistantMessageId: lastAssistantMessageId,
169
- message_count: messages.length,
170
- datetime: new Date().toISOString(),
171
- description,
172
- platform: env.platform,
173
- gitRepo: envInfo.isGit,
174
- terminal: env.terminal,
175
- version: "0.0.25",
176
- transcript: normalizeMessagesForAPI(messages),
177
- errors: sanitizedErrors,
178
- lastApiRequest: getLastAPIRequest(),
179
- ...Object.keys(subagentTranscripts).length > 0 && {
180
- subagentTranscripts
181
- },
182
- ...rawTranscriptJsonl && { rawTranscriptJsonl }
183
- };
184
- const [result, t] = await Promise.all([
185
- submitFeedback(reportData, abortSignal),
186
- generateTitle(description, abortSignal)
187
- ]);
188
- setTitle(t);
189
- if (result.success) {
190
- if (result.feedbackId) {
191
- setFeedbackId(result.feedbackId);
192
- logEvent("tengu_bug_report_submitted", {
193
- feedback_id: result.feedbackId,
194
- last_assistant_message_id: lastAssistantMessageId
195
- });
196
- logEventTo1P("tengu_bug_report_description", {
197
- feedback_id: result.feedbackId,
198
- description: redactSensitiveInfo(description)
199
- });
200
- }
201
- setStep("done");
202
- } else {
203
- if (result.isZdrOrg) {
204
- setError("Feedback collection is not available for organizations with custom data retention policies.");
205
- } else {
206
- setError("Could not submit feedback. Please try again later.");
207
- }
208
- setStep("userInput");
209
- }
210
- }, [description, envInfo.isGit, messages]);
211
- const handleCancel = import_react.useCallback(() => {
212
- if (step === "done") {
213
- if (error) {
214
- onDone("Error submitting feedback / bug report", {
215
- display: "system"
216
- });
217
- } else {
218
- onDone("Feedback / bug report submitted", { display: "system" });
219
- }
220
- return;
221
- }
222
- onDone("Feedback / bug report cancelled", { display: "system" });
223
- }, [step, error, onDone]);
224
- useKeybinding("confirm:no", handleCancel, {
225
- context: "Settings",
226
- isActive: step === "userInput"
227
- });
228
- use_input_default((input, key) => {
229
- if (step === "done") {
230
- if (key.return && title) {
231
- const issueUrl = createGitHubIssueUrl(feedbackId ?? "", title, description, getSanitizedErrorLogs());
232
- openBrowser(issueUrl);
233
- }
234
- if (error) {
235
- onDone("Error submitting feedback / bug report", {
236
- display: "system"
237
- });
238
- } else {
239
- onDone("Feedback / bug report submitted", { display: "system" });
240
- }
241
- return;
242
- }
243
- if (error && step !== "userInput") {
244
- onDone("Error submitting feedback / bug report", {
245
- display: "system"
246
- });
247
- return;
248
- }
249
- if (step === "consent" && (key.return || input === " ")) {
250
- submitReport();
251
- }
252
- });
253
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Dialog, {
254
- title: "Submit Feedback / Bug Report",
255
- onCancel: handleCancel,
256
- isCancelActive: step !== "userInput",
257
- inputGuide: (exitState) => exitState.pending ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
258
- children: [
259
- "Press ",
260
- exitState.keyName,
261
- " again to exit"
262
- ]
263
- }, undefined, true, undefined, this) : step === "userInput" ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Byline, {
264
- children: [
265
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
266
- shortcut: "Enter",
267
- action: "continue"
268
- }, undefined, false, undefined, this),
269
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
270
- action: "confirm:no",
271
- context: "Confirmation",
272
- fallback: "Esc",
273
- description: "cancel"
274
- }, undefined, false, undefined, this)
275
- ]
276
- }, undefined, true, undefined, this) : step === "consent" ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Byline, {
277
- children: [
278
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(KeyboardShortcutHint, {
279
- shortcut: "Enter",
280
- action: "submit"
281
- }, undefined, false, undefined, this),
282
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ConfigurableShortcutHint, {
283
- action: "confirm:no",
284
- context: "Confirmation",
285
- fallback: "Esc",
286
- description: "cancel"
287
- }, undefined, false, undefined, this)
288
- ]
289
- }, undefined, true, undefined, this) : null,
290
- children: [
291
- step === "userInput" && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
292
- flexDirection: "column",
293
- gap: 1,
294
- children: [
295
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
296
- children: "Describe the issue below:"
297
- }, undefined, false, undefined, this),
298
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(TextInput, {
299
- value: description,
300
- onChange: (value) => {
301
- setDescription(value);
302
- if (error) {
303
- setError(null);
304
- }
305
- },
306
- columns: textInputColumns,
307
- onSubmit: () => setStep("consent"),
308
- onExitMessage: () => onDone("Feedback cancelled", { display: "system" }),
309
- cursorOffset,
310
- onChangeCursorOffset: setCursorOffset,
311
- showCursor: true
312
- }, undefined, false, undefined, this),
313
- error && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
314
- flexDirection: "column",
315
- gap: 1,
316
- children: [
317
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
318
- color: "error",
319
- children: error
320
- }, undefined, false, undefined, this),
321
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
322
- dimColor: true,
323
- children: "Edit and press Enter to retry, or Esc to cancel"
324
- }, undefined, false, undefined, this)
325
- ]
326
- }, undefined, true, undefined, this)
327
- ]
328
- }, undefined, true, undefined, this),
329
- step === "consent" && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
330
- flexDirection: "column",
331
- children: [
332
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
333
- children: "This report will include:"
334
- }, undefined, false, undefined, this),
335
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
336
- marginLeft: 2,
337
- flexDirection: "column",
338
- children: [
339
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
340
- children: [
341
- "- Your feedback / bug description:",
342
- " ",
343
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
344
- dimColor: true,
345
- children: description
346
- }, undefined, false, undefined, this)
347
- ]
348
- }, undefined, true, undefined, this),
349
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
350
- children: [
351
- "- Environment info:",
352
- " ",
353
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
354
- dimColor: true,
355
- children: [
356
- env.platform,
357
- ", ",
358
- env.terminal,
359
- ", v",
360
- "0.0.25"
361
- ]
362
- }, undefined, true, undefined, this)
363
- ]
364
- }, undefined, true, undefined, this),
365
- envInfo.gitState && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
366
- children: [
367
- "- Git repo metadata:",
368
- " ",
369
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
370
- dimColor: true,
371
- children: [
372
- envInfo.gitState.branchName,
373
- envInfo.gitState.commitHash ? `, ${envInfo.gitState.commitHash.slice(0, 7)}` : "",
374
- envInfo.gitState.remoteUrl ? ` @ ${envInfo.gitState.remoteUrl}` : "",
375
- !envInfo.gitState.isHeadOnRemote && ", not synced",
376
- !envInfo.gitState.isClean && ", has local changes"
377
- ]
378
- }, undefined, true, undefined, this)
379
- ]
380
- }, undefined, true, undefined, this),
381
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
382
- children: "- Current session transcript"
383
- }, undefined, false, undefined, this)
384
- ]
385
- }, undefined, true, undefined, this),
386
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
387
- marginTop: 1,
388
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
389
- wrap: "wrap",
390
- dimColor: true,
391
- children: [
392
- "We will use your feedback to debug related issues or to improve",
393
- " ",
394
- "Claude Code's functionality (eg. to reduce the risk of bugs occurring in the future)."
395
- ]
396
- }, undefined, true, undefined, this)
397
- }, undefined, false, undefined, this),
398
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
399
- marginTop: 1,
400
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
401
- children: [
402
- "Press ",
403
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
404
- bold: true,
405
- children: "Enter"
406
- }, undefined, false, undefined, this),
407
- " to confirm and submit."
408
- ]
409
- }, undefined, true, undefined, this)
410
- }, undefined, false, undefined, this)
411
- ]
412
- }, undefined, true, undefined, this),
413
- step === "submitting" && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
414
- flexDirection: "row",
415
- gap: 1,
416
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
417
- children: "Submitting report\u2026"
418
- }, undefined, false, undefined, this)
419
- }, undefined, false, undefined, this),
420
- step === "done" && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
421
- flexDirection: "column",
422
- children: [
423
- error ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
424
- color: "error",
425
- children: error
426
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
427
- color: "success",
428
- children: "Thank you for your report!"
429
- }, undefined, false, undefined, this),
430
- feedbackId && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
431
- dimColor: true,
432
- children: [
433
- "Feedback ID: ",
434
- feedbackId
435
- ]
436
- }, undefined, true, undefined, this),
437
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
438
- marginTop: 1,
439
- children: [
440
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
441
- children: "Press "
442
- }, undefined, false, undefined, this),
443
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
444
- bold: true,
445
- children: "Enter "
446
- }, undefined, false, undefined, this),
447
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
448
- children: "to open your browser and draft a GitHub issue, or any other key to close."
449
- }, undefined, false, undefined, this)
450
- ]
451
- }, undefined, true, undefined, this)
452
- ]
453
- }, undefined, true, undefined, this)
454
- ]
455
- }, undefined, true, undefined, this);
456
- }
457
- function createGitHubIssueUrl(feedbackId, title, description, errors) {
458
- const sanitizedTitle = redactSensitiveInfo(title);
459
- const sanitizedDescription = redactSensitiveInfo(description);
460
- const bodyPrefix = `**Bug Description**
461
- ${sanitizedDescription}
462
-
463
- ` + `**Environment Info**
464
- ` + `- Platform: ${env.platform}
465
- ` + `- Terminal: ${env.terminal}
466
- ` + `- Version: ${"0.0.25"}
467
- ` + `- Feedback ID: ${feedbackId}
468
- ` + `
469
- **Errors**
470
- \`\`\`json
471
- `;
472
- const errorSuffix = `
473
- \`\`\`
474
- `;
475
- const errorsJson = jsonStringify(errors);
476
- const baseUrl = `${GITHUB_ISSUES_REPO_URL}/new?title=${encodeURIComponent(sanitizedTitle)}&labels=user-reported,bug&body=`;
477
- const truncationNote = `
478
- **Note:** Content was truncated.
479
- `;
480
- const encodedPrefix = encodeURIComponent(bodyPrefix);
481
- const encodedSuffix = encodeURIComponent(errorSuffix);
482
- const encodedNote = encodeURIComponent(truncationNote);
483
- const encodedErrors = encodeURIComponent(errorsJson);
484
- const spaceForErrors = GITHUB_URL_LIMIT - baseUrl.length - encodedPrefix.length - encodedSuffix.length - encodedNote.length;
485
- if (spaceForErrors <= 0) {
486
- const ellipsis2 = encodeURIComponent("\u2026");
487
- const buffer2 = 50;
488
- const maxEncodedLength = GITHUB_URL_LIMIT - baseUrl.length - ellipsis2.length - encodedNote.length - buffer2;
489
- const fullBody = bodyPrefix + errorsJson + errorSuffix;
490
- let encodedFullBody = encodeURIComponent(fullBody);
491
- if (encodedFullBody.length > maxEncodedLength) {
492
- encodedFullBody = encodedFullBody.slice(0, maxEncodedLength);
493
- const lastPercent2 = encodedFullBody.lastIndexOf("%");
494
- if (lastPercent2 >= encodedFullBody.length - 2) {
495
- encodedFullBody = encodedFullBody.slice(0, lastPercent2);
496
- }
497
- }
498
- return baseUrl + encodedFullBody + ellipsis2 + encodedNote;
499
- }
500
- if (encodedErrors.length <= spaceForErrors) {
501
- return baseUrl + encodedPrefix + encodedErrors + encodedSuffix;
502
- }
503
- const ellipsis = encodeURIComponent("\u2026");
504
- const buffer = 50;
505
- let truncatedEncodedErrors = encodedErrors.slice(0, spaceForErrors - ellipsis.length - buffer);
506
- const lastPercent = truncatedEncodedErrors.lastIndexOf("%");
507
- if (lastPercent >= truncatedEncodedErrors.length - 2) {
508
- truncatedEncodedErrors = truncatedEncodedErrors.slice(0, lastPercent);
509
- }
510
- return baseUrl + encodedPrefix + truncatedEncodedErrors + ellipsis + encodedSuffix + encodedNote;
511
- }
512
- async function generateTitle(description, abortSignal) {
513
- try {
514
- const response = await queryHaiku({
515
- systemPrompt: asSystemPrompt([
516
- "Generate a concise, technical issue title (max 80 chars) for a public GitHub issue based on this bug report for Claude Code.",
517
- "Claude Code is an agentic coding CLI based on the Anthropic API.",
518
- "The title should:",
519
- "- Include the type of issue [Bug] or [Feature Request] as the first thing in the title",
520
- "- Be concise, specific and descriptive of the actual problem",
521
- "- Use technical terminology appropriate for a software issue",
522
- '- For error messages, extract the key error (e.g., "Missing Tool Result Block" rather than the full message)',
523
- "- Be direct and clear for developers to understand the problem",
524
- '- If you cannot determine a clear issue, use "Bug Report: [brief description]"',
525
- "- Any LLM API errors are from the Anthropic API, not from any other model provider",
526
- "Your response will be directly used as the title of the Github issue, and as such should not contain any other commentary or explaination",
527
- 'Examples of good titles include: "[Bug] Auto-Compact triggers to soon", "[Bug] Anthropic API Error: Missing Tool Result Block", "[Bug] Error: Invalid Model Name for Opus"'
528
- ]),
529
- userPrompt: description,
530
- signal: abortSignal,
531
- options: {
532
- hasAppendSystemPrompt: false,
533
- toolChoice: undefined,
534
- isNonInteractiveSession: false,
535
- agents: [],
536
- querySource: "feedback",
537
- mcpTools: []
538
- }
539
- });
540
- const title = response.message.content[0]?.type === "text" ? response.message.content[0].text : "Bug Report";
541
- if (startsWithApiErrorPrefix(title)) {
542
- return createFallbackTitle(description);
543
- }
544
- return title;
545
- } catch (error) {
546
- logError(error);
547
- return createFallbackTitle(description);
548
- }
549
- }
550
- function createFallbackTitle(description) {
551
- const firstLine = description.split(`
552
- `)[0] || "";
553
- if (firstLine.length <= 60 && firstLine.length > 5) {
554
- return firstLine;
555
- }
556
- let truncated = firstLine.slice(0, 60);
557
- if (firstLine.length > 60) {
558
- const lastSpace = truncated.lastIndexOf(" ");
559
- if (lastSpace > 30) {
560
- truncated = truncated.slice(0, lastSpace);
561
- }
562
- truncated += "...";
563
- }
564
- return truncated.length < 10 ? "Bug Report" : truncated;
565
- }
566
- function sanitizeAndLogError(err) {
567
- if (err instanceof Error) {
568
- const safeError = new Error(redactSensitiveInfo(err.message));
569
- if (err.stack) {
570
- safeError.stack = redactSensitiveInfo(err.stack);
571
- }
572
- logError(safeError);
573
- } else {
574
- const errorString = redactSensitiveInfo(String(err));
575
- logError(new Error(errorString));
576
- }
577
- }
578
- async function submitFeedback(data, signal) {
579
- if (isEssentialTrafficOnly()) {
580
- return { success: false };
581
- }
582
- try {
583
- const authResult = getAuthHeaders();
584
- if (authResult.error) {
585
- return { success: false };
586
- }
587
- const headers = {
588
- "Content-Type": "application/json",
589
- "User-Agent": getUserAgent(),
590
- ...authResult.headers
591
- };
592
- const response = await axios_default.post("https://api.anthropic.com/api/claude_cli_feedback", {
593
- content: jsonStringify(data)
594
- }, {
595
- headers,
596
- timeout: 30000,
597
- signal
598
- });
599
- if (response.status === 200) {
600
- const result = response.data;
601
- if (result?.feedback_id) {
602
- return { success: true, feedbackId: result.feedback_id };
603
- }
604
- sanitizeAndLogError(new Error("Failed to submit feedback: request did not return feedback_id"));
605
- return { success: false };
606
- }
607
- sanitizeAndLogError(new Error("Failed to submit feedback:" + response.status));
608
- return { success: false };
609
- } catch (err) {
610
- if (axios_default.isCancel(err)) {
611
- return { success: false };
612
- }
613
- if (axios_default.isAxiosError(err) && err.response?.status === 403) {
614
- const errorData = err.response.data;
615
- if (errorData?.error?.type === "permission_error" && errorData?.error?.message?.includes("Custom data retention settings")) {
616
- sanitizeAndLogError(new Error("Cannot submit feedback because custom data retention settings are enabled"));
617
- return { success: false, isZdrOrg: true };
618
- }
619
- }
620
- sanitizeAndLogError(err);
621
- return { success: false };
622
- }
623
- }
624
- var import_react, jsx_dev_runtime, GITHUB_URL_LIMIT = 7250, GITHUB_ISSUES_REPO_URL;
625
- var init_Feedback = __esm(() => {
626
- init_axios();
627
- init_state();
628
- init_firstPartyEventLogger();
629
- init_analytics();
630
- init_messages();
631
- init_useTerminalSize();
632
- init_src();
633
- init_useKeybinding();
634
- init_claude();
635
- init_errors();
636
- init_browser();
637
- init_debug();
638
- init_env();
639
- init_git();
640
- init_http();
641
- init_log();
642
- init_privacyLevel();
643
- init_sessionStorage();
644
- init_slowOperations();
645
- init_systemPromptType();
646
- init_ConfigurableShortcutHint();
647
- init_src();
648
- init_TextInput();
649
- import_react = __toESM(require_react(), 1);
650
- jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
651
- GITHUB_ISSUES_REPO_URL = process.env.USER_TYPE === "ant" ? "https://github.com/anthropics/claude-cli-internal/issues" : "https://github.com/anthropics/claude-code/issues";
652
- });
653
-
654
- export { redactSensitiveInfo, Feedback, init_Feedback };