@wirecat/drive-cli 0.44.0 → 0.45.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 (168) hide show
  1. package/dist/bin/drive.js +35 -40
  2. package/dist/bundle/all-profiles-O7CNQ7FO.js +26 -0
  3. package/dist/bundle/anthropic-6T67J2CE.js +71 -0
  4. package/dist/bundle/app-server-BVBZT3UY.js +237 -0
  5. package/dist/bundle/bun-O6RL6LRQ.js +169 -0
  6. package/dist/bundle/bun-sqlite-54W7JUY3.js +70 -0
  7. package/dist/bundle/chunk-2DLAJGRN.js +62 -0
  8. package/dist/bundle/chunk-37MAA6F2.js +5624 -0
  9. package/dist/bundle/chunk-3HRDEJJW.js +161 -0
  10. package/dist/bundle/chunk-3Z7WSD2A.js +433 -0
  11. package/dist/bundle/chunk-44FV5JAS.js +1855 -0
  12. package/dist/bundle/chunk-4DW6QGEV.js +164 -0
  13. package/dist/bundle/chunk-4NGLRHWO.js +24 -0
  14. package/dist/bundle/chunk-5DPV7X27.js +663 -0
  15. package/dist/bundle/chunk-5FONRUG6.js +24805 -0
  16. package/dist/bundle/chunk-5MGIL5LW.js +846 -0
  17. package/dist/bundle/chunk-5TC3NCAF.js +42 -0
  18. package/dist/bundle/chunk-6Y2BYFXQ.js +65 -0
  19. package/dist/bundle/chunk-A3FU4RR6.js +150 -0
  20. package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
  21. package/dist/bundle/chunk-AIXLOMH4.js +63 -0
  22. package/dist/bundle/chunk-AOOD3RMK.js +384 -0
  23. package/dist/bundle/chunk-AUS6TKP5.js +1975 -0
  24. package/dist/bundle/chunk-B2J6FJNL.js +19 -0
  25. package/dist/bundle/chunk-BEXHAGXH.js +3542 -0
  26. package/dist/bundle/chunk-BHE7ZY2N.js +2352 -0
  27. package/dist/bundle/chunk-BJ3JRO34.js +2356 -0
  28. package/dist/bundle/chunk-BQUPOB5H.js +2315 -0
  29. package/dist/bundle/chunk-CFZWPIVC.js +1092 -0
  30. package/dist/bundle/chunk-CKR3DVUK.js +754 -0
  31. package/dist/bundle/chunk-CVIKKIGE.js +76 -0
  32. package/dist/bundle/chunk-D67JGWSC.js +190 -0
  33. package/dist/bundle/chunk-DDYR6DYL.js +78 -0
  34. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  35. package/dist/bundle/chunk-DL7D6Y3B.js +18102 -0
  36. package/dist/bundle/chunk-DORXXBFC.js +484 -0
  37. package/dist/bundle/chunk-DXKVEOSS.js +53 -0
  38. package/dist/bundle/chunk-DXQEJWI3.js +522 -0
  39. package/dist/bundle/chunk-FEULDMWM.js +35598 -0
  40. package/dist/bundle/chunk-G3FAOS52.js +630 -0
  41. package/dist/bundle/chunk-GHOWRW7E.js +237 -0
  42. package/dist/bundle/chunk-GNFHZZ55.js +264 -0
  43. package/dist/bundle/chunk-GNI7INK6.js +18 -0
  44. package/dist/bundle/chunk-GOR3Z2FR.js +17 -0
  45. package/dist/bundle/chunk-GQW4GRYR.js +886 -0
  46. package/dist/bundle/chunk-GWPKIRNQ.js +220 -0
  47. package/dist/bundle/chunk-GYCUY4CL.js +9 -0
  48. package/dist/bundle/chunk-HEPIOCHN.js +8181 -0
  49. package/dist/bundle/chunk-HTQTIKWP.js +928 -0
  50. package/dist/bundle/chunk-IAW5A7OR.js +1913 -0
  51. package/dist/bundle/chunk-IGMRWQP3.js +1071 -0
  52. package/dist/bundle/chunk-IKNU5A5Y.js +82 -0
  53. package/dist/bundle/chunk-JVTVAZ5X.js +1054 -0
  54. package/dist/bundle/chunk-K74PQVQZ.js +168 -0
  55. package/dist/bundle/chunk-K7FRUB33.js +795 -0
  56. package/dist/bundle/chunk-KADPV4YA.js +45 -0
  57. package/dist/bundle/chunk-KJMBV574.js +16225 -0
  58. package/dist/bundle/chunk-LHIL46I3.js +31 -0
  59. package/dist/bundle/chunk-LJARCTGL.js +60 -0
  60. package/dist/bundle/chunk-LOTQ2HMT.js +3954 -0
  61. package/dist/bundle/chunk-MAXN7COO.js +99 -0
  62. package/dist/bundle/chunk-MFS52LTZ.js +570 -0
  63. package/dist/bundle/chunk-MFSIOSUM.js +1714 -0
  64. package/dist/bundle/chunk-NB2N6L3R.js +138 -0
  65. package/dist/bundle/chunk-NDNTLUPS.js +58 -0
  66. package/dist/bundle/chunk-NLEB26GA.js +288 -0
  67. package/dist/bundle/chunk-NP3XLLN3.js +73 -0
  68. package/dist/bundle/chunk-NW7IMGRR.js +6848 -0
  69. package/dist/bundle/chunk-O5EHUB2V.js +2 -0
  70. package/dist/bundle/chunk-OWXTPXIQ.js +215 -0
  71. package/dist/bundle/chunk-PDBBBUY7.js +166 -0
  72. package/dist/bundle/chunk-PH74B2VZ.js +122 -0
  73. package/dist/bundle/chunk-PJ7IQVOM.js +421 -0
  74. package/dist/bundle/chunk-Q2Z3VCM4.js +2 -0
  75. package/dist/bundle/chunk-QTJUH3LS.js +15572 -0
  76. package/dist/bundle/chunk-QW36EOAM.js +106 -0
  77. package/dist/bundle/chunk-QWSRPXCJ.js +281 -0
  78. package/dist/bundle/chunk-R2A3K7ZF.js +193 -0
  79. package/dist/bundle/chunk-R2QRP7EJ.js +835 -0
  80. package/dist/bundle/chunk-RCS2SCX5.js +375 -0
  81. package/dist/bundle/chunk-RJ633GFA.js +25 -0
  82. package/dist/bundle/chunk-SBZB7HMU.js +1055 -0
  83. package/dist/bundle/chunk-SMHQA5J6.js +459 -0
  84. package/dist/bundle/chunk-SWMMR3FR.js +48 -0
  85. package/dist/bundle/chunk-TRMIV3OA.js +18 -0
  86. package/dist/bundle/chunk-VAGF723Z.js +74 -0
  87. package/dist/bundle/chunk-VCYFEWPD.js +18078 -0
  88. package/dist/bundle/chunk-VHQNVG3J.js +263 -0
  89. package/dist/bundle/chunk-VHT2WI4I.js +2941 -0
  90. package/dist/bundle/chunk-VYBOYBLX.js +100 -0
  91. package/dist/bundle/chunk-WUFCYDKB.js +71 -0
  92. package/dist/bundle/chunk-XAZQTJXR.js +3402 -0
  93. package/dist/bundle/chunk-XEBFFKXO.js +111 -0
  94. package/dist/bundle/chunk-XF5MFUEB.js +498 -0
  95. package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
  96. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  97. package/dist/bundle/chunk-ZBM4GEV2.js +120 -0
  98. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  99. package/dist/bundle/command-contract-MXCBV3GJ.js +38 -0
  100. package/dist/bundle/dist-MWTMOYWT.js +7577 -0
  101. package/dist/bundle/dist-PY3MVR3G.js +21 -0
  102. package/dist/bundle/drive.js +50 -0
  103. package/dist/bundle/echarts-LD3AI55P.js +42501 -0
  104. package/dist/bundle/embed-FJKIIM43.js +37 -0
  105. package/dist/bundle/embedder-NNQ5ZC25.js +110 -0
  106. package/dist/bundle/entry-ZYSNPDSD.js +15 -0
  107. package/dist/bundle/failure-MJJXFR63.js +37 -0
  108. package/dist/bundle/first-run-KA2UPZAU.js +24 -0
  109. package/dist/bundle/first-screen-VQ3RXDMF.js +36 -0
  110. package/dist/bundle/google-ZYDFTHLN.js +32 -0
  111. package/dist/bundle/google-api-2GT5PAW2.js +82 -0
  112. package/dist/bundle/identity-JQFQXQIR.js +10 -0
  113. package/dist/bundle/instructions-RZMSW3OC.js +11 -0
  114. package/dist/bundle/login-JU6NKW5P.js +158 -0
  115. package/dist/bundle/mcp-2PZDI7WE.js +501 -0
  116. package/dist/bundle/mcp-JOQMFGBC.js +95 -0
  117. package/dist/bundle/mcp-OQBZXELQ.js +165 -0
  118. package/dist/bundle/mdast-util-from-markdown-FXEPSNER.js +1958 -0
  119. package/dist/bundle/mdast-util-gfm-SZM5GBDF.js +2103 -0
  120. package/dist/bundle/micromark-extension-gfm-GRL24TU6.js +1838 -0
  121. package/dist/bundle/node-P4E63KXA.js +2340 -0
  122. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  123. package/dist/bundle/node-ZRLYQL7J.js +176 -0
  124. package/dist/bundle/node-sqlite-TXPSRROT.js +46 -0
  125. package/dist/bundle/oauth-NAIBKERJ.js +18 -0
  126. package/dist/bundle/open-3P5EPXPV.js +20 -0
  127. package/dist/bundle/process-LL77573L.js +91 -0
  128. package/dist/bundle/program-CZ55L6EW.js +24078 -0
  129. package/dist/bundle/prompt-3TX2SWOY.js +13 -0
  130. package/dist/bundle/reasons-GF2TYGX6.js +11 -0
  131. package/dist/bundle/recognize-IFXOJHEA.js +191 -0
  132. package/dist/bundle/remote-663M42Y5.js +28 -0
  133. package/dist/bundle/rerank-OT2F2DBV.js +51 -0
  134. package/dist/bundle/serve-PDNNI6O6.js +20 -0
  135. package/dist/bundle/server-BFOEPMR7.js +56 -0
  136. package/dist/bundle/server-K566PJ7H.js +69 -0
  137. package/dist/bundle/services-5MCTECBU.js +333 -0
  138. package/dist/bundle/sqlite-runtime-BF3KDM7W.js +17 -0
  139. package/dist/bundle/state-SZX65E74.js +34 -0
  140. package/dist/bundle/store-TCWNLA3V.js +125 -0
  141. package/dist/bundle/store-UKPGGAPW.js +142 -0
  142. package/dist/bundle/store-maintenance-command-QHLUVBTJ.js +57 -0
  143. package/dist/bundle/terminal-TFCTWLOS.js +11 -0
  144. package/dist/bundle/tokens-DFCFRF7I.js +103 -0
  145. package/dist/commands/mcp.d.ts.map +1 -1
  146. package/dist/commands/mcp.js +82 -36
  147. package/dist/commands/mcp.js.map +1 -1
  148. package/dist/contract-overrides.d.ts.map +1 -1
  149. package/dist/contract-overrides.js +59 -53
  150. package/dist/contract-overrides.js.map +1 -1
  151. package/dist/mcp.d.ts +6 -5
  152. package/dist/mcp.d.ts.map +1 -1
  153. package/dist/mcp.js +13 -10
  154. package/dist/mcp.js.map +1 -1
  155. package/dist/program.js +4 -4
  156. package/dist/program.js.map +1 -1
  157. package/dist/registry.d.ts +2 -2
  158. package/dist/registry.d.ts.map +1 -1
  159. package/dist/registry.js +3 -3
  160. package/dist/registry.js.map +1 -1
  161. package/dist/state.d.ts +13 -2
  162. package/dist/state.d.ts.map +1 -1
  163. package/dist/state.js +12 -2
  164. package/dist/state.js.map +1 -1
  165. package/dist/version.d.ts +1 -1
  166. package/dist/version.js +1 -1
  167. package/package.json +7 -5
  168. package/skills/drive-cli/SKILL.md +1 -0
@@ -0,0 +1,13 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ readSecret
5
+ } from "./chunk-IKNU5A5Y.js";
6
+ import "./chunk-WUFCYDKB.js";
7
+ import "./chunk-VHT2WI4I.js";
8
+ import "./chunk-BJ3JRO34.js";
9
+ import "./chunk-Y5E2WNWB.js";
10
+ import "./chunk-ZVVMGPBJ.js";
11
+ export {
12
+ readSecret
13
+ };
@@ -0,0 +1,11 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ REASONS
5
+ } from "./chunk-MAXN7COO.js";
6
+ import "./chunk-O5EHUB2V.js";
7
+ import "./chunk-BJ3JRO34.js";
8
+ import "./chunk-ZVVMGPBJ.js";
9
+ export {
10
+ REASONS
11
+ };
@@ -0,0 +1,191 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import "./chunk-VHT2WI4I.js";
4
+ import {
5
+ CliError
6
+ } from "./chunk-BJ3JRO34.js";
7
+ import {
8
+ importFrom
9
+ } from "./chunk-Y5E2WNWB.js";
10
+ import {
11
+ __name
12
+ } from "./chunk-ZVVMGPBJ.js";
13
+
14
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/speech/recognize.js
15
+ import { createRequire } from "node:module";
16
+
17
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/speech/ogg-limit.js
18
+ var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "local transcription needs a complete mono or stereo Ogg Opus recording"), "invalid");
19
+ var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
20
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
21
+ let offset = 0;
22
+ let serial;
23
+ let packet = 0;
24
+ let length = 0;
25
+ const prefix = [];
26
+ while (offset < bytes.length) {
27
+ if (offset + 27 > bytes.length || view.getUint32(offset, false) !== 1332176723 || bytes[offset + 4] !== 0)
28
+ throw invalid();
29
+ const stream = view.getUint32(offset + 14, true);
30
+ if (serial !== void 0 && serial !== stream)
31
+ throw invalid();
32
+ serial = stream;
33
+ const segments = bytes[offset + 26] ?? 0;
34
+ let data = offset + 27 + segments;
35
+ if (data > bytes.length || Boolean((bytes[offset + 5] ?? 0) & 1) !== length > 0)
36
+ throw invalid();
37
+ for (let index = 0; index < segments; index++) {
38
+ const size = bytes[offset + 27 + index] ?? 0;
39
+ if (data + size > bytes.length)
40
+ throw invalid();
41
+ const take = Math.min(size, 19 - prefix.length);
42
+ for (let i = 0; i < take; i++)
43
+ prefix.push(bytes[data + i] ?? 0);
44
+ length += size;
45
+ data += size;
46
+ if (size === 255)
47
+ continue;
48
+ if (packet === 0) {
49
+ if (length < 19 || String.fromCharCode(...prefix.slice(0, 8)) !== "OpusHead" || ![1, 2].includes(prefix[9] ?? 0) || prefix[18] !== 0)
50
+ throw invalid();
51
+ } else if (packet === 1) {
52
+ if (length < 8 || String.fromCharCode(...prefix.slice(0, 8)) !== "OpusTags")
53
+ throw invalid();
54
+ } else {
55
+ if (length < 1)
56
+ throw invalid();
57
+ const toc = prefix[0] ?? 0;
58
+ const config = toc >> 3;
59
+ const frame = config >= 16 ? 120 << (config & 3) : config >= 12 ? 480 << (config & 1) : (config & 3) === 3 ? 2880 : 480 << (config & 3);
60
+ const count = (toc & 3) === 0 ? 1 : (toc & 3) === 3 ? length >= 2 ? (prefix[1] ?? 0) & 63 : 0 : 2;
61
+ if (count < 1 || frame * count > 5760)
62
+ throw invalid();
63
+ }
64
+ packet++;
65
+ length = 0;
66
+ prefix.length = 0;
67
+ }
68
+ offset = data;
69
+ }
70
+ if (length !== 0 || packet < 3)
71
+ throw invalid();
72
+ }, "checkOggDuration");
73
+
74
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/speech/recognize.js
75
+ var SAMPLE_RATE = 16e3;
76
+ var LEAD = SAMPLE_RATE / 2;
77
+ var toModelRate = /* @__PURE__ */ __name((samples, rate) => {
78
+ const step = rate / SAMPLE_RATE;
79
+ const length = Math.floor(samples.length / step);
80
+ const pcm = new Float32Array(LEAD + length);
81
+ for (let i = 0; i < length; i++) {
82
+ const from = Math.floor(i * step);
83
+ const to = Math.max(from + 1, Math.floor((i + 1) * step));
84
+ let sum = 0;
85
+ for (let j = from; j < to; j++)
86
+ sum += samples[j] ?? 0;
87
+ pcm[LEAD + i] = sum / (to - from);
88
+ }
89
+ return pcm;
90
+ }, "toModelRate");
91
+ var decodeOgg = /* @__PURE__ */ __name(async (bytes) => {
92
+ checkOggDuration(bytes);
93
+ const { OggOpusDecoder } = await importFrom(new URL("speech/recognize.js", import.meta.resolve("@wirecat/cli-core")).href, "ogg-opus-decoder");
94
+ const decoder = new OggOpusDecoder();
95
+ await decoder.ready;
96
+ try {
97
+ const { channelData, sampleRate, samplesDecoded } = await decoder.decodeFile(bytes);
98
+ const samples = channelData[0];
99
+ if (!samples || samplesDecoded === 0)
100
+ throw new Error("no Ogg Opus audio in it");
101
+ return { samples, rate: sampleRate };
102
+ } finally {
103
+ decoder.free();
104
+ }
105
+ }, "decodeOgg");
106
+ var WINDOW = 512;
107
+ var detector = /* @__PURE__ */ __name((vadModel) => ({
108
+ sileroVad: {
109
+ model: vadModel,
110
+ // At the default 0.5 a quietly spoken stretch in the middle of a voice message never counted as
111
+ // speech and was lost; 0.3 keeps it for both models and changes nothing on clear speech (126508, 2026-09-30).
112
+ threshold: 0.3,
113
+ minSilenceDuration: 0.5,
114
+ minSpeechDuration: 0.25,
115
+ maxSpeechDuration: 20,
116
+ windowSize: WINDOW
117
+ },
118
+ sampleRate: SAMPLE_RATE,
119
+ numThreads: 1,
120
+ provider: "cpu",
121
+ debug: 0,
122
+ bufferSizeInSeconds: 30
123
+ }), "detector");
124
+ var loaded;
125
+ var loadSherpa = /* @__PURE__ */ __name(() => {
126
+ if (loaded)
127
+ return loaded;
128
+ const load = createRequire(new URL("speech/recognize.js", import.meta.resolve("@wirecat/cli-core")).href);
129
+ const wasm = {};
130
+ load("sherpa-onnx/sherpa-onnx-wasm-nodejs.js")(wasm);
131
+ const stdout = wasm.FS?.getStream(1);
132
+ if (stdout)
133
+ stdout.nfd = 2;
134
+ const asr = load("sherpa-onnx/sherpa-onnx-asr.js");
135
+ const vad = load("sherpa-onnx/sherpa-onnx-vad.js");
136
+ loaded = {
137
+ createOfflineRecognizer: /* @__PURE__ */ __name((config) => new asr.OfflineRecognizer(config, wasm), "createOfflineRecognizer"),
138
+ createVad: /* @__PURE__ */ __name((config) => vad.createVad(wasm, config), "createVad")
139
+ };
140
+ return loaded;
141
+ }, "loadSherpa");
142
+ var openRecognizer = /* @__PURE__ */ __name((model, path, vadModel) => {
143
+ const sherpa = loadSherpa();
144
+ const engine = sherpa.createOfflineRecognizer({
145
+ featConfig: { sampleRate: SAMPLE_RATE, featureDim: model.featureDim },
146
+ modelConfig: { ...model.config(path), numThreads: 1, provider: "cpu", debug: 0 },
147
+ decodingMethod: "greedy_search"
148
+ });
149
+ const vad = sherpa.createVad(detector(vadModel));
150
+ const piece = /* @__PURE__ */ __name((samples) => {
151
+ const stream = engine.createStream();
152
+ try {
153
+ stream.acceptWaveform(SAMPLE_RATE, samples);
154
+ engine.decode(stream);
155
+ return engine.getResult(stream).text.trim();
156
+ } finally {
157
+ stream.free();
158
+ }
159
+ }, "piece");
160
+ return {
161
+ recognize: /* @__PURE__ */ __name((pcm) => {
162
+ vad.reset();
163
+ const parts = [];
164
+ const drain = /* @__PURE__ */ __name(() => {
165
+ while (!vad.isEmpty()) {
166
+ parts.push(piece(vad.front().samples));
167
+ vad.pop();
168
+ }
169
+ }, "drain");
170
+ for (let i = 0; i + WINDOW <= pcm.length; i += WINDOW) {
171
+ vad.acceptWaveform(pcm.subarray(i, i + WINDOW));
172
+ drain();
173
+ }
174
+ vad.flush();
175
+ drain();
176
+ return parts.filter(Boolean).join(" ");
177
+ }, "recognize"),
178
+ free: /* @__PURE__ */ __name(() => {
179
+ vad.free();
180
+ engine.free();
181
+ }, "free")
182
+ };
183
+ }, "openRecognizer");
184
+ export {
185
+ SAMPLE_RATE,
186
+ decodeOgg,
187
+ detector,
188
+ loadSherpa,
189
+ openRecognizer,
190
+ toModelRate
191
+ };
@@ -0,0 +1,28 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ DEFAULT_OPENAI_MODEL,
5
+ OPENAI_MODELS,
6
+ OPENAI_URL,
7
+ isLocal,
8
+ openRemote,
9
+ remoteKey,
10
+ remoteModel
11
+ } from "./chunk-PH74B2VZ.js";
12
+ import "./chunk-RCS2SCX5.js";
13
+ import "./chunk-5DPV7X27.js";
14
+ import "./chunk-GNFHZZ55.js";
15
+ import "./chunk-TRMIV3OA.js";
16
+ import "./chunk-VHT2WI4I.js";
17
+ import "./chunk-BJ3JRO34.js";
18
+ import "./chunk-Y5E2WNWB.js";
19
+ import "./chunk-ZVVMGPBJ.js";
20
+ export {
21
+ DEFAULT_OPENAI_MODEL,
22
+ OPENAI_MODELS,
23
+ OPENAI_URL,
24
+ isLocal,
25
+ openRemote,
26
+ remoteKey,
27
+ remoteModel
28
+ };
@@ -0,0 +1,51 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ defaultThreads,
5
+ loadModel,
6
+ truncated
7
+ } from "./chunk-RCS2SCX5.js";
8
+ import "./chunk-5DPV7X27.js";
9
+ import "./chunk-GNFHZZ55.js";
10
+ import "./chunk-TRMIV3OA.js";
11
+ import "./chunk-VHT2WI4I.js";
12
+ import "./chunk-BJ3JRO34.js";
13
+ import "./chunk-Y5E2WNWB.js";
14
+ import {
15
+ __name
16
+ } from "./chunk-ZVVMGPBJ.js";
17
+
18
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/embeddings/rerank.js
19
+ var openReranker = /* @__PURE__ */ __name(async (model, directory, { threads = defaultThreads() } = {}) => {
20
+ const { ort, tokenizer, session } = await loadModel(model, directory, threads);
21
+ const typeIds = session.inputNames.includes("token_type_ids");
22
+ const output = session.outputNames[0];
23
+ const one = /* @__PURE__ */ __name(async (question, passage) => {
24
+ const encoded = tokenizer.encode(question, { text_pair: passage, return_token_type_ids: true });
25
+ const ids = truncated(encoded.ids, model.maxTokens);
26
+ const shape = [1, ids.length];
27
+ const feeds = {
28
+ input_ids: new ort.Tensor("int64", BigInt64Array.from(ids, BigInt), shape),
29
+ attention_mask: new ort.Tensor("int64", new BigInt64Array(ids.length).fill(1n), shape)
30
+ };
31
+ if (typeIds)
32
+ feeds.token_type_ids = new ort.Tensor("int64", BigInt64Array.from(truncated(encoded.token_type_ids, model.maxTokens), BigInt), shape);
33
+ const logit = (await session.run(feeds))[output]?.data[0];
34
+ if (typeof logit !== "number" || !Number.isFinite(logit))
35
+ throw new Error(`${model.id} gave no score`);
36
+ return logit;
37
+ }, "one");
38
+ return {
39
+ model,
40
+ score: /* @__PURE__ */ __name(async (question, passages) => {
41
+ const scores = [];
42
+ for (const passage of passages)
43
+ scores.push(await one(question, passage));
44
+ return scores;
45
+ }, "score"),
46
+ close: /* @__PURE__ */ __name(() => session.release(), "close")
47
+ };
48
+ }, "openReranker");
49
+ export {
50
+ openReranker
51
+ };
@@ -0,0 +1,20 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ MCP_PATH,
5
+ serveOverHttp
6
+ } from "./chunk-R2A3K7ZF.js";
7
+ import "./chunk-DDYR6DYL.js";
8
+ import "./chunk-NLEB26GA.js";
9
+ import "./chunk-5FONRUG6.js";
10
+ import "./chunk-3HRDEJJW.js";
11
+ import "./chunk-NP3XLLN3.js";
12
+ import "./chunk-AIXLOMH4.js";
13
+ import "./chunk-VHT2WI4I.js";
14
+ import "./chunk-BJ3JRO34.js";
15
+ import "./chunk-Y5E2WNWB.js";
16
+ import "./chunk-ZVVMGPBJ.js";
17
+ export {
18
+ MCP_PATH,
19
+ serveOverHttp
20
+ };
@@ -0,0 +1,56 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ createBotServer,
5
+ serveBotOverStdio
6
+ } from "./chunk-4DW6QGEV.js";
7
+ import "./chunk-4NGLRHWO.js";
8
+ import "./chunk-XAZQTJXR.js";
9
+ import "./chunk-XF5MFUEB.js";
10
+ import "./chunk-G3FAOS52.js";
11
+ import "./chunk-GHOWRW7E.js";
12
+ import "./chunk-5FONRUG6.js";
13
+ import "./chunk-JVTVAZ5X.js";
14
+ import "./chunk-DL7D6Y3B.js";
15
+ import "./chunk-VCYFEWPD.js";
16
+ import "./chunk-DORXXBFC.js";
17
+ import "./chunk-5MGIL5LW.js";
18
+ import "./chunk-BEXHAGXH.js";
19
+ import "./chunk-AUS6TKP5.js";
20
+ import "./chunk-3Z7WSD2A.js";
21
+ import "./chunk-LOTQ2HMT.js";
22
+ import "./chunk-AIXLOMH4.js";
23
+ import "./chunk-CFZWPIVC.js";
24
+ import "./chunk-GOR3Z2FR.js";
25
+ import "./chunk-PJ7IQVOM.js";
26
+ import "./chunk-ZBM4GEV2.js";
27
+ import "./chunk-A3FU4RR6.js";
28
+ import "./chunk-MFS52LTZ.js";
29
+ import "./chunk-LJARCTGL.js";
30
+ import "./chunk-RJ633GFA.js";
31
+ import "./chunk-WUFCYDKB.js";
32
+ import "./chunk-KADPV4YA.js";
33
+ import "./chunk-PH74B2VZ.js";
34
+ import "./chunk-RCS2SCX5.js";
35
+ import "./chunk-5DPV7X27.js";
36
+ import "./chunk-GNFHZZ55.js";
37
+ import "./chunk-FEULDMWM.js";
38
+ import "./chunk-5TC3NCAF.js";
39
+ import "./chunk-AOOD3RMK.js";
40
+ import "./chunk-NB2N6L3R.js";
41
+ import "./chunk-BHE7ZY2N.js";
42
+ import "./chunk-R2QRP7EJ.js";
43
+ import "./chunk-O5EHUB2V.js";
44
+ import "./chunk-BQUPOB5H.js";
45
+ import "./chunk-GQW4GRYR.js";
46
+ import "./chunk-TRMIV3OA.js";
47
+ import "./chunk-VYBOYBLX.js";
48
+ import "./chunk-VHT2WI4I.js";
49
+ import "./chunk-BJ3JRO34.js";
50
+ import "./chunk-Y5E2WNWB.js";
51
+ import "./chunk-NW7IMGRR.js";
52
+ import "./chunk-ZVVMGPBJ.js";
53
+ export {
54
+ createBotServer,
55
+ serveBotOverStdio
56
+ };
@@ -0,0 +1,69 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ PER_RUN,
5
+ createServer,
6
+ envelope,
7
+ serveOverHttpUntilStopped,
8
+ serveOverStdio
9
+ } from "./chunk-K7FRUB33.js";
10
+ import "./chunk-IGMRWQP3.js";
11
+ import "./chunk-SWMMR3FR.js";
12
+ import "./chunk-CVIKKIGE.js";
13
+ import "./chunk-XAZQTJXR.js";
14
+ import "./chunk-XF5MFUEB.js";
15
+ import "./chunk-G3FAOS52.js";
16
+ import "./chunk-GHOWRW7E.js";
17
+ import "./chunk-DXKVEOSS.js";
18
+ import "./chunk-5FONRUG6.js";
19
+ import "./chunk-3HRDEJJW.js";
20
+ import "./chunk-IAW5A7OR.js";
21
+ import "./chunk-JVTVAZ5X.js";
22
+ import "./chunk-NP3XLLN3.js";
23
+ import "./chunk-DL7D6Y3B.js";
24
+ import "./chunk-VCYFEWPD.js";
25
+ import "./chunk-DORXXBFC.js";
26
+ import "./chunk-5MGIL5LW.js";
27
+ import "./chunk-K74PQVQZ.js";
28
+ import "./chunk-BEXHAGXH.js";
29
+ import "./chunk-AUS6TKP5.js";
30
+ import "./chunk-3Z7WSD2A.js";
31
+ import "./chunk-LOTQ2HMT.js";
32
+ import "./chunk-AIXLOMH4.js";
33
+ import "./chunk-CFZWPIVC.js";
34
+ import "./chunk-GOR3Z2FR.js";
35
+ import "./chunk-PJ7IQVOM.js";
36
+ import "./chunk-ZBM4GEV2.js";
37
+ import "./chunk-A3FU4RR6.js";
38
+ import "./chunk-MFS52LTZ.js";
39
+ import "./chunk-LJARCTGL.js";
40
+ import "./chunk-RJ633GFA.js";
41
+ import "./chunk-WUFCYDKB.js";
42
+ import "./chunk-KADPV4YA.js";
43
+ import "./chunk-PH74B2VZ.js";
44
+ import "./chunk-RCS2SCX5.js";
45
+ import "./chunk-5DPV7X27.js";
46
+ import "./chunk-GNFHZZ55.js";
47
+ import "./chunk-FEULDMWM.js";
48
+ import "./chunk-5TC3NCAF.js";
49
+ import "./chunk-AOOD3RMK.js";
50
+ import "./chunk-NB2N6L3R.js";
51
+ import "./chunk-BHE7ZY2N.js";
52
+ import "./chunk-R2QRP7EJ.js";
53
+ import "./chunk-O5EHUB2V.js";
54
+ import "./chunk-BQUPOB5H.js";
55
+ import "./chunk-GQW4GRYR.js";
56
+ import "./chunk-TRMIV3OA.js";
57
+ import "./chunk-VYBOYBLX.js";
58
+ import "./chunk-VHT2WI4I.js";
59
+ import "./chunk-BJ3JRO34.js";
60
+ import "./chunk-Y5E2WNWB.js";
61
+ import "./chunk-NW7IMGRR.js";
62
+ import "./chunk-ZVVMGPBJ.js";
63
+ export {
64
+ PER_RUN,
65
+ createServer,
66
+ envelope,
67
+ serveOverHttpUntilStopped,
68
+ serveOverStdio
69
+ };