coaia-visualizer 1.5.9 → 1.6.0

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/direct-test.sh DELETED
@@ -1,180 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Direct MCP Integration Test
4
- # Tests the MCP server and Next.js API without Docker complexity
5
-
6
- set -e
7
-
8
- echo "========================================="
9
- echo "Direct MCP Integration Test"
10
- echo "========================================="
11
- echo ""
12
-
13
- PROJECT_DIR="/workspace/repos/jgwill/coaia-visualizer-feat-4"
14
- cd "$PROJECT_DIR"
15
-
16
- # Start the Next.js app in the background
17
- echo "1. Starting Next.js application..."
18
- timeout 30 npm run dev > /tmp/nextjs.log 2>&1 &
19
- NEXTJS_PID=$!
20
- echo " Process ID: $NEXTJS_PID"
21
-
22
- # Give the app time to start
23
- sleep 10
24
-
25
- # Check if the app is responding
26
- echo "2. Checking Next.js app health..."
27
- if curl -sf http://localhost:3000/api/charts > /dev/null; then
28
- echo " ✓ Next.js app is responding"
29
- else
30
- echo " ⚠ Warning: App not responding on port 3000, trying port 4321..."
31
- if curl -sf http://localhost:4321/api/charts > /dev/null; then
32
- echo " ✓ Next.js app is responding on port 4321"
33
- else
34
- echo " ✗ Failed to reach Next.js app"
35
- kill $NEXTJS_PID 2>/dev/null || true
36
- exit 1
37
- fi
38
- fi
39
-
40
- API_PORT=3000
41
- if ! curl -sf http://localhost:3000/api/charts > /dev/null 2>&1; then
42
- API_PORT=4321
43
- fi
44
-
45
- echo ""
46
- echo "3. Testing MCP API endpoints..."
47
- echo ""
48
-
49
- # Test 1: Create a chart
50
- echo " Test 1: Creating a chart..."
51
- CHART_RESPONSE=$(curl -s -X POST "http://localhost:$API_PORT/api/charts" \
52
- -H "Content-Type: application/json" \
53
- -d '{
54
- "desiredOutcome": "Test MCP Integration",
55
- "currentReality": "Starting tests",
56
- "dueDate": "2026-02-15"
57
- }')
58
-
59
- CHART_ID=$(echo "$CHART_RESPONSE" | jq -r '.chart.id' 2>/dev/null)
60
-
61
- if [ -n "$CHART_ID" ] && [ "$CHART_ID" != "null" ]; then
62
- echo " ✓ Chart created: $CHART_ID"
63
- else
64
- echo " ✗ Failed to create chart"
65
- echo " Response: $CHART_RESPONSE"
66
- kill $NEXTJS_PID 2>/dev/null || true
67
- exit 1
68
- fi
69
-
70
- # Test 2: Add action step
71
- echo ""
72
- echo " Test 2: Adding action step..."
73
- ACTION_RESPONSE=$(curl -s -X POST "http://localhost:$API_PORT/api/charts/$CHART_ID" \
74
- -H "Content-Type: application/json" \
75
- -d '{
76
- "addActionStep": {
77
- "actionName": "Test Action 1",
78
- "createAsTelescopedChart": false
79
- }
80
- }')
81
-
82
- ACTION_UPDATES=$(echo "$ACTION_RESPONSE" | jq -r '.updates | length' 2>/dev/null || echo "0")
83
-
84
- if [ "$ACTION_UPDATES" -gt 0 ]; then
85
- echo " ✓ Action step added"
86
- else
87
- echo " ⚠ Could not verify action addition"
88
- fi
89
-
90
- # Test 3: Create telescoped chart
91
- echo ""
92
- echo " Test 3: Creating telescoped chart..."
93
- TELESCOPE_RESPONSE=$(curl -s -X POST "http://localhost:$API_PORT/api/charts/$CHART_ID" \
94
- -H "Content-Type: application/json" \
95
- -d '{
96
- "createTelescopedChart": {
97
- "actionName": "action_Test Action 1"
98
- }
99
- }')
100
-
101
- TELESCOPE_ID=$(echo "$TELESCOPE_RESPONSE" | jq -r '.chart.id' 2>/dev/null)
102
-
103
- if [ -n "$TELESCOPE_ID" ] && [ "$TELESCOPE_ID" != "null" ]; then
104
- echo " ✓ Telescoped chart created: $TELESCOPE_ID"
105
- else
106
- echo " ⚠ Telescope response: $(echo "$TELESCOPE_RESPONSE" | jq -c . 2>/dev/null || echo "$TELESCOPE_RESPONSE")"
107
- fi
108
-
109
- # Test 4: Retrieve parent chart
110
- echo ""
111
- echo " Test 4: Retrieving parent chart with subCharts..."
112
- PARENT_RESPONSE=$(curl -s -X GET "http://localhost:$API_PORT/api/charts/$CHART_ID")
113
-
114
- SUBCHARTS_COUNT=$(echo "$PARENT_RESPONSE" | jq -r '.chart.subCharts | length' 2>/dev/null || echo "0")
115
-
116
- if [ "$SUBCHARTS_COUNT" -gt 0 ]; then
117
- echo " ✓ Parent chart has $SUBCHARTS_COUNT subCharts"
118
- else
119
- echo " ⚠ Parent chart subCharts count: $SUBCHARTS_COUNT"
120
- fi
121
-
122
- # Test 5: Test MCP server directly (if available)
123
- echo ""
124
- echo "4. Testing MCP Server..."
125
-
126
- if [ -f "$PROJECT_DIR/mcp/dist/index.js" ]; then
127
- echo " ✓ MCP server built"
128
- echo ""
129
- echo " To test MCP server:"
130
- echo " 1. Build: cd mcp && npm run build"
131
- echo " 2. Run: node dist/index.js"
132
- echo " 3. Configure in Claude Desktop"
133
- else
134
- echo " ⚠ MCP server not built yet"
135
- echo " Build with: cd mcp && npm run build"
136
- fi
137
-
138
- # Cleanup
139
- echo ""
140
- echo "5. Cleaning up..."
141
- kill $NEXTJS_PID 2>/dev/null || true
142
- sleep 1
143
-
144
- echo ""
145
- echo "========================================="
146
- echo "Test Results Summary"
147
- echo "========================================="
148
- echo "✓ Chart created"
149
- echo "✓ Action step added"
150
- if [ -n "$TELESCOPE_ID" ] && [ "$TELESCOPE_ID" != "null" ]; then
151
- echo "✓ Telescoped chart created"
152
- fi
153
- if [ "$SUBCHARTS_COUNT" -gt 0 ]; then
154
- echo "✓ Parent-child relationship established"
155
- fi
156
- echo ""
157
- echo "All basic tests passed!"
158
- echo "========================================="
159
-
160
- # Cleanup
161
- echo ""
162
- echo "5. Cleaning up..."
163
- kill $NEXTJS_PID 2>/dev/null || true
164
- sleep 1
165
-
166
- echo ""
167
- echo "========================================="
168
- echo "Test Results Summary"
169
- echo "========================================="
170
- echo "✓ Chart created"
171
- echo "✓ Action step added"
172
- if [ -n "$TELESCOPE_ID" ] && [ "$TELESCOPE_ID" != "null" ]; then
173
- echo "✓ Telescoped chart created"
174
- fi
175
- if [ "$SUBCHARTS_COUNT" -gt 0 ]; then
176
- echo "✓ Parent-child relationship established"
177
- fi
178
- echo ""
179
- echo "All basic tests passed!"
180
- echo "========================================="
@@ -1,69 +0,0 @@
1
- version: '3.8'
2
-
3
- services:
4
- # Next.js application server
5
- visualizer-app:
6
- build:
7
- context: .
8
- dockerfile: Dockerfile.app
9
- ports:
10
- - "4321:4321"
11
- volumes:
12
- - ./samples:/app/samples:ro
13
- - ./test-data:/app/test-data
14
- environment:
15
- - NODE_ENV=production
16
- - PORT=4321
17
- networks:
18
- - test-network
19
- healthcheck:
20
- test: ["CMD", "curl", "-f", "http://localhost:4321/api/charts"]
21
- interval: 10s
22
- timeout: 5s
23
- retries: 5
24
-
25
- # MCP Server
26
- mcp-server:
27
- build:
28
- context: ./mcp
29
- dockerfile: Dockerfile
30
- environment:
31
- - VISUALIZER_API_URL=http://visualizer-app:4321
32
- - VISUALIZER_API_KEY=${VISUALIZER_API_KEY:-test-api-key}
33
- - NODE_ENV=production
34
- volumes:
35
- - ./test-data:/data
36
- networks:
37
- - test-network
38
- depends_on:
39
- visualizer-app:
40
- condition: service_healthy
41
- stdin_open: true
42
- tty: true
43
-
44
- # Test runner using claude-code CLI or gemini-cli
45
- test-runner:
46
- build:
47
- context: .
48
- dockerfile: Dockerfile.test
49
- environment:
50
- - MCP_SERVER_HOST=mcp-server
51
- - VISUALIZER_API_URL=http://visualizer-app:4321
52
- - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
53
- - GOOGLE_API_KEY=${GOOGLE_API_KEY}
54
- volumes:
55
- - ./test-scripts:/test-scripts:ro
56
- - ./test-results:/test-results
57
- - ./test-data:/test-data
58
- networks:
59
- - test-network
60
- depends_on:
61
- visualizer-app:
62
- condition: service_healthy
63
- mcp-server:
64
- condition: service_started
65
- command: ["/test-scripts/run-all-tests.sh"]
66
-
67
- networks:
68
- test-network:
69
- driver: bridge
@@ -1,11 +0,0 @@
1
- {"type":"Entity","name":"chart_test_master_chart","entityType":"chart","observations":["Master test chart for MCP integration testing"],"metadata":{"createdAt":"2026-01-16T00:00:00.000Z","dueDate":"2026-02-15"}}
2
- {"type":"Entity","name":"action_Setup_test_environment","entityType":"action","observations":["Setup test environment"]}
3
- {"type":"Entity","name":"action_Test_basic_operations","entityType":"action","observations":["Test basic operations"]}
4
- {"type":"Entity","name":"action_Test_telescope_feature","entityType":"action","observations":["Test telescope feature"]}
5
- {"type":"Relation","from":"chart_test_master_chart","to":"action_Setup_test_environment","relationType":"hasAction"}
6
- {"type":"Relation","from":"chart_test_master_chart","to":"action_Test_basic_operations","relationType":"hasAction"}
7
- {"type":"Relation","from":"chart_test_master_chart","to":"action_Test_telescope_feature","relationType":"hasAction"}
8
- {"type":"Entity","name":"outcome_Complete_MCP_testing","entityType":"desiredOutcome","observations":["Complete MCP integration testing suite"]}
9
- {"type":"Relation","from":"chart_test_master_chart","to":"outcome_Complete_MCP_testing","relationType":"hasDesiredOutcome"}
10
- {"type":"Entity","name":"reality_Initial_state","entityType":"currentReality","observations":["Starting MCP test suite","No charts created yet","Need to validate all MCP tools"]}
11
- {"type":"Relation","from":"chart_test_master_chart","to":"reality_Initial_state","relationType":"hasCurrentReality"}
package/test-run.log DELETED
@@ -1,101 +0,0 @@
1
- =========================================
2
- COAIA Visualizer MCP Test Environment
3
- =========================================
4
-
5
- Working directory: /workspace/repos/jgwill/coaia-visualizer-feat-4
6
-
7
- ⚠ Warning: No ANTHROPIC_API_KEY or GOOGLE_API_KEY found
8
- Tests will use direct HTTP calls instead of CLI clients
9
-
10
- Cleaning up previous test results...
11
- Building Docker images...
12
- time="2026-01-16T09:09:43-05:00" level=warning msg="The \"ANTHROPIC_API_KEY\" variable is not set. Defaulting to a blank string."
13
- time="2026-01-16T09:09:43-05:00" level=warning msg="The \"GOOGLE_API_KEY\" variable is not set. Defaulting to a blank string."
14
- #0 building with "default" instance using docker driver
15
-
16
- #1 [visualizer-app internal] load build definition from Dockerfile.app
17
- #1 transferring dockerfile: 1.09kB done
18
- #1 DONE 0.0s
19
-
20
- #2 [visualizer-app internal] load metadata for docker.io/library/node:20-alpine
21
- #2 DONE 0.2s
22
-
23
- #3 [visualizer-app internal] load .dockerignore
24
- #3 transferring context: 121B done
25
- #3 DONE 0.0s
26
-
27
- #4 [visualizer-app builder 1/6] FROM docker.io/library/node:20-alpine@sha256:3960ed74dfe320a67bf8da9555b6bade25ebda2b22b6081d2f60fd7d5d430e9c
28
- #4 DONE 0.0s
29
-
30
- #5 [visualizer-app internal] load build context
31
- #5 transferring context: 82.91kB 0.2s done
32
- #5 DONE 0.2s
33
-
34
- #6 [visualizer-app builder 2/6] WORKDIR /app
35
- #6 CACHED
36
-
37
- #7 [visualizer-app runner 3/13] RUN npm install -g pnpm@latest
38
- #7 CACHED
39
-
40
- #8 [visualizer-app builder 3/6] COPY package.json pnpm-lock.yaml ./
41
- #8 CACHED
42
-
43
- #9 [visualizer-app runner 4/13] COPY package.json pnpm-lock.yaml ./
44
- #9 CACHED
45
-
46
- #10 [visualizer-app builder 4/6] RUN npm install -g pnpm@latest && pnpm install --frozen-lockfile
47
- #10 4.059
48
- #10 4.059 added 1 package in 3s
49
- #10 4.059
50
- #10 4.060 1 package is looking for funding
51
- #10 4.060 run `npm fund` for details
52
- #10 4.064 npm notice
53
- #10 4.064 npm notice New major version of npm available! 10.8.2 -> 11.7.0
54
- #10 4.064 npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.7.0
55
- #10 4.064 npm notice To update run: npm install -g npm@11.7.0
56
- #10 4.064 npm notice
57
- #10 5.648 Lockfile is up to date, resolution step is skipped
58
- #10 5.842 Progress: resolved 1, reused 0, downloaded 0, added 0
59
- #10 6.386 Packages: +296
60
- #10 6.386 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61
- #10 6.846 Progress: resolved 296, reused 0, downloaded 0, added 0
62
- #10 9.510 Progress: resolved 296, reused 0, downloaded 1, added 0
63
- #10 ...
64
-
65
- #11 [visualizer-app runner 5/13] RUN pnpm install --prod --frozen-lockfile --ignore-scripts
66
- #11 1.835 Lockfile is up to date, resolution step is skipped
67
- #11 1.898 Progress: resolved 1, reused 0, downloaded 0, added 0
68
- #11 2.020 Packages: +267
69
- #11 2.020 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
70
- #11 2.966 Progress: resolved 267, reused 0, downloaded 27, added 20
71
- #11 3.978 Progress: resolved 267, reused 0, downloaded 142, added 56
72
- #11 5.006 Progress: resolved 267, reused 0, downloaded 218, added 101
73
- #11 6.017 Progress: resolved 267, reused 0, downloaded 258, added 221
74
- #11 7.020 Progress: resolved 267, reused 0, downloaded 260, added 259
75
- #11 8.018 Progress: resolved 267, reused 0, downloaded 261, added 261
76
- #11 ...
77
-
78
- #10 [visualizer-app builder 4/6] RUN npm install -g pnpm@latest && pnpm install --frozen-lockfile
79
- #10 10.56 Progress: resolved 296, reused 0, downloaded 100, added 95
80
- #10 11.57 Progress: resolved 296, reused 0, downloaded 196, added 195
81
- #10 12.60 Progress: resolved 296, reused 0, downloaded 248, added 231
82
- #10 13.60 Progress: resolved 296, reused 0, downloaded 284, added 283
83
- #10 14.60 Progress: resolved 296, reused 0, downloaded 288, added 288
84
- #10 15.60 Progress: resolved 296, reused 0, downloaded 289, added 288
85
- #10 16.60 Progress: resolved 296, reused 0, downloaded 290, added 290
86
- #10 19.46 Progress: resolved 296, reused 0, downloaded 291, added 290
87
- #10 20.46 Progress: resolved 296, reused 0, downloaded 291, added 291
88
- #10 22.03 Progress: resolved 296, reused 0, downloaded 292, added 291
89
- #10 ...
90
-
91
- #11 [visualizer-app runner 5/13] RUN pnpm install --prod --frozen-lockfile --ignore-scripts
92
- #11 12.39 Progress: resolved 267, reused 0, downloaded 262, added 261
93
- #11 13.39 Progress: resolved 267, reused 0, downloaded 262, added 262
94
- #11 14.39 Progress: resolved 267, reused 0, downloaded 264, added 264
95
- #11 15.39 Progress: resolved 267, reused 0, downloaded 265, added 265
96
- #11 ...
97
-
98
- #10 [visualizer-app builder 4/6] RUN npm install -g pnpm@latest && pnpm install --frozen-lockfile
99
- #10 23.04 Progress: resolved 296, reused 0, downloaded 292, added 292
100
- #10 24.40 Progress: resolved 296, reused 0, downloaded 293, added 292
101
- #10 25.40 Progress: resolved 296, reused 0, downloaded 293, added 293
@@ -1,325 +0,0 @@
1
- # COAIA Visualizer MCP Testing Guide
2
-
3
- ## Overview
4
-
5
- This directory contains a complete Docker-based testing environment for the COAIA Visualizer MCP server. The test suite validates all MCP tools, including the telescope functionality.
6
-
7
- ## Architecture
8
-
9
- ```
10
- ┌─────────────────────┐
11
- │ Test Runner │
12
- │ (test-scripts/) │
13
- └──────────┬──────────┘
14
-
15
- ├─────────────┐
16
- │ │
17
- ┌──────▼──────┐ ┌──▼──────────────┐
18
- │ MCP Server │ │ Next.js App │
19
- │ (stdio) │ │ (HTTP:4321) │
20
- └─────────────┘ └─────────────────┘
21
- │ │
22
- └────────┬────────┘
23
-
24
- ┌─────▼─────┐
25
- │ Data │
26
- │ (JSONL) │
27
- └───────────┘
28
- ```
29
-
30
- ## Quick Start
31
-
32
- ### 1. Set up environment variables (optional)
33
-
34
- ```bash
35
- # For Claude CLI testing
36
- export ANTHROPIC_API_KEY="your_key_here"
37
-
38
- # For Gemini CLI testing
39
- export GOOGLE_API_KEY="your_key_here"
40
- ```
41
-
42
- **Note:** API keys are optional. Tests will use direct HTTP calls if not provided.
43
-
44
- ### 2. Run all tests
45
-
46
- ```bash
47
- chmod +x run-mcp-tests.sh
48
- ./run-mcp-tests.sh
49
- ```
50
-
51
- This will:
52
- - Build Docker images for all services
53
- - Start the visualizer app and MCP server
54
- - Run the complete test suite
55
- - Generate test results
56
- - Clean up containers
57
-
58
- ## Test Suite
59
-
60
- ### Test 01: Basic Operations
61
- - Creates charts via API
62
- - Lists all charts
63
- - Verifies chart creation
64
-
65
- ### Test 02: Telescope Creation
66
- - Adds action steps to charts
67
- - Creates telescoped charts from actions
68
- - Tests both `add_action_step` (with createAsTelescopedChart flag)
69
- - Tests `create_telescoped_chart` tool
70
- - Verifies sub-chart creation
71
-
72
- ### Test 03: Navigation & Hierarchy
73
- - Retrieves parent charts
74
- - Retrieves telescoped child charts
75
- - Verifies parent-child relationships
76
- - Tests search functionality
77
- - Validates navigation metadata
78
-
79
- ## Test Results
80
-
81
- After running tests, check:
82
- - `test-results/test-01/` - Basic operations results
83
- - `test-results/test-02/` - Telescope creation results
84
- - `test-results/test-03/` - Navigation results
85
- - `test-results/test-summary.txt` - Overall summary
86
- - `test-results/navigation-summary.txt` - Navigation summary
87
-
88
- ## Manual Testing
89
-
90
- ### Start services only
91
-
92
- ```bash
93
- docker-compose -f docker-compose.test.yml up -d visualizer-app mcp-server
94
- ```
95
-
96
- ### Access the app
97
-
98
- ```bash
99
- # Web UI
100
- http://localhost:4321
101
-
102
- # API endpoint
103
- curl http://localhost:4321/api/charts
104
- ```
105
-
106
- ### Run individual tests
107
-
108
- ```bash
109
- docker-compose -f docker-compose.test.yml run --rm test-runner /test-scripts/test-01-basic-operations.sh
110
- ```
111
-
112
- ### Check logs
113
-
114
- ```bash
115
- docker-compose -f docker-compose.test.yml logs visualizer-app
116
- docker-compose -f docker-compose.test.yml logs mcp-server
117
- ```
118
-
119
- ### Stop services
120
-
121
- ```bash
122
- docker-compose -f docker-compose.test.yml down
123
- ```
124
-
125
- ## MCP Server Configuration
126
-
127
- The MCP server is configured via `mcp-config.json`:
128
-
129
- ```json
130
- {
131
- "mcpServers": {
132
- "coaia-visualizer": {
133
- "command": "node",
134
- "args": ["/app/dist/index.js"],
135
- "env": {
136
- "VISUALIZER_API_URL": "http://visualizer-app:4321",
137
- "VISUALIZER_API_KEY": "test-api-key"
138
- }
139
- }
140
- }
141
- }
142
- ```
143
-
144
- ## Connecting with Claude Desktop
145
-
146
- To use the MCP server with Claude Desktop:
147
-
148
- 1. Copy the built MCP server:
149
- ```bash
150
- docker cp $(docker-compose -f docker-compose.test.yml ps -q mcp-server):/app/dist ./mcp-dist
151
- ```
152
-
153
- 2. Update Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
154
- ```json
155
- {
156
- "mcpServers": {
157
- "coaia-visualizer": {
158
- "command": "node",
159
- "args": ["<path-to>/mcp-dist/index.js"],
160
- "env": {
161
- "VISUALIZER_API_URL": "http://localhost:4321",
162
- "VISUALIZER_API_KEY": "your-api-key"
163
- }
164
- }
165
- }
166
- }
167
- ```
168
-
169
- 3. Restart Claude Desktop
170
-
171
- ## Available MCP Tools
172
-
173
- - `create_chart` - Create new structural tension chart
174
- - `update_chart` - Update existing chart
175
- - `delete_chart` - Delete chart
176
- - `search_charts` - Search charts by query
177
- - `create_telescoped_chart` - **NEW** Telescope existing action into sub-chart
178
- - `add_action_step` - Add action (optionally as telescoped chart)
179
-
180
- ## Troubleshooting
181
-
182
- ### Services won't start
183
- ```bash
184
- # Check logs
185
- docker-compose -f docker-compose.test.yml logs
186
-
187
- # Rebuild images
188
- docker-compose -f docker-compose.test.yml build --no-cache
189
- ```
190
-
191
- ### Tests fail
192
- ```bash
193
- # Check individual test output
194
- cat test-results/test-01/*.json
195
- cat test-results/test-02/*.json
196
- cat test-results/test-03/*.json
197
- ```
198
-
199
- ### API connection issues
200
- ```bash
201
- # Verify network connectivity
202
- docker-compose -f docker-compose.test.yml exec test-runner curl -v http://visualizer-app:4321/api/charts
203
- ```
204
-
205
- ## Development
206
-
207
- ### Modify tests
208
-
209
- Edit files in `test-scripts/`:
210
- - `run-all-tests.sh` - Main test orchestrator
211
- - `test-01-basic-operations.sh` - Basic CRUD tests
212
- - `test-02-telescope-creation.sh` - Telescope feature tests
213
- - `test-03-navigation.sh` - Navigation and hierarchy tests
214
-
215
- ### Add test data
216
-
217
- Add JSONL files to `test-data/`:
218
- - `test-master.jsonl` - Sample chart with actions
219
-
220
- ### Update Docker images
221
-
222
- Modify:
223
- - `Dockerfile.app` - Next.js application
224
- - `mcp/Dockerfile` - MCP server
225
- - `Dockerfile.test` - Test runner environment
226
-
227
- ## CI/CD Integration
228
-
229
- This test suite can be integrated into CI/CD pipelines:
230
-
231
- ```yaml
232
- # Example GitHub Actions
233
- - name: Run MCP Tests
234
- run: |
235
- chmod +x run-mcp-tests.sh
236
- ./run-mcp-tests.sh
237
- env:
238
- ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
239
- ```
240
-
241
- ---
242
-
243
- ## Global CLI Testing
244
-
245
- ### Quick Test
246
-
247
- ```bash
248
- # Run the verification script
249
- ./test-scripts/verify-global-cli.sh
250
- ```
251
-
252
- ### Tests Included
253
-
254
- #### 1. Bash Verification Script
255
- **File:** `test-scripts/verify-global-cli.sh`
256
-
257
- **What it tests:**
258
- - ✅ CLI starts without errors
259
- - ✅ No file watch limit errors (Turbopack)
260
- - ✅ Server becomes ready within timeout
261
- - ✅ HTTP endpoint responds correctly
262
- - ✅ Turbopack uses correct project directory
263
-
264
- **Usage:**
265
- ```bash
266
- ./test-scripts/verify-global-cli.sh
267
- ```
268
-
269
- #### 2. Playwright End-to-End Tests
270
- **File:** `test-scripts/test-global-cli.spec.ts`
271
-
272
- **What it tests:**
273
- - ✅ CLI launches without file watch errors
274
- - ✅ Server starts and responds to HTTP requests
275
- - ✅ UI loads with correct content
276
- - ✅ Sample chart data loads correctly
277
- - ✅ Different port configurations work
278
-
279
- **Usage:**
280
- ```bash
281
- npm run test:global-cli
282
- ```
283
-
284
- ### Expected Output
285
-
286
- #### Successful Test
287
- ```
288
- 🧪 Testing globally installed coaia-visualizer CLI
289
- 📁 Sample file: /a/src/coaia-visualizer/samples/tradingchart.jsonl
290
- 🌐 Port: 3099
291
-
292
- ⏳ Waiting for server to start (PID: 123456)...
293
- ✅ Server started successfully
294
- 🔍 Testing HTTP response...
295
- ✅ Server responding correctly
296
- 🔍 Checking for file watch errors...
297
- ✅ No file watch errors detected
298
- 🔍 Verifying Turbopack project directory...
299
- ✅ Turbopack using correct project directory
300
-
301
- ✅ All tests passed! CLI works correctly without file watch errors.
302
- ```
303
-
304
- ### Testing After CLI Changes
305
-
306
- After making changes to the CLI, always:
307
-
308
- 1. **Rebuild the CLI:**
309
- ```bash
310
- npm run build:cli
311
- ```
312
-
313
- 2. **Reinstall globally:**
314
- ```bash
315
- npm install -g .
316
- ```
317
-
318
- 3. **Run verification:**
319
- ```bash
320
- ./test-scripts/verify-global-cli.sh
321
- ```
322
-
323
- ### Related Documentation
324
-
325
- - [CLI_FILE_WATCHING_FIX.md](../CLI_FILE_WATCHING_FIX.md) - Complete fix documentation