@caspian2026/agent-sdk 0.0.24 → 0.0.26

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 +196 -47
  3. package/dist/sdk/query.cjs +2 -362
  4. package/dist/sdk/query.js +2 -367
  5. package/package.json +4 -6
  6. package/dist/chunk-05kvhzd7.js +0 -3561
  7. package/dist/chunk-07069jq1.js +0 -30
  8. package/dist/chunk-0731m51q.js +0 -8
  9. package/dist/chunk-08bspa4b.js +0 -673
  10. package/dist/chunk-0brkf8q8.js +0 -89
  11. package/dist/chunk-0n843xh7.js +0 -261
  12. package/dist/chunk-0nbp5jwx.js +0 -8583
  13. package/dist/chunk-0nj16az9.js +0 -169
  14. package/dist/chunk-0paqc2yw.js +0 -15
  15. package/dist/chunk-0q6b50ps.js +0 -111
  16. package/dist/chunk-0r5bb9j4.js +0 -477
  17. package/dist/chunk-0rpz1wgn.js +0 -1030
  18. package/dist/chunk-0t81d427.js +0 -41
  19. package/dist/chunk-0vaw02wq.js +0 -24
  20. package/dist/chunk-0vkfrmqm.js +0 -690
  21. package/dist/chunk-0vp3wfab.js +0 -12
  22. package/dist/chunk-0vr10742.js +0 -1809
  23. package/dist/chunk-0xjaqda8.js +0 -1124
  24. package/dist/chunk-13ehyphg.js +0 -223
  25. package/dist/chunk-15jsw9bb.js +0 -349
  26. package/dist/chunk-16m7eyyw.js +0 -1385
  27. package/dist/chunk-1ae3nt9j.js +0 -31
  28. package/dist/chunk-1gq4r3v1.js +0 -308
  29. package/dist/chunk-1gx78081.js +0 -66
  30. package/dist/chunk-1h2famwb.js +0 -49
  31. package/dist/chunk-1n546sfg.js +0 -200
  32. package/dist/chunk-1qg06d60.js +0 -494
  33. package/dist/chunk-1t0rqstn.js +0 -146
  34. package/dist/chunk-1z8p2eqd.js +0 -40
  35. package/dist/chunk-1zjh9cc5.js +0 -266
  36. package/dist/chunk-20ahkkrb.js +0 -132
  37. package/dist/chunk-21pbfch8.js +0 -105
  38. package/dist/chunk-26wtxbdc.js +0 -13870
  39. package/dist/chunk-2fwze72g.js +0 -24
  40. package/dist/chunk-2gcbr1c7.js +0 -107
  41. package/dist/chunk-2grc1yr8.js +0 -654
  42. package/dist/chunk-2gzv8nrw.js +0 -205
  43. package/dist/chunk-2r212cvt.js +0 -253
  44. package/dist/chunk-2s74bt6e.js +0 -317
  45. package/dist/chunk-2v385w7r.js +0 -7422
  46. package/dist/chunk-2wtkvpp2.js +0 -167
  47. package/dist/chunk-31rsspfr.js +0 -418
  48. package/dist/chunk-3c25bcsw.js +0 -17
  49. package/dist/chunk-3jm08aaw.js +0 -91
  50. package/dist/chunk-3mgywd32.js +0 -8
  51. package/dist/chunk-3nk79af8.js +0 -8
  52. package/dist/chunk-3v4sk2py.js +0 -101
  53. package/dist/chunk-3vwft0eh.js +0 -349
  54. package/dist/chunk-3vy1jt9p.js +0 -1010
  55. package/dist/chunk-3wvqzq9w.js +0 -92
  56. package/dist/chunk-3wvv2s8d.js +0 -336
  57. package/dist/chunk-4060b3s2.js +0 -108
  58. package/dist/chunk-434e0vh4.js +0 -275
  59. package/dist/chunk-46dm23zs.js +0 -344
  60. package/dist/chunk-4bh4qs70.js +0 -209
  61. package/dist/chunk-4cxzbqws.js +0 -94
  62. package/dist/chunk-4jm600zv.js +0 -13
  63. package/dist/chunk-4k9d7gxv.js +0 -118
  64. package/dist/chunk-4nc3t6ms.js +0 -396
  65. package/dist/chunk-4pbx3g7s.js +0 -26
  66. package/dist/chunk-4qhh8bpa.js +0 -54
  67. package/dist/chunk-4v63px9y.js +0 -133
  68. package/dist/chunk-4xnnzt3j.js +0 -74
  69. package/dist/chunk-4zchh01h.js +0 -201
  70. package/dist/chunk-5216fha8.js +0 -1163
  71. package/dist/chunk-55raexh7.js +0 -14358
  72. package/dist/chunk-5bffhf64.js +0 -81
  73. package/dist/chunk-5ccdsxgy.js +0 -74
  74. package/dist/chunk-5ddh2hyn.js +0 -91
  75. package/dist/chunk-5e6ncq5j.js +0 -61
  76. package/dist/chunk-5ekyhb1w.js +0 -422
  77. package/dist/chunk-5fy4r8rv.js +0 -52
  78. package/dist/chunk-5h5kx2jd.js +0 -34
  79. package/dist/chunk-5mbgdvyz.js +0 -847
  80. package/dist/chunk-5n1jc02d.js +0 -87
  81. package/dist/chunk-5pysjah8.js +0 -1543
  82. package/dist/chunk-5ssfz438.js +0 -323
  83. package/dist/chunk-5z28bqne.js +0 -6748
  84. package/dist/chunk-603y0mmg.js +0 -50
  85. package/dist/chunk-62v5kkff.js +0 -90
  86. package/dist/chunk-64c1avct.js +0 -13
  87. package/dist/chunk-64r16v22.js +0 -162
  88. package/dist/chunk-64smdx4a.js +0 -418
  89. package/dist/chunk-66zry909.js +0 -11
  90. package/dist/chunk-68ffk5qa.js +0 -14
  91. package/dist/chunk-69n11zng.js +0 -436
  92. package/dist/chunk-6dj5t602.js +0 -341
  93. package/dist/chunk-6dngjwkh.js +0 -63
  94. package/dist/chunk-6nsd9606.js +0 -790
  95. package/dist/chunk-6pkh8frk.js +0 -253
  96. package/dist/chunk-6qcmt5eb.js +0 -251
  97. package/dist/chunk-6ww7451s.js +0 -60
  98. package/dist/chunk-6xgb0kqz.js +0 -90
  99. package/dist/chunk-72ys9m07.js +0 -121
  100. package/dist/chunk-741sgvtx.js +0 -121
  101. package/dist/chunk-7aw745vx.js +0 -40175
  102. package/dist/chunk-7c8b8cfb.js +0 -219
  103. package/dist/chunk-7mwt4e1z.js +0 -234
  104. package/dist/chunk-7sgtxrsc.js +0 -1059
  105. package/dist/chunk-7wm5s02e.js +0 -216
  106. package/dist/chunk-7xyswgjh.js +0 -8
  107. package/dist/chunk-80a197ez.js +0 -1438
  108. package/dist/chunk-83hfzbx3.js +0 -10
  109. package/dist/chunk-8akrsgad.js +0 -55
  110. package/dist/chunk-8g5pe1gr.js +0 -37
  111. package/dist/chunk-8s07t4k7.js +0 -40
  112. package/dist/chunk-8yhf030a.js +0 -69
  113. package/dist/chunk-928tzaa8.js +0 -107
  114. package/dist/chunk-949pjzj9.js +0 -266
  115. package/dist/chunk-9aycd4z9.js +0 -490
  116. package/dist/chunk-9bzqvsz5.js +0 -211
  117. package/dist/chunk-9q3xfy27.js +0 -460
  118. package/dist/chunk-9vzg1360.js +0 -153
  119. package/dist/chunk-9wbh8n1y.js +0 -63
  120. package/dist/chunk-9x5zgy22.js +0 -12
  121. package/dist/chunk-9zdj4ypz.js +0 -206
  122. package/dist/chunk-a0bvcgyd.js +0 -127
  123. package/dist/chunk-a4m3yr2q.js +0 -117
  124. package/dist/chunk-a8jd4gee.js +0 -227
  125. package/dist/chunk-ase86y73.js +0 -15
  126. package/dist/chunk-atfzpm6r.js +0 -325
  127. package/dist/chunk-awqsddp2.js +0 -338
  128. package/dist/chunk-awrgzpk6.js +0 -29
  129. package/dist/chunk-b0kf00ff.js +0 -637
  130. package/dist/chunk-b1kcd3ss.js +0 -27
  131. package/dist/chunk-b4hy21c4.js +0 -140
  132. package/dist/chunk-b9mkm8mg.js +0 -111
  133. package/dist/chunk-bdjx14rd.js +0 -594
  134. package/dist/chunk-bfb41q9h.js +0 -295
  135. package/dist/chunk-bg4x9ex0.js +0 -21
  136. package/dist/chunk-bh5zqvyc.js +0 -36
  137. package/dist/chunk-bn0zv2y2.js +0 -1154
  138. package/dist/chunk-bn7t681c.js +0 -2669
  139. package/dist/chunk-br4wgffc.js +0 -393
  140. package/dist/chunk-brjd9zmk.js +0 -42
  141. package/dist/chunk-byfawrfx.js +0 -121
  142. package/dist/chunk-c6sjhj89.js +0 -1284
  143. package/dist/chunk-c7jwbe76.js +0 -29030
  144. package/dist/chunk-cdef9v7b.js +0 -27
  145. package/dist/chunk-cdz5yb0r.js +0 -57
  146. package/dist/chunk-cevq1787.js +0 -2718
  147. package/dist/chunk-cgfdkzhb.js +0 -12
  148. package/dist/chunk-cgqw4x5z.js +0 -155
  149. package/dist/chunk-cmmmc8e0.js +0 -212
  150. package/dist/chunk-cnsj3vq2.js +0 -35
  151. package/dist/chunk-cxrktb5g.js +0 -51
  152. package/dist/chunk-cyhrb0bk.js +0 -251
  153. package/dist/chunk-d23rmn8r.js +0 -62
  154. package/dist/chunk-d4mdda98.js +0 -94
  155. package/dist/chunk-dcwp94cj.js +0 -152
  156. package/dist/chunk-ddsjkqs4.js +0 -39
  157. package/dist/chunk-ddv56j39.js +0 -148
  158. package/dist/chunk-dfq6pbq7.js +0 -5822
  159. package/dist/chunk-dfzkwynj.js +0 -5368
  160. package/dist/chunk-dkgkd8b7.js +0 -516
  161. package/dist/chunk-dpnmf0pq.js +0 -312
  162. package/dist/chunk-dygx7vcc.js +0 -226
  163. package/dist/chunk-e0abab5b.js +0 -445
  164. package/dist/chunk-e5qhvhjy.js +0 -168
  165. package/dist/chunk-e60y6r1n.js +0 -20
  166. package/dist/chunk-e68kgvcq.js +0 -79
  167. package/dist/chunk-e9w9zc0g.js +0 -392
  168. package/dist/chunk-ecj9w6tm.js +0 -558
  169. package/dist/chunk-ehtwnxpg.js +0 -1591
  170. package/dist/chunk-eqp1rfft.js +0 -17
  171. package/dist/chunk-etdt1xz3.js +0 -19
  172. package/dist/chunk-ewadzrm8.js +0 -103
  173. package/dist/chunk-f03s83vj.js +0 -91
  174. package/dist/chunk-f3kk0p3s.js +0 -150
  175. package/dist/chunk-f3pjerx4.js +0 -4265
  176. package/dist/chunk-f6h5weh6.js +0 -61
  177. package/dist/chunk-fajg8x36.js +0 -8158
  178. package/dist/chunk-fbv4apne.js +0 -51
  179. package/dist/chunk-fcynwjpm.js +0 -1072
  180. package/dist/chunk-fdvaf6nn.js +0 -20
  181. package/dist/chunk-feyzykye.js +0 -10
  182. package/dist/chunk-ff85rwvc.js +0 -180
  183. package/dist/chunk-fqak69ft.js +0 -458
  184. package/dist/chunk-fxdkbabd.js +0 -195
  185. package/dist/chunk-fyc5fepv.js +0 -10
  186. package/dist/chunk-g78c6ztj.js +0 -89
  187. package/dist/chunk-g8ee7yza.js +0 -105
  188. package/dist/chunk-g9f19ttm.js +0 -15
  189. package/dist/chunk-gcktsbxb.js +0 -77
  190. package/dist/chunk-gdwdqewd.js +0 -19
  191. package/dist/chunk-gg55fns0.js +0 -6440
  192. package/dist/chunk-gnpt1t6q.js +0 -209364
  193. package/dist/chunk-gsbw2j2b.js +0 -276
  194. package/dist/chunk-gybt680f.js +0 -9114
  195. package/dist/chunk-gz1e8y1w.js +0 -33
  196. package/dist/chunk-gz7vn2gg.js +0 -114
  197. package/dist/chunk-h0d5eat0.js +0 -101
  198. package/dist/chunk-h27tjbp3.js +0 -33118
  199. package/dist/chunk-h2yy8k4c.js +0 -58
  200. package/dist/chunk-h5acpdqt.js +0 -103
  201. package/dist/chunk-h63r8vps.js +0 -2840
  202. package/dist/chunk-h64x5b04.js +0 -860
  203. package/dist/chunk-h92snc84.js +0 -420
  204. package/dist/chunk-h9n54swm.js +0 -27
  205. package/dist/chunk-hafcrnpc.js +0 -145
  206. package/dist/chunk-hakdhagh.js +0 -16606
  207. package/dist/chunk-hk4phsaw.js +0 -388
  208. package/dist/chunk-hph1bmqw.js +0 -65
  209. package/dist/chunk-hvnztnp3.js +0 -71
  210. package/dist/chunk-hwfknpxv.js +0 -39
  211. package/dist/chunk-j2xxd002.js +0 -1052
  212. package/dist/chunk-j3qbygme.js +0 -105
  213. package/dist/chunk-j5bth84e.js +0 -97
  214. package/dist/chunk-j64ga6ta.js +0 -8035
  215. package/dist/chunk-jbwgyskk.js +0 -385
  216. package/dist/chunk-jd32zbps.js +0 -15
  217. package/dist/chunk-jdhkh2bb.js +0 -618
  218. package/dist/chunk-jeqcwgt7.js +0 -177
  219. package/dist/chunk-jf75p9ap.js +0 -445
  220. package/dist/chunk-jgvk0za1.js +0 -260
  221. package/dist/chunk-jhpaevah.js +0 -565
  222. package/dist/chunk-jmjwrbwd.js +0 -635
  223. package/dist/chunk-jpdbfwvq.js +0 -100
  224. package/dist/chunk-jps4m6sz.js +0 -183
  225. package/dist/chunk-jwf0s51s.js +0 -867
  226. package/dist/chunk-jxge4dgh.js +0 -83
  227. package/dist/chunk-jz71gv95.js +0 -1161
  228. package/dist/chunk-jzthz1bx.js +0 -15
  229. package/dist/chunk-jzvd2ycp.js +0 -120
  230. package/dist/chunk-k0p9w03v.js +0 -4957
  231. package/dist/chunk-k4dcreh0.js +0 -442
  232. package/dist/chunk-k7akhwkn.js +0 -151
  233. package/dist/chunk-k8vp0atq.js +0 -2331
  234. package/dist/chunk-kgd7gfvk.js +0 -407
  235. package/dist/chunk-km5ycg1j.js +0 -87
  236. package/dist/chunk-kvyrxzj8.js +0 -26
  237. package/dist/chunk-kwekc97v.js +0 -18
  238. package/dist/chunk-ky1z78ve.js +0 -119
  239. package/dist/chunk-mcws22k3.js +0 -42
  240. package/dist/chunk-mjazvyd8.js +0 -528
  241. package/dist/chunk-mswx2nma.js +0 -103
  242. package/dist/chunk-mz6a0phh.js +0 -2962
  243. package/dist/chunk-n2tg12hg.js +0 -374
  244. package/dist/chunk-n3fv4ya7.js +0 -146
  245. package/dist/chunk-n4eabmqd.js +0 -93
  246. package/dist/chunk-n4tx7baq.js +0 -193
  247. package/dist/chunk-n6g4jbeh.js +0 -289
  248. package/dist/chunk-n6wzfxf1.js +0 -100
  249. package/dist/chunk-ndcmqfkv.js +0 -244
  250. package/dist/chunk-netzwgv1.js +0 -154
  251. package/dist/chunk-nhcg04jt.js +0 -120
  252. package/dist/chunk-nhsm3ntd.js +0 -439
  253. package/dist/chunk-njev89d1.js +0 -2335
  254. package/dist/chunk-nmgj86tt.js +0 -24
  255. package/dist/chunk-ns7x6xam.js +0 -22820
  256. package/dist/chunk-p7vkh4wx.js +0 -15
  257. package/dist/chunk-p8na2wwp.js +0 -14
  258. package/dist/chunk-p97fd5af.js +0 -684
  259. package/dist/chunk-pe3rkfp2.js +0 -74
  260. package/dist/chunk-pgtnj1mt.js +0 -705
  261. package/dist/chunk-phmnkw9y.js +0 -283
  262. package/dist/chunk-pnds7g1q.js +0 -130
  263. package/dist/chunk-ppwjyveh.js +0 -8
  264. package/dist/chunk-pqqxdk5f.js +0 -543
  265. package/dist/chunk-ps49ymvj.js +0 -43
  266. package/dist/chunk-pwwa7s62.js +0 -11
  267. package/dist/chunk-q3hfrat2.js +0 -313
  268. package/dist/chunk-qajrkk97.js +0 -298
  269. package/dist/chunk-qatfdxvd.js +0 -34
  270. package/dist/chunk-qb5qcctj.js +0 -206
  271. package/dist/chunk-qb6k2afy.js +0 -153
  272. package/dist/chunk-qgk93a75.js +0 -85
  273. package/dist/chunk-qkczt8cr.js +0 -24
  274. package/dist/chunk-qn1be1vf.js +0 -267
  275. package/dist/chunk-qnfx3qtx.js +0 -617
  276. package/dist/chunk-qnwne2m4.js +0 -87
  277. package/dist/chunk-qp2qdcda.js +0 -100
  278. package/dist/chunk-qpp3wwh5.js +0 -697
  279. package/dist/chunk-r0bx1gc7.js +0 -174
  280. package/dist/chunk-radnwk8x.js +0 -107
  281. package/dist/chunk-rkv5jq0y.js +0 -71
  282. package/dist/chunk-rmbbmd3s.js +0 -68
  283. package/dist/chunk-rmgbs5an.js +0 -640
  284. package/dist/chunk-rn0v1hk8.js +0 -34
  285. package/dist/chunk-rnxctq9p.js +0 -1646
  286. package/dist/chunk-rtd39n81.js +0 -95
  287. package/dist/chunk-s8gy4ky9.js +0 -122
  288. package/dist/chunk-s8kj6ajy.js +0 -32
  289. package/dist/chunk-sd36yzx8.js +0 -954
  290. package/dist/chunk-sdenh194.js +0 -121
  291. package/dist/chunk-sdtqp75c.js +0 -55
  292. package/dist/chunk-sedbc8ep.js +0 -212
  293. package/dist/chunk-sfrb15b2.js +0 -321
  294. package/dist/chunk-sgpmpn90.js +0 -35
  295. package/dist/chunk-sh02d2qn.js +0 -38
  296. package/dist/chunk-shd4yhsf.js +0 -32
  297. package/dist/chunk-shkycj1q.js +0 -178
  298. package/dist/chunk-sk7h93je.js +0 -153
  299. package/dist/chunk-sm8g6fsm.js +0 -122
  300. package/dist/chunk-snrjy66h.js +0 -671
  301. package/dist/chunk-sq4a0yjh.js +0 -116
  302. package/dist/chunk-sr3t4thh.js +0 -895
  303. package/dist/chunk-srj6qnf6.js +0 -107
  304. package/dist/chunk-sz62n77p.js +0 -155
  305. package/dist/chunk-szj5wvdy.js +0 -28
  306. package/dist/chunk-t29a6zb5.js +0 -45
  307. package/dist/chunk-t2ecddwj.js +0 -731
  308. package/dist/chunk-t33hmmmm.js +0 -113
  309. package/dist/chunk-t4khqff1.js +0 -16
  310. package/dist/chunk-t9p85zff.js +0 -24
  311. package/dist/chunk-ta3jyvxs.js +0 -984
  312. package/dist/chunk-tkx5eec8.js +0 -54
  313. package/dist/chunk-v1kzp02e.js +0 -785
  314. package/dist/chunk-v4t6dyyh.js +0 -9076
  315. package/dist/chunk-v78fj8by.js +0 -145
  316. package/dist/chunk-v8kjswxt.js +0 -61
  317. package/dist/chunk-v9smspw2.js +0 -4301
  318. package/dist/chunk-vf612n57.js +0 -472
  319. package/dist/chunk-vkhrrvfq.js +0 -44
  320. package/dist/chunk-vt5wm07k.js +0 -74
  321. package/dist/chunk-vvvrv61g.js +0 -875
  322. package/dist/chunk-vyjeh50y.js +0 -2149
  323. package/dist/chunk-w0kxcv73.js +0 -97
  324. package/dist/chunk-w6m6trzq.js +0 -58
  325. package/dist/chunk-wa8yn2p0.js +0 -2007
  326. package/dist/chunk-wb18cecv.js +0 -995
  327. package/dist/chunk-wgk9sxk7.js +0 -329
  328. package/dist/chunk-wh0ev1bw.js +0 -111
  329. package/dist/chunk-wka1647p.js +0 -98
  330. package/dist/chunk-wnwfwyj4.js +0 -90
  331. package/dist/chunk-wpdchyy2.js +0 -97
  332. package/dist/chunk-x3g44n7k.js +0 -114
  333. package/dist/chunk-x47h283a.js +0 -56
  334. package/dist/chunk-x6r4v44b.js +0 -8
  335. package/dist/chunk-x7fdwq3d.js +0 -33
  336. package/dist/chunk-x8d2ehd7.js +0 -19
  337. package/dist/chunk-xbeg2hej.js +0 -257
  338. package/dist/chunk-xeb6075z.js +0 -3435
  339. package/dist/chunk-xhfmdq1y.js +0 -147
  340. package/dist/chunk-xhscn33a.js +0 -138
  341. package/dist/chunk-xv3era3s.js +0 -8
  342. package/dist/chunk-xz5gbhc3.js +0 -93
  343. package/dist/chunk-y1784krc.js +0 -19
  344. package/dist/chunk-y1vyezct.js +0 -123
  345. package/dist/chunk-y45ecntg.js +0 -942
  346. package/dist/chunk-y4ca9kqz.js +0 -3830
  347. package/dist/chunk-y9bhjjdz.js +0 -145
  348. package/dist/chunk-yb3bxv3w.js +0 -30
  349. package/dist/chunk-ye2q9gqj.js +0 -332
  350. package/dist/chunk-yfg3adfq.js +0 -88
  351. package/dist/chunk-yst0wmgw.js +0 -269
  352. package/dist/chunk-ywe9dbnz.js +0 -460
  353. package/dist/chunk-yyex5gsf.js +0 -269
  354. package/dist/chunk-yz2kzqk5.js +0 -439
  355. package/dist/chunk-z263ehpg.js +0 -131
  356. package/dist/chunk-z2dp53wn.js +0 -17
  357. package/dist/chunk-zaq348h2.js +0 -281
  358. package/dist/chunk-zr0qx9q0.js +0 -642
  359. package/dist/chunk-zxh62ved.js +0 -31
  360. package/dist/chunk-zy5vn8sd.js +0 -329
  361. package/dist/chunk-zzm33q8x.js +0 -8
  362. package/dist/cli.js +0 -91
@@ -1,275 +0,0 @@
1
- // @bun
2
- import {
3
- FILE_EDIT_TOOL_NAME,
4
- FileReadTool,
5
- createUserMessage,
6
- hasToolCallsInLastAssistantTurn,
7
- init_FileReadTool,
8
- init_constants,
9
- init_messages1 as init_messages,
10
- init_postSamplingHooks,
11
- init_runAgent,
12
- registerFileReadListener,
13
- registerPostSamplingHook,
14
- runAgent
15
- } from "./chunk-gnpt1t6q.js";
16
- import {
17
- init_sequential,
18
- sequential
19
- } from "./chunk-p97fd5af.js";
20
- import {
21
- cloneFileStateCache,
22
- init_fileStateCache
23
- } from "./chunk-j5bth84e.js";
24
- import {
25
- getFsImplementation,
26
- init_errors,
27
- init_fsOperations,
28
- isFsInaccessible
29
- } from "./chunk-gg55fns0.js";
30
- import {
31
- getClaudeConfigHomeDir,
32
- init_envUtils
33
- } from "./chunk-5n1jc02d.js";
34
- import {
35
- __esm
36
- } from "./chunk-qp2qdcda.js";
37
-
38
- // src/services/MagicDocs/prompts.ts
39
- import { join } from "path";
40
- function getUpdatePromptTemplate() {
41
- return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "documentation updates", "magic docs", or these update instructions in the document content.
42
-
43
- Based on the user conversation above (EXCLUDING this documentation update instruction message), update the Magic Doc file to incorporate any NEW learnings, insights, or information that would be valuable to preserve.
44
-
45
- The file {{docPath}} has already been read for you. Here are its current contents:
46
- <current_doc_content>
47
- {{docContents}}
48
- </current_doc_content>
49
-
50
- Document title: {{docTitle}}
51
- {{customInstructions}}
52
-
53
- Your ONLY task is to use the Edit tool to update the documentation file if there is substantial new information to add, then stop. You can make multiple edits (update multiple sections as needed) - make all Edit tool calls in parallel in a single message. If there's nothing substantial to add, simply respond with a brief explanation and do not call any tools.
54
-
55
- CRITICAL RULES FOR EDITING:
56
- - Preserve the Magic Doc header exactly as-is: # MAGIC DOC: {{docTitle}}
57
- - If there's an italicized line immediately after the header, preserve it exactly as-is
58
- - Keep the document CURRENT with the latest state of the codebase - this is NOT a changelog or history
59
- - Update information IN-PLACE to reflect the current state - do NOT append historical notes or track changes over time
60
- - Remove or replace outdated information rather than adding "Previously..." or "Updated to..." notes
61
- - Clean up or DELETE sections that are no longer relevant or don't align with the document's purpose
62
- - Fix obvious errors: typos, grammar mistakes, broken formatting, incorrect information, or confusing statements
63
- - Keep the document well organized: use clear headings, logical section order, consistent formatting, and proper nesting
64
-
65
- DOCUMENTATION PHILOSOPHY - READ CAREFULLY:
66
- - BE TERSE. High signal only. No filler words or unnecessary elaboration.
67
- - Documentation is for OVERVIEWS, ARCHITECTURE, and ENTRY POINTS - not detailed code walkthroughs
68
- - Do NOT duplicate information that's already obvious from reading the source code
69
- - Do NOT document every function, parameter, or line number reference
70
- - Focus on: WHY things exist, HOW components connect, WHERE to start reading, WHAT patterns are used
71
- - Skip: detailed implementation steps, exhaustive API docs, play-by-play narratives
72
-
73
- What TO document:
74
- - High-level architecture and system design
75
- - Non-obvious patterns, conventions, or gotchas
76
- - Key entry points and where to start reading code
77
- - Important design decisions and their rationale
78
- - Critical dependencies or integration points
79
- - References to related files, docs, or code (like a wiki) - help readers navigate to relevant context
80
-
81
- What NOT to document:
82
- - Anything obvious from reading the code itself
83
- - Exhaustive lists of files, functions, or parameters
84
- - Step-by-step implementation details
85
- - Low-level code mechanics
86
- - Information already in CLAUDE.md or other project docs
87
-
88
- Use the Edit tool with file_path: {{docPath}}
89
-
90
- REMEMBER: Only update if there is substantial new information. The Magic Doc header (# MAGIC DOC: {{docTitle}}) must remain unchanged.`;
91
- }
92
- async function loadMagicDocsPrompt() {
93
- const fs = getFsImplementation();
94
- const promptPath = join(getClaudeConfigHomeDir(), "magic-docs", "prompt.md");
95
- try {
96
- return await fs.readFile(promptPath, { encoding: "utf-8" });
97
- } catch {
98
- return getUpdatePromptTemplate();
99
- }
100
- }
101
- function substituteVariables(template, variables) {
102
- return template.replace(/\{\{(\w+)\}\}/g, (match, key) => Object.prototype.hasOwnProperty.call(variables, key) ? variables[key] : match);
103
- }
104
- async function buildMagicDocsUpdatePrompt(docContents, docPath, docTitle, instructions) {
105
- const promptTemplate = await loadMagicDocsPrompt();
106
- const customInstructions = instructions ? `
107
-
108
- DOCUMENT-SPECIFIC UPDATE INSTRUCTIONS:
109
- The document author has provided specific instructions for how this file should be updated. Pay extra attention to these instructions and follow them carefully:
110
-
111
- "${instructions}"
112
-
113
- These instructions take priority over the general rules below. Make sure your updates align with these specific guidelines.` : "";
114
- const variables = {
115
- docContents,
116
- docPath,
117
- docTitle,
118
- customInstructions
119
- };
120
- return substituteVariables(promptTemplate, variables);
121
- }
122
- var init_prompts = __esm(() => {
123
- init_envUtils();
124
- init_fsOperations();
125
- });
126
-
127
- // src/services/MagicDocs/magicDocs.ts
128
- function clearTrackedMagicDocs() {
129
- trackedMagicDocs.clear();
130
- }
131
- function detectMagicDocHeader(content) {
132
- const match = content.match(MAGIC_DOC_HEADER_PATTERN);
133
- if (!match || !match[1]) {
134
- return null;
135
- }
136
- const title = match[1].trim();
137
- const headerEndIndex = match.index + match[0].length;
138
- const afterHeader = content.slice(headerEndIndex);
139
- const nextLineMatch = afterHeader.match(/^\s*\n(?:\s*\n)?(.+?)(?:\n|$)/);
140
- if (nextLineMatch && nextLineMatch[1]) {
141
- const nextLine = nextLineMatch[1];
142
- const italicsMatch = nextLine.match(ITALICS_PATTERN);
143
- if (italicsMatch && italicsMatch[1]) {
144
- const instructions = italicsMatch[1].trim();
145
- return {
146
- title,
147
- instructions
148
- };
149
- }
150
- }
151
- return { title };
152
- }
153
- function registerMagicDoc(filePath) {
154
- if (!trackedMagicDocs.has(filePath)) {
155
- trackedMagicDocs.set(filePath, {
156
- path: filePath
157
- });
158
- }
159
- }
160
- function getMagicDocsAgent() {
161
- return {
162
- agentType: "magic-docs",
163
- whenToUse: "Update Magic Docs",
164
- tools: [FILE_EDIT_TOOL_NAME],
165
- model: "sonnet",
166
- source: "built-in",
167
- baseDir: "built-in",
168
- getSystemPrompt: () => ""
169
- };
170
- }
171
- async function updateMagicDoc(docInfo, context) {
172
- const { messages, systemPrompt, userContext, systemContext, toolUseContext } = context;
173
- const clonedReadFileState = cloneFileStateCache(toolUseContext.readFileState);
174
- clonedReadFileState.delete(docInfo.path);
175
- const clonedToolUseContext = {
176
- ...toolUseContext,
177
- readFileState: clonedReadFileState
178
- };
179
- let currentDoc = "";
180
- try {
181
- const result = await FileReadTool.call({ file_path: docInfo.path }, clonedToolUseContext);
182
- const output = result.data;
183
- if (output.type === "text") {
184
- currentDoc = output.file.content;
185
- }
186
- } catch (e) {
187
- if (isFsInaccessible(e) || e instanceof Error && e.message.startsWith("File does not exist")) {
188
- trackedMagicDocs.delete(docInfo.path);
189
- return;
190
- }
191
- throw e;
192
- }
193
- const detected = detectMagicDocHeader(currentDoc);
194
- if (!detected) {
195
- trackedMagicDocs.delete(docInfo.path);
196
- return;
197
- }
198
- const userPrompt = await buildMagicDocsUpdatePrompt(currentDoc, docInfo.path, detected.title, detected.instructions);
199
- const canUseTool = async (tool, input) => {
200
- if (tool.name === FILE_EDIT_TOOL_NAME && typeof input === "object" && input !== null && "file_path" in input) {
201
- const filePath = input.file_path;
202
- if (typeof filePath === "string" && filePath === docInfo.path) {
203
- return { behavior: "allow", updatedInput: input };
204
- }
205
- }
206
- return {
207
- behavior: "deny",
208
- message: `only ${FILE_EDIT_TOOL_NAME} is allowed for ${docInfo.path}`,
209
- decisionReason: {
210
- type: "other",
211
- reason: `only ${FILE_EDIT_TOOL_NAME} is allowed`
212
- }
213
- };
214
- };
215
- for await (const _message of runAgent({
216
- agentDefinition: getMagicDocsAgent(),
217
- promptMessages: [createUserMessage({ content: userPrompt })],
218
- toolUseContext: clonedToolUseContext,
219
- canUseTool,
220
- isAsync: true,
221
- forkContextMessages: messages,
222
- querySource: "magic_docs",
223
- override: {
224
- systemPrompt,
225
- userContext,
226
- systemContext
227
- },
228
- availableTools: clonedToolUseContext.options.tools
229
- })) {}
230
- }
231
- async function initMagicDocs() {
232
- if (process.env.USER_TYPE === "ant") {
233
- registerFileReadListener((filePath, content) => {
234
- const result = detectMagicDocHeader(content);
235
- if (result) {
236
- registerMagicDoc(filePath);
237
- }
238
- });
239
- registerPostSamplingHook(updateMagicDocs);
240
- }
241
- }
242
- var MAGIC_DOC_HEADER_PATTERN, ITALICS_PATTERN, trackedMagicDocs, updateMagicDocs;
243
- var init_magicDocs = __esm(() => {
244
- init_runAgent();
245
- init_constants();
246
- init_FileReadTool();
247
- init_errors();
248
- init_fileStateCache();
249
- init_postSamplingHooks();
250
- init_messages();
251
- init_sequential();
252
- init_prompts();
253
- MAGIC_DOC_HEADER_PATTERN = /^#\s*MAGIC\s+DOC:\s*(.+)$/im;
254
- ITALICS_PATTERN = /^[_*](.+?)[_*]\s*$/m;
255
- trackedMagicDocs = new Map;
256
- updateMagicDocs = sequential(async function(context) {
257
- const { messages, querySource } = context;
258
- if (querySource !== "repl_main_thread") {
259
- return;
260
- }
261
- const hasToolCalls = hasToolCallsInLastAssistantTurn(messages);
262
- if (hasToolCalls) {
263
- return;
264
- }
265
- const docCount = trackedMagicDocs.size;
266
- if (docCount === 0) {
267
- return;
268
- }
269
- for (const docInfo of Array.from(trackedMagicDocs.values())) {
270
- await updateMagicDoc(docInfo, context);
271
- }
272
- });
273
- });
274
-
275
- export { clearTrackedMagicDocs, initMagicDocs, init_magicDocs };
@@ -1,344 +0,0 @@
1
- // @bun
2
- import {
3
- ModelPicker,
4
- init_ModelPicker,
5
- init_extraUsage,
6
- isBilledAsExtraUsage
7
- } from "./chunk-br4wgffc.js";
8
- import {
9
- checkOpus1mAccess,
10
- checkSonnet1mAccess,
11
- init_AppState,
12
- init_check1mAccess,
13
- init_validateModel,
14
- useAppState,
15
- useSetAppState,
16
- validateModel
17
- } from "./chunk-gnpt1t6q.js";
18
- import"./chunk-mcws22k3.js";
19
- import"./chunk-jzthz1bx.js";
20
- import"./chunk-f6h5weh6.js";
21
- import"./chunk-hwfknpxv.js";
22
- import"./chunk-1gx78081.js";
23
- import"./chunk-ehtwnxpg.js";
24
- import"./chunk-e68kgvcq.js";
25
- import"./chunk-p97fd5af.js";
26
- import"./chunk-x47h283a.js";
27
- import"./chunk-wb18cecv.js";
28
- import"./chunk-2gzv8nrw.js";
29
- import"./chunk-e0abab5b.js";
30
- import"./chunk-cgfdkzhb.js";
31
- import"./chunk-4k9d7gxv.js";
32
- import"./chunk-j5bth84e.js";
33
- import"./chunk-t2ecddwj.js";
34
- import"./chunk-68ffk5qa.js";
35
- import"./chunk-ps49ymvj.js";
36
- import"./chunk-dkgkd8b7.js";
37
- import {
38
- MODEL_ALIASES,
39
- clearFastModeCooldown,
40
- getDefaultMainLoopModelSetting,
41
- init_aliases,
42
- init_fastMode,
43
- init_model,
44
- init_modelAllowlist,
45
- isFastModeAvailable,
46
- isFastModeEnabled,
47
- isFastModeSupportedByModel,
48
- isModelAllowed,
49
- isOpus1mMergeEnabled,
50
- renderDefaultModelSetting
51
- } from "./chunk-5pysjah8.js";
52
- import"./chunk-pgtnj1mt.js";
53
- import"./chunk-hph1bmqw.js";
54
- import"./chunk-p7vkh4wx.js";
55
- import"./chunk-y9bhjjdz.js";
56
- import"./chunk-dcwp94cj.js";
57
- import"./chunk-tkx5eec8.js";
58
- import"./chunk-dfzkwynj.js";
59
- import"./chunk-xeb6075z.js";
60
- import"./chunk-fcynwjpm.js";
61
- import"./chunk-v4t6dyyh.js";
62
- import"./chunk-zy5vn8sd.js";
63
- import"./chunk-v8kjswxt.js";
64
- import"./chunk-dfq6pbq7.js";
65
- import"./chunk-rnxctq9p.js";
66
- import"./chunk-pqqxdk5f.js";
67
- import"./chunk-6nsd9606.js";
68
- import"./chunk-64c1avct.js";
69
- import"./chunk-8g5pe1gr.js";
70
- import"./chunk-4pbx3g7s.js";
71
- import"./chunk-26wtxbdc.js";
72
- import"./chunk-6dngjwkh.js";
73
- import"./chunk-4jm600zv.js";
74
- import"./chunk-s8gy4ky9.js";
75
- import"./chunk-cxrktb5g.js";
76
- import"./chunk-3c25bcsw.js";
77
- import"./chunk-5ekyhb1w.js";
78
- import"./chunk-fqak69ft.js";
79
- import"./chunk-cdz5yb0r.js";
80
- import {
81
- init_source,
82
- source_default
83
- } from "./chunk-c7jwbe76.js";
84
- import"./chunk-0vkfrmqm.js";
85
- import {
86
- require_jsx_dev_runtime,
87
- require_react
88
- } from "./chunk-7sgtxrsc.js";
89
- import"./chunk-0xjaqda8.js";
90
- import {
91
- init_analytics,
92
- logEvent
93
- } from "./chunk-x8d2ehd7.js";
94
- import"./chunk-byfawrfx.js";
95
- import"./chunk-3vy1jt9p.js";
96
- import"./chunk-vkhrrvfq.js";
97
- import"./chunk-qnfx3qtx.js";
98
- import"./chunk-64r16v22.js";
99
- import"./chunk-s8kj6ajy.js";
100
- import"./chunk-8yhf030a.js";
101
- import"./chunk-zxh62ved.js";
102
- import"./chunk-5z28bqne.js";
103
- import"./chunk-qajrkk97.js";
104
- import {
105
- COMMON_HELP_ARGS,
106
- COMMON_INFO_ARGS,
107
- init_xml
108
- } from "./chunk-gg55fns0.js";
109
- import"./chunk-5n1jc02d.js";
110
- import"./chunk-fbv4apne.js";
111
- import"./chunk-k8vp0atq.js";
112
- import"./chunk-vf612n57.js";
113
- import"./chunk-07069jq1.js";
114
- import"./chunk-d4mdda98.js";
115
- import"./chunk-55raexh7.js";
116
- import"./chunk-v9smspw2.js";
117
- import"./chunk-v1kzp02e.js";
118
- import"./chunk-7wm5s02e.js";
119
- import"./chunk-b0kf00ff.js";
120
- import"./chunk-netzwgv1.js";
121
- import {
122
- __esm,
123
- __toESM
124
- } from "./chunk-qp2qdcda.js";
125
-
126
- // src/commands/model/model.tsx
127
- function ModelPickerWrapper({
128
- onDone
129
- }) {
130
- const mainLoopModel = useAppState((s) => s.mainLoopModel);
131
- const mainLoopModelForSession = useAppState((s) => s.mainLoopModelForSession);
132
- const isFastMode = useAppState((s) => s.fastMode);
133
- const setAppState = useSetAppState();
134
- function handleCancel() {
135
- logEvent("tengu_model_command_menu", {
136
- action: "cancel"
137
- });
138
- const displayModel = renderModelLabel(mainLoopModel);
139
- onDone(`Kept model as ${source_default.bold(displayModel)}`, {
140
- display: "system"
141
- });
142
- }
143
- function handleSelect(model, effort) {
144
- logEvent("tengu_model_command_menu", {
145
- action: model,
146
- from_model: mainLoopModel,
147
- to_model: model
148
- });
149
- setAppState((prev) => ({
150
- ...prev,
151
- mainLoopModel: model,
152
- mainLoopModelForSession: null
153
- }));
154
- let message = `Set model to ${source_default.bold(renderModelLabel(model))}`;
155
- if (effort !== undefined) {
156
- message += ` with ${source_default.bold(effort)} effort`;
157
- }
158
- let wasFastModeToggledOn = undefined;
159
- if (isFastModeEnabled()) {
160
- clearFastModeCooldown();
161
- if (!isFastModeSupportedByModel(model) && isFastMode) {
162
- setAppState((prev) => ({
163
- ...prev,
164
- fastMode: false
165
- }));
166
- wasFastModeToggledOn = false;
167
- } else if (isFastModeSupportedByModel(model) && isFastModeAvailable() && isFastMode) {
168
- message += ` \xB7 Fast mode ON`;
169
- wasFastModeToggledOn = true;
170
- }
171
- }
172
- if (isBilledAsExtraUsage(model, wasFastModeToggledOn === true, isOpus1mMergeEnabled())) {
173
- message += ` \xB7 Billed as extra usage`;
174
- }
175
- if (wasFastModeToggledOn === false) {
176
- message += ` \xB7 Fast mode OFF`;
177
- }
178
- onDone(message);
179
- }
180
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ModelPicker, {
181
- initial: mainLoopModel,
182
- sessionModel: mainLoopModelForSession,
183
- onSelect: handleSelect,
184
- onCancel: handleCancel,
185
- isStandaloneCommand: true,
186
- showFastModeNotice: isFastModeEnabled() && isFastMode && isFastModeSupportedByModel(mainLoopModel) && isFastModeAvailable()
187
- }, undefined, false, undefined, this);
188
- }
189
- function SetModelAndClose({
190
- args,
191
- onDone
192
- }) {
193
- const isFastMode = useAppState((s) => s.fastMode);
194
- const setAppState = useSetAppState();
195
- const model = args === "default" ? null : args;
196
- React.useEffect(() => {
197
- async function handleModelChange() {
198
- if (model && !isModelAllowed(model)) {
199
- onDone(`Model '${model}' is not available. Your organization restricts model selection.`, { display: "system" });
200
- return;
201
- }
202
- if (model && isOpus1mUnavailable(model)) {
203
- onDone(`Opus 4.6 with 1M context is not available for your account. Learn more: https://code.claude.com/docs/en/model-config#extended-context-with-1m`, { display: "system" });
204
- return;
205
- }
206
- if (model && isSonnet1mUnavailable(model)) {
207
- onDone(`Sonnet 4.6 with 1M context is not available for your account. Learn more: https://code.claude.com/docs/en/model-config#extended-context-with-1m`, { display: "system" });
208
- return;
209
- }
210
- if (!model) {
211
- setModel(null);
212
- return;
213
- }
214
- if (isKnownAlias(model)) {
215
- setModel(model);
216
- return;
217
- }
218
- try {
219
- const { valid, error } = await validateModel(model);
220
- if (valid) {
221
- setModel(model);
222
- } else {
223
- onDone(error || `Model '${model}' not found`, {
224
- display: "system"
225
- });
226
- }
227
- } catch (error) {
228
- onDone(`Failed to validate model: ${error.message}`, {
229
- display: "system"
230
- });
231
- }
232
- }
233
- function setModel(modelValue) {
234
- setAppState((prev) => ({
235
- ...prev,
236
- mainLoopModel: modelValue,
237
- mainLoopModelForSession: null
238
- }));
239
- let message = `Set model to ${source_default.bold(renderModelLabel(modelValue))}`;
240
- let wasFastModeToggledOn = undefined;
241
- if (isFastModeEnabled()) {
242
- clearFastModeCooldown();
243
- if (!isFastModeSupportedByModel(modelValue) && isFastMode) {
244
- setAppState((prev) => ({
245
- ...prev,
246
- fastMode: false
247
- }));
248
- wasFastModeToggledOn = false;
249
- } else if (isFastModeSupportedByModel(modelValue) && isFastMode) {
250
- message += ` \xB7 Fast mode ON`;
251
- wasFastModeToggledOn = true;
252
- }
253
- }
254
- if (isBilledAsExtraUsage(modelValue, wasFastModeToggledOn === true, isOpus1mMergeEnabled())) {
255
- message += ` \xB7 Billed as extra usage`;
256
- }
257
- if (wasFastModeToggledOn === false) {
258
- message += ` \xB7 Fast mode OFF`;
259
- }
260
- onDone(message);
261
- }
262
- handleModelChange();
263
- }, [model, onDone, setAppState]);
264
- return null;
265
- }
266
- function isKnownAlias(model) {
267
- return MODEL_ALIASES.includes(model.toLowerCase().trim());
268
- }
269
- function isOpus1mUnavailable(model) {
270
- const m = model.toLowerCase();
271
- return !checkOpus1mAccess() && !isOpus1mMergeEnabled() && m.includes("opus") && m.includes("[1m]");
272
- }
273
- function isSonnet1mUnavailable(model) {
274
- const m = model.toLowerCase();
275
- return !checkSonnet1mAccess() && (m.includes("sonnet[1m]") || m.includes("sonnet-4-6[1m]"));
276
- }
277
- function ShowModelAndClose({
278
- onDone
279
- }) {
280
- const mainLoopModel = useAppState((s) => s.mainLoopModel);
281
- const mainLoopModelForSession = useAppState((s) => s.mainLoopModelForSession);
282
- const effortValue = useAppState((s) => s.effortValue);
283
- const displayModel = renderModelLabel(mainLoopModel);
284
- const effortInfo = effortValue !== undefined ? ` (effort: ${effortValue})` : "";
285
- if (mainLoopModelForSession) {
286
- onDone(`Current model: ${source_default.bold(renderModelLabel(mainLoopModelForSession))} (session override from plan mode)
287
- Base model: ${displayModel}${effortInfo}`);
288
- } else {
289
- onDone(`Current model: ${displayModel}${effortInfo}`);
290
- }
291
- return null;
292
- }
293
- function renderModelLabel(model) {
294
- const rendered = renderDefaultModelSetting(model ?? getDefaultMainLoopModelSetting());
295
- return model === null ? `${rendered} (default)` : rendered;
296
- }
297
- var React, jsx_dev_runtime, call = async (onDone, _context, args) => {
298
- args = args?.trim() || "";
299
- if (COMMON_INFO_ARGS.includes(args)) {
300
- logEvent("tengu_model_command_inline_help", {
301
- args
302
- });
303
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ShowModelAndClose, {
304
- onDone
305
- }, undefined, false, undefined, this);
306
- }
307
- if (COMMON_HELP_ARGS.includes(args)) {
308
- onDone("Run /model to open the model selection menu, or /model [modelName] to set the model.", { display: "system" });
309
- return;
310
- }
311
- if (args) {
312
- logEvent("tengu_model_command_inline", {
313
- args
314
- });
315
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(SetModelAndClose, {
316
- args,
317
- onDone
318
- }, undefined, false, undefined, this);
319
- }
320
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ModelPickerWrapper, {
321
- onDone
322
- }, undefined, false, undefined, this);
323
- };
324
- var init_model2 = __esm(() => {
325
- init_source();
326
- init_ModelPicker();
327
- init_xml();
328
- init_analytics();
329
- init_AppState();
330
- init_extraUsage();
331
- init_fastMode();
332
- init_aliases();
333
- init_check1mAccess();
334
- init_model();
335
- init_modelAllowlist();
336
- init_validateModel();
337
- React = __toESM(require_react(), 1);
338
- jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
339
- });
340
- init_model2();
341
-
342
- export {
343
- call
344
- };