@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,1154 +0,0 @@
1
- // @bun
2
- import {
3
- Select,
4
- getAllHooks,
5
- getHookDisplayText,
6
- getTools,
7
- hookSourceDescriptionDisplayString,
8
- hookSourceHeaderDisplayString,
9
- hookSourceInlineDisplayString,
10
- init_AppState,
11
- init_hooksSettings,
12
- init_select,
13
- init_tools1 as init_tools,
14
- init_useSettingsChange,
15
- sortMatchersByPriority,
16
- useAppState,
17
- useAppStateStore,
18
- useSettingsChange
19
- } from "./chunk-gnpt1t6q.js";
20
- import"./chunk-mcws22k3.js";
21
- import"./chunk-jzthz1bx.js";
22
- import"./chunk-f6h5weh6.js";
23
- import"./chunk-hwfknpxv.js";
24
- import"./chunk-1gx78081.js";
25
- import"./chunk-ehtwnxpg.js";
26
- import"./chunk-e68kgvcq.js";
27
- import"./chunk-p97fd5af.js";
28
- import"./chunk-x47h283a.js";
29
- import"./chunk-wb18cecv.js";
30
- import"./chunk-2gzv8nrw.js";
31
- import"./chunk-e0abab5b.js";
32
- import"./chunk-cgfdkzhb.js";
33
- import"./chunk-4k9d7gxv.js";
34
- import"./chunk-j5bth84e.js";
35
- import"./chunk-t2ecddwj.js";
36
- import {
37
- init_useKeybinding
38
- } from "./chunk-68ffk5qa.js";
39
- import"./chunk-ps49ymvj.js";
40
- import"./chunk-dkgkd8b7.js";
41
- import"./chunk-5pysjah8.js";
42
- import"./chunk-pgtnj1mt.js";
43
- import"./chunk-hph1bmqw.js";
44
- import"./chunk-p7vkh4wx.js";
45
- import"./chunk-y9bhjjdz.js";
46
- import"./chunk-dcwp94cj.js";
47
- import"./chunk-tkx5eec8.js";
48
- import"./chunk-dfzkwynj.js";
49
- import"./chunk-xeb6075z.js";
50
- import"./chunk-fcynwjpm.js";
51
- import"./chunk-v4t6dyyh.js";
52
- import"./chunk-zy5vn8sd.js";
53
- import"./chunk-v8kjswxt.js";
54
- import {
55
- getSettingsForSource,
56
- getSettings_DEPRECATED,
57
- init_settings1 as init_settings,
58
- init_stringUtils,
59
- plural
60
- } from "./chunk-dfq6pbq7.js";
61
- import"./chunk-rnxctq9p.js";
62
- import"./chunk-pqqxdk5f.js";
63
- import"./chunk-6nsd9606.js";
64
- import"./chunk-64c1avct.js";
65
- import"./chunk-8g5pe1gr.js";
66
- import"./chunk-4pbx3g7s.js";
67
- import"./chunk-26wtxbdc.js";
68
- import"./chunk-6dngjwkh.js";
69
- import"./chunk-4jm600zv.js";
70
- import"./chunk-s8gy4ky9.js";
71
- import"./chunk-cxrktb5g.js";
72
- import"./chunk-3c25bcsw.js";
73
- import"./chunk-5ekyhb1w.js";
74
- import"./chunk-fqak69ft.js";
75
- import"./chunk-cdz5yb0r.js";
76
- import {
77
- Dialog,
78
- Link,
79
- ThemedBox_default,
80
- ThemedText,
81
- init_src,
82
- useKeybinding
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 {
104
- figures_default,
105
- init_figures
106
- } from "./chunk-qajrkk97.js";
107
- import"./chunk-gg55fns0.js";
108
- import"./chunk-5n1jc02d.js";
109
- import"./chunk-fbv4apne.js";
110
- import {
111
- getRegisteredHooks,
112
- init_state
113
- } from "./chunk-k8vp0atq.js";
114
- import {
115
- init_memoize,
116
- memoize_default
117
- } from "./chunk-vf612n57.js";
118
- import"./chunk-07069jq1.js";
119
- import"./chunk-d4mdda98.js";
120
- import"./chunk-55raexh7.js";
121
- import"./chunk-v9smspw2.js";
122
- import"./chunk-v1kzp02e.js";
123
- import"./chunk-7wm5s02e.js";
124
- import"./chunk-b0kf00ff.js";
125
- import"./chunk-netzwgv1.js";
126
- import {
127
- __esm,
128
- __toESM
129
- } from "./chunk-qp2qdcda.js";
130
-
131
- // src/utils/hooks/hooksConfigManager.ts
132
- function groupHooksByEventAndMatcher(appState, toolNames) {
133
- const grouped = {
134
- PreToolUse: {},
135
- PostToolUse: {},
136
- PostToolUseFailure: {},
137
- PermissionDenied: {},
138
- Notification: {},
139
- UserPromptSubmit: {},
140
- SessionStart: {},
141
- SessionEnd: {},
142
- Stop: {},
143
- StopFailure: {},
144
- SubagentStart: {},
145
- SubagentStop: {},
146
- PreCompact: {},
147
- PostCompact: {},
148
- PermissionRequest: {},
149
- Setup: {},
150
- TeammateIdle: {},
151
- TaskCreated: {},
152
- TaskCompleted: {},
153
- Elicitation: {},
154
- ElicitationResult: {},
155
- ConfigChange: {},
156
- WorktreeCreate: {},
157
- WorktreeRemove: {},
158
- InstructionsLoaded: {},
159
- CwdChanged: {},
160
- FileChanged: {}
161
- };
162
- const metadata = getHookEventMetadata(toolNames);
163
- getAllHooks(appState).forEach((hook) => {
164
- const eventGroup = grouped[hook.event];
165
- if (eventGroup) {
166
- const matcherKey = metadata[hook.event].matcherMetadata !== undefined ? hook.matcher || "" : "";
167
- if (!eventGroup[matcherKey]) {
168
- eventGroup[matcherKey] = [];
169
- }
170
- eventGroup[matcherKey].push(hook);
171
- }
172
- });
173
- const registeredHooks = getRegisteredHooks();
174
- if (registeredHooks) {
175
- for (const [event, matchers] of Object.entries(registeredHooks)) {
176
- const hookEvent = event;
177
- const eventGroup = grouped[hookEvent];
178
- if (!eventGroup)
179
- continue;
180
- for (const matcher of matchers) {
181
- const matcherKey = matcher.matcher || "";
182
- if ("pluginRoot" in matcher) {
183
- eventGroup[matcherKey] ??= [];
184
- for (const hook of matcher.hooks) {
185
- eventGroup[matcherKey].push({
186
- event: hookEvent,
187
- config: hook,
188
- matcher: matcher.matcher,
189
- source: "pluginHook",
190
- pluginName: matcher.pluginId
191
- });
192
- }
193
- } else if (process.env.USER_TYPE === "ant") {
194
- eventGroup[matcherKey] ??= [];
195
- for (const _hook of matcher.hooks) {
196
- eventGroup[matcherKey].push({
197
- event: hookEvent,
198
- config: {
199
- type: "command",
200
- command: "[ANT-ONLY] Built-in Hook"
201
- },
202
- matcher: matcher.matcher,
203
- source: "builtinHook"
204
- });
205
- }
206
- }
207
- }
208
- }
209
- }
210
- return grouped;
211
- }
212
- function getSortedMatchersForEvent(hooksByEventAndMatcher, event) {
213
- const matchers = Object.keys(hooksByEventAndMatcher[event] || {});
214
- return sortMatchersByPriority(matchers, hooksByEventAndMatcher, event);
215
- }
216
- function getHooksForMatcher(hooksByEventAndMatcher, event, matcher) {
217
- const matcherKey = matcher ?? "";
218
- return hooksByEventAndMatcher[event]?.[matcherKey] ?? [];
219
- }
220
- function getMatcherMetadata(event, toolNames) {
221
- return getHookEventMetadata(toolNames)[event].matcherMetadata;
222
- }
223
- var getHookEventMetadata;
224
- var init_hooksConfigManager = __esm(() => {
225
- init_memoize();
226
- init_state();
227
- init_hooksSettings();
228
- getHookEventMetadata = memoize_default(function(toolNames) {
229
- return {
230
- PreToolUse: {
231
- summary: "Before tool execution",
232
- description: `Input to command is JSON of tool call arguments.
233
- Exit code 0 - stdout/stderr not shown
234
- Exit code 2 - show stderr to model and block tool call
235
- Other exit codes - show stderr to user only but continue with tool call`,
236
- matcherMetadata: {
237
- fieldToMatch: "tool_name",
238
- values: toolNames
239
- }
240
- },
241
- PostToolUse: {
242
- summary: "After tool execution",
243
- description: `Input to command is JSON with fields "inputs" (tool call arguments) and "response" (tool call response).
244
- Exit code 0 - stdout shown in transcript mode (ctrl+o)
245
- Exit code 2 - show stderr to model immediately
246
- Other exit codes - show stderr to user only`,
247
- matcherMetadata: {
248
- fieldToMatch: "tool_name",
249
- values: toolNames
250
- }
251
- },
252
- PostToolUseFailure: {
253
- summary: "After tool execution fails",
254
- description: `Input to command is JSON with tool_name, tool_input, tool_use_id, error, error_type, is_interrupt, and is_timeout.
255
- Exit code 0 - stdout shown in transcript mode (ctrl+o)
256
- Exit code 2 - show stderr to model immediately
257
- Other exit codes - show stderr to user only`,
258
- matcherMetadata: {
259
- fieldToMatch: "tool_name",
260
- values: toolNames
261
- }
262
- },
263
- PermissionDenied: {
264
- summary: "After auto mode classifier denies a tool call",
265
- description: `Input to command is JSON with tool_name, tool_input, tool_use_id, and reason.
266
- Return {"hookSpecificOutput":{"hookEventName":"PermissionDenied","retry":true}} to tell the model it may retry.
267
- Exit code 0 - stdout shown in transcript mode (ctrl+o)
268
- Other exit codes - show stderr to user only`,
269
- matcherMetadata: {
270
- fieldToMatch: "tool_name",
271
- values: toolNames
272
- }
273
- },
274
- Notification: {
275
- summary: "When notifications are sent",
276
- description: `Input to command is JSON with notification message and type.
277
- Exit code 0 - stdout/stderr not shown
278
- Other exit codes - show stderr to user only`,
279
- matcherMetadata: {
280
- fieldToMatch: "notification_type",
281
- values: [
282
- "permission_prompt",
283
- "idle_prompt",
284
- "auth_success",
285
- "elicitation_dialog",
286
- "elicitation_complete",
287
- "elicitation_response"
288
- ]
289
- }
290
- },
291
- UserPromptSubmit: {
292
- summary: "When the user submits a prompt",
293
- description: `Input to command is JSON with original user prompt text.
294
- Exit code 0 - stdout shown to Claude
295
- Exit code 2 - block processing, erase original prompt, and show stderr to user only
296
- Other exit codes - show stderr to user only`
297
- },
298
- SessionStart: {
299
- summary: "When a new session is started",
300
- description: `Input to command is JSON with session start source.
301
- Exit code 0 - stdout shown to Claude
302
- Blocking errors are ignored
303
- Other exit codes - show stderr to user only`,
304
- matcherMetadata: {
305
- fieldToMatch: "source",
306
- values: ["startup", "resume", "clear", "compact"]
307
- }
308
- },
309
- Stop: {
310
- summary: "Right before Claude concludes its response",
311
- description: `Exit code 0 - stdout/stderr not shown
312
- Exit code 2 - show stderr to model and continue conversation
313
- Other exit codes - show stderr to user only`
314
- },
315
- StopFailure: {
316
- summary: "When the turn ends due to an API error",
317
- description: "Fires instead of Stop when an API error (rate limit, auth failure, etc.) ended the turn. Fire-and-forget \u2014 hook output and exit codes are ignored.",
318
- matcherMetadata: {
319
- fieldToMatch: "error",
320
- values: [
321
- "rate_limit",
322
- "authentication_failed",
323
- "billing_error",
324
- "invalid_request",
325
- "server_error",
326
- "max_output_tokens",
327
- "unknown"
328
- ]
329
- }
330
- },
331
- SubagentStart: {
332
- summary: "When a subagent (Agent tool call) is started",
333
- description: `Input to command is JSON with agent_id and agent_type.
334
- Exit code 0 - stdout shown to subagent
335
- Blocking errors are ignored
336
- Other exit codes - show stderr to user only`,
337
- matcherMetadata: {
338
- fieldToMatch: "agent_type",
339
- values: []
340
- }
341
- },
342
- SubagentStop: {
343
- summary: "Right before a subagent (Agent tool call) concludes its response",
344
- description: `Input to command is JSON with agent_id, agent_type, and agent_transcript_path.
345
- Exit code 0 - stdout/stderr not shown
346
- Exit code 2 - show stderr to subagent and continue having it run
347
- Other exit codes - show stderr to user only`,
348
- matcherMetadata: {
349
- fieldToMatch: "agent_type",
350
- values: []
351
- }
352
- },
353
- PreCompact: {
354
- summary: "Before conversation compaction",
355
- description: `Input to command is JSON with compaction details.
356
- Exit code 0 - stdout appended as custom compact instructions
357
- Exit code 2 - block compaction
358
- Other exit codes - show stderr to user only but continue with compaction`,
359
- matcherMetadata: {
360
- fieldToMatch: "trigger",
361
- values: ["manual", "auto"]
362
- }
363
- },
364
- PostCompact: {
365
- summary: "After conversation compaction",
366
- description: `Input to command is JSON with compaction details and the summary.
367
- Exit code 0 - stdout shown to user
368
- Other exit codes - show stderr to user only`,
369
- matcherMetadata: {
370
- fieldToMatch: "trigger",
371
- values: ["manual", "auto"]
372
- }
373
- },
374
- SessionEnd: {
375
- summary: "When a session is ending",
376
- description: `Input to command is JSON with session end reason.
377
- Exit code 0 - command completes successfully
378
- Other exit codes - show stderr to user only`,
379
- matcherMetadata: {
380
- fieldToMatch: "reason",
381
- values: ["clear", "logout", "prompt_input_exit", "other"]
382
- }
383
- },
384
- PermissionRequest: {
385
- summary: "When a permission dialog is displayed",
386
- description: `Input to command is JSON with tool_name, tool_input, and tool_use_id.
387
- Output JSON with hookSpecificOutput containing decision to allow or deny.
388
- Exit code 0 - use hook decision if provided
389
- Other exit codes - show stderr to user only`,
390
- matcherMetadata: {
391
- fieldToMatch: "tool_name",
392
- values: toolNames
393
- }
394
- },
395
- Setup: {
396
- summary: "Repo setup hooks for init and maintenance",
397
- description: `Input to command is JSON with trigger (init or maintenance).
398
- Exit code 0 - stdout shown to Claude
399
- Blocking errors are ignored
400
- Other exit codes - show stderr to user only`,
401
- matcherMetadata: {
402
- fieldToMatch: "trigger",
403
- values: ["init", "maintenance"]
404
- }
405
- },
406
- TeammateIdle: {
407
- summary: "When a teammate is about to go idle",
408
- description: `Input to command is JSON with teammate_name and team_name.
409
- Exit code 0 - stdout/stderr not shown
410
- Exit code 2 - show stderr to teammate and prevent idle (teammate continues working)
411
- Other exit codes - show stderr to user only`
412
- },
413
- TaskCreated: {
414
- summary: "When a task is being created",
415
- description: `Input to command is JSON with task_id, task_subject, task_description, teammate_name, and team_name.
416
- Exit code 0 - stdout/stderr not shown
417
- Exit code 2 - show stderr to model and prevent task creation
418
- Other exit codes - show stderr to user only`
419
- },
420
- TaskCompleted: {
421
- summary: "When a task is being marked as completed",
422
- description: `Input to command is JSON with task_id, task_subject, task_description, teammate_name, and team_name.
423
- Exit code 0 - stdout/stderr not shown
424
- Exit code 2 - show stderr to model and prevent task completion
425
- Other exit codes - show stderr to user only`
426
- },
427
- Elicitation: {
428
- summary: "When an MCP server requests user input (elicitation)",
429
- description: `Input to command is JSON with mcp_server_name, message, and requested_schema.
430
- Output JSON with hookSpecificOutput containing action (accept/decline/cancel) and optional content.
431
- Exit code 0 - use hook response if provided
432
- Exit code 2 - deny the elicitation
433
- Other exit codes - show stderr to user only`,
434
- matcherMetadata: {
435
- fieldToMatch: "mcp_server_name",
436
- values: []
437
- }
438
- },
439
- ElicitationResult: {
440
- summary: "After a user responds to an MCP elicitation",
441
- description: `Input to command is JSON with mcp_server_name, action, content, mode, and elicitation_id.
442
- Output JSON with hookSpecificOutput containing optional action and content to override the response.
443
- Exit code 0 - use hook response if provided
444
- Exit code 2 - block the response (action becomes decline)
445
- Other exit codes - show stderr to user only`,
446
- matcherMetadata: {
447
- fieldToMatch: "mcp_server_name",
448
- values: []
449
- }
450
- },
451
- ConfigChange: {
452
- summary: "When configuration files change during a session",
453
- description: `Input to command is JSON with source (user_settings, project_settings, local_settings, policy_settings, skills) and file_path.
454
- Exit code 0 - allow the change
455
- Exit code 2 - block the change from being applied to the session
456
- Other exit codes - show stderr to user only`,
457
- matcherMetadata: {
458
- fieldToMatch: "source",
459
- values: [
460
- "user_settings",
461
- "project_settings",
462
- "local_settings",
463
- "policy_settings",
464
- "skills"
465
- ]
466
- }
467
- },
468
- InstructionsLoaded: {
469
- summary: "When an instruction file (CLAUDE.md or rule) is loaded",
470
- description: `Input to command is JSON with file_path, memory_type (User, Project, Local, Managed), load_reason (session_start, nested_traversal, path_glob_match, include, compact), globs (optional \u2014 the paths: frontmatter patterns that matched), trigger_file_path (optional \u2014 the file Claude touched that caused the load), and parent_file_path (optional \u2014 the file that @-included this one).
471
- Exit code 0 - command completes successfully
472
- Other exit codes - show stderr to user only
473
- This hook is observability-only and does not support blocking.`,
474
- matcherMetadata: {
475
- fieldToMatch: "load_reason",
476
- values: [
477
- "session_start",
478
- "nested_traversal",
479
- "path_glob_match",
480
- "include",
481
- "compact"
482
- ]
483
- }
484
- },
485
- WorktreeCreate: {
486
- summary: "Create an isolated worktree for VCS-agnostic isolation",
487
- description: `Input to command is JSON with name (suggested worktree slug).
488
- Stdout should contain the absolute path to the created worktree directory.
489
- Exit code 0 - worktree created successfully
490
- Other exit codes - worktree creation failed`
491
- },
492
- WorktreeRemove: {
493
- summary: "Remove a previously created worktree",
494
- description: `Input to command is JSON with worktree_path (absolute path to worktree).
495
- Exit code 0 - worktree removed successfully
496
- Other exit codes - show stderr to user only`
497
- },
498
- CwdChanged: {
499
- summary: "After the working directory changes",
500
- description: `Input to command is JSON with old_cwd and new_cwd.
501
- CLAUDE_ENV_FILE is set \u2014 write bash exports there to apply env to subsequent BashTool commands.
502
- Hook output can include hookSpecificOutput.watchPaths (array of absolute paths) to register with the FileChanged watcher.
503
- Exit code 0 - command completes successfully
504
- Other exit codes - show stderr to user only`
505
- },
506
- FileChanged: {
507
- summary: "When a watched file changes",
508
- description: `Input to command is JSON with file_path and event (change, add, unlink).
509
- CLAUDE_ENV_FILE is set \u2014 write bash exports there to apply env to subsequent BashTool commands.
510
- The matcher field specifies filenames to watch in the current directory (e.g. ".envrc|.env").
511
- Hook output can include hookSpecificOutput.watchPaths (array of absolute paths) to dynamically update the watch list.
512
- Exit code 0 - command completes successfully
513
- Other exit codes - show stderr to user only`
514
- }
515
- };
516
- }, (toolNames) => toolNames.slice().sort().join(","));
517
- });
518
-
519
- // src/components/hooks/SelectEventMode.tsx
520
- function SelectEventMode({
521
- hookEventMetadata,
522
- hooksByEvent,
523
- totalHooksCount,
524
- restrictedByPolicy,
525
- onSelectEvent,
526
- onCancel
527
- }) {
528
- const subtitle = `${totalHooksCount} ${plural(totalHooksCount, "hook")} configured`;
529
- return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Dialog, {
530
- title: "Hooks",
531
- subtitle,
532
- onCancel,
533
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
534
- flexDirection: "column",
535
- gap: 1,
536
- children: [
537
- restrictedByPolicy && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
538
- flexDirection: "column",
539
- children: [
540
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
541
- color: "suggestion",
542
- children: [
543
- figures_default.info,
544
- " Hooks Restricted by Policy"
545
- ]
546
- }, undefined, true, undefined, this),
547
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
548
- dimColor: true,
549
- children: "Only hooks from managed settings can run. User-defined hooks from ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json are blocked."
550
- }, undefined, false, undefined, this)
551
- ]
552
- }, undefined, true, undefined, this),
553
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
554
- flexDirection: "column",
555
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
556
- dimColor: true,
557
- children: [
558
- figures_default.info,
559
- " This menu is read-only. To add or modify hooks, edit settings.json directly or ask Claude.",
560
- " ",
561
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Link, {
562
- url: "https://code.claude.com/docs/en/hooks",
563
- children: "Learn more"
564
- }, undefined, false, undefined, this)
565
- ]
566
- }, undefined, true, undefined, this)
567
- }, undefined, false, undefined, this),
568
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedBox_default, {
569
- flexDirection: "column",
570
- children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(Select, {
571
- onChange: (value) => {
572
- onSelectEvent(value);
573
- },
574
- onCancel,
575
- options: Object.entries(hookEventMetadata).map(([name, metadata]) => {
576
- const count = hooksByEvent[name] || 0;
577
- return {
578
- label: count > 0 ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
579
- children: [
580
- name,
581
- " ",
582
- /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ThemedText, {
583
- color: "suggestion",
584
- children: [
585
- "(",
586
- count,
587
- ")"
588
- ]
589
- }, undefined, true, undefined, this)
590
- ]
591
- }, undefined, true, undefined, this) : name,
592
- value: name,
593
- description: metadata.summary
594
- };
595
- })
596
- }, undefined, false, undefined, this)
597
- }, undefined, false, undefined, this)
598
- ]
599
- }, undefined, true, undefined, this)
600
- }, undefined, false, undefined, this);
601
- }
602
- var jsx_dev_runtime;
603
- var init_SelectEventMode = __esm(() => {
604
- init_figures();
605
- init_src();
606
- init_stringUtils();
607
- init_select();
608
- init_src();
609
- jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
610
- });
611
-
612
- // src/components/hooks/SelectHookMode.tsx
613
- function SelectHookMode({
614
- selectedEvent,
615
- selectedMatcher,
616
- hooksForSelectedMatcher,
617
- hookEventMetadata,
618
- onSelect,
619
- onCancel
620
- }) {
621
- const title = hookEventMetadata.matcherMetadata !== undefined ? `${selectedEvent} - Matcher: ${selectedMatcher || "(all)"}` : selectedEvent;
622
- if (hooksForSelectedMatcher.length === 0) {
623
- return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Dialog, {
624
- title,
625
- subtitle: hookEventMetadata.description,
626
- onCancel,
627
- inputGuide: () => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
628
- children: "Esc to go back"
629
- }, undefined, false, undefined, this),
630
- children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
631
- flexDirection: "column",
632
- gap: 1,
633
- children: [
634
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
635
- dimColor: true,
636
- children: "No hooks configured for this event."
637
- }, undefined, false, undefined, this),
638
- /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedText, {
639
- dimColor: true,
640
- children: "To add hooks, edit settings.json directly or ask Claude."
641
- }, undefined, false, undefined, this)
642
- ]
643
- }, undefined, true, undefined, this)
644
- }, undefined, false, undefined, this);
645
- }
646
- return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Dialog, {
647
- title,
648
- subtitle: hookEventMetadata.description,
649
- onCancel,
650
- children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ThemedBox_default, {
651
- flexDirection: "column",
652
- children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Select, {
653
- options: hooksForSelectedMatcher.map((hook, index) => ({
654
- label: `[${hook.config.type}] ${getHookDisplayText(hook.config)}`,
655
- value: index.toString(),
656
- description: hook.source === "pluginHook" && hook.pluginName ? `${hookSourceHeaderDisplayString(hook.source)} (${hook.pluginName})` : hookSourceHeaderDisplayString(hook.source)
657
- })),
658
- onChange: (value) => {
659
- const index = parseInt(value, 10);
660
- const hook = hooksForSelectedMatcher[index];
661
- if (hook) {
662
- onSelect(hook);
663
- }
664
- },
665
- onCancel
666
- }, undefined, false, undefined, this)
667
- }, undefined, false, undefined, this)
668
- }, undefined, false, undefined, this);
669
- }
670
- var jsx_dev_runtime2;
671
- var init_SelectHookMode = __esm(() => {
672
- init_src();
673
- init_hooksSettings();
674
- init_select();
675
- init_src();
676
- jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
677
- });
678
-
679
- // src/components/hooks/SelectMatcherMode.tsx
680
- function SelectMatcherMode({
681
- selectedEvent,
682
- matchersForSelectedEvent,
683
- hooksByEventAndMatcher,
684
- eventDescription,
685
- onSelect,
686
- onCancel
687
- }) {
688
- const matchersWithSources = React.useMemo(() => {
689
- return matchersForSelectedEvent.map((matcher) => {
690
- const hooks = hooksByEventAndMatcher[selectedEvent]?.[matcher] || [];
691
- const sources = Array.from(new Set(hooks.map((h) => h.source)));
692
- return {
693
- matcher,
694
- sources,
695
- hookCount: hooks.length
696
- };
697
- });
698
- }, [matchersForSelectedEvent, hooksByEventAndMatcher, selectedEvent]);
699
- if (matchersForSelectedEvent.length === 0) {
700
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Dialog, {
701
- title: `${selectedEvent} - Matchers`,
702
- subtitle: eventDescription,
703
- onCancel,
704
- inputGuide: () => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
705
- children: "Esc to go back"
706
- }, undefined, false, undefined, this),
707
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
708
- flexDirection: "column",
709
- gap: 1,
710
- children: [
711
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
712
- dimColor: true,
713
- children: "No hooks configured for this event."
714
- }, undefined, false, undefined, this),
715
- /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedText, {
716
- dimColor: true,
717
- children: "To add hooks, edit settings.json directly or ask Claude."
718
- }, undefined, false, undefined, this)
719
- ]
720
- }, undefined, true, undefined, this)
721
- }, undefined, false, undefined, this);
722
- }
723
- return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Dialog, {
724
- title: `${selectedEvent} - Matchers`,
725
- subtitle: eventDescription,
726
- onCancel,
727
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ThemedBox_default, {
728
- flexDirection: "column",
729
- children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Select, {
730
- options: matchersWithSources.map((item) => {
731
- const sourceText = item.sources.map(hookSourceInlineDisplayString).join(", ");
732
- const matcherLabel = item.matcher || "(all)";
733
- return {
734
- label: `[${sourceText}] ${matcherLabel}`,
735
- value: item.matcher,
736
- description: `${item.hookCount} ${plural(item.hookCount, "hook")}`
737
- };
738
- }),
739
- onChange: (value) => {
740
- onSelect(value);
741
- },
742
- onCancel
743
- }, undefined, false, undefined, this)
744
- }, undefined, false, undefined, this)
745
- }, undefined, false, undefined, this);
746
- }
747
- var React, jsx_dev_runtime3;
748
- var init_SelectMatcherMode = __esm(() => {
749
- init_src();
750
- init_hooksSettings();
751
- init_stringUtils();
752
- init_select();
753
- init_src();
754
- React = __toESM(require_react(), 1);
755
- jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
756
- });
757
-
758
- // src/components/hooks/ViewHookMode.tsx
759
- function ViewHookMode({
760
- selectedHook,
761
- eventSupportsMatcher,
762
- onCancel
763
- }) {
764
- return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Dialog, {
765
- title: "Hook details",
766
- onCancel,
767
- inputGuide: () => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
768
- children: "Esc to go back"
769
- }, undefined, false, undefined, this),
770
- children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
771
- flexDirection: "column",
772
- gap: 1,
773
- children: [
774
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
775
- flexDirection: "column",
776
- children: [
777
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
778
- children: [
779
- "Event: ",
780
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
781
- bold: true,
782
- children: selectedHook.event
783
- }, undefined, false, undefined, this)
784
- ]
785
- }, undefined, true, undefined, this),
786
- eventSupportsMatcher && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
787
- children: [
788
- "Matcher: ",
789
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
790
- bold: true,
791
- children: selectedHook.matcher || "(all)"
792
- }, undefined, false, undefined, this)
793
- ]
794
- }, undefined, true, undefined, this),
795
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
796
- children: [
797
- "Type: ",
798
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
799
- bold: true,
800
- children: selectedHook.config.type
801
- }, undefined, false, undefined, this)
802
- ]
803
- }, undefined, true, undefined, this),
804
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
805
- children: [
806
- "Source:",
807
- " ",
808
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
809
- dimColor: true,
810
- children: hookSourceDescriptionDisplayString(selectedHook.source)
811
- }, undefined, false, undefined, this)
812
- ]
813
- }, undefined, true, undefined, this),
814
- selectedHook.pluginName && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
815
- children: [
816
- "Plugin: ",
817
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
818
- dimColor: true,
819
- children: selectedHook.pluginName
820
- }, undefined, false, undefined, this)
821
- ]
822
- }, undefined, true, undefined, this)
823
- ]
824
- }, undefined, true, undefined, this),
825
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
826
- flexDirection: "column",
827
- children: [
828
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
829
- dimColor: true,
830
- children: [
831
- getContentFieldLabel(selectedHook.config),
832
- ":"
833
- ]
834
- }, undefined, true, undefined, this),
835
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedBox_default, {
836
- borderStyle: "round",
837
- borderDimColor: true,
838
- paddingLeft: 1,
839
- paddingRight: 1,
840
- children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
841
- children: getContentFieldValue(selectedHook.config)
842
- }, undefined, false, undefined, this)
843
- }, undefined, false, undefined, this)
844
- ]
845
- }, undefined, true, undefined, this),
846
- "statusMessage" in selectedHook.config && selectedHook.config.statusMessage && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
847
- children: [
848
- "Status message:",
849
- " ",
850
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
851
- dimColor: true,
852
- children: selectedHook.config.statusMessage
853
- }, undefined, false, undefined, this)
854
- ]
855
- }, undefined, true, undefined, this),
856
- /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ThemedText, {
857
- dimColor: true,
858
- children: "To modify or remove this hook, edit settings.json directly or ask Claude to help."
859
- }, undefined, false, undefined, this)
860
- ]
861
- }, undefined, true, undefined, this)
862
- }, undefined, false, undefined, this);
863
- }
864
- function getContentFieldLabel(config) {
865
- switch (config.type) {
866
- case "command":
867
- return "Command";
868
- case "prompt":
869
- return "Prompt";
870
- case "agent":
871
- return "Prompt";
872
- case "http":
873
- return "URL";
874
- }
875
- }
876
- function getContentFieldValue(config) {
877
- switch (config.type) {
878
- case "command":
879
- return config.command;
880
- case "prompt":
881
- return config.prompt;
882
- case "agent":
883
- return config.prompt;
884
- case "http":
885
- return config.url;
886
- }
887
- }
888
- var jsx_dev_runtime4;
889
- var init_ViewHookMode = __esm(() => {
890
- init_src();
891
- init_hooksSettings();
892
- init_src();
893
- jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
894
- });
895
-
896
- // src/components/hooks/HooksConfigMenu.tsx
897
- function HooksConfigMenu({ toolNames, onExit }) {
898
- const [modeState, setModeState] = import_react.useState({
899
- mode: "select-event"
900
- });
901
- const [disabledByPolicy, setDisabledByPolicy] = import_react.useState(() => {
902
- const settings2 = getSettings_DEPRECATED();
903
- const hooksDisabled2 = settings2?.disableAllHooks === true;
904
- return hooksDisabled2 && getSettingsForSource("policySettings")?.disableAllHooks === true;
905
- });
906
- const [restrictedByPolicy, setRestrictedByPolicy] = import_react.useState(() => {
907
- return getSettingsForSource("policySettings")?.allowManagedHooksOnly === true;
908
- });
909
- useSettingsChange((source) => {
910
- if (source === "policySettings") {
911
- const settings2 = getSettings_DEPRECATED();
912
- const hooksDisabled2 = settings2?.disableAllHooks === true;
913
- setDisabledByPolicy(hooksDisabled2 && getSettingsForSource("policySettings")?.disableAllHooks === true);
914
- setRestrictedByPolicy(getSettingsForSource("policySettings")?.allowManagedHooksOnly === true);
915
- }
916
- });
917
- const mode = modeState.mode;
918
- const selectedEvent = "event" in modeState ? modeState.event : "PreToolUse";
919
- const selectedMatcher = "matcher" in modeState ? modeState.matcher : null;
920
- const mcp = useAppState((s) => s.mcp);
921
- const appStateStore = useAppStateStore();
922
- const combinedToolNames = import_react.useMemo(() => [...toolNames, ...mcp.tools.map((tool) => tool.name)], [toolNames, mcp.tools]);
923
- const hooksByEventAndMatcher = import_react.useMemo(() => groupHooksByEventAndMatcher(appStateStore.getState(), combinedToolNames), [combinedToolNames, appStateStore]);
924
- const sortedMatchersForSelectedEvent = import_react.useMemo(() => getSortedMatchersForEvent(hooksByEventAndMatcher, selectedEvent), [hooksByEventAndMatcher, selectedEvent]);
925
- const hooksForSelectedMatcher = import_react.useMemo(() => getHooksForMatcher(hooksByEventAndMatcher, selectedEvent, selectedMatcher), [hooksByEventAndMatcher, selectedEvent, selectedMatcher]);
926
- const handleExit = import_react.useCallback(() => {
927
- onExit("Hooks dialog dismissed", { display: "system" });
928
- }, [onExit]);
929
- useKeybinding("confirm:no", handleExit, {
930
- context: "Confirmation",
931
- isActive: mode === "select-event"
932
- });
933
- useKeybinding("confirm:no", () => {
934
- setModeState({ mode: "select-event" });
935
- }, {
936
- context: "Confirmation",
937
- isActive: mode === "select-matcher"
938
- });
939
- useKeybinding("confirm:no", () => {
940
- if ("event" in modeState) {
941
- if (getMatcherMetadata(modeState.event, combinedToolNames) !== undefined) {
942
- setModeState({ mode: "select-matcher", event: modeState.event });
943
- } else {
944
- setModeState({ mode: "select-event" });
945
- }
946
- }
947
- }, {
948
- context: "Confirmation",
949
- isActive: mode === "select-hook"
950
- });
951
- useKeybinding("confirm:no", () => {
952
- if (modeState.mode === "view-hook") {
953
- const { event, hook } = modeState;
954
- setModeState({
955
- mode: "select-hook",
956
- event,
957
- matcher: hook.matcher || ""
958
- });
959
- }
960
- }, {
961
- context: "Confirmation",
962
- isActive: mode === "view-hook"
963
- });
964
- const hookEventMetadata = getHookEventMetadata(combinedToolNames);
965
- const settings = getSettings_DEPRECATED();
966
- const hooksDisabled = settings?.disableAllHooks === true;
967
- const { hooksByEvent, totalHooksCount } = import_react.useMemo(() => {
968
- const byEvent = {};
969
- let total = 0;
970
- for (const [event, matchers] of Object.entries(hooksByEventAndMatcher)) {
971
- const eventCount = Object.values(matchers).reduce((sum, hooks) => sum + hooks.length, 0);
972
- byEvent[event] = eventCount;
973
- total += eventCount;
974
- }
975
- return { hooksByEvent: byEvent, totalHooksCount: total };
976
- }, [hooksByEventAndMatcher]);
977
- if (hooksDisabled) {
978
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Dialog, {
979
- title: "Hook Configuration - Disabled",
980
- onCancel: handleExit,
981
- inputGuide: () => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
982
- children: "Esc to close"
983
- }, undefined, false, undefined, this),
984
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
985
- flexDirection: "column",
986
- gap: 1,
987
- children: [
988
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
989
- flexDirection: "column",
990
- children: [
991
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
992
- children: [
993
- "All hooks are currently ",
994
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
995
- bold: true,
996
- children: "disabled"
997
- }, undefined, false, undefined, this),
998
- disabledByPolicy && " by a managed settings file",
999
- ". You have",
1000
- " ",
1001
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1002
- bold: true,
1003
- children: totalHooksCount
1004
- }, undefined, false, undefined, this),
1005
- " configured",
1006
- " ",
1007
- plural(totalHooksCount, "hook"),
1008
- " that",
1009
- " ",
1010
- plural(totalHooksCount, "is", "are"),
1011
- " not running."
1012
- ]
1013
- }, undefined, true, undefined, this),
1014
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedBox_default, {
1015
- marginTop: 1,
1016
- children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1017
- dimColor: true,
1018
- children: "When hooks are disabled:"
1019
- }, undefined, false, undefined, this)
1020
- }, undefined, false, undefined, this),
1021
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1022
- dimColor: true,
1023
- children: "\xB7 No hook commands will execute"
1024
- }, undefined, false, undefined, this),
1025
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1026
- dimColor: true,
1027
- children: "\xB7 StatusLine will not be displayed"
1028
- }, undefined, false, undefined, this),
1029
- /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1030
- dimColor: true,
1031
- children: "\xB7 Tool operations will proceed without hook validation"
1032
- }, undefined, false, undefined, this)
1033
- ]
1034
- }, undefined, true, undefined, this),
1035
- !disabledByPolicy && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ThemedText, {
1036
- dimColor: true,
1037
- children: 'To re-enable hooks, remove "disableAllHooks" from settings.json or ask Claude.'
1038
- }, undefined, false, undefined, this)
1039
- ]
1040
- }, undefined, true, undefined, this)
1041
- }, undefined, false, undefined, this);
1042
- }
1043
- switch (modeState.mode) {
1044
- case "select-event":
1045
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(SelectEventMode, {
1046
- hookEventMetadata,
1047
- hooksByEvent,
1048
- totalHooksCount,
1049
- restrictedByPolicy,
1050
- onSelectEvent: (event) => {
1051
- if (getMatcherMetadata(event, combinedToolNames) !== undefined) {
1052
- setModeState({ mode: "select-matcher", event });
1053
- } else {
1054
- setModeState({ mode: "select-hook", event, matcher: "" });
1055
- }
1056
- },
1057
- onCancel: handleExit
1058
- }, undefined, false, undefined, this);
1059
- case "select-matcher":
1060
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(SelectMatcherMode, {
1061
- selectedEvent: modeState.event,
1062
- matchersForSelectedEvent: sortedMatchersForSelectedEvent,
1063
- hooksByEventAndMatcher,
1064
- eventDescription: hookEventMetadata[modeState.event].description,
1065
- onSelect: (matcher) => {
1066
- setModeState({
1067
- mode: "select-hook",
1068
- event: modeState.event,
1069
- matcher
1070
- });
1071
- },
1072
- onCancel: () => {
1073
- setModeState({ mode: "select-event" });
1074
- }
1075
- }, undefined, false, undefined, this);
1076
- case "select-hook":
1077
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(SelectHookMode, {
1078
- selectedEvent: modeState.event,
1079
- selectedMatcher: modeState.matcher,
1080
- hooksForSelectedMatcher,
1081
- hookEventMetadata: hookEventMetadata[modeState.event],
1082
- onSelect: (hook) => {
1083
- setModeState({
1084
- mode: "view-hook",
1085
- event: modeState.event,
1086
- hook
1087
- });
1088
- },
1089
- onCancel: () => {
1090
- if (getMatcherMetadata(modeState.event, combinedToolNames) !== undefined) {
1091
- setModeState({
1092
- mode: "select-matcher",
1093
- event: modeState.event
1094
- });
1095
- } else {
1096
- setModeState({ mode: "select-event" });
1097
- }
1098
- }
1099
- }, undefined, false, undefined, this);
1100
- case "view-hook":
1101
- return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ViewHookMode, {
1102
- selectedHook: modeState.hook,
1103
- eventSupportsMatcher: getMatcherMetadata(modeState.event, combinedToolNames) !== undefined,
1104
- onCancel: () => {
1105
- const { event, hook } = modeState;
1106
- setModeState({
1107
- mode: "select-hook",
1108
- event,
1109
- matcher: hook.matcher || ""
1110
- });
1111
- }
1112
- }, undefined, false, undefined, this);
1113
- }
1114
- }
1115
- var import_react, jsx_dev_runtime5;
1116
- var init_HooksConfigMenu = __esm(() => {
1117
- init_AppState();
1118
- init_useSettingsChange();
1119
- init_src();
1120
- init_useKeybinding();
1121
- init_hooksConfigManager();
1122
- init_settings();
1123
- init_stringUtils();
1124
- init_src();
1125
- init_SelectEventMode();
1126
- init_SelectHookMode();
1127
- init_SelectMatcherMode();
1128
- init_ViewHookMode();
1129
- import_react = __toESM(require_react(), 1);
1130
- jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
1131
- });
1132
-
1133
- // src/commands/hooks/hooks.tsx
1134
- var jsx_dev_runtime6, call = async (onDone, context) => {
1135
- logEvent("tengu_hooks_command", {});
1136
- const appState = context.getAppState();
1137
- const permissionContext = appState.toolPermissionContext;
1138
- const toolNames = getTools(permissionContext).map((tool) => tool.name);
1139
- return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(HooksConfigMenu, {
1140
- toolNames,
1141
- onExit: onDone
1142
- }, undefined, false, undefined, this);
1143
- };
1144
- var init_hooks = __esm(() => {
1145
- init_HooksConfigMenu();
1146
- init_analytics();
1147
- init_tools();
1148
- jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
1149
- });
1150
- init_hooks();
1151
-
1152
- export {
1153
- call
1154
- };