agentgui 1.0.274 → 1.0.275

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 (69) hide show
  1. package/CLAUDE.md +280 -280
  2. package/IPFS_DOWNLOADER.md +277 -277
  3. package/TASK_2C_COMPLETION.md +334 -334
  4. package/bin/gmgui.cjs +54 -54
  5. package/build-portable.js +3 -42
  6. package/database.js +1422 -1406
  7. package/lib/claude-runner.js +1130 -1130
  8. package/lib/ipfs-downloader.js +459 -459
  9. package/lib/speech.js +152 -152
  10. package/package.json +1 -1
  11. package/readme.md +76 -76
  12. package/server.js +3787 -3794
  13. package/setup-npm-token.sh +68 -68
  14. package/static/app.js +773 -773
  15. package/static/event-rendering-showcase.html +708 -708
  16. package/static/index.html +3178 -3180
  17. package/static/js/agent-auth.js +298 -298
  18. package/static/js/audio-recorder-processor.js +18 -18
  19. package/static/js/client.js +2656 -2656
  20. package/static/js/conversations.js +583 -583
  21. package/static/js/dialogs.js +267 -267
  22. package/static/js/event-consolidator.js +101 -101
  23. package/static/js/event-filter.js +311 -311
  24. package/static/js/event-processor.js +452 -452
  25. package/static/js/features.js +413 -413
  26. package/static/js/kalman-filter.js +67 -67
  27. package/static/js/progress-dialog.js +130 -130
  28. package/static/js/script-runner.js +219 -219
  29. package/static/js/streaming-renderer.js +2123 -2120
  30. package/static/js/syntax-highlighter.js +269 -269
  31. package/static/js/tts-websocket-handler.js +152 -152
  32. package/static/js/ui-components.js +431 -431
  33. package/static/js/voice.js +849 -849
  34. package/static/js/websocket-manager.js +596 -596
  35. package/static/templates/INDEX.html +465 -465
  36. package/static/templates/README.md +190 -190
  37. package/static/templates/agent-capabilities.html +56 -56
  38. package/static/templates/agent-metadata-panel.html +44 -44
  39. package/static/templates/agent-status-badge.html +30 -30
  40. package/static/templates/code-annotation-panel.html +155 -155
  41. package/static/templates/code-suggestion-panel.html +184 -184
  42. package/static/templates/command-header.html +77 -77
  43. package/static/templates/command-output-scrollable.html +118 -118
  44. package/static/templates/elapsed-time.html +54 -54
  45. package/static/templates/error-alert.html +106 -106
  46. package/static/templates/error-history-timeline.html +160 -160
  47. package/static/templates/error-recovery-options.html +109 -109
  48. package/static/templates/error-stack-trace.html +95 -95
  49. package/static/templates/error-summary.html +80 -80
  50. package/static/templates/event-counter.html +48 -48
  51. package/static/templates/execution-actions.html +97 -97
  52. package/static/templates/execution-progress-bar.html +80 -80
  53. package/static/templates/execution-stepper.html +120 -120
  54. package/static/templates/file-breadcrumb.html +118 -118
  55. package/static/templates/file-diff-viewer.html +121 -121
  56. package/static/templates/file-metadata.html +133 -133
  57. package/static/templates/file-read-panel.html +66 -66
  58. package/static/templates/file-write-panel.html +120 -120
  59. package/static/templates/git-branch-remote.html +107 -107
  60. package/static/templates/git-diff-list.html +101 -101
  61. package/static/templates/git-log-visualization.html +153 -153
  62. package/static/templates/git-status-panel.html +115 -115
  63. package/static/templates/quality-metrics-display.html +170 -170
  64. package/static/templates/terminal-output-panel.html +87 -87
  65. package/static/templates/test-results-display.html +144 -144
  66. package/static/theme.js +72 -72
  67. package/test-download-progress.js +223 -223
  68. package/test-websocket-broadcast.js +147 -147
  69. package/tests/ipfs-downloader.test.js +370 -370
package/bin/gmgui.cjs CHANGED
@@ -1,20 +1,20 @@
1
- #!/usr/bin/env node
2
- const { spawn, spawnSync } = require('child_process');
3
- const path = require('path');
4
- const fs = require('fs');
5
-
6
- const projectRoot = path.join(__dirname, '..');
7
-
8
- async function gmgui(args = []) {
9
- const command = args[0] || 'start';
10
-
11
- if (command === 'start') {
12
- // Always use node as runtime for reliability. When invoked via bunx,
13
- // dependencies are already managed. When invoked via npm/npx, we install
14
- // dependencies ourselves. This avoids ENOENT errors on systems where bun
15
- // may not be in PATH even though bunx works.
16
- const installer = 'npm';
17
-
1
+ #!/usr/bin/env node
2
+ const { spawn, spawnSync } = require('child_process');
3
+ const path = require('path');
4
+ const fs = require('fs');
5
+
6
+ const projectRoot = path.join(__dirname, '..');
7
+
8
+ async function gmgui(args = []) {
9
+ const command = args[0] || 'start';
10
+
11
+ if (command === 'start') {
12
+ // Always use node as runtime for reliability. When invoked via bunx,
13
+ // dependencies are already managed. When invoked via npm/npx, we install
14
+ // dependencies ourselves. This avoids ENOENT errors on systems where bun
15
+ // may not be in PATH even though bunx works.
16
+ const installer = 'npm';
17
+
18
18
  // Ensure dependencies are installed only if node_modules is missing
19
19
  // Skip this for bunx/npx which manage dependencies independently
20
20
  const nodeModulesPath = path.join(projectRoot, 'node_modules');
@@ -40,40 +40,40 @@ async function gmgui(args = []) {
40
40
  throw new Error(`${installer} install failed: ${installResult.error.message}`);
41
41
  }
42
42
  }
43
-
44
- const port = process.env.PORT || 3000;
45
- const baseUrl = process.env.BASE_URL || '/gm';
46
- const runtime = 'node';
47
-
48
- return new Promise((resolve, reject) => {
49
- const ps = spawn(runtime, [path.join(projectRoot, 'server.js')], {
50
- cwd: projectRoot,
51
- env: { ...process.env, PORT: port, BASE_URL: baseUrl, STARTUP_CWD: process.cwd() },
52
- stdio: 'inherit'
53
- });
54
-
55
- ps.on('error', (err) => {
56
- console.error(`Failed to start server: ${err.message}`);
57
- reject(err);
58
- });
59
-
60
- ps.on('exit', (code) => {
61
- if (code !== 0) {
62
- console.error(`Server exited with code ${code}`);
63
- // Don't reject - keep the promise pending so process stays alive
64
- }
65
- });
66
-
67
- // Never resolve this promise - keeps the process alive indefinitely
68
- });
69
- } else {
70
- throw new Error(`Unknown command: ${command}`);
71
- }
72
- }
73
-
74
- // Always run when executed as a bin file (this file should only be used that way)
75
- // Works with npm, npx, bunx, and direct execution
76
- gmgui(process.argv.slice(2)).catch(err => {
77
- console.error(err.message);
78
- process.exit(1);
79
- });
43
+
44
+ const port = process.env.PORT || 3000;
45
+ const baseUrl = process.env.BASE_URL || '/gm';
46
+ const runtime = 'node';
47
+
48
+ return new Promise((resolve, reject) => {
49
+ const ps = spawn(runtime, [path.join(projectRoot, 'server.js')], {
50
+ cwd: projectRoot,
51
+ env: { ...process.env, PORT: port, BASE_URL: baseUrl, STARTUP_CWD: process.cwd() },
52
+ stdio: 'inherit'
53
+ });
54
+
55
+ ps.on('error', (err) => {
56
+ console.error(`Failed to start server: ${err.message}`);
57
+ reject(err);
58
+ });
59
+
60
+ ps.on('exit', (code) => {
61
+ if (code !== 0) {
62
+ console.error(`Server exited with code ${code}`);
63
+ // Don't reject - keep the promise pending so process stays alive
64
+ }
65
+ });
66
+
67
+ // Never resolve this promise - keeps the process alive indefinitely
68
+ });
69
+ } else {
70
+ throw new Error(`Unknown command: ${command}`);
71
+ }
72
+ }
73
+
74
+ // Always run when executed as a bin file (this file should only be used that way)
75
+ // Works with npm, npx, bunx, and direct execution
76
+ gmgui(process.argv.slice(2)).catch(err => {
77
+ console.error(err.message);
78
+ process.exit(1);
79
+ });
package/build-portable.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
3
  import { fileURLToPath } from 'url';
4
- import { execSync, execFileSync } from 'child_process';
4
+ import { execSync } from 'child_process';
5
5
 
6
6
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
7
  const src = __dirname;
8
8
  const out = path.join(src, '..', 'wagentgui');
9
9
  const nm = path.join(src, 'node_modules');
10
- const BUN_WIN_CACHE = path.join(process.env.HOME, '.bun', 'install', 'cache', 'bun-windows-x64-v1.3.9');
11
10
 
12
11
  function log(msg) { console.log('[BUILD] ' + msg); }
13
12
 
@@ -46,55 +45,17 @@ function sizeOf(dir) {
46
45
  return sz;
47
46
  }
48
47
 
49
- function ensureWinBun() {
50
- if (fs.existsSync(BUN_WIN_CACHE)) {
51
- const stat = fs.statSync(BUN_WIN_CACHE);
52
- if (stat.size > 50 * 1024 * 1024) {
53
- // Verify it's a PE file
54
- const buf = Buffer.alloc(2);
55
- const fd = fs.openSync(BUN_WIN_CACHE, 'r');
56
- fs.readSync(fd, buf, 0, 2, 0);
57
- fs.closeSync(fd);
58
- if (buf[0] === 0x4D && buf[1] === 0x5A) return BUN_WIN_CACHE;
59
- }
60
- }
61
- log('Downloading Windows Bun binary...');
62
- execSync(
63
- `~/.bun/bin/bun build --compile --target=bun-windows-x64 --outfile=/tmp/_bun_trigger.exe /dev/null 2>/dev/null || true`,
64
- { stdio: 'inherit' }
65
- );
66
- if (fs.existsSync(BUN_WIN_CACHE)) return BUN_WIN_CACHE;
67
- throw new Error(`Windows Bun binary not found at ${BUN_WIN_CACHE}. Run: bun build --compile --target=bun-windows-x64 --outfile=/tmp/x.exe /dev/null`);
68
- }
69
-
70
48
  log('Output: ' + out);
71
49
  rmrf(out);
72
50
  fs.mkdirSync(out, { recursive: true });
73
51
 
74
- log('Building JS bundle...');
52
+ log('Compiling Windows executable...');
75
53
  execSync(
76
- `~/.bun/bin/bun build --minify --target=bun --outfile=${path.join(out, 'bundle.js')} ${path.join(src, 'portable-entry.js')}`,
54
+ `~/.bun/bin/bun build --compile --target=bun-windows-x64 --outfile=${path.join(out, 'agentgui.exe')} ${path.join(src, 'portable-entry.js')}`,
77
55
  { stdio: 'inherit', cwd: src }
78
56
  );
79
- const bundleSize = fs.statSync(path.join(out, 'bundle.js')).size;
80
- log(`Bundle: ${Math.round(bundleSize / 1024)}KB`);
81
-
82
- log('Locating Windows Bun binary...');
83
- const bunWinPath = ensureWinBun();
84
- log(`Windows Bun: ${bunWinPath} (${Math.round(fs.statSync(bunWinPath).size / 1024 / 1024)}MB)`);
85
-
86
- log('Injecting bundle into Windows Bun exe (.bun PE section)...');
87
- const injector = path.join(src, 'scripts', 'inject-pe-section.py');
88
- execFileSync('python3', [
89
- injector,
90
- bunWinPath,
91
- path.join(out, 'bundle.js'),
92
- path.join(out, 'agentgui.exe')
93
- ], { stdio: 'inherit' });
94
- fs.unlinkSync(path.join(out, 'bundle.js'));
95
57
 
96
58
  const exeSize = fs.statSync(path.join(out, 'agentgui.exe')).size;
97
- // Verify PE magic
98
59
  const buf = Buffer.alloc(2);
99
60
  const fd = fs.openSync(path.join(out, 'agentgui.exe'), 'r');
100
61
  fs.readSync(fd, buf, 0, 2, 0);