@wirecat/drive-cli 0.71.0 → 0.72.1
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 -71
- package/contracts/wirecat.json +77 -8
- package/dist/bin/drive.js +2 -2
- package/dist/bundle/agent-GOCD4ZW2.js +46 -0
- package/dist/bundle/{all-profiles-3QJG2NAN.js → all-profiles-PZVP3G73.js} +67 -25
- package/dist/bundle/{anthropic-PSWTEU6G.js → anthropic-PUOTKSYV.js} +9 -9
- package/dist/bundle/{app-server-PVTA6ABR.js → app-server-MKDCXRZM.js} +97 -79
- package/dist/bundle/{bun-LU5LP3JI.js → bun-NS5YLOQT.js} +2 -2
- package/dist/bundle/{bun-sqlite-PYMKLBRU.js → bun-sqlite-KSKWRLLO.js} +9 -9
- package/dist/bundle/{chunk-COOOO5B3.js → chunk-2CG3LUQS.js} +4 -4
- package/dist/bundle/{chunk-YVI5SQPY.js → chunk-2TVHFJKV.js} +1 -1
- package/dist/bundle/chunk-35FIJGTT.js +52 -0
- package/dist/bundle/chunk-35GROSBS.js +3233 -0
- package/dist/bundle/{chunk-D5TGYUVU.js → chunk-3CH7I452.js} +9 -60
- package/dist/bundle/{chunk-ICDCAQ6K.js → chunk-3QBRS3JT.js} +13 -9
- package/dist/bundle/chunk-3T7JIHSO.js +353 -0
- package/dist/bundle/{chunk-Q7DOMFJ4.js → chunk-3VIEGRBA.js} +6 -6
- package/dist/bundle/chunk-3YCUYFTD.js +2159 -0
- package/dist/bundle/{chunk-CJLVYIOP.js → chunk-3ZGWJYSG.js} +30 -21
- package/dist/bundle/{chunk-YPFWNVHV.js → chunk-43PCMVTZ.js} +2 -100
- package/dist/bundle/{chunk-OF422U5D.js → chunk-4DK55MLP.js} +402 -402
- package/dist/bundle/chunk-4HP6KGBI.js +32 -0
- package/dist/bundle/chunk-4P6D6CUS.js +282 -0
- package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
- package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
- package/dist/bundle/{chunk-6W763DZN.js → chunk-54O5NJRC.js} +14 -13
- package/dist/bundle/{chunk-MNLL5YLM.js → chunk-5BHP4FVM.js} +2 -2
- package/dist/bundle/{chunk-ACUAV6VX.js → chunk-6JU4KLAZ.js} +108 -72
- package/dist/bundle/{chunk-YMJ6IDGT.js → chunk-6KND2DYT.js} +38 -8
- package/dist/bundle/{chunk-4HWJOU7N.js → chunk-7YPZPJTB.js} +1 -1
- package/dist/bundle/chunk-A5XNUMW7.js +108 -0
- package/dist/bundle/{chunk-X4TIMMKJ.js → chunk-AG34MPVN.js} +1 -1
- package/dist/bundle/chunk-B5V2U7IS.js +221 -0
- package/dist/bundle/chunk-B6JC5RS3.js +696 -0
- package/dist/bundle/chunk-BDZXGDGI.js +80 -0
- package/dist/bundle/{chunk-B5KSXHJ7.js → chunk-BMTMGMGE.js} +1 -1
- package/dist/bundle/{chunk-ZCR3IRZ2.js → chunk-CP2TZXAG.js} +16 -9
- package/dist/bundle/{chunk-TAUBRNC5.js → chunk-DOEP4EPW.js} +72 -59
- package/dist/bundle/chunk-DQSOYH6N.js +20 -0
- package/dist/bundle/{chunk-QETR5HIZ.js → chunk-E2TMWONO.js} +4385 -2684
- package/dist/bundle/chunk-E5EYJU5R.js +7 -0
- package/dist/bundle/chunk-ECYOTDJM.js +14 -0
- package/dist/bundle/{chunk-HL52XXZX.js → chunk-EXHTGQR2.js} +3 -4
- package/dist/bundle/chunk-F4BX7TH2.js +15 -0
- package/dist/bundle/{chunk-ASMMG72J.js → chunk-FJQO5OHR.js} +261 -565
- package/dist/bundle/{chunk-RJOQH5YY.js → chunk-FKP4T7A4.js} +111 -859
- package/dist/bundle/{chunk-JDV7HNNQ.js → chunk-FTL3WXZB.js} +13 -26
- package/dist/bundle/{chunk-FP54WSIR.js → chunk-G2CH4FRW.js} +4 -4
- package/dist/bundle/chunk-G2KKMQRN.js +30 -0
- package/dist/bundle/{chunk-NYECVHFH.js → chunk-G4NHRFS7.js} +755 -0
- package/dist/bundle/{chunk-Y2NWGNUB.js → chunk-G7SKXAVZ.js} +5 -5
- package/dist/bundle/{chunk-FT3LN3HP.js → chunk-GFI3UUIU.js} +1 -1
- package/dist/bundle/chunk-GTPPUBYU.js +1876 -0
- package/dist/bundle/{chunk-QFR2PNJN.js → chunk-GTROGY74.js} +12 -12
- package/dist/bundle/{chunk-UTO2GO4P.js → chunk-GYAPDUF5.js} +45 -66
- package/dist/bundle/{chunk-GBKNJWOZ.js → chunk-HCMEU7AF.js} +8 -8
- package/dist/bundle/{chunk-FJH7DJWK.js → chunk-HDGJ7IDE.js} +6 -6
- package/dist/bundle/{chunk-Z3KUSRCF.js → chunk-HMN26CVU.js} +2 -2
- package/dist/bundle/{chunk-I4RWW3UD.js → chunk-HOICQNJX.js} +20 -5
- package/dist/bundle/{chunk-P7CUM5IB.js → chunk-HPS2YGSZ.js} +1 -1
- package/dist/bundle/{chunk-HMS6EEQL.js → chunk-HSASPXRW.js} +3 -3
- package/dist/bundle/{chunk-KGYVHPGE.js → chunk-IABPGOMT.js} +2 -2
- package/dist/bundle/{chunk-4QNW4NK6.js → chunk-IBQZT2YD.js} +1 -1
- package/dist/bundle/{chunk-PRW6SYA3.js → chunk-IE3R46YN.js} +313 -257
- package/dist/bundle/{chunk-7PDHGZN4.js → chunk-IE6O7463.js} +4 -4
- package/dist/bundle/{chunk-3UGYFXH6.js → chunk-IPBYU43F.js} +192 -379
- package/dist/bundle/{chunk-RWDKMU74.js → chunk-IS7STZEB.js} +3 -3
- package/dist/bundle/{chunk-GOWXXYEF.js → chunk-IV77ZFF4.js} +4 -4
- package/dist/bundle/{chunk-6XFIITOG.js → chunk-JDGF3YYS.js} +4811 -3486
- package/dist/bundle/{chunk-GPQ44Y2R.js → chunk-JHAACT4I.js} +2 -2
- package/dist/bundle/{chunk-SERXSCN3.js → chunk-JRED7BNX.js} +337 -390
- package/dist/bundle/{chunk-MIA7P6FZ.js → chunk-JSYUB4SM.js} +6 -6
- package/dist/bundle/{chunk-RESDD3Q4.js → chunk-JVM75M4H.js} +16 -3
- package/dist/bundle/{chunk-XF4EXO2C.js → chunk-JZ65CQWK.js} +6 -6
- package/dist/bundle/{chunk-QNRRK3CN.js → chunk-KBR7OC5S.js} +2 -2
- package/dist/bundle/chunk-KI6OOW6D.js +123 -0
- package/dist/bundle/chunk-KOI5G7NM.js +388 -0
- package/dist/bundle/{chunk-ZZ32DXTH.js → chunk-KPBUJQKT.js} +1 -1
- package/dist/bundle/{chunk-2LHAVY4U.js → chunk-KVBGIZ2C.js} +1 -1
- package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
- package/dist/bundle/{chunk-SAKO3P4H.js → chunk-LKUWH6KU.js} +1 -1
- package/dist/bundle/chunk-MA6U4XH2.js +36 -0
- package/dist/bundle/{chunk-TAFHYHKA.js → chunk-MA7ETVTZ.js} +43 -186
- package/dist/bundle/{chunk-KYKW2W6X.js → chunk-MDJUYCHT.js} +1 -1
- package/dist/bundle/chunk-MEYYH47C.js +25 -0
- package/dist/bundle/{chunk-Z56QFOBR.js → chunk-MGC2BAD2.js} +1 -1
- package/dist/bundle/chunk-NMQRSEZM.js +37 -0
- package/dist/bundle/{chunk-5DPV7X27.js → chunk-NTZWY5R3.js} +321 -0
- package/dist/bundle/{chunk-OJSBWP3F.js → chunk-OBDPKDGB.js} +69 -7
- package/dist/bundle/{chunk-WVDCCYS3.js → chunk-ODTBJGWQ.js} +17 -17
- package/dist/bundle/chunk-PB6ACIME.js +80 -0
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-72C4YOCH.js → chunk-PMAV3RNP.js} +7 -7
- package/dist/bundle/chunk-PSY67L73.js +783 -0
- package/dist/bundle/{chunk-6TNNT2MQ.js → chunk-PUVQOZ2N.js} +483 -176
- package/dist/bundle/{chunk-SDKQNOL5.js → chunk-QB7K6PIP.js} +6 -6
- package/dist/bundle/chunk-QK7GKFKB.js +188 -0
- package/dist/bundle/{chunk-4PA4DHYV.js → chunk-QMUWHKP5.js} +6 -6
- package/dist/bundle/chunk-QURQ2OU2.js +250 -0
- package/dist/bundle/{chunk-LXKYKRHD.js → chunk-R3EDZWXF.js} +8 -227
- package/dist/bundle/{chunk-KGERXYTV.js → chunk-RM4DO2WZ.js} +1 -1
- package/dist/bundle/chunk-S27UKJVL.js +730 -0
- package/dist/bundle/{chunk-22QQUKWA.js → chunk-S3SLDYTU.js} +1 -1
- package/dist/bundle/{chunk-FCS26CYQ.js → chunk-SAEBHENE.js} +4 -4
- package/dist/bundle/chunk-SM7Z2BQF.js +561 -0
- package/dist/bundle/{chunk-QXC6IEH6.js → chunk-SODB63MR.js} +201 -423
- package/dist/bundle/{chunk-2PUNKUYJ.js → chunk-SSFGSY77.js} +10320 -9907
- package/dist/bundle/{chunk-37MAA6F2.js → chunk-STUPCKAA.js} +11 -2221
- package/dist/bundle/{chunk-BKSQBBYG.js → chunk-SUQT4KI2.js} +9 -9
- package/dist/bundle/{chunk-YPNWIB6H.js → chunk-SWQDKO6D.js} +3 -3
- package/dist/bundle/chunk-SZ7XJZGH.js +2231 -0
- package/dist/bundle/{chunk-3N2OFXB5.js → chunk-T3OK6AYZ.js} +5 -5
- package/dist/bundle/{chunk-HKY7X6NY.js → chunk-TFIAD57H.js} +4 -4
- package/dist/bundle/chunk-TRYYWV7J.js +291 -0
- package/dist/bundle/{chunk-XMMFBPGC.js → chunk-TUL6MCTY.js} +3 -3
- package/dist/bundle/{chunk-6Y2BYFXQ.js → chunk-UC7JLE6J.js} +0 -7
- package/dist/bundle/{chunk-YJIGGUPI.js → chunk-UL5HSHFU.js} +4 -4
- package/dist/bundle/{chunk-3EBBLKIT.js → chunk-UT64BBEP.js} +4 -4
- package/dist/bundle/{chunk-26DHFMGZ.js → chunk-VBIZD5V5.js} +2 -2
- package/dist/bundle/chunk-VHTELRUA.js +50 -0
- package/dist/bundle/chunk-VOQICE3G.js +340 -0
- package/dist/bundle/{chunk-GZ2D4KXG.js → chunk-WDJRUNQN.js} +35 -12
- package/dist/bundle/{chunk-2UUWXPOB.js → chunk-X5CXANSA.js} +3 -3
- package/dist/bundle/{chunk-35SCQ4VI.js → chunk-X6HPQKAI.js} +43 -35
- package/dist/bundle/{chunk-COJSWDNU.js → chunk-XKWQDQ4B.js} +3 -3
- package/dist/bundle/{chunk-6SJOTNHF.js → chunk-XZEVHUKI.js} +6 -28
- package/dist/bundle/{chunk-JZHBZOJR.js → chunk-YE7DJB3F.js} +3 -3
- package/dist/bundle/chunk-YHWFF6DN.js +39 -0
- package/dist/bundle/{chunk-2BVVU7GG.js → chunk-YJVQ5GST.js} +1 -1
- package/dist/bundle/{chunk-ZM63SUHG.js → chunk-YRCGFSRR.js} +2 -2
- package/dist/bundle/{chunk-EOEU3AZN.js → chunk-ZNFXKFGF.js} +13 -13
- package/dist/bundle/{cli-556DERZL.js → cli-KXRWXGTS.js} +217 -114
- package/dist/bundle/command-contract-BGNT7MTQ.js +45 -0
- package/dist/bundle/{command-server-entry-AYLGNZWD.js → command-server-entry-7FZX74T6.js} +36 -34
- package/dist/bundle/{decode-QU24MWMN.js → decode-SZ6W34U3.js} +10 -10
- package/dist/bundle/{dispatch-4KODNOXV.js → dispatch-4KNSZ3PI.js} +10 -10
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/drive.js +11 -11
- package/dist/bundle/{echarts-BXX4OQWC.js → echarts-ISH62J4E.js} +2 -2
- package/dist/bundle/{embed-KG27KG3D.js → embed-6ODGTZPK.js} +10 -10
- package/dist/bundle/{embedder-IPAVUQUV.js → embedder-6FY67FTQ.js} +15 -15
- package/dist/bundle/entry-2SA6ZX7E.js +25 -0
- package/dist/bundle/{failure-ESL7ETL4.js → failure-V3ILKUTX.js} +4 -4
- package/dist/bundle/first-run-ZNKPPD6M.js +31 -0
- package/dist/bundle/first-screen-WF6GYLPN.js +45 -0
- package/dist/bundle/google-QCADNPCQ.js +46 -0
- package/dist/bundle/{google-api-VCDBSNOW.js → google-api-ZTI3NKZX.js} +88 -73
- package/dist/bundle/grants-BPN5AGDK.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-LOWMVGZY.js → identity-YX4IPGOO.js} +7 -6
- package/dist/bundle/{instructions-2VECIDXF.js → instructions-G5ZGHVFB.js} +1 -1
- package/dist/bundle/{login-7GBONT7V.js → login-CVX5VJX6.js} +96 -81
- package/dist/bundle/{mcp-O6ACR2DX.js → mcp-MQ2L5IIM.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-HKZJMJ6Q.js +28 -0
- package/dist/bundle/meeting-model-DSE4GRVE.js +29 -0
- package/dist/bundle/{meeting-semantic-G7PFOKU7.js → meeting-semantic-OHG2QN2G.js} +10 -10
- package/dist/bundle/{micromark-extension-gfm-GRL24TU6.js → micromark-extension-gfm-OE2GBORZ.js} +11 -78
- package/dist/bundle/{node-MPEQSFI3.js → node-NLJINXVQ.js} +2 -2
- package/dist/bundle/{node-sqlite-OLQMAYB4.js → node-sqlite-KDFQDYVZ.js} +10 -10
- package/dist/bundle/notes-search-3VBVSQ3R.js +70 -0
- package/dist/bundle/oauth-M3E62ZHC.js +22 -0
- package/dist/bundle/{open-OXTE672W.js → open-WVRUVBIZ.js} +8 -8
- package/dist/bundle/{openai-EB3TPIZY.js → openai-JJWOSJMV.js} +22 -21
- package/dist/bundle/{process-F6TKXWWA.js → process-LPVAYRO7.js} +1 -1
- package/dist/bundle/{program-4IFDZ7FM.js → program-ZJRIP25J.js} +276 -1149
- package/dist/bundle/{prompt-F5RRHPN2.js → prompt-XCDHTEAO.js} +8 -8
- package/dist/bundle/{reasons-UORHJDHK.js → reasons-REEEQDAZ.js} +6 -5
- package/dist/bundle/{recognize-DAVNZND3.js → recognize-OZLFDJAT.js} +7 -7
- package/dist/bundle/remote-MDPYVCZB.js +35 -0
- package/dist/bundle/{rerank-CND2GVLZ.js → rerank-FLZWJNHA.js} +11 -11
- package/dist/bundle/{serve-ZHSPUIGX.js → serve-5UV5VLRV.js} +19 -19
- package/dist/bundle/{server-YMAK4LHC.js → server-53A2X2MK.js} +89 -70
- package/dist/bundle/server-5GMURMDE.js +97 -0
- package/dist/bundle/{services-ZILSFJ6E.js → services-XSMH7BXB.js} +109 -89
- package/dist/bundle/{sqlite-runtime-S5VPMZQH.js → sqlite-runtime-E3L7ENFU.js} +9 -9
- package/dist/bundle/{start-CR6X25RT.js → start-4S2VNR4J.js} +7 -7
- package/dist/bundle/{state-YFPHVIIJ.js → state-TQI4JSH7.js} +9 -9
- package/dist/bundle/{store-CL4ZJZRI.js → store-GS7PU6PJ.js} +38 -23
- package/dist/bundle/{store-UODRT6X4.js → store-VYJPL7MW.js} +36 -25
- package/dist/bundle/store-maintenance-command-JJVYUZMG.js +85 -0
- package/dist/bundle/surface-JC4XVMZR.js +83 -0
- package/dist/bundle/tokens-KJQ5EAPW.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 +5 -0
- 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 +5 -2
- package/dist/sync.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-J5Q5FS2N.js +0 -593
- package/dist/bundle/chunk-L46C6HQ7.js +0 -729
- package/dist/bundle/chunk-UDMNY63V.js +0 -899
- package/dist/bundle/chunk-VKE77B3F.js +0 -2
- package/dist/bundle/command-contract-VRTOAV6W.js +0 -43
- package/dist/bundle/entry-MVXQETWS.js +0 -25
- package/dist/bundle/first-run-4UVLW2WR.js +0 -31
- package/dist/bundle/first-screen-JAKAIINI.js +0 -41
- package/dist/bundle/google-22NXXJX5.js +0 -45
- package/dist/bundle/grants-MQMTVCRQ.js +0 -118
- package/dist/bundle/mdast-util-gfm-SZM5GBDF.js +0 -2103
- package/dist/bundle/meeting-combined-LVP4AZKA.js +0 -27
- package/dist/bundle/meeting-model-RAY5XDXZ.js +0 -29
- package/dist/bundle/oauth-SGH2I2BY.js +0 -22
- package/dist/bundle/remote-D5EYYIAU.js +0 -35
- package/dist/bundle/server-DUVJWP3Q.js +0 -80
- package/dist/bundle/store-maintenance-command-DY5XIBWR.js +0 -72
- package/dist/bundle/tokens-AF7QOFOF.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-3UGYFXH6.js";
|
|
4
|
+
commandAvailability
|
|
5
|
+
} from "./chunk-VHTELRUA.js";
|
|
11
6
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
7
|
+
lentConnection
|
|
8
|
+
} from "./chunk-VOQICE3G.js";
|
|
14
9
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./chunk-L46C6HQ7.js";
|
|
10
|
+
QUERY_ARGUMENT
|
|
11
|
+
} from "./chunk-S27UKJVL.js";
|
|
18
12
|
import {
|
|
19
|
-
QUERY_ARGUMENT,
|
|
20
|
-
onlineDeps,
|
|
21
|
-
servicesFor,
|
|
22
|
-
storeModeDeps
|
|
23
|
-
} from "./chunk-2PUNKUYJ.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-SERXSCN3.js";
|
|
45
|
-
import {
|
|
46
|
-
currentCaller,
|
|
47
|
-
keepsSuccess,
|
|
48
|
-
runContextOf,
|
|
49
|
-
withCaller
|
|
50
|
-
} from "./chunk-72C4YOCH.js";
|
|
16
|
+
flatten
|
|
17
|
+
} from "./chunk-JRED7BNX.js";
|
|
51
18
|
import {
|
|
52
|
-
|
|
53
|
-
} from "./chunk-
|
|
19
|
+
currentCaller
|
|
20
|
+
} from "./chunk-PMAV3RNP.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-26DHFMGZ.js";
|
|
26
|
+
} from "./chunk-FKP4T7A4.js";
|
|
63
27
|
import {
|
|
64
28
|
queryDescription
|
|
65
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-4DK55MLP.js";
|
|
66
30
|
import {
|
|
67
31
|
captureStreams
|
|
68
|
-
} from "./chunk-
|
|
69
|
-
import {
|
|
70
|
-
errorObjectOf,
|
|
71
|
-
mcpErrorResult
|
|
72
|
-
} from "./chunk-3N2OFXB5.js";
|
|
32
|
+
} from "./chunk-3ZGWJYSG.js";
|
|
73
33
|
import {
|
|
74
|
-
|
|
75
|
-
} from "./chunk-
|
|
34
|
+
errorObjectOf
|
|
35
|
+
} from "./chunk-T3OK6AYZ.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-OBDPKDGB.js";
|
|
113
64
|
import {
|
|
114
|
-
CliError
|
|
115
|
-
|
|
116
|
-
} from "./chunk-4QNW4NK6.js";
|
|
65
|
+
CliError
|
|
66
|
+
} from "./chunk-IBQZT2YD.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.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/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.130.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.130.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.130.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.130.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.130.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.130.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
|
{
|
|
@@ -580,8 +591,60 @@ var CALENDAR_FLAGS = [
|
|
|
580
591
|
}
|
|
581
592
|
];
|
|
582
593
|
|
|
583
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
594
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.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.130.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
|
|
584
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
|
+
},
|
|
585
648
|
{
|
|
586
649
|
name: "--pipeline",
|
|
587
650
|
value: "<pipeline>",
|
|
@@ -730,7 +793,7 @@ var CRM_FLAGS = [
|
|
|
730
793
|
}
|
|
731
794
|
];
|
|
732
795
|
|
|
733
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
796
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.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
|
|
734
797
|
var HOW_FLAGS = [
|
|
735
798
|
{
|
|
736
799
|
name: "--limit",
|
|
@@ -1110,13 +1173,7 @@ var HOW_FLAGS = [
|
|
|
1110
1173
|
type: "string",
|
|
1111
1174
|
meaning: "a person whose reply counts as an answer; repeat it for more"
|
|
1112
1175
|
},
|
|
1113
|
-
{
|
|
1114
|
-
name: "--browser",
|
|
1115
|
-
value: "<program>",
|
|
1116
|
-
role: "mode",
|
|
1117
|
-
type: "string",
|
|
1118
|
-
meaning: "the browser program to open for sign-in"
|
|
1119
|
-
},
|
|
1176
|
+
{ name: "--browser", value: "<program>", role: "mode", type: "string", meaning: "the browser to open for sign-in" },
|
|
1120
1177
|
{
|
|
1121
1178
|
name: "--credential-storage",
|
|
1122
1179
|
value: "<storage>",
|
|
@@ -1125,6 +1182,8 @@ var HOW_FLAGS = [
|
|
|
1125
1182
|
meaning: "where a sign-in is kept: keyring, which falls back to a private file by itself, or file (WC-SECR-4)"
|
|
1126
1183
|
},
|
|
1127
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" },
|
|
1128
1187
|
{
|
|
1129
1188
|
name: "--expected-event-id",
|
|
1130
1189
|
value: "<id>",
|
|
@@ -1727,7 +1786,7 @@ var HOW_FLAGS = [
|
|
|
1727
1786
|
}
|
|
1728
1787
|
];
|
|
1729
1788
|
|
|
1730
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1789
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.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
|
|
1731
1790
|
var KNOWLEDGE_FLAGS = [
|
|
1732
1791
|
{
|
|
1733
1792
|
name: "--accept-terms",
|
|
@@ -1763,6 +1822,13 @@ var KNOWLEDGE_FLAGS = [
|
|
|
1763
1822
|
meaning: "at most this many characters read",
|
|
1764
1823
|
unit: "characters"
|
|
1765
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
|
+
},
|
|
1766
1832
|
{
|
|
1767
1833
|
name: "--tag",
|
|
1768
1834
|
value: "<name>",
|
|
@@ -1776,10 +1842,24 @@ var KNOWLEDGE_FLAGS = [
|
|
|
1776
1842
|
role: "target",
|
|
1777
1843
|
type: "string",
|
|
1778
1844
|
meaning: "every stored thing a search with this query finds, in its query language; the command acts on each"
|
|
1845
|
+
},
|
|
1846
|
+
{
|
|
1847
|
+
name: "--since",
|
|
1848
|
+
value: "<time>",
|
|
1849
|
+
role: "target",
|
|
1850
|
+
type: "time",
|
|
1851
|
+
meaning: "from this time on: a time, or a duration ago such as 1d"
|
|
1852
|
+
},
|
|
1853
|
+
{
|
|
1854
|
+
name: "--event",
|
|
1855
|
+
value: "<events>",
|
|
1856
|
+
role: "target",
|
|
1857
|
+
type: "list",
|
|
1858
|
+
meaning: "only these kinds of event, comma separated; the command lists them"
|
|
1779
1859
|
}
|
|
1780
1860
|
];
|
|
1781
1861
|
|
|
1782
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1862
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.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
|
|
1783
1863
|
var MAIL_FLAGS = [
|
|
1784
1864
|
{
|
|
1785
1865
|
name: "--cc",
|
|
@@ -1809,7 +1889,38 @@ var MAIL_FLAGS = [
|
|
|
1809
1889
|
}
|
|
1810
1890
|
];
|
|
1811
1891
|
|
|
1812
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1892
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.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
|
|
1893
|
+
var MIRROR_FLAGS = [
|
|
1894
|
+
{
|
|
1895
|
+
name: "--keep",
|
|
1896
|
+
value: "<side>",
|
|
1897
|
+
role: "mode",
|
|
1898
|
+
type: "choice",
|
|
1899
|
+
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"
|
|
1900
|
+
},
|
|
1901
|
+
{
|
|
1902
|
+
name: "--allow-deletions",
|
|
1903
|
+
value: "<count>",
|
|
1904
|
+
role: "mode",
|
|
1905
|
+
type: "count",
|
|
1906
|
+
meaning: "let this run delete up to this many files when the mirror's guard stops it; owner only"
|
|
1907
|
+
},
|
|
1908
|
+
{
|
|
1909
|
+
name: "--allow-replacements",
|
|
1910
|
+
value: "<count>",
|
|
1911
|
+
role: "mode",
|
|
1912
|
+
type: "count",
|
|
1913
|
+
meaning: "let this run overwrite up to this many existing files when the mirror's guard stops it; owner only"
|
|
1914
|
+
},
|
|
1915
|
+
{
|
|
1916
|
+
name: "--repin",
|
|
1917
|
+
role: "mode",
|
|
1918
|
+
type: "switch",
|
|
1919
|
+
meaning: "accept that a replaced local or remote folder is the mirror's folder now, and sync it; owner only"
|
|
1920
|
+
}
|
|
1921
|
+
];
|
|
1922
|
+
|
|
1923
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.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
|
|
1813
1924
|
var PRIVACY_FLAGS = [
|
|
1814
1925
|
{
|
|
1815
1926
|
name: "--about-text",
|
|
@@ -1870,7 +1981,7 @@ var PRIVACY_FLAGS = [
|
|
|
1870
1981
|
{ name: "--read-receipts", value: "<on|off>", role: "value", type: "choice", meaning: "send read receipts" }
|
|
1871
1982
|
];
|
|
1872
1983
|
|
|
1873
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1984
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.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
|
|
1874
1985
|
var SCHEDULE_FLAGS = [
|
|
1875
1986
|
{
|
|
1876
1987
|
name: "--locale",
|
|
@@ -1903,7 +2014,18 @@ var SCHEDULE_FLAGS = [
|
|
|
1903
2014
|
}
|
|
1904
2015
|
];
|
|
1905
2016
|
|
|
1906
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2017
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.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
|
|
2018
|
+
var SEARCH_FLAGS = [
|
|
2019
|
+
{
|
|
2020
|
+
name: "--like",
|
|
2021
|
+
value: "<text>",
|
|
2022
|
+
role: "query",
|
|
2023
|
+
type: "string",
|
|
2024
|
+
meaning: "a made-up example of the text sought, such as a reply that would answer the question, searched by meaning beside the query"
|
|
2025
|
+
}
|
|
2026
|
+
];
|
|
2027
|
+
|
|
2028
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.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
|
|
1907
2029
|
var WHAT_FLAGS = [
|
|
1908
2030
|
{
|
|
1909
2031
|
name: "--analysis-provider",
|
|
@@ -2900,7 +3022,7 @@ var WHAT_FLAGS = [
|
|
|
2900
3022
|
}
|
|
2901
3023
|
];
|
|
2902
3024
|
|
|
2903
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
3025
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.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
|
|
2904
3026
|
var FLAG_TYPES = [
|
|
2905
3027
|
"switch",
|
|
2906
3028
|
"count",
|
|
@@ -3030,6 +3152,10 @@ var verbs = [
|
|
|
3030
3152
|
["export", "write from the store to a file"],
|
|
3031
3153
|
["import", "bring a file or list the user gives into the store or the messenger, once"],
|
|
3032
3154
|
["download", "save a file from the source to this machine"],
|
|
3155
|
+
["upload", "put a file from this machine on the source"],
|
|
3156
|
+
["publish", "open a thing to anyone who has its public link"],
|
|
3157
|
+
["unpublish", "close a thing's public link"],
|
|
3158
|
+
["stale", "mark a saved memory as out of date, keeping it"],
|
|
3033
3159
|
["transcribe", "turn speech into text"],
|
|
3034
3160
|
["extract", "read the text inside files already on this machine into the store"],
|
|
3035
3161
|
["migrate", "bring a file up to this build's schema"],
|
|
@@ -3054,6 +3180,7 @@ var verbs = [
|
|
|
3054
3180
|
"look at a source before taking anything from it: a chat link without joining, a mailbox without importing"
|
|
3055
3181
|
],
|
|
3056
3182
|
["send", "send a message"],
|
|
3183
|
+
["reply", "answer in a comment thread at the source, under the comment that started it"],
|
|
3057
3184
|
["call", "call one provider API method by its own name, generated from the provider's method list"],
|
|
3058
3185
|
["edit", "change a sent message"],
|
|
3059
3186
|
["forward", "send an existing message on to another chat"],
|
|
@@ -3126,6 +3253,8 @@ var collections = [
|
|
|
3126
3253
|
["messages", "posts in a messenger chat, or emails"],
|
|
3127
3254
|
["drafts", "e-mails saved in a mailbox's Drafts folder, written and not sent"],
|
|
3128
3255
|
["polls", "polls in a chat"],
|
|
3256
|
+
["posts", "posts and pages on a site or blog the owner publishes"],
|
|
3257
|
+
["channels", "the sites and social accounts the owner publishes posts on"],
|
|
3129
3258
|
["reactions", "reactions to a message"],
|
|
3130
3259
|
["recipients", "who a message goes to"],
|
|
3131
3260
|
["replies", "the automatic replies of a profile"],
|
|
@@ -3172,7 +3301,13 @@ var collections = [
|
|
|
3172
3301
|
["transactions", "money that moved in or out of a wallet, as the bank or the owner recorded it"],
|
|
3173
3302
|
["splits", "parts of one transaction, each with its own amount and category"],
|
|
3174
3303
|
["users", "people who work in the owner's account at a service, such as a CRM's employees"],
|
|
3304
|
+
["issues", "work items in an issue tracker, each in a team, a workflow state and maybe a project"],
|
|
3305
|
+
["teams", "groups in a tracker that own issues, states and labels"],
|
|
3306
|
+
["states", "the workflow steps a tracker team moves its issues through, each of a type such as started"],
|
|
3307
|
+
["labels", "a tracker's shared labels on issues, kept by the tracker and not by the owner"],
|
|
3175
3308
|
["fields", "a record type's field definitions: code, label, type and options, such as a CRM's custom fields"],
|
|
3309
|
+
["activities", "a CRM's calls, e-mails, meetings, to-dos and comments on its records"],
|
|
3310
|
+
["changes", "what changed in a copied source over a time: records added, moved, closed or reassigned"],
|
|
3176
3311
|
[
|
|
3177
3312
|
"identities",
|
|
3178
3313
|
"ways to reach a person or an organization: an account in one messenger or mailbox, an e-mail address, a phone"
|
|
@@ -3182,7 +3317,17 @@ var collections = [
|
|
|
3182
3317
|
["relationships", "confirmed or suggested links between people, organizations and projects"],
|
|
3183
3318
|
["roles", "the parts a person plays in a relationship, built in or the owner's own"],
|
|
3184
3319
|
["sheets", "remote spreadsheets and their cell ranges, read or changed through a provider"],
|
|
3320
|
+
[
|
|
3321
|
+
"databases",
|
|
3322
|
+
"a source's databases, such as Notion's, each a set of rows with typed properties; the local store's are tables"
|
|
3323
|
+
],
|
|
3324
|
+
["rows", "the records of a database at the source, each with typed values; an order's or an invoice's are lines"],
|
|
3185
3325
|
["files", "files in the source, such as Google Drive, read and changed there"],
|
|
3326
|
+
["mirrors", "saved pairings of a local folder and a folder in the source, which sync keeps the same both ways"],
|
|
3327
|
+
[
|
|
3328
|
+
"conflicts",
|
|
3329
|
+
"files a mirror's sync found changed on both sides and could not merge, each waiting for a side or a final file"
|
|
3330
|
+
],
|
|
3186
3331
|
["comments", "comments people left on a thing in the source: a channel post or a file"],
|
|
3187
3332
|
["meetings", "stored meetings, from Zoom or another provider"],
|
|
3188
3333
|
["calls", "phone calls a phone system recorded, stored as meetings with their transcripts"],
|
|
@@ -3238,6 +3383,10 @@ var singulars = [
|
|
|
3238
3383
|
["privacy", "who may find, see, call or add the account"],
|
|
3239
3384
|
["metadata", "a profile's cached source attributes"],
|
|
3240
3385
|
["auth", "the credentials a bot profile uses: its token and the secrets beside it"],
|
|
3386
|
+
[
|
|
3387
|
+
"scheduled",
|
|
3388
|
+
"a chat's messages the messenger will send later; their ids are their own, never the ids of sent messages"
|
|
3389
|
+
],
|
|
3241
3390
|
[
|
|
3242
3391
|
"schedule",
|
|
3243
3392
|
"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"
|
|
@@ -3245,8 +3394,10 @@ var singulars = [
|
|
|
3245
3394
|
];
|
|
3246
3395
|
var views = [
|
|
3247
3396
|
["tree", "the parent and child hierarchy of stored sources"],
|
|
3397
|
+
["stats", "a thing's own numbers, such as a post's views, as read at each sync"],
|
|
3248
3398
|
["logs", "the log of a running process"],
|
|
3249
3399
|
["events", "what happened in a thing over time"],
|
|
3400
|
+
["changes", "what a sync changed in the local copy since a time: added, changed, deleted or no longer visible"],
|
|
3250
3401
|
["scheduled", "what is scheduled to happen"],
|
|
3251
3402
|
["context", "what surrounds one thing"],
|
|
3252
3403
|
["path", "where a thing is on this machine"],
|
|
@@ -3257,6 +3408,9 @@ var views = [
|
|
|
3257
3408
|
["transcript", "the text of speech: a voice message or a meeting recording"],
|
|
3258
3409
|
["evidence", "the stored messages or lines a result or a reference rests on"],
|
|
3259
3410
|
["passage", "a cited transcript line with bounded surrounding lines from the same revision"],
|
|
3411
|
+
["summary", "the summary a service wrote of a meeting, with its sections and next steps"],
|
|
3412
|
+
["people", "the people found across stored meetings by name or email, with the meetings they were in"],
|
|
3413
|
+
["invitation", "the text that invites people to a meeting: how to join it and when"],
|
|
3260
3414
|
["agenda", "what needs a look today"],
|
|
3261
3415
|
["busy", "when calendars or people are taken, without what takes them"],
|
|
3262
3416
|
["categories", "the categories a thing takes, with what each means"],
|
|
@@ -3316,11 +3470,14 @@ var VOCABULARY = defineVocabulary({
|
|
|
3316
3470
|
...MAIL_FLAGS,
|
|
3317
3471
|
...KNOWLEDGE_FLAGS,
|
|
3318
3472
|
...CRM_FLAGS,
|
|
3319
|
-
...SCHEDULE_FLAGS
|
|
3473
|
+
...SCHEDULE_FLAGS,
|
|
3474
|
+
...CONTENT_FLAGS,
|
|
3475
|
+
...SEARCH_FLAGS,
|
|
3476
|
+
...MIRROR_FLAGS
|
|
3320
3477
|
]
|
|
3321
3478
|
});
|
|
3322
3479
|
|
|
3323
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3480
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/mcp/agent.js
|
|
3324
3481
|
var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
|
|
3325
3482
|
var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
|
|
3326
3483
|
var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
|
|
@@ -3491,7 +3648,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3491
3648
|
const { argv, stdin } = argvOf(info, input, ctx.profile, ctx.stdin);
|
|
3492
3649
|
const lend = ctx.connection;
|
|
3493
3650
|
let borrowed;
|
|
3494
|
-
let
|
|
3651
|
+
let answered = false;
|
|
3495
3652
|
let result;
|
|
3496
3653
|
let failure;
|
|
3497
3654
|
const streams = captureStreams();
|
|
@@ -3513,7 +3670,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3513
3670
|
answer: /* @__PURE__ */ __name(() => null, "answer"),
|
|
3514
3671
|
agent: {
|
|
3515
3672
|
result: /* @__PURE__ */ __name((value) => {
|
|
3516
|
-
|
|
3673
|
+
answered = true;
|
|
3517
3674
|
result = value;
|
|
3518
3675
|
}, "result"),
|
|
3519
3676
|
failure: /* @__PURE__ */ __name((object2) => {
|
|
@@ -3535,7 +3692,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3535
3692
|
}));
|
|
3536
3693
|
if (failure)
|
|
3537
3694
|
return { error: failure };
|
|
3538
|
-
if (
|
|
3695
|
+
if (answered)
|
|
3539
3696
|
return { result };
|
|
3540
3697
|
if (code !== 0)
|
|
3541
3698
|
throw new CliError("invalid_response", `the command exited with ${code} and said nothing`);
|
|
@@ -3547,468 +3704,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3547
3704
|
}
|
|
3548
3705
|
}, "runCommandForAgent");
|
|
3549
3706
|
|
|
3550
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/mcp/tool.js
|
|
3551
|
-
var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
|
|
3552
|
-
var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
|
|
3553
|
-
var message = pipe(
|
|
3554
|
-
string(),
|
|
3555
|
-
maxLength(256),
|
|
3556
|
-
// biome-ignore lint/suspicious/noControlCharactersInRegex: refusing them is the point
|
|
3557
|
-
regex(/^[^\s\x00-\x1F\x7F-\x9F]+$/, "a message id has no spaces or control characters"),
|
|
3558
|
-
description("message id")
|
|
3559
|
-
);
|
|
3560
|
-
var READ = { readOnlyHint: true, destructiveHint: false, openWorldHint: true };
|
|
3561
|
-
var WRITE = {
|
|
3562
|
-
readOnlyHint: false,
|
|
3563
|
-
destructiveHint: true,
|
|
3564
|
-
idempotentHint: false,
|
|
3565
|
-
openWorldHint: true
|
|
3566
|
-
};
|
|
3567
|
-
var tool = /* @__PURE__ */ __name((definition) => definition, "tool");
|
|
3568
|
-
var chatOf = /* @__PURE__ */ __name((messenger) => pipe(string(), minLength(1), description(messenger.chatArgument)), "chatOf");
|
|
3569
|
-
var tierOf = /* @__PURE__ */ __name((key2, definition, messenger) => {
|
|
3570
|
-
if (definition.annotations.readOnlyHint === true)
|
|
3571
|
-
return "read";
|
|
3572
|
-
if (/^admin|_admin/.test(key2))
|
|
3573
|
-
return "admin";
|
|
3574
|
-
if (/delete|ban|kick|remove|purge|block/.test(key2))
|
|
3575
|
-
return "destructive";
|
|
3576
|
-
if (/draft/.test(key2))
|
|
3577
|
-
return "draft";
|
|
3578
|
-
if (key2 === "messages_pin" && messenger?.quietPins === false)
|
|
3579
|
-
return "write-public";
|
|
3580
|
-
if (/mark_read|mark_unread|read_mark|archive|mute|pin|tag|note|label|folder|alias|save|_(un)?star$/.test(key2))
|
|
3581
|
-
return "write-private";
|
|
3582
|
-
return "write-public";
|
|
3583
|
-
}, "tierOf");
|
|
3584
|
-
var effectsOf = /* @__PURE__ */ __name((definition) => {
|
|
3585
|
-
if (definition.effects)
|
|
3586
|
-
return definition.effects;
|
|
3587
|
-
const { readOnlyHint, openWorldHint } = definition.annotations;
|
|
3588
|
-
if (readOnlyHint === true)
|
|
3589
|
-
return { remote: openWorldHint === false ? "none" : "read", local: "read" };
|
|
3590
|
-
return openWorldHint === false ? LOCAL_WRITE : REMOTE_WRITE;
|
|
3591
|
-
}, "effectsOf");
|
|
3592
|
-
var outcomeOf = /* @__PURE__ */ __name((result) => {
|
|
3593
|
-
if (!result.isError)
|
|
3594
|
-
return { status: "ok" };
|
|
3595
|
-
const code = result.structuredContent?.error?.code;
|
|
3596
|
-
const error = typeof code === "string" ? code : "generic_failure";
|
|
3597
|
-
return { status: error === "permission_error" ? "refused" : "failed", error };
|
|
3598
|
-
}, "outcomeOf");
|
|
3599
|
-
var commandOf = /* @__PURE__ */ __name((name, definition) => definition.command ?? name.replaceAll("_", " "), "commandOf");
|
|
3600
|
-
var toolKey = /* @__PURE__ */ __name((name, definition) => definition.key !== void 0 ? definition.key : keyForCommand(commandOf(name, definition).split(" ")), "toolKey");
|
|
3601
|
-
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");
|
|
3602
|
-
var syncAllowedFor = /* @__PURE__ */ __name((key2, defaults) => {
|
|
3603
|
-
const permissions = defaults.settings.permissions ?? {};
|
|
3604
|
-
const shared = defaults.syncAllowed ?? fetchesAt(levelFor(permissions, "messages.sync-first").level);
|
|
3605
|
-
return shared && (!key2.startsWith("stats_") || fetchesAt(levelFor(permissions, `${key2.replaceAll("_", ".")}.sync-first`).level));
|
|
3606
|
-
}, "syncAllowedFor");
|
|
3607
|
-
var entryRunner = /* @__PURE__ */ __name((registration) => {
|
|
3608
|
-
const run = callRunner(registration);
|
|
3609
|
-
const { log } = registration;
|
|
3610
|
-
return async (key2, definition, args, ctx) => {
|
|
3611
|
-
const startedAt = Date.now();
|
|
3612
|
-
const command = `mcp ${commandOf(key2, definition)}`;
|
|
3613
|
-
const traceId = traceIdOf(ctx?.mcpReq?._meta?.traceparent);
|
|
3614
|
-
const app = registration.messenger?.app;
|
|
3615
|
-
const caller = registration.callers ? callerOf(ctx, key2, registration.callers) : currentCaller();
|
|
3616
|
-
const env = registration.defaults.env ?? process.env;
|
|
3617
|
-
const settings = registration.defaults.settings;
|
|
3618
|
-
const recording = key2 !== "runs_search" && settings.keepFailedRuns !== false && app?.appName ? startRecording({
|
|
3619
|
-
app,
|
|
3620
|
-
command,
|
|
3621
|
-
...settings.profile === void 0 ? {} : { profile: settings.profile },
|
|
3622
|
-
env,
|
|
3623
|
-
record: keepsSuccess({ record: settings.record ?? true, fromFlag: false, env, caller }),
|
|
3624
|
-
keepFailed: true,
|
|
3625
|
-
trace: false,
|
|
3626
|
-
format: "json",
|
|
3627
|
-
context: runContextOf({ bin: app.command, command, env, caller }),
|
|
3628
|
-
...settings.keepRunsForDays === void 0 ? {} : { keepDays: settings.keepRunsForDays },
|
|
3629
|
-
...settings.keepSuccessfulRunsForDays === void 0 ? {} : { keepSuccessDays: settings.keepSuccessfulRunsForDays },
|
|
3630
|
-
...settings.runsSizeLimitMb === void 0 ? {} : { maxBytes: settings.runsSizeLimitMb * 1024 * 1024 },
|
|
3631
|
-
...traceId === void 0 ? {} : { traceId }
|
|
3632
|
-
}) : void 0;
|
|
3633
|
-
const profile = registration.defaults.settings.profile;
|
|
3634
|
-
const scope = {
|
|
3635
|
-
runId: recording?.runId ?? newRunId(new Date(startedAt), command),
|
|
3636
|
-
command,
|
|
3637
|
-
startedAt,
|
|
3638
|
-
...profile === void 0 ? {} : { profile },
|
|
3639
|
-
...traceId === void 0 ? {} : { traceId },
|
|
3640
|
-
...recording ? { events: recording.events } : {}
|
|
3641
|
-
};
|
|
3642
|
-
const work = /* @__PURE__ */ __name(() => inRun(scope, () => {
|
|
3643
|
-
const input = inputOf(definition, syncAllowedFor(key2, registration.defaults));
|
|
3644
|
-
const parsed = safeParse(input, args);
|
|
3645
|
-
return parsed.success ? run(key2, definition, parsed.output, ctx) : failed(new CliError("validation_error", `${commandOf(key2, definition)}: ${summarize(parsed.issues)}`, {
|
|
3646
|
-
arguments: toJsonSchema(input)
|
|
3647
|
-
}), app?.errors);
|
|
3648
|
-
}), "work");
|
|
3649
|
-
const result = await (caller ? withCaller(caller, work) : work());
|
|
3650
|
-
if (recording) {
|
|
3651
|
-
if (result.isError) {
|
|
3652
|
-
const error = result.structuredContent?.error;
|
|
3653
|
-
const code = error?.code && errorCodes.includes(error.code) ? error.code : void 0;
|
|
3654
|
-
await recording.fail(code ? new CliError(code, "MCP operation failed") : new Error("MCP operation failed")).catch(() => void 0);
|
|
3655
|
-
} else
|
|
3656
|
-
await recording.succeed(result.structuredContent).catch(() => void 0);
|
|
3657
|
-
}
|
|
3658
|
-
await log?.({
|
|
3659
|
-
tool: key2,
|
|
3660
|
-
tier: tierOf(key2, definition, registration.messenger),
|
|
3661
|
-
...outcomeOf(result),
|
|
3662
|
-
startedAt,
|
|
3663
|
-
finishedAt: Date.now()
|
|
3664
|
-
}, caller)?.catch(() => void 0);
|
|
3665
|
-
return result;
|
|
3666
|
-
};
|
|
3667
|
-
}, "entryRunner");
|
|
3668
|
-
var callRunner = /* @__PURE__ */ __name(({ messenger, session, withStore, withServices, defaults, around, targets }) => {
|
|
3669
|
-
const where = {
|
|
3670
|
-
profile: defaults.settings.profile,
|
|
3671
|
-
env: defaults.env,
|
|
3672
|
-
pictures: defaults.settings.pictureSearch,
|
|
3673
|
-
reranker: defaults.settings.searchReranker
|
|
3674
|
-
};
|
|
3675
|
-
return async (key2, definition, args, ctx) => {
|
|
3676
|
-
const path = commandOf(key2, definition).split(" ");
|
|
3677
|
-
const run = `mcp ${path.join(" ")}`;
|
|
3678
|
-
try {
|
|
3679
|
-
const execute = /* @__PURE__ */ __name(async () => {
|
|
3680
|
-
const syncAllowed = syncAllowedFor(key2, defaults);
|
|
3681
|
-
if (Buffer.byteLength(JSON.stringify(args)) > MAX_BUFFERED_INPUT)
|
|
3682
|
-
throw new CliError("validation_error", "tool arguments exceed the buffered input limit", {
|
|
3683
|
-
reason: "input.too-large",
|
|
3684
|
-
max_bytes: MAX_BUFFERED_INPUT,
|
|
3685
|
-
retryable: false
|
|
3686
|
-
});
|
|
3687
|
-
definition.check?.(args);
|
|
3688
|
-
if (definition.changesStore)
|
|
3689
|
-
refuseStoreChange(messenger.app, defaults.env);
|
|
3690
|
-
refuseLacking(messenger, path);
|
|
3691
|
-
for (const permission of readKeysForCommand(path)) {
|
|
3692
|
-
if (levelFor(defaults.settings.permissions ?? {}, permission).level === "deny")
|
|
3693
|
-
throw new CliError("permission_error", `profile denies ${permission}`, { permission });
|
|
3694
|
-
}
|
|
3695
|
-
if (args.sync_first && !syncAllowed)
|
|
3696
|
-
throw new CliError("permission_error", "messages.sync-first is not allowed by this profile");
|
|
3697
|
-
if (definition.custom) {
|
|
3698
|
-
const result2 = await definition.custom(args, { ...defaults, signal: ctx.mcpReq.signal }, ctx);
|
|
3699
|
-
return answered(result2, definition.outputLimit?.(args, defaults), targets);
|
|
3700
|
-
}
|
|
3701
|
-
if (definition.local)
|
|
3702
|
-
return answered(await definition.local(args, defaults), definition.outputLimit?.(args, defaults), targets);
|
|
3703
|
-
const { online, stored: local, served } = definition;
|
|
3704
|
-
const stored = local && (!definition.storedWhen || definition.storedWhen(args)) ? local : void 0;
|
|
3705
|
-
const result = stored ? await withStore((store, account) => stored(store, account, args, { ...defaults, signal: ctx.mcpReq.signal }, (work) => session.use(run, work)), {
|
|
3706
|
-
name: run
|
|
3707
|
-
}) : served && withServices ? await withServices((services, connect) => served(services, args, defaults, connect), { name: run }) : served && messenger.history === "store" ? await withStore((store, account) => served(servicesFor({
|
|
3708
|
-
...storeModeDeps(messenger, store, account, defaults.guard),
|
|
3709
|
-
...where,
|
|
3710
|
-
embedders: defaults.embedders
|
|
3711
|
-
}), args, defaults, (work) => session.use(run, async (adapter, release) => {
|
|
3712
|
-
try {
|
|
3713
|
-
return await work(adapter);
|
|
3714
|
-
} finally {
|
|
3715
|
-
await release();
|
|
3716
|
-
}
|
|
3717
|
-
})), { name: run }) : served ? await session.use(run, (adapter, release) => served(servicesFor(onlineDeps(messenger, adapter, defaults.guard, where)), args, defaults, (work) => (async () => {
|
|
3718
|
-
try {
|
|
3719
|
-
return await work(adapter);
|
|
3720
|
-
} finally {
|
|
3721
|
-
await release();
|
|
3722
|
-
}
|
|
3723
|
-
})())) : await session.use(run, (adapter, release) => online(adapter, args, { ...defaults, release }));
|
|
3724
|
-
return answered(result, definition.outputLimit?.(args, defaults), targets);
|
|
3725
|
-
}, "execute");
|
|
3726
|
-
return around ? await around(key2, definition, execute) : await execute();
|
|
3727
|
-
} catch (error) {
|
|
3728
|
-
return failed(error, messenger?.app?.errors, effectsOf(definition));
|
|
3729
|
-
}
|
|
3730
|
-
};
|
|
3731
|
-
}, "callRunner");
|
|
3732
|
-
var outputSchemaOf = /* @__PURE__ */ __name((definition) => {
|
|
3733
|
-
if (!definition.output)
|
|
3734
|
-
return looseObject({});
|
|
3735
|
-
const entity = ENTITIES[definition.output.entity];
|
|
3736
|
-
return definition.output.list ? listEnvelopeSchema(entity) : itemEnvelopeSchema(entity);
|
|
3737
|
-
}, "outputSchemaOf");
|
|
3738
|
-
var Picture = class {
|
|
3739
|
-
static {
|
|
3740
|
-
__name(this, "Picture");
|
|
3741
|
-
}
|
|
3742
|
-
bytes;
|
|
3743
|
-
mimeType;
|
|
3744
|
-
about;
|
|
3745
|
-
constructor(bytes, mimeType, about) {
|
|
3746
|
-
this.bytes = bytes;
|
|
3747
|
-
this.mimeType = mimeType;
|
|
3748
|
-
this.about = about;
|
|
3749
|
-
}
|
|
3750
|
-
};
|
|
3751
|
-
var BinaryResource = class {
|
|
3752
|
-
static {
|
|
3753
|
-
__name(this, "BinaryResource");
|
|
3754
|
-
}
|
|
3755
|
-
base64;
|
|
3756
|
-
mimeType;
|
|
3757
|
-
uri;
|
|
3758
|
-
about;
|
|
3759
|
-
constructor(base64, mimeType, uri, about) {
|
|
3760
|
-
this.base64 = base64;
|
|
3761
|
-
this.mimeType = mimeType;
|
|
3762
|
-
this.uri = uri;
|
|
3763
|
-
this.about = about;
|
|
3764
|
-
}
|
|
3765
|
-
};
|
|
3766
|
-
var answered = /* @__PURE__ */ __name((answer, maxBytes = DEFAULT_OUTPUT_BYTES, targets) => {
|
|
3767
|
-
const bounded = /* @__PURE__ */ __name((result) => {
|
|
3768
|
-
if (maxBytes !== 0 && Buffer.byteLength(JSON.stringify(result.content)) > maxBytes)
|
|
3769
|
-
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 });
|
|
3770
|
-
return result;
|
|
3771
|
-
}, "bounded");
|
|
3772
|
-
if (answer === null || Array.isArray(answer) || typeof answer !== "object")
|
|
3773
|
-
throw new CliError("invalid_response", "tool result must be an object", { retryable: false });
|
|
3774
|
-
const objectBody = /* @__PURE__ */ __name((value) => {
|
|
3775
|
-
const serialized = JSON.parse(agentJson(value));
|
|
3776
|
-
if (serialized === null || Array.isArray(serialized) || typeof serialized !== "object")
|
|
3777
|
-
throw new CliError("invalid_response", "serialized tool result must be an object", { retryable: false });
|
|
3778
|
-
return serialized;
|
|
3779
|
-
}, "objectBody");
|
|
3780
|
-
if (answer instanceof BinaryResource) {
|
|
3781
|
-
const about = sealed(answer.about);
|
|
3782
|
-
return bounded({
|
|
3783
|
-
structuredContent: objectBody(about),
|
|
3784
|
-
content: [
|
|
3785
|
-
{ type: "resource", resource: { uri: answer.uri, mimeType: answer.mimeType, blob: answer.base64 } },
|
|
3786
|
-
{ type: "text", text: agentJson(about) }
|
|
3787
|
-
]
|
|
3788
|
-
});
|
|
3789
|
-
}
|
|
3790
|
-
if (answer instanceof Picture) {
|
|
3791
|
-
const about = sealed(answer.about);
|
|
3792
|
-
return bounded({
|
|
3793
|
-
structuredContent: objectBody(about),
|
|
3794
|
-
content: [
|
|
3795
|
-
{ type: "image", data: Buffer.from(answer.bytes).toString("base64"), mimeType: answer.mimeType },
|
|
3796
|
-
{ type: "text", text: agentJson(about) }
|
|
3797
|
-
]
|
|
3798
|
-
});
|
|
3799
|
-
}
|
|
3800
|
-
const body = objectBody(sealed(targets ? judgedAnswer(answer, targets) : answer));
|
|
3801
|
-
return bounded({ content: [{ type: "text", text: JSON.stringify(body) }], structuredContent: body });
|
|
3802
|
-
}, "answered");
|
|
3803
|
-
var failed = /* @__PURE__ */ __name((error, errors, effects) => {
|
|
3804
|
-
const judged = judgedEffects(effects);
|
|
3805
|
-
const context = { ...failureContext(errors), ...judged ? { effects: judged } : {} };
|
|
3806
|
-
return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(storeDamaged(error), context))));
|
|
3807
|
-
}, "failed");
|
|
3808
|
-
|
|
3809
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/mcp/surface.js
|
|
3810
|
-
import { randomUUID } from "node:crypto";
|
|
3811
|
-
var MATCHES = 8;
|
|
3812
|
-
var ANSWER = answerSchema();
|
|
3813
|
-
var agentAnswer = /* @__PURE__ */ __name((prefix, writes2) => {
|
|
3814
|
-
const meta = pipe(looseObject({}), description(`run facts; ${prefix}_tools_search shows the full answer`));
|
|
3815
|
-
const next = optional(pipe(array(looseObject({})), description("steps to run next: command and args")));
|
|
3816
|
-
return looseObject(writes2 ? { item: optional(unknown()), next, meta } : {
|
|
3817
|
-
items: optional(array(unknown())),
|
|
3818
|
-
item: optional(unknown()),
|
|
3819
|
-
page: optional(looseObject({ has_more: boolean() })),
|
|
3820
|
-
next,
|
|
3821
|
-
missing: optional(array(looseObject({ field: string(), why: string() }))),
|
|
3822
|
-
meta
|
|
3823
|
-
});
|
|
3824
|
-
}, "agentAnswer");
|
|
3825
|
-
var listedAs = /* @__PURE__ */ __name((prefix, writes2) => {
|
|
3826
|
-
const checked = toStandardJsonSchema(ANSWER);
|
|
3827
|
-
const shown = toStandardJsonSchema(agentAnswer(prefix, writes2))["~standard"].jsonSchema;
|
|
3828
|
-
return { "~standard": { ...checked["~standard"], jsonSchema: shown } };
|
|
3829
|
-
}, "listedAs");
|
|
3830
|
-
var normal = /* @__PURE__ */ __name((command) => command.trim().toLowerCase().split(/[\s_-]+/).join(" "), "normal");
|
|
3831
|
-
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(" "));
|
|
3832
|
-
var wordsOf = /* @__PURE__ */ __name((text3) => text3.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(Boolean), "wordsOf");
|
|
3833
|
-
var stem = /* @__PURE__ */ __name((word2) => {
|
|
3834
|
-
const bare = word2.replace(/'s$/u, "");
|
|
3835
|
-
if (bare.length > 4 && bare.endsWith("ies"))
|
|
3836
|
-
return `${bare.slice(0, -3)}y`;
|
|
3837
|
-
for (const ending of ["ing", "ed", "es", "s"])
|
|
3838
|
-
if (bare.length - ending.length >= 3 && bare.endsWith(ending))
|
|
3839
|
-
return bare.slice(0, -ending.length);
|
|
3840
|
-
return bare;
|
|
3841
|
-
}, "stem");
|
|
3842
|
-
var sameWord = /* @__PURE__ */ __name((asked, known) => {
|
|
3843
|
-
if (asked === known)
|
|
3844
|
-
return true;
|
|
3845
|
-
const [short, long] = asked.length <= known.length ? [asked, known] : [known, asked];
|
|
3846
|
-
return short.length >= 3 && long.startsWith(short);
|
|
3847
|
-
}, "sameWord");
|
|
3848
|
-
var fieldsOf2 = /* @__PURE__ */ __name((command, one) => [
|
|
3849
|
-
[4, [...wordsOf(command), ...(one.aliases ?? []).flatMap(wordsOf)]],
|
|
3850
|
-
[2, wordsOf(one.title)],
|
|
3851
|
-
[1, [...wordsOf(one.description), ...(one.keywords ?? []).flatMap(wordsOf), ...Object.keys(one.input.entries)]]
|
|
3852
|
-
].map(([weight, words]) => [weight, [...new Set(words.map(stem))]]), "fieldsOf");
|
|
3853
|
-
var search = /* @__PURE__ */ __name((commands, query) => {
|
|
3854
|
-
const named = normal(query);
|
|
3855
|
-
const all = Object.entries(commands);
|
|
3856
|
-
if (!named)
|
|
3857
|
-
return all.map((entry) => entry).sort((a, b) => a[0].localeCompare(b[0]));
|
|
3858
|
-
const words = [
|
|
3859
|
-
...new Set(wordsOf(query).filter((word2) => word2.length > 1 && !STOP_WORDS.has(word2)).map(stem))
|
|
3860
|
-
];
|
|
3861
|
-
return all.map((entry) => {
|
|
3862
|
-
const fields = fieldsOf2(entry[0], entry[1]);
|
|
3863
|
-
const weights = words.map((word2) => fields.reduce((best, [weight, known]) => known.some((one) => sameWord(word2, one)) ? Math.max(best, weight) : best, 0));
|
|
3864
|
-
const matched = weights.filter((weight) => weight > 0).length;
|
|
3865
|
-
const exact = normal(entry[0]) === named || (entry[1].aliases ?? []).some((alias) => normal(alias) === named);
|
|
3866
|
-
return { entry, matched, rank: (exact ? 1e3 : 0) + matched * 10 + weights.reduce((a, b) => a + b, 0) };
|
|
3867
|
-
}).filter(({ matched, rank }) => matched > 0 || rank >= 1e3).sort((a, b) => b.rank - a.rank || a.entry[0].localeCompare(b.entry[0])).map(({ entry }) => entry);
|
|
3868
|
-
}, "search");
|
|
3869
|
-
var nearest = /* @__PURE__ */ __name((commands, asked) => {
|
|
3870
|
-
const words = normal(asked).split(" ");
|
|
3871
|
-
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);
|
|
3872
|
-
}, "nearest");
|
|
3873
|
-
var runnableOnly = /* @__PURE__ */ __name((result, offered) => {
|
|
3874
|
-
const body = result.structuredContent;
|
|
3875
|
-
if (result.isError || !Array.isArray(body?.next))
|
|
3876
|
-
return result;
|
|
3877
|
-
const next = body.next.filter((step) => step.command === void 0 || offered(step.command));
|
|
3878
|
-
const { next: _, ...rest } = body;
|
|
3879
|
-
const kept = next.length > 0 ? { ...rest, next } : rest;
|
|
3880
|
-
return {
|
|
3881
|
-
...result,
|
|
3882
|
-
structuredContent: kept,
|
|
3883
|
-
content: result.content.map((part) => part.type === "text" ? { ...part, text: JSON.stringify(kept) } : part)
|
|
3884
|
-
};
|
|
3885
|
-
}, "runnableOnly");
|
|
3886
|
-
var takesNothing = /* @__PURE__ */ __name((one) => Object.values(one.input.entries).every((entry) => entry.type === "optional"), "takesNothing");
|
|
3887
|
-
var sampleOf = /* @__PURE__ */ __name((commands) => {
|
|
3888
|
-
const reading = Object.entries(commands).filter(([, one]) => !one.writes);
|
|
3889
|
-
const bare = reading.filter(([, one]) => takesNothing(one));
|
|
3890
|
-
return bare.find(([command]) => command.endsWith(" list"))?.[0] ?? bare[0]?.[0] ?? reading[0]?.[0] ?? Object.keys(commands)[0] ?? "";
|
|
3891
|
-
}, "sampleOf");
|
|
3892
|
-
var registerCommands = /* @__PURE__ */ __name((server, prefix, commands, errors, withheld, isMessenger) => {
|
|
3893
|
-
const byNormal = new Map(Object.keys(commands).map((command) => [normal(command), command]));
|
|
3894
|
-
const messenger = isMessenger ?? Object.keys(commands).some((command) => command.split(" ")[0] === "messages");
|
|
3895
|
-
const tasks = messenger ? '"unread", "send message", "chat members"' : '"list", "show", "change a setting"';
|
|
3896
|
-
const sample = messenger ? "messages list" : sampleOf(commands);
|
|
3897
|
-
const untrusted = messenger ? UNTRUSTED : UNTRUSTED_NEUTRAL;
|
|
3898
|
-
server.registerTool(`${prefix}_tools_search`, {
|
|
3899
|
-
outputSchema: toStandardJsonSchema(looseObject({})),
|
|
3900
|
-
title: "Find a command",
|
|
3901
|
-
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.`,
|
|
3902
|
-
inputSchema: toStandardJsonSchema(strictObject({ query: optional(pipe(string(), description("words that describe the task"))) })),
|
|
3903
|
-
annotations: { ...READ, openWorldHint: false, idempotentHint: true }
|
|
3904
|
-
}, async ({ query }) => {
|
|
3905
|
-
const found = search(commands, query ?? "");
|
|
3906
|
-
const items = query?.trim() ? found.slice(0, MATCHES).map(([command, one]) => ({
|
|
3907
|
-
command,
|
|
3908
|
-
title: one.title,
|
|
3909
|
-
description: one.description,
|
|
3910
|
-
writes: one.writes,
|
|
3911
|
-
availability: one.availability?.() ?? { available: true },
|
|
3912
|
-
arguments: toJsonSchema(one.input),
|
|
3913
|
-
output: toJsonSchema(one.output ?? ANSWER)
|
|
3914
|
-
})) : found.map(([command, one]) => ({
|
|
3915
|
-
command,
|
|
3916
|
-
title: one.title,
|
|
3917
|
-
writes: one.writes,
|
|
3918
|
-
availability: one.availability?.() ?? { available: true }
|
|
3919
|
-
}));
|
|
3920
|
-
const { next: _paging, ...list } = listOf(`${prefix}_tools_search`, {
|
|
3921
|
-
items,
|
|
3922
|
-
limit: Math.max(items.length, query?.trim() ? MATCHES : 1),
|
|
3923
|
-
has_more: found.length > items.length
|
|
3924
|
-
});
|
|
3925
|
-
return answered(list);
|
|
3926
|
-
});
|
|
3927
|
-
const callers = {
|
|
3928
|
-
env: process.env,
|
|
3929
|
-
client: /* @__PURE__ */ __name(() => server.server.getClientVersion(), "client"),
|
|
3930
|
-
connectionId: randomUUID()
|
|
3931
|
-
};
|
|
3932
|
-
const runner = /* @__PURE__ */ __name((writing) => async ({ command: asked, arguments: given }, ctx) => {
|
|
3933
|
-
try {
|
|
3934
|
-
const command = byNormal.get(normal(asked));
|
|
3935
|
-
const one = command === void 0 ? void 0 : commands[command];
|
|
3936
|
-
if (command === void 0 || !one) {
|
|
3937
|
-
withheld?.(normal(asked));
|
|
3938
|
-
const near = nearest(commands, asked);
|
|
3939
|
-
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`);
|
|
3940
|
-
}
|
|
3941
|
-
if (one.writes !== writing)
|
|
3942
|
-
throw new CliError("validation_error", `"${command}" ${writing ? "only reads" : "writes"}: call it with ${prefix}_${writing ? "read" : "write"}`);
|
|
3943
|
-
const args = writing ? agentArguments(given ?? {}) : given ?? {};
|
|
3944
|
-
const caller = currentCaller() ?? callerOf(ctx, command.replace(/[ -]/g, "_"), callers);
|
|
3945
|
-
if (one.checked)
|
|
3946
|
-
return runnableOnly(await withCaller(caller, () => one.run(args, ctx)), (named) => byNormal.has(normal(named)));
|
|
3947
|
-
const parsed = safeParse(strictObject(one.input.entries), args);
|
|
3948
|
-
if (!parsed.success)
|
|
3949
|
-
throw new CliError("validation_error", `${command}: ${summarize(parsed.issues)}`, {
|
|
3950
|
-
arguments: toJsonSchema(one.input)
|
|
3951
|
-
});
|
|
3952
|
-
return runnableOnly(await withCaller(caller, () => one.run(parsed.output, ctx)), (named) => byNormal.has(normal(named)));
|
|
3953
|
-
} catch (error) {
|
|
3954
|
-
return failed(error, errors);
|
|
3955
|
-
}
|
|
3956
|
-
}, "runner");
|
|
3957
|
-
const call = strictObject({
|
|
3958
|
-
command: pipe(string(), minLength(1), description(`a command ${prefix}_tools_search returned: "${sample}"`)),
|
|
3959
|
-
arguments: optional(pipe(record(string(), unknown()), description("that command's arguments")))
|
|
3960
|
-
});
|
|
3961
|
-
server.registerTool(`${prefix}_read`, {
|
|
3962
|
-
outputSchema: listedAs(prefix, false),
|
|
3963
|
-
title: "Run a reading command",
|
|
3964
|
-
description: `Run one command that only reads, with the arguments ${prefix}_tools_search showed. ${untrusted}`,
|
|
3965
|
-
inputSchema: toStandardJsonSchema(call),
|
|
3966
|
-
annotations: READ
|
|
3967
|
-
}, runner(false));
|
|
3968
|
-
if (Object.values(commands).some((one) => one.writes))
|
|
3969
|
-
server.registerTool(`${prefix}_write`, {
|
|
3970
|
-
outputSchema: listedAs(prefix, true),
|
|
3971
|
-
title: "Run a writing command",
|
|
3972
|
-
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}`,
|
|
3973
|
-
inputSchema: toStandardJsonSchema(call),
|
|
3974
|
-
annotations: WRITE
|
|
3975
|
-
}, runner(true));
|
|
3976
|
-
}, "registerCommands");
|
|
3977
|
-
var surfaceCommands = /* @__PURE__ */ __name((tools, registration) => {
|
|
3978
|
-
const run = entryRunner(registration);
|
|
3979
|
-
return Object.fromEntries(Object.entries(tools).map(([key2, definition]) => [
|
|
3980
|
-
commandOf(key2, definition),
|
|
3981
|
-
{
|
|
3982
|
-
title: definition.title,
|
|
3983
|
-
description: definition.description,
|
|
3984
|
-
writes: definition.annotations.readOnlyHint !== true,
|
|
3985
|
-
input: inputOf(definition, syncAllowedFor(key2, registration.defaults)),
|
|
3986
|
-
...definition.output ? { output: outputSchemaOf(definition) } : {},
|
|
3987
|
-
checked: true,
|
|
3988
|
-
run: /* @__PURE__ */ __name((args, ctx) => run(key2, definition, args, ctx), "run")
|
|
3989
|
-
}
|
|
3990
|
-
]));
|
|
3991
|
-
}, "surfaceCommands");
|
|
3992
|
-
var outputOf = /* @__PURE__ */ __name(({ entity, view }) => answerSchema(ENTITIES[view ? `${entity}.${view}` : entity] ?? unknown()), "outputOf");
|
|
3993
|
-
|
|
3994
3707
|
export {
|
|
3995
3708
|
toolsFromCommands,
|
|
3996
|
-
runCommandForAgent
|
|
3997
|
-
message,
|
|
3998
|
-
READ,
|
|
3999
|
-
WRITE,
|
|
4000
|
-
tool,
|
|
4001
|
-
chatOf,
|
|
4002
|
-
tierOf,
|
|
4003
|
-
outcomeOf,
|
|
4004
|
-
commandOf,
|
|
4005
|
-
toolKey,
|
|
4006
|
-
Picture,
|
|
4007
|
-
BinaryResource,
|
|
4008
|
-
answered,
|
|
4009
|
-
failed,
|
|
4010
|
-
normal,
|
|
4011
|
-
registerCommands,
|
|
4012
|
-
surfaceCommands,
|
|
4013
|
-
outputOf
|
|
3709
|
+
runCommandForAgent
|
|
4014
3710
|
};
|