tenjin-cli 0.1.0-alpha.33 → 0.1.0-alpha.35

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 (495) hide show
  1. package/NOTICE.md +110 -0
  2. package/README.md +87 -81
  3. package/dist/{_esm-BIN7VY2L.js → _esm-2KST7HQ7.js} +7 -7
  4. package/dist/alive-5TV22PNF.js +51 -0
  5. package/dist/auth-XI7BJFLW.js +47 -0
  6. package/dist/{auto-update-Y24UL56V.js → auto-update-7L24KDWA.js} +4 -5
  7. package/dist/balance-DFHC6XEU.js +71 -0
  8. package/dist/{ccip-DHDFKTQV.js → ccip-HOW3DZYF.js} +4 -4
  9. package/dist/chunk-24XKUN2S.js +202 -0
  10. package/dist/chunk-24XKUN2S.js.map +1 -0
  11. package/dist/chunk-2L7TDGLV.js +56 -0
  12. package/dist/chunk-2L7TDGLV.js.map +1 -0
  13. package/dist/{chunk-C2Q76BVM.js → chunk-2U7H35IP.js} +29 -7
  14. package/dist/chunk-2U7H35IP.js.map +1 -0
  15. package/dist/chunk-2W4DQQUU.js +176 -0
  16. package/dist/chunk-2W4DQQUU.js.map +1 -0
  17. package/dist/{chunk-LRW6S53P.js → chunk-34SAECKZ.js} +35 -11
  18. package/dist/chunk-34SAECKZ.js.map +1 -0
  19. package/dist/{chunk-2I4QTOLB.js → chunk-3MZ7DYRO.js} +1 -1
  20. package/dist/chunk-3MZ7DYRO.js.map +1 -0
  21. package/dist/{chunk-RVPYTUP4.js → chunk-3Y2EHT4F.js} +13 -9
  22. package/dist/chunk-3Y2EHT4F.js.map +1 -0
  23. package/dist/chunk-3Y6BHIN6.js +169 -0
  24. package/dist/chunk-3Y6BHIN6.js.map +1 -0
  25. package/dist/{chunk-4K7TQHNP.js → chunk-3YPL6T3P.js} +17 -33
  26. package/dist/chunk-3YPL6T3P.js.map +1 -0
  27. package/dist/{chunk-E7SW44LM.js → chunk-44MVIRZH.js} +121 -6
  28. package/dist/chunk-44MVIRZH.js.map +1 -0
  29. package/dist/chunk-45MMSBHA.js +321 -0
  30. package/dist/chunk-45MMSBHA.js.map +1 -0
  31. package/dist/{chunk-3FMZGI7I.js → chunk-4CE6TMI5.js} +1 -1
  32. package/dist/chunk-4CE6TMI5.js.map +1 -0
  33. package/dist/{chunk-QXP3Z3JN.js → chunk-4MBCJFY4.js} +35 -3
  34. package/dist/chunk-4MBCJFY4.js.map +1 -0
  35. package/dist/chunk-4TPL54KW.js +227 -0
  36. package/dist/chunk-4TPL54KW.js.map +1 -0
  37. package/dist/chunk-54ELBTKE.js +1615 -0
  38. package/dist/chunk-54ELBTKE.js.map +1 -0
  39. package/dist/{chunk-NDGZDTSJ.js → chunk-5F4OB5B3.js} +115 -57
  40. package/dist/chunk-5F4OB5B3.js.map +1 -0
  41. package/dist/chunk-5HN4KVQU.js +3348 -0
  42. package/dist/chunk-5HN4KVQU.js.map +1 -0
  43. package/dist/{chunk-ZDZERB6L.js → chunk-5J4E5GYI.js} +572 -407
  44. package/dist/chunk-5J4E5GYI.js.map +1 -0
  45. package/dist/{chunk-ZNNXRNFD.js → chunk-5N4GGUBN.js} +48 -6
  46. package/dist/chunk-5N4GGUBN.js.map +1 -0
  47. package/dist/chunk-5USBZ2MU.js +58 -0
  48. package/dist/chunk-5USBZ2MU.js.map +1 -0
  49. package/dist/chunk-64WOMNYR.js +183 -0
  50. package/dist/chunk-64WOMNYR.js.map +1 -0
  51. package/dist/{chunk-ILNIZ5I2.js → chunk-65RS4LQS.js} +1825 -1715
  52. package/dist/chunk-65RS4LQS.js.map +1 -0
  53. package/dist/{chunk-IE7P2BZE.js → chunk-6QMDUDF2.js} +3 -3
  54. package/dist/{chunk-IADZOXKN.js → chunk-7SLOTLO7.js} +19 -697
  55. package/dist/chunk-7SLOTLO7.js.map +1 -0
  56. package/dist/{chunk-WFSPCCVW.js → chunk-7V25UAQO.js} +99 -99
  57. package/dist/{chunk-WFSPCCVW.js.map → chunk-7V25UAQO.js.map} +1 -1
  58. package/dist/chunk-BGA4DO5M.js +719 -0
  59. package/dist/chunk-BGA4DO5M.js.map +1 -0
  60. package/dist/chunk-BVP7YK2J.js +706 -0
  61. package/dist/chunk-BVP7YK2J.js.map +1 -0
  62. package/dist/chunk-C265QIMJ.js +83 -0
  63. package/dist/chunk-C265QIMJ.js.map +1 -0
  64. package/dist/{chunk-XQJXNMSB.js → chunk-CRG54LEB.js} +1 -1
  65. package/dist/chunk-CRG54LEB.js.map +1 -0
  66. package/dist/{chunk-KG3D7FIF.js → chunk-CZJOMUBP.js} +2 -2
  67. package/dist/{chunk-36RVGZNY.js → chunk-D6M3ZK66.js} +22 -39
  68. package/dist/chunk-D6M3ZK66.js.map +1 -0
  69. package/dist/{chunk-3UCIG4TG.js → chunk-DI4QAGRZ.js} +1 -11
  70. package/dist/chunk-DI4QAGRZ.js.map +1 -0
  71. package/dist/{chunk-JKKAIPTU.js → chunk-DIH2G3YG.js} +47 -10
  72. package/dist/chunk-DIH2G3YG.js.map +1 -0
  73. package/dist/chunk-DJ36BM62.js +78 -0
  74. package/dist/chunk-DJ36BM62.js.map +1 -0
  75. package/dist/chunk-DTEWAVNE.js +114 -0
  76. package/dist/chunk-DTEWAVNE.js.map +1 -0
  77. package/dist/chunk-F2KJAJ7T.js +13 -0
  78. package/dist/chunk-F2KJAJ7T.js.map +1 -0
  79. package/dist/{chunk-BF4XHEQK.js → chunk-F3QPGYOY.js} +6 -6
  80. package/dist/chunk-F3QPGYOY.js.map +1 -0
  81. package/dist/{chunk-3GNJXKIT.js → chunk-F43CV6UC.js} +2 -2
  82. package/dist/{chunk-J57UC3DD.js → chunk-FKVJKLPI.js} +3 -3
  83. package/dist/{chunk-V2LQLN5H.js → chunk-FYFHH7V5.js} +59 -8
  84. package/dist/{chunk-V2LQLN5H.js.map → chunk-FYFHH7V5.js.map} +1 -1
  85. package/dist/chunk-GAJC4BQZ.js +1096 -0
  86. package/dist/chunk-GAJC4BQZ.js.map +1 -0
  87. package/dist/{chunk-DOQGNFHM.js → chunk-GH5UKMZD.js} +2 -12
  88. package/dist/{chunk-DOQGNFHM.js.map → chunk-GH5UKMZD.js.map} +1 -1
  89. package/dist/{chunk-WYXUQGOL.js → chunk-HAZAN4UM.js} +7 -6
  90. package/dist/chunk-HAZAN4UM.js.map +1 -0
  91. package/dist/chunk-HI5XQOX2.js +393 -0
  92. package/dist/chunk-HI5XQOX2.js.map +1 -0
  93. package/dist/chunk-HKGUKAQW.js +488 -0
  94. package/dist/chunk-HKGUKAQW.js.map +1 -0
  95. package/dist/{chunk-SO3XRZPX.js → chunk-HPRVFJPM.js} +6 -6
  96. package/dist/{chunk-L6JEXB3E.js → chunk-HQR4BWKX.js} +3 -131
  97. package/dist/chunk-HQR4BWKX.js.map +1 -0
  98. package/dist/chunk-HZKANST2.js +177 -0
  99. package/dist/chunk-HZKANST2.js.map +1 -0
  100. package/dist/{chunk-UUGOUOVT.js → chunk-I557SAOM.js} +8 -2
  101. package/dist/chunk-I557SAOM.js.map +1 -0
  102. package/dist/{chunk-TC2WZLSC.js → chunk-IGLWLH73.js} +8 -7
  103. package/dist/chunk-IGLWLH73.js.map +1 -0
  104. package/dist/chunk-ILWCKCOI.js +58 -0
  105. package/dist/chunk-ILWCKCOI.js.map +1 -0
  106. package/dist/{chunk-2GP3HRYK.js → chunk-INSIW65E.js} +182 -182
  107. package/dist/{chunk-MPZUYCAP.js → chunk-IULCDMVG.js} +12 -1
  108. package/dist/chunk-IULCDMVG.js.map +1 -0
  109. package/dist/{chunk-INTFHMU4.js → chunk-IVNSUAVC.js} +25 -26
  110. package/dist/chunk-IVNSUAVC.js.map +1 -0
  111. package/dist/chunk-JDQZCREI.js +87 -0
  112. package/dist/chunk-JDQZCREI.js.map +1 -0
  113. package/dist/chunk-JHFFUVON.js +1050 -0
  114. package/dist/chunk-JHFFUVON.js.map +1 -0
  115. package/dist/{chunk-RL5UUDT4.js → chunk-JNUKLSMZ.js} +3 -3
  116. package/dist/chunk-JTILUN4W.js +2933 -0
  117. package/dist/chunk-JTILUN4W.js.map +1 -0
  118. package/dist/{chunk-OJNTCYQQ.js → chunk-JTX3BUDK.js} +37 -53
  119. package/dist/chunk-JTX3BUDK.js.map +1 -0
  120. package/dist/{chunk-X5ZBP3IY.js → chunk-JUUBBBY5.js} +2 -2
  121. package/dist/chunk-JUUBBBY5.js.map +1 -0
  122. package/dist/chunk-JWAK7JQB.js +15 -0
  123. package/dist/chunk-JWAK7JQB.js.map +1 -0
  124. package/dist/{chunk-UXZONNEQ.js → chunk-K5KNGC4I.js} +34 -31
  125. package/dist/chunk-K5KNGC4I.js.map +1 -0
  126. package/dist/chunk-KAQ4Q3TO.js +135 -0
  127. package/dist/chunk-KAQ4Q3TO.js.map +1 -0
  128. package/dist/chunk-KFVJYLVL.js +125 -0
  129. package/dist/chunk-KFVJYLVL.js.map +1 -0
  130. package/dist/chunk-KGUE5AVX.js +69 -0
  131. package/dist/chunk-KGUE5AVX.js.map +1 -0
  132. package/dist/{chunk-FVIGCDSV.js → chunk-KLDMLWXT.js} +11 -85
  133. package/dist/chunk-KLDMLWXT.js.map +1 -0
  134. package/dist/chunk-KNKDMTHU.js +453 -0
  135. package/dist/chunk-KNKDMTHU.js.map +1 -0
  136. package/dist/chunk-LDA6TAYQ.js +95 -0
  137. package/dist/chunk-LDA6TAYQ.js.map +1 -0
  138. package/dist/chunk-LWSSIZOY.js +347 -0
  139. package/dist/chunk-LWSSIZOY.js.map +1 -0
  140. package/dist/{chunk-ZURZHELF.js → chunk-MAHNZA6C.js} +158 -41
  141. package/dist/chunk-MAHNZA6C.js.map +1 -0
  142. package/dist/chunk-MEWZCIA6.js +220 -0
  143. package/dist/chunk-MEWZCIA6.js.map +1 -0
  144. package/dist/{chunk-2SNUOHAT.js → chunk-MEZJ3I63.js} +49 -1
  145. package/dist/chunk-MEZJ3I63.js.map +1 -0
  146. package/dist/chunk-MJDO4EXD.js +353 -0
  147. package/dist/chunk-MJDO4EXD.js.map +1 -0
  148. package/dist/chunk-NJA6NT3A.js +6595 -0
  149. package/dist/chunk-NJA6NT3A.js.map +1 -0
  150. package/dist/{chunk-LHHMV4GU.js → chunk-NVSKJPRC.js} +1 -1
  151. package/dist/{chunk-LHHMV4GU.js.map → chunk-NVSKJPRC.js.map} +1 -1
  152. package/dist/{chunk-4YOZGGTZ.js → chunk-OC7K2DVZ.js} +5 -5
  153. package/dist/chunk-OC7K2DVZ.js.map +1 -0
  154. package/dist/chunk-ODRPASFP.js +2078 -0
  155. package/dist/chunk-ODRPASFP.js.map +1 -0
  156. package/dist/chunk-OJJFANO6.js +133 -0
  157. package/dist/chunk-OJJFANO6.js.map +1 -0
  158. package/dist/{chunk-JNJWBTU2.js → chunk-OQWPRFAC.js} +332 -882
  159. package/dist/chunk-OQWPRFAC.js.map +1 -0
  160. package/dist/chunk-P4I7BFNJ.js +11 -0
  161. package/dist/chunk-P4I7BFNJ.js.map +1 -0
  162. package/dist/{chunk-SNNSAGMT.js → chunk-P6YQWIT2.js} +4058 -4039
  163. package/dist/chunk-P6YQWIT2.js.map +1 -0
  164. package/dist/{chunk-JRGFKVAZ.js → chunk-PETQ5WEA.js} +2 -2
  165. package/dist/{chunk-HMWYAUA6.js → chunk-Q6RSJCXB.js} +29 -69
  166. package/dist/chunk-Q6RSJCXB.js.map +1 -0
  167. package/dist/{chunk-U3IKUGRP.js → chunk-QKEUKBRK.js} +17 -23
  168. package/dist/chunk-QKEUKBRK.js.map +1 -0
  169. package/dist/{chunk-2RWB7RKE.js → chunk-QKYUCITR.js} +174 -5814
  170. package/dist/chunk-QKYUCITR.js.map +1 -0
  171. package/dist/chunk-QQDPRTLP.js +127 -0
  172. package/dist/chunk-QQDPRTLP.js.map +1 -0
  173. package/dist/chunk-QQYCYAKI.js +79 -0
  174. package/dist/chunk-QQYCYAKI.js.map +1 -0
  175. package/dist/chunk-R4KDH477.js +1064 -0
  176. package/dist/chunk-R4KDH477.js.map +1 -0
  177. package/dist/chunk-R5TR2DIK.js +119 -0
  178. package/dist/chunk-R5TR2DIK.js.map +1 -0
  179. package/dist/chunk-R62PKTAG.js +66 -0
  180. package/dist/chunk-R62PKTAG.js.map +1 -0
  181. package/dist/{chunk-BFDQ4WNW.js → chunk-RFZA7PSM.js} +4 -5
  182. package/dist/chunk-RFZA7PSM.js.map +1 -0
  183. package/dist/chunk-RGCPELQN.js +219 -0
  184. package/dist/chunk-RGCPELQN.js.map +1 -0
  185. package/dist/chunk-RGVCOG2S.js +910 -0
  186. package/dist/chunk-RGVCOG2S.js.map +1 -0
  187. package/dist/chunk-SOLNJ3AZ.js +209 -0
  188. package/dist/chunk-SOLNJ3AZ.js.map +1 -0
  189. package/dist/chunk-TFT2X7SH.js +77 -0
  190. package/dist/chunk-TFT2X7SH.js.map +1 -0
  191. package/dist/chunk-TUCKEEXE.js +2 -0
  192. package/dist/chunk-TVWCLUBI.js +293 -0
  193. package/dist/chunk-TVWCLUBI.js.map +1 -0
  194. package/dist/chunk-U4TRWSVE.js +78 -0
  195. package/dist/chunk-U4TRWSVE.js.map +1 -0
  196. package/dist/chunk-UIB33QQP.js +379 -0
  197. package/dist/chunk-UIB33QQP.js.map +1 -0
  198. package/dist/chunk-V6GIVALQ.js +1889 -0
  199. package/dist/chunk-V6GIVALQ.js.map +1 -0
  200. package/dist/chunk-VHXCPXUS.js +366 -0
  201. package/dist/chunk-VHXCPXUS.js.map +1 -0
  202. package/dist/{chunk-HGZEPQUT.js → chunk-VU6GMWF6.js} +17 -8
  203. package/dist/chunk-VU6GMWF6.js.map +1 -0
  204. package/dist/chunk-VWZYE3NC.js +8415 -0
  205. package/dist/chunk-VWZYE3NC.js.map +1 -0
  206. package/dist/{chunk-AGMVASXZ.js → chunk-W2GXIARJ.js} +88 -11
  207. package/dist/chunk-W2GXIARJ.js.map +1 -0
  208. package/dist/chunk-W4G3K3V7.js +288 -0
  209. package/dist/chunk-W4G3K3V7.js.map +1 -0
  210. package/dist/chunk-W74LJ5OT.js +588 -0
  211. package/dist/chunk-W74LJ5OT.js.map +1 -0
  212. package/dist/chunk-W7ELYLYK.js +233 -0
  213. package/dist/chunk-W7ELYLYK.js.map +1 -0
  214. package/dist/{chunk-BPMWXTFX.js → chunk-WFZX352D.js} +7 -7
  215. package/dist/chunk-WXA3WTPF.js +20 -0
  216. package/dist/chunk-WXA3WTPF.js.map +1 -0
  217. package/dist/chunk-XRGFH7FI.js +454 -0
  218. package/dist/chunk-XRGFH7FI.js.map +1 -0
  219. package/dist/chunk-XSCGUO2U.js +330 -0
  220. package/dist/chunk-XSCGUO2U.js.map +1 -0
  221. package/dist/chunk-XWROSMI5.js +1039 -0
  222. package/dist/chunk-XWROSMI5.js.map +1 -0
  223. package/dist/chunk-Y2EXZ47H.js +40 -0
  224. package/dist/chunk-Y2EXZ47H.js.map +1 -0
  225. package/dist/chunk-YJGEVBKZ.js +47 -0
  226. package/dist/chunk-YJGEVBKZ.js.map +1 -0
  227. package/dist/{chunk-6CMM6YCB.js → chunk-YWWMISDY.js} +2 -2
  228. package/dist/{chunk-WXA2BWTE.js → chunk-ZCT5DJ3G.js} +2 -48
  229. package/dist/chunk-ZCT5DJ3G.js.map +1 -0
  230. package/dist/chunk-ZEYA2WWX.js +982 -0
  231. package/dist/chunk-ZEYA2WWX.js.map +1 -0
  232. package/dist/chunk-ZRC7Z5X3.js +82 -0
  233. package/dist/chunk-ZRC7Z5X3.js.map +1 -0
  234. package/dist/{chunk-3AIHRXKO.js → chunk-ZS7JIUJ3.js} +12 -10
  235. package/dist/chunk-ZS7JIUJ3.js.map +1 -0
  236. package/dist/{clack-EZ7TDWQU.js → clack-Q4RNC5VE.js} +2 -6
  237. package/dist/{claude-cli-2YKABJJZ.js → claude-cli-GIIHOBGT.js} +4 -2
  238. package/dist/claude-install-BAUSJMW3.js +64 -0
  239. package/dist/{cli-E36SPKBW.js → cli-QY4KKA3D.js} +632 -150
  240. package/dist/cli-QY4KKA3D.js.map +1 -0
  241. package/dist/client-3YQKORVK.js +710 -0
  242. package/dist/client-3YQKORVK.js.map +1 -0
  243. package/dist/{codex-event-ZO2GEFE6.js → codex-event-EUTCAOTQ.js} +3 -5
  244. package/dist/{codex-host-KECJVTA2.js → codex-host-ZON3S6HU.js} +7 -7
  245. package/dist/{codex-install-HQZDGFXW.js → codex-install-HZV2DOAB.js} +242 -88
  246. package/dist/codex-install-HZV2DOAB.js.map +1 -0
  247. package/dist/config-QZOBMTEL.js +57 -0
  248. package/dist/config-names-Z5NZD5R2.js +224 -0
  249. package/dist/config-names-Z5NZD5R2.js.map +1 -0
  250. package/dist/config-rules-YOYHS6YL.js +55 -0
  251. package/dist/config-subagents-WQV2ZAD5.js +362 -0
  252. package/dist/config-subagents-WQV2ZAD5.js.map +1 -0
  253. package/dist/connect-YDWTYU4B.js +1020 -0
  254. package/dist/connect-YDWTYU4B.js.map +1 -0
  255. package/dist/core-0a66n3e7-TTP554XV.js +127 -0
  256. package/dist/core-0a66n3e7-TTP554XV.js.map +1 -0
  257. package/dist/core-0bmnpbz2-C2JIRVZO.js +10790 -0
  258. package/dist/core-0bmnpbz2-C2JIRVZO.js.map +1 -0
  259. package/dist/core-9je8ee1j-74DGHWPV.js +30 -0
  260. package/dist/core-9je8ee1j-74DGHWPV.js.map +1 -0
  261. package/dist/core-wadgcjfh-TSZFQZGH.js +666 -0
  262. package/dist/core-wadgcjfh-TSZFQZGH.js.map +1 -0
  263. package/dist/core-zg882d22-LKV5DZYW.js +37 -0
  264. package/dist/core-zg882d22-LKV5DZYW.js.map +1 -0
  265. package/dist/decision-QSKHOGCO.js +145 -0
  266. package/dist/{doctor-I6XQEKWD.js → doctor-ZWJXRD75.js} +162 -148
  267. package/dist/doctor-ZWJXRD75.js.map +1 -0
  268. package/dist/{env-proxy-R6ZMLQTT.js → env-proxy-XLSLHBKQ.js} +2 -2
  269. package/dist/{ethersCompat-Df4a6QIZ-X6YZWAML.js → ethersCompat-Df4a6QIZ-K3DMHR6Y.js} +5 -5
  270. package/dist/explicit-ME2NRADQ.js +371 -0
  271. package/dist/explicit-ME2NRADQ.js.map +1 -0
  272. package/dist/flush-stdio-NYIJ3QXT.js +18 -0
  273. package/dist/fund-VF7TLDJH.js +722 -0
  274. package/dist/fund-VF7TLDJH.js.map +1 -0
  275. package/dist/hook-command-VZ27MGWO.js +49 -0
  276. package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
  277. package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +2 -2
  278. package/dist/hosts/claude/tenjin/hooks/hook-data.ts +152 -0
  279. package/dist/hosts/claude/tenjin/hooks/hooks.json +7 -0
  280. package/dist/hosts/claude/tenjin/hooks/model-viewer.tsx +2987 -0
  281. package/dist/hosts/claude/tenjin/hooks/register.tsx +527 -56
  282. package/dist/hosts/claude/tenjin/skills/tenjin-pay/SKILL.md +14 -4
  283. package/dist/hosts/claude/tenjin/types/index.d.ts +144 -1
  284. package/dist/{hosts-DVQJ32QC.js → hosts-3EMTVM4H.js} +7 -6
  285. package/dist/index.js +18 -15
  286. package/dist/index.js.map +1 -1
  287. package/dist/install-ZA7L2UF3.js +115 -0
  288. package/dist/install-funding-JDGYTF72.js +30 -0
  289. package/dist/install-identity-FFAYEFLX.js +30 -0
  290. package/dist/{install-wallet-5M4OTYLX.js → install-wallet-2SFOVE3Q.js} +68 -53
  291. package/dist/install-wallet-2SFOVE3Q.js.map +1 -0
  292. package/dist/mcp-36S6MK3C.js +67642 -0
  293. package/dist/mcp-36S6MK3C.js.map +1 -0
  294. package/dist/new-install-5L4GY3LN.js +51 -0
  295. package/dist/{package-IJFGMWEV.js → package-BONDXSV3.js} +2 -2
  296. package/dist/{passphrase-IFTDS3CU.js → passphrase-T4ULBN4M.js} +16 -12
  297. package/dist/{paths-XCSAKISU.js → paths-O2KDWZ76.js} +18 -28
  298. package/dist/pay-CMV5KL74.js +74 -0
  299. package/dist/{payments-HFPPWHTV.js → payments-Z6UBZL4Z.js} +36 -26
  300. package/dist/payments-Z6UBZL4Z.js.map +1 -0
  301. package/dist/reclaim-subagent-credit-ABSF67SJ.js +105 -0
  302. package/dist/reclaim-subagent-credit-ABSF67SJ.js.map +1 -0
  303. package/dist/{redact-D7ASVWKL.js → redact-LOTHE5TS.js} +2 -8
  304. package/dist/redact-LOTHE5TS.js.map +1 -0
  305. package/dist/routing-quote-AHLAREXR.js +40 -0
  306. package/dist/routing-quote-AHLAREXR.js.map +1 -0
  307. package/dist/run-JH7ELYAM.js +88 -0
  308. package/dist/run-JH7ELYAM.js.map +1 -0
  309. package/dist/runtime-2GX4ALJP.js +410 -0
  310. package/dist/runtime-2GX4ALJP.js.map +1 -0
  311. package/dist/runtime-activate-IDQ2NCSP.js +39 -0
  312. package/dist/runtime-activate-IDQ2NCSP.js.map +1 -0
  313. package/dist/{runtime-fetch-ZSSSK72Y.js → runtime-fetch-6LOBHBEN.js} +4 -4
  314. package/dist/runtime-fetch-6LOBHBEN.js.map +1 -0
  315. package/dist/runtime-launchers-YAPKCBHV.js +31 -0
  316. package/dist/runtime-launchers-YAPKCBHV.js.map +1 -0
  317. package/dist/{runtime-layout-WIDILZ6K.js → runtime-layout-QHZQJV7C.js} +5 -4
  318. package/dist/runtime-layout-QHZQJV7C.js.map +1 -0
  319. package/dist/runtime-place-4POL4KK4.js +37 -0
  320. package/dist/runtime-place-4POL4KK4.js.map +1 -0
  321. package/dist/runtime-provenance-MNJGVBV2.js +12 -0
  322. package/dist/runtime-provenance-MNJGVBV2.js.map +1 -0
  323. package/dist/{secp256k1-ZZZT2CAX.js → secp256k1-N5P2GVGF.js} +3 -3
  324. package/dist/secp256k1-N5P2GVGF.js.map +1 -0
  325. package/dist/{send-GCVEAQKL.js → send-ELXFKEKY.js} +35 -32
  326. package/dist/send-ELXFKEKY.js.map +1 -0
  327. package/dist/status-FXUFWJDM.js +404 -0
  328. package/dist/status-FXUFWJDM.js.map +1 -0
  329. package/dist/{status-line-OPCXDHL2.js → status-line-IH5JBWBC.js} +51 -43
  330. package/dist/status-line-IH5JBWBC.js.map +1 -0
  331. package/dist/streamableHttp-CP2ZQBIK.js +768 -0
  332. package/dist/streamableHttp-CP2ZQBIK.js.map +1 -0
  333. package/dist/{uninstall-BAWRBXXQ.js → uninstall-LJZUKM4D.js} +76 -76
  334. package/dist/uninstall-LJZUKM4D.js.map +1 -0
  335. package/dist/update-EUIX72IX.js +68 -0
  336. package/dist/update-EUIX72IX.js.map +1 -0
  337. package/dist/usage-EKDC7LUC.js +180 -0
  338. package/dist/usage-EKDC7LUC.js.map +1 -0
  339. package/dist/{usdc-VG4CIOUK.js → usdc-YIHK2OMC.js} +8 -12
  340. package/dist/usdc-YIHK2OMC.js.map +1 -0
  341. package/dist/{viemAdapter-By13KInL-DOFTEIJV.js → viemAdapter-By13KInL-PRLSIESK.js} +5 -5
  342. package/dist/viemAdapter-By13KInL-PRLSIESK.js.map +1 -0
  343. package/dist/wallet-HSW757W6.js +80 -0
  344. package/dist/wallet-HSW757W6.js.map +1 -0
  345. package/dist/wallet-kdf-worker.mjs +1433 -818
  346. package/docs/agent-permissions.md +88 -155
  347. package/docs/router-reference.md +236 -0
  348. package/docs/safety-model.md +31 -33
  349. package/docs/subagents-internals.md +97 -0
  350. package/docs/subagents.md +348 -0
  351. package/docs/troubleshooting.md +10 -6
  352. package/package.json +12 -8
  353. package/scripts/installers/install.sh +7 -1
  354. package/dist/alive-GSOWKUOY.js +0 -38
  355. package/dist/chunk-2I4QTOLB.js.map +0 -1
  356. package/dist/chunk-2M2VPI2E.js +0 -560
  357. package/dist/chunk-2M2VPI2E.js.map +0 -1
  358. package/dist/chunk-2RWB7RKE.js.map +0 -1
  359. package/dist/chunk-2SNUOHAT.js.map +0 -1
  360. package/dist/chunk-3623BLPV.js +0 -184
  361. package/dist/chunk-3623BLPV.js.map +0 -1
  362. package/dist/chunk-36RVGZNY.js.map +0 -1
  363. package/dist/chunk-3AIHRXKO.js.map +0 -1
  364. package/dist/chunk-3FMZGI7I.js.map +0 -1
  365. package/dist/chunk-3UCIG4TG.js.map +0 -1
  366. package/dist/chunk-4K7TQHNP.js.map +0 -1
  367. package/dist/chunk-4LMUQMBH.js +0 -29
  368. package/dist/chunk-4LMUQMBH.js.map +0 -1
  369. package/dist/chunk-4USCZ2NI.js +0 -228
  370. package/dist/chunk-4USCZ2NI.js.map +0 -1
  371. package/dist/chunk-4YOZGGTZ.js.map +0 -1
  372. package/dist/chunk-62KNUYWD.js +0 -111
  373. package/dist/chunk-62KNUYWD.js.map +0 -1
  374. package/dist/chunk-A5GKIG5O.js +0 -2037
  375. package/dist/chunk-A5GKIG5O.js.map +0 -1
  376. package/dist/chunk-AGMVASXZ.js.map +0 -1
  377. package/dist/chunk-BF4XHEQK.js.map +0 -1
  378. package/dist/chunk-BFDQ4WNW.js.map +0 -1
  379. package/dist/chunk-C2Q76BVM.js.map +0 -1
  380. package/dist/chunk-CEXSOI5R.js +0 -808
  381. package/dist/chunk-CEXSOI5R.js.map +0 -1
  382. package/dist/chunk-E7SW44LM.js.map +0 -1
  383. package/dist/chunk-EDJWHDDL.js +0 -33
  384. package/dist/chunk-EDJWHDDL.js.map +0 -1
  385. package/dist/chunk-FVIGCDSV.js.map +0 -1
  386. package/dist/chunk-GTTUCOPD.js +0 -105
  387. package/dist/chunk-GTTUCOPD.js.map +0 -1
  388. package/dist/chunk-HDPUXS3Z.js +0 -122
  389. package/dist/chunk-HDPUXS3Z.js.map +0 -1
  390. package/dist/chunk-HGGWCP7W.js +0 -120
  391. package/dist/chunk-HGGWCP7W.js.map +0 -1
  392. package/dist/chunk-HGZEPQUT.js.map +0 -1
  393. package/dist/chunk-HMWYAUA6.js.map +0 -1
  394. package/dist/chunk-IADZOXKN.js.map +0 -1
  395. package/dist/chunk-ILNIZ5I2.js.map +0 -1
  396. package/dist/chunk-INTFHMU4.js.map +0 -1
  397. package/dist/chunk-JKKAIPTU.js.map +0 -1
  398. package/dist/chunk-JNJWBTU2.js.map +0 -1
  399. package/dist/chunk-KM7RY2ZS.js +0 -246
  400. package/dist/chunk-KM7RY2ZS.js.map +0 -1
  401. package/dist/chunk-KOGZDMHO.js +0 -21
  402. package/dist/chunk-KOGZDMHO.js.map +0 -1
  403. package/dist/chunk-L6JEXB3E.js.map +0 -1
  404. package/dist/chunk-LRW6S53P.js.map +0 -1
  405. package/dist/chunk-LXAYUOXI.js +0 -511
  406. package/dist/chunk-LXAYUOXI.js.map +0 -1
  407. package/dist/chunk-MEFB5KHA.js +0 -59
  408. package/dist/chunk-MEFB5KHA.js.map +0 -1
  409. package/dist/chunk-MPZUYCAP.js.map +0 -1
  410. package/dist/chunk-NDGZDTSJ.js.map +0 -1
  411. package/dist/chunk-OJNTCYQQ.js.map +0 -1
  412. package/dist/chunk-P3LFTKE7.js +0 -58
  413. package/dist/chunk-P3LFTKE7.js.map +0 -1
  414. package/dist/chunk-QXP3Z3JN.js.map +0 -1
  415. package/dist/chunk-RVPYTUP4.js.map +0 -1
  416. package/dist/chunk-SNNSAGMT.js.map +0 -1
  417. package/dist/chunk-TC2WZLSC.js.map +0 -1
  418. package/dist/chunk-TKPF35W6.js +0 -29
  419. package/dist/chunk-TKPF35W6.js.map +0 -1
  420. package/dist/chunk-U3IKUGRP.js.map +0 -1
  421. package/dist/chunk-UUGOUOVT.js.map +0 -1
  422. package/dist/chunk-UXZONNEQ.js.map +0 -1
  423. package/dist/chunk-WXA2BWTE.js.map +0 -1
  424. package/dist/chunk-WYXUQGOL.js.map +0 -1
  425. package/dist/chunk-X5ZBP3IY.js.map +0 -1
  426. package/dist/chunk-XKESD27X.js +0 -10
  427. package/dist/chunk-XKESD27X.js.map +0 -1
  428. package/dist/chunk-XQJXNMSB.js.map +0 -1
  429. package/dist/chunk-Y527D4TV.js +0 -56
  430. package/dist/chunk-Y527D4TV.js.map +0 -1
  431. package/dist/chunk-ZDZERB6L.js.map +0 -1
  432. package/dist/chunk-ZNNXRNFD.js.map +0 -1
  433. package/dist/chunk-ZURZHELF.js.map +0 -1
  434. package/dist/cli-E36SPKBW.js.map +0 -1
  435. package/dist/codex-install-HQZDGFXW.js.map +0 -1
  436. package/dist/config-HY2E4GGW.js +0 -55
  437. package/dist/doctor-I6XQEKWD.js.map +0 -1
  438. package/dist/fund-2QRO7OJL.js +0 -378
  439. package/dist/fund-2QRO7OJL.js.map +0 -1
  440. package/dist/hook-command-2UBCSZG6.js +0 -43
  441. package/dist/install-ILUX5C4A.js +0 -107
  442. package/dist/install-identity-TZKGY6LQ.js +0 -31
  443. package/dist/install-wallet-5M4OTYLX.js.map +0 -1
  444. package/dist/mcp-LE4DUS22.js +0 -14127
  445. package/dist/mcp-LE4DUS22.js.map +0 -1
  446. package/dist/pay-WCG3IH4R.js +0 -55
  447. package/dist/payments-HFPPWHTV.js.map +0 -1
  448. package/dist/plugin-registration-PZFI5GZW.js +0 -68
  449. package/dist/runtime-UZOKSUZX.js +0 -1321
  450. package/dist/runtime-UZOKSUZX.js.map +0 -1
  451. package/dist/send-GCVEAQKL.js.map +0 -1
  452. package/dist/status-HCVAOCN7.js +0 -150
  453. package/dist/status-HCVAOCN7.js.map +0 -1
  454. package/dist/status-line-OPCXDHL2.js.map +0 -1
  455. package/dist/uninstall-BAWRBXXQ.js.map +0 -1
  456. package/dist/update-CACXLQLR.js +0 -56
  457. package/dist/wallet-QL4UUXEZ.js +0 -55
  458. /package/dist/{_esm-BIN7VY2L.js.map → _esm-2KST7HQ7.js.map} +0 -0
  459. /package/dist/{alive-GSOWKUOY.js.map → alive-5TV22PNF.js.map} +0 -0
  460. /package/dist/{auto-update-Y24UL56V.js.map → auth-XI7BJFLW.js.map} +0 -0
  461. /package/dist/{ccip-DHDFKTQV.js.map → auto-update-7L24KDWA.js.map} +0 -0
  462. /package/dist/{clack-EZ7TDWQU.js.map → balance-DFHC6XEU.js.map} +0 -0
  463. /package/dist/{claude-cli-2YKABJJZ.js.map → ccip-HOW3DZYF.js.map} +0 -0
  464. /package/dist/{chunk-IE7P2BZE.js.map → chunk-6QMDUDF2.js.map} +0 -0
  465. /package/dist/{chunk-KG3D7FIF.js.map → chunk-CZJOMUBP.js.map} +0 -0
  466. /package/dist/{chunk-3GNJXKIT.js.map → chunk-F43CV6UC.js.map} +0 -0
  467. /package/dist/{chunk-J57UC3DD.js.map → chunk-FKVJKLPI.js.map} +0 -0
  468. /package/dist/{chunk-SO3XRZPX.js.map → chunk-HPRVFJPM.js.map} +0 -0
  469. /package/dist/{chunk-2GP3HRYK.js.map → chunk-INSIW65E.js.map} +0 -0
  470. /package/dist/{chunk-RL5UUDT4.js.map → chunk-JNUKLSMZ.js.map} +0 -0
  471. /package/dist/{chunk-JRGFKVAZ.js.map → chunk-PETQ5WEA.js.map} +0 -0
  472. /package/dist/{codex-event-ZO2GEFE6.js.map → chunk-TUCKEEXE.js.map} +0 -0
  473. /package/dist/{chunk-BPMWXTFX.js.map → chunk-WFZX352D.js.map} +0 -0
  474. /package/dist/{chunk-6CMM6YCB.js.map → chunk-YWWMISDY.js.map} +0 -0
  475. /package/dist/{codex-host-KECJVTA2.js.map → clack-Q4RNC5VE.js.map} +0 -0
  476. /package/dist/{config-HY2E4GGW.js.map → claude-cli-GIIHOBGT.js.map} +0 -0
  477. /package/dist/{env-proxy-R6ZMLQTT.js.map → claude-install-BAUSJMW3.js.map} +0 -0
  478. /package/dist/{ethersCompat-Df4a6QIZ-X6YZWAML.js.map → codex-event-EUTCAOTQ.js.map} +0 -0
  479. /package/dist/{hook-command-2UBCSZG6.js.map → codex-host-ZON3S6HU.js.map} +0 -0
  480. /package/dist/{hosts-DVQJ32QC.js.map → config-QZOBMTEL.js.map} +0 -0
  481. /package/dist/{install-ILUX5C4A.js.map → config-rules-YOYHS6YL.js.map} +0 -0
  482. /package/dist/{install-identity-TZKGY6LQ.js.map → decision-QSKHOGCO.js.map} +0 -0
  483. /package/dist/{package-IJFGMWEV.js.map → env-proxy-XLSLHBKQ.js.map} +0 -0
  484. /package/dist/{passphrase-IFTDS3CU.js.map → ethersCompat-Df4a6QIZ-K3DMHR6Y.js.map} +0 -0
  485. /package/dist/{paths-XCSAKISU.js.map → flush-stdio-NYIJ3QXT.js.map} +0 -0
  486. /package/dist/{pay-WCG3IH4R.js.map → hook-command-VZ27MGWO.js.map} +0 -0
  487. /package/dist/{plugin-registration-PZFI5GZW.js.map → hosts-3EMTVM4H.js.map} +0 -0
  488. /package/dist/{redact-D7ASVWKL.js.map → install-ZA7L2UF3.js.map} +0 -0
  489. /package/dist/{runtime-fetch-ZSSSK72Y.js.map → install-funding-JDGYTF72.js.map} +0 -0
  490. /package/dist/{runtime-layout-WIDILZ6K.js.map → install-identity-FFAYEFLX.js.map} +0 -0
  491. /package/dist/{secp256k1-ZZZT2CAX.js.map → new-install-5L4GY3LN.js.map} +0 -0
  492. /package/dist/{update-CACXLQLR.js.map → package-BONDXSV3.js.map} +0 -0
  493. /package/dist/{usdc-VG4CIOUK.js.map → passphrase-T4ULBN4M.js.map} +0 -0
  494. /package/dist/{viemAdapter-By13KInL-DOFTEIJV.js.map → paths-O2KDWZ76.js.map} +0 -0
  495. /package/dist/{wallet-QL4UUXEZ.js.map → pay-CMV5KL74.js.map} +0 -0
@@ -0,0 +1,710 @@
1
+ import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ AjvJsonSchemaValidator,
4
+ Protocol,
5
+ assertClientRequestTaskCapability,
6
+ assertToolsCallTaskCapability,
7
+ getLiteralValue,
8
+ getObjectShape,
9
+ mergeCapabilities,
10
+ safeParse
11
+ } from "./chunk-NJA6NT3A.js";
12
+ import {
13
+ CallToolResultSchema,
14
+ CompleteResultSchema,
15
+ CreateMessageRequestSchema,
16
+ CreateMessageResultSchema,
17
+ CreateMessageResultWithToolsSchema,
18
+ CreateTaskResultSchema,
19
+ ElicitRequestSchema,
20
+ ElicitResultSchema,
21
+ EmptyResultSchema,
22
+ ErrorCode,
23
+ GetPromptResultSchema,
24
+ InitializeResultSchema,
25
+ LATEST_PROTOCOL_VERSION,
26
+ ListChangedOptionsBaseSchema,
27
+ ListPromptsResultSchema,
28
+ ListResourceTemplatesResultSchema,
29
+ ListResourcesResultSchema,
30
+ ListToolsResultSchema,
31
+ McpError,
32
+ PromptListChangedNotificationSchema,
33
+ ReadResourceResultSchema,
34
+ ResourceListChangedNotificationSchema,
35
+ SUPPORTED_PROTOCOL_VERSIONS,
36
+ ToolListChangedNotificationSchema
37
+ } from "./chunk-54ELBTKE.js";
38
+ import "./chunk-QKYUCITR.js";
39
+ import "./chunk-P6YQWIT2.js";
40
+ import "./chunk-ZXTAQYNA.js";
41
+
42
+ // node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.0_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js
43
+ var ExperimentalClientTasks = class {
44
+ constructor(_client) {
45
+ this._client = _client;
46
+ }
47
+ /**
48
+ * Calls a tool and returns an AsyncGenerator that yields response messages.
49
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
50
+ *
51
+ * This method provides streaming access to tool execution, allowing you to
52
+ * observe intermediate task status updates for long-running tool calls.
53
+ * Automatically validates structured output if the tool has an outputSchema.
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * const stream = client.experimental.tasks.callToolStream({ name: 'myTool', arguments: {} });
58
+ * for await (const message of stream) {
59
+ * switch (message.type) {
60
+ * case 'taskCreated':
61
+ * console.log('Tool execution started:', message.task.taskId);
62
+ * break;
63
+ * case 'taskStatus':
64
+ * console.log('Tool status:', message.task.status);
65
+ * break;
66
+ * case 'result':
67
+ * console.log('Tool result:', message.result);
68
+ * break;
69
+ * case 'error':
70
+ * console.error('Tool error:', message.error);
71
+ * break;
72
+ * }
73
+ * }
74
+ * ```
75
+ *
76
+ * @param params - Tool call parameters (name and arguments)
77
+ * @param resultSchema - Zod schema for validating the result (defaults to CallToolResultSchema)
78
+ * @param options - Optional request options (timeout, signal, task creation params, etc.)
79
+ * @returns AsyncGenerator that yields ResponseMessage objects
80
+ *
81
+ * @experimental
82
+ */
83
+ async *callToolStream(params, resultSchema = CallToolResultSchema, options) {
84
+ const clientInternal = this._client;
85
+ const optionsWithTask = {
86
+ ...options,
87
+ // We check if the tool is known to be a task during auto-configuration, but assume
88
+ // the caller knows what they're doing if they pass this explicitly
89
+ task: options?.task ?? (clientInternal.isToolTask(params.name) ? {} : void 0)
90
+ };
91
+ const stream = clientInternal.requestStream({ method: "tools/call", params }, resultSchema, optionsWithTask);
92
+ const validator = clientInternal.getToolOutputValidator(params.name);
93
+ for await (const message of stream) {
94
+ if (message.type === "result" && validator) {
95
+ const result = message.result;
96
+ if (!result.structuredContent && !result.isError) {
97
+ yield {
98
+ type: "error",
99
+ error: new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`)
100
+ };
101
+ return;
102
+ }
103
+ if (result.structuredContent) {
104
+ try {
105
+ const validationResult = validator(result.structuredContent);
106
+ if (!validationResult.valid) {
107
+ yield {
108
+ type: "error",
109
+ error: new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`)
110
+ };
111
+ return;
112
+ }
113
+ } catch (error) {
114
+ if (error instanceof McpError) {
115
+ yield { type: "error", error };
116
+ return;
117
+ }
118
+ yield {
119
+ type: "error",
120
+ error: new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`)
121
+ };
122
+ return;
123
+ }
124
+ }
125
+ }
126
+ yield message;
127
+ }
128
+ }
129
+ /**
130
+ * Gets the current status of a task.
131
+ *
132
+ * @param taskId - The task identifier
133
+ * @param options - Optional request options
134
+ * @returns The task status
135
+ *
136
+ * @experimental
137
+ */
138
+ async getTask(taskId, options) {
139
+ return this._client.getTask({ taskId }, options);
140
+ }
141
+ /**
142
+ * Retrieves the result of a completed task.
143
+ *
144
+ * @param taskId - The task identifier
145
+ * @param resultSchema - Zod schema for validating the result
146
+ * @param options - Optional request options
147
+ * @returns The task result
148
+ *
149
+ * @experimental
150
+ */
151
+ async getTaskResult(taskId, resultSchema, options) {
152
+ return this._client.getTaskResult({ taskId }, resultSchema, options);
153
+ }
154
+ /**
155
+ * Lists tasks with optional pagination.
156
+ *
157
+ * @param cursor - Optional pagination cursor
158
+ * @param options - Optional request options
159
+ * @returns List of tasks with optional next cursor
160
+ *
161
+ * @experimental
162
+ */
163
+ async listTasks(cursor, options) {
164
+ return this._client.listTasks(cursor ? { cursor } : void 0, options);
165
+ }
166
+ /**
167
+ * Cancels a running task.
168
+ *
169
+ * @param taskId - The task identifier
170
+ * @param options - Optional request options
171
+ *
172
+ * @experimental
173
+ */
174
+ async cancelTask(taskId, options) {
175
+ return this._client.cancelTask({ taskId }, options);
176
+ }
177
+ /**
178
+ * Sends a request and returns an AsyncGenerator that yields response messages.
179
+ * The generator is guaranteed to end with either a 'result' or 'error' message.
180
+ *
181
+ * This method provides streaming access to request processing, allowing you to
182
+ * observe intermediate task status updates for task-augmented requests.
183
+ *
184
+ * @param request - The request to send
185
+ * @param resultSchema - Zod schema for validating the result
186
+ * @param options - Optional request options (timeout, signal, task creation params, etc.)
187
+ * @returns AsyncGenerator that yields ResponseMessage objects
188
+ *
189
+ * @experimental
190
+ */
191
+ requestStream(request, resultSchema, options) {
192
+ return this._client.requestStream(request, resultSchema, options);
193
+ }
194
+ };
195
+
196
+ // node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.0_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
197
+ function applyElicitationDefaults(schema, data) {
198
+ if (!schema || data === null || typeof data !== "object")
199
+ return;
200
+ if (schema.type === "object" && schema.properties && typeof schema.properties === "object") {
201
+ const obj = data;
202
+ const props = schema.properties;
203
+ for (const key of Object.keys(props)) {
204
+ const propSchema = props[key];
205
+ if (obj[key] === void 0 && Object.prototype.hasOwnProperty.call(propSchema, "default")) {
206
+ obj[key] = propSchema.default;
207
+ }
208
+ if (obj[key] !== void 0) {
209
+ applyElicitationDefaults(propSchema, obj[key]);
210
+ }
211
+ }
212
+ }
213
+ if (Array.isArray(schema.anyOf)) {
214
+ for (const sub of schema.anyOf) {
215
+ if (typeof sub !== "boolean") {
216
+ applyElicitationDefaults(sub, data);
217
+ }
218
+ }
219
+ }
220
+ if (Array.isArray(schema.oneOf)) {
221
+ for (const sub of schema.oneOf) {
222
+ if (typeof sub !== "boolean") {
223
+ applyElicitationDefaults(sub, data);
224
+ }
225
+ }
226
+ }
227
+ }
228
+ function getSupportedElicitationModes(capabilities) {
229
+ if (!capabilities) {
230
+ return { supportsFormMode: false, supportsUrlMode: false };
231
+ }
232
+ const hasFormCapability = capabilities.form !== void 0;
233
+ const hasUrlCapability = capabilities.url !== void 0;
234
+ const supportsFormMode = hasFormCapability || !hasFormCapability && !hasUrlCapability;
235
+ const supportsUrlMode = hasUrlCapability;
236
+ return { supportsFormMode, supportsUrlMode };
237
+ }
238
+ var Client = class extends Protocol {
239
+ /**
240
+ * Initializes this client with the given name and version information.
241
+ */
242
+ constructor(_clientInfo, options) {
243
+ super(options);
244
+ this._clientInfo = _clientInfo;
245
+ this._cachedToolOutputValidators = /* @__PURE__ */ new Map();
246
+ this._cachedKnownTaskTools = /* @__PURE__ */ new Set();
247
+ this._cachedRequiredTaskTools = /* @__PURE__ */ new Set();
248
+ this._listChangedDebounceTimers = /* @__PURE__ */ new Map();
249
+ this._capabilities = options?.capabilities ?? {};
250
+ this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new AjvJsonSchemaValidator();
251
+ if (options?.listChanged) {
252
+ this._pendingListChangedConfig = options.listChanged;
253
+ }
254
+ }
255
+ /**
256
+ * Set up handlers for list changed notifications based on config and server capabilities.
257
+ * This should only be called after initialization when server capabilities are known.
258
+ * Handlers are silently skipped if the server doesn't advertise the corresponding listChanged capability.
259
+ * @internal
260
+ */
261
+ _setupListChangedHandlers(config) {
262
+ if (config.tools && this._serverCapabilities?.tools?.listChanged) {
263
+ this._setupListChangedHandler("tools", ToolListChangedNotificationSchema, config.tools, async () => {
264
+ const result = await this.listTools();
265
+ return result.tools;
266
+ });
267
+ }
268
+ if (config.prompts && this._serverCapabilities?.prompts?.listChanged) {
269
+ this._setupListChangedHandler("prompts", PromptListChangedNotificationSchema, config.prompts, async () => {
270
+ const result = await this.listPrompts();
271
+ return result.prompts;
272
+ });
273
+ }
274
+ if (config.resources && this._serverCapabilities?.resources?.listChanged) {
275
+ this._setupListChangedHandler("resources", ResourceListChangedNotificationSchema, config.resources, async () => {
276
+ const result = await this.listResources();
277
+ return result.resources;
278
+ });
279
+ }
280
+ }
281
+ /**
282
+ * Access experimental features.
283
+ *
284
+ * WARNING: These APIs are experimental and may change without notice.
285
+ *
286
+ * @experimental
287
+ */
288
+ get experimental() {
289
+ if (!this._experimental) {
290
+ this._experimental = {
291
+ tasks: new ExperimentalClientTasks(this)
292
+ };
293
+ }
294
+ return this._experimental;
295
+ }
296
+ /**
297
+ * Registers new capabilities. This can only be called before connecting to a transport.
298
+ *
299
+ * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
300
+ */
301
+ registerCapabilities(capabilities) {
302
+ if (this.transport) {
303
+ throw new Error("Cannot register capabilities after connecting to transport");
304
+ }
305
+ this._capabilities = mergeCapabilities(this._capabilities, capabilities);
306
+ }
307
+ /**
308
+ * Override request handler registration to enforce client-side validation for elicitation.
309
+ */
310
+ setRequestHandler(requestSchema, handler) {
311
+ const shape = getObjectShape(requestSchema);
312
+ const methodSchema = shape?.method;
313
+ if (!methodSchema) {
314
+ throw new Error("Schema is missing a method literal");
315
+ }
316
+ const methodValue = getLiteralValue(methodSchema);
317
+ if (typeof methodValue !== "string") {
318
+ throw new Error("Schema method literal must be a string");
319
+ }
320
+ const method = methodValue;
321
+ if (method === "elicitation/create") {
322
+ const wrappedHandler = async (request, extra) => {
323
+ const validatedRequest = safeParse(ElicitRequestSchema, request);
324
+ if (!validatedRequest.success) {
325
+ const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
326
+ throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation request: ${errorMessage}`);
327
+ }
328
+ const { params } = validatedRequest.data;
329
+ params.mode = params.mode ?? "form";
330
+ const { supportsFormMode, supportsUrlMode } = getSupportedElicitationModes(this._capabilities.elicitation);
331
+ if (params.mode === "form" && !supportsFormMode) {
332
+ throw new McpError(ErrorCode.InvalidParams, "Client does not support form-mode elicitation requests");
333
+ }
334
+ if (params.mode === "url" && !supportsUrlMode) {
335
+ throw new McpError(ErrorCode.InvalidParams, "Client does not support URL-mode elicitation requests");
336
+ }
337
+ const result = await Promise.resolve(handler(request, extra));
338
+ if (params.task) {
339
+ const taskValidationResult = safeParse(CreateTaskResultSchema, result);
340
+ if (!taskValidationResult.success) {
341
+ const errorMessage = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error);
342
+ throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
343
+ }
344
+ return taskValidationResult.data;
345
+ }
346
+ const validationResult = safeParse(ElicitResultSchema, result);
347
+ if (!validationResult.success) {
348
+ const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
349
+ throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation result: ${errorMessage}`);
350
+ }
351
+ const validatedResult = validationResult.data;
352
+ const requestedSchema = params.mode === "form" ? params.requestedSchema : void 0;
353
+ if (params.mode === "form" && validatedResult.action === "accept" && validatedResult.content && requestedSchema) {
354
+ if (this._capabilities.elicitation?.form?.applyDefaults) {
355
+ try {
356
+ applyElicitationDefaults(requestedSchema, validatedResult.content);
357
+ } catch {
358
+ }
359
+ }
360
+ }
361
+ return validatedResult;
362
+ };
363
+ return super.setRequestHandler(requestSchema, wrappedHandler);
364
+ }
365
+ if (method === "sampling/createMessage") {
366
+ const wrappedHandler = async (request, extra) => {
367
+ const validatedRequest = safeParse(CreateMessageRequestSchema, request);
368
+ if (!validatedRequest.success) {
369
+ const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
370
+ throw new McpError(ErrorCode.InvalidParams, `Invalid sampling request: ${errorMessage}`);
371
+ }
372
+ const { params } = validatedRequest.data;
373
+ const result = await Promise.resolve(handler(request, extra));
374
+ if (params.task) {
375
+ const taskValidationResult = safeParse(CreateTaskResultSchema, result);
376
+ if (!taskValidationResult.success) {
377
+ const errorMessage = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error);
378
+ throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
379
+ }
380
+ return taskValidationResult.data;
381
+ }
382
+ const hasTools = params.tools || params.toolChoice;
383
+ const resultSchema = hasTools ? CreateMessageResultWithToolsSchema : CreateMessageResultSchema;
384
+ const validationResult = safeParse(resultSchema, result);
385
+ if (!validationResult.success) {
386
+ const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
387
+ throw new McpError(ErrorCode.InvalidParams, `Invalid sampling result: ${errorMessage}`);
388
+ }
389
+ return validationResult.data;
390
+ };
391
+ return super.setRequestHandler(requestSchema, wrappedHandler);
392
+ }
393
+ return super.setRequestHandler(requestSchema, handler);
394
+ }
395
+ assertCapability(capability, method) {
396
+ if (!this._serverCapabilities?.[capability]) {
397
+ throw new Error(`Server does not support ${capability} (required for ${method})`);
398
+ }
399
+ }
400
+ async connect(transport, options) {
401
+ await super.connect(transport);
402
+ if (transport.sessionId !== void 0) {
403
+ return;
404
+ }
405
+ try {
406
+ const result = await this.request({
407
+ method: "initialize",
408
+ params: {
409
+ protocolVersion: LATEST_PROTOCOL_VERSION,
410
+ capabilities: this._capabilities,
411
+ clientInfo: this._clientInfo
412
+ }
413
+ }, InitializeResultSchema, options);
414
+ if (result === void 0) {
415
+ throw new Error(`Server sent invalid initialize result: ${result}`);
416
+ }
417
+ if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) {
418
+ throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`);
419
+ }
420
+ this._serverCapabilities = result.capabilities;
421
+ this._serverVersion = result.serverInfo;
422
+ if (transport.setProtocolVersion) {
423
+ transport.setProtocolVersion(result.protocolVersion);
424
+ }
425
+ this._instructions = result.instructions;
426
+ await this.notification({
427
+ method: "notifications/initialized"
428
+ });
429
+ if (this._pendingListChangedConfig) {
430
+ this._setupListChangedHandlers(this._pendingListChangedConfig);
431
+ this._pendingListChangedConfig = void 0;
432
+ }
433
+ } catch (error) {
434
+ void this.close();
435
+ throw error;
436
+ }
437
+ }
438
+ /**
439
+ * After initialization has completed, this will be populated with the server's reported capabilities.
440
+ */
441
+ getServerCapabilities() {
442
+ return this._serverCapabilities;
443
+ }
444
+ /**
445
+ * After initialization has completed, this will be populated with information about the server's name and version.
446
+ */
447
+ getServerVersion() {
448
+ return this._serverVersion;
449
+ }
450
+ /**
451
+ * After initialization has completed, this may be populated with information about the server's instructions.
452
+ */
453
+ getInstructions() {
454
+ return this._instructions;
455
+ }
456
+ assertCapabilityForMethod(method) {
457
+ switch (method) {
458
+ case "logging/setLevel":
459
+ if (!this._serverCapabilities?.logging) {
460
+ throw new Error(`Server does not support logging (required for ${method})`);
461
+ }
462
+ break;
463
+ case "prompts/get":
464
+ case "prompts/list":
465
+ if (!this._serverCapabilities?.prompts) {
466
+ throw new Error(`Server does not support prompts (required for ${method})`);
467
+ }
468
+ break;
469
+ case "resources/list":
470
+ case "resources/templates/list":
471
+ case "resources/read":
472
+ case "resources/subscribe":
473
+ case "resources/unsubscribe":
474
+ if (!this._serverCapabilities?.resources) {
475
+ throw new Error(`Server does not support resources (required for ${method})`);
476
+ }
477
+ if (method === "resources/subscribe" && !this._serverCapabilities.resources.subscribe) {
478
+ throw new Error(`Server does not support resource subscriptions (required for ${method})`);
479
+ }
480
+ break;
481
+ case "tools/call":
482
+ case "tools/list":
483
+ if (!this._serverCapabilities?.tools) {
484
+ throw new Error(`Server does not support tools (required for ${method})`);
485
+ }
486
+ break;
487
+ case "completion/complete":
488
+ if (!this._serverCapabilities?.completions) {
489
+ throw new Error(`Server does not support completions (required for ${method})`);
490
+ }
491
+ break;
492
+ case "initialize":
493
+ break;
494
+ case "ping":
495
+ break;
496
+ }
497
+ }
498
+ assertNotificationCapability(method) {
499
+ switch (method) {
500
+ case "notifications/roots/list_changed":
501
+ if (!this._capabilities.roots?.listChanged) {
502
+ throw new Error(`Client does not support roots list changed notifications (required for ${method})`);
503
+ }
504
+ break;
505
+ case "notifications/initialized":
506
+ break;
507
+ case "notifications/cancelled":
508
+ break;
509
+ case "notifications/progress":
510
+ break;
511
+ }
512
+ }
513
+ assertRequestHandlerCapability(method) {
514
+ if (!this._capabilities) {
515
+ return;
516
+ }
517
+ switch (method) {
518
+ case "sampling/createMessage":
519
+ if (!this._capabilities.sampling) {
520
+ throw new Error(`Client does not support sampling capability (required for ${method})`);
521
+ }
522
+ break;
523
+ case "elicitation/create":
524
+ if (!this._capabilities.elicitation) {
525
+ throw new Error(`Client does not support elicitation capability (required for ${method})`);
526
+ }
527
+ break;
528
+ case "roots/list":
529
+ if (!this._capabilities.roots) {
530
+ throw new Error(`Client does not support roots capability (required for ${method})`);
531
+ }
532
+ break;
533
+ case "tasks/get":
534
+ case "tasks/list":
535
+ case "tasks/result":
536
+ case "tasks/cancel":
537
+ if (!this._capabilities.tasks) {
538
+ throw new Error(`Client does not support tasks capability (required for ${method})`);
539
+ }
540
+ break;
541
+ case "ping":
542
+ break;
543
+ }
544
+ }
545
+ assertTaskCapability(method) {
546
+ assertToolsCallTaskCapability(this._serverCapabilities?.tasks?.requests, method, "Server");
547
+ }
548
+ assertTaskHandlerCapability(method) {
549
+ if (!this._capabilities) {
550
+ return;
551
+ }
552
+ assertClientRequestTaskCapability(this._capabilities.tasks?.requests, method, "Client");
553
+ }
554
+ async ping(options) {
555
+ return this.request({ method: "ping" }, EmptyResultSchema, options);
556
+ }
557
+ async complete(params, options) {
558
+ return this.request({ method: "completion/complete", params }, CompleteResultSchema, options);
559
+ }
560
+ async setLoggingLevel(level, options) {
561
+ return this.request({ method: "logging/setLevel", params: { level } }, EmptyResultSchema, options);
562
+ }
563
+ async getPrompt(params, options) {
564
+ return this.request({ method: "prompts/get", params }, GetPromptResultSchema, options);
565
+ }
566
+ async listPrompts(params, options) {
567
+ return this.request({ method: "prompts/list", params }, ListPromptsResultSchema, options);
568
+ }
569
+ async listResources(params, options) {
570
+ return this.request({ method: "resources/list", params }, ListResourcesResultSchema, options);
571
+ }
572
+ async listResourceTemplates(params, options) {
573
+ return this.request({ method: "resources/templates/list", params }, ListResourceTemplatesResultSchema, options);
574
+ }
575
+ async readResource(params, options) {
576
+ return this.request({ method: "resources/read", params }, ReadResourceResultSchema, options);
577
+ }
578
+ async subscribeResource(params, options) {
579
+ return this.request({ method: "resources/subscribe", params }, EmptyResultSchema, options);
580
+ }
581
+ async unsubscribeResource(params, options) {
582
+ return this.request({ method: "resources/unsubscribe", params }, EmptyResultSchema, options);
583
+ }
584
+ /**
585
+ * Calls a tool and waits for the result. Automatically validates structured output if the tool has an outputSchema.
586
+ *
587
+ * For task-based execution with streaming behavior, use client.experimental.tasks.callToolStream() instead.
588
+ */
589
+ async callTool(params, resultSchema = CallToolResultSchema, options) {
590
+ if (this.isToolTaskRequired(params.name)) {
591
+ throw new McpError(ErrorCode.InvalidRequest, `Tool "${params.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);
592
+ }
593
+ const result = await this.request({ method: "tools/call", params }, resultSchema, options);
594
+ const validator = this.getToolOutputValidator(params.name);
595
+ if (validator) {
596
+ if (!result.structuredContent && !result.isError) {
597
+ throw new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`);
598
+ }
599
+ if (result.structuredContent) {
600
+ try {
601
+ const validationResult = validator(result.structuredContent);
602
+ if (!validationResult.valid) {
603
+ throw new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`);
604
+ }
605
+ } catch (error) {
606
+ if (error instanceof McpError) {
607
+ throw error;
608
+ }
609
+ throw new McpError(ErrorCode.InvalidParams, `Failed to validate structured content: ${error instanceof Error ? error.message : String(error)}`);
610
+ }
611
+ }
612
+ }
613
+ return result;
614
+ }
615
+ isToolTask(toolName) {
616
+ if (!this._serverCapabilities?.tasks?.requests?.tools?.call) {
617
+ return false;
618
+ }
619
+ return this._cachedKnownTaskTools.has(toolName);
620
+ }
621
+ /**
622
+ * Check if a tool requires task-based execution.
623
+ * Unlike isToolTask which includes 'optional' tools, this only checks for 'required'.
624
+ */
625
+ isToolTaskRequired(toolName) {
626
+ return this._cachedRequiredTaskTools.has(toolName);
627
+ }
628
+ /**
629
+ * Cache validators for tool output schemas.
630
+ * Called after listTools() to pre-compile validators for better performance.
631
+ */
632
+ cacheToolMetadata(tools) {
633
+ this._cachedToolOutputValidators.clear();
634
+ this._cachedKnownTaskTools.clear();
635
+ this._cachedRequiredTaskTools.clear();
636
+ for (const tool of tools) {
637
+ if (tool.outputSchema) {
638
+ const toolValidator = this._jsonSchemaValidator.getValidator(tool.outputSchema);
639
+ this._cachedToolOutputValidators.set(tool.name, toolValidator);
640
+ }
641
+ const taskSupport = tool.execution?.taskSupport;
642
+ if (taskSupport === "required" || taskSupport === "optional") {
643
+ this._cachedKnownTaskTools.add(tool.name);
644
+ }
645
+ if (taskSupport === "required") {
646
+ this._cachedRequiredTaskTools.add(tool.name);
647
+ }
648
+ }
649
+ }
650
+ /**
651
+ * Get cached validator for a tool
652
+ */
653
+ getToolOutputValidator(toolName) {
654
+ return this._cachedToolOutputValidators.get(toolName);
655
+ }
656
+ async listTools(params, options) {
657
+ const result = await this.request({ method: "tools/list", params }, ListToolsResultSchema, options);
658
+ this.cacheToolMetadata(result.tools);
659
+ return result;
660
+ }
661
+ /**
662
+ * Set up a single list changed handler.
663
+ * @internal
664
+ */
665
+ _setupListChangedHandler(listType, notificationSchema, options, fetcher) {
666
+ const parseResult = ListChangedOptionsBaseSchema.safeParse(options);
667
+ if (!parseResult.success) {
668
+ throw new Error(`Invalid ${listType} listChanged options: ${parseResult.error.message}`);
669
+ }
670
+ if (typeof options.onChanged !== "function") {
671
+ throw new Error(`Invalid ${listType} listChanged options: onChanged must be a function`);
672
+ }
673
+ const { autoRefresh, debounceMs } = parseResult.data;
674
+ const { onChanged } = options;
675
+ const refresh = async () => {
676
+ if (!autoRefresh) {
677
+ onChanged(null, null);
678
+ return;
679
+ }
680
+ try {
681
+ const items = await fetcher();
682
+ onChanged(null, items);
683
+ } catch (e) {
684
+ const error = e instanceof Error ? e : new Error(String(e));
685
+ onChanged(error, null);
686
+ }
687
+ };
688
+ const handler = () => {
689
+ if (debounceMs) {
690
+ const existingTimer = this._listChangedDebounceTimers.get(listType);
691
+ if (existingTimer) {
692
+ clearTimeout(existingTimer);
693
+ }
694
+ const timer = setTimeout(refresh, debounceMs);
695
+ this._listChangedDebounceTimers.set(listType, timer);
696
+ } else {
697
+ refresh();
698
+ }
699
+ };
700
+ this.setNotificationHandler(notificationSchema, handler);
701
+ }
702
+ async sendRootsListChanged() {
703
+ return this.notification({ method: "notifications/roots/list_changed" });
704
+ }
705
+ };
706
+ export {
707
+ Client,
708
+ getSupportedElicitationModes
709
+ };
710
+ //# sourceMappingURL=client-3YQKORVK.js.map