@wirecat/tg-cli 0.130.0 → 0.132.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-2XFPXBTA.js → adapter-OXVMOWVE.js} +60 -60
- package/dist/bundle/{all-profiles-GXFPZLYU.js → all-profiles-6OQC7PBL.js} +9 -9
- package/dist/bundle/{anthropic-FHS5XNK5.js → anthropic-YFMIHFW5.js} +5 -5
- package/dist/bundle/{app-server-IZMFSFP2.js → app-server-S7CJPJXN.js} +52 -52
- package/dist/bundle/{bot-api-V3ZJ75KE.js → bot-api-KJ6EZ4R6.js} +61 -61
- package/dist/bundle/{bot-history-EJQOD4AQ.js → bot-history-JYCXDFW4.js} +22 -22
- package/dist/bundle/{bun-GBAZFRCV.js → bun-FVTOBYZ2.js} +2 -2
- package/dist/bundle/{bun-sqlite-JB4BX6X7.js → bun-sqlite-KDGWBNOR.js} +6 -6
- package/dist/bundle/{chunk-KY3JLXW2.js → chunk-2LZD2VFV.js} +4 -4
- package/dist/bundle/{chunk-JUFLELQ7.js → chunk-2UGSIHLV.js} +2 -2
- package/dist/bundle/{chunk-TGRB4SSZ.js → chunk-3QHKZLBU.js} +4 -4
- package/dist/bundle/{chunk-6M3FAHPS.js → chunk-42MXCMW6.js} +3 -3
- package/dist/bundle/{chunk-HT6OFANN.js → chunk-44A2XRDE.js} +20 -20
- package/dist/bundle/{chunk-QJLCEOAP.js → chunk-4CKYANQH.js} +1 -1
- package/dist/bundle/{chunk-AUNNJDVD.js → chunk-4EDJJQJI.js} +28 -8
- package/dist/bundle/{chunk-2JZJPVBH.js → chunk-4YB7JU2W.js} +6 -6
- package/dist/bundle/{chunk-CLG2ISQH.js → chunk-4ZTVJHWU.js} +4 -4
- package/dist/bundle/{chunk-F6MLJ3V5.js → chunk-5RDNBG7D.js} +2 -2
- package/dist/bundle/{chunk-6JBRQ6PM.js → chunk-5UPEEMEF.js} +61 -19
- package/dist/bundle/{chunk-SYZXOEHY.js → chunk-6LPUK62N.js} +3 -3
- package/dist/bundle/{chunk-NRCY3WBC.js → chunk-74UPKW7H.js} +2 -2
- package/dist/bundle/{chunk-QDEP2QOA.js → chunk-7SEVVE3X.js} +3 -3
- package/dist/bundle/{chunk-PS7ZS5HD.js → chunk-A5D3J7XZ.js} +4 -4
- package/dist/bundle/{chunk-3XMUP55N.js → chunk-AERP2QR6.js} +10 -10
- package/dist/bundle/{chunk-RZPMFVWM.js → chunk-AUZWIBHJ.js} +6 -6
- package/dist/bundle/{chunk-OWVQMK7G.js → chunk-B4LGDOG5.js} +528 -389
- package/dist/bundle/{chunk-B6NQJAUC.js → chunk-BLZEQVP4.js} +2 -2
- package/dist/bundle/{chunk-GGGBPWUS.js → chunk-BMI2NWFI.js} +8 -8
- package/dist/bundle/{chunk-EB2JE722.js → chunk-BSXS7VAC.js} +1 -1
- package/dist/bundle/{chunk-FIO5NMK3.js → chunk-CFWFESBO.js} +8 -8
- package/dist/bundle/{chunk-QFVIHBLD.js → chunk-DSJNZXTP.js} +1 -1
- package/dist/bundle/{chunk-F6CV4KUN.js → chunk-DXPGMUOR.js} +2 -2
- package/dist/bundle/{chunk-IV6SIKVH.js → chunk-EPR67IRV.js} +4 -4
- package/dist/bundle/{chunk-BMSS3PCY.js → chunk-ESOFH7PA.js} +37 -30
- package/dist/bundle/{chunk-XXW6PFAX.js → chunk-FIUH52FE.js} +1 -1
- package/dist/bundle/{chunk-4BJAQNJ5.js → chunk-FKGYXIN7.js} +7 -7
- package/dist/bundle/{chunk-VSPSHBAC.js → chunk-FPSRT2TX.js} +2 -2
- package/dist/bundle/{chunk-OKTRB4ZQ.js → chunk-HBSKP7OV.js} +1 -1
- package/dist/bundle/{chunk-RAFK5KXU.js → chunk-IY7CTAOQ.js} +9 -9
- package/dist/bundle/{chunk-66UG67CE.js → chunk-IYJ4B632.js} +14 -13
- package/dist/bundle/{chunk-FH4YIBBH.js → chunk-JDNDWZYS.js} +4 -4
- package/dist/bundle/{chunk-C4ALE7CH.js → chunk-JMJOWT4N.js} +1 -1
- package/dist/bundle/{chunk-ZRQQOGAZ.js → chunk-JNWKV3QV.js} +4 -4
- package/dist/bundle/{chunk-2LPODKIF.js → chunk-JPSRC732.js} +17 -115
- package/dist/bundle/{chunk-SZB5WRMI.js → chunk-JZJV3DYK.js} +2 -2
- package/dist/bundle/{chunk-S5UTBEV3.js → chunk-KJICORS4.js} +38 -37
- package/dist/bundle/{chunk-RPWYTOLI.js → chunk-LF6FACSW.js} +5 -5
- package/dist/bundle/{chunk-QJDHRBXL.js → chunk-LG3K5NHX.js} +7 -7
- package/dist/bundle/{chunk-6WGAWISN.js → chunk-LMGVPDXN.js} +2 -2
- package/dist/bundle/{chunk-EUL7HMUL.js → chunk-LZ3HFDYL.js} +2 -2
- package/dist/bundle/{chunk-B5RGPZDZ.js → chunk-M2TV6BDB.js} +7 -7
- package/dist/bundle/{chunk-3KZG63EH.js → chunk-N5LZ6L4D.js} +3 -3
- package/dist/bundle/{chunk-O2ULG7OO.js → chunk-NLRGMP7M.js} +3 -3
- package/dist/bundle/{chunk-GYCKRIRK.js → chunk-NWCFO37P.js} +3 -3
- package/dist/bundle/{chunk-QBNEWEJC.js → chunk-NWDADTPE.js} +3 -3
- package/dist/bundle/{chunk-42LRWOTT.js → chunk-O3AM32YN.js} +15 -15
- package/dist/bundle/{chunk-7F3LOHRB.js → chunk-O43PARFS.js} +170 -162
- package/dist/bundle/{chunk-IRWSZJYL.js → chunk-OGZZUDJJ.js} +54 -54
- package/dist/bundle/{chunk-M327UNS6.js → chunk-OIRNHSAH.js} +6 -6
- package/dist/bundle/{chunk-XHX5D5VE.js → chunk-PG37E63A.js} +174 -72
- package/dist/bundle/{chunk-PWQKGFS2.js → chunk-PR4F3TYK.js} +30 -30
- package/dist/bundle/{chunk-I5PILOTU.js → chunk-PYECFCPD.js} +1 -1
- package/dist/bundle/{chunk-MVFSWKTM.js → chunk-QNEAPLOP.js} +12 -12
- package/dist/bundle/{chunk-VTJ3AOTT.js → chunk-QS46C5SW.js} +17 -17
- package/dist/bundle/{chunk-X5H5NERR.js → chunk-SMQ45RZX.js} +6 -6
- package/dist/bundle/{chunk-IBSHQWIJ.js → chunk-U7PHJSTX.js} +2 -2
- package/dist/bundle/{chunk-CKJ73EF3.js → chunk-UAFSDTID.js} +1 -1
- package/dist/bundle/{chunk-HHUK3XO5.js → chunk-UGD4SCUI.js} +1 -1
- package/dist/bundle/{chunk-MS6YEIG5.js → chunk-WAVRUADL.js} +13 -13
- package/dist/bundle/{chunk-VXWDQDRU.js → chunk-Y57EKZZK.js} +795 -467
- package/dist/bundle/{chunk-LQPZDDDP.js → chunk-YAPO7QNO.js} +6 -6
- package/dist/bundle/{chunk-G2SMVYBU.js → chunk-YRXSNH3R.js} +2 -2
- package/dist/bundle/{chunk-OJMDKWWL.js → chunk-YSNQGOUI.js} +2268 -1354
- package/dist/bundle/{chunk-GA3URWIF.js → chunk-YVI5SQPY.js} +1 -1
- package/dist/bundle/{chunk-GSHTLLCJ.js → chunk-ZJIGVT6Z.js} +2 -2
- package/dist/bundle/{chunk-LPT5T6PU.js → chunk-ZRW3DF25.js} +24 -24
- package/dist/bundle/{chunk-66PL7P4C.js → chunk-ZZ32DXTH.js} +1 -1
- package/dist/bundle/command-contract-FRH7LBGE.js +37 -0
- package/dist/bundle/{command-server-entry-YR6ONDWO.js → command-server-entry-TM264M2J.js} +27 -27
- package/dist/bundle/{decode-VUKGWFSW.js → decode-RJFOSHCE.js} +5 -5
- package/dist/bundle/{dispatch-ST5FK2KI.js → dispatch-7OZP3X4O.js} +8 -8
- package/dist/bundle/{echarts-GOV5M733.js → echarts-PYKF4D7B.js} +2 -2
- package/dist/bundle/{embed-2IVIYNAJ.js → embed-JFN6Z5TG.js} +6 -6
- package/dist/bundle/{embedder-2HU7JYZK.js → embedder-WN54JIMY.js} +9 -9
- package/dist/bundle/{entry-CSTCXYI5.js → entry-Z6LO6N6S.js} +9 -9
- package/dist/bundle/{failure-GMUQKQ5K.js → failure-UONA2IA5.js} +2 -2
- package/dist/bundle/{first-run-3IZGXZT5.js → first-run-WQAKES7G.js} +12 -12
- package/dist/bundle/first-screen-4RFG22SA.js +35 -0
- package/dist/bundle/{instructions-YSXV6FAC.js → instructions-PR4BBBTM.js} +1 -1
- package/dist/bundle/{mcp-VFIOZDVY.js → mcp-O6ACR2DX.js} +2 -2
- package/dist/bundle/meeting-combined-MHWTZOF2.js +23 -0
- package/dist/bundle/{meeting-model-FQBDHGRU.js → meeting-model-YVTUOM4H.js} +11 -11
- package/dist/bundle/{meeting-semantic-ONNEOJX5.js → meeting-semantic-X4KG6RNV.js} +6 -6
- package/dist/bundle/{node-FMQWCZRS.js → node-OVS5LTVZ.js} +2 -2
- package/dist/bundle/{node-sqlite-YN5OKOC6.js → node-sqlite-LC44SM4Z.js} +7 -7
- package/dist/bundle/{oauth-EW7PTZVT.js → oauth-NSVUFQCW.js} +7 -7
- package/dist/bundle/{open-Q2RDY344.js → open-XN5SJFVY.js} +5 -5
- package/dist/bundle/{openai-STON6G3O.js → openai-WOYZHJNL.js} +15 -15
- package/dist/bundle/{process-OQUC2TW3.js → process-UFBRGTQC.js} +1 -1
- package/dist/bundle/{program-N5BT75OC.js → program-RAGBRRQH.js} +65 -65
- package/dist/bundle/{prompt-WHVF7UTW.js → prompt-6HAKBUQN.js} +5 -5
- package/dist/bundle/{proxy-transport-A4MRO3PF.js → proxy-transport-5EJVFUTC.js} +5 -5
- package/dist/bundle/{recognize-YDQWMXNI.js → recognize-CN5COBVJ.js} +4 -4
- package/dist/bundle/{remote-477LQHP6.js → remote-STX5AMGE.js} +9 -9
- package/dist/bundle/{rerank-4YPB26FG.js → rerank-ZCOWTXIJ.js} +7 -7
- package/dist/bundle/{serve-FXJNUOTS.js → serve-XMQEOIG2.js} +9 -9
- package/dist/bundle/{server-2S6HFBGR.js → server-PGGUD3DM.js} +44 -44
- package/dist/bundle/server-WTNYWCZ4.js +69 -0
- package/dist/bundle/{sqlite-runtime-RXYNJYMC.js → sqlite-runtime-PS4DSOIU.js} +6 -6
- package/dist/bundle/{state-I2GGYGRL.js → state-GL4ZC57O.js} +6 -6
- package/dist/bundle/{store-KX3AAQZH.js → store-HJ76TLWD.js} +19 -19
- package/dist/bundle/{store-VQXIB6KV.js → store-VISFXSHL.js} +17 -17
- package/dist/bundle/store-maintenance-command-SMARMN5C.js +60 -0
- package/dist/bundle/tg.js +13 -13
- package/dist/program.js +1 -1
- package/dist/program.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/tg-cli/SKILL.md +11 -9
- package/dist/bundle/command-contract-G752BLKA.js +0 -37
- package/dist/bundle/first-screen-7QSNCZIK.js +0 -35
- package/dist/bundle/meeting-combined-X4E3LSIJ.js +0 -23
- package/dist/bundle/server-UOSUTZNE.js +0 -69
- package/dist/bundle/store-maintenance-command-LW2MMDLY.js +0 -60
- /package/dist/bundle/{chunk-ZI3YTXSF.js → chunk-VKE77B3F.js} +0 -0
|
@@ -2,31 +2,31 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
updateCommand
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-A5D3J7XZ.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_STEMMERS,
|
|
8
8
|
LANGUAGES
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BMI2NWFI.js";
|
|
10
10
|
import {
|
|
11
11
|
installerOf
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZZ32DXTH.js";
|
|
13
13
|
import {
|
|
14
14
|
QUESTIONS,
|
|
15
15
|
readSetupAnswers,
|
|
16
16
|
unanswered,
|
|
17
17
|
writeSetupAnswers
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-7SEVVE3X.js";
|
|
19
19
|
import {
|
|
20
20
|
sharedConfigPath
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-M2TV6BDB.js";
|
|
22
22
|
import {
|
|
23
23
|
storePath
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-FPSRT2TX.js";
|
|
25
25
|
import {
|
|
26
26
|
__name
|
|
27
27
|
} from "./chunk-ZVVMGPBJ.js";
|
|
28
28
|
|
|
29
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/cli/first-run.js
|
|
30
30
|
import { spawnSync } from "node:child_process";
|
|
31
31
|
import { accessSync, constants, realpathSync } from "node:fs";
|
|
32
32
|
import { delimiter, join } from "node:path";
|
|
@@ -84,7 +84,7 @@ var suggested = /* @__PURE__ */ __name((env, contentLanguages) => {
|
|
|
84
84
|
return (own.length ? own : LANGUAGES.filter(({ code }) => code === "en" || code === system)).map(({ name }) => name);
|
|
85
85
|
}, "suggested");
|
|
86
86
|
var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLanguages }) => {
|
|
87
|
-
const { openStore } = await import("./store-
|
|
87
|
+
const { openStore } = await import("./store-VISFXSHL.js");
|
|
88
88
|
const store = await openStore({ env });
|
|
89
89
|
let rebuild = false;
|
|
90
90
|
try {
|
|
@@ -113,8 +113,8 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
|
|
|
113
113
|
if (!rebuild)
|
|
114
114
|
return;
|
|
115
115
|
const [{ openCache }, { buildStems }] = await Promise.all([
|
|
116
|
-
import("./open-
|
|
117
|
-
import("./store-maintenance-command-
|
|
116
|
+
import("./open-XN5SJFVY.js"),
|
|
117
|
+
import("./store-maintenance-command-SMARMN5C.js")
|
|
118
118
|
]);
|
|
119
119
|
const database = await openCache(storePath(env));
|
|
120
120
|
try {
|
|
@@ -126,7 +126,7 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
|
|
|
126
126
|
var askTools = /* @__PURE__ */ __name(async (run) => {
|
|
127
127
|
const { command, env, io } = run;
|
|
128
128
|
const installed = run.installed ?? ((name) => onPath(name, env));
|
|
129
|
-
const { WIRECAT_TOOLS } = await import("./first-screen-
|
|
129
|
+
const { WIRECAT_TOOLS } = await import("./first-screen-4RFG22SA.js");
|
|
130
130
|
const others = WIRECAT_TOOLS.filter((tool) => tool.command !== command);
|
|
131
131
|
const missing = others.filter((tool) => !installed(tool.command));
|
|
132
132
|
io.say("Other WireCat tools \u2014 they share this store, so one search finds everything:");
|
|
@@ -197,9 +197,10 @@ var setupAtStart = /* @__PURE__ */ __name(async (start) => {
|
|
|
197
197
|
command: start.command,
|
|
198
198
|
env: start.env,
|
|
199
199
|
contentLanguages: start.contentLanguages,
|
|
200
|
-
|
|
200
|
+
// `setup describe` and `setup apply` are a program's; only the bare walk-through asks everything again.
|
|
201
|
+
all: start.path.length === 1 && start.path[0] === "setup",
|
|
201
202
|
io: {
|
|
202
|
-
ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-
|
|
203
|
+
ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-6HAKBUQN.js")).readSecret(prompt, { input, echo: true }), "ask"),
|
|
203
204
|
say: /* @__PURE__ */ __name((text) => process.stderr.write(`${text}
|
|
204
205
|
`), "say")
|
|
205
206
|
}
|
|
@@ -9,15 +9,15 @@ import {
|
|
|
9
9
|
optional,
|
|
10
10
|
pipe,
|
|
11
11
|
safeParse
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4EDJJQJI.js";
|
|
13
13
|
import {
|
|
14
14
|
CliError
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5RDNBG7D.js";
|
|
16
16
|
import {
|
|
17
17
|
__name
|
|
18
18
|
} from "./chunk-ZVVMGPBJ.js";
|
|
19
19
|
|
|
20
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/models/options.js
|
|
21
21
|
var checkedOptions = /* @__PURE__ */ __name((provider, schema, options) => {
|
|
22
22
|
const parsed = safeParse(schema, options);
|
|
23
23
|
if (!parsed.success) {
|
|
@@ -27,7 +27,7 @@ var checkedOptions = /* @__PURE__ */ __name((provider, schema, options) => {
|
|
|
27
27
|
}, "checkedOptions");
|
|
28
28
|
var range = /* @__PURE__ */ __name((min, max) => optional(pipe(number(), finite(), minValue(min), maxValue(max))), "range");
|
|
29
29
|
|
|
30
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/models/types.js
|
|
31
31
|
var MAX_MODEL_IMAGE_BYTES = 4 * 1024 * 1024;
|
|
32
32
|
var validateImages = /* @__PURE__ */ __name((images) => {
|
|
33
33
|
if (images === void 0)
|
|
@@ -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.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/driver.js
|
|
8
8
|
var TIME_LIMIT_FUNCTION = "wc_time_limit";
|
|
9
9
|
var TimeLimitReached = class extends Error {
|
|
10
10
|
static {
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
} from "./chunk-Y5E2WNWB.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5RDNBG7D.js";
|
|
9
9
|
import {
|
|
10
10
|
__name
|
|
11
11
|
} from "./chunk-ZVVMGPBJ.js";
|
|
12
12
|
|
|
13
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/speech/recognize.js
|
|
14
14
|
import { createRequire } from "node:module";
|
|
15
15
|
|
|
16
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/speech/ogg-limit.js
|
|
17
17
|
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "local transcription needs a complete mono or stereo Ogg Opus recording"), "invalid");
|
|
18
18
|
var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
|
|
19
19
|
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
@@ -70,7 +70,7 @@ var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
|
|
|
70
70
|
throw invalid();
|
|
71
71
|
}, "checkOggDuration");
|
|
72
72
|
|
|
73
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
73
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/speech/recognize.js
|
|
74
74
|
var SAMPLE_RATE = 16e3;
|
|
75
75
|
var LEAD = SAMPLE_RATE / 2;
|
|
76
76
|
var toModelRate = /* @__PURE__ */ __name((samples, rate) => {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
+
DEFAULT_PACE,
|
|
4
5
|
FloodMemory,
|
|
5
6
|
OFFLINE,
|
|
7
|
+
Pacer,
|
|
6
8
|
RecipientList,
|
|
7
9
|
capability,
|
|
8
10
|
ceilingRefusal,
|
|
@@ -10,16 +12,17 @@ import {
|
|
|
10
12
|
floodPathFor,
|
|
11
13
|
guardFor,
|
|
12
14
|
holdEnd,
|
|
15
|
+
pacePathFor,
|
|
13
16
|
profilesOnAccount,
|
|
14
17
|
recipientsPathFor,
|
|
15
18
|
refuseLacking,
|
|
16
19
|
servicesFor,
|
|
17
20
|
throughWrapper,
|
|
18
|
-
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
waitForTurn
|
|
22
|
+
} from "./chunk-B4LGDOG5.js";
|
|
20
23
|
import {
|
|
21
24
|
servingProfiles
|
|
22
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-NLRGMP7M.js";
|
|
23
26
|
import {
|
|
24
27
|
chatReferenceOf,
|
|
25
28
|
ensureAccount,
|
|
@@ -27,7 +30,7 @@ import {
|
|
|
27
30
|
isId,
|
|
28
31
|
openStore,
|
|
29
32
|
pickPerson
|
|
30
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-Y57EKZZK.js";
|
|
31
34
|
import {
|
|
32
35
|
CEILING_KEY,
|
|
33
36
|
WRITE_KEYS,
|
|
@@ -48,24 +51,21 @@ import {
|
|
|
48
51
|
rememberAccount,
|
|
49
52
|
rootOf2 as rootOf,
|
|
50
53
|
skipFlagFor
|
|
51
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-O43PARFS.js";
|
|
52
55
|
import {
|
|
53
56
|
providerErrorKey
|
|
54
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-LG3K5NHX.js";
|
|
55
58
|
import {
|
|
56
59
|
isCliFailure
|
|
57
|
-
} from "./chunk-
|
|
58
|
-
import {
|
|
59
|
-
resolvePaths
|
|
60
|
-
} from "./chunk-HT6OFANN.js";
|
|
60
|
+
} from "./chunk-NWDADTPE.js";
|
|
61
61
|
import {
|
|
62
62
|
CliError
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-5RDNBG7D.js";
|
|
64
64
|
import {
|
|
65
65
|
__name
|
|
66
66
|
} from "./chunk-ZVVMGPBJ.js";
|
|
67
67
|
|
|
68
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
68
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
|
|
69
69
|
import { openSync } from "node:fs";
|
|
70
70
|
import { createInterface } from "node:readline";
|
|
71
71
|
import { ReadStream } from "node:tty";
|
|
@@ -120,102 +120,7 @@ var terminalAsker = /* @__PURE__ */ __name((command) => async (key, request) =>
|
|
|
120
120
|
throw new CliError("cancelled", `${key}: not done \u2014 the answer was no`);
|
|
121
121
|
}, "terminalAsker");
|
|
122
122
|
|
|
123
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
124
|
-
import { readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
125
|
-
import { join } from "node:path";
|
|
126
|
-
var DEFAULT_PACE = { perMinute: 60, burst: 20 };
|
|
127
|
-
var pacePathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "pace", `${profile}.json`), "pacePathFor");
|
|
128
|
-
var Pacer = class {
|
|
129
|
-
static {
|
|
130
|
-
__name(this, "Pacer");
|
|
131
|
-
}
|
|
132
|
-
path;
|
|
133
|
-
rate;
|
|
134
|
-
now;
|
|
135
|
-
constructor(path, rate, now = Date.now) {
|
|
136
|
-
this.path = path;
|
|
137
|
-
this.rate = rate;
|
|
138
|
-
this.now = now;
|
|
139
|
-
}
|
|
140
|
-
get interval() {
|
|
141
|
-
return this.rate.perMinute > 0 ? 6e4 / this.rate.perMinute : 0;
|
|
142
|
-
}
|
|
143
|
-
/** When this call may go; reserved at once, so the next caller in any process lines up behind it. */
|
|
144
|
-
async reserve() {
|
|
145
|
-
if (this.interval === 0)
|
|
146
|
-
return this.now();
|
|
147
|
-
return withFileLockAsync(this.path, "the request pace", () => {
|
|
148
|
-
const now = this.now();
|
|
149
|
-
const tat = Math.max(this.read(now), now);
|
|
150
|
-
this.write(tat + this.interval, now);
|
|
151
|
-
return Math.max(now, tat - this.rate.burst * this.interval);
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
/** The messenger asked every caller to wait: nothing goes before `now + waitMs`, in any process. */
|
|
155
|
-
async holdFor(waitMs) {
|
|
156
|
-
if (this.interval === 0)
|
|
157
|
-
return;
|
|
158
|
-
await withFileLockAsync(this.path, "the request pace", () => {
|
|
159
|
-
const now = this.now();
|
|
160
|
-
const hold = now + waitMs + this.rate.burst * this.interval;
|
|
161
|
-
this.write(Math.max(this.read(now), hold), now);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
/** The owner's `flood clear`: every process may go again at once. */
|
|
165
|
-
async reset() {
|
|
166
|
-
await withFileLockAsync(this.path, "the request pace", () => this.write(0, this.now()));
|
|
167
|
-
}
|
|
168
|
-
read(now) {
|
|
169
|
-
try {
|
|
170
|
-
const file = JSON.parse(readFileSync(this.path, "utf8"));
|
|
171
|
-
const tat = Number(file.tat);
|
|
172
|
-
if (!Number.isFinite(tat))
|
|
173
|
-
return 0;
|
|
174
|
-
const at = Number(file.at);
|
|
175
|
-
return Number.isFinite(at) && at > now ? now + Math.max(0, tat - at) : tat;
|
|
176
|
-
} catch {
|
|
177
|
-
return 0;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
write(tat, at) {
|
|
181
|
-
const temporary = `${this.path}.${process.pid}.tmp`;
|
|
182
|
-
writeFileSync(temporary, JSON.stringify({ tat, at }), { mode: 384 });
|
|
183
|
-
renameSync(temporary, this.path);
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
var ANNOUNCE_WAIT_MS = 5e3;
|
|
187
|
-
var LONGEST_PACE_WAIT_MS = 5 * 6e4;
|
|
188
|
-
var waitForTurn = /* @__PURE__ */ __name(async (pacer, options) => {
|
|
189
|
-
const { name, operation, warn } = options;
|
|
190
|
-
const now = options.now ?? Date.now;
|
|
191
|
-
let at = now();
|
|
192
|
-
try {
|
|
193
|
-
at = await pacer.reserve();
|
|
194
|
-
} catch (error) {
|
|
195
|
-
warn?.(`could not remember ${name}'s wait (${error instanceof Error ? error.message : String(error)})`, {
|
|
196
|
-
event: "warning",
|
|
197
|
-
code: "wait_not_remembered",
|
|
198
|
-
operation
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
const waitMs = at - now();
|
|
202
|
-
if (waitMs <= 0)
|
|
203
|
-
return;
|
|
204
|
-
if (waitMs > (options.longestWaitMs ?? LONGEST_PACE_WAIT_MS))
|
|
205
|
-
throw new CliError("rate_limited", `this profile's next request to ${name} has to wait ${Math.ceil(waitMs / 1e3)} s more \u2014 nothing was sent to ${name}`, { retry_after_ms: waitMs, retry_at: new Date(at).toISOString(), remembered: true });
|
|
206
|
-
if (waitMs >= ANNOUNCE_WAIT_MS) {
|
|
207
|
-
const seconds = Math.ceil(waitMs / 1e3);
|
|
208
|
-
warn?.(`waiting ${seconds} s to keep this profile's pace with ${name}`, {
|
|
209
|
-
event: "warning",
|
|
210
|
-
code: "pace_wait",
|
|
211
|
-
operation,
|
|
212
|
-
counts: { seconds }
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
await (options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms))))(waitMs);
|
|
216
|
-
}, "waitForTurn");
|
|
217
|
-
|
|
218
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.665.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_1712fa6347d2f5f4f52e592cd2c1c3bf/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
|
|
123
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
|
|
219
124
|
var pathOf = /* @__PURE__ */ __name((command) => {
|
|
220
125
|
const words = [];
|
|
221
126
|
for (let at = command; at?.parent; at = at.parent)
|
|
@@ -275,7 +180,7 @@ var refuseUnknownPermissionKeys = /* @__PURE__ */ __name((command, settings, too
|
|
|
275
180
|
throw new CliError("validation_error", `--permission ${key} names no command`, { permission: key });
|
|
276
181
|
}, "refuseUnknownPermissionKeys");
|
|
277
182
|
|
|
278
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
|
|
279
184
|
var LONG_LIVED = /* @__PURE__ */ new Set(["self", "newSendId", "close", "formatMarkdown", "formatHtml", "storedChats"]);
|
|
280
185
|
var LISTENING = /* @__PURE__ */ new Set(["watch", "feed", "listen", "listenHistory"]);
|
|
281
186
|
var BLOCKING = /* @__PURE__ */ new Set(["frozen", "limited", "banned"]);
|
|
@@ -372,7 +277,7 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
|
|
|
372
277
|
});
|
|
373
278
|
}, "flooded");
|
|
374
279
|
|
|
375
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
280
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
|
|
376
281
|
var observed = /* @__PURE__ */ __name((messenger, events) => {
|
|
377
282
|
const timed = /* @__PURE__ */ __name(async (operation, named, work, after) => {
|
|
378
283
|
const write = currentOperation();
|
|
@@ -471,7 +376,7 @@ var byPart = /* @__PURE__ */ __name((batch, counts) => {
|
|
|
471
376
|
counts[part] = (counts[part] ?? 0) + items.length;
|
|
472
377
|
}, "byPart");
|
|
473
378
|
|
|
474
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
379
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
|
|
475
380
|
var REKEY_PACING = { lockMs: 50, pauseMs: 25 };
|
|
476
381
|
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" }) => {
|
|
477
382
|
let warned = false;
|
|
@@ -1047,7 +952,7 @@ var keep = /* @__PURE__ */ __name(async (store, account, event, seenAt, among, c
|
|
|
1047
952
|
}
|
|
1048
953
|
}, "keep");
|
|
1049
954
|
|
|
1050
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
955
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
|
|
1051
956
|
var lazyStore = /* @__PURE__ */ __name((env, command, version) => {
|
|
1052
957
|
let opened;
|
|
1053
958
|
return {
|
|
@@ -1450,9 +1355,6 @@ var messengerContext = /* @__PURE__ */ __name((command, messenger, resolving = {
|
|
|
1450
1355
|
export {
|
|
1451
1356
|
answerOf,
|
|
1452
1357
|
terminalAsker,
|
|
1453
|
-
DEFAULT_PACE,
|
|
1454
|
-
pacePathFor,
|
|
1455
|
-
Pacer,
|
|
1456
1358
|
knownPermissionKeys,
|
|
1457
1359
|
knownBeside,
|
|
1458
1360
|
unknownPermissionIssues,
|
|
@@ -2,11 +2,11 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
openCache
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OIRNHSAH.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError,
|
|
8
8
|
isCliError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5RDNBG7D.js";
|
|
10
10
|
import {
|
|
11
11
|
__name
|
|
12
12
|
} from "./chunk-ZVVMGPBJ.js";
|