@wirecat/zoom-cli 0.80.0 → 0.82.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/contracts/wirecat.json +71 -3
- package/dist/answers.d.ts +100 -0
- package/dist/answers.d.ts.map +1 -1
- package/dist/bin/zm.js +2 -2
- package/dist/bundle/agent-F4TRJWWS.js +46 -0
- package/dist/bundle/{all-profiles-5GOKWOT4.js → all-profiles-RULEKTDQ.js} +64 -22
- package/dist/bundle/answer-policy-6XC57AEZ.js +131 -0
- package/dist/bundle/{anthropic-NHXMOFYS.js → anthropic-4NAQBZFL.js} +6 -6
- package/dist/bundle/{app-server-HFW5Z5PI.js → app-server-VLR42U5L.js} +92 -80
- package/dist/bundle/{bun-M5IGY2TG.js → bun-OPDGMZZQ.js} +2 -2
- package/dist/bundle/{bun-sqlite-MTP5JJQ2.js → bun-sqlite-HC6X4AOX.js} +7 -7
- package/dist/bundle/{chunk-TNL3YQ33.js → chunk-274SLQNW.js} +2 -2
- package/dist/bundle/{chunk-5CJ6AAUI.js → chunk-2CI2OEZQ.js} +4 -4
- package/dist/bundle/{chunk-GVKZZT7E.js → chunk-2DBF2IIC.js} +7 -78
- package/dist/bundle/{chunk-NRVMK5H3.js → chunk-2GP573Q4.js} +15748 -11939
- package/dist/bundle/{chunk-4OAR7BGU.js → chunk-2JHVQMVC.js} +1 -1
- package/dist/bundle/{chunk-XKLU5KV2.js → chunk-2SWKQ7C4.js} +1 -1
- package/dist/bundle/{chunk-W3GZ7JUO.js → chunk-2XBDILVW.js} +1 -1
- package/dist/bundle/{chunk-3UONR5HW.js → chunk-3HC5F3P7.js} +1 -1
- package/dist/bundle/{chunk-VN7TKMOW.js → chunk-3YM4B2GT.js} +1 -1
- package/dist/bundle/{chunk-PCPOO5FS.js → chunk-434YFJAE.js} +2 -2
- package/dist/bundle/{chunk-CW6CPQHI.js → chunk-4HLQ2JGK.js} +4 -4
- package/dist/bundle/{chunk-RT7C3SSJ.js → chunk-4N7PP76S.js} +1 -1
- package/dist/bundle/{chunk-JJX4HKDV.js → chunk-52Y4ETKU.js} +4 -4
- package/dist/bundle/{chunk-BIKHHFD2.js → chunk-5HAUK3I4.js} +2166 -2760
- package/dist/bundle/{chunk-W2QDYMAM.js → chunk-5KYQ53EF.js} +13 -9
- package/dist/bundle/{chunk-BW5JEOBE.js → chunk-5TU7Y5UW.js} +12 -12
- package/dist/bundle/{chunk-P2JTVRGU.js → chunk-66ALX4ZI.js} +168 -168
- package/dist/bundle/{chunk-EPIA2UUM.js → chunk-676C2LE6.js} +12 -12
- package/dist/bundle/{chunk-BNEJKGG7.js → chunk-6CWL5BKG.js} +78 -76
- package/dist/bundle/{chunk-TDBVM2SS.js → chunk-6QYZP4E2.js} +3 -3
- package/dist/bundle/{chunk-JXSEH64A.js → chunk-6VK332XS.js} +3 -3
- package/dist/bundle/{chunk-W7M4JYEE.js → chunk-73MOMNLL.js} +1 -1
- package/dist/bundle/{chunk-K672XJ2P.js → chunk-7QPIUMUG.js} +12 -12
- package/dist/bundle/{chunk-CWCDCNXA.js → chunk-7UVDPRFK.js} +6 -6
- package/dist/bundle/{chunk-RMX2WPWS.js → chunk-A6EZK5RG.js} +4 -4
- package/dist/bundle/{chunk-ONJPUFLX.js → chunk-AC6VJNMJ.js} +1 -1
- package/dist/bundle/{chunk-QIK2IBJ4.js → chunk-ACI4YIEH.js} +23 -7
- package/dist/bundle/{chunk-UX4JZMA4.js → chunk-AIKFOBDO.js} +278 -59
- package/dist/bundle/{chunk-GCPO7T2X.js → chunk-ASBDFXLS.js} +3 -3
- package/dist/bundle/{chunk-O4ZBFATF.js → chunk-B32KZRQM.js} +12 -12
- package/dist/bundle/{chunk-5RVXXDN7.js → chunk-BBGJQMRI.js} +1 -1
- package/dist/bundle/chunk-BDKVOU3I.js +52 -0
- package/dist/bundle/{chunk-GCUOZ2OA.js → chunk-BP4FYANF.js} +6 -6
- package/dist/bundle/{chunk-XTCAWNBP.js → chunk-DCYFT3FR.js} +4 -4
- package/dist/bundle/{chunk-FPUGMDJV.js → chunk-DNCLQPOM.js} +1 -1
- package/dist/bundle/{chunk-PKW3TPNP.js → chunk-DSZYABYL.js} +38 -19
- package/dist/bundle/{chunk-6MDL2LZA.js → chunk-E745WZKY.js} +8 -8
- package/dist/bundle/chunk-EGTCQKHV.js +340 -0
- package/dist/bundle/chunk-EQG3PIH2.js +108 -0
- package/dist/bundle/{chunk-ZPZT46O6.js → chunk-ESN3W2MZ.js} +48 -12
- package/dist/bundle/{chunk-7U5X37TE.js → chunk-G46WJ7YO.js} +6 -6
- package/dist/bundle/{chunk-L6FM5RQY.js → chunk-G6PETRMV.js} +3 -3
- package/dist/bundle/chunk-GBHMT2IU.js +755 -0
- package/dist/bundle/{chunk-6QCBTBDA.js → chunk-GGMAIIVE.js} +1 -1
- package/dist/bundle/{chunk-6I4C4ZFT.js → chunk-GTKPMYK7.js} +2 -2
- package/dist/bundle/{chunk-N5YUHN6S.js → chunk-GWGHH56B.js} +12 -12
- package/dist/bundle/{chunk-5XO2AY6D.js → chunk-HC6VN5CO.js} +10 -10
- package/dist/bundle/{chunk-ARL2TTPZ.js → chunk-HP7A2ZOP.js} +9 -9
- package/dist/bundle/chunk-HZENBDW2.js +209 -0
- package/dist/bundle/{chunk-ST3ZB7LS.js → chunk-IANKXHSE.js} +1 -1
- package/dist/bundle/{chunk-GGKEQQME.js → chunk-ICPJT672.js} +13 -9
- package/dist/bundle/chunk-JQ54DYAQ.js +80 -0
- package/dist/bundle/chunk-K5JGJIV2.js +640 -0
- package/dist/bundle/{chunk-DYRISFHZ.js → chunk-KJ6USQDZ.js} +19 -9
- package/dist/bundle/{chunk-TMYZKDQ7.js → chunk-KKFY23AK.js} +65 -65
- package/dist/bundle/chunk-KQPUVXKX.js +84 -0
- package/dist/bundle/{chunk-BPSURRAD.js → chunk-KVJ3I7UL.js} +43 -64
- package/dist/bundle/{chunk-NXFKZFTC.js → chunk-KWU46LNK.js} +3 -3
- package/dist/bundle/chunk-KXJ3JEDH.js +2 -0
- package/dist/bundle/{chunk-YAA2D6RP.js → chunk-L75SMSJR.js} +5 -5
- package/dist/bundle/{chunk-OXPHJEJ2.js → chunk-LAYYO4WD.js} +3 -3
- package/dist/bundle/{chunk-6PIXP5IH.js → chunk-LEKKTJKK.js} +40 -26
- package/dist/bundle/{chunk-3AOESMW6.js → chunk-M7H4MCAX.js} +18 -259
- package/dist/bundle/{chunk-DZ6H3YJH.js → chunk-MAJJ4PG3.js} +19 -16
- package/dist/bundle/{chunk-G5VH4WUF.js → chunk-MQLPZBMQ.js} +2 -2
- package/dist/bundle/{chunk-3Z7CFQTI.js → chunk-N3JLO63O.js} +1 -1
- package/dist/bundle/{chunk-NMETTKCV.js → chunk-N46F72AF.js} +14 -14
- package/dist/bundle/{chunk-A3TUG2DP.js → chunk-NB7EOAUZ.js} +36 -1
- package/dist/bundle/{chunk-BRMV33MO.js → chunk-NEMX3UNN.js} +4 -4
- package/dist/bundle/{chunk-6CDMGT6Q.js → chunk-OBXQLFT5.js} +2 -2
- package/dist/bundle/{chunk-HH7GR6TN.js → chunk-OGNO35A2.js} +6 -6
- package/dist/bundle/{chunk-Q6MISDKJ.js → chunk-OIPYBF43.js} +3 -3
- package/dist/bundle/{chunk-6LY4LBSD.js → chunk-OO4TRVPB.js} +7 -7
- package/dist/bundle/{chunk-CHEHK6IW.js → chunk-OQFQ77AY.js} +214 -118
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-Q5LUGY2V.js → chunk-PMUPN6JW.js} +9 -9
- package/dist/bundle/chunk-PSKTMMCO.js +561 -0
- package/dist/bundle/{chunk-U5N2PKKM.js → chunk-PWVJUIDQ.js} +2 -2
- package/dist/bundle/{chunk-475P3LWG.js → chunk-Q7ICVP25.js} +1 -1
- package/dist/bundle/{chunk-JGSVWLL2.js → chunk-QG6PILDO.js} +2 -2
- package/dist/bundle/{chunk-5K54M6RD.js → chunk-QPHBK63S.js} +1 -1
- package/dist/bundle/{chunk-RFXJLG5V.js → chunk-QVSL5WJ7.js} +5173 -3077
- package/dist/bundle/{chunk-IQWBGMCR.js → chunk-QVYAV7F2.js} +4 -4
- package/dist/bundle/{chunk-XIHENZW6.js → chunk-R2B6PUVI.js} +4 -4
- package/dist/bundle/{chunk-MH4L5LL6.js → chunk-RQOZBTNI.js} +16 -3
- package/dist/bundle/{chunk-FSLR2YGR.js → chunk-T7IAWEBU.js} +7 -7
- package/dist/bundle/{chunk-D4HKTC2T.js → chunk-TKNM22OH.js} +2 -2
- package/dist/bundle/{chunk-EI37UXDR.js → chunk-TKVBFJ5C.js} +1 -1
- package/dist/bundle/{chunk-O3DYRCIT.js → chunk-TXDR6YSF.js} +1 -1
- package/dist/bundle/{chunk-CWXOXIWS.js → chunk-TY7NDMFY.js} +1 -1
- package/dist/bundle/{chunk-Z3CPZ4I4.js → chunk-UAWSINMC.js} +306 -306
- package/dist/bundle/{chunk-4F7Q5CET.js → chunk-UKAAAOPC.js} +31 -180
- package/dist/bundle/{chunk-XL4ND7CZ.js → chunk-UL2PXLKT.js} +26 -26
- package/dist/bundle/{chunk-GRYXOSN6.js → chunk-UQCTXZEP.js} +10 -10
- package/dist/bundle/{chunk-E3JVLVVB.js → chunk-UR5DBODY.js} +37 -30
- package/dist/bundle/{chunk-SUG6YGAF.js → chunk-V5EJSF2B.js} +237 -167
- package/dist/bundle/{chunk-HGSBLY6M.js → chunk-VB72LTSZ.js} +12 -12
- package/dist/bundle/{chunk-2XZ2YKW4.js → chunk-VB7FZOYX.js} +2 -100
- package/dist/bundle/{chunk-PMO2Z6DQ.js → chunk-VS6WURLX.js} +3 -3
- package/dist/bundle/{chunk-5QXQIZJY.js → chunk-VZ5PPYDG.js} +3 -4
- package/dist/bundle/{chunk-YR5TRWT2.js → chunk-W5QHB53X.js} +287 -580
- package/dist/bundle/{chunk-2P6MQH4V.js → chunk-WMANRJR5.js} +6 -6
- package/dist/bundle/chunk-WOPVBRPV.js +29 -0
- package/dist/bundle/{chunk-W32HK7KG.js → chunk-XQ2WL3HB.js} +2 -2
- package/dist/bundle/{chunk-FIJREKLA.js → chunk-XQQVMECZ.js} +3 -3
- package/dist/bundle/{chunk-75JW7X2W.js → chunk-Y6PVS55U.js} +71 -61
- package/dist/bundle/{chunk-EMYRUJCV.js → chunk-YJXJJ2XP.js} +8 -8
- package/dist/bundle/{chunk-L2TURFT6.js → chunk-YY7XKHDY.js} +10 -3
- package/dist/bundle/chunk-ZED2CJW5.js +353 -0
- package/dist/bundle/chunk-ZOYOXWJB.js +746 -0
- package/dist/bundle/{cli-QNBYDOKV.js → cli-U4O5XB7J.js} +171 -124
- package/dist/bundle/command-contract-FBTK6GQX.js +45 -0
- package/dist/bundle/{command-server-entry-WMA4SWJ5.js → command-server-entry-KKH6ZWJV.js} +35 -35
- package/dist/bundle/config-FRJSIZNN.js +118 -0
- package/dist/bundle/{decode-7PXUXNIP.js → decode-TPCNXEK4.js} +6 -6
- package/dist/bundle/{dispatch-AWDROXWN.js → dispatch-FKMIPCPQ.js} +9 -9
- package/dist/bundle/{dist-TSBH4FOU.js → dist-7CLBCYZN.js} +23 -21
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-WIDIUEO6.js → echarts-O3TNDAXJ.js} +2 -2
- package/dist/bundle/{embed-EIRVQF5E.js → embed-WCJSFVSK.js} +7 -7
- package/dist/bundle/{embedder-MXPM6OXK.js → embedder-TBBUPXBX.js} +10 -10
- package/dist/bundle/{failure-JZW73RP7.js → failure-XTWBYI2A.js} +3 -3
- package/dist/bundle/first-run-ELEMFW42.js +29 -0
- package/dist/bundle/first-screen-DIOBWMKP.js +46 -0
- package/dist/bundle/{folders-TGFOE7DY.js → folders-LXOL4N4S.js} +5 -5
- package/dist/bundle/{instructions-D5LNE6NJ.js → instructions-AMH5RWVJ.js} +1 -1
- package/dist/bundle/{main-OHW5Z56X.js → main-YAA7WQ23.js} +24 -24
- package/dist/bundle/{mcp-RGNRW77S.js → mcp-5HFPWC3W.js} +2 -2
- package/dist/bundle/meeting-combined-UXCF4SJ3.js +26 -0
- package/dist/bundle/meeting-model-3BZJ3EQP.js +26 -0
- package/dist/bundle/{meeting-semantic-FYOVY4S2.js → meeting-semantic-3HU7I2SJ.js} +8 -8
- package/dist/bundle/{meetings-WI4SXPBJ.js → meetings-XWMB6FOH.js} +7 -7
- package/dist/bundle/{node-UEWUFR7N.js → node-EGMCBAO7.js} +2 -2
- package/dist/bundle/{node-sqlite-FJWKJHYU.js → node-sqlite-IJBWENFX.js} +8 -8
- package/dist/bundle/oauth-SZDDAP7A.js +20 -0
- package/dist/bundle/{open-EFYTWUGC.js → open-NS3TMKZX.js} +6 -6
- package/dist/bundle/openai-4DN6WI3B.js +28 -0
- package/dist/bundle/{output-file-J4SU6X4I.js → output-file-2UB5JP3R.js} +6 -6
- package/dist/bundle/{process-U5PLNIDC.js → process-SGHEN6MQ.js} +1 -1
- package/dist/bundle/{program-3JICCSA6.js → program-GVCGZP27.js} +170 -160
- package/dist/bundle/{prompt-YPDMSOKC.js → prompt-HJFMPFVC.js} +6 -6
- package/dist/bundle/public-C2ZB2AGQ.js +198 -0
- package/dist/bundle/{recognize-Z2SSWUKH.js → recognize-2SEI5PPM.js} +5 -5
- package/dist/bundle/{remote-R5HMDHOG.js → remote-2DMS74XE.js} +11 -11
- package/dist/bundle/{rerank-6NGBEMQ2.js → rerank-H6GCYVIA.js} +8 -8
- package/dist/bundle/run-log-QU26SUZP.js +145 -0
- package/dist/bundle/{serve-CU3RMWU7.js → serve-ODVRPFJO.js} +11 -11
- package/dist/bundle/server-NBPF6IDZ.js +95 -0
- package/dist/bundle/{server-SOQSVX2Q.js → server-PCLIO24L.js} +82 -69
- package/dist/bundle/{services-LROZ3RDT.js → services-4QAPXBLO.js} +60 -54
- package/dist/bundle/{speech-AS77HFIF.js → speech-MA6ZT3WE.js} +28 -28
- package/dist/bundle/{sqlite-runtime-U25NS6BK.js → sqlite-runtime-PVMAUXRN.js} +7 -7
- package/dist/bundle/{state-CPEVKK66.js → state-QFMTYUME.js} +7 -7
- package/dist/bundle/{store-6CHRMJM7.js → store-25OTAQC3.js} +31 -24
- package/dist/bundle/{store-QKHCZOYR.js → store-F724QIKJ.js} +34 -26
- package/dist/bundle/store-connection-OGPXANGB.js +111 -0
- package/dist/bundle/store-maintenance-command-2CM7LLNQ.js +83 -0
- package/dist/bundle/{streaming-VDJOYGMO.js → streaming-S22C4DG5.js} +7 -7
- package/dist/bundle/surface-7PXHWCF6.js +81 -0
- package/dist/bundle/{tokens-JBN2OHQB.js → tokens-NLUHA2DW.js} +11 -10
- package/dist/bundle/zm.js +9 -9
- package/dist/bundle/{zoom-app-Q4IKYNG3.js → zoom-app-YWFB367P.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/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-7PYXHK2I.js +0 -122
- package/dist/bundle/chunk-3BTRJYIT.js +0 -729
- package/dist/bundle/chunk-M4LAF627.js +0 -719
- package/dist/bundle/command-contract-CT6MV6YG.js +0 -45
- package/dist/bundle/config-ZFQFDEVL.js +0 -109
- package/dist/bundle/first-run-K6EHRAIM.js +0 -29
- package/dist/bundle/first-screen-C6AF4KT4.js +0 -45
- package/dist/bundle/meeting-combined-3OKFXZNA.js +0 -26
- package/dist/bundle/meeting-model-4XNF725D.js +0 -26
- package/dist/bundle/oauth-KOONTGLW.js +0 -20
- package/dist/bundle/openai-6Y2JRDNY.js +0 -28
- package/dist/bundle/run-log-LG3TI3WI.js +0 -136
- package/dist/bundle/server-X7JYRMKX.js +0 -85
- package/dist/bundle/store-connection-FCDVOPWB.js +0 -102
- package/dist/bundle/store-maintenance-command-6HVOAHOZ.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-BDKVOU3I.js";
|
|
10
6
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./chunk-
|
|
7
|
+
lentConnection
|
|
8
|
+
} from "./chunk-EGTCQKHV.js";
|
|
13
9
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from "./chunk-3BTRJYIT.js";
|
|
10
|
+
QUERY_ARGUMENT
|
|
11
|
+
} from "./chunk-GBHMT2IU.js";
|
|
17
12
|
import {
|
|
18
|
-
QUERY_ARGUMENT,
|
|
19
|
-
onlineDeps,
|
|
20
|
-
servicesFor,
|
|
21
|
-
storeModeDeps
|
|
22
|
-
} from "./chunk-RFXJLG5V.js";
|
|
23
|
-
import {
|
|
24
|
-
failureContext
|
|
25
|
-
} from "./chunk-UX4JZMA4.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-SUG6YGAF.js";
|
|
14
|
+
flatten
|
|
15
|
+
} from "./chunk-V5EJSF2B.js";
|
|
41
16
|
import {
|
|
42
|
-
currentCaller
|
|
43
|
-
|
|
44
|
-
runContextOf,
|
|
45
|
-
withCaller
|
|
46
|
-
} from "./chunk-FSLR2YGR.js";
|
|
17
|
+
currentCaller
|
|
18
|
+
} from "./chunk-T7IAWEBU.js";
|
|
47
19
|
import {
|
|
48
20
|
authorityAllowed,
|
|
49
|
-
botApiAllowed
|
|
50
|
-
|
|
51
|
-
keyForCommand,
|
|
52
|
-
levelFor,
|
|
53
|
-
readKeysForCommand
|
|
54
|
-
} from "./chunk-DYRISFHZ.js";
|
|
55
|
-
import {
|
|
56
|
-
MAX_BUFFERED_INPUT
|
|
57
|
-
} from "./chunk-6CDMGT6Q.js";
|
|
21
|
+
botApiAllowed
|
|
22
|
+
} from "./chunk-KJ6USQDZ.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-6I4C4ZFT.js";
|
|
28
|
+
} from "./chunk-WMANRJR5.js";
|
|
67
29
|
import {
|
|
68
30
|
queryDescription
|
|
69
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-UAWSINMC.js";
|
|
70
32
|
import {
|
|
71
|
-
captureStreams
|
|
72
|
-
|
|
73
|
-
} from "./chunk-BNEJKGG7.js";
|
|
33
|
+
captureStreams
|
|
34
|
+
} from "./chunk-6CWL5BKG.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-ESN3W2MZ.js";
|
|
113
64
|
import {
|
|
114
|
-
CliError
|
|
115
|
-
|
|
116
|
-
} from "./chunk-ST3ZB7LS.js";
|
|
65
|
+
CliError
|
|
66
|
+
} from "./chunk-IANKXHSE.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@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/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@1.0.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@1.0.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",
|
|
@@ -369,15 +328,36 @@ var FAMILY_SINCE_0_98 = [
|
|
|
369
328
|
review(ENTITY, "entity lead", "b24's CRM lead and memo's differ (measured 2026-11-13)"),
|
|
370
329
|
review(ENTITY, "entity product", "b24's CRM product and memo's differ (measured 2026-11-13)"),
|
|
371
330
|
review(REASON, "reason ai.address-refused=model.address-refused", "one failure under two names; cli-core 0.650.0 keeps one"),
|
|
372
|
-
review(REASON, "reason profile.unknown: code", "b24 gives it not_found, drive validation_error (measured 2026-11-13)")
|
|
331
|
+
review(REASON, "reason profile.unknown: code", "b24 gives it not_found, drive validation_error (measured 2026-11-13)"),
|
|
332
|
+
{
|
|
333
|
+
rule: REASON,
|
|
334
|
+
target: "reason account-remove.unknown-profile=account-rename.unknown-profile",
|
|
335
|
+
reason: "one failure under two names in cli-core 0.715\u20130.716; 0.717.0 gives account rename profile.unknown",
|
|
336
|
+
review_after: "2026-12-10"
|
|
337
|
+
}
|
|
373
338
|
];
|
|
339
|
+
var CONFIG_UNREADABLE_RENAME = [
|
|
340
|
+
"account-rename.config=config.unreadable=mail.config-unreadable",
|
|
341
|
+
"account-rename.config=config.unreadable",
|
|
342
|
+
"config.unreadable=mail.config-unreadable"
|
|
343
|
+
].map((ids) => ({
|
|
344
|
+
rule: REASON,
|
|
345
|
+
target: `reason ${ids}`,
|
|
346
|
+
reason: "one failure under several names while the CLIs move to cli-core 1.0, which names it config.unreadable",
|
|
347
|
+
review_after: "2026-12-09"
|
|
348
|
+
}));
|
|
374
349
|
var PARITY_GROUPS = defineParityGroups([
|
|
375
|
-
{
|
|
350
|
+
{
|
|
351
|
+
name: "messengers",
|
|
352
|
+
members: ["tg", "max"],
|
|
353
|
+
covers: "tree",
|
|
354
|
+
differences: [...MESSENGERS_SINCE_0_98, ...CONFIG_UNREADABLE_RENAME]
|
|
355
|
+
},
|
|
376
356
|
{
|
|
377
357
|
name: "all",
|
|
378
358
|
members: ["tg", "max", "memo", "drive", "zm", "wa"],
|
|
379
359
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade", "search", "notes", "meetings"],
|
|
380
|
-
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
|
|
360
|
+
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
|
|
381
361
|
},
|
|
382
362
|
// mail's `search messages` is cli-core's mail search, not the messengers' command: --complete took their 20-odd
|
|
383
363
|
// differences as inherited (https://github.com/WireCatLabs/cli-base/issues/390). mail is compared everywhere else
|
|
@@ -386,7 +366,7 @@ var PARITY_GROUPS = defineParityGroups([
|
|
|
386
366
|
name: "mail-shared",
|
|
387
367
|
members: ["tg", "max", "memo", "drive", "zm", "wa", "mail"],
|
|
388
368
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade", "notes", "meetings"],
|
|
389
|
-
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
|
|
369
|
+
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
|
|
390
370
|
},
|
|
391
371
|
// gcal is compared on what it already shares with every CLI; doctor, mcp, search and skill wait until the published
|
|
392
372
|
// CLIs agree there (https://github.com/WireCatLabs/cli-base/issues/390), then gcal moves back into "all".
|
|
@@ -398,28 +378,60 @@ var PARITY_GROUPS = defineParityGroups([
|
|
|
398
378
|
},
|
|
399
379
|
// bitrix24-cli's search is cli-core's CRM `search all`, and beeline-cli's and asterisk-cli's meetings take call
|
|
400
380
|
// 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
|
-
//
|
|
381
|
+
// amo-cli, hubspot-cli and attio-cli share them too, and their CRM commands are compared with b24 in `crm` below.
|
|
382
|
+
// wordpress-cli shares only these roots: it is the first content CLI, so its posts commands have no group yet.
|
|
383
|
+
// linear-cli shares only these roots too: it is the first tracker CLI, so its issues commands have no group yet.
|
|
384
|
+
// notion-cli joins here until its documents commands ship; then it moves next to drive. ydisk joins here too: in "all"
|
|
385
|
+
// its search and notes differ from the messengers' and memo's as drive's do, and a documents group of drive, notion
|
|
386
|
+
// and ydisk differs in 39 paths (session, folders browse, summaries; measured on the published CLIs 2026-11-17).
|
|
403
387
|
{
|
|
404
388
|
name: "shared-roots",
|
|
405
|
-
members: [
|
|
389
|
+
members: [
|
|
390
|
+
"tg",
|
|
391
|
+
"max",
|
|
392
|
+
"memo",
|
|
393
|
+
"drive",
|
|
394
|
+
"zm",
|
|
395
|
+
"wa",
|
|
396
|
+
"b24",
|
|
397
|
+
"beeline",
|
|
398
|
+
"pbx",
|
|
399
|
+
"notion",
|
|
400
|
+
"amo",
|
|
401
|
+
"hubspot",
|
|
402
|
+
"attio",
|
|
403
|
+
"ydisk",
|
|
404
|
+
"wordpress",
|
|
405
|
+
"linear"
|
|
406
|
+
],
|
|
406
407
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade"],
|
|
407
|
-
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
|
|
408
|
+
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
|
|
408
409
|
},
|
|
409
|
-
// The CRM CLIs on cli-core's shared CRM commands.
|
|
410
|
-
// skips it, as beeline. Only b24
|
|
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.
|
|
410
|
+
// The CRM CLIs on cli-core's shared CRM commands. hubspot-cli is not in the family packages, so `audit --family`
|
|
411
|
+
// skips it, as beeline. Only b24 and hubspot have `leads` (amoCRM
|
|
412
|
+
// has no lead apart from a deal), only b24 has `products` (amo leaves them for later) and `deals delete` (amoCRM's
|
|
413
|
+
// API v4 cannot delete a lead, https://www.amocrm.ru/developers/content/crm_platform/leads-api), and hubspot writes
|
|
414
|
+
// no deals yet; a list of roots does not compare presence, so these need no difference. `people`, `organizations`,
|
|
415
|
+
// `users`, `api` and `session` join once b24's released tree is on cli-core's shared people and organizations
|
|
416
|
+
// commands: measured against b24 0.23.0 on 2026-11-16 they differ in options, outputs and summaries.
|
|
416
417
|
{
|
|
417
418
|
name: "crm",
|
|
418
|
-
members: ["b24", "amo"],
|
|
419
|
+
members: ["b24", "amo", "hubspot", "attio"],
|
|
419
420
|
covers: ["deals", "sync", "search", "store", "schedule", "account"],
|
|
420
|
-
differences: [
|
|
421
|
+
differences: [
|
|
422
|
+
{
|
|
423
|
+
rule: "same-path-contract",
|
|
424
|
+
target: "schedule: summary",
|
|
425
|
+
differs: "hubspot",
|
|
426
|
+
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",
|
|
427
|
+
review_after: "2026-12-01"
|
|
428
|
+
}
|
|
429
|
+
]
|
|
421
430
|
}
|
|
422
431
|
]);
|
|
432
|
+
var SHARED_DIFFERENCES = [
|
|
433
|
+
...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()
|
|
434
|
+
];
|
|
423
435
|
var requiredRootSchema = strictObject({ path: pipe(array(segment), minLength(1)), meaning: text });
|
|
424
436
|
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
437
|
var REQUIRED_ROOTS = defineRequiredRoots([
|
|
@@ -431,7 +443,7 @@ var REQUIRED_ROOTS = defineRequiredRoots([
|
|
|
431
443
|
{ path: ["upgrade"], meaning: "updates the CLI" }
|
|
432
444
|
]);
|
|
433
445
|
|
|
434
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
446
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
447
|
var fieldRuleSchema = strictObject({ id: word, rule: text });
|
|
436
448
|
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
449
|
var FIELD_RULES = defineFieldRules([
|
|
@@ -447,7 +459,7 @@ var FIELD_RULES = defineFieldRules([
|
|
|
447
459
|
}
|
|
448
460
|
]);
|
|
449
461
|
|
|
450
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
462
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
463
|
var key = pipe(string(), regex(SNAKE_CASE, "a snake_case key"));
|
|
452
464
|
var identifierSchema = strictObject({ key, meaning: text, replaces: optional(array(key)) });
|
|
453
465
|
var defineIdentifiers = /* @__PURE__ */ __name((input) => parseRegistry("identifiers", array(identifierSchema), input, (identifiers) => {
|
|
@@ -469,7 +481,7 @@ var IDENTIFIERS = defineIdentifiers([
|
|
|
469
481
|
{ key: "trace_id", meaning: "the distributed trace a run belongs to, from `traceparent`" }
|
|
470
482
|
]);
|
|
471
483
|
|
|
472
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
484
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
485
|
var ACCOUNT_FLAGS = [
|
|
474
486
|
{
|
|
475
487
|
name: "--client-id",
|
|
@@ -506,7 +518,7 @@ var ACCOUNT_FLAGS = [
|
|
|
506
518
|
{ name: "--hide-phone", role: "output", type: "switch", meaning: "leave the phone number out of the answer" }
|
|
507
519
|
];
|
|
508
520
|
|
|
509
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
521
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
522
|
var CALENDAR_FLAGS = [
|
|
511
523
|
{ name: "--end-time", value: "<time>", role: "value", type: "time", meaning: "when it ends" },
|
|
512
524
|
{
|
|
@@ -594,7 +606,45 @@ var CALENDAR_FLAGS = [
|
|
|
594
606
|
}
|
|
595
607
|
];
|
|
596
608
|
|
|
597
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
609
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
|
|
610
|
+
var CONTENT_FLAGS = [
|
|
611
|
+
{ name: "--slug", value: "<slug>", role: "value", type: "string", meaning: "the last part of its web address" },
|
|
612
|
+
{
|
|
613
|
+
name: "--tags",
|
|
614
|
+
value: "<ids>",
|
|
615
|
+
role: "value",
|
|
616
|
+
type: "list",
|
|
617
|
+
meaning: "its tags and categories, by comma-separated ids; replaces the ones it has"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
name: "--replace-body",
|
|
621
|
+
role: "mode",
|
|
622
|
+
type: "switch",
|
|
623
|
+
meaning: "write the new text over a body the tool cannot fully read back, losing what it could not show"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
name: "--from-template",
|
|
627
|
+
value: "<template>",
|
|
628
|
+
role: "value",
|
|
629
|
+
type: "string",
|
|
630
|
+
meaning: "start the new page from one of the source's page templates, by name or id; not a message --template"
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
name: "--cover",
|
|
634
|
+
value: "<link>",
|
|
635
|
+
role: "value",
|
|
636
|
+
type: "string",
|
|
637
|
+
meaning: "the page's cover image, by an https link, or none to take it away; a local image file is --photo"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
name: "--allow-deleting-content",
|
|
641
|
+
role: "mode",
|
|
642
|
+
type: "switch",
|
|
643
|
+
meaning: "let an update delete the child pages and databases its new text leaves out; the source keeps them in its trash, unlike --allow-delete"
|
|
644
|
+
}
|
|
645
|
+
];
|
|
646
|
+
|
|
647
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
648
|
var CRM_FLAGS = [
|
|
599
649
|
{
|
|
600
650
|
name: "--email",
|
|
@@ -758,7 +808,7 @@ var CRM_FLAGS = [
|
|
|
758
808
|
}
|
|
759
809
|
];
|
|
760
810
|
|
|
761
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
811
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
812
|
var HOW_FLAGS = [
|
|
763
813
|
{
|
|
764
814
|
name: "--limit",
|
|
@@ -1138,13 +1188,7 @@ var HOW_FLAGS = [
|
|
|
1138
1188
|
type: "string",
|
|
1139
1189
|
meaning: "a person whose reply counts as an answer; repeat it for more"
|
|
1140
1190
|
},
|
|
1141
|
-
{
|
|
1142
|
-
name: "--browser",
|
|
1143
|
-
value: "<program>",
|
|
1144
|
-
role: "mode",
|
|
1145
|
-
type: "string",
|
|
1146
|
-
meaning: "the browser program to open for sign-in"
|
|
1147
|
-
},
|
|
1191
|
+
{ name: "--browser", value: "<program>", role: "mode", type: "string", meaning: "the browser to open for sign-in" },
|
|
1148
1192
|
{
|
|
1149
1193
|
name: "--credential-storage",
|
|
1150
1194
|
value: "<storage>",
|
|
@@ -1153,6 +1197,8 @@ var HOW_FLAGS = [
|
|
|
1153
1197
|
meaning: "where a sign-in is kept: keyring, which falls back to a private file by itself, or file (WC-SECR-4)"
|
|
1154
1198
|
},
|
|
1155
1199
|
{ name: "--checkpoint", value: "<file>", role: "mode", type: "path", meaning: "keep resume progress in this file" },
|
|
1200
|
+
{ name: "--site", value: "<address>", role: "mode", type: "string", meaning: "the owner's site a sign-in is for" },
|
|
1201
|
+
{ name: "--login", value: "<name>", role: "mode", type: "string", meaning: "the user name a password is for" },
|
|
1156
1202
|
{
|
|
1157
1203
|
name: "--expected-event-id",
|
|
1158
1204
|
value: "<id>",
|
|
@@ -1755,7 +1801,7 @@ var HOW_FLAGS = [
|
|
|
1755
1801
|
}
|
|
1756
1802
|
];
|
|
1757
1803
|
|
|
1758
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1804
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
1805
|
var KNOWLEDGE_FLAGS = [
|
|
1760
1806
|
{
|
|
1761
1807
|
name: "--accept-terms",
|
|
@@ -1791,6 +1837,13 @@ var KNOWLEDGE_FLAGS = [
|
|
|
1791
1837
|
meaning: "at most this many characters read",
|
|
1792
1838
|
unit: "characters"
|
|
1793
1839
|
},
|
|
1840
|
+
{
|
|
1841
|
+
name: "--tab",
|
|
1842
|
+
value: "<id>",
|
|
1843
|
+
role: "target",
|
|
1844
|
+
type: "id",
|
|
1845
|
+
meaning: "one tab of a document, by its id: only its text is read"
|
|
1846
|
+
},
|
|
1794
1847
|
{
|
|
1795
1848
|
name: "--tag",
|
|
1796
1849
|
value: "<name>",
|
|
@@ -1804,10 +1857,24 @@ var KNOWLEDGE_FLAGS = [
|
|
|
1804
1857
|
role: "target",
|
|
1805
1858
|
type: "string",
|
|
1806
1859
|
meaning: "every stored thing a search with this query finds, in its query language; the command acts on each"
|
|
1860
|
+
},
|
|
1861
|
+
{
|
|
1862
|
+
name: "--since",
|
|
1863
|
+
value: "<time>",
|
|
1864
|
+
role: "target",
|
|
1865
|
+
type: "time",
|
|
1866
|
+
meaning: "from this time on: a time, or a duration ago such as 1d"
|
|
1867
|
+
},
|
|
1868
|
+
{
|
|
1869
|
+
name: "--event",
|
|
1870
|
+
value: "<events>",
|
|
1871
|
+
role: "target",
|
|
1872
|
+
type: "list",
|
|
1873
|
+
meaning: "only these kinds of event, comma separated; the command lists them"
|
|
1807
1874
|
}
|
|
1808
1875
|
];
|
|
1809
1876
|
|
|
1810
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1877
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
1878
|
var MAIL_FLAGS = [
|
|
1812
1879
|
{
|
|
1813
1880
|
name: "--cc",
|
|
@@ -1837,7 +1904,38 @@ var MAIL_FLAGS = [
|
|
|
1837
1904
|
}
|
|
1838
1905
|
];
|
|
1839
1906
|
|
|
1840
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1907
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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-mirror.js
|
|
1908
|
+
var MIRROR_FLAGS = [
|
|
1909
|
+
{
|
|
1910
|
+
name: "--keep",
|
|
1911
|
+
value: "<side>",
|
|
1912
|
+
role: "mode",
|
|
1913
|
+
type: "choice",
|
|
1914
|
+
meaning: "settle a conflict with one side: local, the remote by its own name (disk, drive), or both, the other kept as a conflict copy"
|
|
1915
|
+
},
|
|
1916
|
+
{
|
|
1917
|
+
name: "--allow-deletions",
|
|
1918
|
+
value: "<count>",
|
|
1919
|
+
role: "mode",
|
|
1920
|
+
type: "count",
|
|
1921
|
+
meaning: "let this run delete up to this many files when the mirror's guard stops it; owner only"
|
|
1922
|
+
},
|
|
1923
|
+
{
|
|
1924
|
+
name: "--allow-replacements",
|
|
1925
|
+
value: "<count>",
|
|
1926
|
+
role: "mode",
|
|
1927
|
+
type: "count",
|
|
1928
|
+
meaning: "let this run overwrite up to this many existing files when the mirror's guard stops it; owner only"
|
|
1929
|
+
},
|
|
1930
|
+
{
|
|
1931
|
+
name: "--repin",
|
|
1932
|
+
role: "mode",
|
|
1933
|
+
type: "switch",
|
|
1934
|
+
meaning: "accept that a replaced local or remote folder is the mirror's folder now, and sync it; owner only"
|
|
1935
|
+
}
|
|
1936
|
+
];
|
|
1937
|
+
|
|
1938
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
1939
|
var PRIVACY_FLAGS = [
|
|
1842
1940
|
{
|
|
1843
1941
|
name: "--about-text",
|
|
@@ -1898,7 +1996,7 @@ var PRIVACY_FLAGS = [
|
|
|
1898
1996
|
{ name: "--read-receipts", value: "<on|off>", role: "value", type: "choice", meaning: "send read receipts" }
|
|
1899
1997
|
];
|
|
1900
1998
|
|
|
1901
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1999
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
2000
|
var SCHEDULE_FLAGS = [
|
|
1903
2001
|
{
|
|
1904
2002
|
name: "--locale",
|
|
@@ -1931,7 +2029,18 @@ var SCHEDULE_FLAGS = [
|
|
|
1931
2029
|
}
|
|
1932
2030
|
];
|
|
1933
2031
|
|
|
1934
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2032
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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-search.js
|
|
2033
|
+
var SEARCH_FLAGS = [
|
|
2034
|
+
{
|
|
2035
|
+
name: "--like",
|
|
2036
|
+
value: "<text>",
|
|
2037
|
+
role: "query",
|
|
2038
|
+
type: "string",
|
|
2039
|
+
meaning: "a made-up example of the text sought, such as a reply that would answer the question, searched by meaning beside the query"
|
|
2040
|
+
}
|
|
2041
|
+
];
|
|
2042
|
+
|
|
2043
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
2044
|
var WHAT_FLAGS = [
|
|
1936
2045
|
{
|
|
1937
2046
|
name: "--analysis-provider",
|
|
@@ -2343,7 +2452,7 @@ var WHAT_FLAGS = [
|
|
|
2343
2452
|
type: "string",
|
|
2344
2453
|
meaning: "an organization: its id or organization:<id>"
|
|
2345
2454
|
},
|
|
2346
|
-
{ name: "--parent", value: "<id>", role: "target", type: "id", meaning: "the folder or
|
|
2455
|
+
{ name: "--parent", value: "<id>", role: "target", type: "id", meaning: "the folder, task or issue it sits under" },
|
|
2347
2456
|
{
|
|
2348
2457
|
name: "--participant-id",
|
|
2349
2458
|
value: "<id>",
|
|
@@ -2621,7 +2730,6 @@ var WHAT_FLAGS = [
|
|
|
2621
2730
|
type: "choice",
|
|
2622
2731
|
meaning: "how it is closed: done, or dismissed when it needs no answer"
|
|
2623
2732
|
},
|
|
2624
|
-
{ name: "--assignee", value: "<person...>", role: "value", type: "list", meaning: "who does it, by UID" },
|
|
2625
2733
|
{ name: "--at", value: "<hh:mm>", role: "value", type: "string", meaning: "every day at this local time" },
|
|
2626
2734
|
{ name: "--body", value: "<json>", role: "value", type: "string", meaning: "the request body, as JSON" },
|
|
2627
2735
|
{
|
|
@@ -2779,7 +2887,6 @@ var WHAT_FLAGS = [
|
|
|
2779
2887
|
type: "id",
|
|
2780
2888
|
meaning: "pin this chat at the top of it; repeat it for more"
|
|
2781
2889
|
},
|
|
2782
|
-
{ name: "--priority", value: "<n>", role: "value", type: "count", meaning: "0 urgent \u2026 4 low" },
|
|
2783
2890
|
{ name: "--quiz", role: "value", type: "switch", meaning: "a quiz: one answer is right, and a vote is final" },
|
|
2784
2891
|
{
|
|
2785
2892
|
name: "--reason",
|
|
@@ -2928,7 +3035,33 @@ var WHAT_FLAGS = [
|
|
|
2928
3035
|
}
|
|
2929
3036
|
];
|
|
2930
3037
|
|
|
2931
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
3038
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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-work.js
|
|
3039
|
+
var WORK_FLAGS = [
|
|
3040
|
+
{
|
|
3041
|
+
name: "--assignee",
|
|
3042
|
+
value: "<person...>",
|
|
3043
|
+
role: "value",
|
|
3044
|
+
type: "list",
|
|
3045
|
+
otherValues: ["user"],
|
|
3046
|
+
meaning: "who does it: people by UID (<person...>), or one tracker user by id, name or e-mail (<user>)"
|
|
3047
|
+
},
|
|
3048
|
+
{
|
|
3049
|
+
name: "--priority",
|
|
3050
|
+
value: "<n>",
|
|
3051
|
+
role: "value",
|
|
3052
|
+
type: "string",
|
|
3053
|
+
meaning: "how urgent: low, medium, high, critical or none, a score from 0.0 to 1.0, or the old 0 urgent \u2026 4 low"
|
|
3054
|
+
},
|
|
3055
|
+
{
|
|
3056
|
+
name: "--team",
|
|
3057
|
+
value: "<team>",
|
|
3058
|
+
role: "value",
|
|
3059
|
+
type: "string",
|
|
3060
|
+
meaning: "the tracker team that owns an issue, by id, key or name"
|
|
3061
|
+
}
|
|
3062
|
+
];
|
|
3063
|
+
|
|
3064
|
+
// node_modules/.pnpm/@wirecat+cli-base@1.0.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
3065
|
var FLAG_TYPES = [
|
|
2933
3066
|
"switch",
|
|
2934
3067
|
"count",
|
|
@@ -3058,6 +3191,10 @@ var verbs = [
|
|
|
3058
3191
|
["export", "write from the store to a file"],
|
|
3059
3192
|
["import", "bring a file or list the user gives into the store or the messenger, once"],
|
|
3060
3193
|
["download", "save a file from the source to this machine"],
|
|
3194
|
+
["upload", "put a file from this machine on the source"],
|
|
3195
|
+
["publish", "open a thing to anyone who has its public link"],
|
|
3196
|
+
["unpublish", "close a thing's public link"],
|
|
3197
|
+
["stale", "mark a saved memory as out of date, keeping it"],
|
|
3061
3198
|
["transcribe", "turn speech into text"],
|
|
3062
3199
|
["extract", "read the text inside files already on this machine into the store"],
|
|
3063
3200
|
["migrate", "bring a file up to this build's schema"],
|
|
@@ -3082,6 +3219,7 @@ var verbs = [
|
|
|
3082
3219
|
"look at a source before taking anything from it: a chat link without joining, a mailbox without importing"
|
|
3083
3220
|
],
|
|
3084
3221
|
["send", "send a message"],
|
|
3222
|
+
["reply", "answer in a comment thread at the source, under the comment that started it"],
|
|
3085
3223
|
["call", "call one provider API method by its own name, generated from the provider's method list"],
|
|
3086
3224
|
["edit", "change a sent message"],
|
|
3087
3225
|
["forward", "send an existing message on to another chat"],
|
|
@@ -3154,6 +3292,8 @@ var collections = [
|
|
|
3154
3292
|
["messages", "posts in a messenger chat, or emails"],
|
|
3155
3293
|
["drafts", "e-mails saved in a mailbox's Drafts folder, written and not sent"],
|
|
3156
3294
|
["polls", "polls in a chat"],
|
|
3295
|
+
["posts", "posts and pages on a site or blog the owner publishes"],
|
|
3296
|
+
["channels", "the sites and social accounts the owner publishes posts on"],
|
|
3157
3297
|
["reactions", "reactions to a message"],
|
|
3158
3298
|
["recipients", "who a message goes to"],
|
|
3159
3299
|
["replies", "the automatic replies of a profile"],
|
|
@@ -3200,6 +3340,11 @@ var collections = [
|
|
|
3200
3340
|
["transactions", "money that moved in or out of a wallet, as the bank or the owner recorded it"],
|
|
3201
3341
|
["splits", "parts of one transaction, each with its own amount and category"],
|
|
3202
3342
|
["users", "people who work in the owner's account at a service, such as a CRM's employees"],
|
|
3343
|
+
["issues", "work items in an issue tracker, each in a team, a workflow state and maybe a project"],
|
|
3344
|
+
["teams", "groups in a tracker that own issues, states and labels"],
|
|
3345
|
+
["states", "the workflow steps a tracker team moves its issues through, each of a type such as started"],
|
|
3346
|
+
["labels", "a tracker's shared labels on issues, kept by the tracker and not by the owner"],
|
|
3347
|
+
["sprints", "a tracker team's time-boxed runs of work, such as Linear's cycles, each with a start and an end"],
|
|
3203
3348
|
["fields", "a record type's field definitions: code, label, type and options, such as a CRM's custom fields"],
|
|
3204
3349
|
["activities", "a CRM's calls, e-mails, meetings, to-dos and comments on its records"],
|
|
3205
3350
|
["changes", "what changed in a copied source over a time: records added, moved, closed or reassigned"],
|
|
@@ -3212,8 +3357,19 @@ var collections = [
|
|
|
3212
3357
|
["relationships", "confirmed or suggested links between people, organizations and projects"],
|
|
3213
3358
|
["roles", "the parts a person plays in a relationship, built in or the owner's own"],
|
|
3214
3359
|
["sheets", "remote spreadsheets and their cell ranges, read or changed through a provider"],
|
|
3360
|
+
[
|
|
3361
|
+
"databases",
|
|
3362
|
+
"a source's databases, such as Notion's, each a set of rows with typed properties; the local store's are tables"
|
|
3363
|
+
],
|
|
3364
|
+
["rows", "the records of a database at the source, each with typed values; an order's or an invoice's are lines"],
|
|
3215
3365
|
["files", "files in the source, such as Google Drive, read and changed there"],
|
|
3216
|
-
["
|
|
3366
|
+
["mirrors", "saved pairings of a local folder and a folder in the source, which sync keeps the same both ways"],
|
|
3367
|
+
[
|
|
3368
|
+
"conflicts",
|
|
3369
|
+
"files a mirror's sync found changed on both sides and could not merge, each waiting for a side or a final file"
|
|
3370
|
+
],
|
|
3371
|
+
["versions", "earlier contents of a file that a write replaced or deleted, kept on this computer to be put back"],
|
|
3372
|
+
["comments", "comments people left on a thing in the source: a channel post, a file or an issue"],
|
|
3217
3373
|
["meetings", "stored meetings, from Zoom or another provider"],
|
|
3218
3374
|
["calls", "phone calls a phone system recorded, stored as meetings with their transcripts"],
|
|
3219
3375
|
["calendars", "calendars of an account, each synced or not"],
|
|
@@ -3268,6 +3424,10 @@ var singulars = [
|
|
|
3268
3424
|
["privacy", "who may find, see, call or add the account"],
|
|
3269
3425
|
["metadata", "a profile's cached source attributes"],
|
|
3270
3426
|
["auth", "the credentials a bot profile uses: its token and the secrets beside it"],
|
|
3427
|
+
[
|
|
3428
|
+
"scheduled",
|
|
3429
|
+
"a chat's messages the messenger will send later; their ids are their own, never the ids of sent messages"
|
|
3430
|
+
],
|
|
3271
3431
|
[
|
|
3272
3432
|
"schedule",
|
|
3273
3433
|
"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,8 +3435,10 @@ var singulars = [
|
|
|
3275
3435
|
];
|
|
3276
3436
|
var views = [
|
|
3277
3437
|
["tree", "the parent and child hierarchy of stored sources"],
|
|
3438
|
+
["stats", "a thing's own numbers, such as a post's views, as read at each sync"],
|
|
3278
3439
|
["logs", "the log of a running process"],
|
|
3279
3440
|
["events", "what happened in a thing over time"],
|
|
3441
|
+
["changes", "what a sync changed in the local copy since a time: added, changed, deleted or no longer visible"],
|
|
3280
3442
|
["scheduled", "what is scheduled to happen"],
|
|
3281
3443
|
["context", "what surrounds one thing"],
|
|
3282
3444
|
["path", "where a thing is on this machine"],
|
|
@@ -3287,6 +3449,8 @@ var views = [
|
|
|
3287
3449
|
["transcript", "the text of speech: a voice message or a meeting recording"],
|
|
3288
3450
|
["evidence", "the stored messages or lines a result or a reference rests on"],
|
|
3289
3451
|
["passage", "a cited transcript line with bounded surrounding lines from the same revision"],
|
|
3452
|
+
["summary", "the summary a service wrote of a meeting, with its sections and next steps"],
|
|
3453
|
+
["people", "the people found across stored meetings by name or email, with the meetings they were in"],
|
|
3290
3454
|
["invitation", "the text that invites people to a meeting: how to join it and when"],
|
|
3291
3455
|
["agenda", "what needs a look today"],
|
|
3292
3456
|
["busy", "when calendars or people are taken, without what takes them"],
|
|
@@ -3347,11 +3511,15 @@ var VOCABULARY = defineVocabulary({
|
|
|
3347
3511
|
...MAIL_FLAGS,
|
|
3348
3512
|
...KNOWLEDGE_FLAGS,
|
|
3349
3513
|
...CRM_FLAGS,
|
|
3350
|
-
...SCHEDULE_FLAGS
|
|
3514
|
+
...SCHEDULE_FLAGS,
|
|
3515
|
+
...CONTENT_FLAGS,
|
|
3516
|
+
...SEARCH_FLAGS,
|
|
3517
|
+
...MIRROR_FLAGS,
|
|
3518
|
+
...WORK_FLAGS
|
|
3351
3519
|
]
|
|
3352
3520
|
});
|
|
3353
3521
|
|
|
3354
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3522
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/mcp/agent.js
|
|
3355
3523
|
var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
|
|
3356
3524
|
var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
|
|
3357
3525
|
var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
|
|
@@ -3522,7 +3690,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3522
3690
|
const { argv, stdin } = argvOf(info, input, ctx.profile, ctx.stdin);
|
|
3523
3691
|
const lend = ctx.connection;
|
|
3524
3692
|
let borrowed;
|
|
3525
|
-
let
|
|
3693
|
+
let answered = false;
|
|
3526
3694
|
let result;
|
|
3527
3695
|
let failure;
|
|
3528
3696
|
const streams = captureStreams();
|
|
@@ -3544,7 +3712,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3544
3712
|
answer: /* @__PURE__ */ __name(() => null, "answer"),
|
|
3545
3713
|
agent: {
|
|
3546
3714
|
result: /* @__PURE__ */ __name((value) => {
|
|
3547
|
-
|
|
3715
|
+
answered = true;
|
|
3548
3716
|
result = value;
|
|
3549
3717
|
}, "result"),
|
|
3550
3718
|
failure: /* @__PURE__ */ __name((object2) => {
|
|
@@ -3566,7 +3734,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3566
3734
|
}));
|
|
3567
3735
|
if (failure)
|
|
3568
3736
|
return { error: failure };
|
|
3569
|
-
if (
|
|
3737
|
+
if (answered)
|
|
3570
3738
|
return { result };
|
|
3571
3739
|
if (code !== 0)
|
|
3572
3740
|
throw new CliError("invalid_response", `the command exited with ${code} and said nothing`);
|
|
@@ -3578,468 +3746,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3578
3746
|
}
|
|
3579
3747
|
}, "runCommandForAgent");
|
|
3580
3748
|
|
|
3581
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_d368e4a5540cfb6719e97dbe530c5868/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.691.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_d368e4a5540cfb6719e97dbe530c5868/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
3749
|
export {
|
|
4026
3750
|
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
|
|
3751
|
+
runCommandForAgent
|
|
4045
3752
|
};
|