agentgui 1.0.67 → 1.0.68
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/.prd +214 -0
- package/.prd-browser +607 -0
- package/CLAUDE.md +1532 -125
- package/browser-test-harness.js +371 -0
- package/browser-test.js +409 -0
- package/execute-tests.js +164 -0
- package/lib/claude-runner.js +41 -12
- package/lib/database-service.ts +252 -0
- package/lib/sync-service.ts +275 -0
- package/lib/types.ts +168 -0
- package/package.json +1 -1
- package/readme.md +586 -0
- package/run-e2e-test.sh +88 -0
- package/server.js +274 -8
- package/static/index.html +487 -180
- package/static/js/client.js +558 -0
- package/static/js/event-filter.js +311 -0
- package/static/js/event-processor.js +454 -0
- package/static/js/streaming-renderer.js +813 -0
- package/static/js/syntax-highlighter.js +271 -0
- package/static/js/ui-components.js +433 -0
- package/static/js/websocket-manager.js +482 -0
- package/static/templates/INDEX.html +465 -0
- package/static/templates/README.md +190 -0
- package/static/templates/agent-capabilities.html +56 -0
- package/static/templates/agent-metadata-panel.html +44 -0
- package/static/templates/agent-status-badge.html +30 -0
- package/static/templates/code-annotation-panel.html +155 -0
- package/static/templates/code-suggestion-panel.html +184 -0
- package/static/templates/command-header.html +77 -0
- package/static/templates/command-output-scrollable.html +118 -0
- package/static/templates/elapsed-time.html +54 -0
- package/static/templates/error-alert.html +106 -0
- package/static/templates/error-history-timeline.html +160 -0
- package/static/templates/error-recovery-options.html +109 -0
- package/static/templates/error-stack-trace.html +95 -0
- package/static/templates/error-summary.html +80 -0
- package/static/templates/event-counter.html +48 -0
- package/static/templates/execution-actions.html +97 -0
- package/static/templates/execution-progress-bar.html +80 -0
- package/static/templates/execution-stepper.html +120 -0
- package/static/templates/file-breadcrumb.html +118 -0
- package/static/templates/file-diff-viewer.html +121 -0
- package/static/templates/file-metadata.html +133 -0
- package/static/templates/file-read-panel.html +66 -0
- package/static/templates/file-write-panel.html +120 -0
- package/static/templates/git-branch-remote.html +107 -0
- package/static/templates/git-diff-list.html +101 -0
- package/static/templates/git-log-visualization.html +153 -0
- package/static/templates/git-status-panel.html +115 -0
- package/static/templates/quality-metrics-display.html +170 -0
- package/static/templates/terminal-output-panel.html +87 -0
- package/static/templates/test-results-display.html +144 -0
- package/test-browser.js +457 -0
- package/test-runner.js +182 -0
package/lib/types.ts
CHANGED
|
@@ -243,3 +243,171 @@ export interface RecoveryState {
|
|
|
243
243
|
readonly pendingOperations: readonly unknown[];
|
|
244
244
|
readonly offline: boolean;
|
|
245
245
|
}
|
|
246
|
+
|
|
247
|
+
// ============================================================================
|
|
248
|
+
// STREAMING & EXECUTION TYPES
|
|
249
|
+
// ============================================================================
|
|
250
|
+
|
|
251
|
+
export type ContentBlockType = 'text' | 'image' | 'tool_use' | 'tool_result' | 'document';
|
|
252
|
+
|
|
253
|
+
export interface TextBlock {
|
|
254
|
+
readonly type: 'text';
|
|
255
|
+
readonly text: string;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export interface ImageBlock {
|
|
259
|
+
readonly type: 'image';
|
|
260
|
+
readonly source: {
|
|
261
|
+
readonly type: 'url' | 'base64';
|
|
262
|
+
readonly url?: string;
|
|
263
|
+
readonly media_type?: string;
|
|
264
|
+
readonly data?: string;
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface ToolUseBlock {
|
|
269
|
+
readonly type: 'tool_use';
|
|
270
|
+
readonly id: string;
|
|
271
|
+
readonly name: string;
|
|
272
|
+
readonly input: Record<string, unknown>;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface ToolResultBlock {
|
|
276
|
+
readonly type: 'tool_result';
|
|
277
|
+
readonly tool_use_id: string;
|
|
278
|
+
readonly content: string;
|
|
279
|
+
readonly is_error?: boolean;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface DocumentBlock {
|
|
283
|
+
readonly type: 'document';
|
|
284
|
+
readonly source: {
|
|
285
|
+
readonly type: 'url' | 'base64' | 'file';
|
|
286
|
+
readonly url?: string;
|
|
287
|
+
readonly media_type?: string;
|
|
288
|
+
readonly data?: string;
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export type ContentBlock = TextBlock | ImageBlock | ToolUseBlock | ToolResultBlock | DocumentBlock;
|
|
293
|
+
|
|
294
|
+
export interface ClaudeMessage {
|
|
295
|
+
readonly id: string;
|
|
296
|
+
readonly type: 'message';
|
|
297
|
+
readonly role: 'user' | 'assistant';
|
|
298
|
+
readonly content: readonly ContentBlock[];
|
|
299
|
+
readonly model?: string;
|
|
300
|
+
readonly stop_reason?: 'end_turn' | 'max_tokens' | 'tool_use' | 'stop_sequence';
|
|
301
|
+
readonly stop_sequence?: string;
|
|
302
|
+
readonly usage?: {
|
|
303
|
+
readonly input_tokens: number;
|
|
304
|
+
readonly output_tokens: number;
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface ExecutionMetadata {
|
|
309
|
+
readonly sessionId: string;
|
|
310
|
+
readonly conversationId: string;
|
|
311
|
+
readonly agentId: string;
|
|
312
|
+
readonly startTime: number;
|
|
313
|
+
readonly endTime?: number;
|
|
314
|
+
readonly duration?: number;
|
|
315
|
+
readonly inputTokens?: number;
|
|
316
|
+
readonly outputTokens?: number;
|
|
317
|
+
readonly totalTokens?: number;
|
|
318
|
+
readonly toolCalls: number;
|
|
319
|
+
readonly toolResults: number;
|
|
320
|
+
readonly errorCount: number;
|
|
321
|
+
readonly status: 'running' | 'completed' | 'error' | 'timeout' | 'interrupted';
|
|
322
|
+
readonly errorMessage?: string;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export type StreamingEventType =
|
|
326
|
+
| 'streaming_start'
|
|
327
|
+
| 'content_block_start'
|
|
328
|
+
| 'content_block_delta'
|
|
329
|
+
| 'content_block_stop'
|
|
330
|
+
| 'message_start'
|
|
331
|
+
| 'message_delta'
|
|
332
|
+
| 'message_stop'
|
|
333
|
+
| 'streaming_error'
|
|
334
|
+
| 'streaming_complete';
|
|
335
|
+
|
|
336
|
+
export interface StreamingEvent {
|
|
337
|
+
readonly type: StreamingEventType;
|
|
338
|
+
readonly timestamp: number;
|
|
339
|
+
readonly sessionId: string;
|
|
340
|
+
readonly conversationId: string;
|
|
341
|
+
readonly data: Record<string, unknown>;
|
|
342
|
+
readonly eventId?: string;
|
|
343
|
+
readonly retryable?: boolean;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export interface StreamingStartEvent extends StreamingEvent {
|
|
347
|
+
readonly type: 'streaming_start';
|
|
348
|
+
readonly data: {
|
|
349
|
+
readonly sessionId: string;
|
|
350
|
+
readonly messageId: string;
|
|
351
|
+
readonly agentId: string;
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export interface ContentBlockStartEvent extends StreamingEvent {
|
|
356
|
+
readonly type: 'content_block_start';
|
|
357
|
+
readonly data: {
|
|
358
|
+
readonly index: number;
|
|
359
|
+
readonly blockType: ContentBlockType;
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export interface ContentBlockDeltaEvent extends StreamingEvent {
|
|
364
|
+
readonly type: 'content_block_delta';
|
|
365
|
+
readonly data: {
|
|
366
|
+
readonly index: number;
|
|
367
|
+
readonly delta: {
|
|
368
|
+
readonly type: 'text_delta' | 'input_json_delta';
|
|
369
|
+
readonly text?: string;
|
|
370
|
+
readonly partial_json?: string;
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export interface ContentBlockStopEvent extends StreamingEvent {
|
|
376
|
+
readonly type: 'content_block_stop';
|
|
377
|
+
readonly data: {
|
|
378
|
+
readonly index: number;
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export interface MessageStopEvent extends StreamingEvent {
|
|
383
|
+
readonly type: 'message_stop';
|
|
384
|
+
readonly data: {
|
|
385
|
+
readonly messageId: string;
|
|
386
|
+
readonly stopReason: string;
|
|
387
|
+
readonly usage: {
|
|
388
|
+
readonly inputTokens: number;
|
|
389
|
+
readonly outputTokens: number;
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
export interface StreamingCompleteEvent extends StreamingEvent {
|
|
395
|
+
readonly type: 'streaming_complete';
|
|
396
|
+
readonly data: {
|
|
397
|
+
readonly sessionId: string;
|
|
398
|
+
readonly messageId: string;
|
|
399
|
+
readonly eventCount: number;
|
|
400
|
+
readonly totalDuration: number;
|
|
401
|
+
readonly metadata: ExecutionMetadata;
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export interface StreamingErrorEvent extends StreamingEvent {
|
|
406
|
+
readonly type: 'streaming_error';
|
|
407
|
+
readonly data: {
|
|
408
|
+
readonly sessionId: string;
|
|
409
|
+
readonly error: string;
|
|
410
|
+
readonly code?: string;
|
|
411
|
+
readonly recoverable: boolean;
|
|
412
|
+
};
|
|
413
|
+
}
|