agentgui 1.0.338 → 1.0.340

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.338",
3
+ "version": "1.0.340",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -30,7 +30,7 @@
30
30
  "fsbrowse": "^0.2.18",
31
31
  "google-auth-library": "^10.5.0",
32
32
  "onnxruntime-node": "1.21.0",
33
- "webtalk": "^1.0.20",
33
+ "webtalk": "^1.0.21",
34
34
  "ws": "^8.14.2"
35
35
  },
36
36
  "overrides": {
package/server.js CHANGED
@@ -14,7 +14,6 @@ import Busboy from 'busboy';
14
14
  import fsbrowse from 'fsbrowse';
15
15
  import { queries } from './database.js';
16
16
  import { runClaudeWithStreaming } from './lib/claude-runner.js';
17
- import { downloadWithFallback } from './lib/model-downloader.js';
18
17
 
19
18
  const ttsTextAccumulators = new Map();
20
19
 
@@ -71,79 +70,32 @@ async function ensureModelsDownloaded() {
71
70
  return modelDownloadState.complete;
72
71
  }
73
72
 
73
+ modelDownloadState.downloading = true;
74
+ modelDownloadState.error = null;
75
+
74
76
  try {
77
+ const r = createRequire(import.meta.url);
78
+ const { createConfig } = r('webtalk/config');
79
+ const { ensureModel } = r('webtalk/whisper-models');
80
+ const { ensureTTSModels } = r('webtalk/tts-models');
75
81
  const gmguiModels = path.join(os.homedir(), '.gmgui', 'models');
76
82
  const modelsBase = process.env.PORTABLE_EXE_DIR
77
83
  ? (fs.existsSync(path.join(process.env.PORTABLE_EXE_DIR, 'models', 'onnx-community')) ? path.join(process.env.PORTABLE_EXE_DIR, 'models') : gmguiModels)
78
84
  : gmguiModels;
79
85
 
80
- const manifestPath = path.join(gmguiModels, '.manifests.json');
81
- if (!fs.existsSync(manifestPath)) {
82
- throw new Error('Model manifest not found at ' + manifestPath);
83
- }
84
-
85
- const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
86
-
87
- const whisperCidRecord = queries.getIpfsCidByModel('whisper-base', 'stt');
88
- const ttsCidRecord = queries.getIpfsCidByModel('tts-models', 'voice');
89
-
90
- modelDownloadState.downloading = true;
91
- modelDownloadState.error = null;
92
-
93
- const downloadModel = async (modelName, modelType, cidRecord) => {
94
- const modelManifest = manifest[modelName];
95
- if (!modelManifest) {
96
- throw new Error(`Model ${modelName} not found in manifest`);
97
- }
98
-
99
- const isWhisper = modelType === 'stt';
100
- const baseDir = isWhisper
101
- ? path.join(modelsBase, 'onnx-community', 'whisper-base')
102
- : path.join(modelsBase, 'tts');
103
-
104
- fs.mkdirSync(baseDir, { recursive: true });
105
-
106
- for (const [filename, fileInfo] of Object.entries(modelManifest.files)) {
107
- const destPath = path.join(baseDir, filename);
108
-
109
- if (fs.existsSync(destPath) && fs.statSync(destPath).size === fileInfo.size) {
110
- console.log(`[MODELS] ${filename} already exists, skipping`);
111
- continue;
112
- }
86
+ const config = createConfig({
87
+ modelsDir: modelsBase,
88
+ ttsModelsDir: path.join(modelsBase, 'tts'),
89
+ });
113
90
 
114
- const ipfsCid = cidRecord ? `${cidRecord.cid}/${filename}` : null;
115
- const huggingfaceUrl = isWhisper
116
- ? `https://huggingface.co/onnx-community/whisper-base/resolve/main/${filename}`
117
- : `https://huggingface.co/datasets/AnEntrypoint/sttttsmodels/resolve/main/tts/${filename}`;
118
-
119
- await downloadWithFallback({
120
- ipfsCid,
121
- huggingfaceUrl,
122
- destPath,
123
- manifest: fileInfo,
124
- minBytes: fileInfo.size * 0.8,
125
- preferredLayer: ipfsCid ? 'ipfs' : 'huggingface'
126
- }, (progress) => {
127
- broadcastModelProgress({
128
- started: true,
129
- done: progress.status === 'success',
130
- downloading: progress.status === 'downloading',
131
- type: modelType === 'stt' ? 'whisper' : 'tts',
132
- source: progress.layer === 'cache' ? 'cache' : progress.layer,
133
- status: progress.status,
134
- file: filename,
135
- progress: progress.total ? (progress.downloaded / progress.total * 100) : 0,
136
- gateway: progress.gateway
137
- });
138
- });
139
- }
140
- };
91
+ broadcastModelProgress({ started: true, done: false, downloading: true, type: 'whisper', status: 'starting' });
92
+ await ensureModel('onnx-community/whisper-base', config);
141
93
 
142
- await downloadModel('whisper-base', 'stt', whisperCidRecord);
143
- await downloadModel('tts-models', 'voice', ttsCidRecord);
94
+ broadcastModelProgress({ started: true, done: false, downloading: true, type: 'tts', status: 'starting' });
95
+ await ensureTTSModels(config);
144
96
 
145
97
  modelDownloadState.complete = true;
146
- broadcastModelProgress({ started: true, done: true, downloading: false });
98
+ broadcastModelProgress({ started: true, done: true, complete: true, downloading: false });
147
99
  return true;
148
100
  } catch (err) {
149
101
  console.error('[MODELS] Download error:', err.message);
package/static/index.html CHANGED
@@ -37,7 +37,7 @@
37
37
  --color-info: #0891b2;
38
38
  --sidebar-width: 300px;
39
39
  --header-height: 52px;
40
- --msg-max-width: 100%;
40
+ --msg-max-width: 800px;
41
41
  }
42
42
 
43
43
  html.dark {
@@ -1381,7 +1381,6 @@
1381
1381
  .block-text {
1382
1382
  margin-bottom: 0;
1383
1383
  padding: 0.5rem 0.75rem;
1384
- background: var(--color-bg-primary);
1385
1384
  border-radius: 0.5rem;
1386
1385
  line-height: 1.5;
1387
1386
  font-size: 0.9rem;
@@ -3029,7 +3028,7 @@
3029
3028
  <div class="view-toggle-bar" id="viewToggleBar">
3030
3029
  <button class="view-toggle-btn active" data-view="chat">Chat</button>
3031
3030
  <button class="view-toggle-btn" data-view="files">Files</button>
3032
- <button class="view-toggle-btn" data-view="voice" style="display:none;">Voice</button>
3031
+ <button class="view-toggle-btn" data-view="voice">Voice</button>
3033
3032
  <button class="view-toggle-btn" data-view="terminal" id="terminalTabBtn">Terminal</button>
3034
3033
  </div>
3035
3034
 
@@ -2139,15 +2139,6 @@ class AgentGUIClient {
2139
2139
  }
2140
2140
  }
2141
2141
 
2142
- _updateVoiceTabState() {
2143
- var voiceBtn = document.querySelector('[data-view="voice"]');
2144
- if (voiceBtn) {
2145
- var isReady = this._modelDownloadProgress?.done === true ||
2146
- this._modelDownloadProgress?.complete === true;
2147
- voiceBtn.title = isReady ? 'Voice' : 'Voice (click to download models)';
2148
- }
2149
- }
2150
-
2151
2142
  _toggleConnectionTooltip() {
2152
2143
  let tooltip = document.getElementById('connection-tooltip');
2153
2144
  if (tooltip) { tooltip.remove(); return; }
@@ -2714,20 +2705,10 @@ class AgentGUIClient {
2714
2705
 
2715
2706
  _updateVoiceTabState() {
2716
2707
  const voiceBtn = document.querySelector('[data-view="voice"]');
2717
- const voiceContainer = document.getElementById('voiceContainer');
2718
- if (!voiceBtn || !voiceContainer) return;
2719
-
2708
+ if (!voiceBtn) return;
2720
2709
  const isReady = this._modelDownloadProgress?.done === true &&
2721
2710
  this._modelDownloadProgress?.complete === true;
2722
-
2723
- if (isReady) {
2724
- voiceBtn.style.display = 'flex';
2725
- voiceBtn.style.opacity = '1';
2726
- voiceBtn.style.pointerEvents = 'auto';
2727
- } else {
2728
- voiceBtn.style.display = 'none';
2729
- voiceContainer.style.display = 'none';
2730
- }
2711
+ voiceBtn.title = isReady ? 'Voice' : 'Voice (click to download models)';
2731
2712
  }
2732
2713
 
2733
2714
  /**