@caspian2026/agent-sdk 0.0.25 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (362) hide show
  1. package/dist/gateway/index.js +98 -22
  2. package/dist/gateway/worker.js +1005 -982
  3. package/dist/sdk/query.cjs +2 -362
  4. package/dist/sdk/query.js +2 -367
  5. package/package.json +126 -128
  6. package/dist/chunk-04n4fe72.js +0 -107
  7. package/dist/chunk-04ys66ej.js +0 -344
  8. package/dist/chunk-07069jq1.js +0 -30
  9. package/dist/chunk-0731m51q.js +0 -8
  10. package/dist/chunk-086x4ct4.js +0 -26
  11. package/dist/chunk-0btqb97n.js +0 -295
  12. package/dist/chunk-0paqc2yw.js +0 -15
  13. package/dist/chunk-0r1rjydx.js +0 -145
  14. package/dist/chunk-0r5bb9j4.js +0 -477
  15. package/dist/chunk-0t81d427.js +0 -41
  16. package/dist/chunk-0teq2mz0.js +0 -420
  17. package/dist/chunk-0vkfrmqm.js +0 -690
  18. package/dist/chunk-0vp3wfab.js +0 -12
  19. package/dist/chunk-0warp8dx.js +0 -253
  20. package/dist/chunk-0xjaqda8.js +0 -1124
  21. package/dist/chunk-10gzv316.js +0 -62
  22. package/dist/chunk-11pq9n08.js +0 -168
  23. package/dist/chunk-1ae3nt9j.js +0 -31
  24. package/dist/chunk-1fmb0njn.js +0 -396
  25. package/dist/chunk-1gx78081.js +0 -66
  26. package/dist/chunk-1h2famwb.js +0 -49
  27. package/dist/chunk-1ng8xwxz.js +0 -276
  28. package/dist/chunk-1v7jp29h.js +0 -206
  29. package/dist/chunk-1xxy5zhb.js +0 -673
  30. package/dist/chunk-20b73w7w.js +0 -117
  31. package/dist/chunk-20qxd83a.js +0 -1161
  32. package/dist/chunk-2239ny9q.js +0 -90
  33. package/dist/chunk-22d4rnef.js +0 -226
  34. package/dist/chunk-26wtxbdc.js +0 -13870
  35. package/dist/chunk-27225bjh.js +0 -618
  36. package/dist/chunk-2b0e32an.js +0 -5822
  37. package/dist/chunk-2bfa9w1y.js +0 -323
  38. package/dist/chunk-2epq04w1.js +0 -63
  39. package/dist/chunk-2fwze72g.js +0 -24
  40. package/dist/chunk-2gzv8nrw.js +0 -205
  41. package/dist/chunk-2mexte1r.js +0 -349
  42. package/dist/chunk-2mzaqh5g.js +0 -338
  43. package/dist/chunk-2tb6mzfc.js +0 -81
  44. package/dist/chunk-2xq0g43w.js +0 -558
  45. package/dist/chunk-334aeqg9.js +0 -90
  46. package/dist/chunk-34jx4rjd.js +0 -995
  47. package/dist/chunk-35w5nhex.js +0 -132
  48. package/dist/chunk-3c25bcsw.js +0 -17
  49. package/dist/chunk-3eaxj8dg.js +0 -151
  50. package/dist/chunk-3fdgrwd2.js +0 -111
  51. package/dist/chunk-3jw0r58d.js +0 -121
  52. package/dist/chunk-3mgywd32.js +0 -8
  53. package/dist/chunk-3nk79af8.js +0 -8
  54. package/dist/chunk-3vy1jt9p.js +0 -1010
  55. package/dist/chunk-3x78pd4j.js +0 -153
  56. package/dist/chunk-47x3dsmn.js +0 -95
  57. package/dist/chunk-49pqt48n.js +0 -108
  58. package/dist/chunk-4f7m9fjw.js +0 -317
  59. package/dist/chunk-4jm600zv.js +0 -13
  60. package/dist/chunk-4k9d7gxv.js +0 -118
  61. package/dist/chunk-4net8san.js +0 -155
  62. package/dist/chunk-4pbx3g7s.js +0 -26
  63. package/dist/chunk-4v125j4z.js +0 -58
  64. package/dist/chunk-4vxkv5vz.js +0 -1438
  65. package/dist/chunk-51fqpjy3.js +0 -121
  66. package/dist/chunk-52e64f2h.js +0 -439
  67. package/dist/chunk-52e9mdjv.js +0 -684
  68. package/dist/chunk-55raexh7.js +0 -14358
  69. package/dist/chunk-59pq5122.js +0 -269
  70. package/dist/chunk-5bsj67v1.js +0 -349
  71. package/dist/chunk-5ccdsxgy.js +0 -74
  72. package/dist/chunk-5ekyhb1w.js +0 -422
  73. package/dist/chunk-5gcqdn8x.js +0 -867
  74. package/dist/chunk-5h5kx2jd.js +0 -34
  75. package/dist/chunk-5hf3werb.js +0 -193
  76. package/dist/chunk-5n1jc02d.js +0 -87
  77. package/dist/chunk-5wfxvxm8.js +0 -127
  78. package/dist/chunk-5wjebwmn.js +0 -89
  79. package/dist/chunk-5z28bqne.js +0 -6748
  80. package/dist/chunk-5zwsxpjn.js +0 -671
  81. package/dist/chunk-60phw466.js +0 -29
  82. package/dist/chunk-64c1avct.js +0 -13
  83. package/dist/chunk-64r16v22.js +0 -162
  84. package/dist/chunk-65t1r7zs.js +0 -418
  85. package/dist/chunk-66zry909.js +0 -11
  86. package/dist/chunk-67hxjjgc.js +0 -731
  87. package/dist/chunk-68ffk5qa.js +0 -14
  88. package/dist/chunk-69dr6rrd.js +0 -177
  89. package/dist/chunk-69n11zng.js +0 -436
  90. package/dist/chunk-6dj5t602.js +0 -341
  91. package/dist/chunk-6dngjwkh.js +0 -63
  92. package/dist/chunk-6dp8sz55.js +0 -3561
  93. package/dist/chunk-6hqgg0sv.js +0 -103
  94. package/dist/chunk-6nsd9606.js +0 -790
  95. package/dist/chunk-6p0hbwz3.js +0 -65
  96. package/dist/chunk-6ywdv5vg.js +0 -97
  97. package/dist/chunk-6zc758qw.js +0 -640
  98. package/dist/chunk-7aw745vx.js +0 -40175
  99. package/dist/chunk-7fxaphbq.js +0 -116
  100. package/dist/chunk-7sgtxrsc.js +0 -1059
  101. package/dist/chunk-7wm5s02e.js +0 -216
  102. package/dist/chunk-7xdk4109.js +0 -442
  103. package/dist/chunk-7xyswgjh.js +0 -8
  104. package/dist/chunk-83hfzbx3.js +0 -10
  105. package/dist/chunk-87m69h0v.js +0 -219
  106. package/dist/chunk-8g5pe1gr.js +0 -37
  107. package/dist/chunk-8jbw0fnf.js +0 -167
  108. package/dist/chunk-8jf9se66.js +0 -321
  109. package/dist/chunk-8p65embj.js +0 -875
  110. package/dist/chunk-8qrmaff1.js +0 -2669
  111. package/dist/chunk-8r975mwc.js +0 -93
  112. package/dist/chunk-8yhf030a.js +0 -69
  113. package/dist/chunk-93emz367.js +0 -107
  114. package/dist/chunk-948mn975.js +0 -460
  115. package/dist/chunk-99chkt7r.js +0 -54
  116. package/dist/chunk-9f7c1hzz.js +0 -50
  117. package/dist/chunk-9fk9ps1g.js +0 -178
  118. package/dist/chunk-9rh0k0aq.js +0 -90
  119. package/dist/chunk-9x5zgy22.js +0 -12
  120. package/dist/chunk-a0k2vj5b.js +0 -460
  121. package/dist/chunk-a0m57ssq.js +0 -325
  122. package/dist/chunk-a0nsmmz1.js +0 -133
  123. package/dist/chunk-a25jh1v4.js +0 -105
  124. package/dist/chunk-a4j5ekv0.js +0 -83
  125. package/dist/chunk-a8k3zf58.js +0 -313
  126. package/dist/chunk-ah0zarbq.js +0 -260
  127. package/dist/chunk-ase86y73.js +0 -15
  128. package/dist/chunk-b0kf00ff.js +0 -637
  129. package/dist/chunk-b1kcd3ss.js +0 -27
  130. package/dist/chunk-b8kcqqds.js +0 -93
  131. package/dist/chunk-bg4x9ex0.js +0 -21
  132. package/dist/chunk-bh5zqvyc.js +0 -36
  133. package/dist/chunk-bqrkfekw.js +0 -267
  134. package/dist/chunk-brjd9zmk.js +0 -42
  135. package/dist/chunk-byfawrfx.js +0 -121
  136. package/dist/chunk-c6sjhj89.js +0 -1284
  137. package/dist/chunk-c7e5yv0q.js +0 -212
  138. package/dist/chunk-c7jwbe76.js +0 -29030
  139. package/dist/chunk-cb5v8w7k.js +0 -289
  140. package/dist/chunk-cdef9v7b.js +0 -27
  141. package/dist/chunk-cdz5yb0r.js +0 -57
  142. package/dist/chunk-cgfdkzhb.js +0 -12
  143. package/dist/chunk-cgqw4x5z.js +0 -155
  144. package/dist/chunk-cnsj3vq2.js +0 -35
  145. package/dist/chunk-cqxm7ggc.js +0 -123
  146. package/dist/chunk-cxrktb5g.js +0 -51
  147. package/dist/chunk-d089t7dk.js +0 -312
  148. package/dist/chunk-d1z934cp.js +0 -71
  149. package/dist/chunk-d4mdda98.js +0 -94
  150. package/dist/chunk-d7xw8v91.js +0 -332
  151. package/dist/chunk-dc06c3rw.js +0 -1154
  152. package/dist/chunk-ddsjkqs4.js +0 -39
  153. package/dist/chunk-dfzkwynj.js +0 -5368
  154. package/dist/chunk-dnmp7s85.js +0 -20
  155. package/dist/chunk-dqqwjkv3.js +0 -8583
  156. package/dist/chunk-dt2mr4vf.js +0 -2962
  157. package/dist/chunk-dztm97gg.js +0 -150
  158. package/dist/chunk-e0abab5b.js +0 -445
  159. package/dist/chunk-e0ragz46.js +0 -209386
  160. package/dist/chunk-e9w9zc0g.js +0 -392
  161. package/dist/chunk-ebwskmsr.js +0 -107
  162. package/dist/chunk-efztk52j.js +0 -114
  163. package/dist/chunk-ehd8wacx.js +0 -40
  164. package/dist/chunk-ehtwnxpg.js +0 -1591
  165. package/dist/chunk-eqp1rfft.js +0 -17
  166. package/dist/chunk-etdt1xz3.js +0 -19
  167. package/dist/chunk-eva785x8.js +0 -88
  168. package/dist/chunk-ewadzrm8.js +0 -103
  169. package/dist/chunk-f2ajmcav.js +0 -92
  170. package/dist/chunk-fajg8x36.js +0 -8158
  171. package/dist/chunk-fbv4apne.js +0 -51
  172. package/dist/chunk-fcynwjpm.js +0 -1072
  173. package/dist/chunk-fev86f95.js +0 -1052
  174. package/dist/chunk-feyzykye.js +0 -10
  175. package/dist/chunk-ff85rwvc.js +0 -180
  176. package/dist/chunk-fk6ktvg2.js +0 -275
  177. package/dist/chunk-fqak69ft.js +0 -458
  178. package/dist/chunk-fqwas4jk.js +0 -281
  179. package/dist/chunk-fs35fdpj.js +0 -439
  180. package/dist/chunk-fvr3f9s3.js +0 -55
  181. package/dist/chunk-fyc5fepv.js +0 -10
  182. package/dist/chunk-g2g9cwt9.js +0 -54
  183. package/dist/chunk-g4znz46v.js +0 -2335
  184. package/dist/chunk-g5ts4e6k.js +0 -697
  185. package/dist/chunk-g6een9wr.js +0 -654
  186. package/dist/chunk-g7cmtx8r.js +0 -77
  187. package/dist/chunk-g9f19ttm.js +0 -15
  188. package/dist/chunk-gc7ap41t.js +0 -516
  189. package/dist/chunk-gdwdqewd.js +0 -19
  190. package/dist/chunk-gg14h3n4.js +0 -131
  191. package/dist/chunk-gg55fns0.js +0 -6440
  192. package/dist/chunk-gq7zab4e.js +0 -418
  193. package/dist/chunk-gydw3qy3.js +0 -169
  194. package/dist/chunk-gz1e8y1w.js +0 -33
  195. package/dist/chunk-h19r628d.js +0 -91
  196. package/dist/chunk-h2k8mt3z.js +0 -329
  197. package/dist/chunk-h9n54swm.js +0 -27
  198. package/dist/chunk-hakdhagh.js +0 -16606
  199. package/dist/chunk-hc2chp3g.js +0 -308
  200. package/dist/chunk-hemcv9t7.js +0 -153
  201. package/dist/chunk-hm62ntv3.js +0 -20
  202. package/dist/chunk-hmq09ytj.js +0 -100
  203. package/dist/chunk-hmv4hhqt.js +0 -2718
  204. package/dist/chunk-hwfknpxv.js +0 -39
  205. package/dist/chunk-j5bth84e.js +0 -97
  206. package/dist/chunk-j64ga6ta.js +0 -8035
  207. package/dist/chunk-j6v3w4yf.js +0 -244
  208. package/dist/chunk-jc29d2nm.js +0 -130
  209. package/dist/chunk-jd32zbps.js +0 -15
  210. package/dist/chunk-jd4sx4wh.js +0 -594
  211. package/dist/chunk-jha8n8b9.js +0 -33118
  212. package/dist/chunk-jj71qx7m.js +0 -122
  213. package/dist/chunk-jka9vpak.js +0 -114
  214. package/dist/chunk-jkf6ayv0.js +0 -32
  215. package/dist/chunk-jpz6t2tt.js +0 -61
  216. package/dist/chunk-jqt3sw12.js +0 -9114
  217. package/dist/chunk-jswd1q63.js +0 -101
  218. package/dist/chunk-jtc4aa2y.js +0 -1543
  219. package/dist/chunk-jyx3h86z.js +0 -635
  220. package/dist/chunk-jzthz1bx.js +0 -15
  221. package/dist/chunk-k0p9w03v.js +0 -4957
  222. package/dist/chunk-k6x3s7x5.js +0 -211
  223. package/dist/chunk-k7kmvnnx.js +0 -942
  224. package/dist/chunk-k8vp0atq.js +0 -2331
  225. package/dist/chunk-k9vm6x6z.js +0 -257
  226. package/dist/chunk-kb1edvhs.js +0 -120
  227. package/dist/chunk-kbhbe33q.js +0 -113
  228. package/dist/chunk-kgcgpp7z.js +0 -140
  229. package/dist/chunk-kvywbvqs.js +0 -261
  230. package/dist/chunk-kwekc97v.js +0 -18
  231. package/dist/chunk-kwyk9zp1.js +0 -74
  232. package/dist/chunk-ky1z78ve.js +0 -119
  233. package/dist/chunk-mcws22k3.js +0 -42
  234. package/dist/chunk-mr2z79r3.js +0 -1385
  235. package/dist/chunk-mst9nmns.js +0 -642
  236. package/dist/chunk-mswx2nma.js +0 -103
  237. package/dist/chunk-n1e3fjpz.js +0 -266
  238. package/dist/chunk-n6vjp9yg.js +0 -138
  239. package/dist/chunk-n84tqtvv.js +0 -120
  240. package/dist/chunk-n8ssddbw.js +0 -105
  241. package/dist/chunk-na35whkd.js +0 -227
  242. package/dist/chunk-netzwgv1.js +0 -154
  243. package/dist/chunk-ng7j0yy1.js +0 -100
  244. package/dist/chunk-nmgj86tt.js +0 -24
  245. package/dist/chunk-ns7x6xam.js +0 -22820
  246. package/dist/chunk-p7vkh4wx.js +0 -15
  247. package/dist/chunk-p8na2wwp.js +0 -14
  248. package/dist/chunk-pe3rkfp2.js +0 -74
  249. package/dist/chunk-pf0152j3.js +0 -40
  250. package/dist/chunk-pgtnj1mt.js +0 -705
  251. package/dist/chunk-ppwjyveh.js +0 -8
  252. package/dist/chunk-pq5qp2y4.js +0 -388
  253. package/dist/chunk-pqqxdk5f.js +0 -543
  254. package/dist/chunk-ps49ymvj.js +0 -43
  255. package/dist/chunk-pws8gq7m.js +0 -7422
  256. package/dist/chunk-pwwa7s62.js +0 -11
  257. package/dist/chunk-pyq0fabn.js +0 -860
  258. package/dist/chunk-q0p1m40t.js +0 -79
  259. package/dist/chunk-q0vhv550.js +0 -393
  260. package/dist/chunk-q7r0kt08.js +0 -1809
  261. package/dist/chunk-qajrkk97.js +0 -298
  262. package/dist/chunk-qatfdxvd.js +0 -34
  263. package/dist/chunk-qb6k2afy.js +0 -153
  264. package/dist/chunk-qg2qgx8h.js +0 -266
  265. package/dist/chunk-qkczt8cr.js +0 -24
  266. package/dist/chunk-qnfx3qtx.js +0 -617
  267. package/dist/chunk-qp2qdcda.js +0 -100
  268. package/dist/chunk-qtwgzej9.js +0 -85
  269. package/dist/chunk-r1dh0ymt.js +0 -91
  270. package/dist/chunk-r36xvgvv.js +0 -407
  271. package/dist/chunk-r48he8g3.js +0 -251
  272. package/dist/chunk-r63tqmtk.js +0 -146
  273. package/dist/chunk-rbdd3q5k.js +0 -101
  274. package/dist/chunk-rmbbmd3s.js +0 -68
  275. package/dist/chunk-rn0v1hk8.js +0 -34
  276. package/dist/chunk-rnxctq9p.js +0 -1646
  277. package/dist/chunk-rrs2mchs.js +0 -183
  278. package/dist/chunk-rtrybvnp.js +0 -209
  279. package/dist/chunk-rw2wkn45.js +0 -494
  280. package/dist/chunk-s4kzkdhd.js +0 -847
  281. package/dist/chunk-s7a0zn7b.js +0 -55
  282. package/dist/chunk-s8gy4ky9.js +0 -122
  283. package/dist/chunk-s8kj6ajy.js +0 -32
  284. package/dist/chunk-sag785ad.js +0 -283
  285. package/dist/chunk-scqjyben.js +0 -174
  286. package/dist/chunk-sd36yzx8.js +0 -954
  287. package/dist/chunk-sdtqm0nm.js +0 -374
  288. package/dist/chunk-sg60xg0x.js +0 -52
  289. package/dist/chunk-sgpmpn90.js +0 -35
  290. package/dist/chunk-sh02d2qn.js +0 -38
  291. package/dist/chunk-sz9y6z13.js +0 -61
  292. package/dist/chunk-szj5wvdy.js +0 -28
  293. package/dist/chunk-t29a6zb5.js +0 -45
  294. package/dist/chunk-t2b49hcf.js +0 -87
  295. package/dist/chunk-t2wqdppz.js +0 -445
  296. package/dist/chunk-t4khqff1.js +0 -16
  297. package/dist/chunk-t70t2gne.js +0 -121
  298. package/dist/chunk-t9p85zff.js +0 -24
  299. package/dist/chunk-tkrstmwz.js +0 -94
  300. package/dist/chunk-tnyb4exc.js +0 -74
  301. package/dist/chunk-tpn8jsvw.js +0 -71
  302. package/dist/chunk-tt7x5j1q.js +0 -111
  303. package/dist/chunk-tw1p628z.js +0 -984
  304. package/dist/chunk-twvdafcz.js +0 -528
  305. package/dist/chunk-tzwjafgn.js +0 -24
  306. package/dist/chunk-v140t8ay.js +0 -152
  307. package/dist/chunk-v1kzp02e.js +0 -785
  308. package/dist/chunk-v4t6dyyh.js +0 -9076
  309. package/dist/chunk-v78fj8by.js +0 -145
  310. package/dist/chunk-v8kjswxt.js +0 -61
  311. package/dist/chunk-v9smspw2.js +0 -4301
  312. package/dist/chunk-vcfbjkk9.js +0 -201
  313. package/dist/chunk-ve167rcs.js +0 -148
  314. package/dist/chunk-vf612n57.js +0 -472
  315. package/dist/chunk-vhffyae8.js +0 -895
  316. package/dist/chunk-vkhrrvfq.js +0 -44
  317. package/dist/chunk-vybkmfhf.js +0 -91
  318. package/dist/chunk-vyjeh50y.js +0 -2149
  319. package/dist/chunk-w6m6trzq.js +0 -58
  320. package/dist/chunk-w9b6kngq.js +0 -234
  321. package/dist/chunk-wa8yn2p0.js +0 -2007
  322. package/dist/chunk-wanceff6.js +0 -2840
  323. package/dist/chunk-wcze2nea.js +0 -336
  324. package/dist/chunk-wgk9sxk7.js +0 -329
  325. package/dist/chunk-wnxcgfsd.js +0 -253
  326. package/dist/chunk-wyjerrr6.js +0 -565
  327. package/dist/chunk-wz9brkq5.js +0 -60
  328. package/dist/chunk-x47h283a.js +0 -56
  329. package/dist/chunk-x59j3x9c.js +0 -98
  330. package/dist/chunk-x6r4v44b.js +0 -8
  331. package/dist/chunk-x7fdwq3d.js +0 -33
  332. package/dist/chunk-x8d2ehd7.js +0 -19
  333. package/dist/chunk-xeb6075z.js +0 -3435
  334. package/dist/chunk-xfw2pxwd.js +0 -223
  335. package/dist/chunk-xh06jc72.js +0 -200
  336. package/dist/chunk-xhfmdq1y.js +0 -147
  337. package/dist/chunk-xkwyg1d2.js +0 -195
  338. package/dist/chunk-xv3era3s.js +0 -8
  339. package/dist/chunk-xyapc58m.js +0 -87
  340. package/dist/chunk-xzgnc76g.js +0 -107
  341. package/dist/chunk-y1784krc.js +0 -19
  342. package/dist/chunk-y4ca9kqz.js +0 -3830
  343. package/dist/chunk-y9bhjjdz.js +0 -145
  344. package/dist/chunk-yb3bxv3w.js +0 -30
  345. package/dist/chunk-yddek6xk.js +0 -146
  346. package/dist/chunk-ypaq3d12.js +0 -4265
  347. package/dist/chunk-yq8z040g.js +0 -111
  348. package/dist/chunk-yqs481qq.js +0 -1163
  349. package/dist/chunk-ys9a9c9h.js +0 -105
  350. package/dist/chunk-yyex5gsf.js +0 -269
  351. package/dist/chunk-yzn396hn.js +0 -89
  352. package/dist/chunk-z2dp53wn.js +0 -17
  353. package/dist/chunk-zay4xp4n.js +0 -251
  354. package/dist/chunk-zc8bwy57.js +0 -212
  355. package/dist/chunk-zhx88cfx.js +0 -97
  356. package/dist/chunk-zkh6f4ct.js +0 -385
  357. package/dist/chunk-zq56gcca.js +0 -206
  358. package/dist/chunk-zrkefd22.js +0 -490
  359. package/dist/chunk-zs5p0yq1.js +0 -1030
  360. package/dist/chunk-zxh62ved.js +0 -31
  361. package/dist/chunk-zzm33q8x.js +0 -8
  362. package/dist/cli.js +0 -220
@@ -1,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-e0ragz46.js";
20
- import"./chunk-mcws22k3.js";
21
- import"./chunk-jzthz1bx.js";
22
- import"./chunk-jpz6t2tt.js";
23
- import"./chunk-hwfknpxv.js";
24
- import"./chunk-1gx78081.js";
25
- import"./chunk-ehtwnxpg.js";
26
- import"./chunk-q0p1m40t.js";
27
- import"./chunk-52e9mdjv.js";
28
- import"./chunk-x47h283a.js";
29
- import"./chunk-34jx4rjd.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-67hxjjgc.js";
36
- import {
37
- init_useKeybinding
38
- } from "./chunk-68ffk5qa.js";
39
- import"./chunk-ps49ymvj.js";
40
- import"./chunk-gc7ap41t.js";
41
- import"./chunk-jtc4aa2y.js";
42
- import"./chunk-pgtnj1mt.js";
43
- import"./chunk-6p0hbwz3.js";
44
- import"./chunk-p7vkh4wx.js";
45
- import"./chunk-y9bhjjdz.js";
46
- import"./chunk-v140t8ay.js";
47
- import"./chunk-99chkt7r.js";
48
- import"./chunk-dfzkwynj.js";
49
- import"./chunk-xeb6075z.js";
50
- import"./chunk-fcynwjpm.js";
51
- import"./chunk-v4t6dyyh.js";
52
- import"./chunk-h2k8mt3z.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-2b0e32an.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
- };