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,311 +1,311 @@
1
- /**
2
- * Event Filter & Search
3
- * Provides event filtering, searching, and replay functionality
4
- */
5
-
6
- class EventFilter {
7
- constructor(renderer) {
8
- this.renderer = renderer;
9
- this.allEvents = [];
10
- this.filteredEvents = [];
11
- this.filterState = {
12
- types: new Set(), // Selected event types to show
13
- searchText: '',
14
- startTime: null,
15
- endTime: null,
16
- isActive: false
17
- };
18
- this.replayState = {
19
- isReplaying: false,
20
- currentIndex: 0,
21
- speed: 1
22
- };
23
- }
24
-
25
- /**
26
- * Store all events for filtering
27
- */
28
- trackEvent(event) {
29
- this.allEvents.push({
30
- ...event,
31
- trackingId: this.allEvents.length,
32
- trackedAt: Date.now()
33
- });
34
-
35
- // Limit history
36
- if (this.allEvents.length > 5000) {
37
- this.allEvents.shift();
38
- }
39
-
40
- // Apply current filters
41
- if (this.filterState.isActive) {
42
- this.applyFilters();
43
- }
44
-
45
- return event;
46
- }
47
-
48
- /**
49
- * Set event type filter
50
- */
51
- setTypeFilter(types) {
52
- this.filterState.types = new Set(types);
53
- this.applyFilters();
54
- }
55
-
56
- /**
57
- * Toggle event type in filter
58
- */
59
- toggleType(type) {
60
- if (this.filterState.types.has(type)) {
61
- this.filterState.types.delete(type);
62
- } else {
63
- this.filterState.types.add(type);
64
- }
65
- this.applyFilters();
66
- }
67
-
68
- /**
69
- * Set search text
70
- */
71
- setSearchText(text) {
72
- this.filterState.searchText = text.toLowerCase();
73
- this.applyFilters();
74
- }
75
-
76
- /**
77
- * Set time range
78
- */
79
- setTimeRange(startTime, endTime) {
80
- this.filterState.startTime = startTime;
81
- this.filterState.endTime = endTime;
82
- this.applyFilters();
83
- }
84
-
85
- /**
86
- * Apply all filters
87
- */
88
- applyFilters() {
89
- this.filterState.isActive =
90
- this.filterState.types.size > 0 ||
91
- this.filterState.searchText.length > 0 ||
92
- this.filterState.startTime !== null ||
93
- this.filterState.endTime !== null;
94
-
95
- if (!this.filterState.isActive) {
96
- this.filteredEvents = [...this.allEvents];
97
- return this.filteredEvents;
98
- }
99
-
100
- this.filteredEvents = this.allEvents.filter(event => {
101
- // Type filter
102
- if (this.filterState.types.size > 0 && !this.filterState.types.has(event.type)) {
103
- return false;
104
- }
105
-
106
- // Search filter
107
- if (this.filterState.searchText.length > 0) {
108
- const searchable = JSON.stringify(event).toLowerCase();
109
- if (!searchable.includes(this.filterState.searchText)) {
110
- return false;
111
- }
112
- }
113
-
114
- // Time range filter
115
- const eventTime = event.timestamp || event.trackedAt;
116
- if (this.filterState.startTime && eventTime < this.filterState.startTime) {
117
- return false;
118
- }
119
- if (this.filterState.endTime && eventTime > this.filterState.endTime) {
120
- return false;
121
- }
122
-
123
- return true;
124
- });
125
-
126
- return this.filteredEvents;
127
- }
128
-
129
- /**
130
- * Search events by text
131
- */
132
- search(query) {
133
- const results = [];
134
- const lowerQuery = query.toLowerCase();
135
-
136
- for (let i = 0; i < this.allEvents.length; i++) {
137
- const event = this.allEvents[i];
138
- const searchable = JSON.stringify(event).toLowerCase();
139
-
140
- if (searchable.includes(lowerQuery)) {
141
- results.push({
142
- event,
143
- index: i,
144
- matchCount: (searchable.match(new RegExp(lowerQuery, 'g')) || []).length
145
- });
146
- }
147
- }
148
-
149
- return results.sort((a, b) => b.matchCount - a.matchCount);
150
- }
151
-
152
- /**
153
- * Get event statistics
154
- */
155
- getStats() {
156
- const stats = {
157
- total: this.allEvents.length,
158
- byType: {},
159
- byTime: {
160
- oldest: null,
161
- newest: null,
162
- span: 0
163
- }
164
- };
165
-
166
- for (const event of this.allEvents) {
167
- // Count by type
168
- stats.byType[event.type] = (stats.byType[event.type] || 0) + 1;
169
-
170
- // Time stats
171
- const time = event.timestamp || event.trackedAt;
172
- if (!stats.byTime.oldest || time < stats.byTime.oldest) {
173
- stats.byTime.oldest = time;
174
- }
175
- if (!stats.byTime.newest || time > stats.byTime.newest) {
176
- stats.byTime.newest = time;
177
- }
178
- }
179
-
180
- if (stats.byTime.oldest && stats.byTime.newest) {
181
- stats.byTime.span = stats.byTime.newest - stats.byTime.oldest;
182
- }
183
-
184
- return stats;
185
- }
186
-
187
- /**
188
- * Start event replay
189
- */
190
- async startReplay(events = null, speed = 1) {
191
- const replayEvents = events || this.filteredEvents;
192
- if (replayEvents.length === 0) return;
193
-
194
- this.replayState.isReplaying = true;
195
- this.replayState.currentIndex = 0;
196
- this.replayState.speed = speed;
197
-
198
- // Clear renderer
199
- this.renderer.clear();
200
-
201
- for (const event of replayEvents) {
202
- if (!this.replayState.isReplaying) break;
203
-
204
- // Estimate delay based on event timestamps
205
- const delay = 100 / this.replayState.speed;
206
- await new Promise(resolve => setTimeout(resolve, delay));
207
-
208
- this.renderer.queueEvent(event);
209
- this.replayState.currentIndex++;
210
- }
211
-
212
- this.replayState.isReplaying = false;
213
- }
214
-
215
- /**
216
- * Stop event replay
217
- */
218
- stopReplay() {
219
- this.replayState.isReplaying = false;
220
- }
221
-
222
- /**
223
- * Get replay progress
224
- */
225
- getReplayProgress() {
226
- const total = this.filteredEvents.length;
227
- const current = this.replayState.currentIndex;
228
- return {
229
- current,
230
- total,
231
- percentage: total > 0 ? (current / total) * 100 : 0,
232
- isReplaying: this.replayState.isReplaying
233
- };
234
- }
235
-
236
- /**
237
- * Export filtered events
238
- */
239
- export(format = 'json') {
240
- const events = this.filterState.isActive ? this.filteredEvents : this.allEvents;
241
-
242
- switch (format) {
243
- case 'json':
244
- return JSON.stringify(events, null, 2);
245
-
246
- case 'csv':
247
- return this.exportAsCSV(events);
248
-
249
- case 'markdown':
250
- return this.exportAsMarkdown(events);
251
-
252
- default:
253
- return JSON.stringify(events);
254
- }
255
- }
256
-
257
- /**
258
- * Export as CSV
259
- */
260
- exportAsCSV(events) {
261
- const headers = ['timestamp', 'type', 'id', 'sessionId', 'message'];
262
- const rows = [headers.join(',')];
263
-
264
- for (const event of events) {
265
- const row = [
266
- new Date(event.timestamp || event.trackedAt).toISOString(),
267
- event.type,
268
- event.id || '',
269
- event.sessionId || '',
270
- JSON.stringify(event.message || event.content || event.text || '')
271
- ];
272
- rows.push(row.map(v => `"${v}"`).join(','));
273
- }
274
-
275
- return rows.join('\n');
276
- }
277
-
278
- /**
279
- * Export as Markdown
280
- */
281
- exportAsMarkdown(events) {
282
- const lines = ['# Event Export\n'];
283
- let currentType = null;
284
-
285
- for (const event of events) {
286
- if (event.type !== currentType) {
287
- currentType = event.type;
288
- lines.push(`\n## ${currentType}\n`);
289
- }
290
-
291
- const time = new Date(event.timestamp || event.trackedAt).toLocaleTimeString();
292
- lines.push(`- **${time}**: ${JSON.stringify(event)}`);
293
- }
294
-
295
- return lines.join('\n');
296
- }
297
-
298
- /**
299
- * Clear history
300
- */
301
- clear() {
302
- this.allEvents = [];
303
- this.filteredEvents = [];
304
- this.stopReplay();
305
- }
306
- }
307
-
308
- // Export for use in browser
309
- if (typeof module !== 'undefined' && module.exports) {
310
- module.exports = EventFilter;
311
- }
1
+ /**
2
+ * Event Filter & Search
3
+ * Provides event filtering, searching, and replay functionality
4
+ */
5
+
6
+ class EventFilter {
7
+ constructor(renderer) {
8
+ this.renderer = renderer;
9
+ this.allEvents = [];
10
+ this.filteredEvents = [];
11
+ this.filterState = {
12
+ types: new Set(), // Selected event types to show
13
+ searchText: '',
14
+ startTime: null,
15
+ endTime: null,
16
+ isActive: false
17
+ };
18
+ this.replayState = {
19
+ isReplaying: false,
20
+ currentIndex: 0,
21
+ speed: 1
22
+ };
23
+ }
24
+
25
+ /**
26
+ * Store all events for filtering
27
+ */
28
+ trackEvent(event) {
29
+ this.allEvents.push({
30
+ ...event,
31
+ trackingId: this.allEvents.length,
32
+ trackedAt: Date.now()
33
+ });
34
+
35
+ // Limit history
36
+ if (this.allEvents.length > 5000) {
37
+ this.allEvents.shift();
38
+ }
39
+
40
+ // Apply current filters
41
+ if (this.filterState.isActive) {
42
+ this.applyFilters();
43
+ }
44
+
45
+ return event;
46
+ }
47
+
48
+ /**
49
+ * Set event type filter
50
+ */
51
+ setTypeFilter(types) {
52
+ this.filterState.types = new Set(types);
53
+ this.applyFilters();
54
+ }
55
+
56
+ /**
57
+ * Toggle event type in filter
58
+ */
59
+ toggleType(type) {
60
+ if (this.filterState.types.has(type)) {
61
+ this.filterState.types.delete(type);
62
+ } else {
63
+ this.filterState.types.add(type);
64
+ }
65
+ this.applyFilters();
66
+ }
67
+
68
+ /**
69
+ * Set search text
70
+ */
71
+ setSearchText(text) {
72
+ this.filterState.searchText = text.toLowerCase();
73
+ this.applyFilters();
74
+ }
75
+
76
+ /**
77
+ * Set time range
78
+ */
79
+ setTimeRange(startTime, endTime) {
80
+ this.filterState.startTime = startTime;
81
+ this.filterState.endTime = endTime;
82
+ this.applyFilters();
83
+ }
84
+
85
+ /**
86
+ * Apply all filters
87
+ */
88
+ applyFilters() {
89
+ this.filterState.isActive =
90
+ this.filterState.types.size > 0 ||
91
+ this.filterState.searchText.length > 0 ||
92
+ this.filterState.startTime !== null ||
93
+ this.filterState.endTime !== null;
94
+
95
+ if (!this.filterState.isActive) {
96
+ this.filteredEvents = [...this.allEvents];
97
+ return this.filteredEvents;
98
+ }
99
+
100
+ this.filteredEvents = this.allEvents.filter(event => {
101
+ // Type filter
102
+ if (this.filterState.types.size > 0 && !this.filterState.types.has(event.type)) {
103
+ return false;
104
+ }
105
+
106
+ // Search filter
107
+ if (this.filterState.searchText.length > 0) {
108
+ const searchable = JSON.stringify(event).toLowerCase();
109
+ if (!searchable.includes(this.filterState.searchText)) {
110
+ return false;
111
+ }
112
+ }
113
+
114
+ // Time range filter
115
+ const eventTime = event.timestamp || event.trackedAt;
116
+ if (this.filterState.startTime && eventTime < this.filterState.startTime) {
117
+ return false;
118
+ }
119
+ if (this.filterState.endTime && eventTime > this.filterState.endTime) {
120
+ return false;
121
+ }
122
+
123
+ return true;
124
+ });
125
+
126
+ return this.filteredEvents;
127
+ }
128
+
129
+ /**
130
+ * Search events by text
131
+ */
132
+ search(query) {
133
+ const results = [];
134
+ const lowerQuery = query.toLowerCase();
135
+
136
+ for (let i = 0; i < this.allEvents.length; i++) {
137
+ const event = this.allEvents[i];
138
+ const searchable = JSON.stringify(event).toLowerCase();
139
+
140
+ if (searchable.includes(lowerQuery)) {
141
+ results.push({
142
+ event,
143
+ index: i,
144
+ matchCount: (searchable.match(new RegExp(lowerQuery, 'g')) || []).length
145
+ });
146
+ }
147
+ }
148
+
149
+ return results.sort((a, b) => b.matchCount - a.matchCount);
150
+ }
151
+
152
+ /**
153
+ * Get event statistics
154
+ */
155
+ getStats() {
156
+ const stats = {
157
+ total: this.allEvents.length,
158
+ byType: {},
159
+ byTime: {
160
+ oldest: null,
161
+ newest: null,
162
+ span: 0
163
+ }
164
+ };
165
+
166
+ for (const event of this.allEvents) {
167
+ // Count by type
168
+ stats.byType[event.type] = (stats.byType[event.type] || 0) + 1;
169
+
170
+ // Time stats
171
+ const time = event.timestamp || event.trackedAt;
172
+ if (!stats.byTime.oldest || time < stats.byTime.oldest) {
173
+ stats.byTime.oldest = time;
174
+ }
175
+ if (!stats.byTime.newest || time > stats.byTime.newest) {
176
+ stats.byTime.newest = time;
177
+ }
178
+ }
179
+
180
+ if (stats.byTime.oldest && stats.byTime.newest) {
181
+ stats.byTime.span = stats.byTime.newest - stats.byTime.oldest;
182
+ }
183
+
184
+ return stats;
185
+ }
186
+
187
+ /**
188
+ * Start event replay
189
+ */
190
+ async startReplay(events = null, speed = 1) {
191
+ const replayEvents = events || this.filteredEvents;
192
+ if (replayEvents.length === 0) return;
193
+
194
+ this.replayState.isReplaying = true;
195
+ this.replayState.currentIndex = 0;
196
+ this.replayState.speed = speed;
197
+
198
+ // Clear renderer
199
+ this.renderer.clear();
200
+
201
+ for (const event of replayEvents) {
202
+ if (!this.replayState.isReplaying) break;
203
+
204
+ // Estimate delay based on event timestamps
205
+ const delay = 100 / this.replayState.speed;
206
+ await new Promise(resolve => setTimeout(resolve, delay));
207
+
208
+ this.renderer.queueEvent(event);
209
+ this.replayState.currentIndex++;
210
+ }
211
+
212
+ this.replayState.isReplaying = false;
213
+ }
214
+
215
+ /**
216
+ * Stop event replay
217
+ */
218
+ stopReplay() {
219
+ this.replayState.isReplaying = false;
220
+ }
221
+
222
+ /**
223
+ * Get replay progress
224
+ */
225
+ getReplayProgress() {
226
+ const total = this.filteredEvents.length;
227
+ const current = this.replayState.currentIndex;
228
+ return {
229
+ current,
230
+ total,
231
+ percentage: total > 0 ? (current / total) * 100 : 0,
232
+ isReplaying: this.replayState.isReplaying
233
+ };
234
+ }
235
+
236
+ /**
237
+ * Export filtered events
238
+ */
239
+ export(format = 'json') {
240
+ const events = this.filterState.isActive ? this.filteredEvents : this.allEvents;
241
+
242
+ switch (format) {
243
+ case 'json':
244
+ return JSON.stringify(events, null, 2);
245
+
246
+ case 'csv':
247
+ return this.exportAsCSV(events);
248
+
249
+ case 'markdown':
250
+ return this.exportAsMarkdown(events);
251
+
252
+ default:
253
+ return JSON.stringify(events);
254
+ }
255
+ }
256
+
257
+ /**
258
+ * Export as CSV
259
+ */
260
+ exportAsCSV(events) {
261
+ const headers = ['timestamp', 'type', 'id', 'sessionId', 'message'];
262
+ const rows = [headers.join(',')];
263
+
264
+ for (const event of events) {
265
+ const row = [
266
+ new Date(event.timestamp || event.trackedAt).toISOString(),
267
+ event.type,
268
+ event.id || '',
269
+ event.sessionId || '',
270
+ JSON.stringify(event.message || event.content || event.text || '')
271
+ ];
272
+ rows.push(row.map(v => `"${v}"`).join(','));
273
+ }
274
+
275
+ return rows.join('\n');
276
+ }
277
+
278
+ /**
279
+ * Export as Markdown
280
+ */
281
+ exportAsMarkdown(events) {
282
+ const lines = ['# Event Export\n'];
283
+ let currentType = null;
284
+
285
+ for (const event of events) {
286
+ if (event.type !== currentType) {
287
+ currentType = event.type;
288
+ lines.push(`\n## ${currentType}\n`);
289
+ }
290
+
291
+ const time = new Date(event.timestamp || event.trackedAt).toLocaleTimeString();
292
+ lines.push(`- **${time}**: ${JSON.stringify(event)}`);
293
+ }
294
+
295
+ return lines.join('\n');
296
+ }
297
+
298
+ /**
299
+ * Clear history
300
+ */
301
+ clear() {
302
+ this.allEvents = [];
303
+ this.filteredEvents = [];
304
+ this.stopReplay();
305
+ }
306
+ }
307
+
308
+ // Export for use in browser
309
+ if (typeof module !== 'undefined' && module.exports) {
310
+ module.exports = EventFilter;
311
+ }