@wirecat/tg-cli 0.100.0 → 0.102.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 +3 -3
- package/dist/bin/tg.js +1 -1
- package/dist/bot/transport.d.ts.map +1 -1
- package/dist/bot/transport.js +14 -17
- package/dist/bot/transport.js.map +1 -1
- package/dist/bundle/{adapter-2LVPMFKF.js → adapter-M2HRSFFL.js} +95 -33
- package/dist/bundle/{all-profiles-BLTK2AAB.js → all-profiles-GOD2QNTK.js} +42 -12
- package/dist/bundle/{anthropic-RJE4XEOO.js → anthropic-LKU7RWMA.js} +5 -5
- package/dist/bundle/{bot-api-4XM3NVWG.js → bot-api-X3MPFVPL.js} +49 -53
- package/dist/bundle/{bot-history-WVM5GEQN.js → bot-history-OUMVVG22.js} +15 -15
- package/dist/bundle/{bun-UZXO2LRQ.js → bun-LIZ6MKFS.js} +2 -2
- package/dist/bundle/{bun-sqlite-GJLGSQIT.js → bun-sqlite-2IFQYQ44.js} +4 -4
- package/dist/bundle/chunk-264DAFJV.js +161 -0
- package/dist/bundle/{chunk-ASDZHG5I.js → chunk-2SUTCDGO.js} +2 -2
- package/dist/bundle/{chunk-2IM4M7Q2.js → chunk-2XBSVRT2.js} +1 -1
- package/dist/bundle/{chunk-Q26JMPBP.js → chunk-334UBWOB.js} +11 -11
- package/dist/bundle/{chunk-MQNFEVAH.js → chunk-4PDEQL6T.js} +2 -2
- package/dist/bundle/chunk-4QB4WDLT.js +922 -0
- package/dist/bundle/{chunk-66E5QDLH.js → chunk-5D6OJREA.js} +1 -1
- package/dist/bundle/{chunk-RDQMV6EU.js → chunk-5DFGJPT6.js} +4 -4
- package/dist/bundle/{chunk-GTURDJJD.js → chunk-5KU4UQBM.js} +1 -1
- package/dist/bundle/{chunk-JSKT5UZX.js → chunk-5VSR5ENL.js} +8 -8
- package/dist/bundle/{chunk-DN4QUTWU.js → chunk-AUOXTGTU.js} +1 -1
- package/dist/bundle/{chunk-X4Y2ROJI.js → chunk-BBC546ZA.js} +91 -2
- package/dist/bundle/{chunk-RER6DAHP.js → chunk-BQYTIYGB.js} +171 -148
- package/dist/bundle/{chunk-3S5CL55R.js → chunk-CLWYQNSC.js} +6 -6
- package/dist/bundle/{chunk-I6WZJVRT.js → chunk-CRZPQQHE.js} +59 -46
- package/dist/bundle/chunk-DE7LFMY2.js +440 -0
- package/dist/bundle/{chunk-GYEOQS2D.js → chunk-DG62L57H.js} +17 -17
- package/dist/bundle/{chunk-QU2FJMFB.js → chunk-ENE5CSVY.js} +2903 -1490
- package/dist/bundle/{chunk-P26LWFNZ.js → chunk-ERQDBK5I.js} +1 -1
- package/dist/bundle/{chunk-UD4DOZCN.js → chunk-F2TG3BA2.js} +6 -6
- package/dist/bundle/{chunk-4U7QOFDA.js → chunk-FBWOQMPE.js} +1698 -816
- package/dist/bundle/{chunk-JFJVS5JC.js → chunk-FOUE7XLK.js} +2 -2
- package/dist/bundle/{chunk-3QDPV34J.js → chunk-GSKFAE3I.js} +1297 -518
- package/dist/bundle/{chunk-BAIZAZ6Q.js → chunk-HLAZ65AW.js} +2 -2
- package/dist/bundle/{chunk-LI7TXFLS.js → chunk-JFSVXMN6.js} +3 -3
- package/dist/bundle/{chunk-6VEOR6GD.js → chunk-M5UH5CF3.js} +6 -8
- package/dist/bundle/{chunk-HXTTDIL7.js → chunk-MGG7JSNO.js} +3 -3
- package/dist/bundle/{chunk-6YLT4YVJ.js → chunk-OCWARAFE.js} +2 -2
- package/dist/bundle/{chunk-WE3LBRMB.js → chunk-OEJ5DMCX.js} +7 -7
- package/dist/bundle/{chunk-SGJYU3SB.js → chunk-OHBHHBYL.js} +3 -3
- package/dist/bundle/{chunk-2MXQ2EUN.js → chunk-PSH7K6TL.js} +617 -57
- package/dist/bundle/{chunk-H3X5LS6U.js → chunk-PYTOIDSM.js} +4 -4
- package/dist/bundle/{chunk-ATZ44Z77.js → chunk-Q2NYEX4A.js} +150 -52
- package/dist/bundle/{chunk-KE6L2UEG.js → chunk-QEPZUFPL.js} +70 -61
- package/dist/bundle/{chunk-CV5ASHTW.js → chunk-QL7CQ6VZ.js} +255 -80
- package/dist/bundle/{chunk-THVNP6S6.js → chunk-SRU3OF4R.js} +2 -2
- package/dist/bundle/{chunk-OOOV3JBZ.js → chunk-TV5DGHBT.js} +953 -677
- package/dist/bundle/{chunk-A7OBVRJV.js → chunk-TXBUDJ3P.js} +3 -3
- package/dist/bundle/{chunk-OW3COBN5.js → chunk-U4RRZUNP.js} +9 -9
- package/dist/bundle/{chunk-WKOY3POD.js → chunk-UK3GAN7Q.js} +7 -7
- package/dist/bundle/{chunk-BL36RR34.js → chunk-UR6ASUSG.js} +10 -7
- package/dist/bundle/{chunk-4VBDVZNE.js → chunk-V52SBQYF.js} +242 -19
- package/dist/bundle/{chunk-4YCLWWZ3.js → chunk-VUJ34PEQ.js} +11 -11
- package/dist/bundle/{chunk-2XUGPE5W.js → chunk-W5EB4JLV.js} +3 -3
- package/dist/bundle/{chunk-3KHKYYCR.js → chunk-WMOEOVWZ.js} +1 -0
- package/dist/bundle/{chunk-UMLPXNJI.js → chunk-WVEHUKCZ.js} +1 -1
- package/dist/bundle/{chunk-SYPL4PHV.js → chunk-XXTJUZMB.js} +1 -1
- package/dist/bundle/{chunk-SMJTL5U7.js → chunk-Y4XSWI22.js} +6 -4
- package/dist/bundle/{chunk-HKT5EOT5.js → chunk-YHB57PFN.js} +1 -1
- package/dist/bundle/{chunk-BZANDKWT.js → chunk-ZJVZXJOG.js} +2 -2
- package/dist/bundle/{chunk-QY3YOOTP.js → chunk-ZRNRQFTF.js} +2 -2
- package/dist/bundle/command-contract-A6VZN3ZR.js +31 -0
- package/dist/bundle/{echarts-YHSYUWLY.js → echarts-27W2CIBD.js} +2 -2
- package/dist/bundle/{embed-3HGI2XIW.js → embed-FGJ273X2.js} +4 -4
- package/dist/bundle/{embedder-2CJMZETJ.js → embedder-7ELL3CQ3.js} +7 -7
- package/dist/bundle/{entry-UVE53OV3.js → entry-SEE5YWIX.js} +5 -5
- package/dist/bundle/{first-run-6GYC2QS3.js → first-run-BD7FEC3W.js} +9 -9
- package/dist/bundle/first-screen-ASZV6LSA.js +29 -0
- package/dist/bundle/{identity-HEV5E57G.js → identity-QR4F42T6.js} +3 -3
- package/dist/bundle/{instructions-5UVAXSQV.js → instructions-L74K64PV.js} +1 -1
- package/dist/bundle/{mcp-NWXBVNUA.js → mcp-4Y37G2UY.js} +2 -2
- package/dist/bundle/{node-YHYEGYVE.js → node-RSL3HANO.js} +2 -2
- package/dist/bundle/{node-sqlite-CQ33A3R2.js → node-sqlite-7R3PYQGJ.js} +4 -4
- package/dist/bundle/{oauth-OB3JFAD7.js → oauth-4ESGXF6U.js} +7 -7
- package/dist/bundle/{open-JHGZIXU2.js → open-DFYEUGTA.js} +3 -3
- package/dist/bundle/{process-PSKS3N5B.js → process-RMV3AKLB.js} +1 -1
- package/dist/bundle/{program-RPYVPNRX.js → program-PIUYQHBF.js} +62 -67
- package/dist/bundle/{prompt-7BXUMJGG.js → prompt-H7GYQQLL.js} +4 -4
- package/dist/bundle/{proxy-transport-3EEMW2HW.js → proxy-transport-G4MA6BGU.js} +4 -4
- package/dist/bundle/{recognize-YMZPL47R.js → recognize-3GMOLZF4.js} +5 -5
- package/dist/bundle/{remote-LQ3Q22NG.js → remote-IRWTCI2B.js} +5 -5
- package/dist/bundle/{rerank-SM7IYVXJ.js → rerank-W3OSXXBN.js} +5 -5
- package/dist/bundle/{serve-GHUEP5H5.js → serve-ZCPO44NO.js} +24 -9
- package/dist/bundle/{server-A45HVXQY.js → server-FXU4QFRB.js} +42 -39
- package/dist/bundle/{server-K2BQPPHN.js → server-YWL4HDOP.js} +77 -68
- package/dist/bundle/{state-WIOL52GZ.js → state-MJPTDIB5.js} +9 -5
- package/dist/bundle/{store-XE5AKUJZ.js → store-6VNQG56O.js} +10 -10
- package/dist/bundle/store-maintenance-command-62TQTMER.js +43 -0
- package/dist/bundle/tg.js +4 -4
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +2 -0
- package/dist/commands/context.js.map +1 -1
- package/dist/program.js +1 -1
- package/dist/program.js.map +1 -1
- package/dist/telegram/errors.js +1 -1
- package/dist/telegram/errors.js.map +1 -1
- package/dist/telegram/sending.d.ts.map +1 -1
- package/dist/telegram/sending.js +52 -3
- package/dist/telegram/sending.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/install/windows.ps1 +1 -1
- package/package.json +3 -3
- package/skills/tg-cli/SKILL.md +4 -4
- package/dist/bundle/chunk-3N6LXAPE.js +0 -724
- package/dist/bundle/chunk-DVOUKGFK.js +0 -1950
- package/dist/bundle/chunk-MUEXF4ME.js +0 -582
- package/dist/bundle/chunk-U7LXA4SO.js +0 -1007
- package/dist/bundle/chunk-V4JSVH4M.js +0 -190
- package/dist/bundle/chunk-YG7PNCSW.js +0 -230
- package/dist/bundle/chunk-Z2FHEIXN.js +0 -63
- package/dist/bundle/command-contract-AIVKJYIR.js +0 -31
- package/dist/bundle/first-screen-HRRLVLOG.js +0 -29
- package/dist/bundle/store-maintenance-command-YS5E7VUN.js +0 -46
- /package/dist/bundle/{chunk-3MVHRZWR.js → chunk-2SJOUK6J.js} +0 -0
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import { createRequire as __tgRequire } from "node:module";
|
|
2
2
|
const require = __tgRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
AGENTS,
|
|
5
4
|
CONFIG,
|
|
6
|
-
MEMO_SCENARIOS,
|
|
7
5
|
SKILL,
|
|
8
6
|
TELEGRAM,
|
|
9
7
|
TELEGRAM_BOT,
|
|
8
|
+
botMcp,
|
|
9
|
+
forCommand,
|
|
10
|
+
parseApiHash,
|
|
11
|
+
parseApiId,
|
|
12
|
+
pathsFor,
|
|
13
|
+
proxiedFetch,
|
|
14
|
+
proxySecrets,
|
|
15
|
+
resolveSettings
|
|
16
|
+
} from "./chunk-4QB4WDLT.js";
|
|
17
|
+
import {
|
|
18
|
+
AGENTS,
|
|
19
|
+
MEMO_SCENARIOS,
|
|
10
20
|
accountCommand,
|
|
11
21
|
agentFor,
|
|
12
22
|
answerStdinOption,
|
|
23
|
+
atTerminal,
|
|
13
24
|
attachmentsCommand,
|
|
14
25
|
botCommand,
|
|
15
|
-
botMcp,
|
|
16
26
|
chatsCommand,
|
|
17
27
|
commandsCommand,
|
|
18
28
|
completeCommand,
|
|
@@ -21,25 +31,19 @@ import {
|
|
|
21
31
|
conversationsCommand,
|
|
22
32
|
doctorCommand,
|
|
23
33
|
floodCommand,
|
|
24
|
-
forCommand,
|
|
25
34
|
guideCommand,
|
|
26
35
|
imagesCommand,
|
|
27
36
|
inboxCommand,
|
|
37
|
+
loginQr,
|
|
28
38
|
mcpCommand,
|
|
29
39
|
mentionsCommand,
|
|
30
40
|
messagesCommand,
|
|
31
41
|
metadataCommand,
|
|
32
42
|
modelsCommand,
|
|
33
|
-
parseApiHash,
|
|
34
|
-
parseApiId,
|
|
35
|
-
pathsFor,
|
|
36
43
|
pollsCommand,
|
|
37
|
-
proxiedFetch,
|
|
38
|
-
proxySecrets,
|
|
39
44
|
reactionsCommand,
|
|
40
45
|
recipientsCommand,
|
|
41
46
|
repliesCommand,
|
|
42
|
-
resolveSettings,
|
|
43
47
|
restartServers,
|
|
44
48
|
reviewCommand,
|
|
45
49
|
run,
|
|
@@ -61,35 +65,27 @@ import {
|
|
|
61
65
|
topicsCommand,
|
|
62
66
|
upgradeCommand,
|
|
63
67
|
watchCommand
|
|
64
|
-
} from "./chunk-
|
|
65
|
-
import {
|
|
66
|
-
atTerminal,
|
|
67
|
-
loginQr
|
|
68
|
-
} from "./chunk-DVOUKGFK.js";
|
|
68
|
+
} from "./chunk-ENE5CSVY.js";
|
|
69
69
|
import {
|
|
70
70
|
parseProxy,
|
|
71
71
|
proxyLabel
|
|
72
|
-
} from "./chunk-
|
|
73
|
-
import "./chunk-
|
|
74
|
-
import "./chunk-
|
|
75
|
-
import "./chunk-
|
|
72
|
+
} from "./chunk-2XBSVRT2.js";
|
|
73
|
+
import "./chunk-AUOXTGTU.js";
|
|
74
|
+
import "./chunk-CRZPQQHE.js";
|
|
75
|
+
import "./chunk-5D6OJREA.js";
|
|
76
76
|
import {
|
|
77
77
|
installSkill
|
|
78
|
-
} from "./chunk-
|
|
79
|
-
import "./chunk-
|
|
80
|
-
import "./chunk-
|
|
81
|
-
import "./chunk-
|
|
82
|
-
import "./chunk-
|
|
83
|
-
import "./chunk-MUEXF4ME.js";
|
|
84
|
-
import "./chunk-4U7QOFDA.js";
|
|
85
|
-
import "./chunk-3N6LXAPE.js";
|
|
86
|
-
import "./chunk-RDQMV6EU.js";
|
|
78
|
+
} from "./chunk-V52SBQYF.js";
|
|
79
|
+
import "./chunk-QL7CQ6VZ.js";
|
|
80
|
+
import "./chunk-PSH7K6TL.js";
|
|
81
|
+
import "./chunk-FBWOQMPE.js";
|
|
82
|
+
import "./chunk-5DFGJPT6.js";
|
|
87
83
|
import {
|
|
88
84
|
inSection
|
|
89
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-UK3GAN7Q.js";
|
|
90
86
|
import "./chunk-ZZLKX62Z.js";
|
|
91
|
-
import "./chunk-
|
|
92
|
-
import "./chunk-
|
|
87
|
+
import "./chunk-M5UH5CF3.js";
|
|
88
|
+
import "./chunk-BQYTIYGB.js";
|
|
93
89
|
import {
|
|
94
90
|
Argument,
|
|
95
91
|
Command,
|
|
@@ -100,6 +96,7 @@ import {
|
|
|
100
96
|
commandWords,
|
|
101
97
|
customizeSharedCommand,
|
|
102
98
|
environmentOf,
|
|
99
|
+
levelFor,
|
|
103
100
|
logsInOrOut,
|
|
104
101
|
outputFor,
|
|
105
102
|
overrideSharedContract,
|
|
@@ -107,52 +104,50 @@ import {
|
|
|
107
104
|
refuseCommandName,
|
|
108
105
|
rememberAccount,
|
|
109
106
|
rootOf,
|
|
107
|
+
runtime,
|
|
110
108
|
secretInputOf,
|
|
111
109
|
withDeadline
|
|
112
|
-
} from "./chunk-
|
|
113
|
-
import
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
} from "./chunk-U7LXA4SO.js";
|
|
117
|
-
import "./chunk-SMJTL5U7.js";
|
|
118
|
-
import "./chunk-Q26JMPBP.js";
|
|
110
|
+
} from "./chunk-GSKFAE3I.js";
|
|
111
|
+
import "./chunk-Y4XSWI22.js";
|
|
112
|
+
import "./chunk-DE7LFMY2.js";
|
|
113
|
+
import "./chunk-334UBWOB.js";
|
|
119
114
|
import {
|
|
120
115
|
installerOf,
|
|
121
116
|
latestVersion,
|
|
122
117
|
runUpdate,
|
|
123
118
|
updateNotice
|
|
124
|
-
} from "./chunk-
|
|
125
|
-
import "./chunk-
|
|
126
|
-
import "./chunk-
|
|
127
|
-
import "./chunk-
|
|
128
|
-
import "./chunk-
|
|
119
|
+
} from "./chunk-PYTOIDSM.js";
|
|
120
|
+
import "./chunk-5KU4UQBM.js";
|
|
121
|
+
import "./chunk-OHBHHBYL.js";
|
|
122
|
+
import "./chunk-VUJ34PEQ.js";
|
|
123
|
+
import "./chunk-2SUTCDGO.js";
|
|
129
124
|
import {
|
|
130
125
|
TG,
|
|
131
126
|
VERSION
|
|
132
|
-
} from "./chunk-
|
|
133
|
-
import "./chunk-
|
|
127
|
+
} from "./chunk-FOUE7XLK.js";
|
|
128
|
+
import "./chunk-264DAFJV.js";
|
|
134
129
|
import {
|
|
135
130
|
servingProfiles
|
|
136
|
-
} from "./chunk-
|
|
137
|
-
import "./chunk-
|
|
138
|
-
import "./chunk-
|
|
139
|
-
import "./chunk-
|
|
140
|
-
import "./chunk-
|
|
141
|
-
import "./chunk-
|
|
142
|
-
import "./chunk-
|
|
131
|
+
} from "./chunk-W5EB4JLV.js";
|
|
132
|
+
import "./chunk-WVEHUKCZ.js";
|
|
133
|
+
import "./chunk-SRU3OF4R.js";
|
|
134
|
+
import "./chunk-OCWARAFE.js";
|
|
135
|
+
import "./chunk-JFSVXMN6.js";
|
|
136
|
+
import "./chunk-U4RRZUNP.js";
|
|
137
|
+
import "./chunk-TV5DGHBT.js";
|
|
143
138
|
import {
|
|
144
139
|
timezoneOf
|
|
145
|
-
} from "./chunk-
|
|
146
|
-
import "./chunk-
|
|
147
|
-
import "./chunk-
|
|
148
|
-
import "./chunk-
|
|
149
|
-
import "./chunk-
|
|
150
|
-
import "./chunk-
|
|
151
|
-
import "./chunk-
|
|
140
|
+
} from "./chunk-QEPZUFPL.js";
|
|
141
|
+
import "./chunk-5VSR5ENL.js";
|
|
142
|
+
import "./chunk-F2TG3BA2.js";
|
|
143
|
+
import "./chunk-2SJOUK6J.js";
|
|
144
|
+
import "./chunk-ZRNRQFTF.js";
|
|
145
|
+
import "./chunk-CLWYQNSC.js";
|
|
146
|
+
import "./chunk-YHB57PFN.js";
|
|
152
147
|
import {
|
|
153
148
|
readSecret
|
|
154
|
-
} from "./chunk-
|
|
155
|
-
import "./chunk-
|
|
149
|
+
} from "./chunk-MGG7JSNO.js";
|
|
150
|
+
import "./chunk-HLAZ65AW.js";
|
|
156
151
|
import {
|
|
157
152
|
configFilePath,
|
|
158
153
|
exitCodeFor,
|
|
@@ -161,11 +156,11 @@ import {
|
|
|
161
156
|
renderPretty,
|
|
162
157
|
resolvePaths,
|
|
163
158
|
singleLine
|
|
164
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-DG62L57H.js";
|
|
165
160
|
import {
|
|
166
161
|
CliError,
|
|
167
162
|
isCliError
|
|
168
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-OEJ5DMCX.js";
|
|
169
164
|
import "./chunk-BJG6JA5U.js";
|
|
170
165
|
import {
|
|
171
166
|
__name
|
|
@@ -240,7 +235,7 @@ var withProxySecrets = /* @__PURE__ */ __name((config) => {
|
|
|
240
235
|
throw new CliError("validation_error", "a proxy password or MTProxy secret never goes on the command line \u2014 run `tg config set proxy -` and paste the URL");
|
|
241
236
|
if (proxy.kind === "mtproxy" && proxy.secret === void 0)
|
|
242
237
|
throw new CliError("validation_error", "an MTProxy link needs its secret \u2014 run `tg config set proxy -` and paste the whole link");
|
|
243
|
-
const { checkProxy } = await import("./proxy-transport-
|
|
238
|
+
const { checkProxy } = await import("./proxy-transport-G4MA6BGU.js");
|
|
244
239
|
asValidation(() => checkProxy(proxy));
|
|
245
240
|
const label = proxyLabel(proxy);
|
|
246
241
|
action.processedArgs[1] = label;
|
|
@@ -723,7 +718,7 @@ import { accessSync, constants, existsSync as existsSync2, mkdirSync } from "nod
|
|
|
723
718
|
import { join } from "node:path";
|
|
724
719
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
725
720
|
|
|
726
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
721
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/update/index.js
|
|
727
722
|
import { realpathSync } from "node:fs";
|
|
728
723
|
import { fileURLToPath } from "node:url";
|
|
729
724
|
var QUIET_WORDS = [
|
|
@@ -962,7 +957,7 @@ var definition = {
|
|
|
962
957
|
{ command: "search all invoice", does: "messages and notes, from the local store and Telegram's server" },
|
|
963
958
|
{ command: "attachments extract", does: "text of PDFs and documents, ready for search" },
|
|
964
959
|
{ command: "schedule agent \u2026", does: "an agent on a timer; it runs read-only and can never send" },
|
|
965
|
-
{ command: "mcp --permission \u2026", does: "your account in any agent, with messages.send=deny" },
|
|
960
|
+
{ command: "mcp serve --permission \u2026", does: "your account in any agent, with messages.send=deny" },
|
|
966
961
|
{ command: "TG_READ_ONLY=1 tg \u2026", does: "a run that can read and sync but never send, edit or delete" }
|
|
967
962
|
]
|
|
968
963
|
},
|
|
@@ -1040,7 +1035,7 @@ var definition = {
|
|
|
1040
1035
|
};
|
|
1041
1036
|
var run2 = /* @__PURE__ */ __name(async (argv, environment = {}) => {
|
|
1042
1037
|
if (!botApi && needsBotApi(argv, environment.env ?? process.env))
|
|
1043
|
-
useBotApi((await import("./bot-api-
|
|
1038
|
+
useBotApi((await import("./bot-api-X3MPFVPL.js")).telegramBotApiCommand);
|
|
1044
1039
|
const notice = updateNotice2(argv, {
|
|
1045
1040
|
...environment.tty === void 0 ? {} : { tty: environment.tty },
|
|
1046
1041
|
...environment.update ? { environment: environment.update } : {},
|
|
@@ -2,10 +2,10 @@ import { createRequire as __tgRequire } from "node:module";
|
|
|
2
2
|
const require = __tgRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
readSecret
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-MGG7JSNO.js";
|
|
6
|
+
import "./chunk-HLAZ65AW.js";
|
|
7
|
+
import "./chunk-DG62L57H.js";
|
|
8
|
+
import "./chunk-OEJ5DMCX.js";
|
|
9
9
|
import "./chunk-BJG6JA5U.js";
|
|
10
10
|
import "./chunk-AFV74GK3.js";
|
|
11
11
|
export {
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
checkProxy,
|
|
5
5
|
proxiedTransport,
|
|
6
6
|
proxyFailure
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-ZJVZXJOG.js";
|
|
8
|
+
import "./chunk-2XBSVRT2.js";
|
|
9
|
+
import "./chunk-DG62L57H.js";
|
|
10
|
+
import "./chunk-OEJ5DMCX.js";
|
|
11
11
|
import "./chunk-BJG6JA5U.js";
|
|
12
12
|
import "./chunk-AFV74GK3.js";
|
|
13
13
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire as __tgRequire } from "node:module";
|
|
2
2
|
const require = __tgRequire(import.meta.url);
|
|
3
|
-
import "./chunk-
|
|
3
|
+
import "./chunk-DG62L57H.js";
|
|
4
4
|
import {
|
|
5
5
|
CliError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OEJ5DMCX.js";
|
|
7
7
|
import {
|
|
8
8
|
importFrom
|
|
9
9
|
} from "./chunk-BJG6JA5U.js";
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
__name
|
|
12
12
|
} from "./chunk-AFV74GK3.js";
|
|
13
13
|
|
|
14
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/speech/recognize.js
|
|
15
15
|
import { createRequire } from "node:module";
|
|
16
16
|
|
|
17
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/speech/ogg-limit.js
|
|
18
18
|
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "local transcription needs a complete mono or stereo Ogg Opus recording"), "invalid");
|
|
19
19
|
var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
|
|
20
20
|
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
@@ -71,7 +71,7 @@ var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
|
|
|
71
71
|
throw invalid();
|
|
72
72
|
}, "checkOggDuration");
|
|
73
73
|
|
|
74
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
74
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/speech/recognize.js
|
|
75
75
|
var SAMPLE_RATE = 16e3;
|
|
76
76
|
var LEAD = SAMPLE_RATE / 2;
|
|
77
77
|
var toModelRate = /* @__PURE__ */ __name((samples, rate) => {
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
openRemote,
|
|
9
9
|
remoteKey,
|
|
10
10
|
remoteModel
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-JFSVXMN6.js";
|
|
12
|
+
import "./chunk-U4RRZUNP.js";
|
|
13
|
+
import "./chunk-ZRNRQFTF.js";
|
|
14
|
+
import "./chunk-DG62L57H.js";
|
|
15
|
+
import "./chunk-OEJ5DMCX.js";
|
|
16
16
|
import "./chunk-BJG6JA5U.js";
|
|
17
17
|
import "./chunk-AFV74GK3.js";
|
|
18
18
|
export {
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
defaultThreads,
|
|
5
5
|
loadModel,
|
|
6
6
|
truncated
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-U4RRZUNP.js";
|
|
8
|
+
import "./chunk-ZRNRQFTF.js";
|
|
9
|
+
import "./chunk-DG62L57H.js";
|
|
10
|
+
import "./chunk-OEJ5DMCX.js";
|
|
11
11
|
import "./chunk-BJG6JA5U.js";
|
|
12
12
|
import {
|
|
13
13
|
__name
|
|
14
14
|
} from "./chunk-AFV74GK3.js";
|
|
15
15
|
|
|
16
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/embeddings/rerank.js
|
|
17
17
|
var openReranker = /* @__PURE__ */ __name(async (model, directory, { threads = defaultThreads() } = {}) => {
|
|
18
18
|
const { ort, tokenizer, session } = await loadModel(model, directory, threads);
|
|
19
19
|
const typeIds = session.inputNames.includes("token_type_ids");
|
|
@@ -2,10 +2,10 @@ import { createRequire as __tgRequire } from "node:module";
|
|
|
2
2
|
const require = __tgRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
listen
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AUOXTGTU.js";
|
|
6
6
|
import {
|
|
7
7
|
ownerLogin
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UR6ASUSG.js";
|
|
9
9
|
import {
|
|
10
10
|
WebStandardStreamableHTTPServerTransport,
|
|
11
11
|
createMcpHandler,
|
|
@@ -14,22 +14,25 @@ import {
|
|
|
14
14
|
isLegacyRequest,
|
|
15
15
|
oauthMetadataResponse,
|
|
16
16
|
requireBearerAuth
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WMOEOVWZ.js";
|
|
18
18
|
import {
|
|
19
|
+
activityRecorder,
|
|
20
|
+
calledTools,
|
|
21
|
+
httpActivityFile,
|
|
19
22
|
httpLock
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-264DAFJV.js";
|
|
24
|
+
import "./chunk-W5EB4JLV.js";
|
|
25
|
+
import "./chunk-WVEHUKCZ.js";
|
|
26
|
+
import "./chunk-DG62L57H.js";
|
|
24
27
|
import {
|
|
25
28
|
CliError
|
|
26
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-OEJ5DMCX.js";
|
|
27
30
|
import "./chunk-BJG6JA5U.js";
|
|
28
31
|
import {
|
|
29
32
|
__name
|
|
30
33
|
} from "./chunk-AFV74GK3.js";
|
|
31
34
|
|
|
32
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/mcp/http/serve.js
|
|
33
36
|
import { randomUUID } from "node:crypto";
|
|
34
37
|
var MCP_PATH = "/mcp";
|
|
35
38
|
var AS_METADATA = "/.well-known/oauth-authorization-server";
|
|
@@ -92,6 +95,15 @@ var metadataRequest = /* @__PURE__ */ __name((request, path, base) => {
|
|
|
92
95
|
url.pathname = inserted ? AS_METADATA : path;
|
|
93
96
|
return new Request(url, { method: request.method, headers: request.headers });
|
|
94
97
|
}, "metadataRequest");
|
|
98
|
+
var toolsIn = /* @__PURE__ */ __name(async (request) => {
|
|
99
|
+
if (request.method !== "POST")
|
|
100
|
+
return [];
|
|
101
|
+
try {
|
|
102
|
+
return calledTools(await request.clone().json());
|
|
103
|
+
} catch {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
}, "toolsIn");
|
|
95
107
|
var serveOverHttp = /* @__PURE__ */ __name(async (build, options) => {
|
|
96
108
|
const { publicUrl, port, tokenFile, appName, onCode, onError, now, lockFile, version } = options;
|
|
97
109
|
const lock = lockFile ? httpLock(lockFile, {
|
|
@@ -126,6 +138,7 @@ var serveOverHttp = /* @__PURE__ */ __name(async (build, options) => {
|
|
|
126
138
|
verifier: login.verifier,
|
|
127
139
|
resourceMetadataUrl: getOAuthProtectedResourceMetadataUrl(resource)
|
|
128
140
|
});
|
|
141
|
+
const activity = activityRecorder(httpActivityFile(tokenFile), now);
|
|
129
142
|
const allowedHosts = [.../* @__PURE__ */ new Set([publicUrl.hostname, ...LOCAL])];
|
|
130
143
|
const allowedOrigins = [publicUrl.origin];
|
|
131
144
|
const listening = await listen(async (request) => {
|
|
@@ -154,6 +167,7 @@ var serveOverHttp = /* @__PURE__ */ __name(async (build, options) => {
|
|
|
154
167
|
const auth = await bearer(request);
|
|
155
168
|
if (auth instanceof Response)
|
|
156
169
|
return auth;
|
|
170
|
+
activity.record(auth.clientId, await toolsIn(request));
|
|
157
171
|
return await isLegacyRequest(request) ? legacy.handle(request, auth) : mcp.fetch(request, { authInfo: auth });
|
|
158
172
|
}, { host: "127.0.0.1", port }).catch((error) => {
|
|
159
173
|
login.close();
|
|
@@ -165,6 +179,7 @@ var serveOverHttp = /* @__PURE__ */ __name(async (build, options) => {
|
|
|
165
179
|
url: listening.url,
|
|
166
180
|
close: /* @__PURE__ */ __name(async () => {
|
|
167
181
|
login.close();
|
|
182
|
+
activity.flush();
|
|
168
183
|
try {
|
|
169
184
|
await listening.close();
|
|
170
185
|
await legacy.close();
|
|
@@ -2,71 +2,71 @@ import { createRequire as __tgRequire } from "node:module";
|
|
|
2
2
|
const require = __tgRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
botInstructions
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5D6OJREA.js";
|
|
6
6
|
import {
|
|
7
7
|
answered,
|
|
8
8
|
normal,
|
|
9
9
|
registerCommands,
|
|
10
10
|
runCommandForAgent,
|
|
11
11
|
toolsFromCommands
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Q2NYEX4A.js";
|
|
13
13
|
import {
|
|
14
14
|
agentJson,
|
|
15
15
|
skillResource
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-YG7PNCSW.js";
|
|
16
|
+
} from "./chunk-V52SBQYF.js";
|
|
18
17
|
import {
|
|
18
|
+
callerOf,
|
|
19
19
|
serveStdio
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-BBC546ZA.js";
|
|
21
|
+
import {
|
|
22
|
+
McpServer
|
|
23
|
+
} from "./chunk-WMOEOVWZ.js";
|
|
21
24
|
import {
|
|
22
25
|
wholeList
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-RER6DAHP.js";
|
|
26
|
+
} from "./chunk-FBWOQMPE.js";
|
|
27
|
+
import "./chunk-5DFGJPT6.js";
|
|
28
|
+
import "./chunk-BQYTIYGB.js";
|
|
27
29
|
import {
|
|
28
30
|
changesMessenger,
|
|
29
31
|
flatten,
|
|
30
32
|
itemOf
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-GSKFAE3I.js";
|
|
34
|
+
import "./chunk-Y4XSWI22.js";
|
|
35
|
+
import "./chunk-DE7LFMY2.js";
|
|
36
|
+
import "./chunk-PYTOIDSM.js";
|
|
37
|
+
import "./chunk-5KU4UQBM.js";
|
|
38
|
+
import "./chunk-OHBHHBYL.js";
|
|
37
39
|
import {
|
|
38
40
|
MESSENGER_CHANGE_REFUSAL,
|
|
39
41
|
readOnlyLockOf,
|
|
40
42
|
readOnlyRefusal
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-3S5CL55R.js";
|
|
56
|
-
import "./chunk-HKT5EOT5.js";
|
|
57
|
-
import "./chunk-BAIZAZ6Q.js";
|
|
43
|
+
} from "./chunk-2SUTCDGO.js";
|
|
44
|
+
import "./chunk-WVEHUKCZ.js";
|
|
45
|
+
import "./chunk-OCWARAFE.js";
|
|
46
|
+
import "./chunk-JFSVXMN6.js";
|
|
47
|
+
import "./chunk-U4RRZUNP.js";
|
|
48
|
+
import "./chunk-TV5DGHBT.js";
|
|
49
|
+
import "./chunk-QEPZUFPL.js";
|
|
50
|
+
import "./chunk-5VSR5ENL.js";
|
|
51
|
+
import "./chunk-F2TG3BA2.js";
|
|
52
|
+
import "./chunk-2SJOUK6J.js";
|
|
53
|
+
import "./chunk-ZRNRQFTF.js";
|
|
54
|
+
import "./chunk-CLWYQNSC.js";
|
|
55
|
+
import "./chunk-YHB57PFN.js";
|
|
56
|
+
import "./chunk-HLAZ65AW.js";
|
|
58
57
|
import {
|
|
59
58
|
mcpErrorResult
|
|
60
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-DG62L57H.js";
|
|
61
60
|
import {
|
|
62
61
|
object
|
|
63
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-OEJ5DMCX.js";
|
|
64
63
|
import "./chunk-BJG6JA5U.js";
|
|
65
64
|
import {
|
|
66
65
|
__name
|
|
67
66
|
} from "./chunk-AFV74GK3.js";
|
|
68
67
|
|
|
69
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
68
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.467.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._7a700db966f96e9df6d3178e7072efc2/node_modules/@wirecat/cli-core/dist/mcp/bot/server.js
|
|
69
|
+
import { randomUUID } from "node:crypto";
|
|
70
70
|
var body = /* @__PURE__ */ __name((command, value) => Array.isArray(value) ? wholeList(`bot ${command}`, value) : value !== null && typeof value === "object" && ("item" in value || "items" in value) ? value : itemOf(value !== null && typeof value === "object" ? value : { value }), "body");
|
|
71
71
|
var createBotServer = /* @__PURE__ */ __name((options) => {
|
|
72
72
|
const { bot, program, settings, env } = options;
|
|
@@ -94,19 +94,21 @@ var createBotServer = /* @__PURE__ */ __name((options) => {
|
|
|
94
94
|
const writes = tools.filter((tool) => tool.writes && tool.availability?.().available !== false).map((tool) => tool.command);
|
|
95
95
|
const skill = options.skill ? skillResource(bot.app, options.skill) : void 0;
|
|
96
96
|
let queue = Promise.resolve();
|
|
97
|
-
const invoke = /* @__PURE__ */ __name((path, input) => {
|
|
97
|
+
const invoke = /* @__PURE__ */ __name((path, input, caller) => {
|
|
98
98
|
const next = queue.then(() => runCommandForAgent(program, path, path[0] === "config" ? { ...input, bot: true } : input, {
|
|
99
99
|
profile: settings.profile,
|
|
100
100
|
readOnly: readOnlyLockOf(bot.app, env) !== void 0,
|
|
101
101
|
env,
|
|
102
102
|
levels,
|
|
103
103
|
...options.keyOf ? { keyOf: options.keyOf } : {},
|
|
104
|
-
authority
|
|
104
|
+
authority,
|
|
105
|
+
...caller ? { caller } : {}
|
|
105
106
|
}));
|
|
106
107
|
queue = next.catch(() => void 0);
|
|
107
108
|
return next;
|
|
108
109
|
}, "invoke");
|
|
109
110
|
const build = /* @__PURE__ */ __name(() => {
|
|
111
|
+
const callers = { env, client: /* @__PURE__ */ __name(() => server.server.getClientVersion(), "client"), connectionId: randomUUID() };
|
|
110
112
|
const server = new McpServer({ name: `${command}-bot-${settings.profile}`, version: bot.app.version }, {
|
|
111
113
|
instructions: botInstructions({
|
|
112
114
|
command,
|
|
@@ -128,8 +130,9 @@ var createBotServer = /* @__PURE__ */ __name((options) => {
|
|
|
128
130
|
writes: tool.writes,
|
|
129
131
|
availability: tool.availability,
|
|
130
132
|
input: tool.input,
|
|
131
|
-
run: /* @__PURE__ */ __name(async (args) => {
|
|
132
|
-
const
|
|
133
|
+
run: /* @__PURE__ */ __name(async (args, ctx) => {
|
|
134
|
+
const caller = callerOf(ctx, `${command}_${tool.command.replaceAll(" ", "_")}`, callers);
|
|
135
|
+
const answer = await invoke(tool.path, args, caller);
|
|
133
136
|
return "error" in answer ? mcpErrorResult(JSON.parse(agentJson(answer.error))) : answered(body(tool.command, answer.result));
|
|
134
137
|
}, "run")
|
|
135
138
|
}
|