clikcode 1.0.3 → 1.0.5
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.
- package/README.md +25 -14
- package/dist/chunk-23TDEBGZ.js +71 -0
- package/dist/chunk-25T3GVS7.js +425 -0
- package/dist/chunk-2BBELGHY.js +11 -0
- package/dist/chunk-2EOL5PZL.js +208 -0
- package/dist/chunk-2GAB36IE.js +26 -0
- package/dist/chunk-2OLS7V66.js +2440 -0
- package/dist/chunk-2QFO2URB.js +179 -0
- package/dist/chunk-2QWPQRSU.js +254 -0
- package/dist/chunk-2YPAPAR3.js +184 -0
- package/dist/chunk-2ZAG5372.js +33 -0
- package/dist/chunk-32IKAIZC.js +12507 -0
- package/dist/chunk-34AZEGYW.js +95 -0
- package/dist/chunk-34JQYQCA.js +175 -0
- package/dist/chunk-34ZISPAO.js +67 -0
- package/dist/chunk-3AAAARE6.js +46 -0
- package/dist/chunk-3AJ6Q3OY.js +510 -0
- package/dist/chunk-3B2CHX7M.js +884 -0
- package/dist/chunk-3BUFORRX.js +59 -0
- package/dist/chunk-3QLHYYFK.js +30 -0
- package/dist/chunk-3RXBMYKZ.js +140 -0
- package/dist/chunk-3TFNIJWS.js +52 -0
- package/dist/chunk-3W3IPDFP.js +119 -0
- package/dist/chunk-3WMS7SEE.js +417 -0
- package/dist/chunk-435ZNSZ3.js +23 -0
- package/dist/chunk-4AQ5NINV.js +39 -0
- package/dist/chunk-4GVEJ5FK.js +168 -0
- package/dist/chunk-4GXAO3UY.js +262 -0
- package/dist/chunk-4L2ZZM4Q.js +332 -0
- package/dist/chunk-4LPDG57B.js +17 -0
- package/dist/chunk-4NN3XQQT.js +223 -0
- package/dist/chunk-4QZEZME7.js +54 -0
- package/dist/chunk-4R6CSC3S.js +38 -0
- package/dist/chunk-4RHXTL3W.js +514 -0
- package/dist/chunk-4SJMPTVQ.js +18 -0
- package/dist/chunk-4VY7G6TX.js +114 -0
- package/dist/chunk-5642PBF7.js +124 -0
- package/dist/chunk-5B6TVO4A.js +33 -0
- package/dist/chunk-5BJLDUPL.js +62 -0
- package/dist/chunk-5HMFFJWU.js +19 -0
- package/dist/chunk-5IKLK33T.js +69 -0
- package/dist/chunk-5NQ5FFMX.js +44 -0
- package/dist/chunk-5QNNW5L6.js +176 -0
- package/dist/chunk-5SM5UAWN.js +239 -0
- package/dist/chunk-5WYJTA6O.js +74 -0
- package/dist/chunk-5ZSR2Y5T.js +227 -0
- package/dist/chunk-5ZWUM5GH.js +39 -0
- package/dist/chunk-64E7D4HY.js +364 -0
- package/dist/chunk-6CK466BC.js +99 -0
- package/dist/chunk-6ES45HHO.js +138 -0
- package/dist/chunk-6HYEZFGL.js +277 -0
- package/dist/chunk-6Y7HLXGW.js +29 -0
- package/dist/chunk-6YKK4FYR.js +258 -0
- package/dist/chunk-74WNMLMS.js +117 -0
- package/dist/chunk-7AULZ7OD.js +55 -0
- package/dist/chunk-7DOKGSUN.js +101 -0
- package/dist/chunk-7IH5LTIZ.js +195 -0
- package/dist/chunk-7ISTS5NS.js +21 -0
- package/dist/chunk-7NMUTGOW.js +527 -0
- package/dist/chunk-7PNHUZEL.js +153 -0
- package/dist/chunk-7TSQLONI.js +88 -0
- package/dist/chunk-AE7TOLD5.js +30 -0
- package/dist/chunk-AEMHSXKA.js +130 -0
- package/dist/chunk-AKRYTS2D.js +211 -0
- package/dist/chunk-AMNSE36L.js +59 -0
- package/dist/chunk-AZVD74ZV.js +23 -0
- package/dist/chunk-B35DVOTK.js +1981 -0
- package/dist/chunk-B4HNJRAH.js +626 -0
- package/dist/chunk-B5WYPPHS.js +13 -0
- package/dist/chunk-BBOVDXQM.js +59 -0
- package/dist/chunk-BD3ECZLK.js +62 -0
- package/dist/chunk-BDGSOT74.js +4578 -0
- package/dist/chunk-BF5VEOPK.js +31 -0
- package/dist/chunk-BFFRW4XH.js +47 -0
- package/dist/chunk-BFPC6PEW.js +208 -0
- package/dist/chunk-BGEMY2JJ.js +376 -0
- package/dist/chunk-BISGNHKD.js +35 -0
- package/dist/chunk-BMRAEBRY.js +21 -0
- package/dist/chunk-BNTXAZXW.js +127 -0
- package/dist/chunk-BOQBXGSN.js +75 -0
- package/dist/chunk-BTJDSTQP.js +213 -0
- package/dist/chunk-BUOPJQP5.js +218 -0
- package/dist/chunk-BXFJS65Q.js +52 -0
- package/dist/chunk-BXPQFSX5.js +59 -0
- package/dist/chunk-C57LIWNY.js +1269 -0
- package/dist/chunk-C6YVCCWR.js +74 -0
- package/dist/chunk-CAADDF6M.js +167 -0
- package/dist/chunk-CBANJFBO.js +69 -0
- package/dist/chunk-CERF3RIB.js +597 -0
- package/dist/chunk-COAS5ETR.js +46 -0
- package/dist/chunk-CQ7J6UQ7.js +78 -0
- package/dist/chunk-CRUVYGO2.js +26 -0
- package/dist/chunk-CVFVFRGN.js +58 -0
- package/dist/chunk-D2UK66HM.js +37 -0
- package/dist/chunk-D2W7SA4R.js +18 -0
- package/dist/chunk-DA44ZENT.js +501 -0
- package/dist/chunk-DAJ76TOC.js +99 -0
- package/dist/chunk-DCZ6CIUM.js +147 -0
- package/dist/chunk-DF35KMXM.js +1314 -0
- package/dist/chunk-DGASQT26.js +151 -0
- package/dist/chunk-DJT57C5P.js +55 -0
- package/dist/chunk-DKDPZTD3.js +44 -0
- package/dist/chunk-DQYVQ2N7.js +77 -0
- package/dist/chunk-DRTP2RTY.js +266 -0
- package/dist/chunk-DW2BMUKY.js +61 -0
- package/dist/chunk-DW5T5ZVU.js +307 -0
- package/dist/chunk-DXKNDNFC.js +164 -0
- package/dist/chunk-DZEQ7UYR.js +291 -0
- package/dist/chunk-E4F4OUAC.js +463 -0
- package/dist/chunk-EE4B6A7W.js +69 -0
- package/dist/chunk-EISKIYWG.js +23 -0
- package/dist/chunk-EKAQK7UQ.js +235 -0
- package/dist/chunk-EOBTJV32.js +123 -0
- package/dist/chunk-ESF3DIZY.js +325 -0
- package/dist/chunk-EVOHOZ4U.js +45 -0
- package/dist/chunk-EXN4KHLB.js +110 -0
- package/dist/chunk-F252T6Y3.js +78 -0
- package/dist/chunk-F3DP4ZA2.js +40 -0
- package/dist/chunk-F6F47QAY.js +58 -0
- package/dist/chunk-FA3Y23ZW.js +57 -0
- package/dist/chunk-FBKXE4EJ.js +640 -0
- package/dist/chunk-FCGEB3H6.js +23 -0
- package/dist/chunk-FF7ZVYJF.js +3732 -0
- package/dist/chunk-FFGKN6L3.js +39 -0
- package/dist/chunk-FFGU4GCC.js +94 -0
- package/dist/chunk-FSFDAOVP.js +74 -0
- package/dist/chunk-FT5TX7OX.js +1573 -0
- package/dist/chunk-G3QP67Z7.js +232 -0
- package/dist/chunk-G5ORJKV2.js +179 -0
- package/dist/chunk-GFNC62PE.js +111 -0
- package/dist/chunk-GGK43Q3N.js +67 -0
- package/dist/chunk-GGYKY4GF.js +11537 -0
- package/dist/chunk-GGYNHGNJ.js +55 -0
- package/dist/chunk-GLY7RM3C.js +354 -0
- package/dist/chunk-GQBZU6EO.js +20 -0
- package/dist/chunk-GSXENUZL.js +9 -0
- package/dist/chunk-GTOAT5D3.js +40 -0
- package/dist/chunk-GWCMDPQU.js +1007 -0
- package/dist/chunk-GXYSMYHJ.js +152 -0
- package/dist/chunk-GYMAI5NY.js +14 -0
- package/dist/chunk-H2VZMKPE.js +30 -0
- package/dist/chunk-H4THUNBM.js +2091 -0
- package/dist/chunk-HGRVSNUZ.js +361 -0
- package/dist/chunk-HI4VY473.js +27 -0
- package/dist/chunk-HOJRSD3Q.js +447 -0
- package/dist/chunk-HRX25W35.js +82 -0
- package/dist/chunk-HSE4AQYV.js +55 -0
- package/dist/chunk-HU5SSUFX.js +383 -0
- package/dist/chunk-I3GDBJLH.js +196 -0
- package/dist/chunk-I75EDU75.js +684 -0
- package/dist/chunk-IBA7DMIO.js +20 -0
- package/dist/chunk-IC6N4NZA.js +231 -0
- package/dist/chunk-IF43HIGV.js +284 -0
- package/dist/chunk-IGZ6C2MC.js +439 -0
- package/dist/chunk-IMLTL2MY.js +192 -0
- package/dist/chunk-IMZL6SGR.js +33 -0
- package/dist/chunk-IS4USJPY.js +516 -0
- package/dist/chunk-ISFSPN2F.js +82 -0
- package/dist/chunk-IXE7GTFI.js +55 -0
- package/dist/chunk-IZ77QJQG.js +36 -0
- package/dist/chunk-J2PACWRQ.js +34 -0
- package/dist/chunk-J6EGFVQX.js +180 -0
- package/dist/chunk-JEKOD43D.js +22 -0
- package/dist/chunk-JGIWATSG.js +30 -0
- package/dist/chunk-JYBONKD4.js +43 -0
- package/dist/chunk-K2NLG2HK.js +454 -0
- package/dist/chunk-KCQ4TBLS.js +164 -0
- package/dist/chunk-KD5KIVMS.js +176 -0
- package/dist/chunk-KHW6TX6I.js +63 -0
- package/dist/chunk-KI5GZFCE.js +520 -0
- package/dist/chunk-KN34B7NO.js +105 -0
- package/dist/chunk-KYUHIFP3.js +136 -0
- package/dist/chunk-KZL5VS4B.js +300 -0
- package/dist/chunk-L3VW3QIH.js +48 -0
- package/dist/chunk-LA6MG4ET.js +2110 -0
- package/dist/chunk-LAVFOA3S.js +66 -0
- package/dist/chunk-LB4OA77N.js +13 -0
- package/dist/chunk-LBFRF2K4.js +196 -0
- package/dist/chunk-LM6EIA4B.js +93 -0
- package/dist/chunk-LPCNRGJ7.js +692 -0
- package/dist/chunk-LSLNL5T3.js +168 -0
- package/dist/chunk-LVRRWP4W.js +568 -0
- package/dist/chunk-LWCFBRHL.js +33 -0
- package/dist/chunk-LXFTMGZZ.js +166 -0
- package/dist/chunk-M33LVA4M.js +151 -0
- package/dist/chunk-M3FO5UMK.js +4944 -0
- package/dist/chunk-M5QNDBAY.js +66 -0
- package/dist/chunk-M6ND6KBE.js +1291 -0
- package/dist/chunk-M7H3WQTE.js +76 -0
- package/dist/chunk-MCBRVPA7.js +191 -0
- package/dist/chunk-MCSDWZET.js +91 -0
- package/dist/chunk-MDT5XDXL.js +289 -0
- package/dist/chunk-MJG3IQY4.js +91 -0
- package/dist/chunk-MOU3N2UL.js +44 -0
- package/dist/chunk-MP4KZOQC.js +3451 -0
- package/dist/chunk-MPAJ446F.js +66 -0
- package/dist/chunk-MVJZZ6AL.js +16 -0
- package/dist/chunk-MXS6S2PY.js +253 -0
- package/dist/chunk-N3SFDYM7.js +291 -0
- package/dist/chunk-NAOX3JUB.js +13 -0
- package/dist/chunk-NEKKIBCX.js +283 -0
- package/dist/chunk-NKDATMEM.js +133 -0
- package/dist/chunk-NR4FMC4K.js +395 -0
- package/dist/chunk-NSOHOJBR.js +221 -0
- package/dist/chunk-NTDB6QKF.js +29 -0
- package/dist/chunk-NWEYRBWK.js +25 -0
- package/dist/chunk-O2YSNYWD.js +23 -0
- package/dist/chunk-O3EW7LAY.js +54 -0
- package/dist/chunk-O7BNJIXU.js +366 -0
- package/dist/chunk-OARL2NXZ.js +116 -0
- package/dist/chunk-OHKZUEJW.js +351 -0
- package/dist/chunk-OKU45BXA.js +647 -0
- package/dist/chunk-OL4JBD3J.js +59 -0
- package/dist/chunk-OLUO5DDR.js +192 -0
- package/dist/chunk-OQ245JLA.js +196 -0
- package/dist/chunk-P72UZAQI.js +289 -0
- package/dist/chunk-PAL2ENB6.js +20 -0
- package/dist/chunk-PAXYQZH7.js +53 -0
- package/dist/chunk-PDPEM5VW.js +51 -0
- package/dist/chunk-PEWCDI2C.js +668 -0
- package/dist/chunk-PGZ54EDX.js +27 -0
- package/dist/chunk-PRWVLDZF.js +73 -0
- package/dist/chunk-PSQQ75VJ.js +52 -0
- package/dist/chunk-PUOVIFHW.js +118 -0
- package/dist/chunk-PWBF2X3V.js +107 -0
- package/dist/chunk-PWXII6HF.js +43 -0
- package/dist/chunk-Q35VLJRT.js +80 -0
- package/dist/chunk-QJP7EYGL.js +128 -0
- package/dist/chunk-QPQKX2MK.js +8836 -0
- package/dist/chunk-QQRLPY25.js +1053 -0
- package/dist/chunk-QUS4ER2W.js +407 -0
- package/dist/chunk-QYHI3YET.js +29 -0
- package/dist/chunk-QYRU2UQI.js +32 -0
- package/dist/chunk-R6XVVQGC.js +13 -0
- package/dist/chunk-R7QN6ONS.js +483 -0
- package/dist/chunk-RD23MPGC.js +221 -0
- package/dist/chunk-RDDWQBEM.js +185 -0
- package/dist/chunk-RDLLDYFO.js +104 -0
- package/dist/chunk-RE4TGORR.js +84 -0
- package/dist/chunk-RJLHVYQY.js +217 -0
- package/dist/chunk-RJLPTWHW.js +905 -0
- package/dist/chunk-RKUVLRZI.js +295 -0
- package/dist/chunk-ROGXPGYR.js +37 -0
- package/dist/chunk-RSZGEL5U.js +163 -0
- package/dist/chunk-RVUOIJXN.js +909 -0
- package/dist/chunk-RW7F4JRP.js +11 -0
- package/dist/chunk-S4UO3AO3.js +53 -0
- package/dist/chunk-S5JAAF6S.js +585 -0
- package/dist/chunk-SNU37TQI.js +56 -0
- package/dist/chunk-SQVUDO2O.js +31 -0
- package/dist/chunk-SYVHIYQT.js +66 -0
- package/dist/chunk-SZBQMTG2.js +85 -0
- package/dist/chunk-T5VCXA3J.js +25 -0
- package/dist/chunk-TK6NSP56.js +30 -0
- package/dist/chunk-TKWVMA6L.js +22 -0
- package/dist/chunk-TQDKJHWX.js +59 -0
- package/dist/chunk-TQDM7S5N.js +127 -0
- package/dist/chunk-TULAXS77.js +23 -0
- package/dist/chunk-TVT45XNH.js +4625 -0
- package/dist/chunk-TWCVV2JO.js +467 -0
- package/dist/chunk-U4DKAD6S.js +47 -0
- package/dist/chunk-UA5K2BTI.js +564 -0
- package/dist/chunk-UAMKCMOK.js +40 -0
- package/dist/chunk-UBMVADBF.js +51 -0
- package/dist/chunk-UFQ5A5PW.js +645 -0
- package/dist/chunk-UOD2SOLL.js +1301 -0
- package/dist/chunk-UTSB4LOW.js +156 -0
- package/dist/chunk-UVXNIUTN.js +412 -0
- package/dist/chunk-UXVPXYPE.js +90 -0
- package/dist/chunk-UYEEMIWR.js +374 -0
- package/dist/chunk-VBGM5ZBW.js +54 -0
- package/dist/chunk-VEWPCZPG.js +762 -0
- package/dist/chunk-VIRDLZ5E.js +108 -0
- package/dist/chunk-VMPO7WKN.js +52 -0
- package/dist/chunk-W2NVSDO5.js +5122 -0
- package/dist/chunk-W3YYPBEA.js +176 -0
- package/dist/chunk-W5AYOICN.js +280 -0
- package/dist/chunk-W5GZOIUF.js +27 -0
- package/dist/chunk-WHKNLZ3C.js +76 -0
- package/dist/chunk-WKBEPPQ5.js +1409 -0
- package/dist/chunk-WM3Z6QKQ.js +151 -0
- package/dist/chunk-WMI2TPMA.js +31 -0
- package/dist/chunk-WNX5VD7S.js +150 -0
- package/dist/chunk-WOVTYST3.js +60 -0
- package/dist/chunk-WPB5WEZJ.js +546 -0
- package/dist/chunk-WUO5EOAT.js +44 -0
- package/dist/chunk-WWLJMP6D.js +133 -0
- package/dist/chunk-WZMLH3XP.js +58 -0
- package/dist/chunk-WZYVLUVQ.js +79 -0
- package/dist/chunk-X2OCPVU5.js +135 -0
- package/dist/chunk-X3CL6DTR.js +95 -0
- package/dist/chunk-X6WF7JEV.js +354 -0
- package/dist/chunk-XAHGBPWT.js +44 -0
- package/dist/chunk-XCKQ5BM2.js +228 -0
- package/dist/chunk-XIBYREEY.js +106 -0
- package/dist/chunk-XKW5NDMR.js +378 -0
- package/dist/chunk-XRDALAO3.js +100 -0
- package/dist/chunk-XUP22EAS.js +41 -0
- package/dist/chunk-XWAC3MKW.js +243 -0
- package/dist/chunk-Y3R7JMXB.js +59 -0
- package/dist/chunk-Y54LTP4W.js +82 -0
- package/dist/chunk-Y7UECI4M.js +99 -0
- package/dist/chunk-YACGDFHC.js +47 -0
- package/dist/chunk-YHNIQPKY.js +71 -0
- package/dist/chunk-YMBR6HYP.js +111 -0
- package/dist/chunk-YMCH3L2S.js +26 -0
- package/dist/chunk-Z4ZU6T7V.js +99 -0
- package/dist/chunk-ZDPF67ZZ.js +173 -0
- package/dist/chunk-ZFC2Q67K.js +101 -0
- package/dist/chunk-ZGHNNSCT.js +114 -0
- package/dist/chunk-ZGX3ERAT.js +173 -0
- package/dist/chunk-ZI3YHEBY.js +37 -0
- package/dist/chunk-ZN7G6JLS.js +639 -0
- package/dist/chunk-ZNPFQMXT.js +47 -0
- package/dist/chunk-ZOU3LV4U.js +63 -0
- package/dist/chunk-ZT7B4H2V.js +117 -0
- package/dist/chunk-ZZCBDNZI.js +58 -0
- package/dist/cli.js +498 -112593
- package/dist/computer-tools.js +36642 -21258
- package/dist/harness-catalog.cjs +88 -43
- package/dist/index.js +1 -1
- package/dist/local-model-supervisor.cjs +555 -0
- package/package.json +3 -4
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createRequire as __clikcodeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __clikcodeCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
adoptAuthFiles,
|
|
5
|
+
authEvidencePresent,
|
|
6
|
+
authFilePresent,
|
|
7
|
+
authFilesStamp,
|
|
8
|
+
expandAuthPath,
|
|
9
|
+
expandAuthPaths,
|
|
10
|
+
harnessCanLogout,
|
|
11
|
+
hasAuthEvidence,
|
|
12
|
+
keychainService,
|
|
13
|
+
logoutNativeHarness,
|
|
14
|
+
prepareAuthFilesForLogin,
|
|
15
|
+
removableAuthFiles,
|
|
16
|
+
removeAuthFiles
|
|
17
|
+
} from "./chunk-DF35KMXM.js";
|
|
18
|
+
import "./chunk-ZT7B4H2V.js";
|
|
19
|
+
import "./chunk-OL4JBD3J.js";
|
|
20
|
+
import "./chunk-IGZ6C2MC.js";
|
|
21
|
+
import "./chunk-4NN3XQQT.js";
|
|
22
|
+
import "./chunk-4AQ5NINV.js";
|
|
23
|
+
import "./chunk-WPB5WEZJ.js";
|
|
24
|
+
import "./chunk-GYMAI5NY.js";
|
|
25
|
+
import "./chunk-CQ7J6UQ7.js";
|
|
26
|
+
import "./chunk-XKW5NDMR.js";
|
|
27
|
+
import "./chunk-W3YYPBEA.js";
|
|
28
|
+
import "./chunk-XIBYREEY.js";
|
|
29
|
+
import "./chunk-EE4B6A7W.js";
|
|
30
|
+
import "./chunk-WZYVLUVQ.js";
|
|
31
|
+
import "./chunk-O3EW7LAY.js";
|
|
32
|
+
import "./chunk-KHW6TX6I.js";
|
|
33
|
+
import "./chunk-YMCH3L2S.js";
|
|
34
|
+
import "./chunk-G3QP67Z7.js";
|
|
35
|
+
import "./chunk-4L2ZZM4Q.js";
|
|
36
|
+
import "./chunk-F6F47QAY.js";
|
|
37
|
+
import "./chunk-RDDWQBEM.js";
|
|
38
|
+
import "./chunk-MPAJ446F.js";
|
|
39
|
+
import "./chunk-CBANJFBO.js";
|
|
40
|
+
import "./chunk-PWXII6HF.js";
|
|
41
|
+
export {
|
|
42
|
+
adoptAuthFiles,
|
|
43
|
+
authEvidencePresent,
|
|
44
|
+
authFilePresent,
|
|
45
|
+
authFilesStamp,
|
|
46
|
+
expandAuthPath,
|
|
47
|
+
expandAuthPaths,
|
|
48
|
+
harnessCanLogout,
|
|
49
|
+
hasAuthEvidence,
|
|
50
|
+
keychainService,
|
|
51
|
+
logoutNativeHarness,
|
|
52
|
+
prepareAuthFilesForLogin,
|
|
53
|
+
removableAuthFiles,
|
|
54
|
+
removeAuthFiles
|
|
55
|
+
};
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { createRequire as __clikcodeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __clikcodeCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
McpSignInRequired
|
|
5
|
+
} from "./chunk-UA5K2BTI.js";
|
|
6
|
+
import {
|
|
7
|
+
JsonRpcPeer
|
|
8
|
+
} from "./chunk-IGZ6C2MC.js";
|
|
9
|
+
import {
|
|
10
|
+
spawnPortable
|
|
11
|
+
} from "./chunk-WPB5WEZJ.js";
|
|
12
|
+
import {
|
|
13
|
+
quiet,
|
|
14
|
+
swallowed
|
|
15
|
+
} from "./chunk-RDDWQBEM.js";
|
|
16
|
+
|
|
17
|
+
// src/agent/mcp/transport.ts
|
|
18
|
+
var McpRequestError = class extends Error {
|
|
19
|
+
constructor(message, code) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.code = code;
|
|
22
|
+
this.name = "McpRequestError";
|
|
23
|
+
}
|
|
24
|
+
code;
|
|
25
|
+
};
|
|
26
|
+
function cancelledError() {
|
|
27
|
+
return Object.assign(new Error("MCP request cancelled"), { name: "AbortError" });
|
|
28
|
+
}
|
|
29
|
+
function cancellable(transport, options, start) {
|
|
30
|
+
const { signal } = options;
|
|
31
|
+
if (signal?.aborted) return Promise.reject(cancelledError());
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
let id;
|
|
34
|
+
const onAbort = () => {
|
|
35
|
+
if (id !== void 0) transport.notify("notifications/cancelled", { requestId: id, reason: "cancelled by the user" });
|
|
36
|
+
reject(cancelledError());
|
|
37
|
+
};
|
|
38
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
39
|
+
start((value) => {
|
|
40
|
+
id = value;
|
|
41
|
+
}).then(resolve, (error) => {
|
|
42
|
+
if (id !== void 0 && error?.code === "ERR_JSONRPC_TIMEOUT") {
|
|
43
|
+
transport.notify("notifications/cancelled", { requestId: id, reason: "timed out" });
|
|
44
|
+
}
|
|
45
|
+
reject(error);
|
|
46
|
+
}).finally(() => signal?.removeEventListener("abort", onAbort));
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function answerServerRequest(method) {
|
|
50
|
+
return method === "ping" ? Promise.resolve({}) : void 0;
|
|
51
|
+
}
|
|
52
|
+
function stdioTransport(spec, handlers) {
|
|
53
|
+
const detached = process.platform !== "win32";
|
|
54
|
+
const child = spawnPortable(spec.command, [...spec.args], {
|
|
55
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
56
|
+
env: { ...process.env, ...spec.env },
|
|
57
|
+
detached,
|
|
58
|
+
windowsHide: true
|
|
59
|
+
});
|
|
60
|
+
child.unref();
|
|
61
|
+
for (const stream of [child.stdin, child.stdout, child.stderr]) stream?.unref?.();
|
|
62
|
+
const peer = new JsonRpcPeer(child, {
|
|
63
|
+
label: `MCP server ${spec.name}`,
|
|
64
|
+
detached,
|
|
65
|
+
// The manager owns shutdown; forwarding SIGINT would kill servers on a
|
|
66
|
+
// Ctrl-C that only meant "stop this turn".
|
|
67
|
+
forwardParentSignals: false,
|
|
68
|
+
onRequest: (method) => answerServerRequest(method),
|
|
69
|
+
onNotification: (method, params) => handlers.onNotification?.(method, params),
|
|
70
|
+
onClose: (error) => handlers.onClose?.(error)
|
|
71
|
+
});
|
|
72
|
+
const transport = {
|
|
73
|
+
request: (method, params, options) => cancellable(
|
|
74
|
+
transport,
|
|
75
|
+
options,
|
|
76
|
+
(onId) => peer.request(method, params, { timeoutMs: options.timeoutMs, onId })
|
|
77
|
+
),
|
|
78
|
+
notify: (method, params) => {
|
|
79
|
+
peer.notify(method, params);
|
|
80
|
+
},
|
|
81
|
+
setProtocolVersion: () => void 0,
|
|
82
|
+
get closed() {
|
|
83
|
+
return peer.closed;
|
|
84
|
+
},
|
|
85
|
+
detail: () => peer.failureDetail(),
|
|
86
|
+
close: () => peer.shutdown({ graceMs: 1e3, killMs: 1e3 }),
|
|
87
|
+
killNow: () => peer.kill("SIGKILL")
|
|
88
|
+
};
|
|
89
|
+
return transport;
|
|
90
|
+
}
|
|
91
|
+
async function* readSseEvents(body) {
|
|
92
|
+
const reader = body.getReader();
|
|
93
|
+
const decoder = new TextDecoder();
|
|
94
|
+
let buffer = "";
|
|
95
|
+
const parse = (block) => {
|
|
96
|
+
let event = "message";
|
|
97
|
+
const data = [];
|
|
98
|
+
for (const line of block.split(/\r?\n/)) {
|
|
99
|
+
if (!line || line.startsWith(":")) continue;
|
|
100
|
+
const colon = line.indexOf(":");
|
|
101
|
+
const field = colon < 0 ? line : line.slice(0, colon);
|
|
102
|
+
const value = colon < 0 ? "" : line.slice(colon + 1).replace(/^ /, "");
|
|
103
|
+
if (field === "event") event = value;
|
|
104
|
+
else if (field === "data") data.push(value);
|
|
105
|
+
}
|
|
106
|
+
return data.length ? { event, data: data.join("\n") } : void 0;
|
|
107
|
+
};
|
|
108
|
+
try {
|
|
109
|
+
for (; ; ) {
|
|
110
|
+
const { value, done } = await reader.read();
|
|
111
|
+
if (done) break;
|
|
112
|
+
buffer += decoder.decode(value, { stream: true });
|
|
113
|
+
for (let match = /\r?\n\r?\n/.exec(buffer); match; match = /\r?\n\r?\n/.exec(buffer)) {
|
|
114
|
+
const parsed = parse(buffer.slice(0, match.index));
|
|
115
|
+
buffer = buffer.slice(match.index + match[0].length);
|
|
116
|
+
if (parsed) yield parsed;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const last = parse(buffer);
|
|
120
|
+
if (last) yield last;
|
|
121
|
+
} finally {
|
|
122
|
+
reader.releaseLock();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
var HttpTransport = class {
|
|
126
|
+
constructor(spec, handlers, fetchImpl = fetch, auth) {
|
|
127
|
+
this.spec = spec;
|
|
128
|
+
this.handlers = handlers;
|
|
129
|
+
this.fetchImpl = fetchImpl;
|
|
130
|
+
this.auth = auth;
|
|
131
|
+
this.mode = spec.transport === "sse" ? "sse" : "streamable";
|
|
132
|
+
}
|
|
133
|
+
spec;
|
|
134
|
+
handlers;
|
|
135
|
+
fetchImpl;
|
|
136
|
+
auth;
|
|
137
|
+
pending = /* @__PURE__ */ new Map();
|
|
138
|
+
/** Aborted on shutdown, so no request or open stream outlives the transport. */
|
|
139
|
+
lifetime = new AbortController();
|
|
140
|
+
streams = /* @__PURE__ */ new Set([this.lifetime]);
|
|
141
|
+
nextId = 1;
|
|
142
|
+
sessionId;
|
|
143
|
+
protocolVersion;
|
|
144
|
+
/** Set once the legacy transport's GET stream has named where to POST. */
|
|
145
|
+
sseEndpoint;
|
|
146
|
+
mode;
|
|
147
|
+
isClosed = false;
|
|
148
|
+
lastError = "";
|
|
149
|
+
get closed() {
|
|
150
|
+
return this.isClosed;
|
|
151
|
+
}
|
|
152
|
+
detail() {
|
|
153
|
+
return this.lastError;
|
|
154
|
+
}
|
|
155
|
+
setProtocolVersion(version) {
|
|
156
|
+
this.protocolVersion = version;
|
|
157
|
+
}
|
|
158
|
+
request(method, params, options) {
|
|
159
|
+
return cancellable(this, options, (onId) => new Promise((resolve, reject) => {
|
|
160
|
+
if (this.isClosed) return reject(new McpRequestError(`MCP server ${this.spec.name} is closed`));
|
|
161
|
+
const id = this.nextId++;
|
|
162
|
+
const timer = setTimeout(() => {
|
|
163
|
+
if (!this.pending.delete(id)) return;
|
|
164
|
+
reject(Object.assign(new McpRequestError(`MCP server ${this.spec.name} ${method} timed out after ${Math.round(options.timeoutMs / 1e3)}s`), { code: "ERR_JSONRPC_TIMEOUT" }));
|
|
165
|
+
}, options.timeoutMs);
|
|
166
|
+
this.pending.set(id, { method, resolve, reject, timer });
|
|
167
|
+
onId(id);
|
|
168
|
+
this.send({ jsonrpc: "2.0", id, method, params }).catch((error) => this.settle(id, void 0, error));
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
notify(method, params) {
|
|
172
|
+
if (this.isClosed) return;
|
|
173
|
+
this.send({ jsonrpc: "2.0", method, ...params ? { params } : {} }).catch(quiet("agent/mcp/transport"));
|
|
174
|
+
}
|
|
175
|
+
async close() {
|
|
176
|
+
if (this.isClosed) return;
|
|
177
|
+
const sessionId = this.mode === "streamable" ? this.sessionId : void 0;
|
|
178
|
+
this.shut(new Error(`MCP server ${this.spec.name} was shut down`));
|
|
179
|
+
if (sessionId) {
|
|
180
|
+
const authorization = await this.auth?.authorization().catch(quiet("agent/mcp/transport"));
|
|
181
|
+
await this.fetchImpl(this.spec.url, {
|
|
182
|
+
method: "DELETE",
|
|
183
|
+
headers: { ...this.spec.headers, "mcp-session-id": sessionId, ...authorization ? { authorization } : {} },
|
|
184
|
+
signal: AbortSignal.timeout(2e3)
|
|
185
|
+
}).catch(quiet("agent/mcp/transport"));
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
killNow() {
|
|
189
|
+
this.shut(new Error(`MCP server ${this.spec.name} was shut down`));
|
|
190
|
+
}
|
|
191
|
+
shut(error) {
|
|
192
|
+
if (this.isClosed) return;
|
|
193
|
+
this.isClosed = true;
|
|
194
|
+
for (const controller of this.streams) controller.abort();
|
|
195
|
+
this.streams.clear();
|
|
196
|
+
for (const [id] of [...this.pending]) this.settle(id, void 0, error);
|
|
197
|
+
this.handlers.onClose?.(error);
|
|
198
|
+
}
|
|
199
|
+
headers(extra = {}) {
|
|
200
|
+
return {
|
|
201
|
+
...this.spec.headers,
|
|
202
|
+
...this.sessionId ? { "mcp-session-id": this.sessionId } : {},
|
|
203
|
+
...this.protocolVersion ? { "mcp-protocol-version": this.protocolVersion } : {},
|
|
204
|
+
...extra
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
/** A request with the credential attached. A 401 gets one fresh token and
|
|
208
|
+
* one retry; a server that still refuses, or whose credential is gone,
|
|
209
|
+
* needs a sign-in -- reported, never started from here (oauth.ts). */
|
|
210
|
+
async authorizedFetch(url, init) {
|
|
211
|
+
for (let attempt = 0; ; attempt++) {
|
|
212
|
+
const authorization = await this.auth?.authorization();
|
|
213
|
+
const response = await this.fetchImpl(url, { ...init, headers: { ...init.headers, ...authorization ? { authorization } : {} } });
|
|
214
|
+
if (response.status !== 401 || !this.auth) return response;
|
|
215
|
+
const verdict = await this.auth.unauthorized(response.headers.get("www-authenticate"), authorization, attempt > 0);
|
|
216
|
+
if (verdict === "fail") return response;
|
|
217
|
+
await response.body?.cancel().catch(quiet("agent/mcp/transport"));
|
|
218
|
+
if (verdict === "sign-in") throw new McpSignInRequired(this.spec.name);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
async send(message) {
|
|
222
|
+
if (this.mode === "sse") return this.sendLegacy(message);
|
|
223
|
+
const response = await this.authorizedFetch(this.spec.url, {
|
|
224
|
+
method: "POST",
|
|
225
|
+
headers: this.headers({ "content-type": "application/json", accept: "application/json, text/event-stream" }),
|
|
226
|
+
body: JSON.stringify(message),
|
|
227
|
+
signal: this.lifetime.signal
|
|
228
|
+
});
|
|
229
|
+
const session = response.headers.get("mcp-session-id");
|
|
230
|
+
if (session) this.sessionId = session;
|
|
231
|
+
if (!response.ok) {
|
|
232
|
+
const text2 = (await response.text().catch(() => "")).trim().slice(0, 500);
|
|
233
|
+
if (message.method === "initialize" && [400, 404, 405].includes(response.status) && this.spec.transport === "http") {
|
|
234
|
+
this.mode = "sse";
|
|
235
|
+
this.streamableRefusal = `HTTP ${response.status}${text2 ? `: ${text2}` : ""}`;
|
|
236
|
+
return this.sendLegacy(message);
|
|
237
|
+
}
|
|
238
|
+
if (response.status === 404 && this.sessionId) this.shut(new McpRequestError(`MCP server ${this.spec.name} ended the session`));
|
|
239
|
+
this.lastError = `HTTP ${response.status}${text2 ? `: ${text2}` : ""}`;
|
|
240
|
+
throw new McpRequestError(`MCP server ${this.spec.name} answered ${this.lastError}`);
|
|
241
|
+
}
|
|
242
|
+
if (response.status === 202 || !response.body) return;
|
|
243
|
+
const type = response.headers.get("content-type") ?? "";
|
|
244
|
+
if (type.includes("text/event-stream")) {
|
|
245
|
+
void this.consumeStream(response.body, void 0);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const text = await response.text();
|
|
249
|
+
if (!text.trim()) return;
|
|
250
|
+
this.dispatchAll(JSON.parse(text));
|
|
251
|
+
}
|
|
252
|
+
async sendLegacy(message) {
|
|
253
|
+
const endpoint = this.sseEndpoint ?? await this.openLegacyStream();
|
|
254
|
+
const response = await this.authorizedFetch(endpoint, {
|
|
255
|
+
method: "POST",
|
|
256
|
+
headers: this.headers({ "content-type": "application/json" }),
|
|
257
|
+
body: JSON.stringify(message),
|
|
258
|
+
signal: this.lifetime.signal
|
|
259
|
+
});
|
|
260
|
+
if (!response.ok) {
|
|
261
|
+
this.lastError = `HTTP ${response.status}`;
|
|
262
|
+
throw new McpRequestError(`MCP server ${this.spec.name} answered ${this.lastError}`);
|
|
263
|
+
}
|
|
264
|
+
await response.body?.cancel().catch(quiet("agent/mcp/transport"));
|
|
265
|
+
}
|
|
266
|
+
legacyOpening;
|
|
267
|
+
/** The streamable-HTTP answer that sent this connection to the legacy transport. */
|
|
268
|
+
streamableRefusal;
|
|
269
|
+
/** The old transport: one long GET whose first event says where to POST,
|
|
270
|
+
* and every answer comes back down that same stream. */
|
|
271
|
+
openLegacyStream() {
|
|
272
|
+
this.legacyOpening ??= (async () => {
|
|
273
|
+
const controller = new AbortController();
|
|
274
|
+
this.streams.add(controller);
|
|
275
|
+
const response = await this.authorizedFetch(this.spec.url, {
|
|
276
|
+
method: "GET",
|
|
277
|
+
headers: this.headers({ accept: "text/event-stream" }),
|
|
278
|
+
signal: controller.signal
|
|
279
|
+
});
|
|
280
|
+
if (!response.ok || !response.body) {
|
|
281
|
+
this.lastError = this.streamableRefusal ? `${this.streamableRefusal} (and HTTP ${response.status} to the legacy event stream)` : `HTTP ${response.status}`;
|
|
282
|
+
throw new McpRequestError(this.streamableRefusal ? `MCP server ${this.spec.name} answered ${this.lastError}` : `MCP server ${this.spec.name} did not open an event stream (${this.lastError})`);
|
|
283
|
+
}
|
|
284
|
+
return new Promise((resolve, reject) => {
|
|
285
|
+
void this.consumeStream(response.body, (endpoint) => {
|
|
286
|
+
this.sseEndpoint = new URL(endpoint, this.spec.url).toString();
|
|
287
|
+
resolve(this.sseEndpoint);
|
|
288
|
+
}).then(() => {
|
|
289
|
+
reject(new McpRequestError(`MCP server ${this.spec.name} closed its event stream before naming an endpoint`));
|
|
290
|
+
this.shut(new McpRequestError(`MCP server ${this.spec.name} closed its event stream`));
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
})();
|
|
294
|
+
return this.legacyOpening;
|
|
295
|
+
}
|
|
296
|
+
async consumeStream(body, onEndpoint) {
|
|
297
|
+
try {
|
|
298
|
+
for await (const event of readSseEvents(body)) {
|
|
299
|
+
if (event.event === "endpoint") {
|
|
300
|
+
onEndpoint?.(event.data.trim());
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
if (event.event !== "message") continue;
|
|
304
|
+
try {
|
|
305
|
+
this.dispatchAll(JSON.parse(event.data));
|
|
306
|
+
} catch (error) {
|
|
307
|
+
swallowed("agent/mcp/transport", error);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
} catch (error) {
|
|
311
|
+
if (!this.isClosed) this.lastError = error instanceof Error ? error.message : String(error);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
dispatchAll(parsed) {
|
|
315
|
+
for (const message of Array.isArray(parsed) ? parsed : [parsed]) {
|
|
316
|
+
if (message && typeof message === "object") this.dispatch(message);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
dispatch(message) {
|
|
320
|
+
const hasId = message.id !== void 0 && message.id !== null;
|
|
321
|
+
if (typeof message.method === "string") {
|
|
322
|
+
if (!hasId) {
|
|
323
|
+
try {
|
|
324
|
+
this.handlers.onNotification?.(message.method, message.params ?? {});
|
|
325
|
+
} catch (error) {
|
|
326
|
+
swallowed("agent/mcp/transport", error);
|
|
327
|
+
}
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
const answered = answerServerRequest(message.method);
|
|
331
|
+
if (answered) void answered.then((result) => this.send({ jsonrpc: "2.0", id: message.id, result }).catch(quiet("agent/mcp/transport")));
|
|
332
|
+
else void this.send({ jsonrpc: "2.0", id: message.id, error: { code: -32601, message: `Unsupported client method: ${message.method}` } }).catch(quiet("agent/mcp/transport"));
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (hasId) this.settle(Number(message.id), message);
|
|
336
|
+
}
|
|
337
|
+
settle(id, message, failure) {
|
|
338
|
+
const entry = this.pending.get(id);
|
|
339
|
+
if (!entry) return;
|
|
340
|
+
this.pending.delete(id);
|
|
341
|
+
clearTimeout(entry.timer);
|
|
342
|
+
if (failure !== void 0) entry.reject(failure instanceof Error ? failure : new Error(String(failure)));
|
|
343
|
+
else if (message?.error) {
|
|
344
|
+
entry.reject(new McpRequestError(String(message.error.message ?? `${entry.method} failed`), typeof message.error.code === "number" ? message.error.code : void 0));
|
|
345
|
+
} else entry.resolve(message?.result ?? {});
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
function openTransport(spec, handlers, fetchImpl, auth) {
|
|
349
|
+
return spec.transport === "stdio" ? stdioTransport(spec, handlers) : new HttpTransport(spec, handlers, fetchImpl, auth);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export {
|
|
353
|
+
openTransport
|
|
354
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createRequire as __clikcodeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __clikcodeCreateRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// src/gateway/subscriptions.ts
|
|
5
|
+
var KEY = "gatewaySubscriptions";
|
|
6
|
+
function gatewaySubscriptionsOn(config) {
|
|
7
|
+
return config.get(KEY) !== false;
|
|
8
|
+
}
|
|
9
|
+
function setGatewaySubscriptions(config, on) {
|
|
10
|
+
config.set(KEY, on);
|
|
11
|
+
}
|
|
12
|
+
function subscriptionsHeader(on) {
|
|
13
|
+
return { "x-clikcode-subscriptions": on ? "on" : "off" };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
gatewaySubscriptionsOn,
|
|
18
|
+
setGatewaySubscriptions,
|
|
19
|
+
subscriptionsHeader
|
|
20
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createRequire as __clikcodeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __clikcodeCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
exportTranscript,
|
|
5
|
+
transcriptMarkdown
|
|
6
|
+
} from "./chunk-ZOU3LV4U.js";
|
|
7
|
+
import "./chunk-DCZ6CIUM.js";
|
|
8
|
+
import "./chunk-WWLJMP6D.js";
|
|
9
|
+
import "./chunk-CRUVYGO2.js";
|
|
10
|
+
import "./chunk-FF7ZVYJF.js";
|
|
11
|
+
import "./chunk-IMLTL2MY.js";
|
|
12
|
+
import "./chunk-BUOPJQP5.js";
|
|
13
|
+
import "./chunk-3B2CHX7M.js";
|
|
14
|
+
import "./chunk-RVUOIJXN.js";
|
|
15
|
+
import "./chunk-QUS4ER2W.js";
|
|
16
|
+
import "./chunk-DQYVQ2N7.js";
|
|
17
|
+
import "./chunk-KYUHIFP3.js";
|
|
18
|
+
import "./chunk-RSZGEL5U.js";
|
|
19
|
+
import "./chunk-CQ7J6UQ7.js";
|
|
20
|
+
import "./chunk-XKW5NDMR.js";
|
|
21
|
+
import "./chunk-W3YYPBEA.js";
|
|
22
|
+
import "./chunk-XIBYREEY.js";
|
|
23
|
+
import "./chunk-EE4B6A7W.js";
|
|
24
|
+
import "./chunk-WZYVLUVQ.js";
|
|
25
|
+
import "./chunk-KHW6TX6I.js";
|
|
26
|
+
import "./chunk-YMCH3L2S.js";
|
|
27
|
+
import "./chunk-5B6TVO4A.js";
|
|
28
|
+
import "./chunk-4QZEZME7.js";
|
|
29
|
+
import "./chunk-LVRRWP4W.js";
|
|
30
|
+
import "./chunk-G3QP67Z7.js";
|
|
31
|
+
import "./chunk-4L2ZZM4Q.js";
|
|
32
|
+
import "./chunk-F6F47QAY.js";
|
|
33
|
+
import "./chunk-RDDWQBEM.js";
|
|
34
|
+
import "./chunk-MPAJ446F.js";
|
|
35
|
+
import "./chunk-CBANJFBO.js";
|
|
36
|
+
import "./chunk-PWXII6HF.js";
|
|
37
|
+
export {
|
|
38
|
+
exportTranscript,
|
|
39
|
+
transcriptMarkdown
|
|
40
|
+
};
|