agentgui 1.0.273 → 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 (71) 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 +111 -0
  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/portable-entry.js +43 -0
  12. package/readme.md +76 -76
  13. package/scripts/inject-pe-section.py +185 -0
  14. package/server.js +3787 -3794
  15. package/setup-npm-token.sh +68 -68
  16. package/static/app.js +773 -773
  17. package/static/event-rendering-showcase.html +708 -708
  18. package/static/index.html +3178 -3180
  19. package/static/js/agent-auth.js +298 -298
  20. package/static/js/audio-recorder-processor.js +18 -18
  21. package/static/js/client.js +2656 -2656
  22. package/static/js/conversations.js +583 -583
  23. package/static/js/dialogs.js +267 -267
  24. package/static/js/event-consolidator.js +101 -101
  25. package/static/js/event-filter.js +311 -311
  26. package/static/js/event-processor.js +452 -452
  27. package/static/js/features.js +413 -413
  28. package/static/js/kalman-filter.js +67 -67
  29. package/static/js/progress-dialog.js +130 -130
  30. package/static/js/script-runner.js +219 -219
  31. package/static/js/streaming-renderer.js +2123 -2120
  32. package/static/js/syntax-highlighter.js +269 -269
  33. package/static/js/tts-websocket-handler.js +152 -152
  34. package/static/js/ui-components.js +431 -431
  35. package/static/js/voice.js +849 -849
  36. package/static/js/websocket-manager.js +596 -596
  37. package/static/templates/INDEX.html +465 -465
  38. package/static/templates/README.md +190 -190
  39. package/static/templates/agent-capabilities.html +56 -56
  40. package/static/templates/agent-metadata-panel.html +44 -44
  41. package/static/templates/agent-status-badge.html +30 -30
  42. package/static/templates/code-annotation-panel.html +155 -155
  43. package/static/templates/code-suggestion-panel.html +184 -184
  44. package/static/templates/command-header.html +77 -77
  45. package/static/templates/command-output-scrollable.html +118 -118
  46. package/static/templates/elapsed-time.html +54 -54
  47. package/static/templates/error-alert.html +106 -106
  48. package/static/templates/error-history-timeline.html +160 -160
  49. package/static/templates/error-recovery-options.html +109 -109
  50. package/static/templates/error-stack-trace.html +95 -95
  51. package/static/templates/error-summary.html +80 -80
  52. package/static/templates/event-counter.html +48 -48
  53. package/static/templates/execution-actions.html +97 -97
  54. package/static/templates/execution-progress-bar.html +80 -80
  55. package/static/templates/execution-stepper.html +120 -120
  56. package/static/templates/file-breadcrumb.html +118 -118
  57. package/static/templates/file-diff-viewer.html +121 -121
  58. package/static/templates/file-metadata.html +133 -133
  59. package/static/templates/file-read-panel.html +66 -66
  60. package/static/templates/file-write-panel.html +120 -120
  61. package/static/templates/git-branch-remote.html +107 -107
  62. package/static/templates/git-diff-list.html +101 -101
  63. package/static/templates/git-log-visualization.html +153 -153
  64. package/static/templates/git-status-panel.html +115 -115
  65. package/static/templates/quality-metrics-display.html +170 -170
  66. package/static/templates/terminal-output-panel.html +87 -87
  67. package/static/templates/test-results-display.html +144 -144
  68. package/static/theme.js +72 -72
  69. package/test-download-progress.js +223 -223
  70. package/test-websocket-broadcast.js +147 -147
  71. package/tests/ipfs-downloader.test.js +370 -370
@@ -1,147 +1,147 @@
1
- import { WebSocketServer } from 'ws';
2
- import http from 'http';
3
- import path from 'path';
4
- import os from 'os';
5
-
6
- const PORT = 8899;
7
- const server = http.createServer();
8
- const wss = new WebSocketServer({ server, clientTracking: true });
9
-
10
- let broadcastedMessages = [];
11
- let clientConnected = false;
12
-
13
- wss.on('connection', (ws) => {
14
- clientConnected = true;
15
- console.log('[WS] Client connected');
16
-
17
- ws.on('message', (data) => {
18
- const msg = JSON.parse(data);
19
- console.log('[WS] Client sent:', msg.type);
20
- });
21
-
22
- ws.on('close', () => {
23
- clientConnected = false;
24
- console.log('[WS] Client disconnected');
25
- });
26
- });
27
-
28
- function broadcastSync(event) {
29
- if (wss.clients.size === 0) return;
30
- const data = JSON.stringify(event);
31
- broadcastedMessages.push(event);
32
- for (const client of wss.clients) {
33
- if (client.readyState === 1) {
34
- client.send(data);
35
- }
36
- }
37
- }
38
-
39
- function broadcastModelProgress(progress) {
40
- const broadcastData = {
41
- type: 'model_download_progress',
42
- modelId: progress.type || 'unknown',
43
- bytesDownloaded: progress.bytesDownloaded || 0,
44
- bytesRemaining: progress.bytesRemaining || 0,
45
- totalBytes: progress.totalBytes || 0,
46
- downloadSpeed: progress.downloadSpeed || 0,
47
- eta: progress.eta || 0,
48
- retryCount: progress.retryCount || 0,
49
- currentGateway: progress.currentGateway || '',
50
- status: progress.status || (progress.done ? 'completed' : progress.downloading ? 'downloading' : 'paused'),
51
- percentComplete: progress.percentComplete || 0,
52
- completedFiles: progress.completedFiles || 0,
53
- totalFiles: progress.totalFiles || 0,
54
- timestamp: Date.now(),
55
- ...progress
56
- };
57
- broadcastSync(broadcastData);
58
- }
59
-
60
- server.listen(PORT, () => {
61
- console.log(`[Server] Listening on ws://localhost:${PORT}`);
62
-
63
- setTimeout(() => {
64
- console.log('\n[Test] Simulating model download progress...\n');
65
-
66
- broadcastModelProgress({
67
- type: 'stt',
68
- started: true,
69
- downloading: true,
70
- completedFiles: 0,
71
- totalFiles: 10
72
- });
73
-
74
- setTimeout(() => {
75
- broadcastModelProgress({
76
- type: 'stt',
77
- bytesDownloaded: 5242880,
78
- bytesRemaining: 20971520,
79
- totalBytes: 26214400,
80
- downloadSpeed: 1048576,
81
- eta: 20,
82
- retryCount: 0,
83
- currentGateway: 'https://huggingface.co/',
84
- status: 'downloading',
85
- percentComplete: 20,
86
- completedFiles: 2,
87
- totalFiles: 10
88
- });
89
-
90
- setTimeout(() => {
91
- broadcastModelProgress({
92
- type: 'stt',
93
- bytesDownloaded: 15728640,
94
- bytesRemaining: 10485760,
95
- totalBytes: 26214400,
96
- downloadSpeed: 2097152,
97
- eta: 5,
98
- retryCount: 0,
99
- currentGateway: 'https://huggingface.co/',
100
- status: 'downloading',
101
- percentComplete: 60,
102
- completedFiles: 6,
103
- totalFiles: 10
104
- });
105
-
106
- setTimeout(() => {
107
- broadcastModelProgress({
108
- type: 'stt',
109
- started: true,
110
- done: true,
111
- downloading: false,
112
- completedFiles: 10,
113
- totalFiles: 10,
114
- status: 'completed'
115
- });
116
-
117
- setTimeout(() => {
118
- console.log('\n[Test] Broadcasting complete. Results:\n');
119
- console.log(`Broadcasted messages: ${broadcastedMessages.length}`);
120
- console.log(`Client connected: ${clientConnected}`);
121
-
122
- console.log('\nMessage types:');
123
- broadcastedMessages.forEach((msg, idx) => {
124
- console.log(` [${idx + 1}] Type: ${msg.type}`);
125
- console.log(` Status: ${msg.status}`);
126
- console.log(` Complete: ${msg.percentComplete || msg.completedFiles}%`);
127
- console.log(` Speed: ${msg.downloadSpeed ? (msg.downloadSpeed / 1024 / 1024).toFixed(2) + 'MB/s' : 'N/A'}`);
128
- console.log(` ETA: ${msg.eta || 0}s`);
129
- });
130
-
131
- const requiredFields = ['modelId', 'bytesDownloaded', 'bytesRemaining', 'downloadSpeed', 'eta', 'retryCount', 'currentGateway', 'status'];
132
- const allFieldsPresent = broadcastedMessages.every(msg =>
133
- requiredFields.every(field => field in msg)
134
- );
135
-
136
- console.log(`\nAll required fields present: ${allFieldsPresent ? 'PASS' : 'FAIL'}`);
137
- console.log(`Message count >= 3: ${broadcastedMessages.length >= 3 ? 'PASS' : 'FAIL'}`);
138
-
139
- server.close(() => {
140
- process.exit(allFieldsPresent && broadcastedMessages.length >= 3 ? 0 : 1);
141
- });
142
- }, 500);
143
- }, 500);
144
- }, 500);
145
- }, 500);
146
- }, 500);
147
- });
1
+ import { WebSocketServer } from 'ws';
2
+ import http from 'http';
3
+ import path from 'path';
4
+ import os from 'os';
5
+
6
+ const PORT = 8899;
7
+ const server = http.createServer();
8
+ const wss = new WebSocketServer({ server, clientTracking: true });
9
+
10
+ let broadcastedMessages = [];
11
+ let clientConnected = false;
12
+
13
+ wss.on('connection', (ws) => {
14
+ clientConnected = true;
15
+ console.log('[WS] Client connected');
16
+
17
+ ws.on('message', (data) => {
18
+ const msg = JSON.parse(data);
19
+ console.log('[WS] Client sent:', msg.type);
20
+ });
21
+
22
+ ws.on('close', () => {
23
+ clientConnected = false;
24
+ console.log('[WS] Client disconnected');
25
+ });
26
+ });
27
+
28
+ function broadcastSync(event) {
29
+ if (wss.clients.size === 0) return;
30
+ const data = JSON.stringify(event);
31
+ broadcastedMessages.push(event);
32
+ for (const client of wss.clients) {
33
+ if (client.readyState === 1) {
34
+ client.send(data);
35
+ }
36
+ }
37
+ }
38
+
39
+ function broadcastModelProgress(progress) {
40
+ const broadcastData = {
41
+ type: 'model_download_progress',
42
+ modelId: progress.type || 'unknown',
43
+ bytesDownloaded: progress.bytesDownloaded || 0,
44
+ bytesRemaining: progress.bytesRemaining || 0,
45
+ totalBytes: progress.totalBytes || 0,
46
+ downloadSpeed: progress.downloadSpeed || 0,
47
+ eta: progress.eta || 0,
48
+ retryCount: progress.retryCount || 0,
49
+ currentGateway: progress.currentGateway || '',
50
+ status: progress.status || (progress.done ? 'completed' : progress.downloading ? 'downloading' : 'paused'),
51
+ percentComplete: progress.percentComplete || 0,
52
+ completedFiles: progress.completedFiles || 0,
53
+ totalFiles: progress.totalFiles || 0,
54
+ timestamp: Date.now(),
55
+ ...progress
56
+ };
57
+ broadcastSync(broadcastData);
58
+ }
59
+
60
+ server.listen(PORT, () => {
61
+ console.log(`[Server] Listening on ws://localhost:${PORT}`);
62
+
63
+ setTimeout(() => {
64
+ console.log('\n[Test] Simulating model download progress...\n');
65
+
66
+ broadcastModelProgress({
67
+ type: 'stt',
68
+ started: true,
69
+ downloading: true,
70
+ completedFiles: 0,
71
+ totalFiles: 10
72
+ });
73
+
74
+ setTimeout(() => {
75
+ broadcastModelProgress({
76
+ type: 'stt',
77
+ bytesDownloaded: 5242880,
78
+ bytesRemaining: 20971520,
79
+ totalBytes: 26214400,
80
+ downloadSpeed: 1048576,
81
+ eta: 20,
82
+ retryCount: 0,
83
+ currentGateway: 'https://huggingface.co/',
84
+ status: 'downloading',
85
+ percentComplete: 20,
86
+ completedFiles: 2,
87
+ totalFiles: 10
88
+ });
89
+
90
+ setTimeout(() => {
91
+ broadcastModelProgress({
92
+ type: 'stt',
93
+ bytesDownloaded: 15728640,
94
+ bytesRemaining: 10485760,
95
+ totalBytes: 26214400,
96
+ downloadSpeed: 2097152,
97
+ eta: 5,
98
+ retryCount: 0,
99
+ currentGateway: 'https://huggingface.co/',
100
+ status: 'downloading',
101
+ percentComplete: 60,
102
+ completedFiles: 6,
103
+ totalFiles: 10
104
+ });
105
+
106
+ setTimeout(() => {
107
+ broadcastModelProgress({
108
+ type: 'stt',
109
+ started: true,
110
+ done: true,
111
+ downloading: false,
112
+ completedFiles: 10,
113
+ totalFiles: 10,
114
+ status: 'completed'
115
+ });
116
+
117
+ setTimeout(() => {
118
+ console.log('\n[Test] Broadcasting complete. Results:\n');
119
+ console.log(`Broadcasted messages: ${broadcastedMessages.length}`);
120
+ console.log(`Client connected: ${clientConnected}`);
121
+
122
+ console.log('\nMessage types:');
123
+ broadcastedMessages.forEach((msg, idx) => {
124
+ console.log(` [${idx + 1}] Type: ${msg.type}`);
125
+ console.log(` Status: ${msg.status}`);
126
+ console.log(` Complete: ${msg.percentComplete || msg.completedFiles}%`);
127
+ console.log(` Speed: ${msg.downloadSpeed ? (msg.downloadSpeed / 1024 / 1024).toFixed(2) + 'MB/s' : 'N/A'}`);
128
+ console.log(` ETA: ${msg.eta || 0}s`);
129
+ });
130
+
131
+ const requiredFields = ['modelId', 'bytesDownloaded', 'bytesRemaining', 'downloadSpeed', 'eta', 'retryCount', 'currentGateway', 'status'];
132
+ const allFieldsPresent = broadcastedMessages.every(msg =>
133
+ requiredFields.every(field => field in msg)
134
+ );
135
+
136
+ console.log(`\nAll required fields present: ${allFieldsPresent ? 'PASS' : 'FAIL'}`);
137
+ console.log(`Message count >= 3: ${broadcastedMessages.length >= 3 ? 'PASS' : 'FAIL'}`);
138
+
139
+ server.close(() => {
140
+ process.exit(allFieldsPresent && broadcastedMessages.length >= 3 ? 0 : 1);
141
+ });
142
+ }, 500);
143
+ }, 500);
144
+ }, 500);
145
+ }, 500);
146
+ }, 500);
147
+ });