agentgui 1.0.298 → 1.0.300
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/build-portable.js +16 -6
- package/lib/speech.js +1 -1
- package/package.json +1 -1
- package/server.js +14 -1
package/build-portable.js
CHANGED
|
@@ -111,6 +111,12 @@ copyDir(path.join(hfNmSrc, 'onnxruntime-common'), path.join(hfNmDest, 'onnxrunti
|
|
|
111
111
|
log('Copying webtalk...');
|
|
112
112
|
copyDir(path.join(nm, 'webtalk'), path.join(destNm, 'webtalk'));
|
|
113
113
|
|
|
114
|
+
log('Copying audio-decode...');
|
|
115
|
+
copyDir(path.join(nm, 'audio-decode'), path.join(destNm, 'audio-decode'));
|
|
116
|
+
const audioDeps = new Set();
|
|
117
|
+
collectDeps('audio-decode', audioDeps);
|
|
118
|
+
for (const dep of audioDeps) copyPkg(dep);
|
|
119
|
+
|
|
114
120
|
log('Copying @anthropic-ai/claude-code ripgrep (win32)...');
|
|
115
121
|
const claudeSrc = path.join(nm, '@anthropic-ai', 'claude-code');
|
|
116
122
|
const claudeDest = path.join(destNm, '@anthropic-ai', 'claude-code');
|
|
@@ -120,13 +126,17 @@ copyDir(path.join(claudeSrc, 'vendor', 'ripgrep', 'x64-win32'), path.join(claude
|
|
|
120
126
|
log('Creating data directory...');
|
|
121
127
|
fs.mkdirSync(path.join(out, 'data'), { recursive: true });
|
|
122
128
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (fs.existsSync(userModels)) {
|
|
126
|
-
copyDir(userModels, path.join(out, 'models'));
|
|
127
|
-
log(`Models bundled: ${Math.round(sizeOf(path.join(out, 'models')) / 1024 / 1024)}MB`);
|
|
129
|
+
if (process.env.NO_BUNDLE_MODELS === 'true') {
|
|
130
|
+
log('Skipping model bundling (NO_BUNDLE_MODELS=true) - models will download on first use');
|
|
128
131
|
} else {
|
|
129
|
-
log('
|
|
132
|
+
log('Bundling AI models...');
|
|
133
|
+
const userModels = path.join(os.homedir(), '.gmgui', 'models');
|
|
134
|
+
if (fs.existsSync(userModels)) {
|
|
135
|
+
copyDir(userModels, path.join(out, 'models'));
|
|
136
|
+
log(`Models bundled: ${Math.round(sizeOf(path.join(out, 'models')) / 1024 / 1024)}MB`);
|
|
137
|
+
} else {
|
|
138
|
+
log('WARNING: No models found at ~/.gmgui/models - portable build will download on first use');
|
|
139
|
+
}
|
|
130
140
|
}
|
|
131
141
|
|
|
132
142
|
fs.writeFileSync(path.join(out, 'README.txt'), [
|
package/lib/speech.js
CHANGED
|
@@ -14,7 +14,7 @@ let serverSTT = null;
|
|
|
14
14
|
let audioDecode = null;
|
|
15
15
|
let ttsUtils = null;
|
|
16
16
|
|
|
17
|
-
try { serverTTS = require('webtalk/server-tts'); } catch(e) { console.warn('[TTS] webtalk/server-tts unavailable:', e.message); }
|
|
17
|
+
try { serverTTS = require('webtalk/server-tts-onnx'); } catch(e) { console.warn('[TTS] webtalk/server-tts-onnx unavailable:', e.message); }
|
|
18
18
|
try { serverSTT = require('webtalk/server-stt'); } catch(e) { console.warn('[STT] webtalk/server-stt unavailable:', e.message); }
|
|
19
19
|
try { audioDecode = require('audio-decode'); } catch(e) { console.warn('[TTS] audio-decode unavailable:', e.message); }
|
|
20
20
|
try { ttsUtils = require('webtalk/tts-utils'); } catch(e) {}
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -86,7 +86,20 @@ async function ensureModelsDownloaded() {
|
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
const { checkTTSModelExists } = createRequire(import.meta.url)('webtalk/tts-models');
|
|
89
|
-
const
|
|
89
|
+
const whisperModelsLib = createRequire(import.meta.url)('webtalk/whisper-models');
|
|
90
|
+
const checkWhisperModelExists = whisperModelsLib.checkWhisperModelExists || (async (modelName, cfg) => {
|
|
91
|
+
const { isFileCorrupted } = whisperModelsLib;
|
|
92
|
+
const modelDir = path.join(cfg.modelsDir, modelName);
|
|
93
|
+
if (!fs.existsSync(modelDir)) return false;
|
|
94
|
+
const encoderPath = path.join(modelDir, 'onnx', 'encoder_model.onnx');
|
|
95
|
+
const decoderPath = path.join(modelDir, 'onnx', 'decoder_model_merged_q4.onnx');
|
|
96
|
+
const decoderFallback = path.join(modelDir, 'onnx', 'decoder_model_merged.onnx');
|
|
97
|
+
const hasEncoder = fs.existsSync(encoderPath);
|
|
98
|
+
const hasDecoder = fs.existsSync(decoderPath) || fs.existsSync(decoderFallback);
|
|
99
|
+
if (!hasEncoder || !hasDecoder) return false;
|
|
100
|
+
return !isFileCorrupted(encoderPath, 40 * 1024 * 1024) &&
|
|
101
|
+
(!isFileCorrupted(decoderPath, 100 * 1024 * 1024) || !isFileCorrupted(decoderFallback, 100 * 1024 * 1024));
|
|
102
|
+
});
|
|
90
103
|
|
|
91
104
|
const sttOk = await checkWhisperModelExists(config.defaultWhisperModel, config).catch(() => false);
|
|
92
105
|
const ttsOk = await checkTTSModelExists(config).catch(() => false);
|