@wirecat/tg-cli 0.126.0 → 0.128.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/dist/bin/tg.js +2 -2
- package/dist/bundle/{adapter-BXU3AVB7.js → adapter-JOI34QLS.js} +43 -43
- package/dist/bundle/{all-profiles-G5A6IROO.js → all-profiles-2BZEE7J2.js} +18 -28
- package/dist/bundle/{anthropic-SINVEVEM.js → anthropic-NW7DL3S3.js} +2 -2
- package/dist/bundle/{app-server-IHIQXPJF.js → app-server-RUTYKELF.js} +39 -54
- package/dist/bundle/{bot-api-LGAVVYRM.js → bot-api-DW6NAZAQ.js} +44 -44
- package/dist/bundle/{bot-history-5C35FGCD.js → bot-history-FAJ2W42U.js} +12 -12
- package/dist/bundle/{bun-2GK3YOP3.js → bun-IVP5LSVI.js} +2 -2
- package/dist/bundle/{bun-sqlite-7DGADK3E.js → bun-sqlite-ATPCJ4CT.js} +3 -3
- package/dist/bundle/{chunk-Y5DGB7GP.js → chunk-2A3TC52A.js} +7 -7
- package/dist/bundle/{chunk-Y4724JRR.js → chunk-2IL4YDGG.js} +2 -2
- package/dist/bundle/{chunk-2F2UMQMB.js → chunk-2QHIOPSA.js} +182 -399
- package/dist/bundle/{chunk-SXVB2CVR.js → chunk-3UGRMFWK.js} +2 -2
- package/dist/bundle/{chunk-QCLMP635.js → chunk-4DSIGS2E.js} +5 -5
- package/dist/bundle/{chunk-HPFB4Y7P.js → chunk-5AP25FMW.js} +1 -1
- package/dist/bundle/{chunk-CK7DSGIK.js → chunk-7D6LI2N7.js} +322 -11
- package/dist/bundle/{chunk-2LN6OJUB.js → chunk-7I5NMVX7.js} +1 -1
- package/dist/bundle/{chunk-JQ2RKLPU.js → chunk-AF2XVV5P.js} +648 -239
- package/dist/bundle/{chunk-MP47TE77.js → chunk-BVCRDHI2.js} +3 -3
- package/dist/bundle/{chunk-7UACPXDC.js → chunk-E56QE3UC.js} +987 -768
- package/dist/bundle/{chunk-ACLUVZ4I.js → chunk-EAUHYQUK.js} +40 -48
- package/dist/bundle/{chunk-L5PYWQDA.js → chunk-F4UIBEQK.js} +2 -2
- package/dist/bundle/{chunk-FYOHGIQP.js → chunk-FHGAJK4I.js} +16 -13
- package/dist/bundle/{chunk-AA2NZAUT.js → chunk-G3PL3R45.js} +1 -1
- package/dist/bundle/{chunk-W75SKUY4.js → chunk-GYO4WXLG.js} +2 -2
- package/dist/bundle/{chunk-GIY56MIB.js → chunk-IHLNXL2D.js} +1 -1
- package/dist/bundle/{chunk-MA2XHO4O.js → chunk-IIHCSJV2.js} +641 -389
- package/dist/bundle/{chunk-N2JSMP4N.js → chunk-IV2KJQ5F.js} +16 -15
- package/dist/bundle/{chunk-QGLB4D7J.js → chunk-J3SX36NE.js} +1 -1
- package/dist/bundle/{chunk-XGBXRDJP.js → chunk-JI2PFQFL.js} +5 -5
- package/dist/bundle/{chunk-RFDPU4NO.js → chunk-JJGPU24U.js} +4 -4
- package/dist/bundle/{chunk-5NLAGTWU.js → chunk-KF2Q776U.js} +7 -7
- package/dist/bundle/{chunk-F34EE5Y2.js → chunk-KKZQK6IK.js} +2 -2
- package/dist/bundle/{chunk-5GINYFD4.js → chunk-LTADKMP5.js} +1 -1
- package/dist/bundle/{chunk-J2BUWK5U.js → chunk-MC6FOTCV.js} +98 -6
- package/dist/bundle/{chunk-63DSHUNP.js → chunk-MDGLKMLD.js} +5 -5
- package/dist/bundle/{chunk-PJ6FZXUR.js → chunk-MGBVVQTU.js} +2 -2
- package/dist/bundle/{chunk-K4DXGJK4.js → chunk-MOUPWPNL.js} +10 -10
- package/dist/bundle/{chunk-G4VVBR6U.js → chunk-NXDQXDRN.js} +3 -3
- package/dist/bundle/{chunk-SL4S5GFR.js → chunk-ODBK56ZR.js} +1 -1
- package/dist/bundle/{chunk-QYLYMOXN.js → chunk-OX6574YV.js} +11 -11
- package/dist/bundle/{chunk-4GR5YYGA.js → chunk-PJA43HVE.js} +2 -2
- package/dist/bundle/{chunk-GI2ZUNOH.js → chunk-Q3ZO6Q3M.js} +4 -4
- package/dist/bundle/{chunk-OXB5P37M.js → chunk-QO4ON2X7.js} +1 -1
- package/dist/bundle/{chunk-NJ3FSKSU.js → chunk-QYN5RDTZ.js} +2 -2
- package/dist/bundle/{chunk-GOGGRLS6.js → chunk-R4QVV3LN.js} +27 -12
- package/dist/bundle/{chunk-AZ7DSHQO.js → chunk-RIGNCUZD.js} +1 -1
- package/dist/bundle/{chunk-QMEPKUG3.js → chunk-RZFIQMOA.js} +55 -52
- package/dist/bundle/{chunk-G4RCT5RH.js → chunk-SDLJJF7E.js} +12 -12
- package/dist/bundle/{chunk-JAKP5RWM.js → chunk-T2CWSFGY.js} +1558 -928
- package/dist/bundle/{chunk-W35POPPX.js → chunk-TGUXKG4B.js} +16 -16
- package/dist/bundle/{chunk-W725T2V7.js → chunk-TQFUAKU6.js} +1 -1
- package/dist/bundle/{chunk-UIFQEXVP.js → chunk-UURJO46N.js} +1 -1
- package/dist/bundle/{chunk-AKUBJHE5.js → chunk-WG3BF7SA.js} +1 -1
- package/dist/bundle/{chunk-7FL2N6DM.js → chunk-WMF6SL5D.js} +1 -1
- package/dist/bundle/{chunk-ZXCQF6XV.js → chunk-WMUPZ3IY.js} +10 -10
- package/dist/bundle/{chunk-KSLZEXRF.js → chunk-WPMJQIEU.js} +1 -1
- package/dist/bundle/{chunk-QOINWAQD.js → chunk-XYAH6QQO.js} +2 -2
- package/dist/bundle/{chunk-DGGAYHLN.js → chunk-YSXDCSBP.js} +33 -23
- package/dist/bundle/{chunk-AYEQMXRE.js → chunk-YVV5S2QA.js} +1 -1
- package/dist/bundle/{chunk-P2GNIWGG.js → chunk-ZVLYK6CZ.js} +6 -6
- package/dist/bundle/{command-contract-ZEYY3ZXK.js → command-contract-3BSXDYBC.js} +13 -13
- package/dist/bundle/{command-server-entry-UWY6PQIV.js → command-server-entry-BU3X4XNL.js} +20 -20
- package/dist/bundle/{decode-QGMFQ6XX.js → decode-NXB7E46F.js} +2 -2
- package/dist/bundle/{echarts-GHU3GEWV.js → echarts-NAXLKJLA.js} +2 -2
- package/dist/bundle/{embed-6DMEWQDO.js → embed-LB6ONWHX.js} +3 -3
- package/dist/bundle/{embedder-W2L7YZPW.js → embedder-WE7B2RU5.js} +6 -6
- package/dist/bundle/{entry-LPEXVFQC.js → entry-W6Y52ZRN.js} +6 -6
- package/dist/bundle/{first-run-3UJ6SJF5.js → first-run-NVYNZZA6.js} +5 -5
- package/dist/bundle/{first-screen-VCSY5QH5.js → first-screen-Z6TVHK6I.js} +14 -14
- package/dist/bundle/{instructions-RUVAH2IS.js → instructions-MRUC57NS.js} +1 -1
- package/dist/bundle/{node-RYSNHVBX.js → node-G7PMDYQV.js} +2 -2
- package/dist/bundle/{node-sqlite-J6ZL4LUY.js → node-sqlite-RXWQ3SES.js} +4 -4
- package/dist/bundle/{oauth-B2QNZNSC.js → oauth-6ZWOL6KX.js} +4 -4
- package/dist/bundle/{open-OMUP5P6V.js → open-V7LMZCFI.js} +2 -2
- package/dist/bundle/{openai-BT4BP4VQ.js → openai-P472V4ZM.js} +12 -12
- package/dist/bundle/{process-HG3QDD54.js → process-GSNPENHL.js} +1 -1
- package/dist/bundle/{program-P2VATMKJ.js → program-IELITPKT.js} +46 -46
- package/dist/bundle/{prompt-BTIHH3Z4.js → prompt-2CP6CQ5N.js} +2 -2
- package/dist/bundle/{recognize-CTSJXPIG.js → recognize-R2DEQ5TC.js} +1 -1
- package/dist/bundle/{remote-2FIGCMKL.js → remote-JG3POFES.js} +6 -6
- package/dist/bundle/{rerank-TI5SLEF4.js → rerank-TVMR3OLL.js} +4 -4
- package/dist/bundle/{serve-IO3IM5C7.js → serve-DBWSMLPH.js} +6 -6
- package/dist/bundle/{server-WEPFFTYA.js → server-EXJ2WNZY.js} +37 -35
- package/dist/bundle/server-SXNFFAIR.js +61 -0
- package/dist/bundle/{sqlite-runtime-CTEYXX7L.js → sqlite-runtime-AWMY7W4Q.js} +3 -3
- package/dist/bundle/{state-GFHVDGHM.js → state-HN44BWNQ.js} +3 -3
- package/dist/bundle/{store-RCK6HT4F.js → store-GIYS3LHV.js} +9 -9
- package/dist/bundle/{store-Y5XC4LEM.js → store-LOVKYQDC.js} +15 -11
- package/dist/bundle/store-maintenance-command-X3VOYNCG.js +52 -0
- package/dist/bundle/tg.js +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/bundle/chunk-BSKYPHLB.js +0 -76
- package/dist/bundle/server-RIGXUTKZ.js +0 -62
- package/dist/bundle/store-maintenance-command-XH6VMCDU.js +0 -52
|
@@ -12,10 +12,7 @@ import {
|
|
|
12
12
|
refuseWriteBeforeConnecting,
|
|
13
13
|
registerPrompts,
|
|
14
14
|
syncsFirst
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
answeredWire
|
|
18
|
-
} from "./chunk-BSKYPHLB.js";
|
|
15
|
+
} from "./chunk-YSXDCSBP.js";
|
|
19
16
|
import {
|
|
20
17
|
BinaryResource,
|
|
21
18
|
Picture,
|
|
@@ -36,30 +33,31 @@ import {
|
|
|
36
33
|
tool,
|
|
37
34
|
toolKey,
|
|
38
35
|
toolsFromCommands
|
|
39
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-IV2KJQ5F.js";
|
|
40
37
|
import {
|
|
41
38
|
agentJson,
|
|
42
39
|
skillResource
|
|
43
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-R4QVV3LN.js";
|
|
44
41
|
import {
|
|
45
42
|
StdioServerTransport,
|
|
43
|
+
answeredWire,
|
|
46
44
|
callerOf,
|
|
47
45
|
callingAgent,
|
|
48
46
|
serveStdio
|
|
49
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-MC6FOTCV.js";
|
|
50
48
|
import {
|
|
51
49
|
instructions
|
|
52
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-IHLNXL2D.js";
|
|
53
51
|
import {
|
|
54
52
|
McpServer,
|
|
55
53
|
ResourceTemplate
|
|
56
54
|
} from "./chunk-5D4AEUVA.js";
|
|
57
55
|
import {
|
|
58
56
|
mcpHttpMarker
|
|
59
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-Q3ZO6Q3M.js";
|
|
60
58
|
import {
|
|
61
59
|
connectedFor
|
|
62
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-FHGAJK4I.js";
|
|
63
61
|
import {
|
|
64
62
|
capability,
|
|
65
63
|
dateWindow,
|
|
@@ -69,25 +67,26 @@ import {
|
|
|
69
67
|
servicesFor,
|
|
70
68
|
storedDeps,
|
|
71
69
|
wholeList
|
|
72
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-IIHCSJV2.js";
|
|
73
71
|
import {
|
|
74
72
|
warmEmbedders
|
|
75
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-4DSIGS2E.js";
|
|
76
74
|
import {
|
|
77
75
|
stdinFieldOf
|
|
78
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-ODBK56ZR.js";
|
|
79
77
|
import {
|
|
80
78
|
openStore,
|
|
81
79
|
pdfPreviewLimits
|
|
82
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-T2CWSFGY.js";
|
|
83
81
|
import {
|
|
84
82
|
findCommand
|
|
85
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-XYAH6QQO.js";
|
|
86
84
|
import {
|
|
87
85
|
DEFAULT_OUTPUT_BYTES,
|
|
88
86
|
changesAuthorityAt,
|
|
89
87
|
describeProgram,
|
|
90
88
|
environmentOf,
|
|
89
|
+
fetchesAt,
|
|
91
90
|
fetchesOnlyAt,
|
|
92
91
|
itemOf,
|
|
93
92
|
judgedTargets,
|
|
@@ -98,22 +97,23 @@ import {
|
|
|
98
97
|
rootOf2 as rootOf,
|
|
99
98
|
sealed,
|
|
100
99
|
snakeKeys
|
|
101
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-2QHIOPSA.js";
|
|
102
101
|
import {
|
|
103
102
|
withCaller
|
|
104
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-ZVLYK6CZ.js";
|
|
105
104
|
import {
|
|
106
105
|
readOnlyLockOf
|
|
107
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-YVV5S2QA.js";
|
|
108
107
|
import {
|
|
109
108
|
timezoneOf,
|
|
110
109
|
typedCommand
|
|
111
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-AF2XVV5P.js";
|
|
112
111
|
import {
|
|
113
112
|
isCliFailure
|
|
114
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-MGBVVQTU.js";
|
|
115
114
|
import {
|
|
116
115
|
description,
|
|
116
|
+
errorObjectOf,
|
|
117
117
|
integer,
|
|
118
118
|
maxValue,
|
|
119
119
|
mcpErrorResult,
|
|
@@ -136,10 +136,10 @@ import {
|
|
|
136
136
|
__name
|
|
137
137
|
} from "./chunk-ZVVMGPBJ.js";
|
|
138
138
|
|
|
139
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
139
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/mcp/server.js
|
|
140
140
|
import { randomUUID } from "node:crypto";
|
|
141
141
|
|
|
142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
142
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/mcp/agent-log.js
|
|
143
143
|
var agentLog = /* @__PURE__ */ __name((open) => {
|
|
144
144
|
let held;
|
|
145
145
|
return {
|
|
@@ -158,7 +158,7 @@ var agentLog = /* @__PURE__ */ __name((open) => {
|
|
|
158
158
|
};
|
|
159
159
|
}, "agentLog");
|
|
160
160
|
|
|
161
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
161
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/mcp/resources.js
|
|
162
162
|
var LISTED = 100;
|
|
163
163
|
var registerResources = /* @__PURE__ */ __name((server, session, { command, name, limit, recorded, withStore, messenger, guard, assertRead }) => {
|
|
164
164
|
server.registerResource("chat", new ResourceTemplate(`${command}://chat/{id}`, {
|
|
@@ -196,7 +196,7 @@ var registerResources = /* @__PURE__ */ __name((server, session, { command, name
|
|
|
196
196
|
});
|
|
197
197
|
}, "registerResources");
|
|
198
198
|
|
|
199
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
199
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/mcp/session.js
|
|
200
200
|
var HARMLESS = /* @__PURE__ */ new Set(["validation_error", "not_found", "permission_error", "confirmation_required", "rate_limited"]);
|
|
201
201
|
var harmless = /* @__PURE__ */ __name((code) => HARMLESS.has(code), "harmless");
|
|
202
202
|
var MessengerSession = class {
|
|
@@ -271,7 +271,7 @@ var MessengerSession = class {
|
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
|
|
274
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
274
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/mcp/tools/attachments.js
|
|
275
275
|
var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
|
|
276
276
|
const _command = messenger.app.command;
|
|
277
277
|
return {
|
|
@@ -325,7 +325,7 @@ var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
|
|
|
325
325
|
};
|
|
326
326
|
}, "attachmentsTools");
|
|
327
327
|
|
|
328
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
328
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/mcp/tools/messages-photo.js
|
|
329
329
|
var PHOTO_LIMIT = 512 * 1024;
|
|
330
330
|
var IMAGE_TYPES = [
|
|
331
331
|
["image/jpeg", (b) => b[0] === 255 && b[1] === 216 && b[2] === 255],
|
|
@@ -341,14 +341,16 @@ var messagesPhotoTools = /* @__PURE__ */ __name((messenger) => ({
|
|
|
341
341
|
input: object({
|
|
342
342
|
chat: chatOf(messenger),
|
|
343
343
|
message,
|
|
344
|
-
|
|
344
|
+
attachment: optional(pipe(number(), integer(), minValue(1), description("which file of the message, from 1; omit for the first photo")))
|
|
345
345
|
}),
|
|
346
346
|
annotations: READ,
|
|
347
347
|
online: /* @__PURE__ */ __name(async (adapter, args, defaults) => {
|
|
348
348
|
const { id: chatId } = await adapter.resolve(args.chat);
|
|
349
349
|
const saveIt = `the owner can save it with \`${typedCommand(messenger.app.command, `messages download ${chatId} ${args.message}`)}\``;
|
|
350
350
|
const { files } = await capability(adapter, "download", "download attachments")(chatId, args.message);
|
|
351
|
-
|
|
351
|
+
if (args.attachment !== void 0 && args.attachment > files.length)
|
|
352
|
+
throw new CliError("not_found", `message ${args.message} has ${files.length} file${files.length === 1 ? "" : "s"}, no file ${args.attachment}`);
|
|
353
|
+
const photo = args.attachment === void 0 ? files.find((file) => file.kind === "photo") : files[args.attachment - 1];
|
|
352
354
|
if (!photo) {
|
|
353
355
|
const kinds = files.map((file) => file.kind).join(", ");
|
|
354
356
|
throw new CliError(files.length === 0 ? "not_found" : "validation_error", files.length === 0 ? `message ${args.message} has no photo` : `the message has a ${kinds}, not a photo \u2014 ${saveIt}`);
|
|
@@ -379,7 +381,7 @@ var readUpTo = /* @__PURE__ */ __name(async (file, limit, saveIt) => {
|
|
|
379
381
|
return new Uint8Array(Buffer.concat(chunks));
|
|
380
382
|
}, "readUpTo");
|
|
381
383
|
|
|
382
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
384
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/mcp/tools/stats.js
|
|
383
385
|
var statsTools = /* @__PURE__ */ __name((messenger) => ({
|
|
384
386
|
stats_charts: tool({
|
|
385
387
|
title: "A chart from a chat's statistics",
|
|
@@ -416,14 +418,14 @@ var statsTools = /* @__PURE__ */ __name((messenger) => ({
|
|
|
416
418
|
})
|
|
417
419
|
}), "statsTools");
|
|
418
420
|
|
|
419
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
421
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/mcp/tools.js
|
|
420
422
|
var pictureTools = /* @__PURE__ */ __name((messenger) => Object.fromEntries(Object.entries({
|
|
421
423
|
...messagesPhotoTools(messenger),
|
|
422
424
|
...attachmentsTools(messenger),
|
|
423
425
|
...statsTools(messenger)
|
|
424
426
|
}).map(([name, definition]) => [name, { ...definition, input: strictObject(definition.input.entries) }])), "pictureTools");
|
|
425
427
|
|
|
426
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
428
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/mcp/server.js
|
|
427
429
|
var PER_RUN = /* @__PURE__ */ new Set([
|
|
428
430
|
"streams",
|
|
429
431
|
"stdin",
|
|
@@ -482,7 +484,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
|
|
|
482
484
|
return void 0;
|
|
483
485
|
}
|
|
484
486
|
}, "stdin");
|
|
485
|
-
const syncAllowed = /* @__PURE__ */ __name((path) => syncsFirst(messenger) && levelOf("messages.sync-first")
|
|
487
|
+
const syncAllowed = /* @__PURE__ */ __name((path) => syncsFirst(messenger) && fetchesAt(levelOf("messages.sync-first")) && (path[0] !== "stats" || fetchesAt(levelOf(`${path.join(".")}.sync-first`))), "syncAllowed");
|
|
486
488
|
const generated = toolsFromCommands(program.commands, {
|
|
487
489
|
includeUnavailable: true,
|
|
488
490
|
exclude: [["bot"]],
|
|
@@ -588,8 +590,8 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
|
|
|
588
590
|
});
|
|
589
591
|
}), "invoke");
|
|
590
592
|
let queue = Promise.resolve();
|
|
591
|
-
const queued = /* @__PURE__ */ __name((one, input, env, caller) => {
|
|
592
|
-
const next = queue.then(() => invoke(one, input, env, caller));
|
|
593
|
+
const queued = /* @__PURE__ */ __name((one, input, env, caller, signal) => {
|
|
594
|
+
const next = queue.then(() => signal?.aborted ? { error: errorObjectOf(new CliError("cancelled", `${one.command} was cancelled before it started`)) } : invoke(one, input, env, caller));
|
|
593
595
|
queue = next.catch(() => void 0);
|
|
594
596
|
return next;
|
|
595
597
|
}, "queued");
|
|
@@ -605,7 +607,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
|
|
|
605
607
|
const traceparent = ctx?.mcpReq?._meta?.traceparent;
|
|
606
608
|
const env = typeof traceparent === "string" ? { ...context.env, TRACEPARENT: traceparent } : context.env;
|
|
607
609
|
const caller = callerOf(ctx, keyOfCommand(one.command), source);
|
|
608
|
-
const answer = await withCaller(caller, () => queued(one, args, env, caller));
|
|
610
|
+
const answer = await withCaller(caller, () => queued(one, args, env, caller, ctx?.mcpReq?.signal));
|
|
609
611
|
const result = "error" in answer ? mcpErrorResult(JSON.parse(agentJson(answer.error))) : (() => {
|
|
610
612
|
try {
|
|
611
613
|
return answered(envelope(one.command, answer.result), DEFAULT_OUTPUT_BYTES, targets);
|
|
@@ -661,7 +663,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
|
|
|
661
663
|
spawnJob: sessionOptions.spawnJob,
|
|
662
664
|
limit: settings.limit,
|
|
663
665
|
get syncAllowed() {
|
|
664
|
-
return syncsFirst(messenger) && levelOf("messages.sync-first")
|
|
666
|
+
return syncsFirst(messenger) && fetchesAt(levelOf("messages.sync-first"));
|
|
665
667
|
},
|
|
666
668
|
guard,
|
|
667
669
|
settings,
|
|
@@ -728,18 +730,8 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
|
|
|
728
730
|
transport: new StdioServerTransport(wire.input, wire.output),
|
|
729
731
|
onerror: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onerror")
|
|
730
732
|
});
|
|
731
|
-
|
|
732
|
-
wire.ended.then(() => resolve("input"));
|
|
733
|
-
if (own)
|
|
734
|
-
signal?.addEventListener("abort", () => resolve("stopped"), { once: true });
|
|
735
|
-
else {
|
|
736
|
-
process.once("SIGINT", () => resolve("stopped"));
|
|
737
|
-
process.once("SIGTERM", () => resolve("stopped"));
|
|
738
|
-
}
|
|
739
|
-
});
|
|
733
|
+
await wire.finished(own ? signal : void 0);
|
|
740
734
|
try {
|
|
741
|
-
if (ended === "input")
|
|
742
|
-
await wire.answered();
|
|
743
735
|
wire.release();
|
|
744
736
|
await handle.close();
|
|
745
737
|
await session.close();
|
|
@@ -750,7 +742,7 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
|
|
|
750
742
|
}, "serveOverStdio");
|
|
751
743
|
var serveOverHttpUntilStopped = /* @__PURE__ */ __name(async (command, context, messenger, options, http) => {
|
|
752
744
|
const { session, embedders, build, log } = createServer(command, context, messenger, options);
|
|
753
|
-
const { serveOverHttp } = await import("./serve-
|
|
745
|
+
const { serveOverHttp } = await import("./serve-DBWSMLPH.js");
|
|
754
746
|
const appName = messenger.app.command;
|
|
755
747
|
const appEnvPrefix = messenger.app.envPrefix;
|
|
756
748
|
const listening = await serveOverHttp(build, {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
id,
|
|
6
6
|
text,
|
|
7
7
|
time
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AF2XVV5P.js";
|
|
9
9
|
import {
|
|
10
10
|
array,
|
|
11
11
|
nullable,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
unknown
|
|
19
19
|
} from "./chunk-XS5C5TQ7.js";
|
|
20
20
|
|
|
21
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/entities/note.js
|
|
22
22
|
var link = {
|
|
23
23
|
target_text: nullable(text),
|
|
24
24
|
kind: text,
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
servicesFor,
|
|
17
17
|
throughWrapper,
|
|
18
18
|
withFileLockAsync
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IIHCSJV2.js";
|
|
20
20
|
import {
|
|
21
21
|
servingProfiles
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-2IL4YDGG.js";
|
|
23
23
|
import {
|
|
24
24
|
chatReferenceOf,
|
|
25
25
|
ensureAccount,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
isId,
|
|
28
28
|
openStore,
|
|
29
29
|
pickPerson
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-T2CWSFGY.js";
|
|
31
31
|
import {
|
|
32
32
|
CEILING_KEY,
|
|
33
33
|
WRITE_KEYS,
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
codeOf,
|
|
37
37
|
currentOperation,
|
|
38
38
|
environmentOf,
|
|
39
|
+
fetchesUnder,
|
|
39
40
|
issueMessage,
|
|
40
41
|
keyForCommand,
|
|
41
42
|
levelFor,
|
|
@@ -47,13 +48,13 @@ import {
|
|
|
47
48
|
rememberAccount,
|
|
48
49
|
rootOf2 as rootOf,
|
|
49
50
|
skipFlagFor
|
|
50
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-2QHIOPSA.js";
|
|
51
52
|
import {
|
|
52
53
|
providerErrorKey
|
|
53
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-ZVLYK6CZ.js";
|
|
54
55
|
import {
|
|
55
56
|
isCliFailure
|
|
56
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-MGBVVQTU.js";
|
|
57
58
|
import {
|
|
58
59
|
resolvePaths
|
|
59
60
|
} from "./chunk-NM5GBJME.js";
|
|
@@ -64,7 +65,7 @@ import {
|
|
|
64
65
|
__name
|
|
65
66
|
} from "./chunk-ZVVMGPBJ.js";
|
|
66
67
|
|
|
67
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
68
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
|
|
68
69
|
import { openSync } from "node:fs";
|
|
69
70
|
import { createInterface } from "node:readline";
|
|
70
71
|
import { ReadStream } from "node:tty";
|
|
@@ -119,7 +120,7 @@ var terminalAsker = /* @__PURE__ */ __name((command) => async (key, request) =>
|
|
|
119
120
|
throw new CliError("cancelled", `${key}: not done \u2014 the answer was no`);
|
|
120
121
|
}, "terminalAsker");
|
|
121
122
|
|
|
122
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
123
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/sends/pace.js
|
|
123
124
|
import { readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
124
125
|
import { join } from "node:path";
|
|
125
126
|
var DEFAULT_PACE = { perMinute: 60, burst: 20 };
|
|
@@ -214,7 +215,7 @@ var waitForTurn = /* @__PURE__ */ __name(async (pacer, options) => {
|
|
|
214
215
|
await (options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms))))(waitMs);
|
|
215
216
|
}, "waitForTurn");
|
|
216
217
|
|
|
217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
218
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
|
|
218
219
|
var pathOf = /* @__PURE__ */ __name((command) => {
|
|
219
220
|
const words = [];
|
|
220
221
|
for (let at = command; at?.parent; at = at.parent)
|
|
@@ -274,7 +275,7 @@ var refuseUnknownPermissionKeys = /* @__PURE__ */ __name((command, settings, too
|
|
|
274
275
|
throw new CliError("validation_error", `--permission ${key} names no command`, { permission: key });
|
|
275
276
|
}, "refuseUnknownPermissionKeys");
|
|
276
277
|
|
|
277
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
278
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
|
|
278
279
|
var LONG_LIVED = /* @__PURE__ */ new Set(["self", "newSendId", "close", "formatMarkdown", "formatHtml", "storedChats"]);
|
|
279
280
|
var LISTENING = /* @__PURE__ */ new Set(["watch", "feed", "listen", "listenHistory"]);
|
|
280
281
|
var BLOCKING = /* @__PURE__ */ new Set(["frozen", "limited", "banned"]);
|
|
@@ -371,7 +372,7 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
|
|
|
371
372
|
});
|
|
372
373
|
}, "flooded");
|
|
373
374
|
|
|
374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
375
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
|
|
375
376
|
var observed = /* @__PURE__ */ __name((messenger, events) => {
|
|
376
377
|
const timed = /* @__PURE__ */ __name(async (operation, named, work, after) => {
|
|
377
378
|
const write = currentOperation();
|
|
@@ -470,7 +471,7 @@ var byPart = /* @__PURE__ */ __name((batch, counts) => {
|
|
|
470
471
|
counts[part] = (counts[part] ?? 0) + items.length;
|
|
471
472
|
}, "byPart");
|
|
472
473
|
|
|
473
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
474
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
|
|
474
475
|
var REKEY_PACING = { lockMs: 50, pauseMs: 25 };
|
|
475
476
|
var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events, pending, announcing, deletedWithoutChat, profile, rekeyed, rekeyPacing = REKEY_PACING, closing, namesFromStore, recipientIds, countsUnread = false, historyLimits, command = "cli" }) => {
|
|
476
477
|
let warned = false;
|
|
@@ -1046,7 +1047,7 @@ var keep = /* @__PURE__ */ __name(async (store, account, event, seenAt, among, c
|
|
|
1046
1047
|
}
|
|
1047
1048
|
}, "keep");
|
|
1048
1049
|
|
|
1049
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1050
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
|
|
1050
1051
|
var lazyStore = /* @__PURE__ */ __name((env, command, version) => {
|
|
1051
1052
|
let opened;
|
|
1052
1053
|
return {
|
|
@@ -1324,6 +1325,8 @@ var refuseLocalWrite = /* @__PURE__ */ __name((context, command, permission) =>
|
|
|
1324
1325
|
const { level, key } = levelFor(settings.permissions, permission);
|
|
1325
1326
|
if (level === "allow" || level === "ask" && context.agent)
|
|
1326
1327
|
return;
|
|
1328
|
+
if (fetchesUnder(level, permission))
|
|
1329
|
+
return;
|
|
1327
1330
|
if (key === CEILING_KEY)
|
|
1328
1331
|
throw ceilingRefusal(permission, command);
|
|
1329
1332
|
throw new CliError(level === "ask" ? "confirmation_required" : "permission_error", `profile ${settings.profile} does not let ${permission} write (permissions.${key} is ${level}, from the ${settings.permissionSources[key ?? ""] ?? "default"}); to allow it: ${command} ${settings.profile} config set permissions.${permission} allow`, { permission });
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/mcp/bot/instructions.js
|
|
8
8
|
var botInstructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => [
|
|
9
9
|
`The owner's ${name} bot "${profile}", through the official Bot API \u2014 not the owner's personal account. What it writes, people see as the bot.`,
|
|
10
10
|
"Use these tools to read the chats this bot is in, find a message or a person, and \u2014 when the profile allows \u2014 write as the bot.",
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
MAX_SECRET_INPUT,
|
|
5
5
|
bufferedInput,
|
|
6
6
|
inputPolicy
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7I5NMVX7.js";
|
|
8
8
|
import {
|
|
9
9
|
CliError
|
|
10
10
|
} from "./chunk-7KCBPAQS.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
__name
|
|
13
13
|
} from "./chunk-ZVVMGPBJ.js";
|
|
14
14
|
|
|
15
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/terminal/prompt.js
|
|
16
16
|
import { createInterface } from "node:readline";
|
|
17
17
|
import { Writable } from "node:stream";
|
|
18
18
|
var EMPTY_TRIES = 3;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.662.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.99.0_commander@15._e11817b5a9b273e1a17561462f2db6c9/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
|
|
8
8
|
var instructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => {
|
|
9
9
|
const all = typeof profile !== "string";
|
|
10
10
|
const offers = /* @__PURE__ */ __name((key) => all || writes.includes(key), "offers");
|