@wirecat/mail-cli 0.0.0-stage → 0.1.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 +50 -0
- package/LICENSE +204 -0
- package/README.md +141 -2
- package/dist/bin/mail.d.ts +3 -0
- package/dist/bin/mail.d.ts.map +1 -0
- package/dist/bin/mail.js +36 -0
- package/dist/bin/mail.js.map +1 -0
- package/dist/bundle/all-profiles-TKMBELRZ.js +286 -0
- package/dist/bundle/anthropic-7LMUAEIZ.js +72 -0
- package/dist/bundle/app-server-JGMIJDD4.js +229 -0
- package/dist/bundle/bun-XRO6XJHQ.js +169 -0
- package/dist/bundle/bun-sqlite-Z54LEHVM.js +71 -0
- package/dist/bundle/chunk-2LLNPNMB.js +24 -0
- package/dist/bundle/chunk-3E3WA2L6.js +1932 -0
- package/dist/bundle/chunk-3KEVLSNN.js +138 -0
- package/dist/bundle/chunk-3KOA73LS.js +3416 -0
- package/dist/bundle/chunk-4E7BN3TC.js +122 -0
- package/dist/bundle/chunk-4FEMINO2.js +409 -0
- package/dist/bundle/chunk-5BVIWP3S.js +71 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-5NYMNSSO.js +264 -0
- package/dist/bundle/chunk-5WGEUDE4.js +27 -0
- package/dist/bundle/chunk-6MAZWSC3.js +132 -0
- package/dist/bundle/chunk-75CWWETH.js +379 -0
- package/dist/bundle/chunk-7SXGLT6T.js +444 -0
- package/dist/bundle/chunk-BTQX2ZSZ.js +288 -0
- package/dist/bundle/chunk-CEW6KIFA.js +1193 -0
- package/dist/bundle/chunk-CH6RXYAX.js +82 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-EOEDICIE.js +6848 -0
- package/dist/bundle/chunk-F6D6PJ34.js +100 -0
- package/dist/bundle/chunk-FDCGTODC.js +78 -0
- package/dist/bundle/chunk-FZ5FXIG6.js +18 -0
- package/dist/bundle/chunk-GAH7N7HO.js +8181 -0
- package/dist/bundle/chunk-GK4M2SUP.js +195 -0
- package/dist/bundle/chunk-GN62YOT5.js +161 -0
- package/dist/bundle/chunk-GQQJOH7A.js +7050 -0
- package/dist/bundle/chunk-GWDCKUBI.js +781 -0
- package/dist/bundle/chunk-HTQTIKWP.js +928 -0
- package/dist/bundle/chunk-IK5TH3O7.js +217 -0
- package/dist/bundle/chunk-J3QXTBD2.js +2742 -0
- package/dist/bundle/chunk-J6MSJLIW.js +45 -0
- package/dist/bundle/chunk-JBBZCTTF.js +76 -0
- package/dist/bundle/chunk-JVMVLITS.js +260 -0
- package/dist/bundle/chunk-K4FVKPDQ.js +525 -0
- package/dist/bundle/chunk-KHTO2Q6E.js +886 -0
- package/dist/bundle/chunk-KM7Q67Z3.js +63 -0
- package/dist/bundle/chunk-LQ37ALDJ.js +2416 -0
- package/dist/bundle/chunk-MNOIRJEO.js +2315 -0
- package/dist/bundle/chunk-MS53RALV.js +168 -0
- package/dist/bundle/chunk-NK7EB63L.js +36225 -0
- package/dist/bundle/chunk-NPGVOZVK.js +2 -0
- package/dist/bundle/chunk-OTUOZ33L.js +82 -0
- package/dist/bundle/chunk-P7P5MNAU.js +46 -0
- package/dist/bundle/chunk-QLEUNU6G.js +537 -0
- package/dist/bundle/chunk-QQB7WT7R.js +216 -0
- package/dist/bundle/chunk-QX7RCLRS.js +23 -0
- package/dist/bundle/chunk-T6464KYA.js +35130 -0
- package/dist/bundle/chunk-TE5U5OAM.js +73 -0
- package/dist/bundle/chunk-TI6VBZKJ.js +166 -0
- package/dist/bundle/chunk-TQFCPUIM.js +53 -0
- package/dist/bundle/chunk-TVREDYX4.js +3574 -0
- package/dist/bundle/chunk-TWPDVUBR.js +106 -0
- package/dist/bundle/chunk-TWTATDM7.js +461 -0
- package/dist/bundle/chunk-UH4DDRHA.js +2989 -0
- package/dist/bundle/chunk-VEIZZRQ5.js +630 -0
- package/dist/bundle/chunk-WLFLBWNH.js +54 -0
- package/dist/bundle/chunk-WXAXYJJ7.js +486 -0
- package/dist/bundle/chunk-XQUUANA2.js +24600 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-YO4CUH5E.js +33 -0
- package/dist/bundle/chunk-YPQQ5J4X.js +849 -0
- package/dist/bundle/chunk-Z34ICZA3.js +1028 -0
- package/dist/bundle/chunk-ZANYM66S.js +58 -0
- package/dist/bundle/chunk-ZD3WUGR2.js +142 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-WU434ZUL.js +34 -0
- package/dist/bundle/decode-YB3ZDTES.js +162 -0
- package/dist/bundle/dispatch-EUKKT3PD.js +411 -0
- package/dist/bundle/dist-A6GKSKFC.js +2072 -0
- package/dist/bundle/dist-X36THCOF.js +7577 -0
- package/dist/bundle/echarts-YNGCOYHW.js +42501 -0
- package/dist/bundle/embed-LWNHIRBQ.js +37 -0
- package/dist/bundle/embedder-2LYD3U37.js +110 -0
- package/dist/bundle/failure-OAIC5VAP.js +24 -0
- package/dist/bundle/first-run-N3HJKGU7.js +27 -0
- package/dist/bundle/first-screen-4U2DMV3G.js +32 -0
- package/dist/bundle/instructions-GJHHFV64.js +11 -0
- package/dist/bundle/mail.js +166 -0
- package/dist/bundle/mcp-L7SRVDRN.js +167 -0
- package/dist/bundle/node-GFOH6FKP.js +176 -0
- package/dist/bundle/node-KM3CUABH.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-NBXQXBIU.js +63 -0
- package/dist/bundle/oauth-56EFO5AQ.js +19 -0
- package/dist/bundle/open-2V7QZQJP.js +21 -0
- package/dist/bundle/openai-V3SVACVL.js +251 -0
- package/dist/bundle/process-XVDX4SPD.js +91 -0
- package/dist/bundle/program-ILID6EAT.js +35542 -0
- package/dist/bundle/prompt-YKWAI222.js +14 -0
- package/dist/bundle/recognize-PAR66KVM.js +25 -0
- package/dist/bundle/remote-CE43TKXC.js +28 -0
- package/dist/bundle/rerank-M7S7P2TW.js +51 -0
- package/dist/bundle/serve-ENPMIV6J.js +197 -0
- package/dist/bundle/server-JRTHUCVY.js +63 -0
- package/dist/bundle/server-MBEZLVKZ.js +189 -0
- package/dist/bundle/sqlite-runtime-HVGDHBJJ.js +18 -0
- package/dist/bundle/state-QZSOSKBD.js +35 -0
- package/dist/bundle/store-2BUX6LVX.js +124 -0
- package/dist/bundle/store-UJ7SNKXI.js +141 -0
- package/dist/bundle/store-maintenance-command-I7V5C44K.js +52 -0
- package/dist/commands/account.d.ts +3 -0
- package/dist/commands/account.d.ts.map +1 -0
- package/dist/commands/account.js +47 -0
- package/dist/commands/account.js.map +1 -0
- package/dist/commands/context.d.ts +41 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +52 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/doctor.d.ts +77 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +74 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/folders.d.ts +3 -0
- package/dist/commands/folders.d.ts.map +1 -0
- package/dist/commands/folders.js +36 -0
- package/dist/commands/folders.js.map +1 -0
- package/dist/commands/login.d.ts +5 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +21 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/mailbox.d.ts +16 -0
- package/dist/commands/mailbox.d.ts.map +1 -0
- package/dist/commands/mailbox.js +54 -0
- package/dist/commands/mailbox.js.map +1 -0
- package/dist/commands/mcp.d.ts +3 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +97 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/session.d.ts +3 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +211 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/setup.d.ts +3 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +156 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +89 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts +3 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +190 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/config.d.ts +190 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +46 -0
- package/dist/config.js.map +1 -0
- package/dist/discovery.d.ts +42 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +179 -0
- package/dist/discovery.js.map +1 -0
- package/dist/identity.d.ts +5 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +16 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/mail/imap-errors.d.ts +4 -0
- package/dist/mail/imap-errors.d.ts.map +1 -0
- package/dist/mail/imap-errors.js +41 -0
- package/dist/mail/imap-errors.js.map +1 -0
- package/dist/mail/imap-messages.d.ts +18 -0
- package/dist/mail/imap-messages.d.ts.map +1 -0
- package/dist/mail/imap-messages.js +66 -0
- package/dist/mail/imap-messages.js.map +1 -0
- package/dist/mail/imap.d.ts +67 -0
- package/dist/mail/imap.d.ts.map +1 -0
- package/dist/mail/imap.js +348 -0
- package/dist/mail/imap.js.map +1 -0
- package/dist/mail/parse.d.ts +18 -0
- package/dist/mail/parse.d.ts.map +1 -0
- package/dist/mail/parse.js +31 -0
- package/dist/mail/parse.js.map +1 -0
- package/dist/mail/port.d.ts +50 -0
- package/dist/mail/port.d.ts.map +1 -0
- package/dist/mail/port.js +4 -0
- package/dist/mail/port.js.map +1 -0
- package/dist/mcp.d.ts +29 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +98 -0
- package/dist/mcp.js.map +1 -0
- package/dist/profile.d.ts +16 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +31 -0
- package/dist/profile.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +52 -0
- package/dist/program.js.map +1 -0
- package/dist/providers.d.ts +53 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/providers.js +106 -0
- package/dist/providers.js.map +1 -0
- package/dist/secret.d.ts +30 -0
- package/dist/secret.d.ts.map +1 -0
- package/dist/secret.js +68 -0
- package/dist/secret.js.map +1 -0
- package/dist/store.d.ts +12 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +25 -0
- package/dist/store.js.map +1 -0
- package/dist/sync.d.ts +26 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +75 -0
- package/dist/sync.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/package.json +83 -4
- package/skills/mail-cli/SKILL.md +27 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
wirecatDirectory
|
|
5
|
+
} from "./chunk-FZ5FXIG6.js";
|
|
6
|
+
import {
|
|
7
|
+
CliError
|
|
8
|
+
} from "./chunk-5BVIWP3S.js";
|
|
9
|
+
import {
|
|
10
|
+
__name
|
|
11
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
12
|
+
|
|
13
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/speech/models.js
|
|
14
|
+
var huggingFace = /* @__PURE__ */ __name((repository, commit) => (name) => `https://huggingface.co/csukuangfj/${repository}/resolve/${commit}/${name}`, "huggingFace");
|
|
15
|
+
var gigaam = huggingFace("sherpa-onnx-nemo-transducer-punct-giga-am-v3-russian-2025-12-16", "a6039be7cee829a9044a69ac0ebaf1c191217c97");
|
|
16
|
+
var gigaamCtc = huggingFace("sherpa-onnx-nemo-ctc-punct-giga-am-v3-russian-2025-12-16", "4fb5407ff028a69fec516cdf4c10fac9ddea7c16");
|
|
17
|
+
var parakeet = huggingFace("sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8", "2bda32ec70b097a55adaa07d9a7173915b43cc78");
|
|
18
|
+
var MODELS = [
|
|
19
|
+
{
|
|
20
|
+
id: "gigaam-v3",
|
|
21
|
+
title: "GigaAM v3, with punctuation",
|
|
22
|
+
languages: "Russian \u2014 the best of the three for Russian",
|
|
23
|
+
featureDim: 64,
|
|
24
|
+
files: [
|
|
25
|
+
{
|
|
26
|
+
name: "encoder.int8.onnx",
|
|
27
|
+
url: gigaam("encoder.int8.onnx"),
|
|
28
|
+
sha256: "369f35a71bf288d3b8e0391fabd8dba5f2314088d440bca474056b7b4b6e66bf",
|
|
29
|
+
bytes: 224570820
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "decoder.onnx",
|
|
33
|
+
url: gigaam("decoder.onnx"),
|
|
34
|
+
sha256: "38fc7475443ea2a26f63211ca350f73ac50fff824ab7a3876ee2bd610c53bbc4",
|
|
35
|
+
bytes: 4600132
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "joiner.onnx",
|
|
39
|
+
url: gigaam("joiner.onnx"),
|
|
40
|
+
sha256: "602ff7017a93311aad34df1437c8d7f49911353c13d6eae7a6ee7b041339465c",
|
|
41
|
+
bytes: 2712896
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "tokens.txt",
|
|
45
|
+
url: gigaam("tokens.txt"),
|
|
46
|
+
sha256: "39abae20e692998290c574e606f11a9edef2902a1995463fcff63d1490cf22b7",
|
|
47
|
+
bytes: 13354
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
config: /* @__PURE__ */ __name((path) => ({
|
|
51
|
+
transducer: { encoder: path("encoder.int8.onnx"), decoder: path("decoder.onnx"), joiner: path("joiner.onnx") },
|
|
52
|
+
tokens: path("tokens.txt"),
|
|
53
|
+
modelType: "nemo_transducer"
|
|
54
|
+
}), "config")
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "gigaam-v3-ctc",
|
|
58
|
+
title: "GigaAM v3 CTC, with punctuation \u2014 a little faster",
|
|
59
|
+
languages: "Russian \u2014 a little faster, rougher with capital letters",
|
|
60
|
+
featureDim: 64,
|
|
61
|
+
files: [
|
|
62
|
+
{
|
|
63
|
+
name: "model.int8.onnx",
|
|
64
|
+
url: gigaamCtc("model.int8.onnx"),
|
|
65
|
+
sha256: "d5fea8df94263c285e54b21e5774b707c707192d3bdbeffd7b1eb07fb6743b35",
|
|
66
|
+
bytes: 224893661
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "tokens.txt",
|
|
70
|
+
url: gigaamCtc("tokens.txt"),
|
|
71
|
+
sha256: "142de7570b3de5b3035ce111a89c228e80e6085273731d944093ddf24fa539cd",
|
|
72
|
+
bytes: 2007
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
config: /* @__PURE__ */ __name((path) => ({ nemoCtc: { model: path("model.int8.onnx") }, tokens: path("tokens.txt") }), "config")
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: "parakeet-v3",
|
|
79
|
+
title: "NVIDIA Parakeet TDT 0.6B v3",
|
|
80
|
+
/** The model card's list: huggingface.co/nvidia/parakeet-tdt-0.6b-v3, read 2026-09-24. */
|
|
81
|
+
languages: "25: bg cs da de el en es et fi fr hr hu it lt lv mt nl pl pt ro ru sk sl sv uk",
|
|
82
|
+
featureDim: 80,
|
|
83
|
+
files: [
|
|
84
|
+
{
|
|
85
|
+
name: "encoder.int8.onnx",
|
|
86
|
+
url: parakeet("encoder.int8.onnx"),
|
|
87
|
+
sha256: "acfc2b4456377e15d04f0243af540b7fe7c992f8d898d751cf134c3a55fd2247",
|
|
88
|
+
bytes: 652184281
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "decoder.int8.onnx",
|
|
92
|
+
url: parakeet("decoder.int8.onnx"),
|
|
93
|
+
sha256: "179e50c43d1a9de79c8a24149a2f9bac6eb5981823f2a2ed88d655b24248db4e",
|
|
94
|
+
bytes: 11845275
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "joiner.int8.onnx",
|
|
98
|
+
url: parakeet("joiner.int8.onnx"),
|
|
99
|
+
sha256: "3164c13fc2821009440d20fcb5fdc78bff28b4db2f8d0f0b329101719c0948b3",
|
|
100
|
+
bytes: 6355277
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "tokens.txt",
|
|
104
|
+
url: parakeet("tokens.txt"),
|
|
105
|
+
sha256: "d58544679ea4bc6ac563d1f545eb7d474bd6cfa467f0a6e2c1dc1c7d37e3c35d",
|
|
106
|
+
bytes: 93939
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
config: /* @__PURE__ */ __name((path) => ({
|
|
110
|
+
transducer: {
|
|
111
|
+
encoder: path("encoder.int8.onnx"),
|
|
112
|
+
decoder: path("decoder.int8.onnx"),
|
|
113
|
+
joiner: path("joiner.int8.onnx")
|
|
114
|
+
},
|
|
115
|
+
tokens: path("tokens.txt"),
|
|
116
|
+
modelType: "nemo_transducer"
|
|
117
|
+
}), "config")
|
|
118
|
+
}
|
|
119
|
+
];
|
|
120
|
+
var OPENAI_TRANSCRIBE_MODEL = "gpt-transcribe";
|
|
121
|
+
var VAD = {
|
|
122
|
+
name: "silero_vad.onnx",
|
|
123
|
+
url: "https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx",
|
|
124
|
+
sha256: "9e2449e1087496d8d4caba907f23e0bd3f78d91fa552479bb9c23ac09cbb1fd6",
|
|
125
|
+
bytes: 643854
|
|
126
|
+
};
|
|
127
|
+
var DEFAULT_ORDER = ["parakeet-v3", "gigaam-v3", "gigaam-v3-ctc"];
|
|
128
|
+
var orderedModels = /* @__PURE__ */ __name((order = DEFAULT_ORDER) => [.../* @__PURE__ */ new Set([...order, ...DEFAULT_ORDER])].map(speechModel), "orderedModels");
|
|
129
|
+
var findModel = /* @__PURE__ */ __name((id) => MODELS.find((model) => model.id === id), "findModel");
|
|
130
|
+
var speechModel = /* @__PURE__ */ __name((id) => {
|
|
131
|
+
const model = findModel(id);
|
|
132
|
+
if (!model) {
|
|
133
|
+
throw new CliError("validation_error", `no speech model "${id}" \u2014 one of ${MODELS.map((known) => known.id).join(", ")}`);
|
|
134
|
+
}
|
|
135
|
+
return model;
|
|
136
|
+
}, "speechModel");
|
|
137
|
+
|
|
138
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/speech/install.js
|
|
139
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
140
|
+
import { createReadStream, createWriteStream, mkdirSync, statSync } from "node:fs";
|
|
141
|
+
import { rename, rm } from "node:fs/promises";
|
|
142
|
+
import { dirname, join } from "node:path";
|
|
143
|
+
import { Readable, Transform } from "node:stream";
|
|
144
|
+
import { pipeline } from "node:stream/promises";
|
|
145
|
+
var sharedModelsDirectory = /* @__PURE__ */ __name((kind, env = process.env) => join(wirecatDirectory(env), "models", kind), "sharedModelsDirectory");
|
|
146
|
+
var modelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedModelsDirectory("audio", env), "modelsDirectory");
|
|
147
|
+
var STALL_MS = 6e4;
|
|
148
|
+
var watchdog = /* @__PURE__ */ __name((ms) => {
|
|
149
|
+
const controller = new AbortController();
|
|
150
|
+
let timer = setTimeout(() => controller.abort(), ms);
|
|
151
|
+
return {
|
|
152
|
+
signal: controller.signal,
|
|
153
|
+
poke: /* @__PURE__ */ __name(() => {
|
|
154
|
+
clearTimeout(timer);
|
|
155
|
+
timer = setTimeout(() => controller.abort(), ms);
|
|
156
|
+
}, "poke"),
|
|
157
|
+
stop: /* @__PURE__ */ __name(() => clearTimeout(timer), "stop")
|
|
158
|
+
};
|
|
159
|
+
}, "watchdog");
|
|
160
|
+
var modelPath = /* @__PURE__ */ __name((directory, model) => (name) => join(directory, model.id, name), "modelPath");
|
|
161
|
+
var vadPath = /* @__PURE__ */ __name((directory) => join(directory, VAD.name), "vadPath");
|
|
162
|
+
var placed = /* @__PURE__ */ __name((model, directory) => [
|
|
163
|
+
...model.files.map((file) => [file, modelPath(directory, model)(file.name)]),
|
|
164
|
+
[VAD, vadPath(directory)]
|
|
165
|
+
], "placed");
|
|
166
|
+
var isInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placed(model, directory)), "isInstalled");
|
|
167
|
+
var filesPresent = /* @__PURE__ */ __name((files) => files.every(([file, path]) => sizeOf(path) === file.bytes), "filesPresent");
|
|
168
|
+
var sizeOf = /* @__PURE__ */ __name((path) => {
|
|
169
|
+
try {
|
|
170
|
+
return statSync(path).size;
|
|
171
|
+
} catch {
|
|
172
|
+
return void 0;
|
|
173
|
+
}
|
|
174
|
+
}, "sizeOf");
|
|
175
|
+
var installedBytes = /* @__PURE__ */ __name((model) => model.files.reduce((sum, file) => sum + file.bytes, 0), "installedBytes");
|
|
176
|
+
var install = /* @__PURE__ */ __name(async (model, directory, { fetch: get = fetch, progress, verifyExisting } = {}) => {
|
|
177
|
+
mkdirSync(join(directory, model.id), { recursive: true, mode: 448 });
|
|
178
|
+
await installFiles(placed(model, directory), { fetch: get, progress, verifyExisting });
|
|
179
|
+
}, "install");
|
|
180
|
+
var installFiles = /* @__PURE__ */ __name(async (files, { fetch: get = fetch, progress, verifyExisting } = {}) => {
|
|
181
|
+
if (verifyExisting)
|
|
182
|
+
for (const [file, path] of files) {
|
|
183
|
+
if (sizeOf(path) !== void 0) {
|
|
184
|
+
const hash = createHash("sha256");
|
|
185
|
+
for await (const chunk of createReadStream(path))
|
|
186
|
+
hash.update(chunk);
|
|
187
|
+
if (hash.digest("hex") !== file.sha256) {
|
|
188
|
+
progress?.(`${path}: not the file this version expects, downloading it again`);
|
|
189
|
+
await rm(path, { force: true });
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
for (const [file, path] of files) {
|
|
194
|
+
if (sizeOf(path) === file.bytes)
|
|
195
|
+
continue;
|
|
196
|
+
mkdirSync(dirname(path), { recursive: true, mode: 448 });
|
|
197
|
+
progress?.(`downloading ${file.name} (${megabytes(file.bytes)})`);
|
|
198
|
+
await fetchVerified(file, path, get);
|
|
199
|
+
}
|
|
200
|
+
}, "installFiles");
|
|
201
|
+
var fetchVerified = /* @__PURE__ */ __name(async (file, path, get) => {
|
|
202
|
+
const stalled = watchdog(STALL_MS);
|
|
203
|
+
try {
|
|
204
|
+
await fetchInto(file, path, get, stalled);
|
|
205
|
+
} catch (error) {
|
|
206
|
+
if (stalled.signal.aborted) {
|
|
207
|
+
throw new CliError("timeout", `${file.name} stopped downloading for ${STALL_MS / 1e3} s \u2014 nothing was installed`);
|
|
208
|
+
}
|
|
209
|
+
throw error;
|
|
210
|
+
} finally {
|
|
211
|
+
stalled.stop();
|
|
212
|
+
}
|
|
213
|
+
}, "fetchVerified");
|
|
214
|
+
var fetchInto = /* @__PURE__ */ __name(async (file, path, get, stalled) => {
|
|
215
|
+
const response = await get(file.url, { signal: stalled.signal });
|
|
216
|
+
if (!response.ok || !response.body) {
|
|
217
|
+
await response.body?.cancel();
|
|
218
|
+
throw new CliError("network_error", `${file.name} could not be downloaded: HTTP ${response.status}`);
|
|
219
|
+
}
|
|
220
|
+
const partial = `${path}.${randomUUID()}.part`;
|
|
221
|
+
const hash = createHash("sha256");
|
|
222
|
+
let bytes = 0;
|
|
223
|
+
const hashing = new Transform({
|
|
224
|
+
transform(chunk, _encoding, done) {
|
|
225
|
+
stalled.poke();
|
|
226
|
+
bytes += chunk.length;
|
|
227
|
+
if (bytes > file.bytes) {
|
|
228
|
+
done(new CliError("invalid_response", `${file.name} is larger than this version expects \u2014 nothing was installed`));
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
hash.update(chunk);
|
|
232
|
+
done(null, chunk);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
try {
|
|
236
|
+
await pipeline(Readable.fromWeb(response.body), hashing, createWriteStream(partial, { flags: "wx", mode: 384 }));
|
|
237
|
+
const actual = hash.digest("hex");
|
|
238
|
+
if (actual !== file.sha256) {
|
|
239
|
+
throw new CliError("invalid_response", `${file.name} is not the file this version expects (sha256 ${actual}) \u2014 nothing was installed`);
|
|
240
|
+
}
|
|
241
|
+
await rename(partial, path);
|
|
242
|
+
} finally {
|
|
243
|
+
await rm(partial, { force: true });
|
|
244
|
+
}
|
|
245
|
+
}, "fetchInto");
|
|
246
|
+
var megabytes = /* @__PURE__ */ __name((bytes) => bytes < 1e6 ? "under 1 MB" : `${Math.round(bytes / 1e6)} MB`, "megabytes");
|
|
247
|
+
|
|
248
|
+
export {
|
|
249
|
+
OPENAI_TRANSCRIBE_MODEL,
|
|
250
|
+
VAD,
|
|
251
|
+
DEFAULT_ORDER,
|
|
252
|
+
orderedModels,
|
|
253
|
+
speechModel,
|
|
254
|
+
sharedModelsDirectory,
|
|
255
|
+
modelsDirectory,
|
|
256
|
+
modelPath,
|
|
257
|
+
vadPath,
|
|
258
|
+
isInstalled,
|
|
259
|
+
filesPresent,
|
|
260
|
+
installedBytes,
|
|
261
|
+
install,
|
|
262
|
+
installFiles,
|
|
263
|
+
megabytes
|
|
264
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// dist/version.js
|
|
5
|
+
var VERSION = "0.1.0";
|
|
6
|
+
|
|
7
|
+
// dist/identity.js
|
|
8
|
+
var PACKAGE = "@wirecat/mail-cli";
|
|
9
|
+
var IDENTITY = {
|
|
10
|
+
command: "mail",
|
|
11
|
+
appName: "mail-cli",
|
|
12
|
+
envPrefix: "MAIL",
|
|
13
|
+
description: "read mail over IMAP into the shared store, with app passwords kept in the OS keyring",
|
|
14
|
+
version: VERSION,
|
|
15
|
+
issues: "https://github.com/WireCatLabs/mail-cli/issues/new",
|
|
16
|
+
messenger: false,
|
|
17
|
+
// One call to the source reads 60 messages on 4 connections: 5 to 12 s on Yandex 360 (cli-testing, performance/mail).
|
|
18
|
+
requestMs: 9e3,
|
|
19
|
+
contentLanguages: ["ru", "en"]
|
|
20
|
+
};
|
|
21
|
+
var SKILL = new URL("../skills/mail-cli/SKILL.md", new URL("../identity.js", import.meta.url).href);
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
PACKAGE,
|
|
25
|
+
IDENTITY,
|
|
26
|
+
SKILL
|
|
27
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
array,
|
|
5
|
+
boolean,
|
|
6
|
+
integer,
|
|
7
|
+
isoTime,
|
|
8
|
+
isoTimestamp,
|
|
9
|
+
minLength,
|
|
10
|
+
minValue,
|
|
11
|
+
nullable,
|
|
12
|
+
number,
|
|
13
|
+
optional,
|
|
14
|
+
picklist,
|
|
15
|
+
pipe,
|
|
16
|
+
record,
|
|
17
|
+
reference,
|
|
18
|
+
strictObject,
|
|
19
|
+
string,
|
|
20
|
+
unknown
|
|
21
|
+
} from "./chunk-LQ37ALDJ.js";
|
|
22
|
+
|
|
23
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/entities/fields.js
|
|
24
|
+
var text = string();
|
|
25
|
+
var id = pipe(string(), minLength(1));
|
|
26
|
+
var time = isoTime;
|
|
27
|
+
var zonedTime = pipe(string(), isoTimestamp("an ISO 8601 time with a zone"));
|
|
28
|
+
var count = pipe(number(), integer(), minValue(0));
|
|
29
|
+
var untrusted = optional(array(text));
|
|
30
|
+
var providerMetadata = optional(record(string(), unknown()));
|
|
31
|
+
var evidenceSource = strictObject({
|
|
32
|
+
ref: nullable(reference),
|
|
33
|
+
kind: text,
|
|
34
|
+
title: nullable(text),
|
|
35
|
+
sender: nullable(text),
|
|
36
|
+
at: nullable(time),
|
|
37
|
+
excerpt: nullable(text),
|
|
38
|
+
tool: nullable(text),
|
|
39
|
+
missing: boolean()
|
|
40
|
+
});
|
|
41
|
+
var author = strictObject({
|
|
42
|
+
type: picklist(["person", "bot"]),
|
|
43
|
+
id,
|
|
44
|
+
name: nullable(text)
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
|
|
48
|
+
var organization = strictObject({
|
|
49
|
+
id,
|
|
50
|
+
ref: reference,
|
|
51
|
+
kind: picklist(["company", "team", "family", "community"]),
|
|
52
|
+
name: text,
|
|
53
|
+
scope: picklist(["personal", "work"]),
|
|
54
|
+
created_at: time
|
|
55
|
+
});
|
|
56
|
+
var project = strictObject({
|
|
57
|
+
id,
|
|
58
|
+
ref: reference,
|
|
59
|
+
key: text,
|
|
60
|
+
name: text,
|
|
61
|
+
kind: picklist(["project", "inbox"]),
|
|
62
|
+
type: picklist(["work", "client", "personal", "oss", "other"]),
|
|
63
|
+
organization_id: nullable(id),
|
|
64
|
+
scope: picklist(["personal", "work"]),
|
|
65
|
+
created_at: time
|
|
66
|
+
});
|
|
67
|
+
var reminder = strictObject({
|
|
68
|
+
id,
|
|
69
|
+
task: text,
|
|
70
|
+
due_at: time,
|
|
71
|
+
timezone: text,
|
|
72
|
+
state: picklist(["pending", "leased", "delivered", "cancelled"]),
|
|
73
|
+
revision: number(),
|
|
74
|
+
receipt: nullable(text)
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/entities/note.js
|
|
78
|
+
var link = {
|
|
79
|
+
target_text: nullable(text),
|
|
80
|
+
kind: text,
|
|
81
|
+
anchor: nullable(text)
|
|
82
|
+
};
|
|
83
|
+
var note = strictObject({
|
|
84
|
+
ref: reference,
|
|
85
|
+
kind: optional(picklist(["note", "document"])),
|
|
86
|
+
provider: optional(text),
|
|
87
|
+
account: optional(text),
|
|
88
|
+
url: optional(text),
|
|
89
|
+
id,
|
|
90
|
+
source: picklist(["file", "internal"]),
|
|
91
|
+
folder_id: nullable(id),
|
|
92
|
+
path: nullable(text),
|
|
93
|
+
title: nullable(text),
|
|
94
|
+
text,
|
|
95
|
+
/** Raises on every edit; `notes edit --revision` takes it, so an edit made meanwhile is refused, not lost. */
|
|
96
|
+
revision: count,
|
|
97
|
+
/** A file's front matter as parsed, keys as the file writes them; null for a note without it. */
|
|
98
|
+
front_matter: nullable(record(string(), unknown())),
|
|
99
|
+
/** The hash of a file's bytes when last imported; null for a note written here. */
|
|
100
|
+
content_hash: nullable(text),
|
|
101
|
+
/** The file the note was exported to, where that is known; null otherwise. */
|
|
102
|
+
export_path: nullable(text),
|
|
103
|
+
created_at: time,
|
|
104
|
+
/** When the store's copy last changed. */
|
|
105
|
+
updated_at: time,
|
|
106
|
+
deleted_at: optional(nullable(time)),
|
|
107
|
+
tags: optional(array(text)),
|
|
108
|
+
/** The first line holding a word of a search. */
|
|
109
|
+
excerpt: optional(text),
|
|
110
|
+
/** Which halves of a search found it. */
|
|
111
|
+
found_by: optional(array(picklist(["title", "words", "meaning"]))),
|
|
112
|
+
/** What the note links to; `to` is null while the name written matches nothing stored. */
|
|
113
|
+
links: optional(array(strictObject({ to: nullable(reference), ...link }))),
|
|
114
|
+
/** The notes and messages that link to it. */
|
|
115
|
+
backlinks: optional(array(strictObject({ from: reference, ...link })))
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export {
|
|
119
|
+
text,
|
|
120
|
+
id,
|
|
121
|
+
time,
|
|
122
|
+
zonedTime,
|
|
123
|
+
count,
|
|
124
|
+
untrusted,
|
|
125
|
+
providerMetadata,
|
|
126
|
+
evidenceSource,
|
|
127
|
+
author,
|
|
128
|
+
organization,
|
|
129
|
+
project,
|
|
130
|
+
reminder,
|
|
131
|
+
note
|
|
132
|
+
};
|