agentgui 1.0.289 → 1.0.291
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 +11 -1
- package/lib/speech.js +3 -0
- package/package.json +1 -1
- package/server.js +16 -7
package/build-portable.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
import os from 'os';
|
|
3
4
|
import { fileURLToPath } from 'url';
|
|
4
5
|
import { execSync } from 'child_process';
|
|
5
6
|
|
|
@@ -51,7 +52,7 @@ fs.mkdirSync(out, { recursive: true });
|
|
|
51
52
|
|
|
52
53
|
log('Compiling Windows executable...');
|
|
53
54
|
execSync(
|
|
54
|
-
|
|
55
|
+
`"${path.join(os.homedir(), '.bun', 'bin', 'bun')}" build --compile --target=bun-windows-x64 --outfile="${path.join(out, 'agentgui.exe')}" "${path.join(src, 'portable-entry.js')}"`,
|
|
55
56
|
{ stdio: 'inherit', cwd: src }
|
|
56
57
|
);
|
|
57
58
|
|
|
@@ -119,6 +120,15 @@ copyDir(path.join(claudeSrc, 'vendor', 'ripgrep', 'x64-win32'), path.join(claude
|
|
|
119
120
|
log('Creating data directory...');
|
|
120
121
|
fs.mkdirSync(path.join(out, 'data'), { recursive: true });
|
|
121
122
|
|
|
123
|
+
log('Bundling AI models...');
|
|
124
|
+
const userModels = path.join(os.homedir(), '.gmgui', 'models');
|
|
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`);
|
|
128
|
+
} else {
|
|
129
|
+
log('WARNING: No models found at ~/.gmgui/models - portable build will download on first use');
|
|
130
|
+
}
|
|
131
|
+
|
|
122
132
|
fs.writeFileSync(path.join(out, 'README.txt'), [
|
|
123
133
|
'# AgentGUI Portable',
|
|
124
134
|
'',
|
package/lib/speech.js
CHANGED
|
@@ -29,6 +29,9 @@ const POCKET_TTS_VOICES = [
|
|
|
29
29
|
const PREDEFINED_IDS = new Set(POCKET_TTS_VOICES.filter(v => v.id !== 'default').map(v => v.id));
|
|
30
30
|
|
|
31
31
|
function getSttOptions() {
|
|
32
|
+
if (process.env.PORTABLE_EXE_DIR) {
|
|
33
|
+
return { cacheDir: path.join(process.env.PORTABLE_EXE_DIR, 'models') };
|
|
34
|
+
}
|
|
32
35
|
if (process.env.PORTABLE_DATA_DIR) {
|
|
33
36
|
return { cacheDir: path.join(process.env.PORTABLE_DATA_DIR, 'models') };
|
|
34
37
|
}
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -75,9 +75,11 @@ async function ensureModelsDownloaded() {
|
|
|
75
75
|
const { createRequire: cr } = await import('module');
|
|
76
76
|
const r = cr(import.meta.url);
|
|
77
77
|
|
|
78
|
+
const bundledModels = process.env.PORTABLE_EXE_DIR ? path.join(process.env.PORTABLE_EXE_DIR, 'models') : null;
|
|
78
79
|
const gmguiModels = path.join(os.homedir(), '.gmgui', 'models');
|
|
79
|
-
const
|
|
80
|
-
const
|
|
80
|
+
const modelsBase = (bundledModels && fs.existsSync(path.join(bundledModels, 'onnx-community'))) ? bundledModels : gmguiModels;
|
|
81
|
+
const sttDir = path.join(modelsBase, 'onnx-community', 'whisper-base');
|
|
82
|
+
const ttsDir = path.join(modelsBase, 'tts');
|
|
81
83
|
|
|
82
84
|
const sttOk = fs.existsSync(sttDir) && fs.readdirSync(sttDir).length > 0;
|
|
83
85
|
const ttsOk = fs.existsSync(ttsDir) && fs.readdirSync(ttsDir).length > 0;
|
|
@@ -2611,13 +2613,20 @@ const server = http.createServer(async (req, res) => {
|
|
|
2611
2613
|
try {
|
|
2612
2614
|
const { getStatus } = await getSpeech();
|
|
2613
2615
|
const baseStatus = getStatus();
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2616
|
+
let pythonDetected = false, pythonVersion = null;
|
|
2617
|
+
try {
|
|
2618
|
+
const r = createRequire(import.meta.url);
|
|
2619
|
+
const serverTTS = r('webtalk/server-tts');
|
|
2620
|
+
if (typeof serverTTS.detectPython === 'function') {
|
|
2621
|
+
const pyInfo = serverTTS.detectPython();
|
|
2622
|
+
pythonDetected = pyInfo.found;
|
|
2623
|
+
pythonVersion = pyInfo.version || null;
|
|
2624
|
+
}
|
|
2625
|
+
} catch(e) {}
|
|
2617
2626
|
sendJSON(req, res, 200, {
|
|
2618
2627
|
...baseStatus,
|
|
2619
|
-
pythonDetected
|
|
2620
|
-
pythonVersion
|
|
2628
|
+
pythonDetected,
|
|
2629
|
+
pythonVersion,
|
|
2621
2630
|
setupMessage: baseStatus.ttsReady ? 'pocket-tts ready' : 'Will setup on first TTS request',
|
|
2622
2631
|
modelsDownloading: modelDownloadState.downloading,
|
|
2623
2632
|
modelsComplete: modelDownloadState.complete,
|