@wirecat/mail-cli 0.33.0 → 0.35.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/CHANGELOG.md +39 -0
- package/README.md +4 -1
- package/contracts/wirecat.json +54 -4
- package/dist/bin/mail.js +2 -2
- package/dist/bundle/agent-KWLCQCSC.js +39 -0
- package/dist/bundle/{all-profiles-W3CGXEEJ.js → all-profiles-6BDSMVOO.js} +63 -21
- package/dist/bundle/{anthropic-UMDO5AKP.js → anthropic-C3XUXUCJ.js} +8 -8
- package/dist/bundle/{app-server-4SICQ5RP.js → app-server-GUHDK4OR.js} +82 -64
- package/dist/bundle/{bun-QVVCH4MJ.js → bun-FN7AM4AG.js} +2 -2
- package/dist/bundle/{bun-sqlite-CHD4AIUK.js → bun-sqlite-56IVBF22.js} +6 -6
- package/dist/bundle/{chunk-HFFHL7SV.js → chunk-2B67TUIF.js} +101 -69
- package/dist/bundle/{chunk-OOYIPK4F.js → chunk-2UNQTKRH.js} +1 -1
- package/dist/bundle/{chunk-LXUHYDNE.js → chunk-3ACF6TIV.js} +1 -1
- package/dist/bundle/chunk-3EV2B7KZ.js +726 -0
- package/dist/bundle/chunk-3KAJCOJP.js +109 -0
- package/dist/bundle/{chunk-2BFXHCZW.js → chunk-3WAZKCDF.js} +2 -2
- package/dist/bundle/{chunk-LKGJMM6W.js → chunk-46SBNO67.js} +12 -63
- package/dist/bundle/{chunk-LB5FTCPZ.js → chunk-4IASS7NQ.js} +128 -10
- package/dist/bundle/chunk-4U5ODZO7.js +360 -0
- package/dist/bundle/{chunk-QN423PC6.js → chunk-5WYBI35N.js} +3 -3
- package/dist/bundle/{chunk-GZYICXO4.js → chunk-5XQI7WCJ.js} +1 -1
- package/dist/bundle/{chunk-JUYUWMTG.js → chunk-635AFLZO.js} +4 -4
- package/dist/bundle/{chunk-2P44S7XK.js → chunk-6B4WZVLN.js} +36 -28
- package/dist/bundle/{chunk-47YNANPZ.js → chunk-6Q5THDNW.js} +3 -3
- package/dist/bundle/chunk-6VARUB3J.js +787 -0
- package/dist/bundle/{chunk-BRRHYXUP.js → chunk-7FXZKQAC.js} +87 -76
- package/dist/bundle/{chunk-EW3JFV7J.js → chunk-7JVKQ6NM.js} +4 -4
- package/dist/bundle/{chunk-OWAJN74H.js → chunk-7KMI47AP.js} +106 -257
- package/dist/bundle/{chunk-BF73DBAA.js → chunk-7PXAUMK5.js} +30 -15
- package/dist/bundle/{chunk-UX76GMQM.js → chunk-7YMLEWTX.js} +43 -64
- package/dist/bundle/{chunk-2L6D54BR.js → chunk-AISQNKT7.js} +8 -8
- package/dist/bundle/chunk-AV2ZJ4WX.js +7 -0
- package/dist/bundle/{chunk-OFMYFFEF.js → chunk-AXKIXVQA.js} +991 -1609
- package/dist/bundle/{chunk-UAV74EY4.js → chunk-CDGVYQXG.js} +1 -1
- package/dist/bundle/{chunk-RXUVXAMM.js → chunk-CFQQTDSA.js} +1 -1
- package/dist/bundle/chunk-CMGZXBJW.js +259 -0
- package/dist/bundle/{chunk-H46MANPR.js → chunk-DD2P67NP.js} +3 -3
- package/dist/bundle/{chunk-IBIFX2LK.js → chunk-DFHUJTP5.js} +2 -2
- package/dist/bundle/{chunk-DI74RP6R.js → chunk-DREU6TN6.js} +31 -85
- package/dist/bundle/{chunk-XQXYAOBV.js → chunk-DZHEVVXA.js} +53 -33
- package/dist/bundle/{chunk-LFBD6RTX.js → chunk-E6HSSKRX.js} +4 -4
- package/dist/bundle/{chunk-UYZDH5LK.js → chunk-EHAXFDDP.js} +1 -1
- package/dist/bundle/chunk-EU4J6GCJ.js +52 -0
- package/dist/bundle/{chunk-CHNNKHLL.js → chunk-EX4Z7CCO.js} +4051 -2788
- package/dist/bundle/chunk-G662S2M4.js +559 -0
- package/dist/bundle/{chunk-XN5KH24X.js → chunk-GG634DR3.js} +5 -5
- package/dist/bundle/{chunk-FSMCXQH2.js → chunk-GU3PYIV2.js} +2 -2
- package/dist/bundle/{chunk-SW7YGW3T.js → chunk-HF5QWKK2.js} +18 -8
- package/dist/bundle/chunk-HJDIMVFW.js +108 -0
- package/dist/bundle/chunk-HKWZG7CZ.js +334 -0
- package/dist/bundle/{chunk-BI5P7JWM.js → chunk-HM6AMYHR.js} +2 -2
- package/dist/bundle/{chunk-35AH33VJ.js → chunk-HVXOA4FO.js} +1 -1
- package/dist/bundle/{chunk-LXAX6AZU.js → chunk-I3QZCQJT.js} +6 -6
- package/dist/bundle/{chunk-I3UAD4EI.js → chunk-ILEKGH44.js} +68 -59
- package/dist/bundle/{chunk-SDWYOYGN.js → chunk-J5ULUTWE.js} +4 -4
- package/dist/bundle/{chunk-TK77DCE5.js → chunk-L4RCWRWS.js} +1 -1
- package/dist/bundle/chunk-MCJYJIH5.js +192 -0
- package/dist/bundle/{chunk-S6CHYNFE.js → chunk-NEDS4ORI.js} +2 -2
- package/dist/bundle/{chunk-QO7BK4WD.js → chunk-ODQCRZX5.js} +35 -12
- package/dist/bundle/chunk-OO4OKMNB.js +80 -0
- package/dist/bundle/{chunk-JCQ47WR4.js → chunk-OOQFBRNR.js} +144 -10
- package/dist/bundle/{chunk-LACMDMDI.js → chunk-OTP2HJ67.js} +9 -9
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-AEKWEYIG.js → chunk-PQDQCCGG.js} +19 -19
- package/dist/bundle/{chunk-BZY5W35X.js → chunk-Q5U2HIBJ.js} +7 -7
- package/dist/bundle/{chunk-74BYHR44.js → chunk-QFMKCU42.js} +3738 -3415
- package/dist/bundle/{chunk-SYUIAMVA.js → chunk-QYCMB7JY.js} +373 -533
- package/dist/bundle/{chunk-KLLT572M.js → chunk-RBV2AM52.js} +2 -100
- package/dist/bundle/{chunk-6VCQ4CTK.js → chunk-RJNKM3CQ.js} +1 -1
- package/dist/bundle/{chunk-6IS4BEN4.js → chunk-RQHWSNX4.js} +4 -4
- package/dist/bundle/chunk-RQJGX7F7.js +170 -0
- package/dist/bundle/{chunk-RENCSP47.js → chunk-TARNPINT.js} +3 -3
- package/dist/bundle/chunk-TP2BCK2Z.js +721 -0
- package/dist/bundle/{chunk-MJ7DUSHT.js → chunk-TP766H4O.js} +18 -14
- package/dist/bundle/{chunk-2X344EUT.js → chunk-UHGKN5US.js} +8 -8
- package/dist/bundle/{chunk-L3MKFI3Y.js → chunk-UWDRU3R6.js} +2 -2
- package/dist/bundle/chunk-V4O47JV6.js +72 -0
- package/dist/bundle/{chunk-CIG4UVP6.js → chunk-W4JYGMTU.js} +14 -13
- package/dist/bundle/{chunk-JADBHKBP.js → chunk-W7ICCFG5.js} +1 -1
- package/dist/bundle/{chunk-MNJ3BMPZ.js → chunk-WDEVKKAD.js} +3 -3
- package/dist/bundle/{chunk-TBZLGT7R.js → chunk-WZKM5I7B.js} +23 -119
- package/dist/bundle/{chunk-MT7T5N2N.js → chunk-XKKYRMGG.js} +4 -4
- package/dist/bundle/chunk-XQNKAM26.js +338 -0
- package/dist/bundle/{chunk-UWF3SSRL.js → chunk-YA44BG3N.js} +58 -9
- package/dist/bundle/{chunk-Y2P2LC5R.js → chunk-YCIWSKOH.js} +9 -9
- package/dist/bundle/{chunk-7OYZU5SP.js → chunk-YQTRKNZQ.js} +4 -4
- package/dist/bundle/chunk-YRAJFTFU.js +353 -0
- package/dist/bundle/chunk-YTI533XF.js +29 -0
- package/dist/bundle/{chunk-UG2QDGAH.js → chunk-ZMYRPMAJ.js} +1 -1
- package/dist/bundle/{chunk-CZ6ZXDSO.js → chunk-ZX7HZDD6.js} +182 -562
- package/dist/bundle/{chunk-IPSLQX64.js → chunk-ZYEU35MB.js} +2 -2
- package/dist/bundle/command-contract-D5UXWHMS.js +39 -0
- package/dist/bundle/{command-server-entry-G2ZHCN5J.js → command-server-entry-TPJ47FYS.js} +28 -25
- package/dist/bundle/decode-XHUASXQK.js +296 -0
- package/dist/bundle/{dispatch-RHIK22OA.js → dispatch-MQZHGGVP.js} +8 -8
- package/dist/bundle/{dist-X5G2IMYG.js → dist-BAE4IQ52.js} +34 -29
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-UZJ6AREV.js → echarts-U7Z2PKIG.js} +2 -2
- package/dist/bundle/{embed-FEXLUH3T.js → embed-W7GPB6EI.js} +6 -6
- package/dist/bundle/{embedder-NHQARKFJ.js → embedder-T72XLFQ5.js} +9 -9
- package/dist/bundle/{failure-7DIA4OET.js → failure-MP6VKL5Y.js} +2 -2
- package/dist/bundle/{first-run-PS5NR2QG.js → first-run-C44TJXRI.js} +12 -12
- package/dist/bundle/first-screen-IESI7DAU.js +39 -0
- package/dist/bundle/{instructions-SDDUBGH4.js → instructions-WGMWQNPP.js} +1 -1
- package/dist/bundle/mail.js +12 -12
- package/dist/bundle/{mcp-GN4FTJX5.js → mcp-YGOAUNC3.js} +2 -2
- package/dist/bundle/meeting-combined-XGZBSWIQ.js +24 -0
- package/dist/bundle/meeting-model-QVHLD4WI.js +24 -0
- package/dist/bundle/meeting-semantic-QKQHUHXX.js +21 -0
- package/dist/bundle/{node-ELCNUOCE.js → node-WANDMJJQ.js} +2 -2
- package/dist/bundle/{node-sqlite-2E5MKZMH.js → node-sqlite-NM5XA4DR.js} +7 -7
- package/dist/bundle/{oauth-JGPEIY3M.js → oauth-6E63ELEE.js} +8 -8
- package/dist/bundle/{open-6DEMCZAB.js → open-5542RTLE.js} +5 -5
- package/dist/bundle/{openai-IVKDU5AH.js → openai-NOYNPFB5.js} +28 -26
- package/dist/bundle/{process-67DAKAAQ.js → process-7AEXXSBX.js} +1 -1
- package/dist/bundle/{program-ESJDQMAJ.js → program-VMA5CGNR.js} +5712 -3640
- package/dist/bundle/{prompt-ZBWOT5KG.js → prompt-WYYO4AJL.js} +5 -5
- package/dist/bundle/{recognize-UUBH2DOH.js → recognize-UGCCOMAS.js} +4 -4
- package/dist/bundle/{remote-UYTNWNOB.js → remote-VZS6BNQB.js} +9 -9
- package/dist/bundle/{rerank-X2633CQN.js → rerank-O46D5GJ2.js} +7 -7
- package/dist/bundle/{serve-CP7Q4OVW.js → serve-QAAF2LCW.js} +10 -10
- package/dist/bundle/server-456MYK3X.js +84 -0
- package/dist/bundle/{server-I7MXRSAG.js → server-Q3PUZLLX.js} +77 -58
- package/dist/bundle/{sqlite-runtime-BX55LI5G.js → sqlite-runtime-EQBCDO2U.js} +6 -6
- package/dist/bundle/{state-LLNJQXFH.js → state-XIOHYXCR.js} +6 -6
- package/dist/bundle/{store-N27XI3VV.js → store-OXJZZUR7.js} +34 -17
- package/dist/bundle/{store-K4KU5N75.js → store-VJBL5XKR.js} +30 -20
- package/dist/bundle/store-maintenance-command-D7XYIX52.js +71 -0
- package/dist/bundle/surface-N7LK7PKN.js +70 -0
- package/dist/commands/read.d.ts +2 -2
- package/dist/commands/read.d.ts.map +1 -1
- package/dist/commands/read.js +5 -4
- package/dist/commands/read.js.map +1 -1
- package/dist/commands/sync.d.ts +2 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +16 -9
- package/dist/commands/sync.js.map +1 -1
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -1
- package/dist/config.js.map +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +2 -2
- package/dist/identity.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-BDCC2J2Z.js +0 -2
- package/dist/bundle/command-contract-NRNQAFFE.js +0 -36
- package/dist/bundle/decode-U6V6D6XH.js +0 -162
- package/dist/bundle/first-screen-C2WTLOG2.js +0 -34
- package/dist/bundle/server-QGTMJ7SF.js +0 -67
- package/dist/bundle/store-maintenance-command-VPAFQCNA.js +0 -58
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
throughWrapper
|
|
5
|
+
} from "./chunk-3EV2B7KZ.js";
|
|
6
|
+
import {
|
|
7
|
+
environmentOf,
|
|
8
|
+
readOnlyLockOf
|
|
9
|
+
} from "./chunk-QYCMB7JY.js";
|
|
10
|
+
import {
|
|
11
|
+
array,
|
|
12
|
+
boolean,
|
|
13
|
+
check,
|
|
14
|
+
pipe,
|
|
15
|
+
record,
|
|
16
|
+
safeParse,
|
|
17
|
+
strictObject,
|
|
18
|
+
string
|
|
19
|
+
} from "./chunk-YA44BG3N.js";
|
|
20
|
+
import {
|
|
21
|
+
CliError
|
|
22
|
+
} from "./chunk-HM6AMYHR.js";
|
|
23
|
+
import {
|
|
24
|
+
__name
|
|
25
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
26
|
+
|
|
27
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/background/relay.js
|
|
28
|
+
import { createHash } from "node:crypto";
|
|
29
|
+
import { chmodSync, lstatSync, mkdirSync, rmSync } from "node:fs";
|
|
30
|
+
import { createConnection, createServer } from "node:net";
|
|
31
|
+
import { tmpdir } from "node:os";
|
|
32
|
+
import { dirname, isAbsolute, join } from "node:path";
|
|
33
|
+
import { PassThrough, Writable } from "node:stream";
|
|
34
|
+
var RELAY_PROTOCOL = 1;
|
|
35
|
+
var requestSchema = strictObject({
|
|
36
|
+
argv: array(string()),
|
|
37
|
+
env: record(string(), string()),
|
|
38
|
+
cwd: pipe(string(), check((path) => isAbsolute(path))),
|
|
39
|
+
tty: boolean(),
|
|
40
|
+
stdinTty: boolean()
|
|
41
|
+
});
|
|
42
|
+
var MAX_CLIENT_LINE = 1024 * 1024;
|
|
43
|
+
var MAX_SERVE_LINE = 64 * 1024 * 1024;
|
|
44
|
+
var MAX_SOCKET_PATH = 100;
|
|
45
|
+
var relayPath = /* @__PURE__ */ __name((lockPath) => {
|
|
46
|
+
const beside = lockPath.replace(/\.lock$/, ".sock");
|
|
47
|
+
if (beside.length <= MAX_SOCKET_PATH)
|
|
48
|
+
return beside;
|
|
49
|
+
const hash = createHash("sha256").update(beside).digest("hex").slice(0, 16);
|
|
50
|
+
const name = join(`wirecat-relay-${process.getuid?.() ?? "user"}`, `${hash}.sock`);
|
|
51
|
+
const temporary = join(tmpdir(), name);
|
|
52
|
+
if (temporary.length <= MAX_SOCKET_PATH || process.platform === "win32")
|
|
53
|
+
return temporary;
|
|
54
|
+
return join("/tmp", name);
|
|
55
|
+
}, "relayPath");
|
|
56
|
+
var privateDirectory = /* @__PURE__ */ __name((dir) => {
|
|
57
|
+
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
58
|
+
const stat = lstatSync(dir);
|
|
59
|
+
const mine = process.getuid === void 0 || stat.uid === process.getuid();
|
|
60
|
+
if (!stat.isDirectory() || !mine || (stat.mode & 63) !== 0) {
|
|
61
|
+
throw new CliError("permission_error", `${dir} is not a private directory, so serve does not listen there`);
|
|
62
|
+
}
|
|
63
|
+
}, "privateDirectory");
|
|
64
|
+
var lines = /* @__PURE__ */ __name((socket, max, onLine, onTooLong) => {
|
|
65
|
+
let buffered = "";
|
|
66
|
+
socket.setEncoding("utf8");
|
|
67
|
+
socket.on("data", (chunk) => {
|
|
68
|
+
buffered += chunk;
|
|
69
|
+
for (let end = buffered.indexOf("\n"); end >= 0; end = buffered.indexOf("\n")) {
|
|
70
|
+
const line = buffered.slice(0, end);
|
|
71
|
+
buffered = buffered.slice(end + 1);
|
|
72
|
+
if (line)
|
|
73
|
+
onLine(line);
|
|
74
|
+
}
|
|
75
|
+
if (buffered.length > max)
|
|
76
|
+
onTooLong();
|
|
77
|
+
});
|
|
78
|
+
}, "lines");
|
|
79
|
+
var frame = /* @__PURE__ */ __name((socket, value) => {
|
|
80
|
+
if (!socket.destroyed)
|
|
81
|
+
socket.write(`${JSON.stringify(value)}
|
|
82
|
+
`);
|
|
83
|
+
}, "frame");
|
|
84
|
+
var listenRelay = /* @__PURE__ */ __name(async (path, run) => {
|
|
85
|
+
privateDirectory(dirname(path));
|
|
86
|
+
rmSync(path, { force: true });
|
|
87
|
+
const open = /* @__PURE__ */ new Set();
|
|
88
|
+
const running = /* @__PURE__ */ new Set();
|
|
89
|
+
const server = createServer((socket) => {
|
|
90
|
+
open.add(socket);
|
|
91
|
+
const stop = new AbortController();
|
|
92
|
+
const stdin = new PassThrough();
|
|
93
|
+
let started = false;
|
|
94
|
+
socket.on("error", () => {
|
|
95
|
+
});
|
|
96
|
+
socket.on("close", () => {
|
|
97
|
+
open.delete(socket);
|
|
98
|
+
stop.abort(new CliError("cancelled", "the client went away", { retryable: false }));
|
|
99
|
+
if (!stdin.writableEnded)
|
|
100
|
+
stdin.end();
|
|
101
|
+
});
|
|
102
|
+
lines(socket, MAX_CLIENT_LINE, (line) => {
|
|
103
|
+
let message;
|
|
104
|
+
try {
|
|
105
|
+
message = JSON.parse(line);
|
|
106
|
+
} catch {
|
|
107
|
+
socket.destroy();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (!started) {
|
|
111
|
+
started = true;
|
|
112
|
+
if (message.v !== RELAY_PROTOCOL) {
|
|
113
|
+
frame(socket, { diagnostic: `serve speaks relay protocol ${RELAY_PROTOCOL}; restart it`, exit: 1 });
|
|
114
|
+
socket.end();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const parsed = safeParse(requestSchema, message.run);
|
|
118
|
+
if (!parsed.success) {
|
|
119
|
+
socket.destroy();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
stdin.isTTY = parsed.output.stdinTty;
|
|
123
|
+
if (parsed.output.stdinTty)
|
|
124
|
+
stdin.end();
|
|
125
|
+
const job = serve(socket, parsed.output, stdin, stop.signal, run);
|
|
126
|
+
running.add(job);
|
|
127
|
+
void job.then(() => running.delete(job), () => running.delete(job));
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (typeof message.stdin === "string" && !stdin.writableEnded)
|
|
131
|
+
stdin.write(Buffer.from(message.stdin, "base64"));
|
|
132
|
+
if (message.stdinEnd === true && !stdin.writableEnded)
|
|
133
|
+
stdin.end();
|
|
134
|
+
}, () => socket.destroy());
|
|
135
|
+
});
|
|
136
|
+
await new Promise((resolve, reject) => {
|
|
137
|
+
server.once("error", reject);
|
|
138
|
+
server.listen(path, () => {
|
|
139
|
+
server.off("error", reject);
|
|
140
|
+
resolve();
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
chmodSync(path, 384);
|
|
144
|
+
return {
|
|
145
|
+
close: /* @__PURE__ */ __name(async () => {
|
|
146
|
+
for (const socket of open)
|
|
147
|
+
socket.destroy();
|
|
148
|
+
await new Promise((resolve) => server.close(() => resolve()));
|
|
149
|
+
await Promise.allSettled(running);
|
|
150
|
+
rmSync(path, { force: true });
|
|
151
|
+
}, "close")
|
|
152
|
+
};
|
|
153
|
+
}, "listenRelay");
|
|
154
|
+
var serve = /* @__PURE__ */ __name(async (socket, request, stdin, signal, run) => {
|
|
155
|
+
const streams = {
|
|
156
|
+
data: /* @__PURE__ */ __name((text) => frame(socket, { data: text }), "data"),
|
|
157
|
+
diagnostic: /* @__PURE__ */ __name((text) => frame(socket, { diagnostic: text }), "diagnostic"),
|
|
158
|
+
progress: /* @__PURE__ */ __name((text) => frame(socket, { progress: text }), "progress")
|
|
159
|
+
};
|
|
160
|
+
const stdout = new Writable({
|
|
161
|
+
write: /* @__PURE__ */ __name((chunk, _encoding, done) => {
|
|
162
|
+
frame(socket, { raw: Buffer.from(chunk).toString("base64") });
|
|
163
|
+
done();
|
|
164
|
+
}, "write")
|
|
165
|
+
});
|
|
166
|
+
let code = 1;
|
|
167
|
+
try {
|
|
168
|
+
code = await run(request, { streams, stdin, stdout, signal });
|
|
169
|
+
} finally {
|
|
170
|
+
frame(socket, { exit: code });
|
|
171
|
+
socket.end();
|
|
172
|
+
}
|
|
173
|
+
}, "serve");
|
|
174
|
+
var relayCommand = /* @__PURE__ */ __name((path, request, options) => new Promise((resolve, reject) => {
|
|
175
|
+
const { streams, stdin, stdout, signal, deadlineMs, writes, holder, listens = false } = options;
|
|
176
|
+
const socket = createConnection(path);
|
|
177
|
+
let connected = false;
|
|
178
|
+
let settled = false;
|
|
179
|
+
let timer;
|
|
180
|
+
const forward = /* @__PURE__ */ __name((chunk) => frame(socket, { stdin: Buffer.from(chunk).toString("base64") }), "forward");
|
|
181
|
+
const ended = /* @__PURE__ */ __name(() => frame(socket, { stdinEnd: true }), "ended");
|
|
182
|
+
const brokenPipe = /* @__PURE__ */ __name((error) => {
|
|
183
|
+
if (error.code === "EPIPE")
|
|
184
|
+
finish({ code: 0 });
|
|
185
|
+
}, "brokenPipe");
|
|
186
|
+
const finish = /* @__PURE__ */ __name((outcome) => {
|
|
187
|
+
if (settled)
|
|
188
|
+
return;
|
|
189
|
+
settled = true;
|
|
190
|
+
if (timer)
|
|
191
|
+
clearTimeout(timer);
|
|
192
|
+
stdout.off("error", brokenPipe);
|
|
193
|
+
signal.removeEventListener("abort", aborted);
|
|
194
|
+
stdin.off("data", forward).off("end", ended);
|
|
195
|
+
stdin.pause();
|
|
196
|
+
socket.destroy();
|
|
197
|
+
if ("code" in outcome)
|
|
198
|
+
resolve(outcome.code);
|
|
199
|
+
else
|
|
200
|
+
reject(outcome.error);
|
|
201
|
+
}, "finish");
|
|
202
|
+
const stopped = /* @__PURE__ */ __name(() => writes ? new CliError("outcome_unknown", `${holder} stopped before the command finished; it may have run \u2014 check before repeating it`, { retryable: false }) : new CliError("provider_unavailable", `${holder} stopped before the command finished`, { retryable: true }), "stopped");
|
|
203
|
+
const aborted = /* @__PURE__ */ __name(() => finish(listens ? { code: 0 } : { error: signal.reason }), "aborted");
|
|
204
|
+
if (signal.aborted)
|
|
205
|
+
return aborted();
|
|
206
|
+
signal.addEventListener("abort", aborted, { once: true });
|
|
207
|
+
stdout.on("error", brokenPipe);
|
|
208
|
+
if (deadlineMs !== void 0)
|
|
209
|
+
timer = setTimeout(() => finish({ error: stopped() }), deadlineMs);
|
|
210
|
+
socket.on("connect", () => {
|
|
211
|
+
connected = true;
|
|
212
|
+
frame(socket, { v: RELAY_PROTOCOL, run: request });
|
|
213
|
+
if (request.stdinTty)
|
|
214
|
+
ended();
|
|
215
|
+
else {
|
|
216
|
+
stdin.on("data", forward).once("end", ended);
|
|
217
|
+
stdin.resume();
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
socket.on("error", (error) => {
|
|
221
|
+
if (connected)
|
|
222
|
+
return finish({ error: stopped() });
|
|
223
|
+
finish({
|
|
224
|
+
error: new CliError("provider_unavailable", `${holder} holds the connection but does not answer its relay (${error.code ?? error.message}) \u2014 restart it`, { retryable: false, sent: false })
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
socket.on("close", () => finish({ error: stopped() }));
|
|
228
|
+
lines(socket, MAX_SERVE_LINE, (line) => {
|
|
229
|
+
let message;
|
|
230
|
+
try {
|
|
231
|
+
message = JSON.parse(line);
|
|
232
|
+
} catch {
|
|
233
|
+
return finish({ error: stopped() });
|
|
234
|
+
}
|
|
235
|
+
if (typeof message.data === "string")
|
|
236
|
+
streams.data(message.data);
|
|
237
|
+
if (typeof message.diagnostic === "string")
|
|
238
|
+
streams.diagnostic(message.diagnostic);
|
|
239
|
+
if (typeof message.progress === "string")
|
|
240
|
+
streams.progress?.(message.progress);
|
|
241
|
+
if (typeof message.raw === "string")
|
|
242
|
+
stdout.write(Buffer.from(message.raw, "base64"));
|
|
243
|
+
if (typeof message.exit === "number")
|
|
244
|
+
finish({ code: message.exit });
|
|
245
|
+
}, () => finish({ error: stopped() }));
|
|
246
|
+
}), "relayCommand");
|
|
247
|
+
|
|
248
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
|
|
249
|
+
var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
|
|
250
|
+
close: /* @__PURE__ */ __name(async () => {
|
|
251
|
+
}, "close"),
|
|
252
|
+
feed: void 0,
|
|
253
|
+
storedChats: void 0,
|
|
254
|
+
listen: void 0,
|
|
255
|
+
listenHistory: void 0,
|
|
256
|
+
...connection.watch && watchers ? {
|
|
257
|
+
// A watcher that throws (its output limit, a closed reader) ends its own watch, never serve's.
|
|
258
|
+
watch: /* @__PURE__ */ __name(async (onEvent, signal, onReady) => {
|
|
259
|
+
let watcher;
|
|
260
|
+
try {
|
|
261
|
+
await new Promise((resolve, reject) => {
|
|
262
|
+
watcher = /* @__PURE__ */ __name((event) => {
|
|
263
|
+
try {
|
|
264
|
+
onEvent(event);
|
|
265
|
+
} catch (error) {
|
|
266
|
+
reject(error);
|
|
267
|
+
}
|
|
268
|
+
}, "watcher");
|
|
269
|
+
watchers.add(watcher);
|
|
270
|
+
signal.addEventListener("abort", () => resolve(), { once: true });
|
|
271
|
+
onReady?.();
|
|
272
|
+
if (signal.aborted)
|
|
273
|
+
resolve();
|
|
274
|
+
});
|
|
275
|
+
} finally {
|
|
276
|
+
if (watcher)
|
|
277
|
+
watchers.delete(watcher);
|
|
278
|
+
}
|
|
279
|
+
}, "watch")
|
|
280
|
+
} : { watch: void 0 }
|
|
281
|
+
}), "lentConnection");
|
|
282
|
+
var serveRelay = /* @__PURE__ */ __name((command, messenger) => {
|
|
283
|
+
let held;
|
|
284
|
+
let relay;
|
|
285
|
+
const watchers = /* @__PURE__ */ new Set();
|
|
286
|
+
const borrowed = /* @__PURE__ */ __name(() => {
|
|
287
|
+
const connection = held;
|
|
288
|
+
if (!connection)
|
|
289
|
+
throw new CliError("provider_unavailable", "serve is not connected yet", { retryable: true });
|
|
290
|
+
return lentConnection(connection, watchers);
|
|
291
|
+
}, "borrowed");
|
|
292
|
+
return {
|
|
293
|
+
messenger: {
|
|
294
|
+
...messenger,
|
|
295
|
+
connect: /* @__PURE__ */ __name(async (...args) => {
|
|
296
|
+
held = await messenger.connect(...args);
|
|
297
|
+
return held;
|
|
298
|
+
}, "connect")
|
|
299
|
+
},
|
|
300
|
+
arrived: /* @__PURE__ */ __name((event) => {
|
|
301
|
+
for (const watcher of watchers)
|
|
302
|
+
watcher(event);
|
|
303
|
+
}, "arrived"),
|
|
304
|
+
/** Listens beside the lock; the address goes into it, which is how a client finds it. */
|
|
305
|
+
open: /* @__PURE__ */ __name(async (lockPath, profile) => {
|
|
306
|
+
const environment = environmentOf(command);
|
|
307
|
+
const runCommand = environment.runCommand;
|
|
308
|
+
if (!runCommand)
|
|
309
|
+
return void 0;
|
|
310
|
+
const readOnly = readOnlyLockOf(messenger.app, environment.env ?? process.env);
|
|
311
|
+
const path = relayPath(lockPath);
|
|
312
|
+
relay = await listenRelay(path, (request, io) => runCommand(request.argv, {
|
|
313
|
+
env: {
|
|
314
|
+
...request.env,
|
|
315
|
+
...readOnly ? { [`${messenger.app.envPrefix}_READ_ONLY`]: "1" } : {}
|
|
316
|
+
},
|
|
317
|
+
streams: io.streams,
|
|
318
|
+
stdin: io.stdin,
|
|
319
|
+
stdout: io.stdout,
|
|
320
|
+
tty: request.tty,
|
|
321
|
+
signal: io.signal,
|
|
322
|
+
answer: /* @__PURE__ */ __name(() => null, "answer"),
|
|
323
|
+
relayed: { profile, cwd: request.cwd, connection: borrowed }
|
|
324
|
+
}));
|
|
325
|
+
return { path, protocol: RELAY_PROTOCOL };
|
|
326
|
+
}, "open"),
|
|
327
|
+
close: /* @__PURE__ */ __name(async () => {
|
|
328
|
+
await relay?.close();
|
|
329
|
+
}, "close")
|
|
330
|
+
};
|
|
331
|
+
}, "serveRelay");
|
|
332
|
+
|
|
333
|
+
export {
|
|
334
|
+
RELAY_PROTOCOL,
|
|
335
|
+
relayCommand,
|
|
336
|
+
lentConnection,
|
|
337
|
+
serveRelay
|
|
338
|
+
};
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
errorCodes,
|
|
5
5
|
isCliError,
|
|
6
6
|
visibleControls
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HM6AMYHR.js";
|
|
8
8
|
import {
|
|
9
9
|
__name
|
|
10
10
|
} from "./chunk-ZVVMGPBJ.js";
|
|
11
11
|
|
|
12
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
12
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/exit-codes.js
|
|
13
13
|
var EXIT_CODES = {
|
|
14
14
|
validation_error: 2,
|
|
15
15
|
configuration_error: 3,
|
|
@@ -271,6 +271,25 @@ function isoTimestamp(message$1) {
|
|
|
271
271
|
}
|
|
272
272
|
__name(isoTimestamp, "isoTimestamp");
|
|
273
273
|
// @__NO_SIDE_EFFECTS__
|
|
274
|
+
function maxEntries(requirement, message$1) {
|
|
275
|
+
return {
|
|
276
|
+
kind: "validation",
|
|
277
|
+
type: "max_entries",
|
|
278
|
+
reference: maxEntries,
|
|
279
|
+
async: false,
|
|
280
|
+
expects: `<=${requirement}`,
|
|
281
|
+
requirement,
|
|
282
|
+
message: message$1,
|
|
283
|
+
"~run"(dataset, config$1) {
|
|
284
|
+
if (!dataset.typed) return dataset;
|
|
285
|
+
const count = Object.keys(dataset.value).length;
|
|
286
|
+
if (dataset.typed && count > this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` });
|
|
287
|
+
return dataset;
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
__name(maxEntries, "maxEntries");
|
|
292
|
+
// @__NO_SIDE_EFFECTS__
|
|
274
293
|
function maxLength(requirement, message$1) {
|
|
275
294
|
return {
|
|
276
295
|
kind: "validation",
|
|
@@ -581,6 +600,23 @@ function exactOptional(wrapped, default_) {
|
|
|
581
600
|
}
|
|
582
601
|
__name(exactOptional, "exactOptional");
|
|
583
602
|
// @__NO_SIDE_EFFECTS__
|
|
603
|
+
function function_(message$1) {
|
|
604
|
+
return _standardSchema({
|
|
605
|
+
kind: "schema",
|
|
606
|
+
type: "function",
|
|
607
|
+
reference: function_,
|
|
608
|
+
expects: "Function",
|
|
609
|
+
async: false,
|
|
610
|
+
message: message$1,
|
|
611
|
+
"~run"(dataset, config$1) {
|
|
612
|
+
if (typeof dataset.value === "function") dataset.typed = true;
|
|
613
|
+
else _addIssue(this, "type", dataset, config$1);
|
|
614
|
+
return dataset;
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
__name(function_, "function_");
|
|
619
|
+
// @__NO_SIDE_EFFECTS__
|
|
584
620
|
function lazy(getter) {
|
|
585
621
|
return _standardSchema({
|
|
586
622
|
kind: "schema",
|
|
@@ -1373,7 +1409,7 @@ function unwrap(schema) {
|
|
|
1373
1409
|
}
|
|
1374
1410
|
__name(unwrap, "unwrap");
|
|
1375
1411
|
|
|
1376
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
1412
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/effects.js
|
|
1377
1413
|
var EFFECT_LEVELS = ["none", "read", "write"];
|
|
1378
1414
|
var effectsSchema = strictObject({
|
|
1379
1415
|
remote: picklist(EFFECT_LEVELS),
|
|
@@ -2010,7 +2046,7 @@ function toStandardJsonSchema(schema) {
|
|
|
2010
2046
|
}
|
|
2011
2047
|
__name(toStandardJsonSchema, "toStandardJsonSchema");
|
|
2012
2048
|
|
|
2013
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2049
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/registry.js
|
|
2014
2050
|
var word = pipe(string(), regex(/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/, "a lower-case word, words joined by -"));
|
|
2015
2051
|
var SNAKE_CASE = /^[a-z][a-z0-9]*(_[a-z0-9]+)*$/;
|
|
2016
2052
|
var text = pipe(string(), regex(/\S/, "must not be empty"));
|
|
@@ -2052,7 +2088,7 @@ var fill = /* @__PURE__ */ __name((template, values) => template.replace(PLACEHO
|
|
|
2052
2088
|
return String(value);
|
|
2053
2089
|
}), "fill");
|
|
2054
2090
|
|
|
2055
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2091
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/output.js
|
|
2056
2092
|
var MAX_NEXT_STEPS = 2;
|
|
2057
2093
|
var COMPACT_FLAG = "--compact";
|
|
2058
2094
|
var isoTime = pipe(string(), isoTimestamp("an ISO 8601 time in UTC"), endsWith("Z", "an ISO 8601 time in UTC, ending in `Z`"));
|
|
@@ -2129,6 +2165,10 @@ var rankingSchema = strictObject({
|
|
|
2129
2165
|
})),
|
|
2130
2166
|
ms: pipe(number(), integer(), minValue(0))
|
|
2131
2167
|
});
|
|
2168
|
+
var querySchema = strictObject({
|
|
2169
|
+
chat: optional(strictObject({ word: text, chat_id: text, title: nullable(text) })),
|
|
2170
|
+
respelled: optional(array(strictObject({ word: text, tried: pipe(array(text), minLength(1)) })))
|
|
2171
|
+
});
|
|
2132
2172
|
var metaSchema = strictObject({
|
|
2133
2173
|
run_id: text,
|
|
2134
2174
|
duration_ms: pipe(number(), integer(), minValue(0)),
|
|
@@ -2141,7 +2181,8 @@ var metaSchema = strictObject({
|
|
|
2141
2181
|
now: optional(isoTime),
|
|
2142
2182
|
now_local: optional(localTime),
|
|
2143
2183
|
window: optional(strictObject({ since: optional(isoTime), until: optional(isoTime) })),
|
|
2144
|
-
ranking: optional(rankingSchema)
|
|
2184
|
+
ranking: optional(rankingSchema),
|
|
2185
|
+
query: optional(querySchema)
|
|
2145
2186
|
});
|
|
2146
2187
|
var offsetOf = /* @__PURE__ */ __name((at, zone) => {
|
|
2147
2188
|
const name = new Intl.DateTimeFormat("en-US", { timeZone: zone, timeZoneName: "longOffset" }).formatToParts(at).find((part) => part.type === "timeZoneName")?.value ?? "GMT";
|
|
@@ -2179,7 +2220,7 @@ var jsonlOf = /* @__PURE__ */ __name(({ items, page, meta }) => [
|
|
|
2179
2220
|
JSON.stringify({ type: "end", complete: meta.complete, ...meta.issues ? { issues: meta.issues } : {}, page })
|
|
2180
2221
|
].join("\n"), "jsonlOf");
|
|
2181
2222
|
|
|
2182
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2223
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/errors.js
|
|
2183
2224
|
var CRASH_CODE = "internal_error";
|
|
2184
2225
|
var CRASH_REASON = "command.crashed";
|
|
2185
2226
|
var errorObjectSchema = strictObject({
|
|
@@ -2223,6 +2264,12 @@ var BASE_REASONS = defineReasons([
|
|
|
2223
2264
|
},
|
|
2224
2265
|
{ reason: "batch.output-budget", code: "validation_error", message: "batch output budget exhausted", details: [] },
|
|
2225
2266
|
{ reason: "config.invalid", code: "configuration_error", message: "the configuration is not valid", details: [] },
|
|
2267
|
+
{
|
|
2268
|
+
reason: "keyring.unreachable",
|
|
2269
|
+
code: "configuration_error",
|
|
2270
|
+
message: "the OS keyring did not answer, and no file holds the sign-in",
|
|
2271
|
+
details: []
|
|
2272
|
+
},
|
|
2226
2273
|
{ reason: "auth.failed", code: "authentication_error", message: "the sign-in did not work", details: [] },
|
|
2227
2274
|
{ reason: "access.denied", code: "permission_error", message: "this account may not do that", details: [] },
|
|
2228
2275
|
{ reason: "item.not-found", code: "not_found", message: "nothing found by that name", details: [] },
|
|
@@ -2272,7 +2319,7 @@ var BASE_REASONS = defineReasons([
|
|
|
2272
2319
|
{ reason: CRASH_REASON, code: CRASH_CODE, message: "the command failed; this is a bug", details: [] }
|
|
2273
2320
|
]);
|
|
2274
2321
|
|
|
2275
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2322
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/steps.js
|
|
2276
2323
|
var SAME_COMMAND = "*";
|
|
2277
2324
|
var commandPath = pipe(string(), regex(/^[a-z][a-z0-9-]*( [a-z][a-z0-9-]*)*$/, "a command path such as `messages sync`"));
|
|
2278
2325
|
var stepSchema = union([
|
|
@@ -2351,7 +2398,7 @@ var STEPS = defineSteps([
|
|
|
2351
2398
|
}
|
|
2352
2399
|
]);
|
|
2353
2400
|
|
|
2354
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
2401
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/failure.js
|
|
2355
2402
|
var recognise = /* @__PURE__ */ __name((failure) => {
|
|
2356
2403
|
if (isCliError(failure))
|
|
2357
2404
|
return failure;
|
|
@@ -2509,6 +2556,7 @@ export {
|
|
|
2509
2556
|
integer,
|
|
2510
2557
|
isoDate,
|
|
2511
2558
|
isoTimestamp,
|
|
2559
|
+
maxEntries,
|
|
2512
2560
|
maxLength,
|
|
2513
2561
|
maxValue,
|
|
2514
2562
|
minLength,
|
|
@@ -2524,6 +2572,7 @@ export {
|
|
|
2524
2572
|
array,
|
|
2525
2573
|
boolean,
|
|
2526
2574
|
exactOptional,
|
|
2575
|
+
function_,
|
|
2527
2576
|
lazy,
|
|
2528
2577
|
literal,
|
|
2529
2578
|
looseObject,
|
|
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
LEVELS
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HF5QWKK2.js";
|
|
6
6
|
import {
|
|
7
7
|
WORD_BODY,
|
|
8
8
|
e164Of
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DREU6TN6.js";
|
|
10
10
|
import {
|
|
11
11
|
resolvePaths,
|
|
12
12
|
writeSecurely
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7FXZKQAC.js";
|
|
14
14
|
import {
|
|
15
15
|
array,
|
|
16
16
|
getDotPath,
|
|
@@ -29,16 +29,16 @@ import {
|
|
|
29
29
|
string,
|
|
30
30
|
transform,
|
|
31
31
|
unknown
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-YA44BG3N.js";
|
|
33
33
|
import {
|
|
34
34
|
CliError,
|
|
35
35
|
visibleControls
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-HM6AMYHR.js";
|
|
37
37
|
import {
|
|
38
38
|
__name
|
|
39
39
|
} from "./chunk-ZVVMGPBJ.js";
|
|
40
40
|
|
|
41
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/domain/vcard.js
|
|
42
42
|
import { createHash } from "node:crypto";
|
|
43
43
|
var MAX_ID = 512;
|
|
44
44
|
var AS_WORD = new RegExp(`^${WORD_BODY}$`);
|
|
@@ -269,7 +269,7 @@ var envelopeOfVcard = /* @__PURE__ */ __name((text, { provider, account, batchId
|
|
|
269
269
|
};
|
|
270
270
|
}, "envelopeOfVcard");
|
|
271
271
|
|
|
272
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
272
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/domain/formatting.js
|
|
273
273
|
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "the messenger formatter returned invalid text spans"), "invalid");
|
|
274
274
|
var validateFormattedText = /* @__PURE__ */ __name((formatted) => {
|
|
275
275
|
const { text, spans } = formatted;
|
|
@@ -329,7 +329,7 @@ var visibleFormattedText = /* @__PURE__ */ __name((formatted) => {
|
|
|
329
329
|
};
|
|
330
330
|
}, "visibleFormattedText");
|
|
331
331
|
|
|
332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
332
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/moderation/check.js
|
|
333
333
|
var INVITE = /max\.ru\/join\/|(t|telegram)\.me\/(\+|joinchat\/)|tg:\/\/join/i;
|
|
334
334
|
var LINK = /https?:\/\/\S+/i;
|
|
335
335
|
var STRENGTH = { report: 0, delete: 1, remove: 2 };
|
|
@@ -517,7 +517,7 @@ var nextPoint = /* @__PURE__ */ __name((rows, found) => {
|
|
|
517
517
|
}, "nextPoint");
|
|
518
518
|
var someUndone = /* @__PURE__ */ __name((rows) => rows.some(undone), "someUndone");
|
|
519
519
|
|
|
520
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
520
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/moderation/rules.js
|
|
521
521
|
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
522
522
|
import { join } from "node:path";
|
|
523
523
|
var RULE_ACTIONS = ["report", "delete", "remove"];
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
readLock,
|
|
6
6
|
releaseLock,
|
|
7
7
|
takeLock
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TARNPINT.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.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
|
|
14
14
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
15
15
|
|
|
16
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/mcp/http/activity.js
|
|
17
17
|
import { randomBytes } from "node:crypto";
|
|
18
18
|
import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
19
19
|
import { dirname } from "node:path";
|
|
@@ -86,7 +86,7 @@ var activityRecorder = /* @__PURE__ */ __name((path, now = Date.now) => {
|
|
|
86
86
|
};
|
|
87
87
|
}, "activityRecorder");
|
|
88
88
|
|
|
89
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
89
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.709.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_d98198650466e0f5373009c2596db072/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
|
|
90
90
|
var ACCESS_SECONDS = 60 * 60;
|
|
91
91
|
var REFRESH_SECONDS = 30 * 24 * 60 * 60;
|
|
92
92
|
var readStored = /* @__PURE__ */ __name((path) => existsSync2(path) ? JSON.parse(readFileSync2(path, "utf8")) : { clients: [], tokens: [] }, "readStored");
|