coaia-visualizer 1.6.2 → 1.6.4

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 (48) hide show
  1. package/cli.ts +11 -5
  2. package/components/chart-detail-editable.tsx +2 -0
  3. package/components/chart-detail.tsx +6 -1
  4. package/components/edit-action-step.tsx +2 -0
  5. package/components/github-provenance.tsx +226 -0
  6. package/components/relation-graph.tsx +91 -27
  7. package/dist/cli.js +9 -5
  8. package/index.tsx +26 -0
  9. package/lib/chart-editor.ts +3 -3
  10. package/lib/github-provenance.ts +316 -0
  11. package/lib/jsonl-parser.ts +2 -2
  12. package/lib/types.ts +15 -2
  13. package/package.json +31 -1
  14. package/.dockerignore +0 -9
  15. package/COMPLETE_IMPLEMENTATION_REPORT.md +0 -215
  16. package/QUICK_START_MCP_TESTING.md +0 -236
  17. package/STC.md +0 -24
  18. package/STCGOAL.md +0 -0
  19. package/STCISSUE.md +0 -48
  20. package/STCKIN.md +0 -0
  21. package/STCMASTERY.md +0 -0
  22. package/STUDY_REPORT.md +0 -510
  23. package/direct-test.sh +0 -180
  24. package/docker-compose.test.yml +0 -69
  25. package/jgwill.coaia-visualizer-8--496dca71-d476-4ac9-ba9f-376add118dd8--260208.txt +0 -2612
  26. package/mcp/dist/api-client.d.ts +0 -138
  27. package/mcp/dist/api-client.d.ts.map +0 -1
  28. package/mcp/dist/api-client.js +0 -115
  29. package/mcp/dist/api-client.js.map +0 -1
  30. package/mcp/dist/index.d.ts +0 -2
  31. package/mcp/dist/index.d.ts.map +0 -1
  32. package/mcp/dist/index.js +0 -286
  33. package/mcp/dist/index.js.map +0 -1
  34. package/mcp/dist/tools/index.d.ts +0 -18
  35. package/mcp/dist/tools/index.d.ts.map +0 -1
  36. package/mcp/dist/tools/index.js +0 -322
  37. package/mcp/dist/tools/index.js.map +0 -1
  38. package/mcp/package-lock.json +0 -210
  39. package/test-data/test-master.jsonl +0 -11
  40. package/test-results/.last-run.json +0 -4
  41. package/test-scripts/README.md +0 -325
  42. package/test-scripts/rich-jsonl-preservation.spec.ts +0 -118
  43. package/test-scripts/run-all-tests.sh +0 -38
  44. package/test-scripts/test-01-basic-operations.sh +0 -87
  45. package/test-scripts/test-02-telescope-creation.sh +0 -91
  46. package/test-scripts/test-03-navigation.sh +0 -87
  47. package/test-scripts/test-global-cli.spec.ts +0 -220
  48. package/test-scripts/verify-global-cli.sh +0 -87
@@ -1,87 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- echo "Test 03: Navigation & Chart Hierarchy"
5
- echo "======================================"
6
-
7
- TEST_RESULTS_DIR="/test-results/test-03"
8
- mkdir -p "$TEST_RESULTS_DIR"
9
-
10
- # Load chart IDs from previous tests
11
- PARENT_CHART_ID=$(cat /test-results/test-01/chart-id.txt 2>/dev/null || echo "")
12
- TELESCOPED_CHART_ID=$(cat /test-results/test-02/telescoped-chart-id.txt 2>/dev/null || echo "")
13
-
14
- echo "Parent chart: $PARENT_CHART_ID"
15
- echo "Telescoped chart: $TELESCOPED_CHART_ID"
16
-
17
- if [ -z "$PARENT_CHART_ID" ]; then
18
- echo "✗ No parent chart ID available"
19
- exit 1
20
- fi
21
-
22
- echo "1. Testing parent chart retrieval..."
23
- curl -X GET "http://visualizer-app:4321/api/charts/$PARENT_CHART_ID" \
24
- -H "X-API-Key: test-api-key" \
25
- -o "$TEST_RESULTS_DIR/parent-chart.json" || true
26
-
27
- # Verify parent chart has metadata about children
28
- HAS_SUBCHARTS=$(cat "$TEST_RESULTS_DIR/parent-chart.json" | jq -r '.chart.subCharts != null' 2>/dev/null || echo "false")
29
-
30
- echo " Parent has subCharts array: $HAS_SUBCHARTS"
31
-
32
- if [ -n "$TELESCOPED_CHART_ID" ] && [ "$TELESCOPED_CHART_ID" != "null" ]; then
33
- echo "2. Testing telescoped chart retrieval..."
34
- curl -X GET "http://visualizer-app:4321/api/charts/$TELESCOPED_CHART_ID" \
35
- -H "X-API-Key: test-api-key" \
36
- -o "$TEST_RESULTS_DIR/telescoped-chart.json" || true
37
-
38
- # Verify telescoped chart has parent metadata
39
- PARENT_REF=$(cat "$TEST_RESULTS_DIR/telescoped-chart.json" | jq -r '.chart.metadata.parentChart' 2>/dev/null || echo "")
40
-
41
- echo " Telescoped chart parent reference: $PARENT_REF"
42
-
43
- if [ -n "$PARENT_REF" ] && [ "$PARENT_REF" != "null" ]; then
44
- echo "✓ Navigation hierarchy is properly established"
45
- else
46
- echo "⚠ Parent reference not found in telescoped chart"
47
- fi
48
- else
49
- echo "⚠ No telescoped chart ID available to test navigation"
50
- fi
51
-
52
- echo "3. Testing search functionality..."
53
- curl -X GET "http://visualizer-app:4321/api/charts/search?query=MCP" \
54
- -H "X-API-Key: test-api-key" \
55
- -o "$TEST_RESULTS_DIR/search-results.json" || true
56
-
57
- SEARCH_COUNT=$(cat "$TEST_RESULTS_DIR/search-results.json" | jq -r '.results | length' 2>/dev/null || echo "0")
58
- echo " Search returned $SEARCH_COUNT results"
59
-
60
- echo "4. Listing all charts to verify hierarchy..."
61
- curl -X GET "http://visualizer-app:4321/api/charts" \
62
- -H "X-API-Key: test-api-key" \
63
- -o "$TEST_RESULTS_DIR/all-charts.json" || true
64
-
65
- TOTAL_CHARTS=$(cat "$TEST_RESULTS_DIR/all-charts.json" | jq -r '.charts | length' 2>/dev/null || echo "0")
66
- echo " Total charts in system: $TOTAL_CHARTS"
67
-
68
- echo ""
69
- echo "Test 03: COMPLETED"
70
- echo ""
71
-
72
- # Generate final summary
73
- cat > /test-results/navigation-summary.txt << EOF
74
- Navigation Test Summary
75
- ========================
76
- Parent Chart ID: $PARENT_CHART_ID
77
- Telescoped Chart ID: $TELESCOPED_CHART_ID
78
- Total Charts: $TOTAL_CHARTS
79
- Search Results: $SEARCH_COUNT
80
-
81
- Parent has subCharts: $HAS_SUBCHARTS
82
- Telescoped has parent ref: $([ -n "$PARENT_REF" ] && echo "yes" || echo "no")
83
-
84
- Test Status: PASSED
85
- EOF
86
-
87
- cat /test-results/navigation-summary.txt
@@ -1,220 +0,0 @@
1
- /**
2
- * Test globally installed CLI with Playwright
3
- * Tests the fix for Turbopack file watching issue
4
- */
5
-
6
- import { test, expect } from '@playwright/test';
7
- import { spawn, ChildProcess } from 'child_process';
8
- import { promises as fs } from 'fs';
9
- import path from 'path';
10
-
11
- let cliProcess: ChildProcess | null = null;
12
- const CLI_PORT = 3099;
13
- const TEST_TIMEOUT = 60000; // 60 seconds for server startup
14
-
15
- test.describe('Global CLI Installation Tests', () => {
16
- test.beforeEach(async () => {
17
- // Kill any existing process on the port
18
- try {
19
- await new Promise<void>((resolve) => {
20
- const kill = spawn('fuser', ['-k', `${CLI_PORT}/tcp`]);
21
- kill.on('close', () => resolve());
22
- setTimeout(resolve, 1000);
23
- });
24
- } catch (e) {
25
- // Port might not be in use
26
- }
27
- });
28
-
29
- test.afterEach(async () => {
30
- // Clean up CLI process
31
- if (cliProcess) {
32
- cliProcess.kill('SIGTERM');
33
- await new Promise(resolve => setTimeout(resolve, 2000));
34
- if (!cliProcess.killed) {
35
- cliProcess.kill('SIGKILL');
36
- }
37
- cliProcess = null;
38
- }
39
- });
40
-
41
- test('should launch CLI without file watch errors', async ({ page }) => {
42
- test.setTimeout(TEST_TIMEOUT);
43
-
44
- const sampleFile = path.join(__dirname, '../samples/tradingchart.jsonl');
45
-
46
- // Verify sample file exists
47
- await fs.access(sampleFile);
48
-
49
- // Launch CLI with sample file
50
- let cliOutput = '';
51
- let cliError = '';
52
- let hasFileWatchError = false;
53
- let serverReady = false;
54
-
55
- cliProcess = spawn(
56
- 'coaia-visualizer',
57
- ['-M', sampleFile, '--port', CLI_PORT.toString(), '--no-open'],
58
- {
59
- stdio: ['ignore', 'pipe', 'pipe'],
60
- env: { ...process.env },
61
- }
62
- );
63
-
64
- // Monitor output
65
- cliProcess.stdout?.on('data', (data) => {
66
- const output = data.toString();
67
- cliOutput += output;
68
- console.log('[CLI stdout]', output);
69
-
70
- if (output.includes('Local:') || output.includes('localhost')) {
71
- serverReady = true;
72
- }
73
- });
74
-
75
- cliProcess.stderr?.on('data', (data) => {
76
- const error = data.toString();
77
- cliError += error;
78
- console.log('[CLI stderr]', error);
79
-
80
- // Check for file watch errors
81
- if (
82
- error.includes('OS file watch limit reached') ||
83
- error.includes('TurbopackInternalError') ||
84
- error.includes('about ["/home/') ||
85
- error.includes('ENOSPC')
86
- ) {
87
- hasFileWatchError = true;
88
- }
89
- });
90
-
91
- // Wait for server to be ready (max 45 seconds)
92
- const startTime = Date.now();
93
- while (!serverReady && Date.now() - startTime < 45000) {
94
- await new Promise(resolve => setTimeout(resolve, 500));
95
-
96
- // Fail fast if file watch error detected
97
- if (hasFileWatchError) {
98
- break;
99
- }
100
- }
101
-
102
- // Verify no file watch errors
103
- expect(hasFileWatchError, 'Should not have file watch errors').toBe(false);
104
- expect(serverReady, 'Server should be ready').toBe(true);
105
-
106
- // Navigate to the app
107
- await page.goto(`http://localhost:${CLI_PORT}`, {
108
- waitUntil: 'networkidle',
109
- timeout: 15000
110
- });
111
-
112
- // Verify page loaded successfully
113
- await expect(page.locator('body')).toBeVisible();
114
-
115
- // Check that it's the visualizer app (should have charts or similar content)
116
- const title = await page.title();
117
- console.log('Page title:', title);
118
-
119
- // Take a screenshot for verification
120
- await page.screenshot({
121
- path: path.join(__dirname, '../test-data/global-cli-test.png'),
122
- fullPage: true
123
- });
124
-
125
- console.log('✅ CLI launched successfully without file watch errors');
126
- });
127
-
128
- test('should load sample chart data correctly', async ({ page }) => {
129
- test.setTimeout(TEST_TIMEOUT);
130
-
131
- const sampleFile = path.join(__dirname, '../samples/tradingchart.jsonl');
132
-
133
- // Launch CLI
134
- let serverReady = false;
135
- cliProcess = spawn(
136
- 'coaia-visualizer',
137
- ['-M', sampleFile, '--port', CLI_PORT.toString(), '--no-open'],
138
- {
139
- stdio: ['ignore', 'pipe', 'pipe'],
140
- env: { ...process.env },
141
- }
142
- );
143
-
144
- cliProcess.stdout?.on('data', (data) => {
145
- const output = data.toString();
146
- if (output.includes('Local:') || output.includes('localhost')) {
147
- serverReady = true;
148
- }
149
- });
150
-
151
- // Wait for server
152
- const startTime = Date.now();
153
- while (!serverReady && Date.now() - startTime < 45000) {
154
- await new Promise(resolve => setTimeout(resolve, 500));
155
- }
156
-
157
- expect(serverReady).toBe(true);
158
-
159
- // Navigate and test the UI
160
- await page.goto(`http://localhost:${CLI_PORT}`, {
161
- waitUntil: 'networkidle',
162
- timeout: 15000
163
- });
164
-
165
- // Wait for content to load
166
- await page.waitForTimeout(2000);
167
-
168
- // Check for chart elements (adjust selectors based on your UI)
169
- const snapshot = await page.locator('body').textContent();
170
- console.log('Page content includes:', snapshot?.substring(0, 500));
171
-
172
- // Verify the app is functional
173
- await expect(page.locator('body')).toBeVisible();
174
-
175
- console.log('✅ Sample chart data loaded successfully');
176
- });
177
-
178
- test('should handle different ports correctly', async ({ page }) => {
179
- test.setTimeout(TEST_TIMEOUT);
180
-
181
- const alternatePort = 3098;
182
- const sampleFile = path.join(__dirname, '../samples/tradingchart.jsonl');
183
-
184
- // Launch on alternate port
185
- let serverReady = false;
186
- cliProcess = spawn(
187
- 'coaia-visualizer',
188
- ['-M', sampleFile, '-p', alternatePort.toString(), '--no-open'],
189
- {
190
- stdio: ['ignore', 'pipe', 'pipe'],
191
- env: { ...process.env },
192
- }
193
- );
194
-
195
- cliProcess.stdout?.on('data', (data) => {
196
- const output = data.toString();
197
- if (output.includes(`${alternatePort}`)) {
198
- serverReady = true;
199
- }
200
- });
201
-
202
- // Wait for server
203
- const startTime = Date.now();
204
- while (!serverReady && Date.now() - startTime < 45000) {
205
- await new Promise(resolve => setTimeout(resolve, 500));
206
- }
207
-
208
- expect(serverReady).toBe(true);
209
-
210
- // Verify server is on alternate port
211
- await page.goto(`http://localhost:${alternatePort}`, {
212
- waitUntil: 'networkidle',
213
- timeout: 15000
214
- });
215
-
216
- await expect(page.locator('body')).toBeVisible();
217
-
218
- console.log('✅ Alternate port configuration works');
219
- });
220
- });
@@ -1,87 +0,0 @@
1
- #!/bin/bash
2
- # Verify global CLI installation works without file watch errors
3
-
4
- set -e
5
-
6
- PORT=3099
7
- SAMPLE_FILE="/a/src/coaia-visualizer/samples/tradingchart.jsonl"
8
- TIMEOUT=45
9
- ERROR_LOG="/tmp/cli-error-check.log"
10
-
11
- echo "🧪 Testing globally installed coaia-visualizer CLI"
12
- echo "📁 Sample file: $SAMPLE_FILE"
13
- echo "🌐 Port: $PORT"
14
- echo ""
15
-
16
- # Clean up any existing process on the port
17
- fuser -k ${PORT}/tcp 2>/dev/null || true
18
- sleep 2
19
-
20
- # Start CLI in background
21
- rm -f "$ERROR_LOG"
22
- cd /tmp
23
- coaia-visualizer -M "$SAMPLE_FILE" --port $PORT --no-open > "$ERROR_LOG" 2>&1 &
24
- CLI_PID=$!
25
-
26
- echo "⏳ Waiting for server to start (PID: $CLI_PID)..."
27
-
28
- # Wait for server to be ready
29
- for i in $(seq 1 $TIMEOUT); do
30
- if grep -q "Ready in" "$ERROR_LOG" 2>/dev/null; then
31
- echo "✅ Server started successfully"
32
- break
33
- fi
34
-
35
- if grep -E "(OS file watch limit|TurbopackInternalError|FATAL)" "$ERROR_LOG" 2>/dev/null; then
36
- echo "❌ File watch error detected:"
37
- grep -E "(OS file watch limit|TurbopackInternalError|FATAL)" "$ERROR_LOG"
38
- kill $CLI_PID 2>/dev/null
39
- exit 1
40
- fi
41
-
42
- if ! kill -0 $CLI_PID 2>/dev/null; then
43
- echo "❌ CLI process died unexpectedly"
44
- tail -20 "$ERROR_LOG"
45
- exit 1
46
- fi
47
-
48
- sleep 1
49
- done
50
-
51
- # Test server response
52
- echo "🔍 Testing HTTP response..."
53
- if curl -s -f http://localhost:$PORT > /dev/null; then
54
- echo "✅ Server responding correctly"
55
- else
56
- echo "❌ Server not responding"
57
- kill $CLI_PID 2>/dev/null
58
- exit 1
59
- fi
60
-
61
- # Check for file watch errors in output
62
- echo "🔍 Checking for file watch errors..."
63
- if grep -qE "(OS file watch limit|TurbopackInternalError|about \[\"/home/)" "$ERROR_LOG"; then
64
- echo "❌ File watch errors detected:"
65
- grep -E "(OS file watch limit|TurbopackInternalError|about \[\"/home/)" "$ERROR_LOG"
66
- kill $CLI_PID 2>/dev/null
67
- exit 1
68
- else
69
- echo "✅ No file watch errors detected"
70
- fi
71
-
72
- # Verify project directory
73
- echo "🔍 Verifying Turbopack project directory..."
74
- if grep -q "dir: '/a/src/coaia-visualizer'" "$ERROR_LOG"; then
75
- echo "✅ Turbopack using correct project directory"
76
- else
77
- echo "⚠️ Warning: Could not verify Turbopack directory"
78
- grep "Creating turbopack project" "$ERROR_LOG" || true
79
- fi
80
-
81
- # Clean up
82
- kill $CLI_PID 2>/dev/null
83
- wait $CLI_PID 2>/dev/null || true
84
-
85
- echo ""
86
- echo "✅ All tests passed! CLI works correctly without file watch errors."
87
- echo "📋 Full output saved to: $ERROR_LOG"