@wirecat/mail-cli 0.0.0-stage → 0.1.1

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.
Files changed (198) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/LICENSE +204 -0
  3. package/README.md +166 -2
  4. package/dist/bin/mail.d.ts +3 -0
  5. package/dist/bin/mail.d.ts.map +1 -0
  6. package/dist/bin/mail.js +36 -0
  7. package/dist/bin/mail.js.map +1 -0
  8. package/dist/bundle/all-profiles-TKMBELRZ.js +286 -0
  9. package/dist/bundle/anthropic-7LMUAEIZ.js +72 -0
  10. package/dist/bundle/app-server-JGMIJDD4.js +229 -0
  11. package/dist/bundle/bun-XRO6XJHQ.js +169 -0
  12. package/dist/bundle/bun-sqlite-Z54LEHVM.js +71 -0
  13. package/dist/bundle/chunk-2LLNPNMB.js +24 -0
  14. package/dist/bundle/chunk-3E3WA2L6.js +1932 -0
  15. package/dist/bundle/chunk-3KEVLSNN.js +138 -0
  16. package/dist/bundle/chunk-3KOA73LS.js +3416 -0
  17. package/dist/bundle/chunk-4E7BN3TC.js +122 -0
  18. package/dist/bundle/chunk-4FEMINO2.js +409 -0
  19. package/dist/bundle/chunk-52F5DWS5.js +27 -0
  20. package/dist/bundle/chunk-5BVIWP3S.js +71 -0
  21. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  22. package/dist/bundle/chunk-5NYMNSSO.js +264 -0
  23. package/dist/bundle/chunk-6MAZWSC3.js +132 -0
  24. package/dist/bundle/chunk-75CWWETH.js +379 -0
  25. package/dist/bundle/chunk-7SXGLT6T.js +444 -0
  26. package/dist/bundle/chunk-BTQX2ZSZ.js +288 -0
  27. package/dist/bundle/chunk-CEW6KIFA.js +1193 -0
  28. package/dist/bundle/chunk-CH6RXYAX.js +82 -0
  29. package/dist/bundle/chunk-D72URWJE.js +532 -0
  30. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  31. package/dist/bundle/chunk-EOEDICIE.js +6848 -0
  32. package/dist/bundle/chunk-F6D6PJ34.js +100 -0
  33. package/dist/bundle/chunk-FDCGTODC.js +78 -0
  34. package/dist/bundle/chunk-FZ5FXIG6.js +18 -0
  35. package/dist/bundle/chunk-GAH7N7HO.js +8181 -0
  36. package/dist/bundle/chunk-GK4M2SUP.js +195 -0
  37. package/dist/bundle/chunk-GN62YOT5.js +161 -0
  38. package/dist/bundle/chunk-GQQJOH7A.js +7050 -0
  39. package/dist/bundle/chunk-GWDCKUBI.js +781 -0
  40. package/dist/bundle/chunk-HTQTIKWP.js +928 -0
  41. package/dist/bundle/chunk-IK5TH3O7.js +217 -0
  42. package/dist/bundle/chunk-J3QXTBD2.js +2742 -0
  43. package/dist/bundle/chunk-J6MSJLIW.js +45 -0
  44. package/dist/bundle/chunk-JBBZCTTF.js +76 -0
  45. package/dist/bundle/chunk-JVMVLITS.js +260 -0
  46. package/dist/bundle/chunk-K4FVKPDQ.js +525 -0
  47. package/dist/bundle/chunk-KHTO2Q6E.js +886 -0
  48. package/dist/bundle/chunk-KM7Q67Z3.js +63 -0
  49. package/dist/bundle/chunk-LQ37ALDJ.js +2416 -0
  50. package/dist/bundle/chunk-MNOIRJEO.js +2315 -0
  51. package/dist/bundle/chunk-MS53RALV.js +168 -0
  52. package/dist/bundle/chunk-NK7EB63L.js +36225 -0
  53. package/dist/bundle/chunk-NPGVOZVK.js +2 -0
  54. package/dist/bundle/chunk-OTUOZ33L.js +82 -0
  55. package/dist/bundle/chunk-P7P5MNAU.js +46 -0
  56. package/dist/bundle/chunk-QLEUNU6G.js +537 -0
  57. package/dist/bundle/chunk-QQB7WT7R.js +216 -0
  58. package/dist/bundle/chunk-QX7RCLRS.js +23 -0
  59. package/dist/bundle/chunk-T6464KYA.js +35130 -0
  60. package/dist/bundle/chunk-TE5U5OAM.js +73 -0
  61. package/dist/bundle/chunk-TI6VBZKJ.js +166 -0
  62. package/dist/bundle/chunk-TQFCPUIM.js +53 -0
  63. package/dist/bundle/chunk-TVREDYX4.js +3574 -0
  64. package/dist/bundle/chunk-TWPDVUBR.js +106 -0
  65. package/dist/bundle/chunk-TWTATDM7.js +461 -0
  66. package/dist/bundle/chunk-UH4DDRHA.js +2989 -0
  67. package/dist/bundle/chunk-VEIZZRQ5.js +630 -0
  68. package/dist/bundle/chunk-WLFLBWNH.js +54 -0
  69. package/dist/bundle/chunk-WXAXYJJ7.js +486 -0
  70. package/dist/bundle/chunk-XQUUANA2.js +24600 -0
  71. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  72. package/dist/bundle/chunk-YO4CUH5E.js +33 -0
  73. package/dist/bundle/chunk-YPQQ5J4X.js +849 -0
  74. package/dist/bundle/chunk-Z34ICZA3.js +1028 -0
  75. package/dist/bundle/chunk-ZANYM66S.js +58 -0
  76. package/dist/bundle/chunk-ZD3WUGR2.js +142 -0
  77. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  78. package/dist/bundle/command-contract-WU434ZUL.js +34 -0
  79. package/dist/bundle/decode-YB3ZDTES.js +162 -0
  80. package/dist/bundle/dispatch-EUKKT3PD.js +411 -0
  81. package/dist/bundle/dist-A6GKSKFC.js +2072 -0
  82. package/dist/bundle/dist-HFUVURJG.js +7577 -0
  83. package/dist/bundle/echarts-YNGCOYHW.js +42501 -0
  84. package/dist/bundle/embed-LWNHIRBQ.js +37 -0
  85. package/dist/bundle/embedder-2LYD3U37.js +110 -0
  86. package/dist/bundle/failure-OAIC5VAP.js +24 -0
  87. package/dist/bundle/first-run-N3HJKGU7.js +27 -0
  88. package/dist/bundle/first-screen-4U2DMV3G.js +32 -0
  89. package/dist/bundle/instructions-GJHHFV64.js +11 -0
  90. package/dist/bundle/mail.js +166 -0
  91. package/dist/bundle/mcp-L7SRVDRN.js +167 -0
  92. package/dist/bundle/node-GFOH6FKP.js +176 -0
  93. package/dist/bundle/node-KM3CUABH.js +2340 -0
  94. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  95. package/dist/bundle/node-sqlite-NBXQXBIU.js +63 -0
  96. package/dist/bundle/oauth-56EFO5AQ.js +19 -0
  97. package/dist/bundle/open-2V7QZQJP.js +21 -0
  98. package/dist/bundle/openai-V3SVACVL.js +251 -0
  99. package/dist/bundle/process-XVDX4SPD.js +91 -0
  100. package/dist/bundle/program-JTJB26P3.js +35542 -0
  101. package/dist/bundle/prompt-YKWAI222.js +14 -0
  102. package/dist/bundle/recognize-PAR66KVM.js +25 -0
  103. package/dist/bundle/remote-CE43TKXC.js +28 -0
  104. package/dist/bundle/rerank-M7S7P2TW.js +51 -0
  105. package/dist/bundle/serve-ENPMIV6J.js +197 -0
  106. package/dist/bundle/server-JRTHUCVY.js +63 -0
  107. package/dist/bundle/server-MBEZLVKZ.js +189 -0
  108. package/dist/bundle/sqlite-runtime-HVGDHBJJ.js +18 -0
  109. package/dist/bundle/state-QZSOSKBD.js +35 -0
  110. package/dist/bundle/store-2BUX6LVX.js +124 -0
  111. package/dist/bundle/store-UJ7SNKXI.js +141 -0
  112. package/dist/bundle/store-maintenance-command-I7V5C44K.js +52 -0
  113. package/dist/commands/account.d.ts +3 -0
  114. package/dist/commands/account.d.ts.map +1 -0
  115. package/dist/commands/account.js +47 -0
  116. package/dist/commands/account.js.map +1 -0
  117. package/dist/commands/context.d.ts +41 -0
  118. package/dist/commands/context.d.ts.map +1 -0
  119. package/dist/commands/context.js +52 -0
  120. package/dist/commands/context.js.map +1 -0
  121. package/dist/commands/folders.d.ts +3 -0
  122. package/dist/commands/folders.d.ts.map +1 -0
  123. package/dist/commands/folders.js +36 -0
  124. package/dist/commands/folders.js.map +1 -0
  125. package/dist/commands/login.d.ts +5 -0
  126. package/dist/commands/login.d.ts.map +1 -0
  127. package/dist/commands/login.js +21 -0
  128. package/dist/commands/login.js.map +1 -0
  129. package/dist/commands/mailbox.d.ts +16 -0
  130. package/dist/commands/mailbox.d.ts.map +1 -0
  131. package/dist/commands/mailbox.js +54 -0
  132. package/dist/commands/mailbox.js.map +1 -0
  133. package/dist/commands/session.d.ts +3 -0
  134. package/dist/commands/session.d.ts.map +1 -0
  135. package/dist/commands/session.js +211 -0
  136. package/dist/commands/session.js.map +1 -0
  137. package/dist/commands/status.d.ts +3 -0
  138. package/dist/commands/status.d.ts.map +1 -0
  139. package/dist/commands/status.js +89 -0
  140. package/dist/commands/status.js.map +1 -0
  141. package/dist/commands/sync.d.ts +3 -0
  142. package/dist/commands/sync.d.ts.map +1 -0
  143. package/dist/commands/sync.js +190 -0
  144. package/dist/commands/sync.js.map +1 -0
  145. package/dist/config.d.ts +190 -0
  146. package/dist/config.d.ts.map +1 -0
  147. package/dist/config.js +46 -0
  148. package/dist/config.js.map +1 -0
  149. package/dist/discovery.d.ts +42 -0
  150. package/dist/discovery.d.ts.map +1 -0
  151. package/dist/discovery.js +179 -0
  152. package/dist/discovery.js.map +1 -0
  153. package/dist/identity.d.ts +5 -0
  154. package/dist/identity.d.ts.map +1 -0
  155. package/dist/identity.js +16 -0
  156. package/dist/identity.js.map +1 -0
  157. package/dist/index.d.ts +3 -0
  158. package/dist/index.d.ts.map +1 -0
  159. package/dist/index.js +3 -0
  160. package/dist/index.js.map +1 -0
  161. package/dist/mail/imap-errors.d.ts +4 -0
  162. package/dist/mail/imap-errors.d.ts.map +1 -0
  163. package/dist/mail/imap-errors.js +41 -0
  164. package/dist/mail/imap-errors.js.map +1 -0
  165. package/dist/mail/imap-messages.d.ts +18 -0
  166. package/dist/mail/imap-messages.d.ts.map +1 -0
  167. package/dist/mail/imap-messages.js +66 -0
  168. package/dist/mail/imap-messages.js.map +1 -0
  169. package/dist/mail/imap.d.ts +67 -0
  170. package/dist/mail/imap.d.ts.map +1 -0
  171. package/dist/mail/imap.js +348 -0
  172. package/dist/mail/imap.js.map +1 -0
  173. package/dist/profile.d.ts +16 -0
  174. package/dist/profile.d.ts.map +1 -0
  175. package/dist/profile.js +31 -0
  176. package/dist/profile.js.map +1 -0
  177. package/dist/program.d.ts +6 -0
  178. package/dist/program.d.ts.map +1 -0
  179. package/dist/program.js +52 -0
  180. package/dist/program.js.map +1 -0
  181. package/dist/providers.d.ts +53 -0
  182. package/dist/providers.d.ts.map +1 -0
  183. package/dist/providers.js +106 -0
  184. package/dist/providers.js.map +1 -0
  185. package/dist/secret.d.ts +30 -0
  186. package/dist/secret.d.ts.map +1 -0
  187. package/dist/secret.js +68 -0
  188. package/dist/secret.js.map +1 -0
  189. package/dist/store.d.ts +12 -0
  190. package/dist/store.d.ts.map +1 -0
  191. package/dist/store.js +25 -0
  192. package/dist/store.js.map +1 -0
  193. package/dist/version.d.ts +2 -0
  194. package/dist/version.d.ts.map +1 -0
  195. package/dist/version.js +2 -0
  196. package/dist/version.js.map +1 -0
  197. package/package.json +83 -4
  198. 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,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
+ };