@wirecat/drive-cli 0.70.0 → 0.72.0

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 (262) hide show
  1. package/README.md +150 -70
  2. package/contracts/wirecat.json +77 -8
  3. package/dist/bin/drive.js +2 -2
  4. package/dist/bundle/agent-23OB2NZP.js +46 -0
  5. package/dist/bundle/{all-profiles-FW3GK3QO.js → all-profiles-GXGDVNQJ.js} +67 -25
  6. package/dist/bundle/{anthropic-QVKJT3II.js → anthropic-H5C4GQHC.js} +9 -9
  7. package/dist/bundle/{app-server-QU73RD5R.js → app-server-EQ3UK4C7.js} +97 -79
  8. package/dist/bundle/{bun-5XCD5CBB.js → bun-DTJVSRY3.js} +2 -2
  9. package/dist/bundle/{bun-sqlite-TIGSVNSV.js → bun-sqlite-JIFY7MAE.js} +9 -9
  10. package/dist/bundle/chunk-2Q325BBD.js +353 -0
  11. package/dist/bundle/chunk-35FIJGTT.js +52 -0
  12. package/dist/bundle/{chunk-7C5KENNU.js → chunk-3FRQ6V4T.js} +3 -3
  13. package/dist/bundle/chunk-47L262VI.js +340 -0
  14. package/dist/bundle/chunk-4HP6KGBI.js +32 -0
  15. package/dist/bundle/{chunk-GA3URWIF.js → chunk-4HPXWYTE.js} +1 -1
  16. package/dist/bundle/{chunk-HYXXMSVD.js → chunk-4IUNYYYL.js} +4473 -2685
  17. package/dist/bundle/{chunk-FYPW7NMH.js → chunk-4JS32SRX.js} +64 -4
  18. package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
  19. package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
  20. package/dist/bundle/{chunk-SONPLYV7.js → chunk-55FH6IEL.js} +5 -5
  21. package/dist/bundle/{chunk-VVN6GHAZ.js → chunk-5BNMWSU2.js} +659 -255
  22. package/dist/bundle/{chunk-FVTKFIQH.js → chunk-5H747A76.js} +5496 -3195
  23. package/dist/bundle/{chunk-PR7XD2DI.js → chunk-5KWCO56H.js} +2 -2
  24. package/dist/bundle/{chunk-3AHBZP33.js → chunk-5U3NCE5R.js} +35 -12
  25. package/dist/bundle/{chunk-HRATXUFH.js → chunk-6CCO3JCM.js} +31 -22
  26. package/dist/bundle/{chunk-RLNZ7NX5.js → chunk-6ZW2ZJYC.js} +2 -2
  27. package/dist/bundle/{chunk-RQNRYF6D.js → chunk-75DAHQOV.js} +3 -3
  28. package/dist/bundle/{chunk-7QSRODXM.js → chunk-77OBW43F.js} +6 -6
  29. package/dist/bundle/{chunk-GV5DGHSA.js → chunk-7EFM6AW3.js} +4 -4
  30. package/dist/bundle/{chunk-BXPC5TFG.js → chunk-A3S7QM5L.js} +3 -3
  31. package/dist/bundle/{chunk-IGNIUDI3.js → chunk-AA4LKC6W.js} +251 -565
  32. package/dist/bundle/chunk-ASTKHB6B.js +3233 -0
  33. package/dist/bundle/{chunk-3TCMANIM.js → chunk-BM6V7456.js} +8 -227
  34. package/dist/bundle/chunk-BO6EDBYJ.js +50 -0
  35. package/dist/bundle/{chunk-F5KJWRF5.js → chunk-BPA3R4KN.js} +2 -100
  36. package/dist/bundle/chunk-CIFE4KPX.js +2159 -0
  37. package/dist/bundle/chunk-CKB4XZZJ.js +730 -0
  38. package/dist/bundle/{chunk-YCL3SK4T.js → chunk-COJTCEZP.js} +113 -860
  39. package/dist/bundle/{chunk-BD2K2ONK.js → chunk-CWPYDT73.js} +6 -6
  40. package/dist/bundle/{chunk-6BMTW5A6.js → chunk-D4JNCXS7.js} +9 -9
  41. package/dist/bundle/chunk-DCPWZIOV.js +696 -0
  42. package/dist/bundle/{chunk-P7PLKNPX.js → chunk-DHMNCOQI.js} +415 -272
  43. package/dist/bundle/chunk-DOQMH4DC.js +280 -0
  44. package/dist/bundle/chunk-DQSOYH6N.js +20 -0
  45. package/dist/bundle/{chunk-ML3R2UHV.js → chunk-DWRUOLBF.js} +4 -4
  46. package/dist/bundle/{chunk-5JTB4URG.js → chunk-E3VWZC3K.js} +14 -13
  47. package/dist/bundle/chunk-ECYOTDJM.js +14 -0
  48. package/dist/bundle/{chunk-7IBENBCK.js → chunk-EVG3AA5M.js} +2 -2
  49. package/dist/bundle/chunk-F4BX7TH2.js +15 -0
  50. package/dist/bundle/{chunk-FCSHWUMW.js → chunk-FBEZSA76.js} +5 -5
  51. package/dist/bundle/{chunk-RHSBXOQM.js → chunk-FBQJN74J.js} +1 -1
  52. package/dist/bundle/{chunk-4WK26MPY.js → chunk-FIZOPJYY.js} +1 -1
  53. package/dist/bundle/chunk-FNAYSZWK.js +783 -0
  54. package/dist/bundle/{chunk-LINBDWJK.js → chunk-FRCJHGZM.js} +2 -2
  55. package/dist/bundle/{chunk-RCTOWLCD.js → chunk-FTG5QBSD.js} +41 -33
  56. package/dist/bundle/{chunk-ABZ2NYDT.js → chunk-FUDUXIVG.js} +1 -1
  57. package/dist/bundle/{chunk-NYECVHFH.js → chunk-G4NHRFS7.js} +755 -0
  58. package/dist/bundle/{chunk-PAPY6Q6H.js → chunk-GIEZYBRC.js} +1 -1
  59. package/dist/bundle/chunk-GTPPUBYU.js +1876 -0
  60. package/dist/bundle/chunk-GU6ICH53.js +108 -0
  61. package/dist/bundle/{chunk-REM5WHHQ.js → chunk-GUMKKRE6.js} +107 -71
  62. package/dist/bundle/{chunk-QBAOIMVB.js → chunk-GWCDOYSC.js} +1 -1
  63. package/dist/bundle/{chunk-HHAZ6DCY.js → chunk-GXGSC622.js} +69 -7
  64. package/dist/bundle/chunk-HAGXTGJC.js +188 -0
  65. package/dist/bundle/{chunk-TNKQDS5A.js → chunk-IMAWQC5K.js} +6 -6
  66. package/dist/bundle/{chunk-ZHZYGY5R.js → chunk-IVGVVSPW.js} +4 -4
  67. package/dist/bundle/{chunk-EDO5LZVF.js → chunk-J4NUHSM7.js} +1 -1
  68. package/dist/bundle/{chunk-DVVUJ254.js → chunk-K652FYCO.js} +6 -6
  69. package/dist/bundle/chunk-K6ZWNTXY.js +561 -0
  70. package/dist/bundle/{chunk-FONIFRYI.js → chunk-KF3ZBQJV.js} +4 -4
  71. package/dist/bundle/chunk-KFZCHJRT.js +80 -0
  72. package/dist/bundle/chunk-KLPFDFLI.js +221 -0
  73. package/dist/bundle/{chunk-LMJBQFW6.js → chunk-KP2XMCNT.js} +13 -13
  74. package/dist/bundle/{chunk-FADAOLGB.js → chunk-KWDZ3KVH.js} +4 -4
  75. package/dist/bundle/{chunk-MXNQZAJQ.js → chunk-KX4C32WD.js} +2 -2
  76. package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
  77. package/dist/bundle/{chunk-ILAQIBEO.js → chunk-M2ZWYVWO.js} +1 -1
  78. package/dist/bundle/chunk-MEYYH47C.js +25 -0
  79. package/dist/bundle/{chunk-ZCXWV4XO.js → chunk-ML2QIWX2.js} +4 -4
  80. package/dist/bundle/{chunk-XOL346TJ.js → chunk-MUFF2YTH.js} +2 -2
  81. package/dist/bundle/{chunk-GAHIHE4K.js → chunk-N24YSLED.js} +9166 -9751
  82. package/dist/bundle/chunk-N4GTCPML.js +7 -0
  83. package/dist/bundle/{chunk-DVI72ZQG.js → chunk-NBMGDRP4.js} +1 -1
  84. package/dist/bundle/chunk-NMQRSEZM.js +37 -0
  85. package/dist/bundle/{chunk-I7YSHUPW.js → chunk-NNGA4QDR.js} +13 -26
  86. package/dist/bundle/{chunk-5DPV7X27.js → chunk-NTZWY5R3.js} +321 -0
  87. package/dist/bundle/chunk-O7CZZ36M.js +80 -0
  88. package/dist/bundle/{chunk-HWUPU6WX.js → chunk-OAONP6KI.js} +13 -9
  89. package/dist/bundle/{chunk-3CHW7JGR.js → chunk-OESP4PHB.js} +17 -17
  90. package/dist/bundle/chunk-OHR6IZNH.js +116 -0
  91. package/dist/bundle/{chunk-54NDYVZA.js → chunk-OLCU7Q2B.js} +1 -1
  92. package/dist/bundle/{chunk-FN3RXBO7.js → chunk-OLDQLEPA.js} +6 -6
  93. package/dist/bundle/{chunk-7DJNURKV.js → chunk-OPIPG6AP.js} +16 -9
  94. package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
  95. package/dist/bundle/chunk-PRYMT3OG.js +30 -0
  96. package/dist/bundle/chunk-QDUIVMEW.js +36 -0
  97. package/dist/bundle/{chunk-66PL7P4C.js → chunk-QKBPCX7Y.js} +1 -1
  98. package/dist/bundle/{chunk-PN4JYURZ.js → chunk-QSLOACDT.js} +201 -423
  99. package/dist/bundle/{chunk-3UWRAIWA.js → chunk-QUZFDU4K.js} +4 -4
  100. package/dist/bundle/{chunk-KSJAFMU5.js → chunk-R32DHS6J.js} +211 -380
  101. package/dist/bundle/{chunk-2SBC4DVV.js → chunk-R57QUYBG.js} +6 -28
  102. package/dist/bundle/{chunk-IFTX7AQU.js → chunk-R64OSDOD.js} +45 -66
  103. package/dist/bundle/{chunk-WJK6KTCS.js → chunk-RSPBVKOC.js} +8 -8
  104. package/dist/bundle/{chunk-GPDPEHYX.js → chunk-SPNPJ3FZ.js} +3 -4
  105. package/dist/bundle/chunk-SQHDSIFL.js +388 -0
  106. package/dist/bundle/{chunk-XZBA6FVH.js → chunk-ST35FIUG.js} +3 -3
  107. package/dist/bundle/{chunk-37MAA6F2.js → chunk-STUPCKAA.js} +11 -2221
  108. package/dist/bundle/chunk-SZ7XJZGH.js +2231 -0
  109. package/dist/bundle/chunk-TRYYWV7J.js +291 -0
  110. package/dist/bundle/{chunk-OY7TNUEC.js → chunk-TTPWKTVR.js} +1 -1
  111. package/dist/bundle/{chunk-3UZ4OH22.js → chunk-U7VEJ3CW.js} +49 -129
  112. package/dist/bundle/{chunk-6Y2BYFXQ.js → chunk-UC7JLE6J.js} +0 -7
  113. package/dist/bundle/{chunk-HK225DAG.js → chunk-UIQ35CA5.js} +1 -1
  114. package/dist/bundle/{chunk-GK3BJMGK.js → chunk-UJY26HW4.js} +1 -1
  115. package/dist/bundle/{chunk-EG62WVR2.js → chunk-UWG3PRY7.js} +9 -60
  116. package/dist/bundle/{chunk-BBRMDMIR.js → chunk-VAR3MJU6.js} +3 -3
  117. package/dist/bundle/{chunk-GJZSVSV3.js → chunk-VPQSI5IU.js} +4 -4
  118. package/dist/bundle/{chunk-YZPE72GE.js → chunk-VQPT3Y7W.js} +12 -12
  119. package/dist/bundle/{chunk-T5D4OGDC.js → chunk-WMG3H2VK.js} +2 -2
  120. package/dist/bundle/{chunk-6DPOWBKA.js → chunk-X5BGAZC5.js} +6 -6
  121. package/dist/bundle/{chunk-DHX27E5M.js → chunk-XC6TRWLZ.js} +3 -3
  122. package/dist/bundle/{chunk-Q5C6YKAY.js → chunk-XQZEMRCU.js} +402 -402
  123. package/dist/bundle/{chunk-54BQWRJL.js → chunk-XZ7MO6EU.js} +7 -7
  124. package/dist/bundle/{chunk-TGS5VPJD.js → chunk-YAIOEPKU.js} +341 -433
  125. package/dist/bundle/chunk-YHWFF6DN.js +39 -0
  126. package/dist/bundle/{chunk-WWE5GO6G.js → chunk-YWOLQEDV.js} +16 -3
  127. package/dist/bundle/{chunk-DR57KDAY.js → chunk-ZFDSJ5YJ.js} +38 -8
  128. package/dist/bundle/{chunk-BBFXQPKD.js → chunk-ZFUZEFU6.js} +3 -3
  129. package/dist/bundle/{chunk-YRUR3E3E.js → chunk-ZJKXSMXK.js} +72 -59
  130. package/dist/bundle/{chunk-BFKFKDPC.js → chunk-ZKWT6HXT.js} +1 -1
  131. package/dist/bundle/chunk-ZPUY3COZ.js +250 -0
  132. package/dist/bundle/{cli-K4D4DIGQ.js → cli-2P5FW2RL.js} +201 -98
  133. package/dist/bundle/command-contract-BMQT2G5X.js +45 -0
  134. package/dist/bundle/{command-server-entry-WREK3QBB.js → command-server-entry-KP2UDGLA.js} +36 -34
  135. package/dist/bundle/{decode-SEETPKBH.js → decode-K2JZ5D6V.js} +10 -10
  136. package/dist/bundle/{dispatch-SQCEURVK.js → dispatch-KOQZA74A.js} +10 -10
  137. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  138. package/dist/bundle/drive.js +11 -11
  139. package/dist/bundle/{echarts-WZ5RKFCX.js → echarts-URO3QGCG.js} +2 -2
  140. package/dist/bundle/{embed-B2UCRZZR.js → embed-JLIPWTNN.js} +10 -10
  141. package/dist/bundle/{embedder-4R6Z7G7L.js → embedder-LUTDO3HS.js} +15 -15
  142. package/dist/bundle/entry-AVF6LMG7.js +25 -0
  143. package/dist/bundle/{failure-CYNXH3RQ.js → failure-GJMQLM7O.js} +4 -4
  144. package/dist/bundle/first-run-VYTIEUDA.js +31 -0
  145. package/dist/bundle/first-screen-QVZPF7KL.js +45 -0
  146. package/dist/bundle/google-VX7IPACN.js +46 -0
  147. package/dist/bundle/{google-api-SAND2F7L.js → google-api-RFXKRLL4.js} +88 -73
  148. package/dist/bundle/grants-4XWJFVD6.js +133 -0
  149. package/dist/bundle/hast-util-from-html-X2DCPS3T.js +10531 -0
  150. package/dist/bundle/hast-util-to-html-VP6XLPKJ.js +998 -0
  151. package/dist/bundle/hast-util-to-mdast-IZ5PRX72.js +2272 -0
  152. package/dist/bundle/{identity-JVVGS4U6.js → identity-FXPB5EMT.js} +7 -6
  153. package/dist/bundle/{instructions-JSMTSB22.js → instructions-IROIUVZI.js} +1 -1
  154. package/dist/bundle/{login-6WG3YBDU.js → login-WIY5VQU7.js} +96 -81
  155. package/dist/bundle/{mcp-VFIOZDVY.js → mcp-NJIOKW3E.js} +2 -2
  156. package/dist/bundle/{mdast-util-from-markdown-FXEPSNER.js → mdast-util-from-markdown-HEZF7KJ4.js} +137 -195
  157. package/dist/bundle/mdast-util-gfm-AQW6R6MG.js +925 -0
  158. package/dist/bundle/mdast-util-to-hast-DF2QVIRV.js +879 -0
  159. package/dist/bundle/mdast-util-to-markdown-XYLXB3Z3.js +18 -0
  160. package/dist/bundle/meeting-combined-JUNV35GM.js +28 -0
  161. package/dist/bundle/meeting-model-XY4UNWWK.js +29 -0
  162. package/dist/bundle/{meeting-semantic-5U7JQCFF.js → meeting-semantic-62QNQMOM.js} +10 -10
  163. package/dist/bundle/{micromark-extension-gfm-GRL24TU6.js → micromark-extension-gfm-OE2GBORZ.js} +11 -78
  164. package/dist/bundle/{node-VJMVHOWD.js → node-IACCI2CW.js} +2 -2
  165. package/dist/bundle/{node-sqlite-DCNT3HVE.js → node-sqlite-WYIRC7C7.js} +10 -10
  166. package/dist/bundle/notes-search-DEDUJKSN.js +70 -0
  167. package/dist/bundle/oauth-HXBXF4VI.js +22 -0
  168. package/dist/bundle/{open-NFOEHVW7.js → open-H32B6BCT.js} +8 -8
  169. package/dist/bundle/{openai-D47WY7EC.js → openai-VHMPJJUG.js} +22 -21
  170. package/dist/bundle/{process-Q2FRU5VA.js → process-RNHPF5OK.js} +1 -1
  171. package/dist/bundle/{program-T2AJJQEM.js → program-GYMJ3DDH.js} +276 -1132
  172. package/dist/bundle/{prompt-YJSDABXN.js → prompt-TOG2CRCE.js} +8 -8
  173. package/dist/bundle/{reasons-WEHPCSJX.js → reasons-TLFQ45YX.js} +6 -5
  174. package/dist/bundle/{recognize-6OBEIEB3.js → recognize-GYGY45EY.js} +7 -7
  175. package/dist/bundle/remote-6XN2QLI5.js +35 -0
  176. package/dist/bundle/{rerank-L6F5SLIB.js → rerank-HJO3O4TW.js} +11 -11
  177. package/dist/bundle/{serve-GYSWIWH4.js → serve-XPCNLHCR.js} +19 -19
  178. package/dist/bundle/server-UBJZ66XE.js +97 -0
  179. package/dist/bundle/{server-GWWP3RIT.js → server-WPT3NC5B.js} +89 -70
  180. package/dist/bundle/{services-BDQBRXT5.js → services-253KKKVU.js} +109 -89
  181. package/dist/bundle/{sqlite-runtime-ZSZGAUYB.js → sqlite-runtime-EZASGJXW.js} +9 -9
  182. package/dist/bundle/{start-BJ275RUK.js → start-UHI35JFL.js} +7 -7
  183. package/dist/bundle/{state-HLNGFI2T.js → state-KJTSPFGK.js} +9 -9
  184. package/dist/bundle/{store-I43KZNJW.js → store-62J2H2A3.js} +36 -25
  185. package/dist/bundle/{store-OSRTGYGI.js → store-G5B7T7M7.js} +38 -23
  186. package/dist/bundle/store-maintenance-command-C6T4YLVF.js +85 -0
  187. package/dist/bundle/surface-3OT64BHS.js +83 -0
  188. package/dist/bundle/tokens-EHYO6D2X.js +133 -0
  189. package/dist/commands/documents.d.ts.map +1 -1
  190. package/dist/commands/documents.js +11 -1
  191. package/dist/commands/documents.js.map +1 -1
  192. package/dist/commands/remote.d.ts.map +1 -1
  193. package/dist/commands/remote.js +8 -22
  194. package/dist/commands/remote.js.map +1 -1
  195. package/dist/commands/sync.d.ts.map +1 -1
  196. package/dist/commands/sync.js +14 -4
  197. package/dist/commands/sync.js.map +1 -1
  198. package/dist/config.d.ts +5 -0
  199. package/dist/config.d.ts.map +1 -1
  200. package/dist/config.js +7 -1
  201. package/dist/config.js.map +1 -1
  202. package/dist/first-screen.d.ts.map +1 -1
  203. package/dist/first-screen.js +2 -1
  204. package/dist/first-screen.js.map +1 -1
  205. package/dist/generated/manifest.d.ts +2 -1
  206. package/dist/generated/manifest.d.ts.map +1 -1
  207. package/dist/generated/manifest.js +782 -0
  208. package/dist/generated/manifest.js.map +1 -1
  209. package/dist/generated/types.d.ts +262 -58
  210. package/dist/generated/types.d.ts.map +1 -1
  211. package/dist/google.d.ts.map +1 -1
  212. package/dist/google.js +5 -5
  213. package/dist/google.js.map +1 -1
  214. package/dist/model.d.ts +5 -2
  215. package/dist/model.d.ts.map +1 -1
  216. package/dist/model.js.map +1 -1
  217. package/dist/policy-keys.js +1 -1
  218. package/dist/policy-keys.js.map +1 -1
  219. package/dist/program.d.ts.map +1 -1
  220. package/dist/program.js +9 -4
  221. package/dist/program.js.map +1 -1
  222. package/dist/state.d.ts.map +1 -1
  223. package/dist/state.js +6 -1
  224. package/dist/state.js.map +1 -1
  225. package/dist/store.d.ts.map +1 -1
  226. package/dist/store.js +2 -7
  227. package/dist/store.js.map +1 -1
  228. package/dist/supported.d.ts +2 -2
  229. package/dist/supported.d.ts.map +1 -1
  230. package/dist/supported.js +2 -3
  231. package/dist/supported.js.map +1 -1
  232. package/dist/sync.d.ts +2 -1
  233. package/dist/sync.d.ts.map +1 -1
  234. package/dist/sync.js +6 -4
  235. package/dist/sync.js.map +1 -1
  236. package/dist/transcripts.d.ts +0 -6
  237. package/dist/transcripts.d.ts.map +1 -1
  238. package/dist/transcripts.js +0 -13
  239. package/dist/transcripts.js.map +1 -1
  240. package/dist/version.d.ts +1 -1
  241. package/dist/version.js +1 -1
  242. package/package.json +3 -3
  243. package/scenarios/find-decision.md +1 -1
  244. package/skills/drive-cli/SKILL.md +4 -2
  245. package/dist/bundle/chunk-AV5UKJZM.js +0 -729
  246. package/dist/bundle/chunk-NP7LJATI.js +0 -598
  247. package/dist/bundle/chunk-P77FL6RY.js +0 -896
  248. package/dist/bundle/chunk-ZI3YTXSF.js +0 -2
  249. package/dist/bundle/command-contract-V3F452QI.js +0 -43
  250. package/dist/bundle/entry-ORZYRJ5N.js +0 -25
  251. package/dist/bundle/first-run-KAKA6KBY.js +0 -31
  252. package/dist/bundle/first-screen-R645UHRH.js +0 -41
  253. package/dist/bundle/google-BSO3YB7N.js +0 -45
  254. package/dist/bundle/grants-PLNFYARD.js +0 -118
  255. package/dist/bundle/mdast-util-gfm-SZM5GBDF.js +0 -2103
  256. package/dist/bundle/meeting-combined-SUKMFK3F.js +0 -27
  257. package/dist/bundle/meeting-model-S4YGKIFI.js +0 -29
  258. package/dist/bundle/oauth-KCMNQ3ZP.js +0 -22
  259. package/dist/bundle/remote-3SL2QJ7T.js +0 -35
  260. package/dist/bundle/server-BI46BSRE.js +0 -80
  261. package/dist/bundle/store-maintenance-command-FO7LEVSL.js +0 -72
  262. package/dist/bundle/tokens-DB7O7QNB.js +0 -118
@@ -0,0 +1,561 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ UNTRUSTED,
5
+ UNTRUSTED_NEUTRAL,
6
+ agentArguments,
7
+ agentJson,
8
+ failureContext
9
+ } from "./chunk-R32DHS6J.js";
10
+ import {
11
+ callerOf
12
+ } from "./chunk-GU6ICH53.js";
13
+ import {
14
+ refuseLacking
15
+ } from "./chunk-KFZCHJRT.js";
16
+ import {
17
+ servicesFor
18
+ } from "./chunk-N24YSLED.js";
19
+ import {
20
+ onlineDeps,
21
+ storeModeDeps
22
+ } from "./chunk-CIFE4KPX.js";
23
+ import {
24
+ DEFAULT_OUTPUT_BYTES,
25
+ ENTITIES,
26
+ LOCAL_WRITE,
27
+ REMOTE_WRITE,
28
+ answerSchema,
29
+ fetchesAt,
30
+ judgedAnswer,
31
+ judgedEffects,
32
+ keyForCommand,
33
+ levelFor,
34
+ listOf,
35
+ readKeysForCommand,
36
+ refuseStoreChange,
37
+ sealed,
38
+ startRecording
39
+ } from "./chunk-YAIOEPKU.js";
40
+ import {
41
+ currentCaller,
42
+ keepsSuccess,
43
+ runContextOf,
44
+ withCaller
45
+ } from "./chunk-XZ7MO6EU.js";
46
+ import {
47
+ MAX_BUFFERED_INPUT
48
+ } from "./chunk-KX4C32WD.js";
49
+ import {
50
+ inRun,
51
+ newRunId
52
+ } from "./chunk-COJTCEZP.js";
53
+ import {
54
+ storeDamaged
55
+ } from "./chunk-6ZW2ZJYC.js";
56
+ import {
57
+ errorObjectOf,
58
+ mcpErrorResult
59
+ } from "./chunk-55FH6IEL.js";
60
+ import {
61
+ traceIdOf
62
+ } from "./chunk-EVG3AA5M.js";
63
+ import {
64
+ array,
65
+ boolean,
66
+ description,
67
+ integer,
68
+ itemEnvelopeSchema,
69
+ listEnvelopeSchema,
70
+ looseObject,
71
+ maxLength,
72
+ maxValue,
73
+ minLength,
74
+ minValue,
75
+ number,
76
+ optional,
77
+ pipe,
78
+ record,
79
+ regex,
80
+ safeParse,
81
+ strictObject,
82
+ string,
83
+ summarize,
84
+ toJsonSchema,
85
+ toStandardJsonSchema,
86
+ unknown
87
+ } from "./chunk-GXGSC622.js";
88
+ import {
89
+ CliError,
90
+ errorCodes
91
+ } from "./chunk-OLCU7Q2B.js";
92
+ import {
93
+ __name
94
+ } from "./chunk-ZVVMGPBJ.js";
95
+
96
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/mcp/surface.js
97
+ import { randomUUID } from "node:crypto";
98
+
99
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/mcp/tool.js
100
+ var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
101
+ var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
102
+ var message = pipe(
103
+ string(),
104
+ maxLength(256),
105
+ // biome-ignore lint/suspicious/noControlCharactersInRegex: refusing them is the point
106
+ regex(/^[^\s\x00-\x1F\x7F-\x9F]+$/, "a message id has no spaces or control characters"),
107
+ description("message id")
108
+ );
109
+ var READ = { readOnlyHint: true, destructiveHint: false, openWorldHint: true };
110
+ var WRITE = {
111
+ readOnlyHint: false,
112
+ destructiveHint: true,
113
+ idempotentHint: false,
114
+ openWorldHint: true
115
+ };
116
+ var tool = /* @__PURE__ */ __name((definition) => definition, "tool");
117
+ var chatOf = /* @__PURE__ */ __name((messenger) => pipe(string(), minLength(1), description(messenger.chatArgument)), "chatOf");
118
+ var tierOf = /* @__PURE__ */ __name((key, definition, messenger) => {
119
+ if (definition.annotations.readOnlyHint === true)
120
+ return "read";
121
+ if (/^admin|_admin/.test(key))
122
+ return "admin";
123
+ if (/delete|ban|kick|remove|purge|block/.test(key))
124
+ return "destructive";
125
+ if (/draft/.test(key))
126
+ return "draft";
127
+ if (key === "messages_pin" && messenger?.quietPins === false)
128
+ return "write-public";
129
+ if (/mark_read|mark_unread|read_mark|archive|mute|pin|tag|note|label|folder|alias|save|_(un)?star$/.test(key))
130
+ return "write-private";
131
+ return "write-public";
132
+ }, "tierOf");
133
+ var effectsOf = /* @__PURE__ */ __name((definition) => {
134
+ if (definition.effects)
135
+ return definition.effects;
136
+ const { readOnlyHint, openWorldHint } = definition.annotations;
137
+ if (readOnlyHint === true)
138
+ return { remote: openWorldHint === false ? "none" : "read", local: "read" };
139
+ return openWorldHint === false ? LOCAL_WRITE : REMOTE_WRITE;
140
+ }, "effectsOf");
141
+ var outcomeOf = /* @__PURE__ */ __name((result) => {
142
+ if (!result.isError)
143
+ return { status: "ok" };
144
+ const code = result.structuredContent?.error?.code;
145
+ const error = typeof code === "string" ? code : "generic_failure";
146
+ return { status: error === "permission_error" ? "refused" : "failed", error };
147
+ }, "outcomeOf");
148
+ var commandOf = /* @__PURE__ */ __name((name, definition) => definition.command ?? name.replaceAll("_", " "), "commandOf");
149
+ var toolKey = /* @__PURE__ */ __name((name, definition) => definition.key !== void 0 ? definition.key : keyForCommand(commandOf(name, definition).split(" ")), "toolKey");
150
+ var inputOf = /* @__PURE__ */ __name((definition, syncAllowed) => strictObject(syncAllowed || !("sync_first" in definition.input.entries) ? definition.input.entries : Object.fromEntries(Object.entries(definition.input.entries).filter(([name]) => !["sync_first", "sync_time", "max_chats", "max_messages"].includes(name)))), "inputOf");
151
+ var syncAllowedFor = /* @__PURE__ */ __name((key, defaults) => {
152
+ const permissions = defaults.settings.permissions ?? {};
153
+ const shared = defaults.syncAllowed ?? fetchesAt(levelFor(permissions, "messages.sync-first").level);
154
+ return shared && (!key.startsWith("stats_") || fetchesAt(levelFor(permissions, `${key.replaceAll("_", ".")}.sync-first`).level));
155
+ }, "syncAllowedFor");
156
+ var entryRunner = /* @__PURE__ */ __name((registration) => {
157
+ const run = callRunner(registration);
158
+ const { log } = registration;
159
+ return async (key, definition, args, ctx) => {
160
+ const startedAt = Date.now();
161
+ const command = `mcp ${commandOf(key, definition)}`;
162
+ const traceId = traceIdOf(ctx?.mcpReq?._meta?.traceparent);
163
+ const app = registration.messenger?.app;
164
+ const caller = registration.callers ? callerOf(ctx, key, registration.callers) : currentCaller();
165
+ const env = registration.defaults.env ?? process.env;
166
+ const settings = registration.defaults.settings;
167
+ const recording = key !== "runs_search" && settings.keepFailedRuns !== false && app?.appName ? startRecording({
168
+ app,
169
+ command,
170
+ ...settings.profile === void 0 ? {} : { profile: settings.profile },
171
+ env,
172
+ record: keepsSuccess({ record: settings.record ?? true, fromFlag: false, env, caller }),
173
+ keepFailed: true,
174
+ trace: false,
175
+ format: "json",
176
+ context: runContextOf({ bin: app.command, command, env, caller }),
177
+ ...settings.keepRunsForDays === void 0 ? {} : { keepDays: settings.keepRunsForDays },
178
+ ...settings.keepSuccessfulRunsForDays === void 0 ? {} : { keepSuccessDays: settings.keepSuccessfulRunsForDays },
179
+ ...settings.runsSizeLimitMb === void 0 ? {} : { maxBytes: settings.runsSizeLimitMb * 1024 * 1024 },
180
+ ...traceId === void 0 ? {} : { traceId }
181
+ }) : void 0;
182
+ const profile = registration.defaults.settings.profile;
183
+ const scope = {
184
+ runId: recording?.runId ?? newRunId(new Date(startedAt), command),
185
+ command,
186
+ startedAt,
187
+ ...profile === void 0 ? {} : { profile },
188
+ ...traceId === void 0 ? {} : { traceId },
189
+ ...recording ? { events: recording.events } : {}
190
+ };
191
+ const work = /* @__PURE__ */ __name(() => inRun(scope, () => {
192
+ const input = inputOf(definition, syncAllowedFor(key, registration.defaults));
193
+ const parsed = safeParse(input, args);
194
+ return parsed.success ? run(key, definition, parsed.output, ctx) : failed(new CliError("validation_error", `${commandOf(key, definition)}: ${summarize(parsed.issues)}`, {
195
+ arguments: toJsonSchema(input)
196
+ }), app?.errors);
197
+ }), "work");
198
+ const result = await (caller ? withCaller(caller, work) : work());
199
+ if (recording) {
200
+ if (result.isError) {
201
+ const error = result.structuredContent?.error;
202
+ const code = error?.code && errorCodes.includes(error.code) ? error.code : void 0;
203
+ await recording.fail(code ? new CliError(code, "MCP operation failed") : new Error("MCP operation failed")).catch(() => void 0);
204
+ } else
205
+ await recording.succeed(result.structuredContent).catch(() => void 0);
206
+ }
207
+ await log?.({
208
+ tool: key,
209
+ tier: tierOf(key, definition, registration.messenger),
210
+ ...outcomeOf(result),
211
+ startedAt,
212
+ finishedAt: Date.now()
213
+ }, caller)?.catch(() => void 0);
214
+ return result;
215
+ };
216
+ }, "entryRunner");
217
+ var callRunner = /* @__PURE__ */ __name(({ messenger, session, withStore, withServices, defaults, around, targets }) => {
218
+ const where = {
219
+ profile: defaults.settings.profile,
220
+ env: defaults.env,
221
+ pictures: defaults.settings.pictureSearch,
222
+ reranker: defaults.settings.searchReranker
223
+ };
224
+ return async (key, definition, args, ctx) => {
225
+ const path = commandOf(key, definition).split(" ");
226
+ const run = `mcp ${path.join(" ")}`;
227
+ try {
228
+ const execute = /* @__PURE__ */ __name(async () => {
229
+ const syncAllowed = syncAllowedFor(key, defaults);
230
+ if (Buffer.byteLength(JSON.stringify(args)) > MAX_BUFFERED_INPUT)
231
+ throw new CliError("validation_error", "tool arguments exceed the buffered input limit", {
232
+ reason: "input.too-large",
233
+ max_bytes: MAX_BUFFERED_INPUT,
234
+ retryable: false
235
+ });
236
+ definition.check?.(args);
237
+ if (definition.changesStore)
238
+ refuseStoreChange(messenger.app, defaults.env);
239
+ refuseLacking(messenger, path);
240
+ for (const permission of readKeysForCommand(path)) {
241
+ if (levelFor(defaults.settings.permissions ?? {}, permission).level === "deny")
242
+ throw new CliError("permission_error", `profile denies ${permission}`, { permission });
243
+ }
244
+ if (args.sync_first && !syncAllowed)
245
+ throw new CliError("permission_error", "messages.sync-first is not allowed by this profile");
246
+ if (definition.custom) {
247
+ const result2 = await definition.custom(args, { ...defaults, signal: ctx.mcpReq.signal }, ctx);
248
+ return answered(result2, definition.outputLimit?.(args, defaults), targets);
249
+ }
250
+ if (definition.local)
251
+ return answered(await definition.local(args, defaults), definition.outputLimit?.(args, defaults), targets);
252
+ const { online, stored: local, served } = definition;
253
+ const stored = local && (!definition.storedWhen || definition.storedWhen(args)) ? local : void 0;
254
+ const result = stored ? await withStore((store, account) => stored(store, account, args, { ...defaults, signal: ctx.mcpReq.signal }, (work) => session.use(run, work)), {
255
+ name: run
256
+ }) : served && withServices ? await withServices((services, connect) => served(services, args, defaults, connect), { name: run }) : served && messenger.history === "store" ? await withStore((store, account) => served(servicesFor({
257
+ ...storeModeDeps(messenger, store, account, defaults.guard),
258
+ ...where,
259
+ embedders: defaults.embedders
260
+ }), args, defaults, (work) => session.use(run, async (adapter, release) => {
261
+ try {
262
+ return await work(adapter);
263
+ } finally {
264
+ await release();
265
+ }
266
+ })), { name: run }) : served ? await session.use(run, (adapter, release) => served(servicesFor(onlineDeps(messenger, adapter, defaults.guard, where)), args, defaults, (work) => (async () => {
267
+ try {
268
+ return await work(adapter);
269
+ } finally {
270
+ await release();
271
+ }
272
+ })())) : await session.use(run, (adapter, release) => online(adapter, args, { ...defaults, release }));
273
+ return answered(result, definition.outputLimit?.(args, defaults), targets);
274
+ }, "execute");
275
+ return around ? await around(key, definition, execute) : await execute();
276
+ } catch (error) {
277
+ return failed(error, messenger?.app?.errors, effectsOf(definition));
278
+ }
279
+ };
280
+ }, "callRunner");
281
+ var outputSchemaOf = /* @__PURE__ */ __name((definition) => {
282
+ if (!definition.output)
283
+ return looseObject({});
284
+ const entity = ENTITIES[definition.output.entity];
285
+ return definition.output.list ? listEnvelopeSchema(entity) : itemEnvelopeSchema(entity);
286
+ }, "outputSchemaOf");
287
+ var Picture = class {
288
+ static {
289
+ __name(this, "Picture");
290
+ }
291
+ bytes;
292
+ mimeType;
293
+ about;
294
+ constructor(bytes, mimeType, about) {
295
+ this.bytes = bytes;
296
+ this.mimeType = mimeType;
297
+ this.about = about;
298
+ }
299
+ };
300
+ var BinaryResource = class {
301
+ static {
302
+ __name(this, "BinaryResource");
303
+ }
304
+ base64;
305
+ mimeType;
306
+ uri;
307
+ about;
308
+ constructor(base64, mimeType, uri, about) {
309
+ this.base64 = base64;
310
+ this.mimeType = mimeType;
311
+ this.uri = uri;
312
+ this.about = about;
313
+ }
314
+ };
315
+ var answered = /* @__PURE__ */ __name((answer, maxBytes = DEFAULT_OUTPUT_BYTES, targets) => {
316
+ const bounded = /* @__PURE__ */ __name((result) => {
317
+ if (maxBytes !== 0 && Buffer.byteLength(JSON.stringify(result.content)) > maxBytes)
318
+ throw new CliError("invalid_response", "tool output exceeds its byte limit \u2014 reduce limit or use a narrower request", { reason: "output.too-large", max_bytes: maxBytes, retryable: false });
319
+ return result;
320
+ }, "bounded");
321
+ if (answer === null || Array.isArray(answer) || typeof answer !== "object")
322
+ throw new CliError("invalid_response", "tool result must be an object", { retryable: false });
323
+ const objectBody = /* @__PURE__ */ __name((value) => {
324
+ const serialized = JSON.parse(agentJson(value));
325
+ if (serialized === null || Array.isArray(serialized) || typeof serialized !== "object")
326
+ throw new CliError("invalid_response", "serialized tool result must be an object", { retryable: false });
327
+ return serialized;
328
+ }, "objectBody");
329
+ if (answer instanceof BinaryResource) {
330
+ const about = sealed(answer.about);
331
+ return bounded({
332
+ structuredContent: objectBody(about),
333
+ content: [
334
+ { type: "resource", resource: { uri: answer.uri, mimeType: answer.mimeType, blob: answer.base64 } },
335
+ { type: "text", text: agentJson(about) }
336
+ ]
337
+ });
338
+ }
339
+ if (answer instanceof Picture) {
340
+ const about = sealed(answer.about);
341
+ return bounded({
342
+ structuredContent: objectBody(about),
343
+ content: [
344
+ { type: "image", data: Buffer.from(answer.bytes).toString("base64"), mimeType: answer.mimeType },
345
+ { type: "text", text: agentJson(about) }
346
+ ]
347
+ });
348
+ }
349
+ const body = objectBody(sealed(targets ? judgedAnswer(answer, targets) : answer));
350
+ return bounded({ content: [{ type: "text", text: JSON.stringify(body) }], structuredContent: body });
351
+ }, "answered");
352
+ var failed = /* @__PURE__ */ __name((error, errors, effects) => {
353
+ const judged = judgedEffects(effects);
354
+ const context = { ...failureContext(errors), ...judged ? { effects: judged } : {} };
355
+ return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(storeDamaged(error), context))));
356
+ }, "failed");
357
+
358
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/mcp/surface.js
359
+ var MATCHES = 8;
360
+ var ANSWER = answerSchema();
361
+ var agentAnswer = /* @__PURE__ */ __name((prefix, writes) => {
362
+ const meta = pipe(looseObject({}), description(`run facts; ${prefix}_tools_search shows the full answer`));
363
+ const next = optional(pipe(array(looseObject({})), description("steps to run next: command and args")));
364
+ return looseObject(writes ? { item: optional(unknown()), next, meta } : {
365
+ items: optional(array(unknown())),
366
+ item: optional(unknown()),
367
+ page: optional(looseObject({ has_more: boolean() })),
368
+ next,
369
+ missing: optional(array(looseObject({ field: string(), why: string() }))),
370
+ meta
371
+ });
372
+ }, "agentAnswer");
373
+ var listedAs = /* @__PURE__ */ __name((prefix, writes) => {
374
+ const checked = toStandardJsonSchema(ANSWER);
375
+ const shown = toStandardJsonSchema(agentAnswer(prefix, writes))["~standard"].jsonSchema;
376
+ return { "~standard": { ...checked["~standard"], jsonSchema: shown } };
377
+ }, "listedAs");
378
+ var normal = /* @__PURE__ */ __name((command) => command.trim().toLowerCase().split(/[\s_-]+/).join(" "), "normal");
379
+ var STOP_WORDS = new Set("a an the to of in on at by for from with into out about and or but is are be been was were it its this that these those which who whom whose what when where how do does did can could should would will my our your their his her them they we you i one some any all each every another other".split(" "));
380
+ var wordsOf = /* @__PURE__ */ __name((text) => text.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(Boolean), "wordsOf");
381
+ var stem = /* @__PURE__ */ __name((word) => {
382
+ const bare = word.replace(/'s$/u, "");
383
+ if (bare.length > 4 && bare.endsWith("ies"))
384
+ return `${bare.slice(0, -3)}y`;
385
+ for (const ending of ["ing", "ed", "es", "s"])
386
+ if (bare.length - ending.length >= 3 && bare.endsWith(ending))
387
+ return bare.slice(0, -ending.length);
388
+ return bare;
389
+ }, "stem");
390
+ var sameWord = /* @__PURE__ */ __name((asked, known) => {
391
+ if (asked === known)
392
+ return true;
393
+ const [short, long] = asked.length <= known.length ? [asked, known] : [known, asked];
394
+ return short.length >= 3 && long.startsWith(short);
395
+ }, "sameWord");
396
+ var fieldsOf = /* @__PURE__ */ __name((command, one) => [
397
+ [4, [...wordsOf(command), ...(one.aliases ?? []).flatMap(wordsOf)]],
398
+ [2, wordsOf(one.title)],
399
+ [1, [...wordsOf(one.description), ...(one.keywords ?? []).flatMap(wordsOf), ...Object.keys(one.input.entries)]]
400
+ ].map(([weight, words]) => [weight, [...new Set(words.map(stem))]]), "fieldsOf");
401
+ var search = /* @__PURE__ */ __name((commands, query) => {
402
+ const named = normal(query);
403
+ const all = Object.entries(commands);
404
+ if (!named)
405
+ return all.map((entry) => entry).sort((a, b) => a[0].localeCompare(b[0]));
406
+ const words = [
407
+ ...new Set(wordsOf(query).filter((word) => word.length > 1 && !STOP_WORDS.has(word)).map(stem))
408
+ ];
409
+ return all.map((entry) => {
410
+ const fields = fieldsOf(entry[0], entry[1]);
411
+ const weights = words.map((word) => fields.reduce((best, [weight, known]) => known.some((one) => sameWord(word, one)) ? Math.max(best, weight) : best, 0));
412
+ const matched = weights.filter((weight) => weight > 0).length;
413
+ const exact = normal(entry[0]) === named || (entry[1].aliases ?? []).some((alias) => normal(alias) === named);
414
+ return { entry, matched, rank: (exact ? 1e3 : 0) + matched * 10 + weights.reduce((a, b) => a + b, 0) };
415
+ }).filter(({ matched, rank }) => matched > 0 || rank >= 1e3).sort((a, b) => b.rank - a.rank || wordsOf(a.entry[0]).length - wordsOf(b.entry[0]).length || a.entry[0].localeCompare(b.entry[0])).map(({ entry }) => entry);
416
+ }, "search");
417
+ var nearest = /* @__PURE__ */ __name((commands, asked) => {
418
+ const words = normal(asked).split(" ");
419
+ return Object.keys(commands).map((one) => ({ one, shared: words.filter((word) => normal(one).split(" ").includes(word)).length })).filter(({ shared }) => shared > 0).sort((a, b) => b.shared - a.shared).slice(0, 3).map(({ one }) => one);
420
+ }, "nearest");
421
+ var runnableOnly = /* @__PURE__ */ __name((result, offered) => {
422
+ const body = result.structuredContent;
423
+ if (result.isError || !Array.isArray(body?.next))
424
+ return result;
425
+ const next = body.next.filter((step) => step.command === void 0 || offered(step.command));
426
+ const { next: _, ...rest } = body;
427
+ const kept = next.length > 0 ? { ...rest, next } : rest;
428
+ return {
429
+ ...result,
430
+ structuredContent: kept,
431
+ content: result.content.map((part) => part.type === "text" ? { ...part, text: JSON.stringify(kept) } : part)
432
+ };
433
+ }, "runnableOnly");
434
+ var takesNothing = /* @__PURE__ */ __name((one) => Object.values(one.input.entries).every((entry) => entry.type === "optional"), "takesNothing");
435
+ var sampleOf = /* @__PURE__ */ __name((commands) => {
436
+ const reading = Object.entries(commands).filter(([, one]) => !one.writes);
437
+ const bare = reading.filter(([, one]) => takesNothing(one));
438
+ return bare.find(([command]) => command.endsWith(" list"))?.[0] ?? bare[0]?.[0] ?? reading[0]?.[0] ?? Object.keys(commands)[0] ?? "";
439
+ }, "sampleOf");
440
+ var registerCommands = /* @__PURE__ */ __name((server, prefix, commands, errors, withheld, isMessenger) => {
441
+ const byNormal = new Map(Object.keys(commands).map((command) => [normal(command), command]));
442
+ const messenger = isMessenger ?? Object.keys(commands).some((command) => command.split(" ")[0] === "messages");
443
+ const tasks = messenger ? '"unread", "send message", "chat members"' : '"list", "show", "change a setting"';
444
+ const sample = messenger ? "messages list" : sampleOf(commands);
445
+ const untrusted = messenger ? UNTRUSTED : UNTRUSTED_NEUTRAL;
446
+ server.registerTool(`${prefix}_tools_search`, {
447
+ outputSchema: toStandardJsonSchema(looseObject({})),
448
+ title: "Find a command",
449
+ description: `Find the command for a task \u2014 ${tasks} \u2014 before calling ${prefix}_read or ${prefix}_write with it. Each match gives its command, whether it writes, its arguments and the shape of its answer. With no words, lists every command and title, without arguments.`,
450
+ inputSchema: toStandardJsonSchema(strictObject({ query: optional(pipe(string(), description("words that describe the task"))) })),
451
+ annotations: { ...READ, openWorldHint: false, idempotentHint: true }
452
+ }, async ({ query }) => {
453
+ const found = search(commands, query ?? "");
454
+ const items = query?.trim() ? found.slice(0, MATCHES).map(([command, one]) => ({
455
+ command,
456
+ title: one.title,
457
+ description: one.description,
458
+ writes: one.writes,
459
+ availability: one.availability?.() ?? { available: true },
460
+ arguments: toJsonSchema(one.input),
461
+ output: toJsonSchema(one.output ?? ANSWER)
462
+ })) : found.map(([command, one]) => ({
463
+ command,
464
+ title: one.title,
465
+ writes: one.writes,
466
+ availability: one.availability?.() ?? { available: true }
467
+ }));
468
+ const { next: _paging, ...list } = listOf(`${prefix}_tools_search`, {
469
+ items,
470
+ limit: Math.max(items.length, query?.trim() ? MATCHES : 1),
471
+ has_more: found.length > items.length
472
+ });
473
+ return answered(list);
474
+ });
475
+ const callers = {
476
+ env: process.env,
477
+ client: /* @__PURE__ */ __name(() => server.server.getClientVersion(), "client"),
478
+ connectionId: randomUUID()
479
+ };
480
+ const runner = /* @__PURE__ */ __name((writing) => async ({ command: asked, arguments: given }, ctx) => {
481
+ try {
482
+ const command = byNormal.get(normal(asked));
483
+ const one = command === void 0 ? void 0 : commands[command];
484
+ if (command === void 0 || !one) {
485
+ withheld?.(normal(asked));
486
+ const near = nearest(commands, asked);
487
+ throw new CliError("validation_error", `no command "${asked}" here${near.length ? ` \u2014 did you mean ${near.map((name) => `"${name}"`).join(", ")}?` : ""}; ${prefix}_tools_search finds one`);
488
+ }
489
+ if (one.writes !== writing)
490
+ throw new CliError("validation_error", `"${command}" ${writing ? "only reads" : "writes"}: call it with ${prefix}_${writing ? "read" : "write"}`);
491
+ const args = writing ? agentArguments(given ?? {}) : given ?? {};
492
+ const caller = currentCaller() ?? callerOf(ctx, command.replace(/[ -]/g, "_"), callers);
493
+ if (one.checked)
494
+ return runnableOnly(await withCaller(caller, () => one.run(args, ctx)), (named) => byNormal.has(normal(named)));
495
+ const parsed = safeParse(strictObject(one.input.entries), args);
496
+ if (!parsed.success)
497
+ throw new CliError("validation_error", `${command}: ${summarize(parsed.issues)}`, {
498
+ arguments: toJsonSchema(one.input)
499
+ });
500
+ return runnableOnly(await withCaller(caller, () => one.run(parsed.output, ctx)), (named) => byNormal.has(normal(named)));
501
+ } catch (error) {
502
+ return failed(error, errors);
503
+ }
504
+ }, "runner");
505
+ const call = strictObject({
506
+ command: pipe(string(), minLength(1), description(`a command ${prefix}_tools_search returned: "${sample}"`)),
507
+ arguments: optional(pipe(record(string(), unknown()), description("that command's arguments")))
508
+ });
509
+ server.registerTool(`${prefix}_read`, {
510
+ outputSchema: listedAs(prefix, false),
511
+ title: "Run a reading command",
512
+ description: `Run one command that only reads, with the arguments ${prefix}_tools_search showed. ${untrusted}`,
513
+ inputSchema: toStandardJsonSchema(call),
514
+ annotations: READ
515
+ }, runner(false));
516
+ if (Object.values(commands).some((one) => one.writes))
517
+ server.registerTool(`${prefix}_write`, {
518
+ outputSchema: listedAs(prefix, true),
519
+ title: "Run a writing command",
520
+ description: `Run one command that changes something \u2014 ${messenger ? "sends, edits, deletes, joins" : "creates, edits, deletes"} \u2014 with the arguments ${prefix}_tools_search showed. ${untrusted}`,
521
+ inputSchema: toStandardJsonSchema(call),
522
+ annotations: WRITE
523
+ }, runner(true));
524
+ }, "registerCommands");
525
+ var surfaceCommands = /* @__PURE__ */ __name((tools, registration) => {
526
+ const run = entryRunner(registration);
527
+ return Object.fromEntries(Object.entries(tools).map(([key, definition]) => [
528
+ commandOf(key, definition),
529
+ {
530
+ title: definition.title,
531
+ description: definition.description,
532
+ writes: definition.annotations.readOnlyHint !== true,
533
+ input: inputOf(definition, syncAllowedFor(key, registration.defaults)),
534
+ ...definition.output ? { output: outputSchemaOf(definition) } : {},
535
+ checked: true,
536
+ run: /* @__PURE__ */ __name((args, ctx) => run(key, definition, args, ctx), "run")
537
+ }
538
+ ]));
539
+ }, "surfaceCommands");
540
+ var outputOf = /* @__PURE__ */ __name(({ entity, view }) => answerSchema(ENTITIES[view ? `${entity}.${view}` : entity] ?? unknown()), "outputOf");
541
+
542
+ export {
543
+ message,
544
+ READ,
545
+ WRITE,
546
+ tool,
547
+ chatOf,
548
+ tierOf,
549
+ outcomeOf,
550
+ commandOf,
551
+ toolKey,
552
+ Picture,
553
+ BinaryResource,
554
+ answered,
555
+ failed,
556
+ normal,
557
+ search,
558
+ registerCommands,
559
+ surfaceCommands,
560
+ outputOf
561
+ };
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  wirecatDirectory
5
- } from "./chunk-T5D4OGDC.js";
5
+ } from "./chunk-WMG3H2VK.js";
6
6
  import {
7
7
  CliError
8
- } from "./chunk-54NDYVZA.js";
8
+ } from "./chunk-OLCU7Q2B.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/speech/models.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/speech/models.js
14
14
  var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/csukuangfj/${repository}/resolve/${commit}/${name}`, "huggingFace");
15
15
  var gigaam = huggingFace("sherpa-onnx-nemo-transducer-punct-giga-am-v3-russian-2025-12-16", "a6039be7cee829a9044a69ac0ebaf1c191217c97");
16
16
  var gigaamCtc = huggingFace("sherpa-onnx-nemo-ctc-punct-giga-am-v3-russian-2025-12-16", "4fb5407ff028a69fec516cdf4c10fac9ddea7c16");
@@ -137,7 +137,7 @@ var speechModel = /* @__PURE__ */ __name((id) => {
137
137
  return model;
138
138
  }, "speechModel");
139
139
 
140
- // node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/speech/install.js
140
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/speech/install.js
141
141
  import { createHash, randomUUID } from "node:crypto";
142
142
  import { createReadStream, createWriteStream, mkdirSync, statSync } from "node:fs";
143
143
  import { rename, rm } from "node:fs/promises";
@@ -0,0 +1,80 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ CliError
5
+ } from "./chunk-OLCU7Q2B.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-ZVVMGPBJ.js";
9
+
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
11
+ var COMMAND_NEEDS = {
12
+ "account update": ["updateProfile", "change the profile"],
13
+ "account sessions list": ["sessions", "list the account's sessions"],
14
+ "account sessions end": ["endOtherSessions", "end other sessions"],
15
+ "chats events": ["chatEvents", "read who joined or left"],
16
+ "chats inspect": ["inspect", "read a link"],
17
+ "chats folders list": ["folders", "list its folders"],
18
+ "chats folders show": ["folders", "list its folders"],
19
+ "chats folders create": ["createFolder", "create a folder"],
20
+ "chats folders update": ["updateFolder", "change a folder"],
21
+ "chats folders delete": ["deleteFolder", "delete a folder"],
22
+ "chats links show": ["group", "read a group"],
23
+ "chats links reset": ["resetInviteLink", "replace an invite link"],
24
+ "chats requests list": ["joinRequests", "read join requests"],
25
+ "chats requests confirm": ["answerJoinRequest", "answer join requests"],
26
+ "chats requests reject": ["answerJoinRequest", "answer join requests"],
27
+ "chats admins add": ["addAdmin", "make someone an admin"],
28
+ "chats admins remove": ["removeAdmin", "take admin rights back"],
29
+ "contacts add": ["addContact", "add a contact"],
30
+ "contacts remove": ["removeContact", "remove a contact"],
31
+ "contacts rename": ["renameContact", "rename a contact"],
32
+ "contacts import": ["importContacts", "import contacts"],
33
+ "contacts block": ["block", "block a person"],
34
+ "contacts unblock": ["unblock", "unblock a person"],
35
+ "messages forward": ["forward", "forward a message"],
36
+ "messages comments": ["comments", "read comments on a channel post"],
37
+ "messages pin": ["pin", "pin a message"],
38
+ "messages unpin": ["unpin", "unpin a message"],
39
+ "messages scheduled cancel": ["cancelScheduled", "cancel a scheduled message"],
40
+ "messages scheduled edit": ["editScheduled", "edit a scheduled message"],
41
+ "messages scheduled send": ["sendScheduled", "send a scheduled message now"]
42
+ };
43
+ var STORE_ANSWERS = /* @__PURE__ */ new Set(["chats events"]);
44
+ var lackedNeed = /* @__PURE__ */ __name((messenger, path) => {
45
+ const need = COMMAND_NEEDS[path];
46
+ if (!need)
47
+ return void 0;
48
+ if (path === "messages comments" && (messenger?.readsComments ?? messenger?.channelComments) === false)
49
+ return need;
50
+ if (!messenger?.lacks?.includes(need[0]) && !messenger?.never?.includes(need[0]))
51
+ return void 0;
52
+ return messenger.history === "store" && STORE_ANSWERS.has(path) ? void 0 : need;
53
+ }, "lackedNeed");
54
+ var refuseLacking = /* @__PURE__ */ __name((messenger, path) => {
55
+ const need = lackedNeed(messenger, path.join(" "));
56
+ if (need)
57
+ throw new CliError("validation_error", `this messenger cannot ${need[1]}`);
58
+ }, "refuseLacking");
59
+ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
60
+ const walk = /* @__PURE__ */ __name((command, path) => {
61
+ for (const child of command.commands) {
62
+ const at = [...path, child.name()];
63
+ const need = COMMAND_NEEDS[at.join(" ")];
64
+ if (need && messenger.never?.includes(need[0]))
65
+ child._hidden = true;
66
+ walk(child, at);
67
+ if (child.commands.length > 0 && child.commands.every((one) => one._hidden))
68
+ child._hidden = true;
69
+ }
70
+ }, "walk");
71
+ walk(group, [group.name()]);
72
+ return group;
73
+ }, "hideNever");
74
+
75
+ export {
76
+ COMMAND_NEEDS,
77
+ lackedNeed,
78
+ refuseLacking,
79
+ hideNever
80
+ };