@wirecat/tg-cli 0.115.0 → 0.117.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/bot/transport.d.ts +11 -9
- package/dist/bot/transport.d.ts.map +1 -1
- package/dist/bot/transport.js +58 -32
- package/dist/bot/transport.js.map +1 -1
- package/dist/bundle/{adapter-ODK7R4LY.js → adapter-VNQ72MBK.js} +98 -63
- package/dist/bundle/{all-profiles-AQYM65BS.js → all-profiles-3W2UQTCK.js} +10 -9
- package/dist/bundle/{anthropic-VBDSVNIM.js → anthropic-DFUW2KTG.js} +6 -6
- package/dist/bundle/{app-server-YOIHLBNS.js → app-server-5XJIMLHB.js} +49 -45
- package/dist/bundle/{bot-api-TRYLGQKK.js → bot-api-HRRBF3W6.js} +50 -49
- package/dist/bundle/{bot-history-7DTJLBBJ.js → bot-history-GBH5XE4N.js} +18 -17
- package/dist/bundle/{bun-XIMM6EHD.js → bun-ZMOYGG6F.js} +2 -2
- package/dist/bundle/{bun-sqlite-6B3BL5IV.js → bun-sqlite-6FZFMA7K.js} +5 -5
- package/dist/bundle/{chunk-DIABP7ZP.js → chunk-2452HCIV.js} +3 -3
- package/dist/bundle/{chunk-WMG4IGEB.js → chunk-2XLKZL6K.js} +77 -38
- package/dist/bundle/chunk-3GRX7WP6.js +35 -0
- package/dist/bundle/{chunk-WINKEV4F.js → chunk-3MQOLYAN.js} +4 -4
- package/dist/bundle/{chunk-KDOBY524.js → chunk-3RJYLN5V.js} +133 -27
- package/dist/bundle/{chunk-Y3AQHPAJ.js → chunk-4JDGN6OD.js} +1 -1
- package/dist/bundle/{chunk-JZXQZW2D.js → chunk-56Q5JV3Z.js} +2 -2
- package/dist/bundle/{chunk-XIYRHIBK.js → chunk-66FZBLRJ.js} +13 -13
- package/dist/bundle/{chunk-OUX3QMYI.js → chunk-6GFUL4OU.js} +228 -84
- package/dist/bundle/{chunk-O7CBGHI7.js → chunk-6HRN7BW6.js} +1 -1
- package/dist/bundle/{chunk-TQYMLXDS.js → chunk-7NBUT62O.js} +3 -3
- package/dist/bundle/{chunk-A4BQGSKI.js → chunk-7Y3RUEVY.js} +6 -6
- package/dist/bundle/chunk-AG6HWPQP.js +64 -0
- package/dist/bundle/{chunk-GCFU6WBE.js → chunk-AUBRELCM.js} +3 -3
- package/dist/bundle/{chunk-PEKTB3FQ.js → chunk-B2YPB5AE.js} +56 -27
- package/dist/bundle/{chunk-CCHHEMPM.js → chunk-BXTDAGM4.js} +3 -2
- package/dist/bundle/{chunk-QK6VLKG5.js → chunk-C6TUVV7E.js} +674 -316
- package/dist/bundle/{chunk-XY7IGVVS.js → chunk-EA2PGDER.js} +2 -2
- package/dist/bundle/{chunk-KIZT2MI6.js → chunk-EL6I4WTB.js} +1 -1
- package/dist/bundle/{chunk-77M3IAVU.js → chunk-EPCFXKTX.js} +27 -8
- package/dist/bundle/{chunk-L4CMCC3V.js → chunk-EZTYJ43A.js} +4 -2
- package/dist/bundle/{chunk-PEJHI7QO.js → chunk-F6KBVIJP.js} +4 -4
- package/dist/bundle/{chunk-UY7GJRGY.js → chunk-FAHHERJ7.js} +4 -4
- package/dist/bundle/{chunk-WOQGUIXE.js → chunk-FEKXHILZ.js} +1 -1
- package/dist/bundle/chunk-G7B5UIE7.js +182 -0
- package/dist/bundle/{chunk-RFRI2HFT.js → chunk-GFHNQBD2.js} +1 -1
- package/dist/bundle/{chunk-TMATSEP5.js → chunk-HORGORHK.js} +12 -12
- package/dist/bundle/{chunk-2TC76TLJ.js → chunk-HWYSRB64.js} +2 -2
- package/dist/bundle/{chunk-GX4DMI4H.js → chunk-HZZGOLGP.js} +15 -12
- package/dist/bundle/{chunk-MUZ4KYGY.js → chunk-JWIUK3SK.js} +2 -2
- package/dist/bundle/{chunk-WDNNN3J4.js → chunk-KVTLT4V7.js} +6 -6
- package/dist/bundle/{chunk-UBQ3LOF6.js → chunk-L5WNE4WS.js} +2 -2
- package/dist/bundle/{chunk-OMP6ALBT.js → chunk-M7V5XRM6.js} +3 -3
- package/dist/bundle/{chunk-LUIPXRKN.js → chunk-MLHKQDUN.js} +647 -129
- package/dist/bundle/{chunk-VQCWVZWG.js → chunk-MP7M6FFU.js} +6 -6
- package/dist/bundle/{chunk-5ROWSRK7.js → chunk-NUCDEOFC.js} +2 -2
- package/dist/bundle/{chunk-ILHTNOIV.js → chunk-P3ASN72F.js} +1 -1
- package/dist/bundle/{chunk-VVKEWWSO.js → chunk-PTIB7NEE.js} +1 -1
- package/dist/bundle/{chunk-D4E345BC.js → chunk-Q7O4CQDO.js} +4 -2
- package/dist/bundle/{chunk-EW3XTUPB.js → chunk-QOGYHU3Q.js} +4 -4
- package/dist/bundle/{chunk-BEQPZA3S.js → chunk-RDH2QBUE.js} +3 -3
- package/dist/bundle/{chunk-AVWPMJ6E.js → chunk-RDSLSV4M.js} +2 -2
- package/dist/bundle/{chunk-YCUQKFGD.js → chunk-SQXB5ZUZ.js} +3 -3
- package/dist/bundle/{chunk-RHUNMU4Q.js → chunk-TFBHDIGY.js} +4 -4
- package/dist/bundle/{chunk-OSP335AJ.js → chunk-TG6ZYL4B.js} +8 -8
- package/dist/bundle/{chunk-IUDIRZVU.js → chunk-UGPZCNYC.js} +991 -536
- package/dist/bundle/{chunk-AICS3TSF.js → chunk-UYK5AXSW.js} +4 -4
- package/dist/bundle/{chunk-PZAEI4NM.js → chunk-V2T7NYNU.js} +55 -46
- package/dist/bundle/{chunk-HZKWB6WS.js → chunk-V47NPSSV.js} +28 -28
- package/dist/bundle/{chunk-U67TSAAO.js → chunk-VMCQGZIA.js} +1893 -840
- package/dist/bundle/{chunk-CNO3R4O4.js → chunk-VRDVXXXD.js} +8 -8
- package/dist/bundle/{chunk-PQLBPYJR.js → chunk-VW6BF6M7.js} +1 -1
- package/dist/bundle/{chunk-M7B5IMH3.js → chunk-X3CD475M.js} +1336 -366
- package/dist/bundle/chunk-XW5C4TI7.js +91 -0
- package/dist/bundle/{chunk-NTW5ZE47.js → chunk-YHZFGUAP.js} +39 -33
- package/dist/bundle/{chunk-BIEBJLYO.js → chunk-YIXXH74F.js} +2 -2
- package/dist/bundle/{chunk-BPPRR7TV.js → chunk-Z4QKLHJW.js} +15587 -1637
- package/dist/bundle/{chunk-POKTQZOM.js → chunk-ZPILMEFY.js} +12 -89
- package/dist/bundle/command-contract-KMMHARMR.js +33 -0
- package/dist/bundle/{decode-2GATBZGH.js → decode-YMSOY2AY.js} +5 -5
- package/dist/bundle/{dispatch-MJMW7WDH.js → dispatch-OP27MWX5.js} +8 -8
- package/dist/bundle/{echarts-GKEZEAL7.js → echarts-7XS55TQY.js} +2 -2
- package/dist/bundle/{embed-TBQPLA4Y.js → embed-QTOE7NN3.js} +6 -6
- package/dist/bundle/{embedder-B5DTNCRO.js → embedder-KBBRYSNH.js} +9 -9
- package/dist/bundle/{entry-A6DEW2TD.js → entry-HGEUYYMX.js} +7 -7
- package/dist/bundle/{failure-TLF3SISS.js → failure-4JUQFXJT.js} +2 -2
- package/dist/bundle/{first-run-3N5AABEY.js → first-run-CSGMEJXY.js} +11 -11
- package/dist/bundle/first-screen-K2PBNJNE.js +31 -0
- package/dist/bundle/{instructions-P5E34PQR.js → instructions-S6ZXCTFH.js} +1 -1
- package/dist/bundle/{mcp-MNI62HHE.js → mcp-M4QN2E7R.js} +2 -2
- package/dist/bundle/{node-GKPRXS5Y.js → node-LCIUWXXG.js} +2 -2
- package/dist/bundle/{node-sqlite-GIDPALK3.js → node-sqlite-HL4WY4N2.js} +6 -6
- package/dist/bundle/{oauth-C57W4IMD.js → oauth-U4KIMDKG.js} +7 -7
- package/dist/bundle/{open-E6Q4WRPU.js → open-EH7OS7M7.js} +5 -5
- package/dist/bundle/{openai-5WMXY2KP.js → openai-W5TB3NA5.js} +14 -14
- package/dist/bundle/{process-U2P5Z6UF.js → process-3CVLTCTA.js} +1 -1
- package/dist/bundle/{program-FEUDU6GF.js → program-LOIZTK2P.js} +58 -50
- package/dist/bundle/{prompt-4NGAZGHE.js → prompt-IDNH7N3W.js} +5 -5
- package/dist/bundle/{proxy-transport-MGCJ7JAW.js → proxy-transport-4DPZB2W2.js} +5 -5
- package/dist/bundle/{recognize-EUHRBA7V.js → recognize-G5EWYXIF.js} +4 -4
- package/dist/bundle/{remote-3JHLB2FV.js → remote-4XTBZVZD.js} +7 -7
- package/dist/bundle/{rerank-ZZ45SZPC.js → rerank-OWSTDLZN.js} +7 -7
- package/dist/bundle/{serve-XOGX5FC5.js → serve-YCPSEWP3.js} +9 -9
- package/dist/bundle/server-KELKX6S3.js +60 -0
- package/dist/bundle/{server-I6O72XP5.js → server-ODG4A2KK.js} +35 -34
- package/dist/bundle/{state-BIUYTGH6.js → state-OL2235G5.js} +6 -6
- package/dist/bundle/{store-FOJFYOMR.js → store-5AACYNDM.js} +17 -12
- package/dist/bundle/store-maintenance-command-3J7WZYVN.js +50 -0
- package/dist/bundle/tg.js +13 -13
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +7 -0
- package/dist/commands/session.js.map +1 -1
- package/dist/telegram/account.d.ts.map +1 -1
- package/dist/telegram/account.js +4 -1
- package/dist/telegram/account.js.map +1 -1
- package/dist/telegram/errors.d.ts.map +1 -1
- package/dist/telegram/errors.js +2 -1
- package/dist/telegram/errors.js.map +1 -1
- package/dist/telegram/feature.d.ts +4 -1
- package/dist/telegram/feature.d.ts.map +1 -1
- package/dist/telegram/feature.js +5 -2
- package/dist/telegram/feature.js.map +1 -1
- package/dist/telegram/login.d.ts +2 -0
- package/dist/telegram/login.d.ts.map +1 -1
- package/dist/telegram/login.js +31 -2
- package/dist/telegram/login.js.map +1 -1
- package/dist/telegram/sending.d.ts.map +1 -1
- package/dist/telegram/sending.js +24 -10
- package/dist/telegram/sending.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/chunk-63YKD7YA.js +0 -18
- package/dist/bundle/chunk-GWDMKEDY.js +0 -48
- package/dist/bundle/chunk-WMRFAK5B.js +0 -132
- package/dist/bundle/command-contract-YF4KGFXC.js +0 -32
- package/dist/bundle/first-screen-HANARM67.js +0 -30
- package/dist/bundle/server-DRE5MJ76.js +0 -59
- package/dist/bundle/store-maintenance-command-YKV2C34N.js +0 -49
- /package/dist/bundle/{chunk-NUN6OGOV.js → chunk-VOXIGICJ.js} +0 -0
|
@@ -7,18 +7,18 @@ import {
|
|
|
7
7
|
describeOptions,
|
|
8
8
|
keyForCommand,
|
|
9
9
|
metaOf
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-X3CD475M.js";
|
|
11
11
|
import {
|
|
12
12
|
jsonSchemaOf
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-EPCFXKTX.js";
|
|
14
14
|
import {
|
|
15
15
|
CliError
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BXTDAGM4.js";
|
|
17
17
|
import {
|
|
18
18
|
__name
|
|
19
19
|
} from "./chunk-ZVVMGPBJ.js";
|
|
20
20
|
|
|
21
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/command-contract.js
|
|
22
22
|
var SCHEMA_DIALECT = "https://json-schema.org/draft/2020-12/schema";
|
|
23
23
|
var outputOf = /* @__PURE__ */ __name((command) => {
|
|
24
24
|
const entity = answerEntitySchema(command);
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
refuseLacking,
|
|
14
14
|
servicesFor,
|
|
15
15
|
throughWrapper
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UGPZCNYC.js";
|
|
17
17
|
import {
|
|
18
18
|
CEILING_KEY,
|
|
19
19
|
LOG_ATTRIBUTES,
|
|
@@ -38,35 +38,35 @@ import {
|
|
|
38
38
|
rememberAccount,
|
|
39
39
|
rootOf2 as rootOf,
|
|
40
40
|
skipFlagFor
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-X3CD475M.js";
|
|
42
42
|
import {
|
|
43
43
|
isCliFailure,
|
|
44
44
|
providerErrorKey
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-ZPILMEFY.js";
|
|
46
46
|
import {
|
|
47
47
|
MESSENGER_CHANGE_REFUSAL,
|
|
48
48
|
readOnlyRefusal
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-Q7O4CQDO.js";
|
|
50
50
|
import {
|
|
51
51
|
servingProfiles
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-AUBRELCM.js";
|
|
53
53
|
import {
|
|
54
54
|
openStore
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-Z4QKLHJW.js";
|
|
56
56
|
import {
|
|
57
57
|
logRecordOf,
|
|
58
58
|
realSleep,
|
|
59
59
|
resolvePaths,
|
|
60
60
|
writeSecurely
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-YHZFGUAP.js";
|
|
62
62
|
import {
|
|
63
63
|
CliError
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-BXTDAGM4.js";
|
|
65
65
|
import {
|
|
66
66
|
__name
|
|
67
67
|
} from "./chunk-ZVVMGPBJ.js";
|
|
68
68
|
|
|
69
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
69
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
|
|
70
70
|
import { openSync } from "node:fs";
|
|
71
71
|
import { createInterface } from "node:readline";
|
|
72
72
|
import { ReadStream } from "node:tty";
|
|
@@ -121,10 +121,10 @@ var terminalAsker = /* @__PURE__ */ __name((command) => async (key, request) =>
|
|
|
121
121
|
throw new CliError("cancelled", `${key}: not done \u2014 the answer was no`);
|
|
122
122
|
}, "terminalAsker");
|
|
123
123
|
|
|
124
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
124
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/guard.js
|
|
125
125
|
import { randomUUID } from "node:crypto";
|
|
126
126
|
|
|
127
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
127
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/flood.js
|
|
128
128
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
129
129
|
import { dirname, join } from "node:path";
|
|
130
130
|
var MOST_DEADLINES = 50;
|
|
@@ -208,11 +208,11 @@ var FloodMemory = class {
|
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
210
|
|
|
211
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
211
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/journal.js
|
|
212
212
|
import { appendFileSync, mkdirSync as mkdirSync3, readFileSync as readFileSync2 } from "node:fs";
|
|
213
213
|
import { dirname as dirname3, join as join2 } from "node:path";
|
|
214
214
|
|
|
215
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
215
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
|
|
216
216
|
import { closeSync, mkdirSync as mkdirSync2, openSync as openSync2, statSync, unlinkSync } from "node:fs";
|
|
217
217
|
import { dirname as dirname2 } from "node:path";
|
|
218
218
|
var LOCK_WAIT_MS = 5e3;
|
|
@@ -279,7 +279,7 @@ var lockTime = /* @__PURE__ */ __name((lock) => {
|
|
|
279
279
|
}
|
|
280
280
|
}, "lockTime");
|
|
281
281
|
|
|
282
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
282
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/journal.js
|
|
283
283
|
var sendsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "sends", `${profile}.jsonl`), "sendsPathFor");
|
|
284
284
|
var SendJournal = class {
|
|
285
285
|
static {
|
|
@@ -356,7 +356,7 @@ var withSendId = /* @__PURE__ */ __name((entry) => {
|
|
|
356
356
|
return cid === void 0 || rest.sendId !== void 0 ? rest : { ...rest, sendId: String(cid) };
|
|
357
357
|
}, "withSendId");
|
|
358
358
|
|
|
359
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
359
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/recipients.js
|
|
360
360
|
import { existsSync, readFileSync as readFileSync3, rmSync } from "node:fs";
|
|
361
361
|
import { join as join3 } from "node:path";
|
|
362
362
|
var recipientsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "profiles", `${profile}.recipients.json`), "recipientsPathFor");
|
|
@@ -468,7 +468,7 @@ var RecipientList = class {
|
|
|
468
468
|
}
|
|
469
469
|
};
|
|
470
470
|
|
|
471
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
471
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/guard.js
|
|
472
472
|
var HOUR_MS = 60 * 60 * 1e3;
|
|
473
473
|
var READS_UNDER_HOLD = /* @__PURE__ */ new Set([
|
|
474
474
|
"attachments.extract",
|
|
@@ -661,7 +661,7 @@ var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env, a
|
|
|
661
661
|
}), "guardFor");
|
|
662
662
|
var journalFailure = /* @__PURE__ */ __name((error) => error?.code ?? (error instanceof Error ? error.name : "error"), "journalFailure");
|
|
663
663
|
|
|
664
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
664
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/pace.js
|
|
665
665
|
import { readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
666
666
|
import { join as join4 } from "node:path";
|
|
667
667
|
var DEFAULT_PACE = { perMinute: 60, burst: 20 };
|
|
@@ -719,8 +719,39 @@ var Pacer = class {
|
|
|
719
719
|
renameSync2(temporary, this.path);
|
|
720
720
|
}
|
|
721
721
|
};
|
|
722
|
+
var ANNOUNCE_WAIT_MS = 5e3;
|
|
723
|
+
var LONGEST_PACE_WAIT_MS = 5 * 6e4;
|
|
724
|
+
var waitForTurn = /* @__PURE__ */ __name(async (pacer, options) => {
|
|
725
|
+
const { name, operation, warn } = options;
|
|
726
|
+
const now = options.now ?? Date.now;
|
|
727
|
+
let at = now();
|
|
728
|
+
try {
|
|
729
|
+
at = await pacer.reserve();
|
|
730
|
+
} catch (error) {
|
|
731
|
+
warn?.(`could not remember ${name}'s wait (${error instanceof Error ? error.message : String(error)})`, {
|
|
732
|
+
event: "warning",
|
|
733
|
+
code: "wait_not_remembered",
|
|
734
|
+
operation
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
const waitMs = at - now();
|
|
738
|
+
if (waitMs <= 0)
|
|
739
|
+
return;
|
|
740
|
+
if (waitMs > LONGEST_PACE_WAIT_MS)
|
|
741
|
+
throw new CliError("rate_limited", `${name} asked this profile to wait, ${Math.ceil(waitMs / 1e3)} s are left \u2014 nothing was sent to ${name}`, { retry_after_ms: waitMs, retry_at: new Date(at).toISOString(), remembered: true });
|
|
742
|
+
if (waitMs >= ANNOUNCE_WAIT_MS) {
|
|
743
|
+
const seconds = Math.ceil(waitMs / 1e3);
|
|
744
|
+
warn?.(`waiting ${seconds} s to keep this profile's pace with ${name}`, {
|
|
745
|
+
event: "warning",
|
|
746
|
+
code: "pace_wait",
|
|
747
|
+
operation,
|
|
748
|
+
counts: { seconds }
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
await (options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms))))(waitMs);
|
|
752
|
+
}, "waitForTurn");
|
|
722
753
|
|
|
723
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
754
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
|
|
724
755
|
var pathOf = /* @__PURE__ */ __name((command) => {
|
|
725
756
|
const words = [];
|
|
726
757
|
for (let at = command; at?.parent; at = at.parent)
|
|
@@ -780,12 +811,10 @@ var refuseUnknownPermissionKeys = /* @__PURE__ */ __name((command, settings, too
|
|
|
780
811
|
throw new CliError("validation_error", `--permission ${key} names no command`, { permission: key });
|
|
781
812
|
}, "refuseUnknownPermissionKeys");
|
|
782
813
|
|
|
783
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
814
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
|
|
784
815
|
var LONG_LIVED = /* @__PURE__ */ new Set(["self", "newSendId", "close", "formatMarkdown", "formatHtml", "storedChats"]);
|
|
785
816
|
var LISTENING = /* @__PURE__ */ new Set(["watch", "feed", "listen", "listenHistory"]);
|
|
786
817
|
var BLOCKING = /* @__PURE__ */ new Set(["frozen", "limited", "banned"]);
|
|
787
|
-
var ANNOUNCE_WAIT_MS = 5e3;
|
|
788
|
-
var LONGEST_PACE_WAIT_MS = 5 * 6e4;
|
|
789
818
|
var chatOf = /* @__PURE__ */ __name((args) => typeof args[0] === "string" && /^-?\d+$/.test(args[0]) ? args[0] : void 0, "chatOf");
|
|
790
819
|
var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer }) => {
|
|
791
820
|
const kept = /* @__PURE__ */ __name(async (operation, what2) => {
|
|
@@ -841,28 +870,8 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
|
|
|
841
870
|
await kept(operation, () => pacer.holdFor(waitMs));
|
|
842
871
|
}, "noted");
|
|
843
872
|
const turn = /* @__PURE__ */ __name(async (operation) => {
|
|
844
|
-
if (
|
|
845
|
-
|
|
846
|
-
let at = Date.now();
|
|
847
|
-
await kept(operation, async () => {
|
|
848
|
-
at = await pacer.reserve();
|
|
849
|
-
});
|
|
850
|
-
const waitMs = at - Date.now();
|
|
851
|
-
if (waitMs <= 0)
|
|
852
|
-
return;
|
|
853
|
-
if (waitMs > LONGEST_PACE_WAIT_MS) {
|
|
854
|
-
throw new CliError("rate_limited", `${name} asked this profile to wait, ${Math.ceil(waitMs / 1e3)} s are left \u2014 nothing was sent to ${name}`, { retry_after_ms: waitMs, retry_at: new Date(at).toISOString(), remembered: true });
|
|
855
|
-
}
|
|
856
|
-
if (waitMs >= ANNOUNCE_WAIT_MS) {
|
|
857
|
-
const seconds = Math.ceil(waitMs / 1e3);
|
|
858
|
-
warn(`waiting ${seconds} s to keep this profile's pace with ${name}`, {
|
|
859
|
-
event: "warning",
|
|
860
|
-
code: "pace_wait",
|
|
861
|
-
operation,
|
|
862
|
-
counts: { seconds }
|
|
863
|
-
});
|
|
864
|
-
}
|
|
865
|
-
await new Promise((resolve) => setTimeout(resolve, waitMs));
|
|
873
|
+
if (pacer)
|
|
874
|
+
await waitForTurn(pacer, { name, operation, warn });
|
|
866
875
|
}, "turn");
|
|
867
876
|
return throughWrapper(messenger, {}, (operation, call) => {
|
|
868
877
|
if (LONG_LIVED.has(operation))
|
|
@@ -899,7 +908,7 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
|
|
|
899
908
|
});
|
|
900
909
|
}, "flooded");
|
|
901
910
|
|
|
902
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
911
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
|
|
903
912
|
var observed = /* @__PURE__ */ __name((messenger, events) => {
|
|
904
913
|
const timed = /* @__PURE__ */ __name(async (operation, named, work, after) => {
|
|
905
914
|
const write = currentOperation();
|
|
@@ -998,7 +1007,7 @@ var byPart = /* @__PURE__ */ __name((batch, counts) => {
|
|
|
998
1007
|
counts[part] = (counts[part] ?? 0) + items.length;
|
|
999
1008
|
}, "byPart");
|
|
1000
1009
|
|
|
1001
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
|
|
1002
1011
|
var REKEY_PACING = { lockMs: 50, pauseMs: 25 };
|
|
1003
1012
|
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" }) => {
|
|
1004
1013
|
let warned = false;
|
|
@@ -1574,7 +1583,7 @@ var keep = /* @__PURE__ */ __name(async (store, account, event, seenAt, among, c
|
|
|
1574
1583
|
}
|
|
1575
1584
|
}, "keep");
|
|
1576
1585
|
|
|
1577
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1586
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
|
|
1578
1587
|
var lazyStore = /* @__PURE__ */ __name((env, command, version) => {
|
|
1579
1588
|
let opened;
|
|
1580
1589
|
return {
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
tool,
|
|
21
21
|
toolKey,
|
|
22
22
|
toolsFromCommands
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-6GFUL4OU.js";
|
|
24
24
|
import {
|
|
25
25
|
CHART_KINDS,
|
|
26
26
|
CHART_SIZE,
|
|
@@ -34,23 +34,23 @@ import {
|
|
|
34
34
|
registerPrompts,
|
|
35
35
|
stdinFieldOf,
|
|
36
36
|
syncsFirst
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-2XLKZL6K.js";
|
|
38
38
|
import {
|
|
39
39
|
agentJson,
|
|
40
40
|
skillResource
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-3RJYLN5V.js";
|
|
42
42
|
import {
|
|
43
43
|
instructions
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-GFHNQBD2.js";
|
|
45
45
|
import {
|
|
46
46
|
answeredWire
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-PTIB7NEE.js";
|
|
48
48
|
import {
|
|
49
49
|
StdioServerTransport,
|
|
50
50
|
callerOf,
|
|
51
51
|
callingAgent,
|
|
52
52
|
serveStdio
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-EA2PGDER.js";
|
|
54
54
|
import {
|
|
55
55
|
McpServer,
|
|
56
56
|
ResourceTemplate
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
import {
|
|
59
59
|
connectedFor,
|
|
60
60
|
guardFor
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-V2T7NYNU.js";
|
|
62
62
|
import {
|
|
63
63
|
capability,
|
|
64
64
|
dateWindow,
|
|
@@ -67,10 +67,10 @@ import {
|
|
|
67
67
|
servicesFor,
|
|
68
68
|
storedDeps,
|
|
69
69
|
wholeList
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-UGPZCNYC.js";
|
|
71
71
|
import {
|
|
72
72
|
findCommand
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-UYK5AXSW.js";
|
|
74
74
|
import {
|
|
75
75
|
DEFAULT_OUTPUT_BYTES,
|
|
76
76
|
changesAuthorityAt,
|
|
@@ -86,27 +86,27 @@ import {
|
|
|
86
86
|
sealed,
|
|
87
87
|
snakeKeys,
|
|
88
88
|
typedCommand
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-X3CD475M.js";
|
|
90
90
|
import {
|
|
91
91
|
isCliFailure,
|
|
92
92
|
withCaller
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-ZPILMEFY.js";
|
|
94
94
|
import {
|
|
95
95
|
readOnlyLockOf
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-Q7O4CQDO.js";
|
|
97
97
|
import {
|
|
98
98
|
mcpHttpMarker
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-FAHHERJ7.js";
|
|
100
100
|
import {
|
|
101
101
|
openStore,
|
|
102
102
|
pdfPreviewLimits
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-Z4QKLHJW.js";
|
|
104
104
|
import {
|
|
105
105
|
timezoneOf
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-C6TUVV7E.js";
|
|
107
107
|
import {
|
|
108
108
|
warmEmbedders
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-KVTLT4V7.js";
|
|
110
110
|
import {
|
|
111
111
|
description,
|
|
112
112
|
integer,
|
|
@@ -122,19 +122,19 @@ import {
|
|
|
122
122
|
regex,
|
|
123
123
|
strictObject,
|
|
124
124
|
string
|
|
125
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-EPCFXKTX.js";
|
|
126
126
|
import {
|
|
127
127
|
CliError,
|
|
128
128
|
visibleControls
|
|
129
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-BXTDAGM4.js";
|
|
130
130
|
import {
|
|
131
131
|
__name
|
|
132
132
|
} from "./chunk-ZVVMGPBJ.js";
|
|
133
133
|
|
|
134
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
134
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/server.js
|
|
135
135
|
import { randomUUID } from "node:crypto";
|
|
136
136
|
|
|
137
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
137
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/agent-log.js
|
|
138
138
|
var agentLog = /* @__PURE__ */ __name((open) => {
|
|
139
139
|
let held;
|
|
140
140
|
return {
|
|
@@ -153,7 +153,7 @@ var agentLog = /* @__PURE__ */ __name((open) => {
|
|
|
153
153
|
};
|
|
154
154
|
}, "agentLog");
|
|
155
155
|
|
|
156
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
156
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/resources.js
|
|
157
157
|
var LISTED = 100;
|
|
158
158
|
var registerResources = /* @__PURE__ */ __name((server, session, { command, name, limit, recorded, withStore, messenger, guard, assertRead }) => {
|
|
159
159
|
server.registerResource("chat", new ResourceTemplate(`${command}://chat/{id}`, {
|
|
@@ -191,7 +191,7 @@ var registerResources = /* @__PURE__ */ __name((server, session, { command, name
|
|
|
191
191
|
});
|
|
192
192
|
}, "registerResources");
|
|
193
193
|
|
|
194
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
194
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/session.js
|
|
195
195
|
var HARMLESS = /* @__PURE__ */ new Set(["validation_error", "not_found", "permission_error", "confirmation_required", "rate_limited"]);
|
|
196
196
|
var harmless = /* @__PURE__ */ __name((code) => HARMLESS.has(code), "harmless");
|
|
197
197
|
var MessengerSession = class {
|
|
@@ -266,7 +266,7 @@ var MessengerSession = class {
|
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
|
|
269
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
269
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/tools/attachments.js
|
|
270
270
|
var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
|
|
271
271
|
const _command = messenger.app.command;
|
|
272
272
|
return {
|
|
@@ -320,7 +320,7 @@ var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
|
|
|
320
320
|
};
|
|
321
321
|
}, "attachmentsTools");
|
|
322
322
|
|
|
323
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
323
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/tools/messages-photo.js
|
|
324
324
|
var PHOTO_LIMIT = 512 * 1024;
|
|
325
325
|
var IMAGE_TYPES = [
|
|
326
326
|
["image/jpeg", (b) => b[0] === 255 && b[1] === 216 && b[2] === 255],
|
|
@@ -374,7 +374,7 @@ var readUpTo = /* @__PURE__ */ __name(async (file, limit, saveIt) => {
|
|
|
374
374
|
return new Uint8Array(Buffer.concat(chunks));
|
|
375
375
|
}, "readUpTo");
|
|
376
376
|
|
|
377
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
377
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/tools/stats.js
|
|
378
378
|
var statsTools = /* @__PURE__ */ __name((messenger) => ({
|
|
379
379
|
stats_charts: tool({
|
|
380
380
|
title: "A chart from a chat's statistics",
|
|
@@ -411,14 +411,14 @@ var statsTools = /* @__PURE__ */ __name((messenger) => ({
|
|
|
411
411
|
})
|
|
412
412
|
}), "statsTools");
|
|
413
413
|
|
|
414
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
414
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/tools.js
|
|
415
415
|
var pictureTools = /* @__PURE__ */ __name((messenger) => Object.fromEntries(Object.entries({
|
|
416
416
|
...messagesPhotoTools(messenger),
|
|
417
417
|
...attachmentsTools(messenger),
|
|
418
418
|
...statsTools(messenger)
|
|
419
419
|
}).map(([name, definition]) => [name, { ...definition, input: strictObject(definition.input.entries) }])), "pictureTools");
|
|
420
420
|
|
|
421
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
421
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/server.js
|
|
422
422
|
var PER_RUN = /* @__PURE__ */ new Set([
|
|
423
423
|
"streams",
|
|
424
424
|
"stdin",
|
|
@@ -742,7 +742,7 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
|
|
|
742
742
|
}, "serveOverStdio");
|
|
743
743
|
var serveOverHttpUntilStopped = /* @__PURE__ */ __name(async (command, context, messenger, options, http) => {
|
|
744
744
|
const { session, embedders, build, log } = createServer(command, context, messenger, options);
|
|
745
|
-
const { serveOverHttp } = await import("./serve-
|
|
745
|
+
const { serveOverHttp } = await import("./serve-YCPSEWP3.js");
|
|
746
746
|
const appName = messenger.app.command;
|
|
747
747
|
const appEnvPrefix = messenger.app.envPrefix;
|
|
748
748
|
const listening = await serveOverHttp(build, {
|