agentgui 1.0.66 → 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.
Files changed (55) hide show
  1. package/.prd +213 -53
  2. package/.prd-browser +607 -0
  3. package/CLAUDE.md +1532 -125
  4. package/browser-test-harness.js +371 -0
  5. package/browser-test.js +409 -0
  6. package/execute-tests.js +164 -0
  7. package/lib/claude-runner.js +41 -12
  8. package/lib/database-service.ts +252 -0
  9. package/lib/sync-service.ts +275 -0
  10. package/lib/types.ts +168 -0
  11. package/package.json +1 -1
  12. package/readme.md +586 -0
  13. package/run-e2e-test.sh +88 -0
  14. package/server.js +274 -8
  15. package/static/index.html +487 -180
  16. package/static/js/client.js +558 -0
  17. package/static/js/event-filter.js +311 -0
  18. package/static/js/event-processor.js +454 -0
  19. package/static/js/streaming-renderer.js +813 -0
  20. package/static/js/syntax-highlighter.js +271 -0
  21. package/static/js/ui-components.js +433 -0
  22. package/static/js/websocket-manager.js +482 -0
  23. package/static/templates/INDEX.html +465 -0
  24. package/static/templates/README.md +190 -0
  25. package/static/templates/agent-capabilities.html +56 -0
  26. package/static/templates/agent-metadata-panel.html +44 -0
  27. package/static/templates/agent-status-badge.html +30 -0
  28. package/static/templates/code-annotation-panel.html +155 -0
  29. package/static/templates/code-suggestion-panel.html +184 -0
  30. package/static/templates/command-header.html +77 -0
  31. package/static/templates/command-output-scrollable.html +118 -0
  32. package/static/templates/elapsed-time.html +54 -0
  33. package/static/templates/error-alert.html +106 -0
  34. package/static/templates/error-history-timeline.html +160 -0
  35. package/static/templates/error-recovery-options.html +109 -0
  36. package/static/templates/error-stack-trace.html +95 -0
  37. package/static/templates/error-summary.html +80 -0
  38. package/static/templates/event-counter.html +48 -0
  39. package/static/templates/execution-actions.html +97 -0
  40. package/static/templates/execution-progress-bar.html +80 -0
  41. package/static/templates/execution-stepper.html +120 -0
  42. package/static/templates/file-breadcrumb.html +118 -0
  43. package/static/templates/file-diff-viewer.html +121 -0
  44. package/static/templates/file-metadata.html +133 -0
  45. package/static/templates/file-read-panel.html +66 -0
  46. package/static/templates/file-write-panel.html +120 -0
  47. package/static/templates/git-branch-remote.html +107 -0
  48. package/static/templates/git-diff-list.html +101 -0
  49. package/static/templates/git-log-visualization.html +153 -0
  50. package/static/templates/git-status-panel.html +115 -0
  51. package/static/templates/quality-metrics-display.html +170 -0
  52. package/static/templates/terminal-output-panel.html +87 -0
  53. package/static/templates/test-results-display.html +144 -0
  54. package/test-browser.js +457 -0
  55. package/test-runner.js +182 -0
@@ -0,0 +1,170 @@
1
+ <!-- Code Quality Metrics Display -->
2
+ <div class="quality-metrics-display card" role="region" aria-label="Code quality metrics">
3
+ <div class="card-header border-b pb-3 mb-3">
4
+ <h4 class="font-semibold">Quality Metrics</h4>
5
+ </div>
6
+
7
+ <!-- Primary Metrics Grid -->
8
+ <div class="metrics-grid mb-4">
9
+ <!-- Complexity -->
10
+ <div class="metric-item">
11
+ <div class="metric-label">Cyclomatic Complexity</div>
12
+ <div class="metric-value" data-score="{{ complexityScore }}" data-level="{{ complexityLevel }}">
13
+ {{ complexityScore }}
14
+ </div>
15
+ <div class="metric-bar">
16
+ <div class="metric-bar-fill" style="width: {{ complexityPercent }}%"></div>
17
+ </div>
18
+ <p class="text-xs text-secondary mt-1">{{ complexityDescription }}</p>
19
+ </div>
20
+
21
+ <!-- Duplication -->
22
+ <div class="metric-item">
23
+ <div class="metric-label">Code Duplication</div>
24
+ <div class="metric-value" data-score="{{ duplicationPercent }}%" data-level="{{ duplicationLevel }}">
25
+ {{ duplicationPercent }}%
26
+ </div>
27
+ <div class="metric-bar">
28
+ <div class="metric-bar-fill" style="width: {{ duplicationPercent }}%"></div>
29
+ </div>
30
+ <p class="text-xs text-secondary mt-1">{{ duplicationCount }} duplicated lines</p>
31
+ </div>
32
+
33
+ <!-- Coverage -->
34
+ <div class="metric-item">
35
+ <div class="metric-label">Test Coverage</div>
36
+ <div class="metric-value" data-score="{{ coveragePercent }}%" data-level="{{ coverageLevel }}">
37
+ {{ coveragePercent }}%
38
+ </div>
39
+ <div class="metric-bar">
40
+ <div class="metric-bar-fill" style="width: {{ coveragePercent }}%"></div>
41
+ </div>
42
+ <p class="text-xs text-secondary mt-1">{{ coveredLines }}/{{ totalLines }} lines</p>
43
+ </div>
44
+
45
+ <!-- Maintainability -->
46
+ <div class="metric-item">
47
+ <div class="metric-label">Maintainability Index</div>
48
+ <div class="metric-value" data-score="{{ maintainabilityScore }}" data-level="{{ maintainabilityLevel }}">
49
+ {{ maintainabilityScore }}
50
+ </div>
51
+ <div class="metric-bar">
52
+ <div class="metric-bar-fill" style="width: {{ maintainabilityPercent }}%"></div>
53
+ </div>
54
+ <p class="text-xs text-secondary mt-1">{{ maintainabilityDescription }}</p>
55
+ </div>
56
+ </div>
57
+
58
+ <!-- Detailed Metrics -->
59
+ <div class="detailed-metrics">
60
+ <details class="metric-details" open>
61
+ <summary class="cursor-pointer font-semibold mb-2">File Statistics</summary>
62
+ <div class="mt-2 space-y-1 text-sm">
63
+ <p><span class="text-secondary">Lines of Code:</span> <code class="font-mono">{{ linesOfCode }}</code></p>
64
+ <p><span class="text-secondary">Functions:</span> <code class="font-mono">{{ functionCount }}</code></p>
65
+ <p><span class="text-secondary">Comments:</span> <code class="font-mono">{{ commentRatio }}%</code></p>
66
+ <p><span class="text-secondary">Blank Lines:</span> <code class="font-mono">{{ blankLinePercent }}%</code></p>
67
+ </div>
68
+ </details>
69
+
70
+ <details class="metric-details">
71
+ <summary class="cursor-pointer font-semibold mb-2">Issues Found</summary>
72
+ <div class="mt-2 space-y-1 text-sm">
73
+ <p class="text-red-600"><span class="font-semibold">{{ criticalIssues }}</span> Critical</p>
74
+ <p class="text-orange-600"><span class="font-semibold">{{ majorIssues }}</span> Major</p>
75
+ <p class="text-yellow-600"><span class="font-semibold">{{ minorIssues }}</span> Minor</p>
76
+ <p class="text-blue-600"><span class="font-semibold">{{ infoIssues }}</span> Info</p>
77
+ </div>
78
+ </details>
79
+ </div>
80
+ </div>
81
+
82
+ <style scoped>
83
+ .quality-metrics-display {
84
+ padding: 16px;
85
+ }
86
+
87
+ .metrics-grid {
88
+ display: grid;
89
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
90
+ gap: 16px;
91
+ }
92
+
93
+ .metric-item {
94
+ padding: 12px;
95
+ background-color: var(--color-bg-secondary);
96
+ border-radius: 4px;
97
+ border: 1px solid var(--color-border);
98
+ }
99
+
100
+ .metric-label {
101
+ font-size: 12px;
102
+ font-weight: 600;
103
+ color: var(--color-text-secondary);
104
+ text-transform: uppercase;
105
+ letter-spacing: 0.5px;
106
+ margin-bottom: 8px;
107
+ }
108
+
109
+ .metric-value {
110
+ font-size: 28px;
111
+ font-weight: bold;
112
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
113
+ }
114
+
115
+ .metric-value[data-level="good"] {
116
+ color: #10b981;
117
+ }
118
+
119
+ .metric-value[data-level="fair"] {
120
+ color: #f59e0b;
121
+ }
122
+
123
+ .metric-value[data-level="poor"] {
124
+ color: #ef4444;
125
+ }
126
+
127
+ .metric-bar {
128
+ height: 4px;
129
+ background-color: var(--color-border);
130
+ border-radius: 2px;
131
+ overflow: hidden;
132
+ margin: 8px 0;
133
+ }
134
+
135
+ .metric-bar-fill {
136
+ height: 100%;
137
+ background: linear-gradient(90deg, #10b981 0%, #f59e0b 50%, #ef4444 100%);
138
+ transition: width 0.3s ease;
139
+ }
140
+
141
+ .detailed-metrics {
142
+ margin-top: 16px;
143
+ padding-top: 16px;
144
+ border-top: 1px solid var(--color-border);
145
+ }
146
+
147
+ .metric-details {
148
+ margin-bottom: 12px;
149
+ }
150
+
151
+ .metric-details[open] summary {
152
+ color: var(--color-primary);
153
+ }
154
+
155
+ summary {
156
+ cursor: pointer;
157
+ list-style: none;
158
+ }
159
+
160
+ summary::-webkit-details-marker {
161
+ display: none;
162
+ }
163
+
164
+ .font-mono {
165
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
166
+ background-color: var(--color-bg-code);
167
+ padding: 1px 3px;
168
+ border-radius: 2px;
169
+ }
170
+ </style>
@@ -0,0 +1,87 @@
1
+ <!-- Terminal-like Output Panel with ANSI Color Support -->
2
+ <div class="terminal-output-panel card" role="region" aria-label="Terminal output">
3
+ <div class="card-header flex items-center justify-between mb-3 pb-3 border-b">
4
+ <div>
5
+ <h4 class="font-semibold text-sm">{{ commandName }}</h4>
6
+ <p class="text-xs text-secondary font-mono">$ {{ command }}</p>
7
+ </div>
8
+ <div class="flex items-center gap-2">
9
+ <span class="badge" data-exit-code="{{ exitCode }}">
10
+ Exit {{ exitCode }}
11
+ </span>
12
+ </div>
13
+ </div>
14
+
15
+ <!-- Output Container (Virtual Scrolling) -->
16
+ <div class="terminal-content" data-scrollable="true" role="region" aria-label="Command output" aria-live="polite">
17
+ <pre class="terminal-output" data-line-count="{{ lineCount }}"><code>{{ output }}</code></pre>
18
+ </div>
19
+
20
+ <!-- Output Statistics -->
21
+ <div class="text-xs text-secondary mt-3 pt-3 border-t space-y-1">
22
+ <p><span class="font-mono">{{ stdoutLines }}</span> stdout lines • <span class="font-mono">{{ stderrLines }}</span> stderr lines</p>
23
+ <p>Duration: <span class="font-mono">{{ duration }}</span> • Memory: <span class="font-mono">{{ memoryUsed }}</span></p>
24
+ </div>
25
+ </div>
26
+
27
+ <style scoped>
28
+ .terminal-output-panel {
29
+ padding: 16px;
30
+ background: var(--color-bg-primary);
31
+ }
32
+
33
+ .terminal-content {
34
+ background-color: var(--color-bg-terminal);
35
+ border: 1px solid var(--color-border);
36
+ border-radius: 4px;
37
+ padding: 12px;
38
+ max-height: 400px;
39
+ overflow-y: auto;
40
+ overflow-x: auto;
41
+ }
42
+
43
+ .terminal-output {
44
+ margin: 0;
45
+ padding: 0;
46
+ font-size: 12px;
47
+ line-height: 1.5;
48
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
49
+ color: var(--color-text-terminal);
50
+ }
51
+
52
+ /* ANSI Color Classes */
53
+ .ansi-bold { font-weight: bold; }
54
+ .ansi-dim { opacity: 0.5; }
55
+ .ansi-italic { font-style: italic; }
56
+ .ansi-underline { text-decoration: underline; }
57
+
58
+ /* Text Colors */
59
+ .ansi-black { color: #000000; }
60
+ .ansi-red { color: #ff0000; }
61
+ .ansi-green { color: #00ff00; }
62
+ .ansi-yellow { color: #ffff00; }
63
+ .ansi-blue { color: #0000ff; }
64
+ .ansi-magenta { color: #ff00ff; }
65
+ .ansi-cyan { color: #00ffff; }
66
+ .ansi-white { color: #ffffff; }
67
+
68
+ /* Background Colors */
69
+ .ansi-bg-black { background-color: #000000; }
70
+ .ansi-bg-red { background-color: #ff0000; }
71
+ .ansi-bg-green { background-color: #00ff00; }
72
+ .ansi-bg-yellow { background-color: #ffff00; }
73
+ .ansi-bg-blue { background-color: #0000ff; }
74
+ .ansi-bg-magenta { background-color: #ff00ff; }
75
+ .ansi-bg-cyan { background-color: #00ffff; }
76
+ .ansi-bg-white { background-color: #ffffff; }
77
+
78
+ .badge[data-exit-code="0"] {
79
+ background-color: #10b981;
80
+ color: white;
81
+ }
82
+
83
+ .badge[data-exit-code]:not([data-exit-code="0"]) {
84
+ background-color: #ef4444;
85
+ color: white;
86
+ }
87
+ </style>
@@ -0,0 +1,144 @@
1
+ <!-- Test Results Display -->
2
+ <div class="test-results-display card" role="region" aria-label="Test execution results">
3
+ <div class="card-header flex items-center justify-between mb-3 pb-3 border-b">
4
+ <h4 class="font-semibold">Test Results</h4>
5
+ <div class="test-summary flex gap-2">
6
+ <span class="badge-result passed" aria-label="Passed tests">{{ passedCount }}</span>
7
+ <span class="badge-result failed" aria-label="Failed tests">{{ failedCount }}</span>
8
+ <span class="badge-result skipped" aria-label="Skipped tests">{{ skippedCount }}</span>
9
+ </div>
10
+ </div>
11
+
12
+ <!-- Summary Stats -->
13
+ <div class="summary-stats grid grid-cols-4 gap-3 mb-4 pb-4 border-b text-center">
14
+ <div>
15
+ <p class="text-2xl font-bold text-green-600">{{ passedCount }}</p>
16
+ <p class="text-xs text-secondary">Passed</p>
17
+ </div>
18
+ <div>
19
+ <p class="text-2xl font-bold text-red-600">{{ failedCount }}</p>
20
+ <p class="text-xs text-secondary">Failed</p>
21
+ </div>
22
+ <div>
23
+ <p class="text-2xl font-bold text-yellow-600">{{ skippedCount }}</p>
24
+ <p class="text-xs text-secondary">Skipped</p>
25
+ </div>
26
+ <div>
27
+ <p class="text-2xl font-bold font-mono">{{ passPercentage }}%</p>
28
+ <p class="text-xs text-secondary">Pass Rate</p>
29
+ </div>
30
+ </div>
31
+
32
+ <!-- Test Tree/List -->
33
+ <div class="test-list space-y-1">
34
+ {{ for suite in testSuites }}
35
+ <details class="test-suite">
36
+ <summary class="cursor-pointer py-2 px-3 rounded hover:bg-hover-bg flex items-center gap-2">
37
+ <svg class="w-4 h-4 chevron" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
38
+ <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/>
39
+ </svg>
40
+ <span class="font-semibold text-sm">{{ suite.name }}</span>
41
+ <span class="ml-auto text-xs space-x-1">
42
+ <span class="text-green-600">{{ suite.passed }}</span>
43
+ <span class="text-red-600">{{ suite.failed }}</span>
44
+ </span>
45
+ </summary>
46
+
47
+ <div class="test-cases mt-2 ml-4 space-y-1 border-l pl-3">
48
+ {{ for test in suite.tests }}
49
+ <div class="test-case flex items-center gap-2 py-1 text-sm">
50
+ {{ if test.status == 'passed' }}
51
+ <svg class="w-4 h-4 text-green-600" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
52
+ <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"/>
53
+ </svg>
54
+ {{ else if test.status == 'failed' }}
55
+ <svg class="w-4 h-4 text-red-600" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
56
+ <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z"/>
57
+ </svg>
58
+ {{ else }}
59
+ <svg class="w-4 h-4 text-yellow-600" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
60
+ <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm0-2a6 6 0 100-12 6 6 0 000 12z"/>
61
+ </svg>
62
+ {{ end }}
63
+ <span class="flex-1">{{ test.name }}</span>
64
+ <span class="text-secondary text-xs">{{ test.duration }}ms</span>
65
+ </div>
66
+ {{ end }}
67
+ </div>
68
+ </details>
69
+ {{ end }}
70
+ </div>
71
+
72
+ <!-- Execution Metadata -->
73
+ <div class="mt-4 pt-4 border-t text-xs text-secondary space-y-1">
74
+ <p>Total Duration: <code class="font-mono">{{ totalDuration }}</code></p>
75
+ <p>Framework: <code class="font-mono">{{ framework }}</code></p>
76
+ </div>
77
+ </div>
78
+
79
+ <style scoped>
80
+ .test-results-display {
81
+ padding: 16px;
82
+ max-height: 600px;
83
+ overflow-y: auto;
84
+ }
85
+
86
+ .badge-result {
87
+ padding: 4px 8px;
88
+ border-radius: 3px;
89
+ font-size: 12px;
90
+ font-weight: 600;
91
+ color: white;
92
+ }
93
+
94
+ .badge-result.passed {
95
+ background-color: #10b981;
96
+ }
97
+
98
+ .badge-result.failed {
99
+ background-color: #ef4444;
100
+ }
101
+
102
+ .badge-result.skipped {
103
+ background-color: #6b7280;
104
+ }
105
+
106
+ .test-suite {
107
+ background-color: var(--color-bg-secondary);
108
+ border: 1px solid var(--color-border);
109
+ border-radius: 4px;
110
+ overflow: hidden;
111
+ }
112
+
113
+ .test-suite[open] summary {
114
+ background-color: var(--color-bg-hover);
115
+ border-bottom: 1px solid var(--color-border);
116
+ }
117
+
118
+ summary {
119
+ list-style: none;
120
+ }
121
+
122
+ summary::-webkit-details-marker {
123
+ display: none;
124
+ }
125
+
126
+ .chevron {
127
+ transition: transform 0.2s;
128
+ }
129
+
130
+ details[open] .chevron {
131
+ transform: rotate(180deg);
132
+ }
133
+
134
+ .test-case {
135
+ padding: 4px 0;
136
+ }
137
+
138
+ .font-mono {
139
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
140
+ background-color: var(--color-bg-code);
141
+ padding: 1px 3px;
142
+ border-radius: 2px;
143
+ }
144
+ </style>