@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
|
@@ -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.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/stdin-field.js
|
|
8
8
|
var fields = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
var readsStdin = /* @__PURE__ */ __name((command, field) => {
|
|
10
10
|
fields.set(command, field);
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
7
|
+
// 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/executable.js
|
|
8
8
|
import { existsSync } from "node:fs";
|
|
9
9
|
import { win32 } from "node:path";
|
|
10
10
|
var variable = /* @__PURE__ */ __name((env, name) => Object.entries(env).find(([key]) => key.toUpperCase() === name)?.[1], "variable");
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
textModel,
|
|
5
|
+
vectorModelKey
|
|
6
|
+
} from "./chunk-HKWZG7CZ.js";
|
|
7
|
+
import {
|
|
8
|
+
OPENAI_URL,
|
|
9
|
+
openRemote,
|
|
10
|
+
remoteKey,
|
|
11
|
+
remoteModel
|
|
12
|
+
} from "./chunk-OTP2HJ67.js";
|
|
13
|
+
import {
|
|
14
|
+
endpointFetch
|
|
15
|
+
} from "./chunk-OOQFBRNR.js";
|
|
16
|
+
import {
|
|
17
|
+
isTextModelInstalled,
|
|
18
|
+
openEmbedder,
|
|
19
|
+
textModelsDirectory
|
|
20
|
+
} from "./chunk-7YMLEWTX.js";
|
|
21
|
+
import {
|
|
22
|
+
CliError
|
|
23
|
+
} from "./chunk-HM6AMYHR.js";
|
|
24
|
+
import {
|
|
25
|
+
__name
|
|
26
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
27
|
+
|
|
28
|
+
// 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/services/meeting-model.js
|
|
29
|
+
var integer = /* @__PURE__ */ __name((value, name, max) => {
|
|
30
|
+
if (!Number.isSafeInteger(value) || value < 1 || value > max)
|
|
31
|
+
throw new CliError("validation_error", `Invalid ${name}`);
|
|
32
|
+
return value;
|
|
33
|
+
}, "integer");
|
|
34
|
+
var cancelled = /* @__PURE__ */ __name((signal) => {
|
|
35
|
+
if (signal?.aborted)
|
|
36
|
+
throw new CliError("cancelled", "Meeting embedding was cancelled");
|
|
37
|
+
}, "cancelled");
|
|
38
|
+
var validatedRemote = /* @__PURE__ */ __name((remote) => {
|
|
39
|
+
let url;
|
|
40
|
+
try {
|
|
41
|
+
url = new URL(remote.baseUrl);
|
|
42
|
+
} catch {
|
|
43
|
+
throw new CliError("validation_error", "Invalid embedding endpoint");
|
|
44
|
+
}
|
|
45
|
+
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.search || url.hash)
|
|
46
|
+
throw new CliError("validation_error", "Embedding endpoint requires HTTP/S without credentials, query or fragment");
|
|
47
|
+
if (typeof remote.model !== "string" || !/^[\w./:-]{1,200}$/.test(remote.model))
|
|
48
|
+
throw new CliError("validation_error", "Invalid embedding model name");
|
|
49
|
+
const dims = integer(remote.dims, "embedding dimensions", 8192);
|
|
50
|
+
const baseUrl = remote.baseUrl.replace(/\/+$/, "");
|
|
51
|
+
const result = remoteModel({ model: remote.model, dims, ...baseUrl === OPENAI_URL ? {} : { baseUrl } });
|
|
52
|
+
return result;
|
|
53
|
+
}, "validatedRemote");
|
|
54
|
+
var meetingEmbeddingModel = /* @__PURE__ */ __name((choice, env) => {
|
|
55
|
+
if (typeof choice === "string") {
|
|
56
|
+
const model = textModel(choice, env);
|
|
57
|
+
return { key: vectorModelKey(model), dims: model.dims, kind: "local", model: model.id };
|
|
58
|
+
}
|
|
59
|
+
if (!choice || typeof choice !== "object" || !choice.remote)
|
|
60
|
+
throw new CliError("validation_error", "An explicit embedding model is required");
|
|
61
|
+
const remote = validatedRemote(choice.remote);
|
|
62
|
+
if (choice.concurrency !== void 0 && choice.concurrency !== 1)
|
|
63
|
+
throw new CliError("validation_error", "Meeting embedding supports one remote request worker");
|
|
64
|
+
return { key: remoteKey(remote), dims: remote.dims, kind: "remote", model: remote.model };
|
|
65
|
+
}, "meetingEmbeddingModel");
|
|
66
|
+
var createMeetingRemoteModel = /* @__PURE__ */ __name((input) => {
|
|
67
|
+
try {
|
|
68
|
+
return validatedRemote(remoteModel(input));
|
|
69
|
+
} catch (error) {
|
|
70
|
+
if (error instanceof CliError)
|
|
71
|
+
throw error;
|
|
72
|
+
throw new CliError("validation_error", "Invalid embedding endpoint");
|
|
73
|
+
}
|
|
74
|
+
}, "createMeetingRemoteModel");
|
|
75
|
+
var withAbort = /* @__PURE__ */ __name(async (pending, signal) => {
|
|
76
|
+
cancelled(signal);
|
|
77
|
+
if (!signal)
|
|
78
|
+
return pending;
|
|
79
|
+
let onAbort = /* @__PURE__ */ __name(() => {
|
|
80
|
+
}, "onAbort");
|
|
81
|
+
const interrupted = new Promise((_, reject) => {
|
|
82
|
+
onAbort = /* @__PURE__ */ __name(() => reject(new CliError("cancelled", "Meeting embedding was cancelled")), "onAbort");
|
|
83
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
84
|
+
});
|
|
85
|
+
try {
|
|
86
|
+
return await Promise.race([pending, interrupted]);
|
|
87
|
+
} finally {
|
|
88
|
+
signal.removeEventListener("abort", onAbort);
|
|
89
|
+
}
|
|
90
|
+
}, "withAbort");
|
|
91
|
+
var boundedResponse = /* @__PURE__ */ __name(async (response, maxBytes, signal) => {
|
|
92
|
+
const length = response.headers.get("content-length");
|
|
93
|
+
if (length !== null && (!/^\d+$/.test(length) || Number(length) > maxBytes)) {
|
|
94
|
+
void response.body?.cancel().catch(() => {
|
|
95
|
+
});
|
|
96
|
+
throw new CliError("invalid_response", "Embedding response exceeds the byte budget");
|
|
97
|
+
}
|
|
98
|
+
if (!response.body)
|
|
99
|
+
throw new CliError("invalid_response", "Embedding response has no body");
|
|
100
|
+
const reader = response.body.getReader();
|
|
101
|
+
const chunks = [];
|
|
102
|
+
let bytes = 0;
|
|
103
|
+
try {
|
|
104
|
+
for (; ; ) {
|
|
105
|
+
cancelled(signal);
|
|
106
|
+
const part = await withAbort(reader.read(), signal);
|
|
107
|
+
cancelled(signal);
|
|
108
|
+
if (part.done)
|
|
109
|
+
break;
|
|
110
|
+
bytes += part.value.byteLength;
|
|
111
|
+
if (bytes > maxBytes)
|
|
112
|
+
throw new CliError("invalid_response", "Embedding response exceeds the byte budget");
|
|
113
|
+
chunks.push(part.value);
|
|
114
|
+
}
|
|
115
|
+
const body = Buffer.concat(chunks, bytes).toString("utf8");
|
|
116
|
+
try {
|
|
117
|
+
return JSON.parse(body);
|
|
118
|
+
} catch {
|
|
119
|
+
throw new CliError("invalid_response", "Embedding response is not JSON");
|
|
120
|
+
}
|
|
121
|
+
} finally {
|
|
122
|
+
void reader.cancel().catch(() => {
|
|
123
|
+
});
|
|
124
|
+
reader.releaseLock();
|
|
125
|
+
}
|
|
126
|
+
}, "boundedResponse");
|
|
127
|
+
var openMeetingEmbedder = /* @__PURE__ */ __name(async (choice, options = {}) => {
|
|
128
|
+
const descriptor = meetingEmbeddingModel(choice, options.env);
|
|
129
|
+
const { signal } = options;
|
|
130
|
+
cancelled(signal);
|
|
131
|
+
const maxInputBytes = integer(options.maxInputBytes ?? 1024 * 1024, "input byte budget", 16 * 1024 * 1024);
|
|
132
|
+
const maxResponseBytes = integer(options.maxResponseBytes ?? 8 * 1024 * 1024, "response byte budget", 64 * 1024 * 1024);
|
|
133
|
+
if (options.threads !== void 0)
|
|
134
|
+
integer(options.threads, "embedding threads", 128);
|
|
135
|
+
let engine;
|
|
136
|
+
let remoteFailure;
|
|
137
|
+
if (typeof choice === "string") {
|
|
138
|
+
const model = textModel(choice, options.env);
|
|
139
|
+
const directory = options.directory ?? textModelsDirectory(options.env);
|
|
140
|
+
if (!isTextModelInstalled(model, directory))
|
|
141
|
+
throw new CliError("configuration_error", "The explicit local embedding model is not installed");
|
|
142
|
+
engine = await openEmbedder(model, directory, {
|
|
143
|
+
...options.threads === void 0 ? {} : { threads: options.threads }
|
|
144
|
+
});
|
|
145
|
+
} else {
|
|
146
|
+
const remote = validatedRemote(choice.remote);
|
|
147
|
+
const key = choice.apiKey ?? (remote.provider === "openai" ? (options.env ?? process.env).OPENAI_API_KEY : void 0);
|
|
148
|
+
if (remote.provider === "openai" && !key)
|
|
149
|
+
throw new CliError("authentication_error", "The explicit remote embedding model requires an API key");
|
|
150
|
+
const post = options.fetch ?? endpointFetch(remote.baseUrl, 12e4);
|
|
151
|
+
const guarded = /* @__PURE__ */ __name(async (url, init) => {
|
|
152
|
+
try {
|
|
153
|
+
cancelled(signal);
|
|
154
|
+
const responseTask = post(url, { ...init, redirect: "manual", ...signal ? { signal } : {} }).then((response2) => {
|
|
155
|
+
if (signal?.aborted) {
|
|
156
|
+
void response2.body?.cancel().catch(() => {
|
|
157
|
+
});
|
|
158
|
+
cancelled(signal);
|
|
159
|
+
}
|
|
160
|
+
return response2;
|
|
161
|
+
});
|
|
162
|
+
const response = await withAbort(responseTask, signal);
|
|
163
|
+
if (signal?.aborted) {
|
|
164
|
+
void response.body?.cancel().catch(() => {
|
|
165
|
+
});
|
|
166
|
+
cancelled(signal);
|
|
167
|
+
}
|
|
168
|
+
if (response.status >= 300 && response.status < 400) {
|
|
169
|
+
void response.body?.cancel().catch(() => {
|
|
170
|
+
});
|
|
171
|
+
throw new CliError("invalid_response", "Embedding redirects are refused");
|
|
172
|
+
}
|
|
173
|
+
if (!response.ok) {
|
|
174
|
+
void response.body?.cancel().catch(() => {
|
|
175
|
+
});
|
|
176
|
+
return new Response("{}", { status: response.status });
|
|
177
|
+
}
|
|
178
|
+
const body = await boundedResponse(response, maxResponseBytes, signal);
|
|
179
|
+
if (!body || typeof body !== "object" || !("data" in body) || !Array.isArray(body.data) || body.data.length > 256)
|
|
180
|
+
throw new CliError("invalid_response", "Embedding response lacks vector data");
|
|
181
|
+
for (const entry of body.data) {
|
|
182
|
+
if (!entry || typeof entry !== "object" || !Number.isSafeInteger(entry.index) || entry.index < 0 || !Array.isArray(entry.embedding) || entry.embedding.length !== remote.dims || entry.embedding.some((value) => typeof value !== "number" || !Number.isFinite(value) || !Number.isFinite(Math.fround(value))))
|
|
183
|
+
throw new CliError("invalid_response", "Embedding response contains invalid vectors");
|
|
184
|
+
}
|
|
185
|
+
const indices = body.data.map((entry) => entry.index).sort((a, b) => a - b);
|
|
186
|
+
if (indices.some((index, position) => index !== position))
|
|
187
|
+
throw new CliError("invalid_response", "Embedding response contains invalid vector indices");
|
|
188
|
+
return new Response(JSON.stringify({ data: body.data.map((entry) => ({ index: entry.index, embedding: entry.embedding })) }), { status: response.status });
|
|
189
|
+
} catch (error) {
|
|
190
|
+
remoteFailure = error;
|
|
191
|
+
throw error;
|
|
192
|
+
}
|
|
193
|
+
}, "guarded");
|
|
194
|
+
engine = openRemote(remote, key, { concurrency: 1, fetch: guarded, tries: 1, env: options.env ?? process.env });
|
|
195
|
+
}
|
|
196
|
+
if (signal?.aborted) {
|
|
197
|
+
await engine.close();
|
|
198
|
+
cancelled(signal);
|
|
199
|
+
}
|
|
200
|
+
let closed = false;
|
|
201
|
+
let running = false;
|
|
202
|
+
let active = null;
|
|
203
|
+
let closing = null;
|
|
204
|
+
return {
|
|
205
|
+
...descriptor,
|
|
206
|
+
async embed(texts, kind) {
|
|
207
|
+
cancelled(signal);
|
|
208
|
+
if (closed)
|
|
209
|
+
throw new CliError("configuration_error", "Meeting embedder is closed");
|
|
210
|
+
if (!Array.isArray(texts) || texts.length > 1e3 || texts.some((text) => typeof text !== "string") || !["query", "passage"].includes(kind))
|
|
211
|
+
throw new CliError("validation_error", "Invalid meeting embedding inputs");
|
|
212
|
+
if (Buffer.byteLength(JSON.stringify(texts), "utf8") > maxInputBytes || texts.length * descriptor.dims * 4 > maxResponseBytes)
|
|
213
|
+
throw new CliError("validation_error", "Meeting embedding input or vector payload exceeds its byte budget");
|
|
214
|
+
if (running)
|
|
215
|
+
throw new CliError("validation_error", "A meeting embedding request is already running");
|
|
216
|
+
running = true;
|
|
217
|
+
let settled = /* @__PURE__ */ __name(() => {
|
|
218
|
+
}, "settled");
|
|
219
|
+
active = new Promise((resolve) => {
|
|
220
|
+
settled = resolve;
|
|
221
|
+
});
|
|
222
|
+
remoteFailure = void 0;
|
|
223
|
+
try {
|
|
224
|
+
const vectors = await engine.embed([...texts], kind);
|
|
225
|
+
cancelled(signal);
|
|
226
|
+
if (vectors.length !== texts.length || vectors.some((vector) => vector.length !== descriptor.dims || !vector.some((value) => value !== 0) || [...vector].some((value) => !Number.isFinite(value))))
|
|
227
|
+
throw new CliError("invalid_response", "Meeting embedder returned invalid vectors");
|
|
228
|
+
return vectors;
|
|
229
|
+
} catch (error) {
|
|
230
|
+
cancelled(signal);
|
|
231
|
+
if (remoteFailure instanceof CliError)
|
|
232
|
+
throw remoteFailure;
|
|
233
|
+
if (error instanceof CliError)
|
|
234
|
+
throw error;
|
|
235
|
+
throw new CliError("provider_error", "Meeting embedding failed");
|
|
236
|
+
} finally {
|
|
237
|
+
running = false;
|
|
238
|
+
settled();
|
|
239
|
+
active = null;
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
async close() {
|
|
243
|
+
if (!closing) {
|
|
244
|
+
closed = true;
|
|
245
|
+
closing = (async () => {
|
|
246
|
+
await active;
|
|
247
|
+
await engine.close();
|
|
248
|
+
})();
|
|
249
|
+
}
|
|
250
|
+
await closing;
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
}, "openMeetingEmbedder");
|
|
254
|
+
|
|
255
|
+
export {
|
|
256
|
+
meetingEmbeddingModel,
|
|
257
|
+
createMeetingRemoteModel,
|
|
258
|
+
openMeetingEmbedder
|
|
259
|
+
};
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
id,
|
|
6
6
|
text,
|
|
7
7
|
time
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DZHEVVXA.js";
|
|
9
9
|
import {
|
|
10
10
|
array,
|
|
11
11
|
nullable,
|
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
strictObject,
|
|
17
17
|
string,
|
|
18
18
|
unknown
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-YA44BG3N.js";
|
|
20
20
|
|
|
21
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21
|
+
// 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/entities/note.js
|
|
22
22
|
var link = {
|
|
23
23
|
target_text: nullable(text),
|
|
24
24
|
kind: text,
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
} from "./chunk-Y5E2WNWB.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HM6AMYHR.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/store/vector-extension.js
|
|
14
14
|
import { readFileSync } from "node:fs";
|
|
15
15
|
var musl = /* @__PURE__ */ __name(() => {
|
|
16
16
|
if (process.platform !== "linux")
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
QUERY_LIMITS,
|
|
5
|
+
exhausted,
|
|
6
|
+
searchError
|
|
7
|
+
} from "./chunk-V4O47JV6.js";
|
|
8
|
+
import {
|
|
9
|
+
fold
|
|
10
|
+
} from "./chunk-L4RCWRWS.js";
|
|
3
11
|
import {
|
|
4
12
|
CATALOG_KINDS,
|
|
5
13
|
CONTRACT_KINDS,
|
|
@@ -11,29 +19,23 @@ import {
|
|
|
11
19
|
ORDER_DIRECTIONS,
|
|
12
20
|
ORDER_PURPOSES,
|
|
13
21
|
ORDER_STATUSES,
|
|
14
|
-
QUERY_LIMITS,
|
|
15
22
|
SUBSCRIPTION_STATUSES,
|
|
16
23
|
TRANSACTION_STATUSES,
|
|
17
24
|
WALLET_KINDS,
|
|
18
25
|
looksLikeReference,
|
|
19
26
|
parseReference,
|
|
20
27
|
providerLabel,
|
|
21
|
-
providerNamed
|
|
22
|
-
|
|
23
|
-
} from "./chunk-OFMYFFEF.js";
|
|
24
|
-
import {
|
|
25
|
-
fold
|
|
26
|
-
} from "./chunk-TK77DCE5.js";
|
|
28
|
+
providerNamed
|
|
29
|
+
} from "./chunk-6VARUB3J.js";
|
|
27
30
|
import {
|
|
28
31
|
CliError,
|
|
29
|
-
isCliError,
|
|
30
32
|
singleLine
|
|
31
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-HM6AMYHR.js";
|
|
32
34
|
import {
|
|
33
35
|
__name
|
|
34
36
|
} from "./chunk-ZVVMGPBJ.js";
|
|
35
37
|
|
|
36
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38
|
+
// 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/phone-plans.generated.js
|
|
37
39
|
var PHONE_PLANS = [
|
|
38
40
|
{
|
|
39
41
|
country: "us",
|
|
@@ -413,7 +415,7 @@ var PHONE_PLANS = [
|
|
|
413
415
|
}
|
|
414
416
|
];
|
|
415
417
|
|
|
416
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
418
|
+
// 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/phones.js
|
|
417
419
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
418
420
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
419
421
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -488,7 +490,7 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
|
|
|
488
490
|
return found ? `+${found[1]}` : void 0;
|
|
489
491
|
}, "storedPhone");
|
|
490
492
|
|
|
491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
493
|
+
// 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/record-fields.js
|
|
492
494
|
var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
493
495
|
var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
494
496
|
var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
|
|
@@ -538,7 +540,7 @@ var arrayOf = /* @__PURE__ */ __name((item, maxItems, description) => ({
|
|
|
538
540
|
}), "arrayOf");
|
|
539
541
|
var isObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isObject");
|
|
540
542
|
|
|
541
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
543
|
+
// 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/record-types.js
|
|
542
544
|
var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
|
|
543
545
|
var PARTY = ["person", "organization"];
|
|
544
546
|
var ORGANIZATION = ["organization"];
|
|
@@ -933,7 +935,7 @@ var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf(type).some(([, role])
|
|
|
933
935
|
var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
|
|
934
936
|
var article = /* @__PURE__ */ __name((word) => /^[aeiou]/.test(word) ? "an" : "a", "article");
|
|
935
937
|
|
|
936
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
938
|
+
// 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/ref-arguments.js
|
|
937
939
|
var TAKES = {
|
|
938
940
|
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
939
941
|
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
@@ -993,52 +995,7 @@ var ensureAccount = /* @__PURE__ */ __name(async (reference, scope, profilesOn)
|
|
|
993
995
|
throw wrongAccount(reference, scope, profiles);
|
|
994
996
|
}, "ensureAccount");
|
|
995
997
|
|
|
996
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
997
|
-
var QUERY_VERSION = 1;
|
|
998
|
-
var QUERY_LIMITS2 = {
|
|
999
|
-
...QUERY_LIMITS,
|
|
1000
|
-
pattern: 1024,
|
|
1001
|
-
states: 1e4,
|
|
1002
|
-
expansions: 1e4,
|
|
1003
|
-
candidates: 5e4,
|
|
1004
|
-
bodyBytes: 8388608,
|
|
1005
|
-
milliseconds: 2e3,
|
|
1006
|
-
work: 1e7
|
|
1007
|
-
};
|
|
1008
|
-
var SEARCH_QUERY = {
|
|
1009
|
-
command: "search",
|
|
1010
|
-
guide: "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md"
|
|
1011
|
-
};
|
|
1012
|
-
var MESSAGE_PARSING = { ...SEARCH_QUERY, proximity: true };
|
|
1013
|
-
var MOST_WORDS_APART = 50;
|
|
1014
|
-
function searchError(reason, span, alternative) {
|
|
1015
|
-
queryError(reason, span, alternative, SEARCH_QUERY);
|
|
1016
|
-
}
|
|
1017
|
-
__name(searchError, "searchError");
|
|
1018
|
-
var ANSWER_MS = 1e3;
|
|
1019
|
-
var searchTimeLimit = /* @__PURE__ */ __name((deadline, now = Date.now()) => deadline?.explicit ? Math.max(QUERY_LIMITS2.milliseconds, deadline.endsAt - now - ANSWER_MS) : void 0, "searchTimeLimit");
|
|
1020
|
-
function outOfTime(limitMs = QUERY_LIMITS2.milliseconds) {
|
|
1021
|
-
throw new CliError("timeout", `search stopped at its time limit of ${limitMs / 1e3}s \u2014 the query is valid; add chat: or date: to search less of the store`, { reason: "query.time-limit", budget: "time", limit_ms: limitMs, complete: false });
|
|
1022
|
-
}
|
|
1023
|
-
__name(outOfTime, "outOfTime");
|
|
1024
|
-
var isQueryLimit = /* @__PURE__ */ __name((error) => isCliError(error) && (error.details.reason === "query.too-large" || error.details.reason === "query.time-limit"), "isQueryLimit");
|
|
1025
|
-
function exhausted(budget) {
|
|
1026
|
-
throw new CliError("validation_error", `search exceeded its ${budget} budget \u2014 narrow the chat or date range`, {
|
|
1027
|
-
reason: "query.too-large",
|
|
1028
|
-
budget,
|
|
1029
|
-
complete: false
|
|
1030
|
-
});
|
|
1031
|
-
}
|
|
1032
|
-
__name(exhausted, "exhausted");
|
|
1033
|
-
function tooWideTerm([term], budget) {
|
|
1034
|
-
if (term === void 0)
|
|
1035
|
-
exhausted(budget);
|
|
1036
|
-
const part = term.replace(/[*?]+/gu, " ").trim().split(/\s+/u).sort((a, b) => b.length - a.length)[0] ?? term;
|
|
1037
|
-
throw new CliError("validation_error", `search exceeded its ${budget} budget: ${term} is checked word by word, and too many messages hold it \u2014 write *${part}* (any word holding it, read from the index), more of the word, or add chat: or date:`, { reason: "query.too-large", budget, term, complete: false });
|
|
1038
|
-
}
|
|
1039
|
-
__name(tooWideTerm, "tooWideTerm");
|
|
1040
|
-
|
|
1041
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
998
|
+
// 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/search/lucene/automaton.js
|
|
1042
999
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
1043
1000
|
var literal = /* @__PURE__ */ __name((c) => ({
|
|
1044
1001
|
kind: "char",
|
|
@@ -1046,10 +1003,10 @@ var literal = /* @__PURE__ */ __name((c) => ({
|
|
|
1046
1003
|
negate: false
|
|
1047
1004
|
}), "literal");
|
|
1048
1005
|
var compileAutomaton = /* @__PURE__ */ __name((pattern, span = { start: 0, end: pattern.length }) => {
|
|
1049
|
-
if (pattern.length >
|
|
1006
|
+
if (pattern.length > QUERY_LIMITS.pattern * 2)
|
|
1050
1007
|
exhausted("pattern");
|
|
1051
1008
|
const chars = [...pattern];
|
|
1052
|
-
if (chars.length >
|
|
1009
|
+
if (chars.length > QUERY_LIMITS.pattern)
|
|
1053
1010
|
exhausted("pattern");
|
|
1054
1011
|
let at = 0, depth = 0;
|
|
1055
1012
|
const failure = /* @__PURE__ */ __name(() => searchError("query.invalid-regex", span, "use the supported Lucene regex subset"), "failure");
|
|
@@ -1092,7 +1049,7 @@ var compileAutomaton = /* @__PURE__ */ __name((pattern, span = { start: 0, end:
|
|
|
1092
1049
|
return character();
|
|
1093
1050
|
}, "escaped");
|
|
1094
1051
|
const union = /* @__PURE__ */ __name(() => {
|
|
1095
|
-
if (++depth >
|
|
1052
|
+
if (++depth > QUERY_LIMITS.depth)
|
|
1096
1053
|
exhausted("pattern depth");
|
|
1097
1054
|
const children = [concat()];
|
|
1098
1055
|
while (chars[at] === "|") {
|
|
@@ -1134,7 +1091,7 @@ var compileAutomaton = /* @__PURE__ */ __name((pattern, span = { start: 0, end:
|
|
|
1134
1091
|
if (character() !== "}" || max !== null && max < min)
|
|
1135
1092
|
return failure();
|
|
1136
1093
|
}
|
|
1137
|
-
if (min >
|
|
1094
|
+
if (min > QUERY_LIMITS.states || max !== null && max > QUERY_LIMITS.states)
|
|
1138
1095
|
exhausted("automaton states");
|
|
1139
1096
|
child = { kind: "repeat", child, min, max };
|
|
1140
1097
|
}
|
|
@@ -1214,7 +1171,7 @@ var compileAutomaton = /* @__PURE__ */ __name((pattern, span = { start: 0, end:
|
|
|
1214
1171
|
return failure();
|
|
1215
1172
|
const states = [];
|
|
1216
1173
|
const state = /* @__PURE__ */ __name(() => {
|
|
1217
|
-
if (states.length >=
|
|
1174
|
+
if (states.length >= QUERY_LIMITS.states)
|
|
1218
1175
|
exhausted("automaton states");
|
|
1219
1176
|
states.push({ epsilon: [], edges: [] });
|
|
1220
1177
|
return states.length - 1;
|
|
@@ -1278,7 +1235,7 @@ var compileAutomaton = /* @__PURE__ */ __name((pattern, span = { start: 0, end:
|
|
|
1278
1235
|
states: states.length,
|
|
1279
1236
|
test: /* @__PURE__ */ __name((text2, budget = { work: 0 }) => {
|
|
1280
1237
|
const spend = /* @__PURE__ */ __name(() => {
|
|
1281
|
-
if (++budget.work > (budget.maxWork ??
|
|
1238
|
+
if (++budget.work > (budget.maxWork ?? QUERY_LIMITS.work))
|
|
1282
1239
|
exhausted("automaton work");
|
|
1283
1240
|
}, "spend");
|
|
1284
1241
|
const closure = /* @__PURE__ */ __name((initial) => {
|
|
@@ -1438,7 +1395,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
1438
1395
|
return out;
|
|
1439
1396
|
}, "foldRegex");
|
|
1440
1397
|
|
|
1441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1398
|
+
// 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/search/trigrams.js
|
|
1442
1399
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
1443
1400
|
const padded = ` ${term} `;
|
|
1444
1401
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -1447,7 +1404,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
1447
1404
|
return [...pieces];
|
|
1448
1405
|
}, "trigrams");
|
|
1449
1406
|
|
|
1450
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1407
|
+
// 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/resolve.js
|
|
1451
1408
|
var isId = /* @__PURE__ */ __name((reference) => /^-?\d+$/.test(reference.trim()), "isId");
|
|
1452
1409
|
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
1453
1410
|
var pickChat = /* @__PURE__ */ __name((reference, chats) => {
|
|
@@ -1518,7 +1475,7 @@ ${lines}`, { candidates });
|
|
|
1518
1475
|
}, "ambiguous");
|
|
1519
1476
|
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
1520
1477
|
|
|
1521
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1478
|
+
// 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/addresses.js
|
|
1522
1479
|
var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
1523
1480
|
var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
|
|
1524
1481
|
var ROLE_ADDRESS_WORDS = {
|
|
@@ -1580,7 +1537,7 @@ var PERSON_LIKE = /* @__PURE__ */ new Set(["hr"]);
|
|
|
1580
1537
|
var isPersonLikeRoleAddress = /* @__PURE__ */ __name((address) => PERSON_LIKE.has(localWord(address)), "isPersonLikeRoleAddress");
|
|
1581
1538
|
var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
|
|
1582
1539
|
|
|
1583
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1540
|
+
// 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/display-names.js
|
|
1584
1541
|
var QUOTES = [
|
|
1585
1542
|
['"', '"'],
|
|
1586
1543
|
["'", "'"],
|
|
@@ -1638,7 +1595,7 @@ var nameKey = /* @__PURE__ */ __name((name) => {
|
|
|
1638
1595
|
}, "nameKey");
|
|
1639
1596
|
var isReadable = /* @__PURE__ */ __name((shown) => shown !== null && READABLE.test(shown), "isReadable");
|
|
1640
1597
|
|
|
1641
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1598
|
+
// 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/counters.js
|
|
1642
1599
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
1643
1600
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
1644
1601
|
var counterValue = /* @__PURE__ */ __name((message, field) => {
|
|
@@ -1675,7 +1632,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
1675
1632
|
return states.some((one) => one.freshness === "stale") ? "stale" : "fresh";
|
|
1676
1633
|
}, "counterFreshness");
|
|
1677
1634
|
|
|
1678
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1635
|
+
// 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/rankings-options.js
|
|
1679
1636
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
1680
1637
|
var AUTHOR_MEASURES = [
|
|
1681
1638
|
"messages",
|
|
@@ -1815,7 +1772,7 @@ var withoutUrls = /* @__PURE__ */ __name((text2) => text2.replace(/\S+/gu, (toke
|
|
|
1815
1772
|
var rankingWords = /* @__PURE__ */ __name((text2) => withoutUrls(text2).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
1816
1773
|
var rankingQuestion = /* @__PURE__ */ __name((text2) => withoutUrls(text2).includes("?"), "rankingQuestion");
|
|
1817
1774
|
|
|
1818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1775
|
+
// 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/records.js
|
|
1819
1776
|
import { createHash } from "node:crypto";
|
|
1820
1777
|
var RECORDS_SCHEMA_VERSION = 1;
|
|
1821
1778
|
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
@@ -1987,7 +1944,7 @@ var fieldReferences = /* @__PURE__ */ __name((record, options = {}) => {
|
|
|
1987
1944
|
return found;
|
|
1988
1945
|
}, "fieldReferences");
|
|
1989
1946
|
|
|
1990
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1947
|
+
// 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/relation-role-labels.js
|
|
1991
1948
|
var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
|
|
1992
1949
|
var ROLE_LABELS = {
|
|
1993
1950
|
organization: {
|
|
@@ -2038,17 +1995,6 @@ export {
|
|
|
2038
1995
|
isMobilePhone,
|
|
2039
1996
|
BARE_INTERNATIONAL_PROVIDERS,
|
|
2040
1997
|
storedPhone,
|
|
2041
|
-
QUERY_VERSION,
|
|
2042
|
-
QUERY_LIMITS2 as QUERY_LIMITS,
|
|
2043
|
-
SEARCH_QUERY,
|
|
2044
|
-
MESSAGE_PARSING,
|
|
2045
|
-
MOST_WORDS_APART,
|
|
2046
|
-
searchError,
|
|
2047
|
-
searchTimeLimit,
|
|
2048
|
-
outOfTime,
|
|
2049
|
-
isQueryLimit,
|
|
2050
|
-
exhausted,
|
|
2051
|
-
tooWideTerm,
|
|
2052
1998
|
compileAutomaton,
|
|
2053
1999
|
wildcardPattern,
|
|
2054
2000
|
foldRegex,
|