@wirecat/tg-cli 0.121.0 → 0.122.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-GVSBFSBY.js → adapter-ZI57T2L5.js} +41 -41
- package/dist/bundle/{all-profiles-CTOGU4XR.js → all-profiles-7VXJF42C.js} +6 -6
- package/dist/bundle/{anthropic-7472H6ES.js → anthropic-DKRXIWVV.js} +2 -2
- package/dist/bundle/{app-server-GZWV4NPR.js → app-server-F5MKHZ7S.js} +37 -37
- package/dist/bundle/{bot-api-PPVAKICN.js → bot-api-F24NWJT3.js} +42 -42
- package/dist/bundle/{bot-history-7YY7MCR4.js → bot-history-U3WM3A7S.js} +12 -12
- package/dist/bundle/{bun-KCN62RMD.js → bun-OMTJAXGK.js} +2 -2
- package/dist/bundle/{bun-sqlite-2BNE56MY.js → bun-sqlite-HSYLO46A.js} +2 -2
- package/dist/bundle/{chunk-7MXRFFIT.js → chunk-27SVHRHV.js} +2 -2
- package/dist/bundle/{chunk-6SQAE7NM.js → chunk-2FXA32RJ.js} +6 -6
- package/dist/bundle/{chunk-KPAUPIC3.js → chunk-2UHANFLM.js} +2 -2
- package/dist/bundle/{chunk-24DWSW6H.js → chunk-33ELXJRR.js} +11 -10
- package/dist/bundle/{chunk-3EGVR7OF.js → chunk-4MFMUBHH.js} +95 -79
- package/dist/bundle/{chunk-SHIHW2YN.js → chunk-4N2WJYLE.js} +2 -2
- package/dist/bundle/{chunk-SQWTUENZ.js → chunk-6DLRATDC.js} +242 -239
- package/dist/bundle/{chunk-QQ264PXQ.js → chunk-6LMEIELG.js} +1 -1
- package/dist/bundle/{chunk-AYDLA27G.js → chunk-7FWU4RON.js} +3 -3
- package/dist/bundle/{chunk-KKD5ZPGD.js → chunk-7GCVON7M.js} +5 -5
- package/dist/bundle/{chunk-TEMCXODM.js → chunk-7X6YLKTK.js} +1 -1
- package/dist/bundle/{chunk-ESLV57MC.js → chunk-ALW7ROTM.js} +1 -1
- package/dist/bundle/{chunk-MAPJUOTD.js → chunk-ARKB3M5X.js} +3 -3
- package/dist/bundle/{chunk-GB55EDOF.js → chunk-C5CB6RIX.js} +1 -1
- package/dist/bundle/{chunk-S7P5X23R.js → chunk-CB6AHU6H.js} +27 -9
- package/dist/bundle/{chunk-YMJKHMHX.js → chunk-CW3C7FSO.js} +1 -1
- package/dist/bundle/{chunk-QNNUNGPL.js → chunk-D3ODL4P7.js} +2 -2
- package/dist/bundle/{chunk-T7ONSJAA.js → chunk-DCGGZUNJ.js} +2 -2
- package/dist/bundle/{chunk-3HNI6GI7.js → chunk-DDSAJKPO.js} +4 -4
- package/dist/bundle/{chunk-7UIMMQOV.js → chunk-DTTONQW7.js} +1 -1
- package/dist/bundle/{chunk-VPNLTNQD.js → chunk-E3MFMMVY.js} +5 -5
- package/dist/bundle/{chunk-W77WC6ZK.js → chunk-FHWUOFWX.js} +2 -2
- package/dist/bundle/{chunk-5P43K3GL.js → chunk-FYHFAOPM.js} +1505 -1014
- package/dist/bundle/{chunk-ZSW7LN7T.js → chunk-FZKHFTKH.js} +13 -13
- package/dist/bundle/{chunk-CPDYPZIG.js → chunk-GJBGZQHN.js} +177 -151
- package/dist/bundle/{chunk-3E35VJME.js → chunk-GJFICFQB.js} +1 -1
- package/dist/bundle/{chunk-YRY752BB.js → chunk-HAR76KJG.js} +4 -4
- package/dist/bundle/{chunk-CLMRF6XR.js → chunk-LQRZUNYF.js} +2 -2
- package/dist/bundle/{chunk-LTAHG7BO.js → chunk-MFWWZ6XL.js} +2 -2
- package/dist/bundle/{chunk-NR7PGYPO.js → chunk-N7WDVH2O.js} +28 -28
- package/dist/bundle/{chunk-KVW7LCZK.js → chunk-NE3EGYPD.js} +3 -3
- package/dist/bundle/{chunk-RPBO5XL3.js → chunk-NU4RMUMQ.js} +10 -10
- package/dist/bundle/{chunk-CMEWPXKU.js → chunk-O5A4IS2D.js} +1 -1
- package/dist/bundle/{chunk-M47CXY5J.js → chunk-PG3V225O.js} +21 -21
- package/dist/bundle/{chunk-DAK2J3FG.js → chunk-QROAXWDU.js} +7 -7
- package/dist/bundle/{chunk-4HJCWFPN.js → chunk-R2IW6JBV.js} +46 -46
- package/dist/bundle/{chunk-FERGNQYA.js → chunk-RFFU6KQ5.js} +12 -12
- package/dist/bundle/{chunk-M73VM67N.js → chunk-SODUFMDW.js} +727 -382
- package/dist/bundle/{chunk-4J34T6IQ.js → chunk-TKJZENAZ.js} +1 -1
- package/dist/bundle/{chunk-QMNUQTA2.js → chunk-UGEYQWEO.js} +1 -1
- package/dist/bundle/chunk-V4BPS7MH.js +185 -0
- package/dist/bundle/{chunk-6LRKWXCS.js → chunk-VC6J7X76.js} +10 -10
- package/dist/bundle/{chunk-MKAKM3V7.js → chunk-VDFEWSCS.js} +2 -2
- package/dist/bundle/{chunk-Y4CSR5RP.js → chunk-VQL4RVXZ.js} +1 -1
- package/dist/bundle/{chunk-R6KXHBMW.js → chunk-W34QQMBK.js} +1 -1
- package/dist/bundle/{chunk-54KFRAHF.js → chunk-Y52T5EMB.js} +1 -1
- package/dist/bundle/{chunk-VAAZL6OD.js → chunk-Y74WJL3M.js} +2 -2
- package/dist/bundle/{chunk-PLBEUSZP.js → chunk-YDMKP7PO.js} +1 -1
- package/dist/bundle/{chunk-RZX7RDXY.js → chunk-YFEH7OWG.js} +12 -12
- package/dist/bundle/{chunk-DG44ORQ3.js → chunk-ZKHXWSKD.js} +4 -4
- package/dist/bundle/{chunk-BJTJBNR7.js → chunk-ZNPRTCUO.js} +6 -6
- package/dist/bundle/{command-contract-3W73W27G.js → command-contract-247AKZTE.js} +12 -12
- package/dist/bundle/{command-server-entry-37PKBJ5A.js → command-server-entry-N32NX4QW.js} +67 -51
- package/dist/bundle/{decode-F7KC7WT4.js → decode-ZKJWSFXF.js} +2 -2
- package/dist/bundle/{echarts-4VYG66GX.js → echarts-QLVLIP73.js} +2 -2
- package/dist/bundle/{embed-ENZ6R4HF.js → embed-LC6K7P3S.js} +3 -3
- package/dist/bundle/{embedder-4CBICMFO.js → embedder-6C3OQBOV.js} +6 -6
- package/dist/bundle/{entry-XQ562EDO.js → entry-5H6LB3MP.js} +5 -5
- package/dist/bundle/{first-run-PPXOC6ID.js → first-run-IOYQ4XQK.js} +5 -5
- package/dist/bundle/{first-screen-JC6BYZYD.js → first-screen-NVK7PFX4.js} +13 -13
- package/dist/bundle/{instructions-XLCMJ5PJ.js → instructions-SZUMEDY3.js} +1 -1
- package/dist/bundle/{node-SSAC67R5.js → node-V76RRFIA.js} +2 -2
- package/dist/bundle/{node-sqlite-SUUUSYSZ.js → node-sqlite-2DTVOT7L.js} +3 -3
- package/dist/bundle/{oauth-2ZNHMPEX.js → oauth-CT7EBDRY.js} +4 -4
- package/dist/bundle/{open-EFNT7V2Q.js → open-G3VHOOMV.js} +2 -2
- package/dist/bundle/{openai-7STFVJXA.js → openai-F4K7MVTZ.js} +10 -10
- package/dist/bundle/{process-63F4PNWH.js → process-XH3KEHSF.js} +1 -1
- package/dist/bundle/{program-C2E3TQNK.js → program-FLGIHTHM.js} +44 -44
- package/dist/bundle/{prompt-QPO7EKD5.js → prompt-JWQ6UQ6R.js} +2 -2
- package/dist/bundle/{recognize-MLXEHFYL.js → recognize-Z26T3SYD.js} +1 -1
- package/dist/bundle/{remote-DO7FLJEF.js → remote-7KHT6V3O.js} +4 -4
- package/dist/bundle/{rerank-W3WSBDAM.js → rerank-6QVI74QY.js} +4 -4
- package/dist/bundle/{serve-Z3TOTEMQ.js → serve-WYDZTONY.js} +6 -6
- package/dist/bundle/server-UXQT7LZT.js +61 -0
- package/dist/bundle/{server-BYSOJCUA.js → server-Y4J2NCFA.js} +28 -28
- package/dist/bundle/{state-PKRPBCMY.js → state-YCXBKOD2.js} +3 -3
- package/dist/bundle/{store-Y4G7CNJT.js → store-QECSDJRP.js} +9 -9
- package/dist/bundle/store-maintenance-command-5YW6TRJA.js +49 -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-GNGYV5NX.js +0 -116
- package/dist/bundle/server-IRUVLXD4.js +0 -61
- package/dist/bundle/store-maintenance-command-PHK43OSM.js +0 -49
|
@@ -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.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/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.",
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
stdinFieldOf
|
|
5
|
+
} from "./chunk-YDMKP7PO.js";
|
|
6
|
+
import {
|
|
7
|
+
isCommandServer
|
|
8
|
+
} from "./chunk-NE3EGYPD.js";
|
|
9
|
+
import {
|
|
10
|
+
commandPathOf
|
|
11
|
+
} from "./chunk-MFWWZ6XL.js";
|
|
12
|
+
import {
|
|
13
|
+
commandServerRequest,
|
|
14
|
+
metaOf
|
|
15
|
+
} from "./chunk-GJBGZQHN.js";
|
|
16
|
+
import {
|
|
17
|
+
errorObjectOf,
|
|
18
|
+
renderError
|
|
19
|
+
} from "./chunk-WGGSFGNZ.js";
|
|
20
|
+
import {
|
|
21
|
+
CliError
|
|
22
|
+
} from "./chunk-VUBZFMGP.js";
|
|
23
|
+
import {
|
|
24
|
+
__name
|
|
25
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
26
|
+
|
|
27
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/cli/command-server.js
|
|
28
|
+
import { createInterface } from "node:readline";
|
|
29
|
+
var COMMAND_SERVER_PROTOCOL = 1;
|
|
30
|
+
var COMMAND_SERVER_IDLE_MS = 10 * 6e4;
|
|
31
|
+
var COMMAND_SERVER_CONCURRENT = 8;
|
|
32
|
+
var runsAlone = /* @__PURE__ */ __name((command) => commandPathOf(command)[0] === "store", "runsAlone");
|
|
33
|
+
var enterCommandServer = /* @__PURE__ */ __name(async (command, cli) => {
|
|
34
|
+
const request = commandServerRequest();
|
|
35
|
+
if (!request)
|
|
36
|
+
return;
|
|
37
|
+
refuseInCommandServer(command, cli);
|
|
38
|
+
if (runsAlone(command))
|
|
39
|
+
await request.alone();
|
|
40
|
+
}, "enterCommandServer");
|
|
41
|
+
var refuseInCommandServer = /* @__PURE__ */ __name((command, cli) => {
|
|
42
|
+
if (!commandServerRequest())
|
|
43
|
+
return;
|
|
44
|
+
const typed = [cli, ...commandPathOf(command)].join(" ");
|
|
45
|
+
const { lifetime } = metaOf(command);
|
|
46
|
+
if (lifetime)
|
|
47
|
+
throw new CliError("validation_error", `\`${typed}\` ${lifetime === "persistent" ? "runs until it is stopped" : "waits on a person"}; the command server runs only commands that return \u2014 start it as a process of its own`);
|
|
48
|
+
if (stdinFieldOf(command))
|
|
49
|
+
throw new CliError("validation_error", `\`${typed}\` reads its input on stdin, which the command server does not pass on \u2014 start it as a process of its own`);
|
|
50
|
+
}, "refuseInCommandServer");
|
|
51
|
+
var refusal = /* @__PURE__ */ __name((cli, message) => `${renderError(errorObjectOf(new CliError("validation_error", message)), { cli, interactive: false })}
|
|
52
|
+
`, "refusal");
|
|
53
|
+
var requestOf = /* @__PURE__ */ __name((line, cli) => {
|
|
54
|
+
let parsed;
|
|
55
|
+
try {
|
|
56
|
+
parsed = JSON.parse(line);
|
|
57
|
+
} catch {
|
|
58
|
+
return { id: null, error: "a request is one JSON object per line" };
|
|
59
|
+
}
|
|
60
|
+
const { id, argv } = parsed ?? {};
|
|
61
|
+
const known = typeof id === "number" && Number.isFinite(id) ? id : null;
|
|
62
|
+
if (known === null)
|
|
63
|
+
return { id: null, error: 'a request needs a numeric "id"' };
|
|
64
|
+
if (!Array.isArray(argv) || !argv.every((word) => typeof word === "string"))
|
|
65
|
+
return { id: known, error: '"argv" is a list of strings' };
|
|
66
|
+
if (isCommandServer(argv))
|
|
67
|
+
return { id: known, error: `\`${cli} commands --serve\` cannot run inside itself` };
|
|
68
|
+
return { id: known, argv };
|
|
69
|
+
}, "requestOf");
|
|
70
|
+
var serveCommands = /* @__PURE__ */ __name(async ({ input, write, run, cli, version, idleMs = COMMAND_SERVER_IDLE_MS, concurrent = COMMAND_SERVER_CONCURRENT, signal }) => {
|
|
71
|
+
const send = /* @__PURE__ */ __name((value) => write(`${JSON.stringify(value)}
|
|
72
|
+
`), "send");
|
|
73
|
+
await send({ ready: true, protocol: COMMAND_SERVER_PROTOCOL, version, concurrent });
|
|
74
|
+
const lines = createInterface({ input, crlfDelay: Number.POSITIVE_INFINITY });
|
|
75
|
+
return new Promise((resolve) => {
|
|
76
|
+
const waiting = [];
|
|
77
|
+
let active = 0;
|
|
78
|
+
let running = 0;
|
|
79
|
+
let gated = false;
|
|
80
|
+
let drained;
|
|
81
|
+
let turns = Promise.resolve();
|
|
82
|
+
let timer;
|
|
83
|
+
let ending = false;
|
|
84
|
+
let done = false;
|
|
85
|
+
const finish = /* @__PURE__ */ __name(() => {
|
|
86
|
+
if (done)
|
|
87
|
+
return;
|
|
88
|
+
done = true;
|
|
89
|
+
clearTimeout(timer);
|
|
90
|
+
lines.close();
|
|
91
|
+
resolve(0);
|
|
92
|
+
}, "finish");
|
|
93
|
+
const settle = /* @__PURE__ */ __name(() => {
|
|
94
|
+
if (running === 0 && drained) {
|
|
95
|
+
const go = drained;
|
|
96
|
+
drained = void 0;
|
|
97
|
+
go();
|
|
98
|
+
}
|
|
99
|
+
pump();
|
|
100
|
+
if (active > 0 || waiting.length > 0 || done)
|
|
101
|
+
return;
|
|
102
|
+
if (ending)
|
|
103
|
+
finish();
|
|
104
|
+
else {
|
|
105
|
+
clearTimeout(timer);
|
|
106
|
+
timer = setTimeout(finish, idleMs);
|
|
107
|
+
}
|
|
108
|
+
}, "settle");
|
|
109
|
+
const start = /* @__PURE__ */ __name((line) => {
|
|
110
|
+
active += 1;
|
|
111
|
+
running += 1;
|
|
112
|
+
let holdsPlace = true;
|
|
113
|
+
let ended = false;
|
|
114
|
+
let turn;
|
|
115
|
+
let release;
|
|
116
|
+
const alone = /* @__PURE__ */ __name(() => {
|
|
117
|
+
if (turn)
|
|
118
|
+
return turn;
|
|
119
|
+
holdsPlace = false;
|
|
120
|
+
running -= 1;
|
|
121
|
+
turn = turns.then(() => new Promise((go) => {
|
|
122
|
+
if (ended)
|
|
123
|
+
return go();
|
|
124
|
+
gated = true;
|
|
125
|
+
drained = /* @__PURE__ */ __name(() => {
|
|
126
|
+
if (ended)
|
|
127
|
+
gated = false;
|
|
128
|
+
else {
|
|
129
|
+
holdsPlace = true;
|
|
130
|
+
running += 1;
|
|
131
|
+
}
|
|
132
|
+
go();
|
|
133
|
+
}, "drained");
|
|
134
|
+
settle();
|
|
135
|
+
}));
|
|
136
|
+
turns = turn.then(() => ended && !holdsPlace ? void 0 : new Promise((free) => release = free));
|
|
137
|
+
return turn;
|
|
138
|
+
}, "alone");
|
|
139
|
+
const answer = /* @__PURE__ */ __name(async () => {
|
|
140
|
+
const request = requestOf(line, cli);
|
|
141
|
+
if ("error" in request)
|
|
142
|
+
return send({ id: request.id, code: 2, stdout: "", stderr: refusal(cli, request.error) });
|
|
143
|
+
const answered = await run(request.argv, alone);
|
|
144
|
+
return send({ id: request.id, ...answered });
|
|
145
|
+
}, "answer");
|
|
146
|
+
answer().catch(finish).finally(() => {
|
|
147
|
+
ended = true;
|
|
148
|
+
active -= 1;
|
|
149
|
+
if (holdsPlace)
|
|
150
|
+
running -= 1;
|
|
151
|
+
if (release) {
|
|
152
|
+
gated = false;
|
|
153
|
+
release();
|
|
154
|
+
}
|
|
155
|
+
settle();
|
|
156
|
+
});
|
|
157
|
+
}, "start");
|
|
158
|
+
const pump = /* @__PURE__ */ __name(() => {
|
|
159
|
+
while (!done && !gated && running < concurrent && waiting.length > 0)
|
|
160
|
+
start(waiting.shift());
|
|
161
|
+
}, "pump");
|
|
162
|
+
lines.on("line", (line) => {
|
|
163
|
+
if (done || ending || line.trim() === "")
|
|
164
|
+
return;
|
|
165
|
+
clearTimeout(timer);
|
|
166
|
+
waiting.push(line);
|
|
167
|
+
pump();
|
|
168
|
+
});
|
|
169
|
+
const end = /* @__PURE__ */ __name(() => {
|
|
170
|
+
ending = true;
|
|
171
|
+
settle();
|
|
172
|
+
}, "end");
|
|
173
|
+
lines.on("close", end);
|
|
174
|
+
if (signal?.aborted)
|
|
175
|
+
end();
|
|
176
|
+
signal?.addEventListener("abort", end, { once: true });
|
|
177
|
+
settle();
|
|
178
|
+
});
|
|
179
|
+
}, "serveCommands");
|
|
180
|
+
|
|
181
|
+
export {
|
|
182
|
+
COMMAND_SERVER_CONCURRENT,
|
|
183
|
+
enterCommandServer,
|
|
184
|
+
serveCommands
|
|
185
|
+
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_STEMMERS,
|
|
8
8
|
LANGUAGES
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QROAXWDU.js";
|
|
10
10
|
import {
|
|
11
11
|
installerOf
|
|
12
12
|
} from "./chunk-RX5CJ55S.js";
|
|
@@ -15,18 +15,18 @@ import {
|
|
|
15
15
|
readSetupAnswers,
|
|
16
16
|
unanswered,
|
|
17
17
|
writeSetupAnswers
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-4N2WJYLE.js";
|
|
19
19
|
import {
|
|
20
20
|
sharedConfigPath
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HAR76KJG.js";
|
|
22
22
|
import {
|
|
23
23
|
storePath
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-Y52T5EMB.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.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/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-QECSDJRP.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-G3VHOOMV.js"),
|
|
117
|
+
import("./store-maintenance-command-5YW6TRJA.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-NVK7PFX4.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:");
|
|
@@ -199,7 +199,7 @@ var setupAtStart = /* @__PURE__ */ __name(async (start) => {
|
|
|
199
199
|
contentLanguages: start.contentLanguages,
|
|
200
200
|
all: start.path[0] === "setup",
|
|
201
201
|
io: {
|
|
202
|
-
ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-
|
|
202
|
+
ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-JWQ6UQ6R.js")).readSecret(prompt, { input, echo: true }), "ask"),
|
|
203
203
|
say: /* @__PURE__ */ __name((text) => process.stderr.write(`${text}
|
|
204
204
|
`), "say")
|
|
205
205
|
}
|
|
@@ -17,7 +17,7 @@ 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.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/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.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/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.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/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 {
|
|
@@ -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.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/stdio-wire.js
|
|
8
8
|
import { PassThrough, Writable } from "node:stream";
|
|
9
9
|
var lineReader = /* @__PURE__ */ __name((onMessage) => {
|
|
10
10
|
let rest = "";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-ZVVMGPBJ.js";
|
|
9
9
|
|
|
10
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/store/path.js
|
|
11
11
|
import { userInfo } from "node:os";
|
|
12
12
|
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
13
13
|
var wirecatDirectory = /* @__PURE__ */ __name((env = process.env, platform) => resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env, ...platform ? { platform } : {} }).state, "wirecatDirectory");
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ACCESS_SECONDS,
|
|
5
5
|
REFRESH_SECONDS,
|
|
6
6
|
readStored
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DDSAJKPO.js";
|
|
8
8
|
import {
|
|
9
9
|
OAuthError,
|
|
10
10
|
OAuthErrorCode
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
__name
|
|
14
14
|
} from "./chunk-ZVVMGPBJ.js";
|
|
15
15
|
|
|
16
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/http/oauth.js
|
|
17
17
|
import { createHash, randomBytes, randomInt, timingSafeEqual } from "node:crypto";
|
|
18
18
|
import { chmodSync, mkdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
19
19
|
import { dirname } from "node:path";
|
|
@@ -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.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/cli/stdin-field.js
|
|
8
8
|
var fields = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
var readsStdin = /* @__PURE__ */ __name((command, field) => {
|
|
10
10
|
fields.set(command, field);
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
agentJson,
|
|
8
8
|
commandAvailability,
|
|
9
9
|
failureContext
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CB6AHU6H.js";
|
|
11
11
|
import {
|
|
12
12
|
callerOf
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DCGGZUNJ.js";
|
|
14
14
|
import {
|
|
15
15
|
QUERY_ARGUMENT,
|
|
16
16
|
lentConnection,
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
refuseLacking,
|
|
19
19
|
servicesFor,
|
|
20
20
|
storeModeDeps
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-6DLRATDC.js";
|
|
22
22
|
import {
|
|
23
23
|
MAX_BUFFERED_INPUT
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-C5CB6RIX.js";
|
|
25
25
|
import {
|
|
26
26
|
DEFAULT_OUTPUT_BYTES,
|
|
27
27
|
ENTITIES,
|
|
@@ -41,23 +41,23 @@ import {
|
|
|
41
41
|
refuseStoreChange,
|
|
42
42
|
sealed,
|
|
43
43
|
startRecording
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-GJBGZQHN.js";
|
|
45
45
|
import {
|
|
46
46
|
currentCaller,
|
|
47
47
|
keepsSuccess,
|
|
48
48
|
runContextOf,
|
|
49
49
|
withCaller
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-2FXA32RJ.js";
|
|
51
51
|
import {
|
|
52
52
|
enclosingTraceId,
|
|
53
53
|
inRun,
|
|
54
54
|
newRunId,
|
|
55
55
|
queryDescription,
|
|
56
56
|
traceOf
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-4MFMUBHH.js";
|
|
58
58
|
import {
|
|
59
59
|
storeDamaged
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-27SVHRHV.js";
|
|
61
61
|
import {
|
|
62
62
|
captureStreams,
|
|
63
63
|
traceIdOf
|
|
@@ -109,7 +109,7 @@ import {
|
|
|
109
109
|
__name
|
|
110
110
|
} from "./chunk-ZVVMGPBJ.js";
|
|
111
111
|
|
|
112
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
112
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/agent.js
|
|
113
113
|
import { Readable } from "node:stream";
|
|
114
114
|
|
|
115
115
|
// node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/lint.js
|
|
@@ -3200,7 +3200,7 @@ var VOCABULARY = defineVocabulary({
|
|
|
3200
3200
|
]
|
|
3201
3201
|
});
|
|
3202
3202
|
|
|
3203
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3203
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/agent.js
|
|
3204
3204
|
var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
|
|
3205
3205
|
var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
|
|
3206
3206
|
var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
|
|
@@ -3423,7 +3423,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
|
|
|
3423
3423
|
}
|
|
3424
3424
|
}, "runCommandForAgent");
|
|
3425
3425
|
|
|
3426
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3426
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/tool.js
|
|
3427
3427
|
var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
|
|
3428
3428
|
var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
|
|
3429
3429
|
var message = pipe(
|
|
@@ -3682,7 +3682,7 @@ var failed = /* @__PURE__ */ __name((error, errors, effects) => {
|
|
|
3682
3682
|
return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(storeDamaged(error), context))));
|
|
3683
3683
|
}, "failed");
|
|
3684
3684
|
|
|
3685
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3685
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/surface.js
|
|
3686
3686
|
import { randomUUID } from "node:crypto";
|
|
3687
3687
|
var MATCHES = 8;
|
|
3688
3688
|
var ANSWER = answerSchema();
|
|
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
openSqlite
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FYHFAOPM.js";
|
|
6
6
|
import {
|
|
7
7
|
__name
|
|
8
8
|
} from "./chunk-ZVVMGPBJ.js";
|
|
9
9
|
|
|
10
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/store/damage.js
|
|
11
11
|
var DERIVED = /* @__PURE__ */ new Set(["mentions", "involvements", "embeddings"]);
|
|
12
12
|
var named = /* @__PURE__ */ __name((tables) => tables.length <= 5 ? tables.join(", ") : `${tables.slice(0, 5).join(", ")} and ${tables.length - 5} more`, "named");
|
|
13
13
|
var isDerivedTable = /* @__PURE__ */ __name((table, searchIndexes) => DERIVED.has(table) || table.startsWith("vector_index_") || searchIndexes.some((index) => table === index || table.startsWith(`${index}_`)), "isDerivedTable");
|
|
@@ -110,7 +110,7 @@ var storeDamageReport = /* @__PURE__ */ __name(({ health, command, mark = null,
|
|
|
110
110
|
};
|
|
111
111
|
}, "storeDamageReport");
|
|
112
112
|
|
|
113
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
113
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/store/health.js
|
|
114
114
|
import { existsSync, statSync } from "node:fs";
|
|
115
115
|
var JSON_COLUMNS = {
|
|
116
116
|
accounts: ["settings"],
|
|
@@ -252,7 +252,7 @@ var storeHealth = /* @__PURE__ */ __name(async (path, { deep = false } = {}) =>
|
|
|
252
252
|
}
|
|
253
253
|
}, "storeHealth");
|
|
254
254
|
|
|
255
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
|
|
256
256
|
var MAX_BYTES = 16 * 1024 * 1024;
|
|
257
257
|
|
|
258
258
|
export {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
commandPathOf,
|
|
8
8
|
findCommand,
|
|
9
9
|
outputOf
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MFWWZ6XL.js";
|
|
11
11
|
import {
|
|
12
12
|
Command,
|
|
13
13
|
Help,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
environmentOf,
|
|
19
19
|
metaOf,
|
|
20
20
|
takesProfile
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-GJBGZQHN.js";
|
|
22
22
|
import {
|
|
23
23
|
writes
|
|
24
24
|
} from "./chunk-WGGSFGNZ.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
__name
|
|
30
30
|
} from "./chunk-ZVVMGPBJ.js";
|
|
31
31
|
|
|
32
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/cli/help/sections.js
|
|
33
33
|
var SECTIONS = {
|
|
34
34
|
read: "Read",
|
|
35
35
|
write: "Write",
|
|
@@ -95,7 +95,7 @@ var CORE_SECTIONS = {
|
|
|
95
95
|
upgrade: "setup"
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
98
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/cli/help/commands-text.js
|
|
99
99
|
var DESCRIPTION = 90;
|
|
100
100
|
var COLUMN = 52;
|
|
101
101
|
var short = /* @__PURE__ */ __name((text) => {
|
|
@@ -134,7 +134,7 @@ var commandsText = /* @__PURE__ */ __name((root, commands, scope) => {
|
|
|
134
134
|
`;
|
|
135
135
|
}, "commandsText");
|
|
136
136
|
|
|
137
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
137
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/cli/help/command-help.js
|
|
138
138
|
var ARGUMENT_KINDS = {
|
|
139
139
|
chat: "chat",
|
|
140
140
|
chats: "chat",
|
|
@@ -326,7 +326,7 @@ var installCommandHelp = /* @__PURE__ */ __name((program, { profile = true } = {
|
|
|
326
326
|
command.addHelpText("after", () => commandHelpText(command));
|
|
327
327
|
}, "installCommandHelp");
|
|
328
328
|
|
|
329
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
329
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/cli/help/first-screen.js
|
|
330
330
|
var WIRECAT_TOOLS = [
|
|
331
331
|
{
|
|
332
332
|
command: "tg",
|
|
@@ -6,18 +6,18 @@ import {
|
|
|
6
6
|
commandPathOf,
|
|
7
7
|
findCommand,
|
|
8
8
|
outputOf
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-MFWWZ6XL.js";
|
|
10
|
+
import "./chunk-GJBGZQHN.js";
|
|
11
|
+
import "./chunk-2UHANFLM.js";
|
|
12
|
+
import "./chunk-O5A4IS2D.js";
|
|
13
|
+
import "./chunk-2FXA32RJ.js";
|
|
14
|
+
import "./chunk-4N2WJYLE.js";
|
|
15
|
+
import "./chunk-GJFICFQB.js";
|
|
16
|
+
import "./chunk-4MFMUBHH.js";
|
|
17
|
+
import "./chunk-27SVHRHV.js";
|
|
18
|
+
import "./chunk-HAR76KJG.js";
|
|
19
|
+
import "./chunk-7FWU4RON.js";
|
|
20
|
+
import "./chunk-Y52T5EMB.js";
|
|
21
21
|
import "./chunk-YVNHQFLC.js";
|
|
22
22
|
import "./chunk-U6HEZPCR.js";
|
|
23
23
|
import "./chunk-WGGSFGNZ.js";
|