@wirecat/tg-cli 0.106.0 → 0.108.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.
Files changed (89) hide show
  1. package/dist/bin/tg.js +2 -2
  2. package/dist/bundle/{adapter-TIGHDHUK.js → adapter-YFWRJWL5.js} +37 -37
  3. package/dist/bundle/{all-profiles-N4DLSGWY.js → all-profiles-GQIZSF4W.js} +5 -5
  4. package/dist/bundle/{anthropic-D2T2QRLR.js → anthropic-BKWEDKPU.js} +3 -3
  5. package/dist/bundle/{app-server-FZTDNSPB.js → app-server-RJV7ICLH.js} +34 -34
  6. package/dist/bundle/{bot-api-OMUV6EIK.js → bot-api-2PAH2JZ3.js} +38 -38
  7. package/dist/bundle/{bot-history-P2MWYLXW.js → bot-history-DPPZ43F4.js} +10 -10
  8. package/dist/bundle/{bun-UA5PRMLC.js → bun-Q7COX3Z5.js} +2 -2
  9. package/dist/bundle/{bun-sqlite-XVRVJ7A2.js → bun-sqlite-YI4AYZXO.js} +2 -2
  10. package/dist/bundle/{chunk-ELQ5ORY2.js → chunk-26PWIQPP.js} +195 -195
  11. package/dist/bundle/{chunk-R2F6U4F3.js → chunk-3562DVQ7.js} +7 -7
  12. package/dist/bundle/{chunk-QWTHUKS4.js → chunk-3GXKJKIC.js} +4 -4
  13. package/dist/bundle/{chunk-XX37LKXG.js → chunk-3HYDKCXB.js} +4 -4
  14. package/dist/bundle/{chunk-ID6TO5P5.js → chunk-4RDMNNVO.js} +14 -9
  15. package/dist/bundle/{chunk-XXLAGQDN.js → chunk-5HPXENE5.js} +1 -1
  16. package/dist/bundle/{chunk-T3ZLOMWW.js → chunk-5P27JGGA.js} +4 -4
  17. package/dist/bundle/{chunk-WLGQTYIO.js → chunk-6MZ2ZBX4.js} +2 -2
  18. package/dist/bundle/{chunk-DC7O7TVJ.js → chunk-6QTUYMGX.js} +1 -1
  19. package/dist/bundle/{chunk-JOSUY2NX.js → chunk-76OSISA3.js} +1 -1
  20. package/dist/bundle/{chunk-LSP2NCNL.js → chunk-77OOX2OE.js} +47 -47
  21. package/dist/bundle/{chunk-C2MKA7SX.js → chunk-AOUB2QFP.js} +1 -1
  22. package/dist/bundle/{recognize-T5TPTI6P.js → chunk-AS2BVZU3.js} +6 -6
  23. package/dist/bundle/{chunk-LGKLQE2I.js → chunk-B7TFWNKJ.js} +1 -1
  24. package/dist/bundle/{chunk-XFXTB522.js → chunk-BL72ZIBV.js} +1 -1
  25. package/dist/bundle/{chunk-C6NTI37N.js → chunk-BOSMBW4I.js} +10 -10
  26. package/dist/bundle/{chunk-2J3TUUCO.js → chunk-BT6PWDM6.js} +2 -2
  27. package/dist/bundle/{chunk-VYFKWPIS.js → chunk-CVWF3BFK.js} +42 -42
  28. package/dist/bundle/{chunk-E5Z4FGRD.js → chunk-CZANI3DM.js} +20 -20
  29. package/dist/bundle/{chunk-ADLIUGL2.js → chunk-D6DBVPES.js} +2 -2
  30. package/dist/bundle/{chunk-XMKKBDEW.js → chunk-DNOJKQXQ.js} +289 -264
  31. package/dist/bundle/{chunk-AQSKZMBD.js → chunk-DUWTG2GE.js} +7 -7
  32. package/dist/bundle/{chunk-PEIDCYF5.js → chunk-EBB7RFCW.js} +1 -1
  33. package/dist/bundle/{chunk-FO33YFWF.js → chunk-EWL3ZFOI.js} +5 -5
  34. package/dist/bundle/{chunk-QI75LME5.js → chunk-F67VPIJL.js} +26 -26
  35. package/dist/bundle/{chunk-DECFDUNW.js → chunk-KQFR7ZAA.js} +11 -11
  36. package/dist/bundle/{chunk-EPKGNUOZ.js → chunk-KZPZFPGB.js} +20 -20
  37. package/dist/bundle/{chunk-67GS5BZI.js → chunk-LY2LFJMU.js} +92 -92
  38. package/dist/bundle/{chunk-7P6ZCUPN.js → chunk-LYLGLFWY.js} +2 -2
  39. package/dist/bundle/{chunk-T5OFRHDS.js → chunk-NCXCBVHO.js} +5 -5
  40. package/dist/bundle/{chunk-GD6BOLZP.js → chunk-OB5PPPXH.js} +11 -6
  41. package/dist/bundle/{chunk-6BQUCCBD.js → chunk-ON67U6WV.js} +4 -4
  42. package/dist/bundle/{chunk-T4UTTH3A.js → chunk-PCMW3PW6.js} +1 -1
  43. package/dist/bundle/{chunk-2GQCWNX5.js → chunk-PQHYM2XC.js} +1 -1
  44. package/dist/bundle/{chunk-PHPXTRMS.js → chunk-QVIT6SQ5.js} +1888 -1562
  45. package/dist/bundle/{chunk-EW3Y44NV.js → chunk-R5YOKYTE.js} +9 -9
  46. package/dist/bundle/{chunk-WPRLG5SL.js → chunk-REI5TPS3.js} +8 -8
  47. package/dist/bundle/{chunk-EUTOFAUT.js → chunk-SONKULUF.js} +2 -2
  48. package/dist/bundle/{chunk-GHAQXUH3.js → chunk-TVA3NXXO.js} +1 -1
  49. package/dist/bundle/{chunk-QQYM26DA.js → chunk-VK2YLSK7.js} +1 -1
  50. package/dist/bundle/{chunk-BLWCHZCW.js → chunk-WEDWIXIC.js} +2 -2
  51. package/dist/bundle/{chunk-V7OXTQBY.js → chunk-WKSLGPZQ.js} +3 -3
  52. package/dist/bundle/{chunk-XQV7EMAI.js → chunk-WUF64WOG.js} +4 -4
  53. package/dist/bundle/{chunk-PAHBZPZN.js → chunk-XZXOGHU5.js} +70 -46
  54. package/dist/bundle/{chunk-6XXI3AHJ.js → chunk-YJ6GFFEE.js} +1 -1
  55. package/dist/bundle/{chunk-ONK66VVG.js → chunk-ZHHVNTBJ.js} +1 -1
  56. package/dist/bundle/{chunk-BZUO2KFV.js → chunk-ZYBDAZFO.js} +1 -1
  57. package/dist/bundle/{command-contract-N5FA573V.js → command-contract-5GJV6EHG.js} +12 -12
  58. package/dist/bundle/decode-ZFAFVFWX.js +159 -0
  59. package/dist/bundle/{echarts-WLPTUTMR.js → echarts-SVXNTKGV.js} +2 -2
  60. package/dist/bundle/{embed-IALJOWZJ.js → embed-V755YE7O.js} +3 -3
  61. package/dist/bundle/{embedder-ZY2TS2XJ.js → embedder-MQAPNQBH.js} +6 -6
  62. package/dist/bundle/{entry-67RA75VS.js → entry-ULQ3VOMQ.js} +3 -3
  63. package/dist/bundle/{first-run-QN3UUBJW.js → first-run-64BTWXDR.js} +5 -5
  64. package/dist/bundle/{first-screen-FK4ZJQJY.js → first-screen-YZCH4TEV.js} +13 -13
  65. package/dist/bundle/{identity-X3YA364I.js → identity-PW45VBUU.js} +1 -1
  66. package/dist/bundle/{instructions-355MU4CT.js → instructions-G3ZUIRRH.js} +1 -1
  67. package/dist/bundle/{node-UGJWZLVB.js → node-IDJXLZSX.js} +2 -2
  68. package/dist/bundle/node-sqlite-W22J37MG.js +62 -0
  69. package/dist/bundle/{oauth-EZGVL3PP.js → oauth-Q52LBXDE.js} +4 -4
  70. package/dist/bundle/{open-ANYJ5AKD.js → open-YLD7VHEC.js} +1 -1
  71. package/dist/bundle/{process-JVAQXITD.js → process-OBESF2XG.js} +1 -1
  72. package/dist/bundle/{program-QGSZY5SZ.js → program-EBMWHOKQ.js} +40 -40
  73. package/dist/bundle/{prompt-EWF4ZSJO.js → prompt-FHHQF3MG.js} +2 -2
  74. package/dist/bundle/recognize-QNHKHGKM.js +22 -0
  75. package/dist/bundle/{remote-KOAALKIC.js → remote-RVZWRCCT.js} +4 -4
  76. package/dist/bundle/{rerank-MCXFZFRH.js → rerank-KG2USEME.js} +4 -4
  77. package/dist/bundle/{serve-QEVXXJ2G.js → serve-I4MJKEQ4.js} +6 -6
  78. package/dist/bundle/server-AXMWFPNT.js +55 -0
  79. package/dist/bundle/{server-Y3ZLG44J.js → server-GV7SV3L6.js} +26 -26
  80. package/dist/bundle/{state-F2ZJV2VP.js → state-AJKHWFBU.js} +3 -3
  81. package/dist/bundle/{store-QX7HBTOW.js → store-L3HFSSGJ.js} +7 -7
  82. package/dist/bundle/store-maintenance-command-Y22ARSDR.js +44 -0
  83. package/dist/bundle/tg.js +2 -2
  84. package/dist/version.d.ts +1 -1
  85. package/dist/version.js +1 -1
  86. package/package.json +2 -2
  87. package/dist/bundle/node-sqlite-FJFIOC3K.js +0 -46
  88. package/dist/bundle/server-6QM3GFZX.js +0 -55
  89. package/dist/bundle/store-maintenance-command-ZBOQSTHY.js +0 -44
@@ -0,0 +1,159 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ SAMPLE_RATE,
5
+ decodeOgg
6
+ } from "./chunk-AS2BVZU3.js";
7
+ import "./chunk-T4SDOYPY.js";
8
+ import {
9
+ CliError
10
+ } from "./chunk-67SRVSPU.js";
11
+ import {
12
+ importFrom
13
+ } from "./chunk-Y5E2WNWB.js";
14
+ import {
15
+ __name
16
+ } from "./chunk-ZVVMGPBJ.js";
17
+
18
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._95f40a748301e48ce1af109feea5b293/node_modules/@wirecat/cli-core/dist/speech/decode.js
19
+ import { spawn } from "node:child_process";
20
+ import { mkdtemp, rm, writeFile } from "node:fs/promises";
21
+ import { createRequire } from "node:module";
22
+ import { tmpdir } from "node:os";
23
+ import { join } from "node:path";
24
+ import { pathToFileURL } from "node:url";
25
+ var LONGEST_AUDIO_SECONDS = 3600;
26
+ var FFMPEG_TIMEOUT_MS = 12e4;
27
+ var FFMPEG_FORMATS = "mov,mp4,m4a,3gp,3g2,mj2,aac,mp3,wav,amr,caf,aiff,flac,ogg,matroska,webm,asf";
28
+ var text = /* @__PURE__ */ __name((bytes, from, length) => String.fromCharCode(...bytes.subarray(from, from + length)), "text");
29
+ var contains = /* @__PURE__ */ __name((bytes, needle, within) => Buffer.from(bytes.buffer, bytes.byteOffset, Math.min(bytes.length, within)).includes(needle, 0, "latin1"), "contains");
30
+ var formatOf = /* @__PURE__ */ __name((bytes) => {
31
+ if (text(bytes, 0, 4) === "OggS") {
32
+ if (contains(bytes, "OpusHead", 128))
33
+ return "opus";
34
+ if (contains(bytes, "vorbis", 128))
35
+ return "vorbis";
36
+ return "other";
37
+ }
38
+ if (text(bytes, 0, 4) === "fLaC")
39
+ return "flac";
40
+ const frame = bytes[0] === 255 && ((bytes[1] ?? 0) & 224) === 224 && ((bytes[1] ?? 0) >> 1 & 3) !== 0;
41
+ if (text(bytes, 0, 3) === "ID3" || frame)
42
+ return "mp3";
43
+ return "other";
44
+ }, "formatOf");
45
+ var firstChannel = /* @__PURE__ */ __name((decoded) => {
46
+ const samples = decoded.channelData[0];
47
+ if (!samples || decoded.samplesDecoded === 0)
48
+ throw new CliError("validation_error", "no audio in that file");
49
+ return { samples, rate: decoded.sampleRate };
50
+ }, "firstChannel");
51
+ var load = /* @__PURE__ */ __name((name) => importFrom(new URL("speech/decode.js", import.meta.resolve("@wirecat/cli-core")).href, pathToFileURL(createRequire(new URL("speech/decode.js", import.meta.resolve("@wirecat/cli-core")).href).resolve(name)).href), "load");
52
+ var decodeVorbis = /* @__PURE__ */ __name(async (bytes) => {
53
+ const { OggVorbisDecoder } = await load("@wasm-audio-decoders/ogg-vorbis");
54
+ const decoder = new OggVorbisDecoder();
55
+ await decoder.ready;
56
+ try {
57
+ return firstChannel(await decoder.decodeFile(bytes));
58
+ } finally {
59
+ decoder.free();
60
+ }
61
+ }, "decodeVorbis");
62
+ var decodeFlac = /* @__PURE__ */ __name(async (bytes) => {
63
+ const { FLACDecoder } = await load("@wasm-audio-decoders/flac");
64
+ const decoder = new FLACDecoder();
65
+ await decoder.ready;
66
+ try {
67
+ return firstChannel(await decoder.decodeFile(bytes));
68
+ } finally {
69
+ decoder.free();
70
+ }
71
+ }, "decodeFlac");
72
+ var decodeMp3 = /* @__PURE__ */ __name(async (bytes) => {
73
+ const { MPEGDecoder } = await load("mpg123-decoder");
74
+ const decoder = new MPEGDecoder();
75
+ await decoder.ready;
76
+ try {
77
+ return firstChannel(decoder.decode(bytes));
78
+ } finally {
79
+ decoder.free();
80
+ }
81
+ }, "decodeMp3");
82
+ var runFfmpeg = /* @__PURE__ */ __name(async (bytes) => {
83
+ const directory = await mkdtemp(join(tmpdir(), "wirecat-audio-"));
84
+ try {
85
+ const input = join(directory, "audio");
86
+ await writeFile(input, bytes, { mode: 384 });
87
+ const largest = LONGEST_AUDIO_SECONDS * SAMPLE_RATE * 4;
88
+ const output = await new Promise((resolve, reject) => {
89
+ const child = spawn("ffmpeg", [
90
+ "-nostdin",
91
+ "-hide_banner",
92
+ "-loglevel",
93
+ "error",
94
+ "-protocol_whitelist",
95
+ "file",
96
+ "-format_whitelist",
97
+ FFMPEG_FORMATS,
98
+ "-i",
99
+ input,
100
+ "-vn",
101
+ "-ac",
102
+ "1",
103
+ "-ar",
104
+ String(SAMPLE_RATE),
105
+ "-f",
106
+ "f32le",
107
+ "pipe:1"
108
+ ], { stdio: ["ignore", "pipe", "pipe"], timeout: FFMPEG_TIMEOUT_MS });
109
+ const chunks = [];
110
+ let size = 0;
111
+ let errors = "";
112
+ child.stdout.on("data", (chunk) => {
113
+ size += chunk.length;
114
+ if (size > largest)
115
+ child.kill();
116
+ else
117
+ chunks.push(chunk);
118
+ });
119
+ child.stderr.on("data", (chunk) => {
120
+ errors = (errors + chunk.toString()).slice(-500);
121
+ });
122
+ child.on("error", (error) => reject(error.code === "ENOENT" ? new CliError("validation_error", "only ffmpeg reads this audio format, and ffmpeg is not installed") : error));
123
+ child.on("close", (code) => {
124
+ if (size > largest)
125
+ reject(new CliError("validation_error", `the audio is longer than ${LONGEST_AUDIO_SECONDS / 60} minutes`));
126
+ else if (code === 0)
127
+ resolve(Buffer.concat(chunks));
128
+ else
129
+ reject(new CliError("validation_error", `ffmpeg could not read the audio: ${errors.trim() || code}`));
130
+ });
131
+ });
132
+ const samples = new Float32Array(Math.floor(output.length / 4));
133
+ Buffer.from(samples.buffer).set(output.subarray(0, samples.length * 4));
134
+ return { samples, rate: SAMPLE_RATE };
135
+ } finally {
136
+ await rm(directory, { recursive: true, force: true });
137
+ }
138
+ }, "runFfmpeg");
139
+ var BUNDLED = {
140
+ opus: decodeOgg,
141
+ vorbis: decodeVorbis,
142
+ flac: decodeFlac,
143
+ mp3: decodeMp3
144
+ };
145
+ var decodeAudio = /* @__PURE__ */ __name(async (bytes, ffmpeg = runFfmpeg) => {
146
+ const format = formatOf(bytes);
147
+ const pcm = format === "other" ? await ffmpeg(bytes) : await BUNDLED[format](bytes).catch((error) => ffmpeg(bytes).catch(() => {
148
+ throw error;
149
+ }));
150
+ if (pcm.samples.length / pcm.rate > LONGEST_AUDIO_SECONDS)
151
+ throw new CliError("validation_error", `the audio is longer than ${LONGEST_AUDIO_SECONDS / 60} minutes`);
152
+ return pcm;
153
+ }, "decodeAudio");
154
+ export {
155
+ LONGEST_AUDIO_SECONDS,
156
+ decodeAudio,
157
+ formatOf,
158
+ runFfmpeg
159
+ };
@@ -42399,7 +42399,7 @@ function install11(registers) {
42399
42399
  }
42400
42400
  __name(install11, "install");
42401
42401
 
42402
- // node_modules/.pnpm/@wirecat+cli-core@0.479.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._835150ae4189cac822e446e361e54dd7/node_modules/@wirecat/cli-core/dist/charts/echarts-option.js
42402
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._95f40a748301e48ce1af109feea5b293/node_modules/@wirecat/cli-core/dist/charts/echarts-option.js
42403
42403
  var echartsOption = /* @__PURE__ */ __name((chart) => ({
42404
42404
  animation: false,
42405
42405
  backgroundColor: "#111827",
@@ -42447,7 +42447,7 @@ var echartsOption = /* @__PURE__ */ __name((chart) => ({
42447
42447
  } : {}
42448
42448
  }), "echartsOption");
42449
42449
 
42450
- // node_modules/.pnpm/@wirecat+cli-core@0.479.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._835150ae4189cac822e446e361e54dd7/node_modules/@wirecat/cli-core/dist/charts/echarts.js
42450
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._95f40a748301e48ce1af109feea5b293/node_modules/@wirecat/cli-core/dist/charts/echarts.js
42451
42451
  use([install2, install, install6, install5, install10, install7, install11]);
42452
42452
  var echartsRenderer = {
42453
42453
  render: /* @__PURE__ */ __name(async (chart, size) => {
@@ -13,9 +13,9 @@ import {
13
13
  truncated,
14
14
  unit,
15
15
  warmEmbedders
16
- } from "./chunk-FO33YFWF.js";
17
- import "./chunk-XX37LKXG.js";
18
- import "./chunk-PEIDCYF5.js";
16
+ } from "./chunk-EWL3ZFOI.js";
17
+ import "./chunk-3HYDKCXB.js";
18
+ import "./chunk-EBB7RFCW.js";
19
19
  import "./chunk-T4SDOYPY.js";
20
20
  import "./chunk-67SRVSPU.js";
21
21
  import "./chunk-Y5E2WNWB.js";
@@ -4,9 +4,9 @@ import {
4
4
  openSession,
5
5
  truncated,
6
6
  unit
7
- } from "./chunk-FO33YFWF.js";
8
- import "./chunk-XX37LKXG.js";
9
- import "./chunk-PEIDCYF5.js";
7
+ } from "./chunk-EWL3ZFOI.js";
8
+ import "./chunk-3HYDKCXB.js";
9
+ import "./chunk-EBB7RFCW.js";
10
10
  import "./chunk-T4SDOYPY.js";
11
11
  import {
12
12
  CliError
@@ -18,11 +18,11 @@ import {
18
18
  __name
19
19
  } from "./chunk-ZVVMGPBJ.js";
20
20
 
21
- // node_modules/.pnpm/@wirecat+cli-core@0.479.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._835150ae4189cac822e446e361e54dd7/node_modules/@wirecat/cli-core/dist/images/picture/embedder.js
21
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._95f40a748301e48ce1af109feea5b293/node_modules/@wirecat/cli-core/dist/images/picture/embedder.js
22
22
  import { readFileSync } from "node:fs";
23
23
  import { join } from "node:path";
24
24
 
25
- // node_modules/.pnpm/@wirecat+cli-core@0.479.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._835150ae4189cac822e446e361e54dd7/node_modules/@wirecat/cli-core/dist/images/picture/preprocess.js
25
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._95f40a748301e48ce1af109feea5b293/node_modules/@wirecat/cli-core/dist/images/picture/preprocess.js
26
26
  var SIZE = 224;
27
27
  var MEAN = [0.48145466, 0.4578275, 0.40821073];
28
28
  var STD = [0.26862954, 0.26130258, 0.27577711];
@@ -61,7 +61,7 @@ var preprocess = /* @__PURE__ */ __name(async (bytes, load = importCanvas) => {
61
61
  return pixels;
62
62
  }, "preprocess");
63
63
 
64
- // node_modules/.pnpm/@wirecat+cli-core@0.479.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._835150ae4189cac822e446e361e54dd7/node_modules/@wirecat/cli-core/dist/images/picture/embedder.js
64
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._95f40a748301e48ce1af109feea5b293/node_modules/@wirecat/cli-core/dist/images/picture/embedder.js
65
65
  var openPictureEmbedder = /* @__PURE__ */ __name(async (model, directory, { threads = 4, canvas } = {}) => {
66
66
  const { Tokenizer } = await importFrom(new URL("images/picture/embedder.js", import.meta.resolve("@wirecat/cli-core")).href, "@huggingface/tokenizers");
67
67
  const path = /* @__PURE__ */ __name((name) => join(directory, model.id, name), "path");
@@ -2,9 +2,9 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  startCli
5
- } from "./chunk-EW3Y44NV.js";
6
- import "./chunk-T4UTTH3A.js";
7
- import "./chunk-T5OFRHDS.js";
5
+ } from "./chunk-R5YOKYTE.js";
6
+ import "./chunk-PCMW3PW6.js";
7
+ import "./chunk-NCXCBVHO.js";
8
8
  import "./chunk-T4SDOYPY.js";
9
9
  import "./chunk-67SRVSPU.js";
10
10
  import "./chunk-Y5E2WNWB.js";
@@ -5,13 +5,13 @@ import {
5
5
  asksAtStart,
6
6
  setupAtStart,
7
7
  systemLanguage
8
- } from "./chunk-C6NTI37N.js";
8
+ } from "./chunk-BOSMBW4I.js";
9
9
  import "./chunk-VMU4SGCE.js";
10
10
  import "./chunk-MFS52LTZ.js";
11
- import "./chunk-EUTOFAUT.js";
12
- import "./chunk-R2F6U4F3.js";
13
- import "./chunk-6BQUCCBD.js";
14
- import "./chunk-PEIDCYF5.js";
11
+ import "./chunk-SONKULUF.js";
12
+ import "./chunk-3562DVQ7.js";
13
+ import "./chunk-ON67U6WV.js";
14
+ import "./chunk-EBB7RFCW.js";
15
15
  import "./chunk-T4SDOYPY.js";
16
16
  import "./chunk-67SRVSPU.js";
17
17
  import "./chunk-Y5E2WNWB.js";
@@ -4,21 +4,21 @@ import {
4
4
  WIRECAT_TOOLS,
5
5
  firstScreen,
6
6
  installHelp
7
- } from "./chunk-GD6BOLZP.js";
7
+ } from "./chunk-OB5PPPXH.js";
8
8
  import "./chunk-2ABQZVK4.js";
9
- import "./chunk-T3ZLOMWW.js";
10
- import "./chunk-67GS5BZI.js";
11
- import "./chunk-LSP2NCNL.js";
12
- import "./chunk-V7OXTQBY.js";
13
- import "./chunk-AQSKZMBD.js";
14
- import "./chunk-EUTOFAUT.js";
15
- import "./chunk-T4UTTH3A.js";
16
- import "./chunk-2GQCWNX5.js";
17
- import "./chunk-XX37LKXG.js";
18
- import "./chunk-PAHBZPZN.js";
19
- import "./chunk-6BQUCCBD.js";
9
+ import "./chunk-5P27JGGA.js";
10
+ import "./chunk-LY2LFJMU.js";
11
+ import "./chunk-77OOX2OE.js";
12
+ import "./chunk-WKSLGPZQ.js";
13
+ import "./chunk-DUWTG2GE.js";
14
+ import "./chunk-SONKULUF.js";
15
+ import "./chunk-PCMW3PW6.js";
16
+ import "./chunk-PQHYM2XC.js";
17
+ import "./chunk-3HYDKCXB.js";
18
+ import "./chunk-XZXOGHU5.js";
19
+ import "./chunk-ON67U6WV.js";
20
20
  import "./chunk-O5EHUB2V.js";
21
- import "./chunk-PEIDCYF5.js";
21
+ import "./chunk-EBB7RFCW.js";
22
22
  import "./chunk-T4SDOYPY.js";
23
23
  import "./chunk-67SRVSPU.js";
24
24
  import "./chunk-Y5E2WNWB.js";
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  TG
5
- } from "./chunk-GHAQXUH3.js";
5
+ } from "./chunk-TVA3NXXO.js";
6
6
  import "./chunk-O5EHUB2V.js";
7
7
  import "./chunk-67SRVSPU.js";
8
8
  import "./chunk-ZVVMGPBJ.js";
@@ -3,7 +3,7 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  appInstructions,
5
5
  instructions
6
- } from "./chunk-XFXTB522.js";
6
+ } from "./chunk-BL72ZIBV.js";
7
7
  import "./chunk-ZVVMGPBJ.js";
8
8
  export {
9
9
  appInstructions,
@@ -18,12 +18,12 @@ import {
18
18
  jitCompatCheck,
19
19
  refineSqliteCodecs,
20
20
  sql
21
- } from "./chunk-QQYM26DA.js";
21
+ } from "./chunk-VK2YLSK7.js";
22
22
  import {
23
23
  __name
24
24
  } from "./chunk-ZVVMGPBJ.js";
25
25
 
26
- // node_modules/.pnpm/@wirecat+cli-core@0.479.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._835150ae4189cac822e446e361e54dd7/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/node.js
26
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._95f40a748301e48ce1af109feea5b293/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/node.js
27
27
  import { DatabaseSync } from "node:sqlite";
28
28
  var nodeSQLiteCodecs = refineSqliteCodecs({
29
29
  "integer:boolean": { normalize: booleanFromInteger },
@@ -0,0 +1,62 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ loadVectorExtension,
5
+ vectorExtension
6
+ } from "./chunk-76OSISA3.js";
7
+ import "./chunk-T4SDOYPY.js";
8
+ import "./chunk-67SRVSPU.js";
9
+ import "./chunk-Y5E2WNWB.js";
10
+ import {
11
+ __name
12
+ } from "./chunk-ZVVMGPBJ.js";
13
+
14
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._95f40a748301e48ce1af109feea5b293/node_modules/@wirecat/cli-core/dist/store/drivers/node-sqlite.js
15
+ import { DatabaseSync } from "node:sqlite";
16
+ var openWithNodeSqlite = /* @__PURE__ */ __name(async (path) => cacheOverNodeSqlite(await nodeClient(path)), "openWithNodeSqlite");
17
+ var nodeClient = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
18
+ const extension = await vectorExtension();
19
+ const client = new DatabaseSync(path, { readOnly, allowExtension: true });
20
+ try {
21
+ loadVectorExtension(client, extension);
22
+ return client;
23
+ } catch (error) {
24
+ client.close();
25
+ throw error;
26
+ }
27
+ }, "nodeClient");
28
+ var STATEMENT_CACHE_SIZE = 1e3;
29
+ var cacheOverNodeSqlite = /* @__PURE__ */ __name((database, cacheSize = STATEMENT_CACHE_SIZE) => {
30
+ const statements = /* @__PURE__ */ new Map();
31
+ const prepare = /* @__PURE__ */ __name((sql) => {
32
+ const statement = database.prepare(sql);
33
+ return {
34
+ run: /* @__PURE__ */ __name((...parameters) => ({ changes: Number(statement.run(...parameters).changes) }), "run"),
35
+ get: /* @__PURE__ */ __name((...parameters) => statement.get(...parameters), "get"),
36
+ all: /* @__PURE__ */ __name((...parameters) => statement.all(...parameters), "all")
37
+ };
38
+ }, "prepare");
39
+ return {
40
+ exec: /* @__PURE__ */ __name((sql) => database.exec(sql), "exec"),
41
+ prepare: /* @__PURE__ */ __name((sql) => {
42
+ const cached = statements.get(sql);
43
+ if (cached)
44
+ statements.delete(sql);
45
+ const statement = cached ?? prepare(sql);
46
+ statements.set(sql, statement);
47
+ if (statements.size > cacheSize)
48
+ statements.delete(statements.keys().next().value);
49
+ return statement;
50
+ }, "prepare"),
51
+ close: /* @__PURE__ */ __name(() => {
52
+ statements.clear();
53
+ database.close();
54
+ }, "close")
55
+ };
56
+ }, "cacheOverNodeSqlite");
57
+ export {
58
+ STATEMENT_CACHE_SIZE,
59
+ cacheOverNodeSqlite,
60
+ nodeClient,
61
+ openWithNodeSqlite
62
+ };
@@ -3,11 +3,11 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  ownerLogin,
5
5
  revokeAll
6
- } from "./chunk-BLWCHZCW.js";
6
+ } from "./chunk-WEDWIXIC.js";
7
7
  import "./chunk-5D4AEUVA.js";
8
- import "./chunk-XQV7EMAI.js";
9
- import "./chunk-2J3TUUCO.js";
10
- import "./chunk-2GQCWNX5.js";
8
+ import "./chunk-WUF64WOG.js";
9
+ import "./chunk-BT6PWDM6.js";
10
+ import "./chunk-PQHYM2XC.js";
11
11
  import "./chunk-T4SDOYPY.js";
12
12
  import "./chunk-67SRVSPU.js";
13
13
  import "./chunk-Y5E2WNWB.js";
@@ -6,7 +6,7 @@ import {
6
6
  openCache,
7
7
  openFile,
8
8
  storeCapable
9
- } from "./chunk-T5OFRHDS.js";
9
+ } from "./chunk-NCXCBVHO.js";
10
10
  import "./chunk-T4SDOYPY.js";
11
11
  import "./chunk-67SRVSPU.js";
12
12
  import "./chunk-Y5E2WNWB.js";
@@ -5,7 +5,7 @@ import {
5
5
  __name
6
6
  } from "./chunk-ZVVMGPBJ.js";
7
7
 
8
- // node_modules/.pnpm/@wirecat+cli-core@0.479.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._835150ae4189cac822e446e361e54dd7/node_modules/@wirecat/cli-core/dist/embeddings/process.js
8
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._95f40a748301e48ce1af109feea5b293/node_modules/@wirecat/cli-core/dist/embeddings/process.js
9
9
  import { spawn } from "node:child_process";
10
10
  import { createInterface } from "node:readline";
11
11
  import { fileURLToPath } from "node:url";
@@ -13,7 +13,7 @@ import {
13
13
  proxiedFetch,
14
14
  proxySecrets,
15
15
  resolveSettings
16
- } from "./chunk-WPRLG5SL.js";
16
+ } from "./chunk-REI5TPS3.js";
17
17
  import {
18
18
  AGENTS,
19
19
  MEMO_SCENARIOS,
@@ -65,27 +65,27 @@ import {
65
65
  topicsCommand,
66
66
  upgradeCommand,
67
67
  watchCommand
68
- } from "./chunk-XMKKBDEW.js";
69
- import "./chunk-6XXI3AHJ.js";
68
+ } from "./chunk-DNOJKQXQ.js";
69
+ import "./chunk-YJ6GFFEE.js";
70
70
  import {
71
71
  parseProxy,
72
72
  proxyLabel
73
73
  } from "./chunk-FG2QTYEF.js";
74
- import "./chunk-LGKLQE2I.js";
75
- import "./chunk-EPKGNUOZ.js";
74
+ import "./chunk-B7TFWNKJ.js";
75
+ import "./chunk-KZPZFPGB.js";
76
76
  import {
77
77
  installSkill
78
- } from "./chunk-ID6TO5P5.js";
79
- import "./chunk-VYFKWPIS.js";
80
- import "./chunk-E5Z4FGRD.js";
81
- import "./chunk-ELQ5ORY2.js";
82
- import "./chunk-QWTHUKS4.js";
78
+ } from "./chunk-4RDMNNVO.js";
79
+ import "./chunk-CVWF3BFK.js";
80
+ import "./chunk-CZANI3DM.js";
81
+ import "./chunk-26PWIQPP.js";
82
+ import "./chunk-3GXKJKIC.js";
83
83
  import {
84
84
  inSection
85
- } from "./chunk-GD6BOLZP.js";
85
+ } from "./chunk-OB5PPPXH.js";
86
86
  import "./chunk-2ABQZVK4.js";
87
- import "./chunk-T3ZLOMWW.js";
88
- import "./chunk-67GS5BZI.js";
87
+ import "./chunk-5P27JGGA.js";
88
+ import "./chunk-LY2LFJMU.js";
89
89
  import {
90
90
  Argument,
91
91
  Command,
@@ -107,10 +107,10 @@ import {
107
107
  runtime,
108
108
  secretInputOf,
109
109
  withDeadline
110
- } from "./chunk-LSP2NCNL.js";
111
- import "./chunk-V7OXTQBY.js";
112
- import "./chunk-AQSKZMBD.js";
113
- import "./chunk-C6NTI37N.js";
110
+ } from "./chunk-77OOX2OE.js";
111
+ import "./chunk-WKSLGPZQ.js";
112
+ import "./chunk-DUWTG2GE.js";
113
+ import "./chunk-BOSMBW4I.js";
114
114
  import {
115
115
  installerOf,
116
116
  latestVersion,
@@ -118,37 +118,37 @@ import {
118
118
  updateNotice
119
119
  } from "./chunk-VMU4SGCE.js";
120
120
  import "./chunk-MFS52LTZ.js";
121
- import "./chunk-EUTOFAUT.js";
122
- import "./chunk-EW3Y44NV.js";
123
- import "./chunk-T4UTTH3A.js";
121
+ import "./chunk-SONKULUF.js";
122
+ import "./chunk-R5YOKYTE.js";
123
+ import "./chunk-PCMW3PW6.js";
124
124
  import {
125
125
  TG,
126
126
  VERSION
127
- } from "./chunk-GHAQXUH3.js";
128
- import "./chunk-XQV7EMAI.js";
127
+ } from "./chunk-TVA3NXXO.js";
128
+ import "./chunk-WUF64WOG.js";
129
129
  import {
130
130
  servingProfiles
131
- } from "./chunk-2J3TUUCO.js";
132
- import "./chunk-2GQCWNX5.js";
133
- import "./chunk-BZUO2KFV.js";
134
- import "./chunk-DC7O7TVJ.js";
135
- import "./chunk-7P6ZCUPN.js";
136
- import "./chunk-FO33YFWF.js";
137
- import "./chunk-XX37LKXG.js";
138
- import "./chunk-PHPXTRMS.js";
131
+ } from "./chunk-BT6PWDM6.js";
132
+ import "./chunk-PQHYM2XC.js";
133
+ import "./chunk-ZYBDAZFO.js";
134
+ import "./chunk-6QTUYMGX.js";
135
+ import "./chunk-LYLGLFWY.js";
136
+ import "./chunk-EWL3ZFOI.js";
137
+ import "./chunk-3HYDKCXB.js";
138
+ import "./chunk-QVIT6SQ5.js";
139
139
  import {
140
140
  timezoneOf
141
- } from "./chunk-PAHBZPZN.js";
142
- import "./chunk-R2F6U4F3.js";
143
- import "./chunk-6BQUCCBD.js";
141
+ } from "./chunk-XZXOGHU5.js";
142
+ import "./chunk-3562DVQ7.js";
143
+ import "./chunk-ON67U6WV.js";
144
144
  import "./chunk-O5EHUB2V.js";
145
- import "./chunk-PEIDCYF5.js";
146
- import "./chunk-T5OFRHDS.js";
147
- import "./chunk-QQYM26DA.js";
145
+ import "./chunk-EBB7RFCW.js";
146
+ import "./chunk-NCXCBVHO.js";
147
+ import "./chunk-VK2YLSK7.js";
148
148
  import {
149
149
  readSecret
150
- } from "./chunk-ADLIUGL2.js";
151
- import "./chunk-C2MKA7SX.js";
150
+ } from "./chunk-D6DBVPES.js";
151
+ import "./chunk-AOUB2QFP.js";
152
152
  import {
153
153
  configFilePath,
154
154
  exitCodeFor,
@@ -719,7 +719,7 @@ import { accessSync, constants, existsSync as existsSync2, mkdirSync } from "nod
719
719
  import { join } from "node:path";
720
720
  import { fileURLToPath as fileURLToPath2 } from "node:url";
721
721
 
722
- // node_modules/.pnpm/@wirecat+cli-core@0.479.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._835150ae4189cac822e446e361e54dd7/node_modules/@wirecat/cli-core/dist/update/index.js
722
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._95f40a748301e48ce1af109feea5b293/node_modules/@wirecat/cli-core/dist/update/index.js
723
723
  import { realpathSync } from "node:fs";
724
724
  import { fileURLToPath } from "node:url";
725
725
  var QUIET_WORDS = [
@@ -1036,7 +1036,7 @@ var definition = {
1036
1036
  };
1037
1037
  var run2 = /* @__PURE__ */ __name(async (argv, environment = {}) => {
1038
1038
  if (!botApi && needsBotApi(argv, environment.env ?? process.env))
1039
- useBotApi((await import("./bot-api-OMUV6EIK.js")).telegramBotApiCommand);
1039
+ useBotApi((await import("./bot-api-2PAH2JZ3.js")).telegramBotApiCommand);
1040
1040
  const notice = updateNotice2(argv, {
1041
1041
  ...environment.tty === void 0 ? {} : { tty: environment.tty },
1042
1042
  ...environment.update ? { environment: environment.update } : {},
@@ -2,8 +2,8 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  readSecret
5
- } from "./chunk-ADLIUGL2.js";
6
- import "./chunk-C2MKA7SX.js";
5
+ } from "./chunk-D6DBVPES.js";
6
+ import "./chunk-AOUB2QFP.js";
7
7
  import "./chunk-T4SDOYPY.js";
8
8
  import "./chunk-67SRVSPU.js";
9
9
  import "./chunk-Y5E2WNWB.js";
@@ -0,0 +1,22 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ SAMPLE_RATE,
5
+ decodeOgg,
6
+ detector,
7
+ loadSherpa,
8
+ openRecognizer,
9
+ toModelRate
10
+ } from "./chunk-AS2BVZU3.js";
11
+ import "./chunk-T4SDOYPY.js";
12
+ import "./chunk-67SRVSPU.js";
13
+ import "./chunk-Y5E2WNWB.js";
14
+ import "./chunk-ZVVMGPBJ.js";
15
+ export {
16
+ SAMPLE_RATE,
17
+ decodeOgg,
18
+ detector,
19
+ loadSherpa,
20
+ openRecognizer,
21
+ toModelRate
22
+ };
@@ -8,10 +8,10 @@ import {
8
8
  openRemote,
9
9
  remoteKey,
10
10
  remoteModel
11
- } from "./chunk-7P6ZCUPN.js";
12
- import "./chunk-FO33YFWF.js";
13
- import "./chunk-XX37LKXG.js";
14
- import "./chunk-PEIDCYF5.js";
11
+ } from "./chunk-LYLGLFWY.js";
12
+ import "./chunk-EWL3ZFOI.js";
13
+ import "./chunk-3HYDKCXB.js";
14
+ import "./chunk-EBB7RFCW.js";
15
15
  import "./chunk-T4SDOYPY.js";
16
16
  import "./chunk-67SRVSPU.js";
17
17
  import "./chunk-Y5E2WNWB.js";
@@ -4,9 +4,9 @@ import {
4
4
  defaultThreads,
5
5
  loadModel,
6
6
  truncated
7
- } from "./chunk-FO33YFWF.js";
8
- import "./chunk-XX37LKXG.js";
9
- import "./chunk-PEIDCYF5.js";
7
+ } from "./chunk-EWL3ZFOI.js";
8
+ import "./chunk-3HYDKCXB.js";
9
+ import "./chunk-EBB7RFCW.js";
10
10
  import "./chunk-T4SDOYPY.js";
11
11
  import "./chunk-67SRVSPU.js";
12
12
  import "./chunk-Y5E2WNWB.js";
@@ -14,7 +14,7 @@ import {
14
14
  __name
15
15
  } from "./chunk-ZVVMGPBJ.js";
16
16
 
17
- // node_modules/.pnpm/@wirecat+cli-core@0.479.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._835150ae4189cac822e446e361e54dd7/node_modules/@wirecat/cli-core/dist/embeddings/rerank.js
17
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._95f40a748301e48ce1af109feea5b293/node_modules/@wirecat/cli-core/dist/embeddings/rerank.js
18
18
  var openReranker = /* @__PURE__ */ __name(async (model, directory, { threads = defaultThreads() } = {}) => {
19
19
  const { ort, tokenizer, session } = await loadModel(model, directory, threads);
20
20
  const typeIds = session.inputNames.includes("token_type_ids");