@wirecat/zoom-cli 0.79.0 → 0.81.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.
- package/README.md +5 -4
- package/contracts/wirecat.json +71 -3
- package/dist/answer-output.d.ts +1 -1
- package/dist/answer-output.js +1 -1
- package/dist/answers.d.ts +44 -0
- package/dist/answers.d.ts.map +1 -1
- package/dist/bin/zm.js +2 -2
- package/dist/bundle/agent-VYAJCJLE.js +45 -0
- package/dist/bundle/{all-profiles-LDSHUH5W.js → all-profiles-3ASMN35R.js} +64 -22
- package/dist/bundle/answer-policy-PTH4F2DW.js +129 -0
- package/dist/bundle/{anthropic-UH3QWA3F.js → anthropic-XXI53VNI.js} +6 -6
- package/dist/bundle/{app-server-LFANTLAJ.js → app-server-B7WLNZNQ.js} +90 -80
- package/dist/bundle/{bun-M3J2QTR3.js → bun-2FLR4IV4.js} +2 -2
- package/dist/bundle/{bun-sqlite-NYP5UH23.js → bun-sqlite-3NNHTOGM.js} +7 -7
- package/dist/bundle/{chunk-RMQ7EALU.js → chunk-2ELGSNX3.js} +17 -17
- package/dist/bundle/{chunk-5RVXXDN7.js → chunk-2GNGR265.js} +1 -1
- package/dist/bundle/{chunk-FMT4CIGN.js → chunk-2RFWRJFK.js} +7 -7
- package/dist/bundle/{chunk-HZRQLAHO.js → chunk-2Z7UOXFC.js} +1 -1
- package/dist/bundle/chunk-337ALCXQ.js +640 -0
- package/dist/bundle/{chunk-2PUMYKGV.js → chunk-35FVYRH5.js} +20 -18
- package/dist/bundle/{chunk-Y64L7A7E.js → chunk-3M436OO2.js} +6 -6
- package/dist/bundle/{chunk-E5WLE7BM.js → chunk-3UX4VJWD.js} +1 -1
- package/dist/bundle/{chunk-P4MZOAPC.js → chunk-437DLSB3.js} +1371 -638
- package/dist/bundle/{chunk-I75KOOUD.js → chunk-46EF6P2J.js} +3 -3
- package/dist/bundle/{chunk-XOYMIEAZ.js → chunk-4B335BCJ.js} +7 -78
- package/dist/bundle/chunk-4BU3LRTB.js +561 -0
- package/dist/bundle/{chunk-LITZ7KPO.js → chunk-4BXLHSXY.js} +2 -2
- package/dist/bundle/{chunk-TUECY6LV.js → chunk-4FSH7K6N.js} +2 -2
- package/dist/bundle/{chunk-W656MRJD.js → chunk-4VOCXLMJ.js} +6 -6
- package/dist/bundle/{chunk-TLO62ROR.js → chunk-4ZXJ4AZW.js} +26 -26
- package/dist/bundle/{chunk-XFMVDQ6J.js → chunk-5EWYDHBH.js} +2 -2
- package/dist/bundle/{chunk-UQKVZFIX.js → chunk-5SEBLX6B.js} +12 -12
- package/dist/bundle/{chunk-HVQVCGME.js → chunk-77TJ3AJH.js} +3 -3
- package/dist/bundle/{chunk-I6VDTYML.js → chunk-7JWVPJIP.js} +10 -10
- package/dist/bundle/{chunk-FPUGMDJV.js → chunk-AV2ZJ4WX.js} +1 -1
- package/dist/bundle/{chunk-PCPOO5FS.js → chunk-AWJQ6FAX.js} +2 -2
- package/dist/bundle/{chunk-NKFEEY5M.js → chunk-B2WBWKYN.js} +12 -12
- package/dist/bundle/{chunk-52ZQ72HL.js → chunk-BQBC2WIG.js} +1 -1
- package/dist/bundle/{chunk-2GI63IPV.js → chunk-BZXHJKKI.js} +3 -3
- package/dist/bundle/{chunk-3QPAD6YI.js → chunk-C4BBCSGK.js} +43 -64
- package/dist/bundle/{chunk-CWXOXIWS.js → chunk-CFQQTDSA.js} +1 -1
- package/dist/bundle/{chunk-OLMEJNL4.js → chunk-D26K6756.js} +6 -6
- package/dist/bundle/{chunk-DI5JX4SD.js → chunk-D7CDHBDX.js} +1 -1
- package/dist/bundle/{chunk-Y4UDPQ3L.js → chunk-DMJLJVD3.js} +7 -7
- package/dist/bundle/{chunk-LCCVEX4R.js → chunk-EEBSKMEA.js} +12 -12
- package/dist/bundle/{chunk-DQVCCO7G.js → chunk-EPASOAEI.js} +184 -165
- package/dist/bundle/{chunk-RUE3WP7K.js → chunk-EWEQ7AXL.js} +45 -23
- package/dist/bundle/{chunk-4T3J4NCF.js → chunk-F2J2FQUB.js} +9 -9
- package/dist/bundle/{chunk-TP7GDWVF.js → chunk-F5ZAN7OC.js} +1 -1
- package/dist/bundle/{chunk-DFCHHR5M.js → chunk-FMMYBVCH.js} +1 -1
- package/dist/bundle/{chunk-XAOSZGTD.js → chunk-FXCR4DGU.js} +1 -1
- package/dist/bundle/{chunk-M5FW654Z.js → chunk-FXZPAGHT.js} +2 -2
- package/dist/bundle/{chunk-5KEOCHBZ.js → chunk-G3DWMG7Y.js} +4 -4
- package/dist/bundle/{chunk-FKA7DOCK.js → chunk-GCAJW4SR.js} +1 -1
- package/dist/bundle/chunk-GDRFVBCB.js +108 -0
- package/dist/bundle/{chunk-WE4UFASG.js → chunk-GPRJXJC7.js} +15 -1
- package/dist/bundle/chunk-GW2A2FJH.js +209 -0
- package/dist/bundle/{chunk-2N57GL4L.js → chunk-HHQROAJQ.js} +1 -1
- package/dist/bundle/{chunk-M4RXPZ6K.js → chunk-HIFPHARA.js} +4 -4
- package/dist/bundle/{chunk-O3DYRCIT.js → chunk-HVXOA4FO.js} +1 -1
- package/dist/bundle/{chunk-ONJPUFLX.js → chunk-IBYGNUO7.js} +1 -1
- package/dist/bundle/{chunk-2W6QGFHF.js → chunk-IDUKCXL7.js} +8 -8
- package/dist/bundle/{chunk-FO5UNFFN.js → chunk-IFM4G4MT.js} +4 -4
- package/dist/bundle/chunk-IVZACJ6X.js +52 -0
- package/dist/bundle/{chunk-XIHENZW6.js → chunk-IYNICUCC.js} +4 -4
- package/dist/bundle/chunk-J5EHZBO5.js +68 -0
- package/dist/bundle/{chunk-FIJREKLA.js → chunk-JK24A3RP.js} +3 -3
- package/dist/bundle/{chunk-73L5R7AS.js → chunk-JKEMW6E4.js} +2 -2
- package/dist/bundle/{chunk-PP6SZLCY.js → chunk-K7CTCDYX.js} +18 -249
- package/dist/bundle/{chunk-63WT3HCY.js → chunk-KZ3B6HW5.js} +3 -3
- package/dist/bundle/{chunk-XDBGGOE2.js → chunk-L2ERFXB7.js} +32 -28
- package/dist/bundle/{chunk-2IPIBDXI.js → chunk-L54I45OX.js} +19 -16
- package/dist/bundle/{chunk-X2M6NIQG.js → chunk-LECMHK2F.js} +1 -1
- package/dist/bundle/{chunk-NQMHYLZO.js → chunk-LGESUPKO.js} +20 -20
- package/dist/bundle/{chunk-SGFNQFP4.js → chunk-LVCCZI5A.js} +71 -61
- package/dist/bundle/chunk-M7OYEMLI.js +340 -0
- package/dist/bundle/{chunk-VX6ZSKXM.js → chunk-MA4UJNUI.js} +12 -12
- package/dist/bundle/{chunk-4S7RUA3U.js → chunk-MBBR7QHI.js} +9333 -8433
- package/dist/bundle/{chunk-BNEJKGG7.js → chunk-N5ROXGY4.js} +78 -76
- package/dist/bundle/{chunk-2LJARGNG.js → chunk-N62P5FY4.js} +12 -12
- package/dist/bundle/{chunk-65DOVVHQ.js → chunk-NM5XMKWO.js} +1 -1
- package/dist/bundle/{chunk-YOBTKYIX.js → chunk-NQGGTO3B.js} +35 -12
- package/dist/bundle/{chunk-W5HRTC6X.js → chunk-NS3JWBDR.js} +6 -6
- package/dist/bundle/{chunk-QIK2IBJ4.js → chunk-NX3BLISW.js} +23 -7
- package/dist/bundle/{chunk-4BQN5IFQ.js → chunk-OEQNP56V.js} +2 -100
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-AWLZZTPW.js → chunk-PS7HQ5LQ.js} +3 -3
- package/dist/bundle/{chunk-J62BQBVG.js → chunk-Q26UFIH4.js} +3 -3
- package/dist/bundle/{chunk-QRKSASGP.js → chunk-QFK52FG6.js} +3 -3
- package/dist/bundle/chunk-QNG27PGH.js +751 -0
- package/dist/bundle/{chunk-T6LA664Z.js → chunk-R4CXFYQN.js} +139 -574
- package/dist/bundle/{chunk-OZQSTX4J.js → chunk-R6HP2XKD.js} +5 -5
- package/dist/bundle/{chunk-GTUBQQU2.js → chunk-RQFRXUI4.js} +77 -67
- package/dist/bundle/{chunk-BTFPDS52.js → chunk-RRYHLP3A.js} +6 -6
- package/dist/bundle/{chunk-HOXBHGP2.js → chunk-SRUAUMBL.js} +12 -12
- package/dist/bundle/{chunk-RJ5JAYNZ.js → chunk-T2BHIC37.js} +65 -65
- package/dist/bundle/{chunk-JJGUHWLB.js → chunk-T7QPZYRZ.js} +7 -7
- package/dist/bundle/{chunk-NI7UYGTF.js → chunk-TI4WJOEX.js} +13 -13
- package/dist/bundle/{chunk-ST3ZB7LS.js → chunk-UHMJSSQO.js} +1 -1
- package/dist/bundle/{chunk-BOVYOUB3.js → chunk-UMPUY77T.js} +10 -10
- package/dist/bundle/{chunk-U7QXC75C.js → chunk-UPR2S5IE.js} +9 -9
- package/dist/bundle/chunk-UUVWAVKN.js +80 -0
- package/dist/bundle/{chunk-2OTETB4A.js → chunk-V3ZTAAJ6.js} +19 -9
- package/dist/bundle/{chunk-QX3PO5UE.js → chunk-VAW7QGJA.js} +3 -3
- package/dist/bundle/{chunk-N5O3XVX3.js → chunk-VQTYJ6XH.js} +3 -3
- package/dist/bundle/{chunk-YCW422X7.js → chunk-VXD65V67.js} +1466 -1544
- package/dist/bundle/{chunk-D264RGZ4.js → chunk-WHXYPLUE.js} +4 -4
- package/dist/bundle/chunk-WIX6BFRF.js +353 -0
- package/dist/bundle/{chunk-P4WHDL2F.js → chunk-WKNYNK7W.js} +4 -4
- package/dist/bundle/{chunk-PJFVE7UH.js → chunk-XWKUGAG6.js} +31 -16
- package/dist/bundle/{chunk-W7HM2VGO.js → chunk-XYQVVW4R.js} +1 -1
- package/dist/bundle/{chunk-RMX2WPWS.js → chunk-Y7XJA4EW.js} +4 -4
- package/dist/bundle/{chunk-Z3CPZ4I4.js → chunk-YIIGF643.js} +306 -306
- package/dist/bundle/{chunk-525BI32C.js → chunk-YISJJNXT.js} +3 -3
- package/dist/bundle/{chunk-AZB6QXZU.js → chunk-YJKXCINQ.js} +51 -4
- package/dist/bundle/{chunk-IIFRJV3A.js → chunk-YNWBRDBX.js} +2 -2
- package/dist/bundle/{chunk-ZPZT46O6.js → chunk-YRDQ54G5.js} +33 -10
- package/dist/bundle/{chunk-W53EJOFQ.js → chunk-YUDVRFXN.js} +1 -1
- package/dist/bundle/{chunk-ND7TBQKO.js → chunk-ZFRYFDZN.js} +2 -2
- package/dist/bundle/{chunk-XEIL6VNA.js → chunk-ZLYICF6A.js} +4 -4
- package/dist/bundle/{chunk-7DTWT7BN.js → chunk-ZMAPXIGC.js} +2 -2
- package/dist/bundle/{chunk-ZKVYV25H.js → chunk-ZNAX7GUV.js} +8 -8
- package/dist/bundle/{cli-AVQU63FT.js → cli-WTGAGSXV.js} +144 -97
- package/dist/bundle/command-contract-3IKVWPDL.js +45 -0
- package/dist/bundle/{command-server-entry-JZP7Y73G.js → command-server-entry-47CAYN3E.js} +35 -35
- package/dist/bundle/config-ZOGOKGTU.js +116 -0
- package/dist/bundle/{decode-JLAYH7GC.js → decode-2G7QS5IQ.js} +6 -6
- package/dist/bundle/{dispatch-AWDROXWN.js → dispatch-ZAP3KBVJ.js} +9 -9
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{dist-TBLTUL5M.js → dist-WY6R3WH7.js} +21 -21
- package/dist/bundle/{echarts-FVTUDXDU.js → echarts-YRRVLEX3.js} +2 -2
- package/dist/bundle/{embed-CJRENDF7.js → embed-B5H3OW2O.js} +7 -7
- package/dist/bundle/{embedder-RPE67QJD.js → embedder-3O73SP6Y.js} +10 -10
- package/dist/bundle/{failure-JZW73RP7.js → failure-EYGW7JMC.js} +3 -3
- package/dist/bundle/first-run-MPKMDEMA.js +29 -0
- package/dist/bundle/first-screen-AIAAC3KF.js +45 -0
- package/dist/bundle/{folders-TGFOE7DY.js → folders-4CGFWM6H.js} +5 -5
- package/dist/bundle/{instructions-HET7BCYK.js → instructions-AG7SRWTR.js} +1 -1
- package/dist/bundle/{main-QRJ6NRCD.js → main-DOGY6FJP.js} +24 -24
- package/dist/bundle/{mcp-RGNRW77S.js → mcp-YGOAUNC3.js} +2 -2
- package/dist/bundle/meeting-combined-YKPKTKGA.js +26 -0
- package/dist/bundle/meeting-model-HTXSGHNM.js +26 -0
- package/dist/bundle/{meeting-semantic-4MURLQCA.js → meeting-semantic-FOEBWV3P.js} +8 -8
- package/dist/bundle/{meetings-QFZWKHI4.js → meetings-PVE4C2NF.js} +7 -7
- package/dist/bundle/{node-CXZIFHZC.js → node-GJQYN4FT.js} +2 -2
- package/dist/bundle/{node-sqlite-CZPYFROO.js → node-sqlite-MLRYKVCQ.js} +8 -8
- package/dist/bundle/oauth-AC55C6SG.js +20 -0
- package/dist/bundle/{open-3AONZFET.js → open-3LGTYP6M.js} +6 -6
- package/dist/bundle/openai-E2MSLVIX.js +28 -0
- package/dist/bundle/{output-file-J4SU6X4I.js → output-file-FXMTTLOI.js} +6 -6
- package/dist/bundle/{process-5RUXWGYS.js → process-MEKCZMX3.js} +1 -1
- package/dist/bundle/{program-2O4YSRWY.js → program-E5BSSIGY.js} +166 -156
- package/dist/bundle/{prompt-NDLUFCJV.js → prompt-AIA6QSZK.js} +6 -6
- package/dist/bundle/{recognize-CZOIAJQX.js → recognize-M57VNTEV.js} +5 -5
- package/dist/bundle/{remote-O3CE4Q3B.js → remote-3OTENZ7Z.js} +11 -11
- package/dist/bundle/{rerank-MZOL746K.js → rerank-P5WHDFDU.js} +8 -8
- package/dist/bundle/run-log-EOQ4EQDS.js +143 -0
- package/dist/bundle/{serve-43IBHMFM.js → serve-BRLC2QVV.js} +11 -11
- package/dist/bundle/{server-6LTMPPTO.js → server-25NF7DMS.js} +80 -69
- package/dist/bundle/server-EW2RL2EL.js +93 -0
- package/dist/bundle/{services-UIRD5PHE.js → services-MJE43OGD.js} +54 -52
- package/dist/bundle/{speech-6QVKIJVR.js → speech-4AVCWTQH.js} +28 -28
- package/dist/bundle/{sqlite-runtime-PKCIBVHZ.js → sqlite-runtime-U4TQXWMC.js} +7 -7
- package/dist/bundle/{state-AC55V3IE.js → state-GNUGVMY7.js} +7 -7
- package/dist/bundle/{store-OAGA2ZK3.js → store-KBFZVQWF.js} +33 -24
- package/dist/bundle/{store-QOCYJNKX.js → store-MHVBFUBB.js} +27 -26
- package/dist/bundle/store-connection-SKRUAI4L.js +109 -0
- package/dist/bundle/store-maintenance-command-G6EXJSHJ.js +81 -0
- package/dist/bundle/{streaming-VDJOYGMO.js → streaming-6F7AFEHD.js} +7 -7
- package/dist/bundle/surface-DWEWB5RG.js +79 -0
- package/dist/bundle/{tokens-LN442AO6.js → tokens-BB4MQBLH.js} +11 -10
- package/dist/bundle/zm.js +9 -9
- package/dist/bundle/{zoom-app-TOCQ7LB5.js → zoom-app-YTGOZ2FS.js} +8 -8
- package/dist/commands.d.ts +1 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +8 -2
- package/dist/commands.js.map +1 -1
- package/dist/program-bindings.d.ts.map +1 -1
- package/dist/program-bindings.js +2 -2
- package/dist/program-bindings.js.map +1 -1
- package/dist/setup-commands.d.ts +1 -1
- package/dist/setup-commands.d.ts.map +1 -1
- package/dist/setup-commands.js +31 -5
- package/dist/setup-commands.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/zoom-api/types.d.ts +5 -0
- package/dist/zoom-api/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/bundle/answer-policy-VJK4ID2F.js +0 -122
- package/dist/bundle/chunk-3AFZ6Q5N.js +0 -729
- package/dist/bundle/command-contract-MCWBL5VS.js +0 -45
- package/dist/bundle/config-G3C54VH6.js +0 -109
- package/dist/bundle/first-run-QEASX5J5.js +0 -29
- package/dist/bundle/first-screen-NGCQD3CU.js +0 -45
- package/dist/bundle/meeting-combined-AZXCDXCV.js +0 -26
- package/dist/bundle/meeting-model-7HNQ4I3J.js +0 -26
- package/dist/bundle/oauth-T45MPIZF.js +0 -20
- package/dist/bundle/openai-LHWUXEBO.js +0 -28
- package/dist/bundle/run-log-GX6LNMWY.js +0 -136
- package/dist/bundle/server-3E2PJGYK.js +0 -85
- package/dist/bundle/store-connection-PBZMFY56.js +0 -102
- package/dist/bundle/store-maintenance-command-VBCHEOGI.js +0 -77
|
@@ -1,76 +1,37 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
UNTRUSTED,
|
|
5
|
-
UNTRUSTED_NEUTRAL,
|
|
6
|
-
agentArguments,
|
|
7
|
-
agentJson,
|
|
8
4
|
commandAvailability
|
|
9
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IVZACJ6X.js";
|
|
10
6
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./chunk-
|
|
7
|
+
lentConnection
|
|
8
|
+
} from "./chunk-M7OYEMLI.js";
|
|
13
9
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from "./chunk-3AFZ6Q5N.js";
|
|
10
|
+
QUERY_ARGUMENT
|
|
11
|
+
} from "./chunk-QNG27PGH.js";
|
|
17
12
|
import {
|
|
18
|
-
QUERY_ARGUMENT,
|
|
19
|
-
onlineDeps,
|
|
20
|
-
servicesFor,
|
|
21
|
-
storeModeDeps
|
|
22
|
-
} from "./chunk-4S7RUA3U.js";
|
|
23
|
-
import {
|
|
24
|
-
failureContext
|
|
25
|
-
} from "./chunk-AZB6QXZU.js";
|
|
26
|
-
import {
|
|
27
|
-
DEFAULT_OUTPUT_BYTES,
|
|
28
|
-
ENTITIES,
|
|
29
|
-
LOCAL_WRITE,
|
|
30
|
-
REMOTE_WRITE,
|
|
31
|
-
answerSchema,
|
|
32
13
|
changesMessenger,
|
|
33
|
-
flatten
|
|
34
|
-
|
|
35
|
-
judgedEffects,
|
|
36
|
-
listOf,
|
|
37
|
-
refuseStoreChange,
|
|
38
|
-
sealed,
|
|
39
|
-
startRecording
|
|
40
|
-
} from "./chunk-DQVCCO7G.js";
|
|
14
|
+
flatten
|
|
15
|
+
} from "./chunk-EPASOAEI.js";
|
|
41
16
|
import {
|
|
42
|
-
currentCaller
|
|
43
|
-
|
|
44
|
-
runContextOf,
|
|
45
|
-
withCaller
|
|
46
|
-
} from "./chunk-JJGUHWLB.js";
|
|
17
|
+
currentCaller
|
|
18
|
+
} from "./chunk-T7QPZYRZ.js";
|
|
47
19
|
import {
|
|
48
20
|
authorityAllowed,
|
|
49
|
-
botApiAllowed
|
|
50
|
-
|
|
51
|
-
keyForCommand,
|
|
52
|
-
levelFor,
|
|
53
|
-
readKeysForCommand
|
|
54
|
-
} from "./chunk-2OTETB4A.js";
|
|
55
|
-
import {
|
|
56
|
-
MAX_BUFFERED_INPUT
|
|
57
|
-
} from "./chunk-XFMVDQ6J.js";
|
|
21
|
+
botApiAllowed
|
|
22
|
+
} from "./chunk-V3ZTAAJ6.js";
|
|
58
23
|
import {
|
|
59
24
|
enclosingTraceId,
|
|
60
25
|
inRun,
|
|
61
26
|
newRunId,
|
|
62
27
|
traceOf
|
|
63
|
-
} from "./chunk-
|
|
64
|
-
import {
|
|
65
|
-
storeDamaged
|
|
66
|
-
} from "./chunk-ND7TBQKO.js";
|
|
28
|
+
} from "./chunk-D26K6756.js";
|
|
67
29
|
import {
|
|
68
30
|
queryDescription
|
|
69
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-YIIGF643.js";
|
|
70
32
|
import {
|
|
71
|
-
captureStreams
|
|
72
|
-
|
|
73
|
-
} from "./chunk-BNEJKGG7.js";
|
|
33
|
+
captureStreams
|
|
34
|
+
} from "./chunk-N5ROXGY4.js";
|
|
74
35
|
import {
|
|
75
36
|
COMPACT_FLAG,
|
|
76
37
|
SNAKE_CASE,
|
|
@@ -81,13 +42,7 @@ import {
|
|
|
81
42
|
errorObjectOf,
|
|
82
43
|
integer,
|
|
83
44
|
isoDate,
|
|
84
|
-
itemEnvelopeSchema,
|
|
85
|
-
listEnvelopeSchema,
|
|
86
45
|
literal,
|
|
87
|
-
looseObject,
|
|
88
|
-
maxLength,
|
|
89
|
-
maxValue,
|
|
90
|
-
mcpErrorResult,
|
|
91
46
|
minLength,
|
|
92
47
|
minValue,
|
|
93
48
|
number,
|
|
@@ -98,30 +53,25 @@ import {
|
|
|
98
53
|
pipe,
|
|
99
54
|
record,
|
|
100
55
|
regex,
|
|
101
|
-
safeParse,
|
|
102
56
|
strictObject,
|
|
103
57
|
string,
|
|
104
|
-
summarize,
|
|
105
58
|
text,
|
|
106
|
-
toJsonSchema,
|
|
107
|
-
toStandardJsonSchema,
|
|
108
59
|
union,
|
|
109
60
|
unknown,
|
|
110
61
|
word,
|
|
111
62
|
writes
|
|
112
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-YRDQ54G5.js";
|
|
113
64
|
import {
|
|
114
|
-
CliError
|
|
115
|
-
|
|
116
|
-
} from "./chunk-ST3ZB7LS.js";
|
|
65
|
+
CliError
|
|
66
|
+
} from "./chunk-UHMJSSQO.js";
|
|
117
67
|
import {
|
|
118
68
|
__name
|
|
119
69
|
} from "./chunk-ZVVMGPBJ.js";
|
|
120
70
|
|
|
121
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
71
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/mcp/agent.js
|
|
122
72
|
import { Readable } from "node:stream";
|
|
123
73
|
|
|
124
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
74
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/lint.js
|
|
125
75
|
var LINT_SEVERITIES = ["high", "medium", "low"];
|
|
126
76
|
var lintRuleSchema = strictObject({
|
|
127
77
|
id: word,
|
|
@@ -267,7 +217,7 @@ var overrideSchema = strictObject({
|
|
|
267
217
|
});
|
|
268
218
|
var overridesSchema = array(overrideSchema);
|
|
269
219
|
|
|
270
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
220
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/audit.js
|
|
271
221
|
var auditRuleSchema = strictObject({ id: word, severity: picklist(LINT_SEVERITIES), summary: text });
|
|
272
222
|
var defineAuditRules = /* @__PURE__ */ __name((input) => parseRegistry("audit rules", array(auditRuleSchema), input, (rules) => duplicates(rules.map((rule) => rule.id)).map((id) => `"${id}" is listed twice`)), "defineAuditRules");
|
|
273
223
|
var AUDIT_RULES = defineAuditRules([
|
|
@@ -322,17 +272,20 @@ var parityGroupSchema = strictObject({
|
|
|
322
272
|
absent: optional(word),
|
|
323
273
|
/** The one CLI that has the path or flag by design; every other CLI compared must lack it. */
|
|
324
274
|
only: optional(word),
|
|
275
|
+
/** The one CLI whose value (a summary, a value name) differs by design; every other CLI compared must agree. */
|
|
276
|
+
differs: optional(word),
|
|
325
277
|
reason: pipe(text, minLength(10, "say why, in a sentence")),
|
|
326
278
|
/** Warns from 14 days before and fails 14 days after, as a lint override does. */
|
|
327
279
|
review_after: optional(pipe(string(), isoDate("a date, YYYY-MM-DD")))
|
|
328
280
|
}))
|
|
329
281
|
});
|
|
282
|
+
var kindOf = /* @__PURE__ */ __name((entry) => ["absent", "only", "differs"].filter((one) => entry[one] !== void 0), "kindOf");
|
|
330
283
|
var defineParityGroups = /* @__PURE__ */ __name((input) => parseRegistry("parity groups", array(parityGroupSchema), input, (groups) => [
|
|
331
284
|
...duplicates(groups.map((group) => group.name)).map((name) => `"${name}" is listed twice`),
|
|
332
285
|
...groups.flatMap((group) => [
|
|
333
286
|
...duplicates(group.differences.map((entry) => `${entry.rule} ${entry.target}`)).map((both) => `${group.name}: "${both}" is listed twice`),
|
|
334
|
-
...group.differences.filter((entry) => (entry.
|
|
335
|
-
...group.differences.filter((entry) => entry.
|
|
287
|
+
...group.differences.filter((entry) => kindOf(entry).length === 1 && entry.expected).map((entry) => `${group.name}: "${entry.target}" has \`${kindOf(entry)[0]}\`, which measures the values itself; drop \`expected\``),
|
|
288
|
+
...group.differences.filter((entry) => kindOf(entry).length > 1).map((entry) => `${group.name}: "${entry.target}" has ${kindOf(entry).map((one) => `\`${one}\``).join(" and ")}; keep one`)
|
|
336
289
|
])
|
|
337
290
|
]), "defineParityGroups");
|
|
338
291
|
var MEMO_HAS_NO_PROFILES = [
|
|
@@ -347,6 +300,12 @@ var MEMO_HAS_NO_PROFILES = [
|
|
|
347
300
|
absent: "memo",
|
|
348
301
|
reason: "memo has no profiles: it reads other CLIs' stores and selects their accounts with --source and --account (https://github.com/WireCatLabs/cli-base/issues/390)"
|
|
349
302
|
}));
|
|
303
|
+
var MEMO_MCP_SUMMARIES = ["mcp", "mcp serve"].map((path) => ({
|
|
304
|
+
rule: "same-path-contract",
|
|
305
|
+
target: `${path}: summary`,
|
|
306
|
+
differs: "memo",
|
|
307
|
+
reason: "memo has no profiles, so its mcp commands serve memo's commands rather than a profile's"
|
|
308
|
+
}));
|
|
350
309
|
var MEMO_DOCTOR_DEEP = {
|
|
351
310
|
rule: "same-path-contract",
|
|
352
311
|
target: "doctor --deep",
|
|
@@ -377,7 +336,7 @@ var PARITY_GROUPS = defineParityGroups([
|
|
|
377
336
|
name: "all",
|
|
378
337
|
members: ["tg", "max", "memo", "drive", "zm", "wa"],
|
|
379
338
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade", "search", "notes", "meetings"],
|
|
380
|
-
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
|
|
339
|
+
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
|
|
381
340
|
},
|
|
382
341
|
// mail's `search messages` is cli-core's mail search, not the messengers' command: --complete took their 20-odd
|
|
383
342
|
// differences as inherited (https://github.com/WireCatLabs/cli-base/issues/390). mail is compared everywhere else
|
|
@@ -386,7 +345,7 @@ var PARITY_GROUPS = defineParityGroups([
|
|
|
386
345
|
name: "mail-shared",
|
|
387
346
|
members: ["tg", "max", "memo", "drive", "zm", "wa", "mail"],
|
|
388
347
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade", "notes", "meetings"],
|
|
389
|
-
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
|
|
348
|
+
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
|
|
390
349
|
},
|
|
391
350
|
// gcal is compared on what it already shares with every CLI; doctor, mcp, search and skill wait until the published
|
|
392
351
|
// CLIs agree there (https://github.com/WireCatLabs/cli-base/issues/390), then gcal moves back into "all".
|
|
@@ -398,28 +357,58 @@ var PARITY_GROUPS = defineParityGroups([
|
|
|
398
357
|
},
|
|
399
358
|
// bitrix24-cli's search is cli-core's CRM `search all`, and beeline-cli's and asterisk-cli's meetings take call
|
|
400
359
|
// recordings, not zoom-cli's: they are compared on the root commands every CLI shares, the way gcal and mail are.
|
|
401
|
-
// amo-cli
|
|
402
|
-
//
|
|
360
|
+
// amo-cli, hubspot-cli and attio-cli share them too, and their CRM commands are compared with b24 in `crm` below.
|
|
361
|
+
// wordpress-cli shares only these roots: it is the first content CLI, so its posts commands have no group yet.
|
|
362
|
+
// notion-cli joins here until its documents commands ship; then it moves next to drive. ydisk joins here too: in "all"
|
|
363
|
+
// its search and notes differ from the messengers' and memo's as drive's do, and a documents group of drive, notion
|
|
364
|
+
// and ydisk differs in 39 paths (session, folders browse, summaries; measured on the published CLIs 2026-11-17).
|
|
403
365
|
{
|
|
404
366
|
name: "shared-roots",
|
|
405
|
-
members: [
|
|
367
|
+
members: [
|
|
368
|
+
"tg",
|
|
369
|
+
"max",
|
|
370
|
+
"memo",
|
|
371
|
+
"drive",
|
|
372
|
+
"zm",
|
|
373
|
+
"wa",
|
|
374
|
+
"b24",
|
|
375
|
+
"beeline",
|
|
376
|
+
"pbx",
|
|
377
|
+
"notion",
|
|
378
|
+
"amo",
|
|
379
|
+
"hubspot",
|
|
380
|
+
"attio",
|
|
381
|
+
"ydisk",
|
|
382
|
+
"wordpress"
|
|
383
|
+
],
|
|
406
384
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade"],
|
|
407
|
-
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
|
|
385
|
+
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
|
|
408
386
|
},
|
|
409
|
-
// The CRM CLIs on cli-core's shared CRM commands. amo-cli (amoCRM and Kommo) is not on npm yet
|
|
410
|
-
//
|
|
411
|
-
// later) and `deals delete` (amoCRM's
|
|
412
|
-
// https://www.amocrm.ru/developers/content/crm_platform/leads-api)
|
|
413
|
-
// these need no difference. `people`, `organizations`,
|
|
414
|
-
// is on cli-core's shared people and organizations
|
|
415
|
-
// in options, outputs and summaries.
|
|
387
|
+
// The CRM CLIs on cli-core's shared CRM commands. amo-cli (amoCRM and Kommo) is not on npm yet and hubspot-cli is
|
|
388
|
+
// not in the family packages, so `audit --family` skips them, as beeline. Only b24 and hubspot have `leads` (amoCRM
|
|
389
|
+
// has no lead apart from a deal), only b24 has `products` (amo leaves them for later) and `deals delete` (amoCRM's
|
|
390
|
+
// API v4 cannot delete a lead, https://www.amocrm.ru/developers/content/crm_platform/leads-api), and hubspot writes
|
|
391
|
+
// no deals yet; a list of roots does not compare presence, so these need no difference. `people`, `organizations`,
|
|
392
|
+
// `users`, `api` and `session` join once b24's released tree is on cli-core's shared people and organizations
|
|
393
|
+
// commands: measured against b24 0.23.0 on 2026-11-16 they differ in options, outputs and summaries.
|
|
416
394
|
{
|
|
417
395
|
name: "crm",
|
|
418
|
-
members: ["b24", "amo"],
|
|
396
|
+
members: ["b24", "amo", "hubspot", "attio"],
|
|
419
397
|
covers: ["deals", "sync", "search", "store", "schedule", "account"],
|
|
420
|
-
differences: [
|
|
398
|
+
differences: [
|
|
399
|
+
{
|
|
400
|
+
rule: "same-path-contract",
|
|
401
|
+
target: "schedule: summary",
|
|
402
|
+
differs: "hubspot",
|
|
403
|
+
reason: "cli-core cuts the summary to a fixed width after it puts in the CLI's name (src/cli/help/commands-text.ts), so hubspot's longer name ends it a word earlier than b24's and amo's",
|
|
404
|
+
review_after: "2026-12-01"
|
|
405
|
+
}
|
|
406
|
+
]
|
|
421
407
|
}
|
|
422
408
|
]);
|
|
409
|
+
var SHARED_DIFFERENCES = [
|
|
410
|
+
...new Map(PARITY_GROUPS.flatMap((group) => group.differences).filter((entry) => entry.rule === "same-entity-schema" || entry.rule === "same-error-reason").map((entry) => [`${entry.rule} ${entry.target}`, entry])).values()
|
|
411
|
+
];
|
|
423
412
|
var requiredRootSchema = strictObject({ path: pipe(array(segment), minLength(1)), meaning: text });
|
|
424
413
|
var defineRequiredRoots = /* @__PURE__ */ __name((input) => parseRegistry("required roots", array(requiredRootSchema), input, (roots2) => duplicates(roots2.map((root) => root.path.join(" "))).map((path) => `"${path}" is listed twice`)), "defineRequiredRoots");
|
|
425
414
|
var REQUIRED_ROOTS = defineRequiredRoots([
|
|
@@ -431,7 +420,7 @@ var REQUIRED_ROOTS = defineRequiredRoots([
|
|
|
431
420
|
{ path: ["upgrade"], meaning: "updates the CLI" }
|
|
432
421
|
]);
|
|
433
422
|
|
|
434
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
423
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/fields.js
|
|
435
424
|
var fieldRuleSchema = strictObject({ id: word, rule: text });
|
|
436
425
|
var defineFieldRules = /* @__PURE__ */ __name((input) => parseRegistry("output field rules", array(fieldRuleSchema), input, (rules) => duplicates(rules.map((rule) => rule.id)).map((id) => `"${id}" is listed twice`)), "defineFieldRules");
|
|
437
426
|
var FIELD_RULES = defineFieldRules([
|
|
@@ -447,7 +436,7 @@ var FIELD_RULES = defineFieldRules([
|
|
|
447
436
|
}
|
|
448
437
|
]);
|
|
449
438
|
|
|
450
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
439
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/identifiers.js
|
|
451
440
|
var key = pipe(string(), regex(SNAKE_CASE, "a snake_case key"));
|
|
452
441
|
var identifierSchema = strictObject({ key, meaning: text, replaces: optional(array(key)) });
|
|
453
442
|
var defineIdentifiers = /* @__PURE__ */ __name((input) => parseRegistry("identifiers", array(identifierSchema), input, (identifiers) => {
|
|
@@ -469,7 +458,7 @@ var IDENTIFIERS = defineIdentifiers([
|
|
|
469
458
|
{ key: "trace_id", meaning: "the distributed trace a run belongs to, from `traceparent`" }
|
|
470
459
|
]);
|
|
471
460
|
|
|
472
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
461
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-account.js
|
|
473
462
|
var ACCOUNT_FLAGS = [
|
|
474
463
|
{
|
|
475
464
|
name: "--client-id",
|
|
@@ -506,7 +495,7 @@ var ACCOUNT_FLAGS = [
|
|
|
506
495
|
{ name: "--hide-phone", role: "output", type: "switch", meaning: "leave the phone number out of the answer" }
|
|
507
496
|
];
|
|
508
497
|
|
|
509
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
498
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-calendar.js
|
|
510
499
|
var CALENDAR_FLAGS = [
|
|
511
500
|
{ name: "--end-time", value: "<time>", role: "value", type: "time", meaning: "when it ends" },
|
|
512
501
|
{
|
|
@@ -594,7 +583,25 @@ var CALENDAR_FLAGS = [
|
|
|
594
583
|
}
|
|
595
584
|
];
|
|
596
585
|
|
|
597
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
586
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-content.js
|
|
587
|
+
var CONTENT_FLAGS = [
|
|
588
|
+
{ name: "--slug", value: "<slug>", role: "value", type: "string", meaning: "the last part of its web address" },
|
|
589
|
+
{
|
|
590
|
+
name: "--tags",
|
|
591
|
+
value: "<ids>",
|
|
592
|
+
role: "value",
|
|
593
|
+
type: "list",
|
|
594
|
+
meaning: "its tags and categories, by comma-separated ids; replaces the ones it has"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
name: "--replace-body",
|
|
598
|
+
role: "mode",
|
|
599
|
+
type: "switch",
|
|
600
|
+
meaning: "write the new text over a body the tool cannot fully read back, losing what it could not show"
|
|
601
|
+
}
|
|
602
|
+
];
|
|
603
|
+
|
|
604
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-crm.js
|
|
598
605
|
var CRM_FLAGS = [
|
|
599
606
|
{
|
|
600
607
|
name: "--email",
|
|
@@ -758,7 +765,7 @@ var CRM_FLAGS = [
|
|
|
758
765
|
}
|
|
759
766
|
];
|
|
760
767
|
|
|
761
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
768
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-how.js
|
|
762
769
|
var HOW_FLAGS = [
|
|
763
770
|
{
|
|
764
771
|
name: "--limit",
|
|
@@ -1138,13 +1145,7 @@ var HOW_FLAGS = [
|
|
|
1138
1145
|
type: "string",
|
|
1139
1146
|
meaning: "a person whose reply counts as an answer; repeat it for more"
|
|
1140
1147
|
},
|
|
1141
|
-
{
|
|
1142
|
-
name: "--browser",
|
|
1143
|
-
value: "<program>",
|
|
1144
|
-
role: "mode",
|
|
1145
|
-
type: "string",
|
|
1146
|
-
meaning: "the browser program to open for sign-in"
|
|
1147
|
-
},
|
|
1148
|
+
{ name: "--browser", value: "<program>", role: "mode", type: "string", meaning: "the browser to open for sign-in" },
|
|
1148
1149
|
{
|
|
1149
1150
|
name: "--credential-storage",
|
|
1150
1151
|
value: "<storage>",
|
|
@@ -1153,6 +1154,8 @@ var HOW_FLAGS = [
|
|
|
1153
1154
|
meaning: "where a sign-in is kept: keyring, which falls back to a private file by itself, or file (WC-SECR-4)"
|
|
1154
1155
|
},
|
|
1155
1156
|
{ name: "--checkpoint", value: "<file>", role: "mode", type: "path", meaning: "keep resume progress in this file" },
|
|
1157
|
+
{ name: "--site", value: "<address>", role: "mode", type: "string", meaning: "the owner's site a sign-in is for" },
|
|
1158
|
+
{ name: "--login", value: "<name>", role: "mode", type: "string", meaning: "the user name a password is for" },
|
|
1156
1159
|
{
|
|
1157
1160
|
name: "--expected-event-id",
|
|
1158
1161
|
value: "<id>",
|
|
@@ -1755,7 +1758,7 @@ var HOW_FLAGS = [
|
|
|
1755
1758
|
}
|
|
1756
1759
|
];
|
|
1757
1760
|
|
|
1758
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1761
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-knowledge.js
|
|
1759
1762
|
var KNOWLEDGE_FLAGS = [
|
|
1760
1763
|
{
|
|
1761
1764
|
name: "--accept-terms",
|
|
@@ -1791,6 +1794,13 @@ var KNOWLEDGE_FLAGS = [
|
|
|
1791
1794
|
meaning: "at most this many characters read",
|
|
1792
1795
|
unit: "characters"
|
|
1793
1796
|
},
|
|
1797
|
+
{
|
|
1798
|
+
name: "--tab",
|
|
1799
|
+
value: "<id>",
|
|
1800
|
+
role: "target",
|
|
1801
|
+
type: "id",
|
|
1802
|
+
meaning: "one tab of a document, by its id: only its text is read"
|
|
1803
|
+
},
|
|
1794
1804
|
{
|
|
1795
1805
|
name: "--tag",
|
|
1796
1806
|
value: "<name>",
|
|
@@ -1807,7 +1817,7 @@ var KNOWLEDGE_FLAGS = [
|
|
|
1807
1817
|
}
|
|
1808
1818
|
];
|
|
1809
1819
|
|
|
1810
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1820
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-mail.js
|
|
1811
1821
|
var MAIL_FLAGS = [
|
|
1812
1822
|
{
|
|
1813
1823
|
name: "--cc",
|
|
@@ -1837,7 +1847,7 @@ var MAIL_FLAGS = [
|
|
|
1837
1847
|
}
|
|
1838
1848
|
];
|
|
1839
1849
|
|
|
1840
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1850
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-privacy.js
|
|
1841
1851
|
var PRIVACY_FLAGS = [
|
|
1842
1852
|
{
|
|
1843
1853
|
name: "--about-text",
|
|
@@ -1898,7 +1908,7 @@ var PRIVACY_FLAGS = [
|
|
|
1898
1908
|
{ name: "--read-receipts", value: "<on|off>", role: "value", type: "choice", meaning: "send read receipts" }
|
|
1899
1909
|
];
|
|
1900
1910
|
|
|
1901
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1911
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-schedule.js
|
|
1902
1912
|
var SCHEDULE_FLAGS = [
|
|
1903
1913
|
{
|
|
1904
1914
|
name: "--locale",
|
|
@@ -1931,7 +1941,7 @@ var SCHEDULE_FLAGS = [
|
|
|
1931
1941
|
}
|
|
1932
1942
|
];
|
|
1933
1943
|
|
|
1934
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1944
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/flags-what.js
|
|
1935
1945
|
var WHAT_FLAGS = [
|
|
1936
1946
|
{
|
|
1937
1947
|
name: "--analysis-provider",
|
|
@@ -2928,7 +2938,7 @@ var WHAT_FLAGS = [
|
|
|
2928
2938
|
}
|
|
2929
2939
|
];
|
|
2930
2940
|
|
|
2931
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2941
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/vocabulary.js
|
|
2932
2942
|
var FLAG_TYPES = [
|
|
2933
2943
|
"switch",
|
|
2934
2944
|
"count",
|
|
@@ -3058,6 +3068,10 @@ var verbs = [
|
|
|
3058
3068
|
["export", "write from the store to a file"],
|
|
3059
3069
|
["import", "bring a file or list the user gives into the store or the messenger, once"],
|
|
3060
3070
|
["download", "save a file from the source to this machine"],
|
|
3071
|
+
["upload", "put a file from this machine on the source"],
|
|
3072
|
+
["publish", "open a thing to anyone who has its public link"],
|
|
3073
|
+
["unpublish", "close a thing's public link"],
|
|
3074
|
+
["stale", "mark a saved memory as out of date, keeping it"],
|
|
3061
3075
|
["transcribe", "turn speech into text"],
|
|
3062
3076
|
["extract", "read the text inside files already on this machine into the store"],
|
|
3063
3077
|
["migrate", "bring a file up to this build's schema"],
|
|
@@ -3154,6 +3168,8 @@ var collections = [
|
|
|
3154
3168
|
["messages", "posts in a messenger chat, or emails"],
|
|
3155
3169
|
["drafts", "e-mails saved in a mailbox's Drafts folder, written and not sent"],
|
|
3156
3170
|
["polls", "polls in a chat"],
|
|
3171
|
+
["posts", "posts and pages on a site or blog the owner publishes"],
|
|
3172
|
+
["channels", "the sites and social accounts the owner publishes posts on"],
|
|
3157
3173
|
["reactions", "reactions to a message"],
|
|
3158
3174
|
["recipients", "who a message goes to"],
|
|
3159
3175
|
["replies", "the automatic replies of a profile"],
|
|
@@ -3200,6 +3216,10 @@ var collections = [
|
|
|
3200
3216
|
["transactions", "money that moved in or out of a wallet, as the bank or the owner recorded it"],
|
|
3201
3217
|
["splits", "parts of one transaction, each with its own amount and category"],
|
|
3202
3218
|
["users", "people who work in the owner's account at a service, such as a CRM's employees"],
|
|
3219
|
+
["issues", "work items in an issue tracker, each in a team, a workflow state and maybe a project"],
|
|
3220
|
+
["teams", "groups in a tracker that own issues, states and labels"],
|
|
3221
|
+
["states", "the workflow steps a tracker team moves its issues through, each of a type such as started"],
|
|
3222
|
+
["labels", "a tracker's shared labels on issues, kept by the tracker and not by the owner"],
|
|
3203
3223
|
["fields", "a record type's field definitions: code, label, type and options, such as a CRM's custom fields"],
|
|
3204
3224
|
["activities", "a CRM's calls, e-mails, meetings, to-dos and comments on its records"],
|
|
3205
3225
|
["changes", "what changed in a copied source over a time: records added, moved, closed or reassigned"],
|
|
@@ -3268,6 +3288,10 @@ var singulars = [
|
|
|
3268
3288
|
["privacy", "who may find, see, call or add the account"],
|
|
3269
3289
|
["metadata", "a profile's cached source attributes"],
|
|
3270
3290
|
["auth", "the credentials a bot profile uses: its token and the secrets beside it"],
|
|
3291
|
+
[
|
|
3292
|
+
"scheduled",
|
|
3293
|
+
"a chat's messages the messenger will send later; their ids are their own, never the ids of sent messages"
|
|
3294
|
+
],
|
|
3271
3295
|
[
|
|
3272
3296
|
"schedule",
|
|
3273
3297
|
"a profile's timers the owner saved, each running a command of this tool or an agent; the tool's own background work is jobs"
|
|
@@ -3275,6 +3299,7 @@ var singulars = [
|
|
|
3275
3299
|
];
|
|
3276
3300
|
var views = [
|
|
3277
3301
|
["tree", "the parent and child hierarchy of stored sources"],
|
|
3302
|
+
["stats", "a thing's own numbers, such as a post's views, as read at each sync"],
|
|
3278
3303
|
["logs", "the log of a running process"],
|
|
3279
3304
|
["events", "what happened in a thing over time"],
|
|
3280
3305
|
["scheduled", "what is scheduled to happen"],
|
|
@@ -3347,11 +3372,12 @@ var VOCABULARY = defineVocabulary({
|
|
|
3347
3372
|
...MAIL_FLAGS,
|
|
3348
3373
|
...KNOWLEDGE_FLAGS,
|
|
3349
3374
|
...CRM_FLAGS,
|
|
3350
|
-
...SCHEDULE_FLAGS
|
|
3375
|
+
...SCHEDULE_FLAGS,
|
|
3376
|
+
...CONTENT_FLAGS
|
|
3351
3377
|
]
|
|
3352
3378
|
});
|
|
3353
3379
|
|
|
3354
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3380
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/mcp/agent.js
|
|
3355
3381
|
var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
|
|
3356
3382
|
var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
|
|
3357
3383
|
var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
|
|
@@ -3522,7 +3548,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3522
3548
|
const { argv, stdin } = argvOf(info, input, ctx.profile, ctx.stdin);
|
|
3523
3549
|
const lend = ctx.connection;
|
|
3524
3550
|
let borrowed;
|
|
3525
|
-
let
|
|
3551
|
+
let answered = false;
|
|
3526
3552
|
let result;
|
|
3527
3553
|
let failure;
|
|
3528
3554
|
const streams = captureStreams();
|
|
@@ -3544,7 +3570,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3544
3570
|
answer: /* @__PURE__ */ __name(() => null, "answer"),
|
|
3545
3571
|
agent: {
|
|
3546
3572
|
result: /* @__PURE__ */ __name((value) => {
|
|
3547
|
-
|
|
3573
|
+
answered = true;
|
|
3548
3574
|
result = value;
|
|
3549
3575
|
}, "result"),
|
|
3550
3576
|
failure: /* @__PURE__ */ __name((object2) => {
|
|
@@ -3566,7 +3592,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3566
3592
|
}));
|
|
3567
3593
|
if (failure)
|
|
3568
3594
|
return { error: failure };
|
|
3569
|
-
if (
|
|
3595
|
+
if (answered)
|
|
3570
3596
|
return { result };
|
|
3571
3597
|
if (code !== 0)
|
|
3572
3598
|
throw new CliError("invalid_response", `the command exited with ${code} and said nothing`);
|
|
@@ -3578,468 +3604,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3578
3604
|
}
|
|
3579
3605
|
}, "runCommandForAgent");
|
|
3580
3606
|
|
|
3581
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/mcp/tool.js
|
|
3582
|
-
var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
|
|
3583
|
-
var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
|
|
3584
|
-
var message = pipe(
|
|
3585
|
-
string(),
|
|
3586
|
-
maxLength(256),
|
|
3587
|
-
// biome-ignore lint/suspicious/noControlCharactersInRegex: refusing them is the point
|
|
3588
|
-
regex(/^[^\s\x00-\x1F\x7F-\x9F]+$/, "a message id has no spaces or control characters"),
|
|
3589
|
-
description("message id")
|
|
3590
|
-
);
|
|
3591
|
-
var READ = { readOnlyHint: true, destructiveHint: false, openWorldHint: true };
|
|
3592
|
-
var WRITE = {
|
|
3593
|
-
readOnlyHint: false,
|
|
3594
|
-
destructiveHint: true,
|
|
3595
|
-
idempotentHint: false,
|
|
3596
|
-
openWorldHint: true
|
|
3597
|
-
};
|
|
3598
|
-
var tool = /* @__PURE__ */ __name((definition) => definition, "tool");
|
|
3599
|
-
var chatOf = /* @__PURE__ */ __name((messenger) => pipe(string(), minLength(1), description(messenger.chatArgument)), "chatOf");
|
|
3600
|
-
var tierOf = /* @__PURE__ */ __name((key2, definition, messenger) => {
|
|
3601
|
-
if (definition.annotations.readOnlyHint === true)
|
|
3602
|
-
return "read";
|
|
3603
|
-
if (/^admin|_admin/.test(key2))
|
|
3604
|
-
return "admin";
|
|
3605
|
-
if (/delete|ban|kick|remove|purge|block/.test(key2))
|
|
3606
|
-
return "destructive";
|
|
3607
|
-
if (/draft/.test(key2))
|
|
3608
|
-
return "draft";
|
|
3609
|
-
if (key2 === "messages_pin" && messenger?.quietPins === false)
|
|
3610
|
-
return "write-public";
|
|
3611
|
-
if (/mark_read|mark_unread|read_mark|archive|mute|pin|tag|note|label|folder|alias|save|_(un)?star$/.test(key2))
|
|
3612
|
-
return "write-private";
|
|
3613
|
-
return "write-public";
|
|
3614
|
-
}, "tierOf");
|
|
3615
|
-
var effectsOf = /* @__PURE__ */ __name((definition) => {
|
|
3616
|
-
if (definition.effects)
|
|
3617
|
-
return definition.effects;
|
|
3618
|
-
const { readOnlyHint, openWorldHint } = definition.annotations;
|
|
3619
|
-
if (readOnlyHint === true)
|
|
3620
|
-
return { remote: openWorldHint === false ? "none" : "read", local: "read" };
|
|
3621
|
-
return openWorldHint === false ? LOCAL_WRITE : REMOTE_WRITE;
|
|
3622
|
-
}, "effectsOf");
|
|
3623
|
-
var outcomeOf = /* @__PURE__ */ __name((result) => {
|
|
3624
|
-
if (!result.isError)
|
|
3625
|
-
return { status: "ok" };
|
|
3626
|
-
const code = result.structuredContent?.error?.code;
|
|
3627
|
-
const error = typeof code === "string" ? code : "generic_failure";
|
|
3628
|
-
return { status: error === "permission_error" ? "refused" : "failed", error };
|
|
3629
|
-
}, "outcomeOf");
|
|
3630
|
-
var commandOf = /* @__PURE__ */ __name((name, definition) => definition.command ?? name.replaceAll("_", " "), "commandOf");
|
|
3631
|
-
var toolKey = /* @__PURE__ */ __name((name, definition) => definition.key !== void 0 ? definition.key : keyForCommand(commandOf(name, definition).split(" ")), "toolKey");
|
|
3632
|
-
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");
|
|
3633
|
-
var syncAllowedFor = /* @__PURE__ */ __name((key2, defaults) => {
|
|
3634
|
-
const permissions = defaults.settings.permissions ?? {};
|
|
3635
|
-
const shared = defaults.syncAllowed ?? fetchesAt(levelFor(permissions, "messages.sync-first").level);
|
|
3636
|
-
return shared && (!key2.startsWith("stats_") || fetchesAt(levelFor(permissions, `${key2.replaceAll("_", ".")}.sync-first`).level));
|
|
3637
|
-
}, "syncAllowedFor");
|
|
3638
|
-
var entryRunner = /* @__PURE__ */ __name((registration) => {
|
|
3639
|
-
const run = callRunner(registration);
|
|
3640
|
-
const { log } = registration;
|
|
3641
|
-
return async (key2, definition, args, ctx) => {
|
|
3642
|
-
const startedAt = Date.now();
|
|
3643
|
-
const command = `mcp ${commandOf(key2, definition)}`;
|
|
3644
|
-
const traceId = traceIdOf(ctx?.mcpReq?._meta?.traceparent);
|
|
3645
|
-
const app = registration.messenger?.app;
|
|
3646
|
-
const caller = registration.callers ? callerOf(ctx, key2, registration.callers) : currentCaller();
|
|
3647
|
-
const env = registration.defaults.env ?? process.env;
|
|
3648
|
-
const settings = registration.defaults.settings;
|
|
3649
|
-
const recording = key2 !== "runs_search" && settings.keepFailedRuns !== false && app?.appName ? startRecording({
|
|
3650
|
-
app,
|
|
3651
|
-
command,
|
|
3652
|
-
...settings.profile === void 0 ? {} : { profile: settings.profile },
|
|
3653
|
-
env,
|
|
3654
|
-
record: keepsSuccess({ record: settings.record ?? true, fromFlag: false, env, caller }),
|
|
3655
|
-
keepFailed: true,
|
|
3656
|
-
trace: false,
|
|
3657
|
-
format: "json",
|
|
3658
|
-
context: runContextOf({ bin: app.command, command, env, caller }),
|
|
3659
|
-
...settings.keepRunsForDays === void 0 ? {} : { keepDays: settings.keepRunsForDays },
|
|
3660
|
-
...settings.keepSuccessfulRunsForDays === void 0 ? {} : { keepSuccessDays: settings.keepSuccessfulRunsForDays },
|
|
3661
|
-
...settings.runsSizeLimitMb === void 0 ? {} : { maxBytes: settings.runsSizeLimitMb * 1024 * 1024 },
|
|
3662
|
-
...traceId === void 0 ? {} : { traceId }
|
|
3663
|
-
}) : void 0;
|
|
3664
|
-
const profile = registration.defaults.settings.profile;
|
|
3665
|
-
const scope = {
|
|
3666
|
-
runId: recording?.runId ?? newRunId(new Date(startedAt), command),
|
|
3667
|
-
command,
|
|
3668
|
-
startedAt,
|
|
3669
|
-
...profile === void 0 ? {} : { profile },
|
|
3670
|
-
...traceId === void 0 ? {} : { traceId },
|
|
3671
|
-
...recording ? { events: recording.events } : {}
|
|
3672
|
-
};
|
|
3673
|
-
const work = /* @__PURE__ */ __name(() => inRun(scope, () => {
|
|
3674
|
-
const input = inputOf(definition, syncAllowedFor(key2, registration.defaults));
|
|
3675
|
-
const parsed = safeParse(input, args);
|
|
3676
|
-
return parsed.success ? run(key2, definition, parsed.output, ctx) : failed(new CliError("validation_error", `${commandOf(key2, definition)}: ${summarize(parsed.issues)}`, {
|
|
3677
|
-
arguments: toJsonSchema(input)
|
|
3678
|
-
}), app?.errors);
|
|
3679
|
-
}), "work");
|
|
3680
|
-
const result = await (caller ? withCaller(caller, work) : work());
|
|
3681
|
-
if (recording) {
|
|
3682
|
-
if (result.isError) {
|
|
3683
|
-
const error = result.structuredContent?.error;
|
|
3684
|
-
const code = error?.code && errorCodes.includes(error.code) ? error.code : void 0;
|
|
3685
|
-
await recording.fail(code ? new CliError(code, "MCP operation failed") : new Error("MCP operation failed")).catch(() => void 0);
|
|
3686
|
-
} else
|
|
3687
|
-
await recording.succeed(result.structuredContent).catch(() => void 0);
|
|
3688
|
-
}
|
|
3689
|
-
await log?.({
|
|
3690
|
-
tool: key2,
|
|
3691
|
-
tier: tierOf(key2, definition, registration.messenger),
|
|
3692
|
-
...outcomeOf(result),
|
|
3693
|
-
startedAt,
|
|
3694
|
-
finishedAt: Date.now()
|
|
3695
|
-
}, caller)?.catch(() => void 0);
|
|
3696
|
-
return result;
|
|
3697
|
-
};
|
|
3698
|
-
}, "entryRunner");
|
|
3699
|
-
var callRunner = /* @__PURE__ */ __name(({ messenger, session, withStore, withServices, defaults, around, targets }) => {
|
|
3700
|
-
const where = {
|
|
3701
|
-
profile: defaults.settings.profile,
|
|
3702
|
-
env: defaults.env,
|
|
3703
|
-
pictures: defaults.settings.pictureSearch,
|
|
3704
|
-
reranker: defaults.settings.searchReranker
|
|
3705
|
-
};
|
|
3706
|
-
return async (key2, definition, args, ctx) => {
|
|
3707
|
-
const path = commandOf(key2, definition).split(" ");
|
|
3708
|
-
const run = `mcp ${path.join(" ")}`;
|
|
3709
|
-
try {
|
|
3710
|
-
const execute = /* @__PURE__ */ __name(async () => {
|
|
3711
|
-
const syncAllowed = syncAllowedFor(key2, defaults);
|
|
3712
|
-
if (Buffer.byteLength(JSON.stringify(args)) > MAX_BUFFERED_INPUT)
|
|
3713
|
-
throw new CliError("validation_error", "tool arguments exceed the buffered input limit", {
|
|
3714
|
-
reason: "input.too-large",
|
|
3715
|
-
max_bytes: MAX_BUFFERED_INPUT,
|
|
3716
|
-
retryable: false
|
|
3717
|
-
});
|
|
3718
|
-
definition.check?.(args);
|
|
3719
|
-
if (definition.changesStore)
|
|
3720
|
-
refuseStoreChange(messenger.app, defaults.env);
|
|
3721
|
-
refuseLacking(messenger, path);
|
|
3722
|
-
for (const permission of readKeysForCommand(path)) {
|
|
3723
|
-
if (levelFor(defaults.settings.permissions ?? {}, permission).level === "deny")
|
|
3724
|
-
throw new CliError("permission_error", `profile denies ${permission}`, { permission });
|
|
3725
|
-
}
|
|
3726
|
-
if (args.sync_first && !syncAllowed)
|
|
3727
|
-
throw new CliError("permission_error", "messages.sync-first is not allowed by this profile");
|
|
3728
|
-
if (definition.custom) {
|
|
3729
|
-
const result2 = await definition.custom(args, { ...defaults, signal: ctx.mcpReq.signal }, ctx);
|
|
3730
|
-
return answered(result2, definition.outputLimit?.(args, defaults), targets);
|
|
3731
|
-
}
|
|
3732
|
-
if (definition.local)
|
|
3733
|
-
return answered(await definition.local(args, defaults), definition.outputLimit?.(args, defaults), targets);
|
|
3734
|
-
const { online, stored: local, served } = definition;
|
|
3735
|
-
const stored = local && (!definition.storedWhen || definition.storedWhen(args)) ? local : void 0;
|
|
3736
|
-
const result = stored ? await withStore((store, account) => stored(store, account, args, { ...defaults, signal: ctx.mcpReq.signal }, (work) => session.use(run, work)), {
|
|
3737
|
-
name: run
|
|
3738
|
-
}) : served && withServices ? await withServices((services, connect) => served(services, args, defaults, connect), { name: run }) : served && messenger.history === "store" ? await withStore((store, account) => served(servicesFor({
|
|
3739
|
-
...storeModeDeps(messenger, store, account, defaults.guard),
|
|
3740
|
-
...where,
|
|
3741
|
-
embedders: defaults.embedders
|
|
3742
|
-
}), args, defaults, (work) => session.use(run, async (adapter, release) => {
|
|
3743
|
-
try {
|
|
3744
|
-
return await work(adapter);
|
|
3745
|
-
} finally {
|
|
3746
|
-
await release();
|
|
3747
|
-
}
|
|
3748
|
-
})), { name: run }) : served ? await session.use(run, (adapter, release) => served(servicesFor(onlineDeps(messenger, adapter, defaults.guard, where)), args, defaults, (work) => (async () => {
|
|
3749
|
-
try {
|
|
3750
|
-
return await work(adapter);
|
|
3751
|
-
} finally {
|
|
3752
|
-
await release();
|
|
3753
|
-
}
|
|
3754
|
-
})())) : await session.use(run, (adapter, release) => online(adapter, args, { ...defaults, release }));
|
|
3755
|
-
return answered(result, definition.outputLimit?.(args, defaults), targets);
|
|
3756
|
-
}, "execute");
|
|
3757
|
-
return around ? await around(key2, definition, execute) : await execute();
|
|
3758
|
-
} catch (error) {
|
|
3759
|
-
return failed(error, messenger?.app?.errors, effectsOf(definition));
|
|
3760
|
-
}
|
|
3761
|
-
};
|
|
3762
|
-
}, "callRunner");
|
|
3763
|
-
var outputSchemaOf = /* @__PURE__ */ __name((definition) => {
|
|
3764
|
-
if (!definition.output)
|
|
3765
|
-
return looseObject({});
|
|
3766
|
-
const entity = ENTITIES[definition.output.entity];
|
|
3767
|
-
return definition.output.list ? listEnvelopeSchema(entity) : itemEnvelopeSchema(entity);
|
|
3768
|
-
}, "outputSchemaOf");
|
|
3769
|
-
var Picture = class {
|
|
3770
|
-
static {
|
|
3771
|
-
__name(this, "Picture");
|
|
3772
|
-
}
|
|
3773
|
-
bytes;
|
|
3774
|
-
mimeType;
|
|
3775
|
-
about;
|
|
3776
|
-
constructor(bytes, mimeType, about) {
|
|
3777
|
-
this.bytes = bytes;
|
|
3778
|
-
this.mimeType = mimeType;
|
|
3779
|
-
this.about = about;
|
|
3780
|
-
}
|
|
3781
|
-
};
|
|
3782
|
-
var BinaryResource = class {
|
|
3783
|
-
static {
|
|
3784
|
-
__name(this, "BinaryResource");
|
|
3785
|
-
}
|
|
3786
|
-
base64;
|
|
3787
|
-
mimeType;
|
|
3788
|
-
uri;
|
|
3789
|
-
about;
|
|
3790
|
-
constructor(base64, mimeType, uri, about) {
|
|
3791
|
-
this.base64 = base64;
|
|
3792
|
-
this.mimeType = mimeType;
|
|
3793
|
-
this.uri = uri;
|
|
3794
|
-
this.about = about;
|
|
3795
|
-
}
|
|
3796
|
-
};
|
|
3797
|
-
var answered = /* @__PURE__ */ __name((answer, maxBytes = DEFAULT_OUTPUT_BYTES, targets) => {
|
|
3798
|
-
const bounded = /* @__PURE__ */ __name((result) => {
|
|
3799
|
-
if (maxBytes !== 0 && Buffer.byteLength(JSON.stringify(result.content)) > maxBytes)
|
|
3800
|
-
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 });
|
|
3801
|
-
return result;
|
|
3802
|
-
}, "bounded");
|
|
3803
|
-
if (answer === null || Array.isArray(answer) || typeof answer !== "object")
|
|
3804
|
-
throw new CliError("invalid_response", "tool result must be an object", { retryable: false });
|
|
3805
|
-
const objectBody = /* @__PURE__ */ __name((value) => {
|
|
3806
|
-
const serialized = JSON.parse(agentJson(value));
|
|
3807
|
-
if (serialized === null || Array.isArray(serialized) || typeof serialized !== "object")
|
|
3808
|
-
throw new CliError("invalid_response", "serialized tool result must be an object", { retryable: false });
|
|
3809
|
-
return serialized;
|
|
3810
|
-
}, "objectBody");
|
|
3811
|
-
if (answer instanceof BinaryResource) {
|
|
3812
|
-
const about = sealed(answer.about);
|
|
3813
|
-
return bounded({
|
|
3814
|
-
structuredContent: objectBody(about),
|
|
3815
|
-
content: [
|
|
3816
|
-
{ type: "resource", resource: { uri: answer.uri, mimeType: answer.mimeType, blob: answer.base64 } },
|
|
3817
|
-
{ type: "text", text: agentJson(about) }
|
|
3818
|
-
]
|
|
3819
|
-
});
|
|
3820
|
-
}
|
|
3821
|
-
if (answer instanceof Picture) {
|
|
3822
|
-
const about = sealed(answer.about);
|
|
3823
|
-
return bounded({
|
|
3824
|
-
structuredContent: objectBody(about),
|
|
3825
|
-
content: [
|
|
3826
|
-
{ type: "image", data: Buffer.from(answer.bytes).toString("base64"), mimeType: answer.mimeType },
|
|
3827
|
-
{ type: "text", text: agentJson(about) }
|
|
3828
|
-
]
|
|
3829
|
-
});
|
|
3830
|
-
}
|
|
3831
|
-
const body = objectBody(sealed(targets ? judgedAnswer(answer, targets) : answer));
|
|
3832
|
-
return bounded({ content: [{ type: "text", text: JSON.stringify(body) }], structuredContent: body });
|
|
3833
|
-
}, "answered");
|
|
3834
|
-
var failed = /* @__PURE__ */ __name((error, errors, effects) => {
|
|
3835
|
-
const judged = judgedEffects(effects);
|
|
3836
|
-
const context = { ...failureContext(errors), ...judged ? { effects: judged } : {} };
|
|
3837
|
-
return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(storeDamaged(error), context))));
|
|
3838
|
-
}, "failed");
|
|
3839
|
-
|
|
3840
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/mcp/surface.js
|
|
3841
|
-
import { randomUUID } from "node:crypto";
|
|
3842
|
-
var MATCHES = 8;
|
|
3843
|
-
var ANSWER = answerSchema();
|
|
3844
|
-
var agentAnswer = /* @__PURE__ */ __name((prefix, writes2) => {
|
|
3845
|
-
const meta = pipe(looseObject({}), description(`run facts; ${prefix}_tools_search shows the full answer`));
|
|
3846
|
-
const next = optional(pipe(array(looseObject({})), description("steps to run next: command and args")));
|
|
3847
|
-
return looseObject(writes2 ? { item: optional(unknown()), next, meta } : {
|
|
3848
|
-
items: optional(array(unknown())),
|
|
3849
|
-
item: optional(unknown()),
|
|
3850
|
-
page: optional(looseObject({ has_more: boolean() })),
|
|
3851
|
-
next,
|
|
3852
|
-
missing: optional(array(looseObject({ field: string(), why: string() }))),
|
|
3853
|
-
meta
|
|
3854
|
-
});
|
|
3855
|
-
}, "agentAnswer");
|
|
3856
|
-
var listedAs = /* @__PURE__ */ __name((prefix, writes2) => {
|
|
3857
|
-
const checked = toStandardJsonSchema(ANSWER);
|
|
3858
|
-
const shown = toStandardJsonSchema(agentAnswer(prefix, writes2))["~standard"].jsonSchema;
|
|
3859
|
-
return { "~standard": { ...checked["~standard"], jsonSchema: shown } };
|
|
3860
|
-
}, "listedAs");
|
|
3861
|
-
var normal = /* @__PURE__ */ __name((command) => command.trim().toLowerCase().split(/[\s_-]+/).join(" "), "normal");
|
|
3862
|
-
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(" "));
|
|
3863
|
-
var wordsOf = /* @__PURE__ */ __name((text3) => text3.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(Boolean), "wordsOf");
|
|
3864
|
-
var stem = /* @__PURE__ */ __name((word2) => {
|
|
3865
|
-
const bare = word2.replace(/'s$/u, "");
|
|
3866
|
-
if (bare.length > 4 && bare.endsWith("ies"))
|
|
3867
|
-
return `${bare.slice(0, -3)}y`;
|
|
3868
|
-
for (const ending of ["ing", "ed", "es", "s"])
|
|
3869
|
-
if (bare.length - ending.length >= 3 && bare.endsWith(ending))
|
|
3870
|
-
return bare.slice(0, -ending.length);
|
|
3871
|
-
return bare;
|
|
3872
|
-
}, "stem");
|
|
3873
|
-
var sameWord = /* @__PURE__ */ __name((asked, known) => {
|
|
3874
|
-
if (asked === known)
|
|
3875
|
-
return true;
|
|
3876
|
-
const [short, long] = asked.length <= known.length ? [asked, known] : [known, asked];
|
|
3877
|
-
return short.length >= 3 && long.startsWith(short);
|
|
3878
|
-
}, "sameWord");
|
|
3879
|
-
var fieldsOf2 = /* @__PURE__ */ __name((command, one) => [
|
|
3880
|
-
[4, [...wordsOf(command), ...(one.aliases ?? []).flatMap(wordsOf)]],
|
|
3881
|
-
[2, wordsOf(one.title)],
|
|
3882
|
-
[1, [...wordsOf(one.description), ...(one.keywords ?? []).flatMap(wordsOf), ...Object.keys(one.input.entries)]]
|
|
3883
|
-
].map(([weight, words]) => [weight, [...new Set(words.map(stem))]]), "fieldsOf");
|
|
3884
|
-
var search = /* @__PURE__ */ __name((commands, query) => {
|
|
3885
|
-
const named = normal(query);
|
|
3886
|
-
const all = Object.entries(commands);
|
|
3887
|
-
if (!named)
|
|
3888
|
-
return all.map((entry) => entry).sort((a, b) => a[0].localeCompare(b[0]));
|
|
3889
|
-
const words = [
|
|
3890
|
-
...new Set(wordsOf(query).filter((word2) => word2.length > 1 && !STOP_WORDS.has(word2)).map(stem))
|
|
3891
|
-
];
|
|
3892
|
-
return all.map((entry) => {
|
|
3893
|
-
const fields = fieldsOf2(entry[0], entry[1]);
|
|
3894
|
-
const weights = words.map((word2) => fields.reduce((best, [weight, known]) => known.some((one) => sameWord(word2, one)) ? Math.max(best, weight) : best, 0));
|
|
3895
|
-
const matched = weights.filter((weight) => weight > 0).length;
|
|
3896
|
-
const exact = normal(entry[0]) === named || (entry[1].aliases ?? []).some((alias) => normal(alias) === named);
|
|
3897
|
-
return { entry, matched, rank: (exact ? 1e3 : 0) + matched * 10 + weights.reduce((a, b) => a + b, 0) };
|
|
3898
|
-
}).filter(({ matched, rank }) => matched > 0 || rank >= 1e3).sort((a, b) => b.rank - a.rank || a.entry[0].localeCompare(b.entry[0])).map(({ entry }) => entry);
|
|
3899
|
-
}, "search");
|
|
3900
|
-
var nearest = /* @__PURE__ */ __name((commands, asked) => {
|
|
3901
|
-
const words = normal(asked).split(" ");
|
|
3902
|
-
return Object.keys(commands).map((one) => ({ one, shared: words.filter((word2) => normal(one).split(" ").includes(word2)).length })).filter(({ shared }) => shared > 0).sort((a, b) => b.shared - a.shared).slice(0, 3).map(({ one }) => one);
|
|
3903
|
-
}, "nearest");
|
|
3904
|
-
var runnableOnly = /* @__PURE__ */ __name((result, offered) => {
|
|
3905
|
-
const body = result.structuredContent;
|
|
3906
|
-
if (result.isError || !Array.isArray(body?.next))
|
|
3907
|
-
return result;
|
|
3908
|
-
const next = body.next.filter((step) => step.command === void 0 || offered(step.command));
|
|
3909
|
-
const { next: _, ...rest } = body;
|
|
3910
|
-
const kept = next.length > 0 ? { ...rest, next } : rest;
|
|
3911
|
-
return {
|
|
3912
|
-
...result,
|
|
3913
|
-
structuredContent: kept,
|
|
3914
|
-
content: result.content.map((part) => part.type === "text" ? { ...part, text: JSON.stringify(kept) } : part)
|
|
3915
|
-
};
|
|
3916
|
-
}, "runnableOnly");
|
|
3917
|
-
var takesNothing = /* @__PURE__ */ __name((one) => Object.values(one.input.entries).every((entry) => entry.type === "optional"), "takesNothing");
|
|
3918
|
-
var sampleOf = /* @__PURE__ */ __name((commands) => {
|
|
3919
|
-
const reading = Object.entries(commands).filter(([, one]) => !one.writes);
|
|
3920
|
-
const bare = reading.filter(([, one]) => takesNothing(one));
|
|
3921
|
-
return bare.find(([command]) => command.endsWith(" list"))?.[0] ?? bare[0]?.[0] ?? reading[0]?.[0] ?? Object.keys(commands)[0] ?? "";
|
|
3922
|
-
}, "sampleOf");
|
|
3923
|
-
var registerCommands = /* @__PURE__ */ __name((server, prefix, commands, errors, withheld, isMessenger) => {
|
|
3924
|
-
const byNormal = new Map(Object.keys(commands).map((command) => [normal(command), command]));
|
|
3925
|
-
const messenger = isMessenger ?? Object.keys(commands).some((command) => command.split(" ")[0] === "messages");
|
|
3926
|
-
const tasks = messenger ? '"unread", "send message", "chat members"' : '"list", "show", "change a setting"';
|
|
3927
|
-
const sample = messenger ? "messages list" : sampleOf(commands);
|
|
3928
|
-
const untrusted = messenger ? UNTRUSTED : UNTRUSTED_NEUTRAL;
|
|
3929
|
-
server.registerTool(`${prefix}_tools_search`, {
|
|
3930
|
-
outputSchema: toStandardJsonSchema(looseObject({})),
|
|
3931
|
-
title: "Find a command",
|
|
3932
|
-
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.`,
|
|
3933
|
-
inputSchema: toStandardJsonSchema(strictObject({ query: optional(pipe(string(), description("words that describe the task"))) })),
|
|
3934
|
-
annotations: { ...READ, openWorldHint: false, idempotentHint: true }
|
|
3935
|
-
}, async ({ query }) => {
|
|
3936
|
-
const found = search(commands, query ?? "");
|
|
3937
|
-
const items = query?.trim() ? found.slice(0, MATCHES).map(([command, one]) => ({
|
|
3938
|
-
command,
|
|
3939
|
-
title: one.title,
|
|
3940
|
-
description: one.description,
|
|
3941
|
-
writes: one.writes,
|
|
3942
|
-
availability: one.availability?.() ?? { available: true },
|
|
3943
|
-
arguments: toJsonSchema(one.input),
|
|
3944
|
-
output: toJsonSchema(one.output ?? ANSWER)
|
|
3945
|
-
})) : found.map(([command, one]) => ({
|
|
3946
|
-
command,
|
|
3947
|
-
title: one.title,
|
|
3948
|
-
writes: one.writes,
|
|
3949
|
-
availability: one.availability?.() ?? { available: true }
|
|
3950
|
-
}));
|
|
3951
|
-
const { next: _paging, ...list } = listOf(`${prefix}_tools_search`, {
|
|
3952
|
-
items,
|
|
3953
|
-
limit: Math.max(items.length, query?.trim() ? MATCHES : 1),
|
|
3954
|
-
has_more: found.length > items.length
|
|
3955
|
-
});
|
|
3956
|
-
return answered(list);
|
|
3957
|
-
});
|
|
3958
|
-
const callers = {
|
|
3959
|
-
env: process.env,
|
|
3960
|
-
client: /* @__PURE__ */ __name(() => server.server.getClientVersion(), "client"),
|
|
3961
|
-
connectionId: randomUUID()
|
|
3962
|
-
};
|
|
3963
|
-
const runner = /* @__PURE__ */ __name((writing) => async ({ command: asked, arguments: given }, ctx) => {
|
|
3964
|
-
try {
|
|
3965
|
-
const command = byNormal.get(normal(asked));
|
|
3966
|
-
const one = command === void 0 ? void 0 : commands[command];
|
|
3967
|
-
if (command === void 0 || !one) {
|
|
3968
|
-
withheld?.(normal(asked));
|
|
3969
|
-
const near = nearest(commands, asked);
|
|
3970
|
-
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`);
|
|
3971
|
-
}
|
|
3972
|
-
if (one.writes !== writing)
|
|
3973
|
-
throw new CliError("validation_error", `"${command}" ${writing ? "only reads" : "writes"}: call it with ${prefix}_${writing ? "read" : "write"}`);
|
|
3974
|
-
const args = writing ? agentArguments(given ?? {}) : given ?? {};
|
|
3975
|
-
const caller = currentCaller() ?? callerOf(ctx, command.replace(/[ -]/g, "_"), callers);
|
|
3976
|
-
if (one.checked)
|
|
3977
|
-
return runnableOnly(await withCaller(caller, () => one.run(args, ctx)), (named) => byNormal.has(normal(named)));
|
|
3978
|
-
const parsed = safeParse(strictObject(one.input.entries), args);
|
|
3979
|
-
if (!parsed.success)
|
|
3980
|
-
throw new CliError("validation_error", `${command}: ${summarize(parsed.issues)}`, {
|
|
3981
|
-
arguments: toJsonSchema(one.input)
|
|
3982
|
-
});
|
|
3983
|
-
return runnableOnly(await withCaller(caller, () => one.run(parsed.output, ctx)), (named) => byNormal.has(normal(named)));
|
|
3984
|
-
} catch (error) {
|
|
3985
|
-
return failed(error, errors);
|
|
3986
|
-
}
|
|
3987
|
-
}, "runner");
|
|
3988
|
-
const call = strictObject({
|
|
3989
|
-
command: pipe(string(), minLength(1), description(`a command ${prefix}_tools_search returned: "${sample}"`)),
|
|
3990
|
-
arguments: optional(pipe(record(string(), unknown()), description("that command's arguments")))
|
|
3991
|
-
});
|
|
3992
|
-
server.registerTool(`${prefix}_read`, {
|
|
3993
|
-
outputSchema: listedAs(prefix, false),
|
|
3994
|
-
title: "Run a reading command",
|
|
3995
|
-
description: `Run one command that only reads, with the arguments ${prefix}_tools_search showed. ${untrusted}`,
|
|
3996
|
-
inputSchema: toStandardJsonSchema(call),
|
|
3997
|
-
annotations: READ
|
|
3998
|
-
}, runner(false));
|
|
3999
|
-
if (Object.values(commands).some((one) => one.writes))
|
|
4000
|
-
server.registerTool(`${prefix}_write`, {
|
|
4001
|
-
outputSchema: listedAs(prefix, true),
|
|
4002
|
-
title: "Run a writing command",
|
|
4003
|
-
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}`,
|
|
4004
|
-
inputSchema: toStandardJsonSchema(call),
|
|
4005
|
-
annotations: WRITE
|
|
4006
|
-
}, runner(true));
|
|
4007
|
-
}, "registerCommands");
|
|
4008
|
-
var surfaceCommands = /* @__PURE__ */ __name((tools, registration) => {
|
|
4009
|
-
const run = entryRunner(registration);
|
|
4010
|
-
return Object.fromEntries(Object.entries(tools).map(([key2, definition]) => [
|
|
4011
|
-
commandOf(key2, definition),
|
|
4012
|
-
{
|
|
4013
|
-
title: definition.title,
|
|
4014
|
-
description: definition.description,
|
|
4015
|
-
writes: definition.annotations.readOnlyHint !== true,
|
|
4016
|
-
input: inputOf(definition, syncAllowedFor(key2, registration.defaults)),
|
|
4017
|
-
...definition.output ? { output: outputSchemaOf(definition) } : {},
|
|
4018
|
-
checked: true,
|
|
4019
|
-
run: /* @__PURE__ */ __name((args, ctx) => run(key2, definition, args, ctx), "run")
|
|
4020
|
-
}
|
|
4021
|
-
]));
|
|
4022
|
-
}, "surfaceCommands");
|
|
4023
|
-
var outputOf = /* @__PURE__ */ __name(({ entity, view }) => answerSchema(ENTITIES[view ? `${entity}.${view}` : entity] ?? unknown()), "outputOf");
|
|
4024
|
-
|
|
4025
3607
|
export {
|
|
4026
3608
|
toolsFromCommands,
|
|
4027
|
-
runCommandForAgent
|
|
4028
|
-
message,
|
|
4029
|
-
READ,
|
|
4030
|
-
WRITE,
|
|
4031
|
-
tool,
|
|
4032
|
-
chatOf,
|
|
4033
|
-
tierOf,
|
|
4034
|
-
outcomeOf,
|
|
4035
|
-
commandOf,
|
|
4036
|
-
toolKey,
|
|
4037
|
-
Picture,
|
|
4038
|
-
BinaryResource,
|
|
4039
|
-
answered,
|
|
4040
|
-
failed,
|
|
4041
|
-
normal,
|
|
4042
|
-
registerCommands,
|
|
4043
|
-
surfaceCommands,
|
|
4044
|
-
outputOf
|
|
3609
|
+
runCommandForAgent
|
|
4045
3610
|
};
|