agentgui 1.0.285 → 1.0.286

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 CHANGED
@@ -50,18 +50,8 @@ rmrf(out);
50
50
  fs.mkdirSync(out, { recursive: true });
51
51
 
52
52
  log('Compiling Windows executable...');
53
- const onWindows = process.platform === 'win32';
54
- const icoPath = path.join(src, 'agentgui.ico');
55
- const winFlags = onWindows ? [
56
- '--windows-hide-console',
57
- '--windows-title=AgentGUI',
58
- '--windows-description=Multi-agent GUI client for AI coding agents',
59
- '--windows-version=1.0.0.0',
60
- ...(fs.existsSync(icoPath) ? [`--windows-icon=${icoPath}`] : []),
61
- ] : [];
62
53
  execSync(
63
- [`~/.bun/bin/bun build --compile --target=bun-windows-x64`, ...winFlags,
64
- `--outfile=${path.join(out, 'agentgui.exe')}`, path.join(src, 'portable-entry.js')].join(' '),
54
+ `~/.bun/bin/bun build --compile --target=bun-windows-x64 --outfile=${path.join(out, 'agentgui.exe')} ${path.join(src, 'portable-entry.js')}`,
65
55
  { stdio: 'inherit', cwd: src }
66
56
  );
67
57
 
@@ -78,6 +68,30 @@ copyDir(path.join(src, 'static'), path.join(out, 'static'));
78
68
 
79
69
  const destNm = path.join(out, 'node_modules');
80
70
 
71
+ function collectDeps(pkgName, visited = new Set()) {
72
+ if (visited.has(pkgName)) return;
73
+ visited.add(pkgName);
74
+ const pkgJson = path.join(nm, pkgName, 'package.json');
75
+ if (!fs.existsSync(pkgJson)) return;
76
+ const p = JSON.parse(fs.readFileSync(pkgJson, 'utf8'));
77
+ for (const dep of Object.keys(p.dependencies || {})) collectDeps(dep, visited);
78
+ return visited;
79
+ }
80
+
81
+ function copyPkg(pkgName) {
82
+ const src2 = path.join(nm, pkgName);
83
+ const dest2 = path.join(destNm, pkgName);
84
+ if (!fs.existsSync(src2) || fs.existsSync(dest2)) return;
85
+ copyDir(src2, dest2);
86
+ }
87
+
88
+ log('Copying runtime JS deps (express, fsbrowse, busboy, ws, better-sqlite3 trees)...');
89
+ const runtimeRoots = ['express', 'fsbrowse', 'busboy', 'ws', 'better-sqlite3'];
90
+ const allDeps = new Set();
91
+ for (const root of runtimeRoots) collectDeps(root, allDeps);
92
+ for (const dep of allDeps) copyPkg(dep);
93
+ log(`Copied ${allDeps.size} runtime dep packages`);
94
+
81
95
  log('Copying @huggingface/transformers (dist + win32 natives)...');
82
96
  const hfSrc = path.join(nm, '@huggingface', 'transformers');
83
97
  const hfDest = path.join(destNm, '@huggingface', 'transformers');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.285",
3
+ "version": "1.0.286",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
package/portable-entry.js CHANGED
@@ -35,6 +35,8 @@ console.log(`[AgentGUI Portable] Exe directory: ${exeDir}`);
35
35
  console.log(`[AgentGUI Portable] Data directory: ${dataDir}`);
36
36
  console.log(`[AgentGUI Portable] Server starting on ${url}`);
37
37
 
38
+ process.chdir(exeDir);
39
+
38
40
  setTimeout(() => {
39
41
  const cmd = process.platform === 'win32' ? 'start' : process.platform === 'darwin' ? 'open' : 'xdg-open';
40
42
  spawn(cmd, [url], { shell: true, detached: true, stdio: 'ignore' }).unref();
package/server.js CHANGED
@@ -9,6 +9,9 @@ import { WebSocketServer } from 'ws';
9
9
  import { execSync, spawn } from 'child_process';
10
10
  import { createRequire } from 'module';
11
11
  import { OAuth2Client } from 'google-auth-library';
12
+ import express from 'express';
13
+ import Busboy from 'busboy';
14
+ import fsbrowse from 'fsbrowse';
12
15
  import { queries } from './database.js';
13
16
  import { runClaudeWithStreaming } from './lib/claude-runner.js';
14
17
  import IPFSDownloader from './lib/ipfs-downloader.js';
@@ -276,10 +279,6 @@ function pushTTSAudio(cacheKey, wav, conversationId, sessionId, voiceId) {
276
279
  });
277
280
  }
278
281
 
279
- const require = createRequire(import.meta.url);
280
- const express = require('express');
281
- const Busboy = require('busboy');
282
- const fsbrowse = require('fsbrowse');
283
282
 
284
283
  const SYSTEM_PROMPT = `Your output will be spoken aloud by a text-to-speech system. Write ONLY plain conversational sentences that sound natural when read aloud. Never use markdown, bold, italics, headers, bullet points, numbered lists, tables, or any formatting. Never use colons to introduce lists or options. Never use labels like "Option A" or "1." followed by a title. Instead of listing options, describe them conversationally in flowing sentences. For example, instead of "**Option 1**: Do X" say "One approach would be to do X." Keep sentences short and simple. Use transition words like "also", "another option", "or alternatively" to connect ideas. When mentioning file names, spell out the dot between the name and extension as the word "dot" so it is spoken clearly. For example, say "server dot js" instead of "server.js", "index dot html" instead of "index.html", and "package dot json" instead of "package.json". Write as if you are speaking to someone in a casual conversation.`;
285
284
 
@@ -3714,21 +3713,21 @@ function onServerReady() {
3714
3713
 
3715
3714
  resumeInterruptedStreams().catch(err => console.error('[RESUME] Startup error:', err.message));
3716
3715
 
3717
- ensureModelsDownloaded().then(ok => {
3716
+ ensureModelsDownloaded().then(async ok => {
3718
3717
  if (ok) console.log('[MODELS] Speech models ready');
3719
3718
  else console.log('[MODELS] Speech model download failed');
3720
3719
  try {
3721
- const { getVoices } = require('./lib/speech.js');
3720
+ const { getVoices } = await getSpeech();
3722
3721
  const voices = getVoices();
3723
3722
  broadcastSync({ type: 'voice_list', voices });
3724
3723
  } catch (err) {
3725
3724
  debugLog('[VOICE] Failed to broadcast voices: ' + err.message);
3726
3725
  broadcastSync({ type: 'voice_list', voices: [] });
3727
3726
  }
3728
- }).catch(err => {
3727
+ }).catch(async err => {
3729
3728
  console.error('[MODELS] Download error:', err.message);
3730
3729
  try {
3731
- const { getVoices } = require('./lib/speech.js');
3730
+ const { getVoices } = await getSpeech();
3732
3731
  const voices = getVoices();
3733
3732
  broadcastSync({ type: 'voice_list', voices });
3734
3733
  } catch (err2) {