@wirecat/drive-cli 0.70.0 → 0.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -70
- package/contracts/wirecat.json +77 -8
- package/dist/bin/drive.js +2 -2
- package/dist/bundle/agent-23OB2NZP.js +46 -0
- package/dist/bundle/{all-profiles-FW3GK3QO.js → all-profiles-GXGDVNQJ.js} +67 -25
- package/dist/bundle/{anthropic-QVKJT3II.js → anthropic-H5C4GQHC.js} +9 -9
- package/dist/bundle/{app-server-QU73RD5R.js → app-server-EQ3UK4C7.js} +97 -79
- package/dist/bundle/{bun-5XCD5CBB.js → bun-DTJVSRY3.js} +2 -2
- package/dist/bundle/{bun-sqlite-TIGSVNSV.js → bun-sqlite-JIFY7MAE.js} +9 -9
- package/dist/bundle/chunk-2Q325BBD.js +353 -0
- package/dist/bundle/chunk-35FIJGTT.js +52 -0
- package/dist/bundle/{chunk-7C5KENNU.js → chunk-3FRQ6V4T.js} +3 -3
- package/dist/bundle/chunk-47L262VI.js +340 -0
- package/dist/bundle/chunk-4HP6KGBI.js +32 -0
- package/dist/bundle/{chunk-GA3URWIF.js → chunk-4HPXWYTE.js} +1 -1
- package/dist/bundle/{chunk-HYXXMSVD.js → chunk-4IUNYYYL.js} +4473 -2685
- package/dist/bundle/{chunk-FYPW7NMH.js → chunk-4JS32SRX.js} +64 -4
- package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
- package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
- package/dist/bundle/{chunk-SONPLYV7.js → chunk-55FH6IEL.js} +5 -5
- package/dist/bundle/{chunk-VVN6GHAZ.js → chunk-5BNMWSU2.js} +659 -255
- package/dist/bundle/{chunk-FVTKFIQH.js → chunk-5H747A76.js} +5496 -3195
- package/dist/bundle/{chunk-PR7XD2DI.js → chunk-5KWCO56H.js} +2 -2
- package/dist/bundle/{chunk-3AHBZP33.js → chunk-5U3NCE5R.js} +35 -12
- package/dist/bundle/{chunk-HRATXUFH.js → chunk-6CCO3JCM.js} +31 -22
- package/dist/bundle/{chunk-RLNZ7NX5.js → chunk-6ZW2ZJYC.js} +2 -2
- package/dist/bundle/{chunk-RQNRYF6D.js → chunk-75DAHQOV.js} +3 -3
- package/dist/bundle/{chunk-7QSRODXM.js → chunk-77OBW43F.js} +6 -6
- package/dist/bundle/{chunk-GV5DGHSA.js → chunk-7EFM6AW3.js} +4 -4
- package/dist/bundle/{chunk-BXPC5TFG.js → chunk-A3S7QM5L.js} +3 -3
- package/dist/bundle/{chunk-IGNIUDI3.js → chunk-AA4LKC6W.js} +251 -565
- package/dist/bundle/chunk-ASTKHB6B.js +3233 -0
- package/dist/bundle/{chunk-3TCMANIM.js → chunk-BM6V7456.js} +8 -227
- package/dist/bundle/chunk-BO6EDBYJ.js +50 -0
- package/dist/bundle/{chunk-F5KJWRF5.js → chunk-BPA3R4KN.js} +2 -100
- package/dist/bundle/chunk-CIFE4KPX.js +2159 -0
- package/dist/bundle/chunk-CKB4XZZJ.js +730 -0
- package/dist/bundle/{chunk-YCL3SK4T.js → chunk-COJTCEZP.js} +113 -860
- package/dist/bundle/{chunk-BD2K2ONK.js → chunk-CWPYDT73.js} +6 -6
- package/dist/bundle/{chunk-6BMTW5A6.js → chunk-D4JNCXS7.js} +9 -9
- package/dist/bundle/chunk-DCPWZIOV.js +696 -0
- package/dist/bundle/{chunk-P7PLKNPX.js → chunk-DHMNCOQI.js} +415 -272
- package/dist/bundle/chunk-DOQMH4DC.js +280 -0
- package/dist/bundle/chunk-DQSOYH6N.js +20 -0
- package/dist/bundle/{chunk-ML3R2UHV.js → chunk-DWRUOLBF.js} +4 -4
- package/dist/bundle/{chunk-5JTB4URG.js → chunk-E3VWZC3K.js} +14 -13
- package/dist/bundle/chunk-ECYOTDJM.js +14 -0
- package/dist/bundle/{chunk-7IBENBCK.js → chunk-EVG3AA5M.js} +2 -2
- package/dist/bundle/chunk-F4BX7TH2.js +15 -0
- package/dist/bundle/{chunk-FCSHWUMW.js → chunk-FBEZSA76.js} +5 -5
- package/dist/bundle/{chunk-RHSBXOQM.js → chunk-FBQJN74J.js} +1 -1
- package/dist/bundle/{chunk-4WK26MPY.js → chunk-FIZOPJYY.js} +1 -1
- package/dist/bundle/chunk-FNAYSZWK.js +783 -0
- package/dist/bundle/{chunk-LINBDWJK.js → chunk-FRCJHGZM.js} +2 -2
- package/dist/bundle/{chunk-RCTOWLCD.js → chunk-FTG5QBSD.js} +41 -33
- package/dist/bundle/{chunk-ABZ2NYDT.js → chunk-FUDUXIVG.js} +1 -1
- package/dist/bundle/{chunk-NYECVHFH.js → chunk-G4NHRFS7.js} +755 -0
- package/dist/bundle/{chunk-PAPY6Q6H.js → chunk-GIEZYBRC.js} +1 -1
- package/dist/bundle/chunk-GTPPUBYU.js +1876 -0
- package/dist/bundle/chunk-GU6ICH53.js +108 -0
- package/dist/bundle/{chunk-REM5WHHQ.js → chunk-GUMKKRE6.js} +107 -71
- package/dist/bundle/{chunk-QBAOIMVB.js → chunk-GWCDOYSC.js} +1 -1
- package/dist/bundle/{chunk-HHAZ6DCY.js → chunk-GXGSC622.js} +69 -7
- package/dist/bundle/chunk-HAGXTGJC.js +188 -0
- package/dist/bundle/{chunk-TNKQDS5A.js → chunk-IMAWQC5K.js} +6 -6
- package/dist/bundle/{chunk-ZHZYGY5R.js → chunk-IVGVVSPW.js} +4 -4
- package/dist/bundle/{chunk-EDO5LZVF.js → chunk-J4NUHSM7.js} +1 -1
- package/dist/bundle/{chunk-DVVUJ254.js → chunk-K652FYCO.js} +6 -6
- package/dist/bundle/chunk-K6ZWNTXY.js +561 -0
- package/dist/bundle/{chunk-FONIFRYI.js → chunk-KF3ZBQJV.js} +4 -4
- package/dist/bundle/chunk-KFZCHJRT.js +80 -0
- package/dist/bundle/chunk-KLPFDFLI.js +221 -0
- package/dist/bundle/{chunk-LMJBQFW6.js → chunk-KP2XMCNT.js} +13 -13
- package/dist/bundle/{chunk-FADAOLGB.js → chunk-KWDZ3KVH.js} +4 -4
- package/dist/bundle/{chunk-MXNQZAJQ.js → chunk-KX4C32WD.js} +2 -2
- package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
- package/dist/bundle/{chunk-ILAQIBEO.js → chunk-M2ZWYVWO.js} +1 -1
- package/dist/bundle/chunk-MEYYH47C.js +25 -0
- package/dist/bundle/{chunk-ZCXWV4XO.js → chunk-ML2QIWX2.js} +4 -4
- package/dist/bundle/{chunk-XOL346TJ.js → chunk-MUFF2YTH.js} +2 -2
- package/dist/bundle/{chunk-GAHIHE4K.js → chunk-N24YSLED.js} +9166 -9751
- package/dist/bundle/chunk-N4GTCPML.js +7 -0
- package/dist/bundle/{chunk-DVI72ZQG.js → chunk-NBMGDRP4.js} +1 -1
- package/dist/bundle/chunk-NMQRSEZM.js +37 -0
- package/dist/bundle/{chunk-I7YSHUPW.js → chunk-NNGA4QDR.js} +13 -26
- package/dist/bundle/{chunk-5DPV7X27.js → chunk-NTZWY5R3.js} +321 -0
- package/dist/bundle/chunk-O7CZZ36M.js +80 -0
- package/dist/bundle/{chunk-HWUPU6WX.js → chunk-OAONP6KI.js} +13 -9
- package/dist/bundle/{chunk-3CHW7JGR.js → chunk-OESP4PHB.js} +17 -17
- package/dist/bundle/chunk-OHR6IZNH.js +116 -0
- package/dist/bundle/{chunk-54NDYVZA.js → chunk-OLCU7Q2B.js} +1 -1
- package/dist/bundle/{chunk-FN3RXBO7.js → chunk-OLDQLEPA.js} +6 -6
- package/dist/bundle/{chunk-7DJNURKV.js → chunk-OPIPG6AP.js} +16 -9
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/chunk-PRYMT3OG.js +30 -0
- package/dist/bundle/chunk-QDUIVMEW.js +36 -0
- package/dist/bundle/{chunk-66PL7P4C.js → chunk-QKBPCX7Y.js} +1 -1
- package/dist/bundle/{chunk-PN4JYURZ.js → chunk-QSLOACDT.js} +201 -423
- package/dist/bundle/{chunk-3UWRAIWA.js → chunk-QUZFDU4K.js} +4 -4
- package/dist/bundle/{chunk-KSJAFMU5.js → chunk-R32DHS6J.js} +211 -380
- package/dist/bundle/{chunk-2SBC4DVV.js → chunk-R57QUYBG.js} +6 -28
- package/dist/bundle/{chunk-IFTX7AQU.js → chunk-R64OSDOD.js} +45 -66
- package/dist/bundle/{chunk-WJK6KTCS.js → chunk-RSPBVKOC.js} +8 -8
- package/dist/bundle/{chunk-GPDPEHYX.js → chunk-SPNPJ3FZ.js} +3 -4
- package/dist/bundle/chunk-SQHDSIFL.js +388 -0
- package/dist/bundle/{chunk-XZBA6FVH.js → chunk-ST35FIUG.js} +3 -3
- package/dist/bundle/{chunk-37MAA6F2.js → chunk-STUPCKAA.js} +11 -2221
- package/dist/bundle/chunk-SZ7XJZGH.js +2231 -0
- package/dist/bundle/chunk-TRYYWV7J.js +291 -0
- package/dist/bundle/{chunk-OY7TNUEC.js → chunk-TTPWKTVR.js} +1 -1
- package/dist/bundle/{chunk-3UZ4OH22.js → chunk-U7VEJ3CW.js} +49 -129
- package/dist/bundle/{chunk-6Y2BYFXQ.js → chunk-UC7JLE6J.js} +0 -7
- package/dist/bundle/{chunk-HK225DAG.js → chunk-UIQ35CA5.js} +1 -1
- package/dist/bundle/{chunk-GK3BJMGK.js → chunk-UJY26HW4.js} +1 -1
- package/dist/bundle/{chunk-EG62WVR2.js → chunk-UWG3PRY7.js} +9 -60
- package/dist/bundle/{chunk-BBRMDMIR.js → chunk-VAR3MJU6.js} +3 -3
- package/dist/bundle/{chunk-GJZSVSV3.js → chunk-VPQSI5IU.js} +4 -4
- package/dist/bundle/{chunk-YZPE72GE.js → chunk-VQPT3Y7W.js} +12 -12
- package/dist/bundle/{chunk-T5D4OGDC.js → chunk-WMG3H2VK.js} +2 -2
- package/dist/bundle/{chunk-6DPOWBKA.js → chunk-X5BGAZC5.js} +6 -6
- package/dist/bundle/{chunk-DHX27E5M.js → chunk-XC6TRWLZ.js} +3 -3
- package/dist/bundle/{chunk-Q5C6YKAY.js → chunk-XQZEMRCU.js} +402 -402
- package/dist/bundle/{chunk-54BQWRJL.js → chunk-XZ7MO6EU.js} +7 -7
- package/dist/bundle/{chunk-TGS5VPJD.js → chunk-YAIOEPKU.js} +341 -433
- package/dist/bundle/chunk-YHWFF6DN.js +39 -0
- package/dist/bundle/{chunk-WWE5GO6G.js → chunk-YWOLQEDV.js} +16 -3
- package/dist/bundle/{chunk-DR57KDAY.js → chunk-ZFDSJ5YJ.js} +38 -8
- package/dist/bundle/{chunk-BBFXQPKD.js → chunk-ZFUZEFU6.js} +3 -3
- package/dist/bundle/{chunk-YRUR3E3E.js → chunk-ZJKXSMXK.js} +72 -59
- package/dist/bundle/{chunk-BFKFKDPC.js → chunk-ZKWT6HXT.js} +1 -1
- package/dist/bundle/chunk-ZPUY3COZ.js +250 -0
- package/dist/bundle/{cli-K4D4DIGQ.js → cli-2P5FW2RL.js} +201 -98
- package/dist/bundle/command-contract-BMQT2G5X.js +45 -0
- package/dist/bundle/{command-server-entry-WREK3QBB.js → command-server-entry-KP2UDGLA.js} +36 -34
- package/dist/bundle/{decode-SEETPKBH.js → decode-K2JZ5D6V.js} +10 -10
- package/dist/bundle/{dispatch-SQCEURVK.js → dispatch-KOQZA74A.js} +10 -10
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/drive.js +11 -11
- package/dist/bundle/{echarts-WZ5RKFCX.js → echarts-URO3QGCG.js} +2 -2
- package/dist/bundle/{embed-B2UCRZZR.js → embed-JLIPWTNN.js} +10 -10
- package/dist/bundle/{embedder-4R6Z7G7L.js → embedder-LUTDO3HS.js} +15 -15
- package/dist/bundle/entry-AVF6LMG7.js +25 -0
- package/dist/bundle/{failure-CYNXH3RQ.js → failure-GJMQLM7O.js} +4 -4
- package/dist/bundle/first-run-VYTIEUDA.js +31 -0
- package/dist/bundle/first-screen-QVZPF7KL.js +45 -0
- package/dist/bundle/google-VX7IPACN.js +46 -0
- package/dist/bundle/{google-api-SAND2F7L.js → google-api-RFXKRLL4.js} +88 -73
- package/dist/bundle/grants-4XWJFVD6.js +133 -0
- package/dist/bundle/hast-util-from-html-X2DCPS3T.js +10531 -0
- package/dist/bundle/hast-util-to-html-VP6XLPKJ.js +998 -0
- package/dist/bundle/hast-util-to-mdast-IZ5PRX72.js +2272 -0
- package/dist/bundle/{identity-JVVGS4U6.js → identity-FXPB5EMT.js} +7 -6
- package/dist/bundle/{instructions-JSMTSB22.js → instructions-IROIUVZI.js} +1 -1
- package/dist/bundle/{login-6WG3YBDU.js → login-WIY5VQU7.js} +96 -81
- package/dist/bundle/{mcp-VFIOZDVY.js → mcp-NJIOKW3E.js} +2 -2
- package/dist/bundle/{mdast-util-from-markdown-FXEPSNER.js → mdast-util-from-markdown-HEZF7KJ4.js} +137 -195
- package/dist/bundle/mdast-util-gfm-AQW6R6MG.js +925 -0
- package/dist/bundle/mdast-util-to-hast-DF2QVIRV.js +879 -0
- package/dist/bundle/mdast-util-to-markdown-XYLXB3Z3.js +18 -0
- package/dist/bundle/meeting-combined-JUNV35GM.js +28 -0
- package/dist/bundle/meeting-model-XY4UNWWK.js +29 -0
- package/dist/bundle/{meeting-semantic-5U7JQCFF.js → meeting-semantic-62QNQMOM.js} +10 -10
- package/dist/bundle/{micromark-extension-gfm-GRL24TU6.js → micromark-extension-gfm-OE2GBORZ.js} +11 -78
- package/dist/bundle/{node-VJMVHOWD.js → node-IACCI2CW.js} +2 -2
- package/dist/bundle/{node-sqlite-DCNT3HVE.js → node-sqlite-WYIRC7C7.js} +10 -10
- package/dist/bundle/notes-search-DEDUJKSN.js +70 -0
- package/dist/bundle/oauth-HXBXF4VI.js +22 -0
- package/dist/bundle/{open-NFOEHVW7.js → open-H32B6BCT.js} +8 -8
- package/dist/bundle/{openai-D47WY7EC.js → openai-VHMPJJUG.js} +22 -21
- package/dist/bundle/{process-Q2FRU5VA.js → process-RNHPF5OK.js} +1 -1
- package/dist/bundle/{program-T2AJJQEM.js → program-GYMJ3DDH.js} +276 -1132
- package/dist/bundle/{prompt-YJSDABXN.js → prompt-TOG2CRCE.js} +8 -8
- package/dist/bundle/{reasons-WEHPCSJX.js → reasons-TLFQ45YX.js} +6 -5
- package/dist/bundle/{recognize-6OBEIEB3.js → recognize-GYGY45EY.js} +7 -7
- package/dist/bundle/remote-6XN2QLI5.js +35 -0
- package/dist/bundle/{rerank-L6F5SLIB.js → rerank-HJO3O4TW.js} +11 -11
- package/dist/bundle/{serve-GYSWIWH4.js → serve-XPCNLHCR.js} +19 -19
- package/dist/bundle/server-UBJZ66XE.js +97 -0
- package/dist/bundle/{server-GWWP3RIT.js → server-WPT3NC5B.js} +89 -70
- package/dist/bundle/{services-BDQBRXT5.js → services-253KKKVU.js} +109 -89
- package/dist/bundle/{sqlite-runtime-ZSZGAUYB.js → sqlite-runtime-EZASGJXW.js} +9 -9
- package/dist/bundle/{start-BJ275RUK.js → start-UHI35JFL.js} +7 -7
- package/dist/bundle/{state-HLNGFI2T.js → state-KJTSPFGK.js} +9 -9
- package/dist/bundle/{store-I43KZNJW.js → store-62J2H2A3.js} +36 -25
- package/dist/bundle/{store-OSRTGYGI.js → store-G5B7T7M7.js} +38 -23
- package/dist/bundle/store-maintenance-command-C6T4YLVF.js +85 -0
- package/dist/bundle/surface-3OT64BHS.js +83 -0
- package/dist/bundle/tokens-EHYO6D2X.js +133 -0
- package/dist/commands/documents.d.ts.map +1 -1
- package/dist/commands/documents.js +11 -1
- package/dist/commands/documents.js.map +1 -1
- package/dist/commands/remote.d.ts.map +1 -1
- package/dist/commands/remote.js +8 -22
- package/dist/commands/remote.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +14 -4
- package/dist/commands/sync.js.map +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +7 -1
- package/dist/config.js.map +1 -1
- package/dist/first-screen.d.ts.map +1 -1
- package/dist/first-screen.js +2 -1
- package/dist/first-screen.js.map +1 -1
- package/dist/generated/manifest.d.ts +2 -1
- package/dist/generated/manifest.d.ts.map +1 -1
- package/dist/generated/manifest.js +782 -0
- package/dist/generated/manifest.js.map +1 -1
- package/dist/generated/types.d.ts +262 -58
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/google.d.ts.map +1 -1
- package/dist/google.js +5 -5
- package/dist/google.js.map +1 -1
- package/dist/model.d.ts +5 -2
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js.map +1 -1
- package/dist/policy-keys.js +1 -1
- package/dist/policy-keys.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +9 -4
- package/dist/program.js.map +1 -1
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +6 -1
- package/dist/state.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +2 -7
- package/dist/store.js.map +1 -1
- package/dist/supported.d.ts +2 -2
- package/dist/supported.d.ts.map +1 -1
- package/dist/supported.js +2 -3
- package/dist/supported.js.map +1 -1
- package/dist/sync.d.ts +2 -1
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +6 -4
- package/dist/sync.js.map +1 -1
- package/dist/transcripts.d.ts +0 -6
- package/dist/transcripts.d.ts.map +1 -1
- package/dist/transcripts.js +0 -13
- package/dist/transcripts.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/scenarios/find-decision.md +1 -1
- package/skills/drive-cli/SKILL.md +4 -2
- package/dist/bundle/chunk-AV5UKJZM.js +0 -729
- package/dist/bundle/chunk-NP7LJATI.js +0 -598
- package/dist/bundle/chunk-P77FL6RY.js +0 -896
- package/dist/bundle/chunk-ZI3YTXSF.js +0 -2
- package/dist/bundle/command-contract-V3F452QI.js +0 -43
- package/dist/bundle/entry-ORZYRJ5N.js +0 -25
- package/dist/bundle/first-run-KAKA6KBY.js +0 -31
- package/dist/bundle/first-screen-R645UHRH.js +0 -41
- package/dist/bundle/google-BSO3YB7N.js +0 -45
- package/dist/bundle/grants-PLNFYARD.js +0 -118
- package/dist/bundle/mdast-util-gfm-SZM5GBDF.js +0 -2103
- package/dist/bundle/meeting-combined-SUKMFK3F.js +0 -27
- package/dist/bundle/meeting-model-S4YGKIFI.js +0 -29
- package/dist/bundle/oauth-KCMNQ3ZP.js +0 -22
- package/dist/bundle/remote-3SL2QJ7T.js +0 -35
- package/dist/bundle/server-BI46BSRE.js +0 -80
- package/dist/bundle/store-maintenance-command-FO7LEVSL.js +0 -72
- package/dist/bundle/tokens-DB7O7QNB.js +0 -118
|
@@ -1,78 +1,38 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
agentArguments,
|
|
7
|
-
agentJson,
|
|
8
|
-
commandAvailability,
|
|
9
|
-
failureContext
|
|
10
|
-
} from "./chunk-KSJAFMU5.js";
|
|
4
|
+
commandAvailability
|
|
5
|
+
} from "./chunk-BO6EDBYJ.js";
|
|
11
6
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
7
|
+
lentConnection
|
|
8
|
+
} from "./chunk-47L262VI.js";
|
|
14
9
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./chunk-AV5UKJZM.js";
|
|
10
|
+
QUERY_ARGUMENT
|
|
11
|
+
} from "./chunk-CKB4XZZJ.js";
|
|
18
12
|
import {
|
|
19
|
-
QUERY_ARGUMENT,
|
|
20
|
-
onlineDeps,
|
|
21
|
-
servicesFor,
|
|
22
|
-
storeModeDeps
|
|
23
|
-
} from "./chunk-GAHIHE4K.js";
|
|
24
|
-
import {
|
|
25
|
-
DEFAULT_OUTPUT_BYTES,
|
|
26
|
-
ENTITIES,
|
|
27
|
-
LOCAL_WRITE,
|
|
28
|
-
REMOTE_WRITE,
|
|
29
|
-
answerSchema,
|
|
30
13
|
authorityAllowed,
|
|
31
14
|
botApiAllowed,
|
|
32
15
|
changesMessenger,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
judgedAnswer,
|
|
36
|
-
judgedEffects,
|
|
37
|
-
keyForCommand,
|
|
38
|
-
levelFor,
|
|
39
|
-
listOf,
|
|
40
|
-
readKeysForCommand,
|
|
41
|
-
refuseStoreChange,
|
|
42
|
-
sealed,
|
|
43
|
-
startRecording
|
|
44
|
-
} from "./chunk-TGS5VPJD.js";
|
|
45
|
-
import {
|
|
46
|
-
currentCaller,
|
|
47
|
-
keepsSuccess,
|
|
48
|
-
runContextOf,
|
|
49
|
-
withCaller
|
|
50
|
-
} from "./chunk-54BQWRJL.js";
|
|
16
|
+
flatten
|
|
17
|
+
} from "./chunk-YAIOEPKU.js";
|
|
51
18
|
import {
|
|
52
|
-
|
|
53
|
-
} from "./chunk-
|
|
19
|
+
currentCaller
|
|
20
|
+
} from "./chunk-XZ7MO6EU.js";
|
|
54
21
|
import {
|
|
55
22
|
enclosingTraceId,
|
|
56
23
|
inRun,
|
|
57
24
|
newRunId,
|
|
58
25
|
traceOf
|
|
59
|
-
} from "./chunk-
|
|
60
|
-
import {
|
|
61
|
-
storeDamaged
|
|
62
|
-
} from "./chunk-RLNZ7NX5.js";
|
|
26
|
+
} from "./chunk-COJTCEZP.js";
|
|
63
27
|
import {
|
|
64
28
|
queryDescription
|
|
65
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-XQZEMRCU.js";
|
|
66
30
|
import {
|
|
67
31
|
captureStreams
|
|
68
|
-
} from "./chunk-
|
|
69
|
-
import {
|
|
70
|
-
errorObjectOf,
|
|
71
|
-
mcpErrorResult
|
|
72
|
-
} from "./chunk-SONPLYV7.js";
|
|
32
|
+
} from "./chunk-6CCO3JCM.js";
|
|
73
33
|
import {
|
|
74
|
-
|
|
75
|
-
} from "./chunk-
|
|
34
|
+
errorObjectOf
|
|
35
|
+
} from "./chunk-55FH6IEL.js";
|
|
76
36
|
import {
|
|
77
37
|
COMPACT_FLAG,
|
|
78
38
|
SNAKE_CASE,
|
|
@@ -82,12 +42,7 @@ import {
|
|
|
82
42
|
duplicates,
|
|
83
43
|
integer,
|
|
84
44
|
isoDate,
|
|
85
|
-
itemEnvelopeSchema,
|
|
86
|
-
listEnvelopeSchema,
|
|
87
45
|
literal,
|
|
88
|
-
looseObject,
|
|
89
|
-
maxLength,
|
|
90
|
-
maxValue,
|
|
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-GXGSC622.js";
|
|
113
64
|
import {
|
|
114
|
-
CliError
|
|
115
|
-
|
|
116
|
-
} from "./chunk-54NDYVZA.js";
|
|
65
|
+
CliError
|
|
66
|
+
} from "./chunk-OLCU7Q2B.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.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/mcp/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.128.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.128.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,7 +328,13 @@ 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
|
];
|
|
374
339
|
var PARITY_GROUPS = defineParityGroups([
|
|
375
340
|
{ name: "messengers", members: ["tg", "max"], covers: "tree", differences: MESSENGERS_SINCE_0_98 },
|
|
@@ -377,7 +342,7 @@ var PARITY_GROUPS = defineParityGroups([
|
|
|
377
342
|
name: "all",
|
|
378
343
|
members: ["tg", "max", "memo", "drive", "zm", "wa"],
|
|
379
344
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade", "search", "notes", "meetings"],
|
|
380
|
-
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
|
|
345
|
+
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
|
|
381
346
|
},
|
|
382
347
|
// mail's `search messages` is cli-core's mail search, not the messengers' command: --complete took their 20-odd
|
|
383
348
|
// differences as inherited (https://github.com/WireCatLabs/cli-base/issues/390). mail is compared everywhere else
|
|
@@ -386,7 +351,7 @@ var PARITY_GROUPS = defineParityGroups([
|
|
|
386
351
|
name: "mail-shared",
|
|
387
352
|
members: ["tg", "max", "memo", "drive", "zm", "wa", "mail"],
|
|
388
353
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade", "notes", "meetings"],
|
|
389
|
-
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
|
|
354
|
+
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
|
|
390
355
|
},
|
|
391
356
|
// gcal is compared on what it already shares with every CLI; doctor, mcp, search and skill wait until the published
|
|
392
357
|
// CLIs agree there (https://github.com/WireCatLabs/cli-base/issues/390), then gcal moves back into "all".
|
|
@@ -398,14 +363,60 @@ var PARITY_GROUPS = defineParityGroups([
|
|
|
398
363
|
},
|
|
399
364
|
// bitrix24-cli's search is cli-core's CRM `search all`, and beeline-cli's and asterisk-cli's meetings take call
|
|
400
365
|
// recordings, not zoom-cli's: they are compared on the root commands every CLI shares, the way gcal and mail are.
|
|
401
|
-
//
|
|
366
|
+
// amo-cli, hubspot-cli and attio-cli share them too, and their CRM commands are compared with b24 in `crm` below.
|
|
367
|
+
// wordpress-cli shares only these roots: it is the first content CLI, so its posts commands have no group yet.
|
|
368
|
+
// linear-cli shares only these roots too: it is the first tracker CLI, so its issues commands have no group yet.
|
|
369
|
+
// notion-cli joins here until its documents commands ship; then it moves next to drive. ydisk joins here too: in "all"
|
|
370
|
+
// its search and notes differ from the messengers' and memo's as drive's do, and a documents group of drive, notion
|
|
371
|
+
// and ydisk differs in 39 paths (session, folders browse, summaries; measured on the published CLIs 2026-11-17).
|
|
402
372
|
{
|
|
403
373
|
name: "shared-roots",
|
|
404
|
-
members: [
|
|
374
|
+
members: [
|
|
375
|
+
"tg",
|
|
376
|
+
"max",
|
|
377
|
+
"memo",
|
|
378
|
+
"drive",
|
|
379
|
+
"zm",
|
|
380
|
+
"wa",
|
|
381
|
+
"b24",
|
|
382
|
+
"beeline",
|
|
383
|
+
"pbx",
|
|
384
|
+
"notion",
|
|
385
|
+
"amo",
|
|
386
|
+
"hubspot",
|
|
387
|
+
"attio",
|
|
388
|
+
"ydisk",
|
|
389
|
+
"wordpress",
|
|
390
|
+
"linear"
|
|
391
|
+
],
|
|
405
392
|
covers: ["commands", "doctor", "skill", "mcp", "upgrade"],
|
|
406
|
-
differences: [...MEMO_HAS_NO_PROFILES, MEMO_DOCTOR_DEEP]
|
|
393
|
+
differences: [...MEMO_HAS_NO_PROFILES, ...MEMO_MCP_SUMMARIES, MEMO_DOCTOR_DEEP]
|
|
394
|
+
},
|
|
395
|
+
// The CRM CLIs on cli-core's shared CRM commands. hubspot-cli is not in the family packages, so `audit --family`
|
|
396
|
+
// skips it, as beeline. Only b24 and hubspot have `leads` (amoCRM
|
|
397
|
+
// has no lead apart from a deal), only b24 has `products` (amo leaves them for later) and `deals delete` (amoCRM's
|
|
398
|
+
// API v4 cannot delete a lead, https://www.amocrm.ru/developers/content/crm_platform/leads-api), and hubspot writes
|
|
399
|
+
// no deals yet; a list of roots does not compare presence, so these need no difference. `people`, `organizations`,
|
|
400
|
+
// `users`, `api` and `session` join once b24's released tree is on cli-core's shared people and organizations
|
|
401
|
+
// commands: measured against b24 0.23.0 on 2026-11-16 they differ in options, outputs and summaries.
|
|
402
|
+
{
|
|
403
|
+
name: "crm",
|
|
404
|
+
members: ["b24", "amo", "hubspot", "attio"],
|
|
405
|
+
covers: ["deals", "sync", "search", "store", "schedule", "account"],
|
|
406
|
+
differences: [
|
|
407
|
+
{
|
|
408
|
+
rule: "same-path-contract",
|
|
409
|
+
target: "schedule: summary",
|
|
410
|
+
differs: "hubspot",
|
|
411
|
+
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",
|
|
412
|
+
review_after: "2026-12-01"
|
|
413
|
+
}
|
|
414
|
+
]
|
|
407
415
|
}
|
|
408
416
|
]);
|
|
417
|
+
var SHARED_DIFFERENCES = [
|
|
418
|
+
...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()
|
|
419
|
+
];
|
|
409
420
|
var requiredRootSchema = strictObject({ path: pipe(array(segment), minLength(1)), meaning: text });
|
|
410
421
|
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");
|
|
411
422
|
var REQUIRED_ROOTS = defineRequiredRoots([
|
|
@@ -417,7 +428,7 @@ var REQUIRED_ROOTS = defineRequiredRoots([
|
|
|
417
428
|
{ path: ["upgrade"], meaning: "updates the CLI" }
|
|
418
429
|
]);
|
|
419
430
|
|
|
420
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
431
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
421
432
|
var fieldRuleSchema = strictObject({ id: word, rule: text });
|
|
422
433
|
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");
|
|
423
434
|
var FIELD_RULES = defineFieldRules([
|
|
@@ -433,7 +444,7 @@ var FIELD_RULES = defineFieldRules([
|
|
|
433
444
|
}
|
|
434
445
|
]);
|
|
435
446
|
|
|
436
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
447
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
437
448
|
var key = pipe(string(), regex(SNAKE_CASE, "a snake_case key"));
|
|
438
449
|
var identifierSchema = strictObject({ key, meaning: text, replaces: optional(array(key)) });
|
|
439
450
|
var defineIdentifiers = /* @__PURE__ */ __name((input) => parseRegistry("identifiers", array(identifierSchema), input, (identifiers) => {
|
|
@@ -455,7 +466,7 @@ var IDENTIFIERS = defineIdentifiers([
|
|
|
455
466
|
{ key: "trace_id", meaning: "the distributed trace a run belongs to, from `traceparent`" }
|
|
456
467
|
]);
|
|
457
468
|
|
|
458
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
469
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
459
470
|
var ACCOUNT_FLAGS = [
|
|
460
471
|
{
|
|
461
472
|
name: "--client-id",
|
|
@@ -492,7 +503,7 @@ var ACCOUNT_FLAGS = [
|
|
|
492
503
|
{ name: "--hide-phone", role: "output", type: "switch", meaning: "leave the phone number out of the answer" }
|
|
493
504
|
];
|
|
494
505
|
|
|
495
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
506
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
496
507
|
var CALENDAR_FLAGS = [
|
|
497
508
|
{ name: "--end-time", value: "<time>", role: "value", type: "time", meaning: "when it ends" },
|
|
498
509
|
{
|
|
@@ -524,6 +535,13 @@ var CALENDAR_FLAGS = [
|
|
|
524
535
|
type: "string",
|
|
525
536
|
meaning: "one of the service's own settings, such as a meeting's waiting room; repeat it for more"
|
|
526
537
|
},
|
|
538
|
+
{
|
|
539
|
+
name: "--conference",
|
|
540
|
+
value: "<service>",
|
|
541
|
+
role: "value",
|
|
542
|
+
type: "string",
|
|
543
|
+
meaning: "the video meeting service that gives the event a new meeting link, such as google-meet"
|
|
544
|
+
},
|
|
527
545
|
{
|
|
528
546
|
name: "--id",
|
|
529
547
|
value: "<id>",
|
|
@@ -573,8 +591,60 @@ var CALENDAR_FLAGS = [
|
|
|
573
591
|
}
|
|
574
592
|
];
|
|
575
593
|
|
|
576
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
594
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
595
|
+
var CONTENT_FLAGS = [
|
|
596
|
+
{ name: "--slug", value: "<slug>", role: "value", type: "string", meaning: "the last part of its web address" },
|
|
597
|
+
{
|
|
598
|
+
name: "--tags",
|
|
599
|
+
value: "<ids>",
|
|
600
|
+
role: "value",
|
|
601
|
+
type: "list",
|
|
602
|
+
meaning: "its tags and categories, by comma-separated ids; replaces the ones it has"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
name: "--replace-body",
|
|
606
|
+
role: "mode",
|
|
607
|
+
type: "switch",
|
|
608
|
+
meaning: "write the new text over a body the tool cannot fully read back, losing what it could not show"
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
name: "--from-template",
|
|
612
|
+
value: "<template>",
|
|
613
|
+
role: "value",
|
|
614
|
+
type: "string",
|
|
615
|
+
meaning: "start the new page from one of the source's page templates, by name or id; not a message --template"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
name: "--cover",
|
|
619
|
+
value: "<link>",
|
|
620
|
+
role: "value",
|
|
621
|
+
type: "string",
|
|
622
|
+
meaning: "the page's cover image, by an https link, or none to take it away; a local image file is --photo"
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
name: "--allow-deleting-content",
|
|
626
|
+
role: "mode",
|
|
627
|
+
type: "switch",
|
|
628
|
+
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"
|
|
629
|
+
}
|
|
630
|
+
];
|
|
631
|
+
|
|
632
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
577
633
|
var CRM_FLAGS = [
|
|
634
|
+
{
|
|
635
|
+
name: "--email",
|
|
636
|
+
value: "<address>",
|
|
637
|
+
role: "value",
|
|
638
|
+
type: "string",
|
|
639
|
+
meaning: "an e-mail address to give it; repeat it for more"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
name: "--phone",
|
|
643
|
+
value: "<phone>",
|
|
644
|
+
role: "value",
|
|
645
|
+
type: "string",
|
|
646
|
+
meaning: "a phone number to give it, in international form starting with +; repeat it for more"
|
|
647
|
+
},
|
|
578
648
|
{
|
|
579
649
|
name: "--pipeline",
|
|
580
650
|
value: "<pipeline>",
|
|
@@ -723,7 +793,7 @@ var CRM_FLAGS = [
|
|
|
723
793
|
}
|
|
724
794
|
];
|
|
725
795
|
|
|
726
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
796
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
727
797
|
var HOW_FLAGS = [
|
|
728
798
|
{
|
|
729
799
|
name: "--limit",
|
|
@@ -1103,13 +1173,7 @@ var HOW_FLAGS = [
|
|
|
1103
1173
|
type: "string",
|
|
1104
1174
|
meaning: "a person whose reply counts as an answer; repeat it for more"
|
|
1105
1175
|
},
|
|
1106
|
-
{
|
|
1107
|
-
name: "--browser",
|
|
1108
|
-
value: "<program>",
|
|
1109
|
-
role: "mode",
|
|
1110
|
-
type: "string",
|
|
1111
|
-
meaning: "the browser program to open for sign-in"
|
|
1112
|
-
},
|
|
1176
|
+
{ name: "--browser", value: "<program>", role: "mode", type: "string", meaning: "the browser to open for sign-in" },
|
|
1113
1177
|
{
|
|
1114
1178
|
name: "--credential-storage",
|
|
1115
1179
|
value: "<storage>",
|
|
@@ -1118,6 +1182,8 @@ var HOW_FLAGS = [
|
|
|
1118
1182
|
meaning: "where a sign-in is kept: keyring, which falls back to a private file by itself, or file (WC-SECR-4)"
|
|
1119
1183
|
},
|
|
1120
1184
|
{ name: "--checkpoint", value: "<file>", role: "mode", type: "path", meaning: "keep resume progress in this file" },
|
|
1185
|
+
{ name: "--site", value: "<address>", role: "mode", type: "string", meaning: "the owner's site a sign-in is for" },
|
|
1186
|
+
{ name: "--login", value: "<name>", role: "mode", type: "string", meaning: "the user name a password is for" },
|
|
1121
1187
|
{
|
|
1122
1188
|
name: "--expected-event-id",
|
|
1123
1189
|
value: "<id>",
|
|
@@ -1720,7 +1786,7 @@ var HOW_FLAGS = [
|
|
|
1720
1786
|
}
|
|
1721
1787
|
];
|
|
1722
1788
|
|
|
1723
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1789
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
1724
1790
|
var KNOWLEDGE_FLAGS = [
|
|
1725
1791
|
{
|
|
1726
1792
|
name: "--accept-terms",
|
|
@@ -1756,6 +1822,13 @@ var KNOWLEDGE_FLAGS = [
|
|
|
1756
1822
|
meaning: "at most this many characters read",
|
|
1757
1823
|
unit: "characters"
|
|
1758
1824
|
},
|
|
1825
|
+
{
|
|
1826
|
+
name: "--tab",
|
|
1827
|
+
value: "<id>",
|
|
1828
|
+
role: "target",
|
|
1829
|
+
type: "id",
|
|
1830
|
+
meaning: "one tab of a document, by its id: only its text is read"
|
|
1831
|
+
},
|
|
1759
1832
|
{
|
|
1760
1833
|
name: "--tag",
|
|
1761
1834
|
value: "<name>",
|
|
@@ -1772,7 +1845,7 @@ var KNOWLEDGE_FLAGS = [
|
|
|
1772
1845
|
}
|
|
1773
1846
|
];
|
|
1774
1847
|
|
|
1775
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1848
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
1776
1849
|
var MAIL_FLAGS = [
|
|
1777
1850
|
{
|
|
1778
1851
|
name: "--cc",
|
|
@@ -1802,7 +1875,38 @@ var MAIL_FLAGS = [
|
|
|
1802
1875
|
}
|
|
1803
1876
|
];
|
|
1804
1877
|
|
|
1805
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1878
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
1879
|
+
var MIRROR_FLAGS = [
|
|
1880
|
+
{
|
|
1881
|
+
name: "--keep",
|
|
1882
|
+
value: "<side>",
|
|
1883
|
+
role: "mode",
|
|
1884
|
+
type: "choice",
|
|
1885
|
+
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"
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
name: "--allow-deletions",
|
|
1889
|
+
value: "<count>",
|
|
1890
|
+
role: "mode",
|
|
1891
|
+
type: "count",
|
|
1892
|
+
meaning: "let this run delete up to this many files when the mirror's guard stops it; owner only"
|
|
1893
|
+
},
|
|
1894
|
+
{
|
|
1895
|
+
name: "--allow-replacements",
|
|
1896
|
+
value: "<count>",
|
|
1897
|
+
role: "mode",
|
|
1898
|
+
type: "count",
|
|
1899
|
+
meaning: "let this run overwrite up to this many existing files when the mirror's guard stops it; owner only"
|
|
1900
|
+
},
|
|
1901
|
+
{
|
|
1902
|
+
name: "--repin",
|
|
1903
|
+
role: "mode",
|
|
1904
|
+
type: "switch",
|
|
1905
|
+
meaning: "accept that a replaced local or remote folder is the mirror's folder now, and sync it; owner only"
|
|
1906
|
+
}
|
|
1907
|
+
];
|
|
1908
|
+
|
|
1909
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
1806
1910
|
var PRIVACY_FLAGS = [
|
|
1807
1911
|
{
|
|
1808
1912
|
name: "--about-text",
|
|
@@ -1863,7 +1967,7 @@ var PRIVACY_FLAGS = [
|
|
|
1863
1967
|
{ name: "--read-receipts", value: "<on|off>", role: "value", type: "choice", meaning: "send read receipts" }
|
|
1864
1968
|
];
|
|
1865
1969
|
|
|
1866
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1970
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
1867
1971
|
var SCHEDULE_FLAGS = [
|
|
1868
1972
|
{
|
|
1869
1973
|
name: "--locale",
|
|
@@ -1896,7 +2000,18 @@ var SCHEDULE_FLAGS = [
|
|
|
1896
2000
|
}
|
|
1897
2001
|
];
|
|
1898
2002
|
|
|
1899
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2003
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
2004
|
+
var SEARCH_FLAGS = [
|
|
2005
|
+
{
|
|
2006
|
+
name: "--like",
|
|
2007
|
+
value: "<text>",
|
|
2008
|
+
role: "query",
|
|
2009
|
+
type: "string",
|
|
2010
|
+
meaning: "a made-up example of the text sought, such as a reply that would answer the question, searched by meaning beside the query"
|
|
2011
|
+
}
|
|
2012
|
+
];
|
|
2013
|
+
|
|
2014
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
1900
2015
|
var WHAT_FLAGS = [
|
|
1901
2016
|
{
|
|
1902
2017
|
name: "--analysis-provider",
|
|
@@ -2893,7 +3008,7 @@ var WHAT_FLAGS = [
|
|
|
2893
3008
|
}
|
|
2894
3009
|
];
|
|
2895
3010
|
|
|
2896
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
3011
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.128.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
|
|
2897
3012
|
var FLAG_TYPES = [
|
|
2898
3013
|
"switch",
|
|
2899
3014
|
"count",
|
|
@@ -3023,6 +3138,10 @@ var verbs = [
|
|
|
3023
3138
|
["export", "write from the store to a file"],
|
|
3024
3139
|
["import", "bring a file or list the user gives into the store or the messenger, once"],
|
|
3025
3140
|
["download", "save a file from the source to this machine"],
|
|
3141
|
+
["upload", "put a file from this machine on the source"],
|
|
3142
|
+
["publish", "open a thing to anyone who has its public link"],
|
|
3143
|
+
["unpublish", "close a thing's public link"],
|
|
3144
|
+
["stale", "mark a saved memory as out of date, keeping it"],
|
|
3026
3145
|
["transcribe", "turn speech into text"],
|
|
3027
3146
|
["extract", "read the text inside files already on this machine into the store"],
|
|
3028
3147
|
["migrate", "bring a file up to this build's schema"],
|
|
@@ -3047,6 +3166,7 @@ var verbs = [
|
|
|
3047
3166
|
"look at a source before taking anything from it: a chat link without joining, a mailbox without importing"
|
|
3048
3167
|
],
|
|
3049
3168
|
["send", "send a message"],
|
|
3169
|
+
["reply", "answer in a comment thread at the source, under the comment that started it"],
|
|
3050
3170
|
["call", "call one provider API method by its own name, generated from the provider's method list"],
|
|
3051
3171
|
["edit", "change a sent message"],
|
|
3052
3172
|
["forward", "send an existing message on to another chat"],
|
|
@@ -3119,6 +3239,8 @@ var collections = [
|
|
|
3119
3239
|
["messages", "posts in a messenger chat, or emails"],
|
|
3120
3240
|
["drafts", "e-mails saved in a mailbox's Drafts folder, written and not sent"],
|
|
3121
3241
|
["polls", "polls in a chat"],
|
|
3242
|
+
["posts", "posts and pages on a site or blog the owner publishes"],
|
|
3243
|
+
["channels", "the sites and social accounts the owner publishes posts on"],
|
|
3122
3244
|
["reactions", "reactions to a message"],
|
|
3123
3245
|
["recipients", "who a message goes to"],
|
|
3124
3246
|
["replies", "the automatic replies of a profile"],
|
|
@@ -3165,7 +3287,13 @@ var collections = [
|
|
|
3165
3287
|
["transactions", "money that moved in or out of a wallet, as the bank or the owner recorded it"],
|
|
3166
3288
|
["splits", "parts of one transaction, each with its own amount and category"],
|
|
3167
3289
|
["users", "people who work in the owner's account at a service, such as a CRM's employees"],
|
|
3290
|
+
["issues", "work items in an issue tracker, each in a team, a workflow state and maybe a project"],
|
|
3291
|
+
["teams", "groups in a tracker that own issues, states and labels"],
|
|
3292
|
+
["states", "the workflow steps a tracker team moves its issues through, each of a type such as started"],
|
|
3293
|
+
["labels", "a tracker's shared labels on issues, kept by the tracker and not by the owner"],
|
|
3168
3294
|
["fields", "a record type's field definitions: code, label, type and options, such as a CRM's custom fields"],
|
|
3295
|
+
["activities", "a CRM's calls, e-mails, meetings, to-dos and comments on its records"],
|
|
3296
|
+
["changes", "what changed in a copied source over a time: records added, moved, closed or reassigned"],
|
|
3169
3297
|
[
|
|
3170
3298
|
"identities",
|
|
3171
3299
|
"ways to reach a person or an organization: an account in one messenger or mailbox, an e-mail address, a phone"
|
|
@@ -3175,7 +3303,17 @@ var collections = [
|
|
|
3175
3303
|
["relationships", "confirmed or suggested links between people, organizations and projects"],
|
|
3176
3304
|
["roles", "the parts a person plays in a relationship, built in or the owner's own"],
|
|
3177
3305
|
["sheets", "remote spreadsheets and their cell ranges, read or changed through a provider"],
|
|
3306
|
+
[
|
|
3307
|
+
"databases",
|
|
3308
|
+
"a source's databases, such as Notion's, each a set of rows with typed properties; the local store's are tables"
|
|
3309
|
+
],
|
|
3310
|
+
["rows", "the records of a database at the source, each with typed values; an order's or an invoice's are lines"],
|
|
3178
3311
|
["files", "files in the source, such as Google Drive, read and changed there"],
|
|
3312
|
+
["mirrors", "saved pairings of a local folder and a folder in the source, which sync keeps the same both ways"],
|
|
3313
|
+
[
|
|
3314
|
+
"conflicts",
|
|
3315
|
+
"files a mirror's sync found changed on both sides and could not merge, each waiting for a side or a final file"
|
|
3316
|
+
],
|
|
3179
3317
|
["comments", "comments people left on a thing in the source: a channel post or a file"],
|
|
3180
3318
|
["meetings", "stored meetings, from Zoom or another provider"],
|
|
3181
3319
|
["calls", "phone calls a phone system recorded, stored as meetings with their transcripts"],
|
|
@@ -3231,6 +3369,10 @@ var singulars = [
|
|
|
3231
3369
|
["privacy", "who may find, see, call or add the account"],
|
|
3232
3370
|
["metadata", "a profile's cached source attributes"],
|
|
3233
3371
|
["auth", "the credentials a bot profile uses: its token and the secrets beside it"],
|
|
3372
|
+
[
|
|
3373
|
+
"scheduled",
|
|
3374
|
+
"a chat's messages the messenger will send later; their ids are their own, never the ids of sent messages"
|
|
3375
|
+
],
|
|
3234
3376
|
[
|
|
3235
3377
|
"schedule",
|
|
3236
3378
|
"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"
|
|
@@ -3238,6 +3380,7 @@ var singulars = [
|
|
|
3238
3380
|
];
|
|
3239
3381
|
var views = [
|
|
3240
3382
|
["tree", "the parent and child hierarchy of stored sources"],
|
|
3383
|
+
["stats", "a thing's own numbers, such as a post's views, as read at each sync"],
|
|
3241
3384
|
["logs", "the log of a running process"],
|
|
3242
3385
|
["events", "what happened in a thing over time"],
|
|
3243
3386
|
["scheduled", "what is scheduled to happen"],
|
|
@@ -3250,6 +3393,7 @@ var views = [
|
|
|
3250
3393
|
["transcript", "the text of speech: a voice message or a meeting recording"],
|
|
3251
3394
|
["evidence", "the stored messages or lines a result or a reference rests on"],
|
|
3252
3395
|
["passage", "a cited transcript line with bounded surrounding lines from the same revision"],
|
|
3396
|
+
["invitation", "the text that invites people to a meeting: how to join it and when"],
|
|
3253
3397
|
["agenda", "what needs a look today"],
|
|
3254
3398
|
["busy", "when calendars or people are taken, without what takes them"],
|
|
3255
3399
|
["categories", "the categories a thing takes, with what each means"],
|
|
@@ -3309,11 +3453,14 @@ var VOCABULARY = defineVocabulary({
|
|
|
3309
3453
|
...MAIL_FLAGS,
|
|
3310
3454
|
...KNOWLEDGE_FLAGS,
|
|
3311
3455
|
...CRM_FLAGS,
|
|
3312
|
-
...SCHEDULE_FLAGS
|
|
3456
|
+
...SCHEDULE_FLAGS,
|
|
3457
|
+
...CONTENT_FLAGS,
|
|
3458
|
+
...SEARCH_FLAGS,
|
|
3459
|
+
...MIRROR_FLAGS
|
|
3313
3460
|
]
|
|
3314
3461
|
});
|
|
3315
3462
|
|
|
3316
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3463
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/mcp/agent.js
|
|
3317
3464
|
var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
|
|
3318
3465
|
var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
|
|
3319
3466
|
var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
|
|
@@ -3484,7 +3631,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3484
3631
|
const { argv, stdin } = argvOf(info, input, ctx.profile, ctx.stdin);
|
|
3485
3632
|
const lend = ctx.connection;
|
|
3486
3633
|
let borrowed;
|
|
3487
|
-
let
|
|
3634
|
+
let answered = false;
|
|
3488
3635
|
let result;
|
|
3489
3636
|
let failure;
|
|
3490
3637
|
const streams = captureStreams();
|
|
@@ -3506,7 +3653,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3506
3653
|
answer: /* @__PURE__ */ __name(() => null, "answer"),
|
|
3507
3654
|
agent: {
|
|
3508
3655
|
result: /* @__PURE__ */ __name((value) => {
|
|
3509
|
-
|
|
3656
|
+
answered = true;
|
|
3510
3657
|
result = value;
|
|
3511
3658
|
}, "result"),
|
|
3512
3659
|
failure: /* @__PURE__ */ __name((object2) => {
|
|
@@ -3528,7 +3675,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3528
3675
|
}));
|
|
3529
3676
|
if (failure)
|
|
3530
3677
|
return { error: failure };
|
|
3531
|
-
if (
|
|
3678
|
+
if (answered)
|
|
3532
3679
|
return { result };
|
|
3533
3680
|
if (code !== 0)
|
|
3534
3681
|
throw new CliError("invalid_response", `the command exited with ${code} and said nothing`);
|
|
@@ -3540,468 +3687,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3540
3687
|
}
|
|
3541
3688
|
}, "runCommandForAgent");
|
|
3542
3689
|
|
|
3543
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/mcp/tool.js
|
|
3544
|
-
var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
|
|
3545
|
-
var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
|
|
3546
|
-
var message = pipe(
|
|
3547
|
-
string(),
|
|
3548
|
-
maxLength(256),
|
|
3549
|
-
// biome-ignore lint/suspicious/noControlCharactersInRegex: refusing them is the point
|
|
3550
|
-
regex(/^[^\s\x00-\x1F\x7F-\x9F]+$/, "a message id has no spaces or control characters"),
|
|
3551
|
-
description("message id")
|
|
3552
|
-
);
|
|
3553
|
-
var READ = { readOnlyHint: true, destructiveHint: false, openWorldHint: true };
|
|
3554
|
-
var WRITE = {
|
|
3555
|
-
readOnlyHint: false,
|
|
3556
|
-
destructiveHint: true,
|
|
3557
|
-
idempotentHint: false,
|
|
3558
|
-
openWorldHint: true
|
|
3559
|
-
};
|
|
3560
|
-
var tool = /* @__PURE__ */ __name((definition) => definition, "tool");
|
|
3561
|
-
var chatOf = /* @__PURE__ */ __name((messenger) => pipe(string(), minLength(1), description(messenger.chatArgument)), "chatOf");
|
|
3562
|
-
var tierOf = /* @__PURE__ */ __name((key2, definition, messenger) => {
|
|
3563
|
-
if (definition.annotations.readOnlyHint === true)
|
|
3564
|
-
return "read";
|
|
3565
|
-
if (/^admin|_admin/.test(key2))
|
|
3566
|
-
return "admin";
|
|
3567
|
-
if (/delete|ban|kick|remove|purge|block/.test(key2))
|
|
3568
|
-
return "destructive";
|
|
3569
|
-
if (/draft/.test(key2))
|
|
3570
|
-
return "draft";
|
|
3571
|
-
if (key2 === "messages_pin" && messenger?.quietPins === false)
|
|
3572
|
-
return "write-public";
|
|
3573
|
-
if (/mark_read|mark_unread|read_mark|archive|mute|pin|tag|note|label|folder|alias|save|_(un)?star$/.test(key2))
|
|
3574
|
-
return "write-private";
|
|
3575
|
-
return "write-public";
|
|
3576
|
-
}, "tierOf");
|
|
3577
|
-
var effectsOf = /* @__PURE__ */ __name((definition) => {
|
|
3578
|
-
if (definition.effects)
|
|
3579
|
-
return definition.effects;
|
|
3580
|
-
const { readOnlyHint, openWorldHint } = definition.annotations;
|
|
3581
|
-
if (readOnlyHint === true)
|
|
3582
|
-
return { remote: openWorldHint === false ? "none" : "read", local: "read" };
|
|
3583
|
-
return openWorldHint === false ? LOCAL_WRITE : REMOTE_WRITE;
|
|
3584
|
-
}, "effectsOf");
|
|
3585
|
-
var outcomeOf = /* @__PURE__ */ __name((result) => {
|
|
3586
|
-
if (!result.isError)
|
|
3587
|
-
return { status: "ok" };
|
|
3588
|
-
const code = result.structuredContent?.error?.code;
|
|
3589
|
-
const error = typeof code === "string" ? code : "generic_failure";
|
|
3590
|
-
return { status: error === "permission_error" ? "refused" : "failed", error };
|
|
3591
|
-
}, "outcomeOf");
|
|
3592
|
-
var commandOf = /* @__PURE__ */ __name((name, definition) => definition.command ?? name.replaceAll("_", " "), "commandOf");
|
|
3593
|
-
var toolKey = /* @__PURE__ */ __name((name, definition) => definition.key !== void 0 ? definition.key : keyForCommand(commandOf(name, definition).split(" ")), "toolKey");
|
|
3594
|
-
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");
|
|
3595
|
-
var syncAllowedFor = /* @__PURE__ */ __name((key2, defaults) => {
|
|
3596
|
-
const permissions = defaults.settings.permissions ?? {};
|
|
3597
|
-
const shared = defaults.syncAllowed ?? fetchesAt(levelFor(permissions, "messages.sync-first").level);
|
|
3598
|
-
return shared && (!key2.startsWith("stats_") || fetchesAt(levelFor(permissions, `${key2.replaceAll("_", ".")}.sync-first`).level));
|
|
3599
|
-
}, "syncAllowedFor");
|
|
3600
|
-
var entryRunner = /* @__PURE__ */ __name((registration) => {
|
|
3601
|
-
const run = callRunner(registration);
|
|
3602
|
-
const { log } = registration;
|
|
3603
|
-
return async (key2, definition, args, ctx) => {
|
|
3604
|
-
const startedAt = Date.now();
|
|
3605
|
-
const command = `mcp ${commandOf(key2, definition)}`;
|
|
3606
|
-
const traceId = traceIdOf(ctx?.mcpReq?._meta?.traceparent);
|
|
3607
|
-
const app = registration.messenger?.app;
|
|
3608
|
-
const caller = registration.callers ? callerOf(ctx, key2, registration.callers) : currentCaller();
|
|
3609
|
-
const env = registration.defaults.env ?? process.env;
|
|
3610
|
-
const settings = registration.defaults.settings;
|
|
3611
|
-
const recording = key2 !== "runs_search" && settings.keepFailedRuns !== false && app?.appName ? startRecording({
|
|
3612
|
-
app,
|
|
3613
|
-
command,
|
|
3614
|
-
...settings.profile === void 0 ? {} : { profile: settings.profile },
|
|
3615
|
-
env,
|
|
3616
|
-
record: keepsSuccess({ record: settings.record ?? true, fromFlag: false, env, caller }),
|
|
3617
|
-
keepFailed: true,
|
|
3618
|
-
trace: false,
|
|
3619
|
-
format: "json",
|
|
3620
|
-
context: runContextOf({ bin: app.command, command, env, caller }),
|
|
3621
|
-
...settings.keepRunsForDays === void 0 ? {} : { keepDays: settings.keepRunsForDays },
|
|
3622
|
-
...settings.keepSuccessfulRunsForDays === void 0 ? {} : { keepSuccessDays: settings.keepSuccessfulRunsForDays },
|
|
3623
|
-
...settings.runsSizeLimitMb === void 0 ? {} : { maxBytes: settings.runsSizeLimitMb * 1024 * 1024 },
|
|
3624
|
-
...traceId === void 0 ? {} : { traceId }
|
|
3625
|
-
}) : void 0;
|
|
3626
|
-
const profile = registration.defaults.settings.profile;
|
|
3627
|
-
const scope = {
|
|
3628
|
-
runId: recording?.runId ?? newRunId(new Date(startedAt), command),
|
|
3629
|
-
command,
|
|
3630
|
-
startedAt,
|
|
3631
|
-
...profile === void 0 ? {} : { profile },
|
|
3632
|
-
...traceId === void 0 ? {} : { traceId },
|
|
3633
|
-
...recording ? { events: recording.events } : {}
|
|
3634
|
-
};
|
|
3635
|
-
const work = /* @__PURE__ */ __name(() => inRun(scope, () => {
|
|
3636
|
-
const input = inputOf(definition, syncAllowedFor(key2, registration.defaults));
|
|
3637
|
-
const parsed = safeParse(input, args);
|
|
3638
|
-
return parsed.success ? run(key2, definition, parsed.output, ctx) : failed(new CliError("validation_error", `${commandOf(key2, definition)}: ${summarize(parsed.issues)}`, {
|
|
3639
|
-
arguments: toJsonSchema(input)
|
|
3640
|
-
}), app?.errors);
|
|
3641
|
-
}), "work");
|
|
3642
|
-
const result = await (caller ? withCaller(caller, work) : work());
|
|
3643
|
-
if (recording) {
|
|
3644
|
-
if (result.isError) {
|
|
3645
|
-
const error = result.structuredContent?.error;
|
|
3646
|
-
const code = error?.code && errorCodes.includes(error.code) ? error.code : void 0;
|
|
3647
|
-
await recording.fail(code ? new CliError(code, "MCP operation failed") : new Error("MCP operation failed")).catch(() => void 0);
|
|
3648
|
-
} else
|
|
3649
|
-
await recording.succeed(result.structuredContent).catch(() => void 0);
|
|
3650
|
-
}
|
|
3651
|
-
await log?.({
|
|
3652
|
-
tool: key2,
|
|
3653
|
-
tier: tierOf(key2, definition, registration.messenger),
|
|
3654
|
-
...outcomeOf(result),
|
|
3655
|
-
startedAt,
|
|
3656
|
-
finishedAt: Date.now()
|
|
3657
|
-
}, caller)?.catch(() => void 0);
|
|
3658
|
-
return result;
|
|
3659
|
-
};
|
|
3660
|
-
}, "entryRunner");
|
|
3661
|
-
var callRunner = /* @__PURE__ */ __name(({ messenger, session, withStore, withServices, defaults, around, targets }) => {
|
|
3662
|
-
const where = {
|
|
3663
|
-
profile: defaults.settings.profile,
|
|
3664
|
-
env: defaults.env,
|
|
3665
|
-
pictures: defaults.settings.pictureSearch,
|
|
3666
|
-
reranker: defaults.settings.searchReranker
|
|
3667
|
-
};
|
|
3668
|
-
return async (key2, definition, args, ctx) => {
|
|
3669
|
-
const path = commandOf(key2, definition).split(" ");
|
|
3670
|
-
const run = `mcp ${path.join(" ")}`;
|
|
3671
|
-
try {
|
|
3672
|
-
const execute = /* @__PURE__ */ __name(async () => {
|
|
3673
|
-
const syncAllowed = syncAllowedFor(key2, defaults);
|
|
3674
|
-
if (Buffer.byteLength(JSON.stringify(args)) > MAX_BUFFERED_INPUT)
|
|
3675
|
-
throw new CliError("validation_error", "tool arguments exceed the buffered input limit", {
|
|
3676
|
-
reason: "input.too-large",
|
|
3677
|
-
max_bytes: MAX_BUFFERED_INPUT,
|
|
3678
|
-
retryable: false
|
|
3679
|
-
});
|
|
3680
|
-
definition.check?.(args);
|
|
3681
|
-
if (definition.changesStore)
|
|
3682
|
-
refuseStoreChange(messenger.app, defaults.env);
|
|
3683
|
-
refuseLacking(messenger, path);
|
|
3684
|
-
for (const permission of readKeysForCommand(path)) {
|
|
3685
|
-
if (levelFor(defaults.settings.permissions ?? {}, permission).level === "deny")
|
|
3686
|
-
throw new CliError("permission_error", `profile denies ${permission}`, { permission });
|
|
3687
|
-
}
|
|
3688
|
-
if (args.sync_first && !syncAllowed)
|
|
3689
|
-
throw new CliError("permission_error", "messages.sync-first is not allowed by this profile");
|
|
3690
|
-
if (definition.custom) {
|
|
3691
|
-
const result2 = await definition.custom(args, { ...defaults, signal: ctx.mcpReq.signal }, ctx);
|
|
3692
|
-
return answered(result2, definition.outputLimit?.(args, defaults), targets);
|
|
3693
|
-
}
|
|
3694
|
-
if (definition.local)
|
|
3695
|
-
return answered(await definition.local(args, defaults), definition.outputLimit?.(args, defaults), targets);
|
|
3696
|
-
const { online, stored: local, served } = definition;
|
|
3697
|
-
const stored = local && (!definition.storedWhen || definition.storedWhen(args)) ? local : void 0;
|
|
3698
|
-
const result = stored ? await withStore((store, account) => stored(store, account, args, { ...defaults, signal: ctx.mcpReq.signal }, (work) => session.use(run, work)), {
|
|
3699
|
-
name: run
|
|
3700
|
-
}) : served && withServices ? await withServices((services, connect) => served(services, args, defaults, connect), { name: run }) : served && messenger.history === "store" ? await withStore((store, account) => served(servicesFor({
|
|
3701
|
-
...storeModeDeps(messenger, store, account, defaults.guard),
|
|
3702
|
-
...where,
|
|
3703
|
-
embedders: defaults.embedders
|
|
3704
|
-
}), args, defaults, (work) => session.use(run, async (adapter, release) => {
|
|
3705
|
-
try {
|
|
3706
|
-
return await work(adapter);
|
|
3707
|
-
} finally {
|
|
3708
|
-
await release();
|
|
3709
|
-
}
|
|
3710
|
-
})), { name: run }) : served ? await session.use(run, (adapter, release) => served(servicesFor(onlineDeps(messenger, adapter, defaults.guard, where)), args, defaults, (work) => (async () => {
|
|
3711
|
-
try {
|
|
3712
|
-
return await work(adapter);
|
|
3713
|
-
} finally {
|
|
3714
|
-
await release();
|
|
3715
|
-
}
|
|
3716
|
-
})())) : await session.use(run, (adapter, release) => online(adapter, args, { ...defaults, release }));
|
|
3717
|
-
return answered(result, definition.outputLimit?.(args, defaults), targets);
|
|
3718
|
-
}, "execute");
|
|
3719
|
-
return around ? await around(key2, definition, execute) : await execute();
|
|
3720
|
-
} catch (error) {
|
|
3721
|
-
return failed(error, messenger?.app?.errors, effectsOf(definition));
|
|
3722
|
-
}
|
|
3723
|
-
};
|
|
3724
|
-
}, "callRunner");
|
|
3725
|
-
var outputSchemaOf = /* @__PURE__ */ __name((definition) => {
|
|
3726
|
-
if (!definition.output)
|
|
3727
|
-
return looseObject({});
|
|
3728
|
-
const entity = ENTITIES[definition.output.entity];
|
|
3729
|
-
return definition.output.list ? listEnvelopeSchema(entity) : itemEnvelopeSchema(entity);
|
|
3730
|
-
}, "outputSchemaOf");
|
|
3731
|
-
var Picture = class {
|
|
3732
|
-
static {
|
|
3733
|
-
__name(this, "Picture");
|
|
3734
|
-
}
|
|
3735
|
-
bytes;
|
|
3736
|
-
mimeType;
|
|
3737
|
-
about;
|
|
3738
|
-
constructor(bytes, mimeType, about) {
|
|
3739
|
-
this.bytes = bytes;
|
|
3740
|
-
this.mimeType = mimeType;
|
|
3741
|
-
this.about = about;
|
|
3742
|
-
}
|
|
3743
|
-
};
|
|
3744
|
-
var BinaryResource = class {
|
|
3745
|
-
static {
|
|
3746
|
-
__name(this, "BinaryResource");
|
|
3747
|
-
}
|
|
3748
|
-
base64;
|
|
3749
|
-
mimeType;
|
|
3750
|
-
uri;
|
|
3751
|
-
about;
|
|
3752
|
-
constructor(base64, mimeType, uri, about) {
|
|
3753
|
-
this.base64 = base64;
|
|
3754
|
-
this.mimeType = mimeType;
|
|
3755
|
-
this.uri = uri;
|
|
3756
|
-
this.about = about;
|
|
3757
|
-
}
|
|
3758
|
-
};
|
|
3759
|
-
var answered = /* @__PURE__ */ __name((answer, maxBytes = DEFAULT_OUTPUT_BYTES, targets) => {
|
|
3760
|
-
const bounded = /* @__PURE__ */ __name((result) => {
|
|
3761
|
-
if (maxBytes !== 0 && Buffer.byteLength(JSON.stringify(result.content)) > maxBytes)
|
|
3762
|
-
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 });
|
|
3763
|
-
return result;
|
|
3764
|
-
}, "bounded");
|
|
3765
|
-
if (answer === null || Array.isArray(answer) || typeof answer !== "object")
|
|
3766
|
-
throw new CliError("invalid_response", "tool result must be an object", { retryable: false });
|
|
3767
|
-
const objectBody = /* @__PURE__ */ __name((value) => {
|
|
3768
|
-
const serialized = JSON.parse(agentJson(value));
|
|
3769
|
-
if (serialized === null || Array.isArray(serialized) || typeof serialized !== "object")
|
|
3770
|
-
throw new CliError("invalid_response", "serialized tool result must be an object", { retryable: false });
|
|
3771
|
-
return serialized;
|
|
3772
|
-
}, "objectBody");
|
|
3773
|
-
if (answer instanceof BinaryResource) {
|
|
3774
|
-
const about = sealed(answer.about);
|
|
3775
|
-
return bounded({
|
|
3776
|
-
structuredContent: objectBody(about),
|
|
3777
|
-
content: [
|
|
3778
|
-
{ type: "resource", resource: { uri: answer.uri, mimeType: answer.mimeType, blob: answer.base64 } },
|
|
3779
|
-
{ type: "text", text: agentJson(about) }
|
|
3780
|
-
]
|
|
3781
|
-
});
|
|
3782
|
-
}
|
|
3783
|
-
if (answer instanceof Picture) {
|
|
3784
|
-
const about = sealed(answer.about);
|
|
3785
|
-
return bounded({
|
|
3786
|
-
structuredContent: objectBody(about),
|
|
3787
|
-
content: [
|
|
3788
|
-
{ type: "image", data: Buffer.from(answer.bytes).toString("base64"), mimeType: answer.mimeType },
|
|
3789
|
-
{ type: "text", text: agentJson(about) }
|
|
3790
|
-
]
|
|
3791
|
-
});
|
|
3792
|
-
}
|
|
3793
|
-
const body = objectBody(sealed(targets ? judgedAnswer(answer, targets) : answer));
|
|
3794
|
-
return bounded({ content: [{ type: "text", text: JSON.stringify(body) }], structuredContent: body });
|
|
3795
|
-
}, "answered");
|
|
3796
|
-
var failed = /* @__PURE__ */ __name((error, errors, effects) => {
|
|
3797
|
-
const judged = judgedEffects(effects);
|
|
3798
|
-
const context = { ...failureContext(errors), ...judged ? { effects: judged } : {} };
|
|
3799
|
-
return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(storeDamaged(error), context))));
|
|
3800
|
-
}, "failed");
|
|
3801
|
-
|
|
3802
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/mcp/surface.js
|
|
3803
|
-
import { randomUUID } from "node:crypto";
|
|
3804
|
-
var MATCHES = 8;
|
|
3805
|
-
var ANSWER = answerSchema();
|
|
3806
|
-
var agentAnswer = /* @__PURE__ */ __name((prefix, writes2) => {
|
|
3807
|
-
const meta = pipe(looseObject({}), description(`run facts; ${prefix}_tools_search shows the full answer`));
|
|
3808
|
-
const next = optional(pipe(array(looseObject({})), description("steps to run next: command and args")));
|
|
3809
|
-
return looseObject(writes2 ? { item: optional(unknown()), next, meta } : {
|
|
3810
|
-
items: optional(array(unknown())),
|
|
3811
|
-
item: optional(unknown()),
|
|
3812
|
-
page: optional(looseObject({ has_more: boolean() })),
|
|
3813
|
-
next,
|
|
3814
|
-
missing: optional(array(looseObject({ field: string(), why: string() }))),
|
|
3815
|
-
meta
|
|
3816
|
-
});
|
|
3817
|
-
}, "agentAnswer");
|
|
3818
|
-
var listedAs = /* @__PURE__ */ __name((prefix, writes2) => {
|
|
3819
|
-
const checked = toStandardJsonSchema(ANSWER);
|
|
3820
|
-
const shown = toStandardJsonSchema(agentAnswer(prefix, writes2))["~standard"].jsonSchema;
|
|
3821
|
-
return { "~standard": { ...checked["~standard"], jsonSchema: shown } };
|
|
3822
|
-
}, "listedAs");
|
|
3823
|
-
var normal = /* @__PURE__ */ __name((command) => command.trim().toLowerCase().split(/[\s_-]+/).join(" "), "normal");
|
|
3824
|
-
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(" "));
|
|
3825
|
-
var wordsOf = /* @__PURE__ */ __name((text3) => text3.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(Boolean), "wordsOf");
|
|
3826
|
-
var stem = /* @__PURE__ */ __name((word2) => {
|
|
3827
|
-
const bare = word2.replace(/'s$/u, "");
|
|
3828
|
-
if (bare.length > 4 && bare.endsWith("ies"))
|
|
3829
|
-
return `${bare.slice(0, -3)}y`;
|
|
3830
|
-
for (const ending of ["ing", "ed", "es", "s"])
|
|
3831
|
-
if (bare.length - ending.length >= 3 && bare.endsWith(ending))
|
|
3832
|
-
return bare.slice(0, -ending.length);
|
|
3833
|
-
return bare;
|
|
3834
|
-
}, "stem");
|
|
3835
|
-
var sameWord = /* @__PURE__ */ __name((asked, known) => {
|
|
3836
|
-
if (asked === known)
|
|
3837
|
-
return true;
|
|
3838
|
-
const [short, long] = asked.length <= known.length ? [asked, known] : [known, asked];
|
|
3839
|
-
return short.length >= 3 && long.startsWith(short);
|
|
3840
|
-
}, "sameWord");
|
|
3841
|
-
var fieldsOf2 = /* @__PURE__ */ __name((command, one) => [
|
|
3842
|
-
[4, [...wordsOf(command), ...(one.aliases ?? []).flatMap(wordsOf)]],
|
|
3843
|
-
[2, wordsOf(one.title)],
|
|
3844
|
-
[1, [...wordsOf(one.description), ...(one.keywords ?? []).flatMap(wordsOf), ...Object.keys(one.input.entries)]]
|
|
3845
|
-
].map(([weight, words]) => [weight, [...new Set(words.map(stem))]]), "fieldsOf");
|
|
3846
|
-
var search = /* @__PURE__ */ __name((commands, query) => {
|
|
3847
|
-
const named = normal(query);
|
|
3848
|
-
const all = Object.entries(commands);
|
|
3849
|
-
if (!named)
|
|
3850
|
-
return all.map((entry) => entry).sort((a, b) => a[0].localeCompare(b[0]));
|
|
3851
|
-
const words = [
|
|
3852
|
-
...new Set(wordsOf(query).filter((word2) => word2.length > 1 && !STOP_WORDS.has(word2)).map(stem))
|
|
3853
|
-
];
|
|
3854
|
-
return all.map((entry) => {
|
|
3855
|
-
const fields = fieldsOf2(entry[0], entry[1]);
|
|
3856
|
-
const weights = words.map((word2) => fields.reduce((best, [weight, known]) => known.some((one) => sameWord(word2, one)) ? Math.max(best, weight) : best, 0));
|
|
3857
|
-
const matched = weights.filter((weight) => weight > 0).length;
|
|
3858
|
-
const exact = normal(entry[0]) === named || (entry[1].aliases ?? []).some((alias) => normal(alias) === named);
|
|
3859
|
-
return { entry, matched, rank: (exact ? 1e3 : 0) + matched * 10 + weights.reduce((a, b) => a + b, 0) };
|
|
3860
|
-
}).filter(({ matched, rank }) => matched > 0 || rank >= 1e3).sort((a, b) => b.rank - a.rank || a.entry[0].localeCompare(b.entry[0])).map(({ entry }) => entry);
|
|
3861
|
-
}, "search");
|
|
3862
|
-
var nearest = /* @__PURE__ */ __name((commands, asked) => {
|
|
3863
|
-
const words = normal(asked).split(" ");
|
|
3864
|
-
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);
|
|
3865
|
-
}, "nearest");
|
|
3866
|
-
var runnableOnly = /* @__PURE__ */ __name((result, offered) => {
|
|
3867
|
-
const body = result.structuredContent;
|
|
3868
|
-
if (result.isError || !Array.isArray(body?.next))
|
|
3869
|
-
return result;
|
|
3870
|
-
const next = body.next.filter((step) => step.command === void 0 || offered(step.command));
|
|
3871
|
-
const { next: _, ...rest } = body;
|
|
3872
|
-
const kept = next.length > 0 ? { ...rest, next } : rest;
|
|
3873
|
-
return {
|
|
3874
|
-
...result,
|
|
3875
|
-
structuredContent: kept,
|
|
3876
|
-
content: result.content.map((part) => part.type === "text" ? { ...part, text: JSON.stringify(kept) } : part)
|
|
3877
|
-
};
|
|
3878
|
-
}, "runnableOnly");
|
|
3879
|
-
var takesNothing = /* @__PURE__ */ __name((one) => Object.values(one.input.entries).every((entry) => entry.type === "optional"), "takesNothing");
|
|
3880
|
-
var sampleOf = /* @__PURE__ */ __name((commands) => {
|
|
3881
|
-
const reading = Object.entries(commands).filter(([, one]) => !one.writes);
|
|
3882
|
-
const bare = reading.filter(([, one]) => takesNothing(one));
|
|
3883
|
-
return bare.find(([command]) => command.endsWith(" list"))?.[0] ?? bare[0]?.[0] ?? reading[0]?.[0] ?? Object.keys(commands)[0] ?? "";
|
|
3884
|
-
}, "sampleOf");
|
|
3885
|
-
var registerCommands = /* @__PURE__ */ __name((server, prefix, commands, errors, withheld, isMessenger) => {
|
|
3886
|
-
const byNormal = new Map(Object.keys(commands).map((command) => [normal(command), command]));
|
|
3887
|
-
const messenger = isMessenger ?? Object.keys(commands).some((command) => command.split(" ")[0] === "messages");
|
|
3888
|
-
const tasks = messenger ? '"unread", "send message", "chat members"' : '"list", "show", "change a setting"';
|
|
3889
|
-
const sample = messenger ? "messages list" : sampleOf(commands);
|
|
3890
|
-
const untrusted = messenger ? UNTRUSTED : UNTRUSTED_NEUTRAL;
|
|
3891
|
-
server.registerTool(`${prefix}_tools_search`, {
|
|
3892
|
-
outputSchema: toStandardJsonSchema(looseObject({})),
|
|
3893
|
-
title: "Find a command",
|
|
3894
|
-
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.`,
|
|
3895
|
-
inputSchema: toStandardJsonSchema(strictObject({ query: optional(pipe(string(), description("words that describe the task"))) })),
|
|
3896
|
-
annotations: { ...READ, openWorldHint: false, idempotentHint: true }
|
|
3897
|
-
}, async ({ query }) => {
|
|
3898
|
-
const found = search(commands, query ?? "");
|
|
3899
|
-
const items = query?.trim() ? found.slice(0, MATCHES).map(([command, one]) => ({
|
|
3900
|
-
command,
|
|
3901
|
-
title: one.title,
|
|
3902
|
-
description: one.description,
|
|
3903
|
-
writes: one.writes,
|
|
3904
|
-
availability: one.availability?.() ?? { available: true },
|
|
3905
|
-
arguments: toJsonSchema(one.input),
|
|
3906
|
-
output: toJsonSchema(one.output ?? ANSWER)
|
|
3907
|
-
})) : found.map(([command, one]) => ({
|
|
3908
|
-
command,
|
|
3909
|
-
title: one.title,
|
|
3910
|
-
writes: one.writes,
|
|
3911
|
-
availability: one.availability?.() ?? { available: true }
|
|
3912
|
-
}));
|
|
3913
|
-
const { next: _paging, ...list } = listOf(`${prefix}_tools_search`, {
|
|
3914
|
-
items,
|
|
3915
|
-
limit: Math.max(items.length, query?.trim() ? MATCHES : 1),
|
|
3916
|
-
has_more: found.length > items.length
|
|
3917
|
-
});
|
|
3918
|
-
return answered(list);
|
|
3919
|
-
});
|
|
3920
|
-
const callers = {
|
|
3921
|
-
env: process.env,
|
|
3922
|
-
client: /* @__PURE__ */ __name(() => server.server.getClientVersion(), "client"),
|
|
3923
|
-
connectionId: randomUUID()
|
|
3924
|
-
};
|
|
3925
|
-
const runner = /* @__PURE__ */ __name((writing) => async ({ command: asked, arguments: given }, ctx) => {
|
|
3926
|
-
try {
|
|
3927
|
-
const command = byNormal.get(normal(asked));
|
|
3928
|
-
const one = command === void 0 ? void 0 : commands[command];
|
|
3929
|
-
if (command === void 0 || !one) {
|
|
3930
|
-
withheld?.(normal(asked));
|
|
3931
|
-
const near = nearest(commands, asked);
|
|
3932
|
-
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`);
|
|
3933
|
-
}
|
|
3934
|
-
if (one.writes !== writing)
|
|
3935
|
-
throw new CliError("validation_error", `"${command}" ${writing ? "only reads" : "writes"}: call it with ${prefix}_${writing ? "read" : "write"}`);
|
|
3936
|
-
const args = writing ? agentArguments(given ?? {}) : given ?? {};
|
|
3937
|
-
const caller = currentCaller() ?? callerOf(ctx, command.replace(/[ -]/g, "_"), callers);
|
|
3938
|
-
if (one.checked)
|
|
3939
|
-
return runnableOnly(await withCaller(caller, () => one.run(args, ctx)), (named) => byNormal.has(normal(named)));
|
|
3940
|
-
const parsed = safeParse(strictObject(one.input.entries), args);
|
|
3941
|
-
if (!parsed.success)
|
|
3942
|
-
throw new CliError("validation_error", `${command}: ${summarize(parsed.issues)}`, {
|
|
3943
|
-
arguments: toJsonSchema(one.input)
|
|
3944
|
-
});
|
|
3945
|
-
return runnableOnly(await withCaller(caller, () => one.run(parsed.output, ctx)), (named) => byNormal.has(normal(named)));
|
|
3946
|
-
} catch (error) {
|
|
3947
|
-
return failed(error, errors);
|
|
3948
|
-
}
|
|
3949
|
-
}, "runner");
|
|
3950
|
-
const call = strictObject({
|
|
3951
|
-
command: pipe(string(), minLength(1), description(`a command ${prefix}_tools_search returned: "${sample}"`)),
|
|
3952
|
-
arguments: optional(pipe(record(string(), unknown()), description("that command's arguments")))
|
|
3953
|
-
});
|
|
3954
|
-
server.registerTool(`${prefix}_read`, {
|
|
3955
|
-
outputSchema: listedAs(prefix, false),
|
|
3956
|
-
title: "Run a reading command",
|
|
3957
|
-
description: `Run one command that only reads, with the arguments ${prefix}_tools_search showed. ${untrusted}`,
|
|
3958
|
-
inputSchema: toStandardJsonSchema(call),
|
|
3959
|
-
annotations: READ
|
|
3960
|
-
}, runner(false));
|
|
3961
|
-
if (Object.values(commands).some((one) => one.writes))
|
|
3962
|
-
server.registerTool(`${prefix}_write`, {
|
|
3963
|
-
outputSchema: listedAs(prefix, true),
|
|
3964
|
-
title: "Run a writing command",
|
|
3965
|
-
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}`,
|
|
3966
|
-
inputSchema: toStandardJsonSchema(call),
|
|
3967
|
-
annotations: WRITE
|
|
3968
|
-
}, runner(true));
|
|
3969
|
-
}, "registerCommands");
|
|
3970
|
-
var surfaceCommands = /* @__PURE__ */ __name((tools, registration) => {
|
|
3971
|
-
const run = entryRunner(registration);
|
|
3972
|
-
return Object.fromEntries(Object.entries(tools).map(([key2, definition]) => [
|
|
3973
|
-
commandOf(key2, definition),
|
|
3974
|
-
{
|
|
3975
|
-
title: definition.title,
|
|
3976
|
-
description: definition.description,
|
|
3977
|
-
writes: definition.annotations.readOnlyHint !== true,
|
|
3978
|
-
input: inputOf(definition, syncAllowedFor(key2, registration.defaults)),
|
|
3979
|
-
...definition.output ? { output: outputSchemaOf(definition) } : {},
|
|
3980
|
-
checked: true,
|
|
3981
|
-
run: /* @__PURE__ */ __name((args, ctx) => run(key2, definition, args, ctx), "run")
|
|
3982
|
-
}
|
|
3983
|
-
]));
|
|
3984
|
-
}, "surfaceCommands");
|
|
3985
|
-
var outputOf = /* @__PURE__ */ __name(({ entity, view }) => answerSchema(ENTITIES[view ? `${entity}.${view}` : entity] ?? unknown()), "outputOf");
|
|
3986
|
-
|
|
3987
3690
|
export {
|
|
3988
3691
|
toolsFromCommands,
|
|
3989
|
-
runCommandForAgent
|
|
3990
|
-
message,
|
|
3991
|
-
READ,
|
|
3992
|
-
WRITE,
|
|
3993
|
-
tool,
|
|
3994
|
-
chatOf,
|
|
3995
|
-
tierOf,
|
|
3996
|
-
outcomeOf,
|
|
3997
|
-
commandOf,
|
|
3998
|
-
toolKey,
|
|
3999
|
-
Picture,
|
|
4000
|
-
BinaryResource,
|
|
4001
|
-
answered,
|
|
4002
|
-
failed,
|
|
4003
|
-
normal,
|
|
4004
|
-
registerCommands,
|
|
4005
|
-
surfaceCommands,
|
|
4006
|
-
outputOf
|
|
3692
|
+
runCommandForAgent
|
|
4007
3693
|
};
|