coaia-visualizer 1.4.2 → 1.5.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/.dockerignore +9 -0
- package/Dockerfile.app +50 -0
- package/Dockerfile.test +24 -0
- package/LIVE_MODE_DESIGN.md +435 -0
- package/MCP_TESTING_COMPLETE.md +302 -0
- package/MCP_TESTING_IMPLEMENTATION_SUMMARY.md +317 -0
- package/MCP_TESTING_SETUP.md +268 -0
- package/NAMING.md +218 -0
- package/QUICK_START_MCP_TESTING.md +236 -0
- package/WS__issue_8__coaia-visualizer__260207.code-workspace +45 -0
- package/app/api/audio/[filename]/route.ts +37 -0
- package/app/api/charts/[id]/route.ts +48 -35
- package/app/api/watch/route.ts +42 -0
- package/app/page.tsx +103 -53
- package/cli.ts +56 -3
- package/components/add-master-chart.tsx +230 -0
- package/components/chart-detail-editable.tsx +27 -16
- package/components/chart-list.tsx +13 -1
- package/components/create-chart-form.tsx +248 -0
- package/components/data-stats.tsx +9 -7
- package/components/live-indicator.tsx +14 -0
- package/components/ui/dialog.tsx +143 -0
- package/components/ui/label.tsx +24 -0
- package/direct-test.sh +180 -0
- package/dist/cli.js +52 -3
- package/docker-compose.test.yml +69 -0
- package/hooks/use-live-polling.ts +45 -0
- package/jgwill.coaia-visualizer-8--496dca71-d476-4ac9-ba9f-376add118dd8--260208.txt +2612 -0
- package/lib/chart-editor.ts +281 -68
- package/mcp/Dockerfile +21 -0
- package/mcp/README.md +25 -6
- package/mcp/src/api-client.ts +15 -3
- package/mcp/src/index.ts +17 -2
- package/mcp/src/tools/index.ts +21 -1
- package/mcp/test_mcp/.gemini/settings.json +18 -0
- package/mcp-config.json +14 -0
- package/package.json +2 -2
- package/run-mcp-tests.sh +99 -0
- package/samples/tradingchart.jsonl +31 -0
- package/test-data/test-master.jsonl +11 -0
- package/test-run.log +101 -0
- package/test-scripts/README.md +239 -0
- package/test-scripts/run-all-tests.sh +38 -0
- package/test-scripts/test-01-basic-operations.sh +87 -0
- package/test-scripts/test-02-telescope-creation.sh +91 -0
- package/test-scripts/test-03-navigation.sh +87 -0
- package/validate-mcp.sh +136 -0
package/mcp/src/index.ts
CHANGED
|
@@ -102,7 +102,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
102
102
|
if (typedArgs.updateDesiredOutcome) updates.updateDesiredOutcome = typedArgs.updateDesiredOutcome
|
|
103
103
|
if (typedArgs.addCurrentRealityObservation) updates.addCurrentRealityObservation = typedArgs.addCurrentRealityObservation
|
|
104
104
|
if ('updateDueDate' in typedArgs) updates.updateDueDate = typedArgs.updateDueDate
|
|
105
|
-
|
|
105
|
+
|
|
106
106
|
const result = await client.updateChart(typedArgs.chartId, updates)
|
|
107
107
|
return {
|
|
108
108
|
content: [
|
|
@@ -223,6 +223,21 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
case 'create_telescoped_chart': {
|
|
227
|
+
const result = await client.createTelescopedChart(
|
|
228
|
+
typedArgs.chartId,
|
|
229
|
+
typedArgs.actionName
|
|
230
|
+
)
|
|
231
|
+
return {
|
|
232
|
+
content: [
|
|
233
|
+
{
|
|
234
|
+
type: 'text',
|
|
235
|
+
text: JSON.stringify(result, null, 2),
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
226
241
|
case 'delete_chart': {
|
|
227
242
|
const result = await client.deleteChart(typedArgs.chartId)
|
|
228
243
|
return {
|
|
@@ -294,7 +309,7 @@ async function main() {
|
|
|
294
309
|
|
|
295
310
|
const transport = new StdioServerTransport()
|
|
296
311
|
await server.connect(transport)
|
|
297
|
-
|
|
312
|
+
|
|
298
313
|
console.error('✅ MCP Server running')
|
|
299
314
|
}
|
|
300
315
|
|
package/mcp/src/tools/index.ts
CHANGED
|
@@ -245,6 +245,25 @@ export const DELETE_ACTION_STEP_TOOL: Tool = {
|
|
|
245
245
|
},
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
+
export const CREATE_TELESCOPED_CHART_TOOL: Tool = {
|
|
249
|
+
name: 'create_telescoped_chart',
|
|
250
|
+
description: 'Create a telescoped chart from an EXISTING action step. This converts an action into a detailed sub-chart for drilling down into work. Different from add_action_step which creates a NEW action as a telescoped chart.',
|
|
251
|
+
inputSchema: {
|
|
252
|
+
type: 'object',
|
|
253
|
+
properties: {
|
|
254
|
+
chartId: {
|
|
255
|
+
type: 'string',
|
|
256
|
+
description: 'The parent chart ID containing the action',
|
|
257
|
+
},
|
|
258
|
+
actionName: {
|
|
259
|
+
type: 'string',
|
|
260
|
+
description: 'The action entity name to telescope (e.g., "chart_1_action_1")',
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
required: ['chartId', 'actionName'],
|
|
264
|
+
},
|
|
265
|
+
}
|
|
266
|
+
|
|
248
267
|
export const DELETE_CHART_TOOL: Tool = {
|
|
249
268
|
name: 'delete_chart',
|
|
250
269
|
description: 'Delete a chart and all its sub-charts, actions, and narrative beats',
|
|
@@ -310,10 +329,11 @@ export const ALL_TOOLS: Tool[] = [
|
|
|
310
329
|
UPDATE_ACTION_STEP_TOOL,
|
|
311
330
|
MARK_ACTION_COMPLETE_TOOL,
|
|
312
331
|
UPDATE_ACTION_PROGRESS_TOOL,
|
|
332
|
+
UPDATE_CURRENT_REALITY_TOOL,
|
|
313
333
|
TOGGLE_ACTION_COMPLETION_TOOL,
|
|
314
334
|
DELETE_ACTION_STEP_TOOL,
|
|
335
|
+
CREATE_TELESCOPED_CHART_TOOL,
|
|
315
336
|
DELETE_CHART_TOOL,
|
|
316
337
|
SEARCH_CHARTS_TOOL,
|
|
317
338
|
GET_CHART_PROGRESS_TOOL,
|
|
318
|
-
UPDATE_CURRENT_REALITY_TOOL,
|
|
319
339
|
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"chart-coaia-narrative-legacy-mcp": {
|
|
4
|
+
"command": "npx",
|
|
5
|
+
"args": ["-y", "${CNCV}", "--memory-path", "${memories}/trading-chart.coaia-narrative.jsonl" ]
|
|
6
|
+
},
|
|
7
|
+
"charts-mcp": {
|
|
8
|
+
"command": "node",
|
|
9
|
+
"args": [
|
|
10
|
+
"/workspace/repos/jgwill/coaia-visualizer-feat-4/mcp/dist/index.js"
|
|
11
|
+
],
|
|
12
|
+
"env": {
|
|
13
|
+
"COAIAN_API_TOKEN":"123",
|
|
14
|
+
"COAIAV_API_URL":"http://localhost:4321"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
package/mcp-config.json
ADDED
package/package.json
CHANGED
package/run-mcp-tests.sh
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# MCP Integration Test Runner
|
|
4
|
+
# This script builds and runs the complete Docker-based test environment
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
# Get the directory where the script is located
|
|
9
|
+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
10
|
+
cd "$SCRIPT_DIR"
|
|
11
|
+
|
|
12
|
+
echo "========================================="
|
|
13
|
+
echo "COAIA Visualizer MCP Test Environment"
|
|
14
|
+
echo "========================================="
|
|
15
|
+
echo ""
|
|
16
|
+
echo "Working directory: $(pwd)"
|
|
17
|
+
echo ""
|
|
18
|
+
|
|
19
|
+
# Check if .env.test exists
|
|
20
|
+
if [ ! -f .env.test ]; then
|
|
21
|
+
echo "Creating .env.test file..."
|
|
22
|
+
cat > .env.test << EOF
|
|
23
|
+
VISUALIZER_API_URL=http://visualizer-app:4321
|
|
24
|
+
VISUALIZER_API_KEY=test-api-key
|
|
25
|
+
TEST_MODE=true
|
|
26
|
+
LOG_LEVEL=debug
|
|
27
|
+
EOF
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
# Check for API keys if using Claude or Gemini CLI
|
|
31
|
+
if [ -z "$ANTHROPIC_API_KEY" ] && [ -z "$GOOGLE_API_KEY" ]; then
|
|
32
|
+
echo "⚠ Warning: No ANTHROPIC_API_KEY or GOOGLE_API_KEY found"
|
|
33
|
+
echo " Tests will use direct HTTP calls instead of CLI clients"
|
|
34
|
+
echo ""
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Clean up previous test results
|
|
38
|
+
echo "Cleaning up previous test results..."
|
|
39
|
+
rm -rf test-results/*
|
|
40
|
+
mkdir -p test-results
|
|
41
|
+
|
|
42
|
+
# Build and start services
|
|
43
|
+
echo "Building Docker images..."
|
|
44
|
+
docker-compose -f docker-compose.test.yml build
|
|
45
|
+
|
|
46
|
+
echo ""
|
|
47
|
+
echo "Starting services..."
|
|
48
|
+
docker-compose -f docker-compose.test.yml up -d visualizer-app mcp-server
|
|
49
|
+
|
|
50
|
+
echo ""
|
|
51
|
+
echo "Waiting for services to be healthy..."
|
|
52
|
+
sleep 10
|
|
53
|
+
|
|
54
|
+
# Check if visualizer app is running
|
|
55
|
+
if docker-compose -f docker-compose.test.yml ps | grep -q "visualizer-app.*Up"; then
|
|
56
|
+
echo "✓ Visualizer app is running"
|
|
57
|
+
else
|
|
58
|
+
echo "✗ Visualizer app failed to start"
|
|
59
|
+
docker-compose -f docker-compose.test.yml logs visualizer-app
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# Run tests
|
|
64
|
+
echo ""
|
|
65
|
+
echo "Running integration tests..."
|
|
66
|
+
docker-compose -f docker-compose.test.yml run --rm test-runner
|
|
67
|
+
|
|
68
|
+
# Capture exit code
|
|
69
|
+
TEST_EXIT_CODE=$?
|
|
70
|
+
|
|
71
|
+
# Show results
|
|
72
|
+
echo ""
|
|
73
|
+
echo "========================================="
|
|
74
|
+
echo "Test Results"
|
|
75
|
+
echo "========================================="
|
|
76
|
+
|
|
77
|
+
if [ -f test-results/test-summary.txt ]; then
|
|
78
|
+
cat test-results/test-summary.txt
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
if [ -f test-results/navigation-summary.txt ]; then
|
|
82
|
+
echo ""
|
|
83
|
+
cat test-results/navigation-summary.txt
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
# Cleanup
|
|
87
|
+
echo ""
|
|
88
|
+
echo "Cleaning up..."
|
|
89
|
+
docker-compose -f docker-compose.test.yml down
|
|
90
|
+
|
|
91
|
+
echo ""
|
|
92
|
+
if [ $TEST_EXIT_CODE -eq 0 ]; then
|
|
93
|
+
echo "✓ All tests PASSED"
|
|
94
|
+
else
|
|
95
|
+
echo "✗ Tests FAILED"
|
|
96
|
+
echo " Check test-results/ directory for details"
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
exit $TEST_EXIT_CODE
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{"type":"entity","name":"chart_1767434421888_chart","entityType":"structural_tension_chart","observations":["Chart created on 2026-01-03T10:00:21.888Z"],"metadata":{"chartId":"chart_1767434421888","dueDate":"2026-01-10","level":0,"createdAt":"2026-01-03T10:00:21.888Z","updatedAt":"2026-01-03T10:00:21.888Z"}}
|
|
2
|
+
{"type":"entity","name":"chart_1767434421888_desired_outcome","entityType":"desired_outcome","observations":["Automated FX trading system generating $1,100-2,200/month profit through validated regime-aware signals with flowing data pipeline"],"metadata":{"chartId":"chart_1767434421888","dueDate":"2026-01-10","createdAt":"2026-01-03T10:00:21.888Z","updatedAt":"2026-01-03T10:00:21.888Z"}}
|
|
3
|
+
{"type":"entity","name":"chart_1767434421888_current_reality","entityType":"current_reality","observations":["Phase 1 complete with 61.9% win rate validated. 9 Python packages integrated. Monitor running (PID 2167008). Data pipeline stalled 9 days - jgtfxcon returning Dec 24 timestamps. TandT validation correctly blocks stale data trades."],"metadata":{"chartId":"chart_1767434421888","createdAt":"2026-01-03T10:00:21.888Z","updatedAt":"2026-01-03T10:00:21.888Z"}}
|
|
4
|
+
{"type":"entity","name":"chart_1767434421888_action_1","entityType":"action_step","observations":["Restore data pipeline flow from broker"],"metadata":{"chartId":"chart_1767434421888","dueDate":"2026-01-15T05:00:00.000Z","completionStatus":false,"createdAt":"2026-01-03T10:00:21.888Z","updatedAt":"2026-01-11T17:06:19.876Z"}}
|
|
5
|
+
{"type":"entity","name":"chart_1767434421888_action_2","entityType":"action_step","observations":["Validate PDS→CDS→TTF end-to-end pipeline"],"metadata":{"chartId":"chart_1767434421888","dueDate":"2026-01-05T07:08:49.920Z","completionStatus":false,"createdAt":"2026-01-03T10:00:21.888Z","updatedAt":"2026-01-03T10:00:21.888Z"}}
|
|
6
|
+
{"type":"entity","name":"chart_1767434421888_action_3","entityType":"action_step","observations":["Achieve first live FDB signal detection"],"metadata":{"chartId":"chart_1767434421888","dueDate":"2026-01-06T05:43:03.936Z","completionStatus":false,"createdAt":"2026-01-03T10:00:21.888Z","updatedAt":"2026-01-03T10:00:21.888Z"}}
|
|
7
|
+
{"type":"entity","name":"chart_1767434421888_action_4","entityType":"action_step","observations":["Deploy container environment for parallel work"],"metadata":{"chartId":"chart_1767434421888","dueDate":"2026-01-07T04:17:17.952Z","completionStatus":false,"createdAt":"2026-01-03T10:00:21.888Z","updatedAt":"2026-01-03T10:00:21.888Z"}}
|
|
8
|
+
{"type":"entity","name":"chart_1767434421888_action_5","entityType":"action_step","observations":["Establish multi-instance coordination protocol"],"metadata":{"chartId":"chart_1767434421888","dueDate":"2026-01-08T02:51:31.968Z","completionStatus":false,"createdAt":"2026-01-03T10:00:21.888Z","updatedAt":"2026-01-03T10:00:21.888Z"}}
|
|
9
|
+
{"type":"entity","name":"chart_1767434421888_action_6","entityType":"action_step","observations":["Execute Phase 2 validation with first trades"],"metadata":{"chartId":"chart_1767434421888","dueDate":"2026-01-09T01:25:45.984Z","completionStatus":false,"createdAt":"2026-01-03T10:00:21.888Z","updatedAt":"2026-01-03T10:00:21.888Z"}}
|
|
10
|
+
{"type":"entity","name":"chart_1767434421888_beat_1767606309464","entityType":"narrative_beat","observations":["Act 1 Setup","Timestamp: 2026-01-05T09:45:09.464Z","Universe: engineer-world, ceremony-world, story-engine-world"],"metadata":{"chartId":"chart_1767434421888","act":1,"type_dramatic":"Setup","universes":["engineer-world","ceremony-world","story-engine-world"],"timestamp":"2026-01-05T09:45:09.464Z","createdAt":"2026-01-05T09:45:09.464Z","narrative":{"description":"Chart created Jan 3, 2026 capturing the creative tension between validated Phase 1 (61.9% WR) and desired Phase 2 ($1.1-2.2K/month)","prose":"The structural tension forms: desired outcome ($1,100-2,200/month through regime-aware signals) meets current reality (61.9% win rate validated, but data pipeline stalled 9 days). The tension is creative, not problematic—TandT correctly blocks stale data trades. Six action steps distribute across Jan 4-9, each a stepping stone toward the living system. The dream is named; the path is visible; the blocker is honest.","lessons":["Structural tension = creative force, not problem to solve","Phase 1 success (61.9% WR) validates the approach","jgtfxcon Dec 24 timestamp issue is the critical blocker","TandT validation working correctly—system protecting itself"]},"relationalAlignment":{"assessed":false,"score":null,"principles":[]},"fourDirections":{"north_vision":null,"east_intention":null,"south_emotion":null,"west_introspection":null}}}
|
|
11
|
+
{"type":"entity","name":"chart_1767434421888_beat_1767606319012","entityType":"narrative_beat","observations":["Act 2 Discovery/Learning","Timestamp: 2026-01-05T09:45:19.012Z","Universe: engineer-world, ceremony-world, story-engine-world"],"metadata":{"chartId":"chart_1767434421888","act":2,"type_dramatic":"Discovery/Learning","universes":["engineer-world","ceremony-world","story-engine-world"],"timestamp":"2026-01-05T09:45:19.012Z","createdAt":"2026-01-05T09:45:19.012Z","narrative":{"description":"Commit e697d04 imports 19 files (+2252 lines) including jgtfxcon, Phase1 reports, and session launchers into git provenance","prose":"The scattered artifacts of Phase 1—jgtfxcon broker connections, implementation plans, progress reports—gather into a single repository. Like tools laid on a workbench before the craft begins, 2252 lines of code and documentation find their place in version control. The data pipeline blocker (Dec 24 timestamps) remains, but now the code to diagnose it lives in sacred git space where archaeology becomes possible.","lessons":["jgtfxcon package now accessible for pipeline debugging","Phase 1 documentation (61.9% WR) preserved for reference","Git provenance enables collaborative development","Blocker visible but unresolved: e697d04 is foundation, not fix"]},"relationalAlignment":{"assessed":false,"score":null,"principles":[]},"fourDirections":{"north_vision":null,"east_intention":null,"south_emotion":null,"west_introspection":null}}}
|
|
12
|
+
{"type":"entity","name":"chart_1767434421888_beat_1767606330232","entityType":"narrative_beat","observations":["Act 3 Character Development","Timestamp: 2026-01-05T09:45:30.232Z","Universe: engineer-world, ceremony-world, story-engine-world"],"metadata":{"chartId":"chart_1767434421888","act":3,"type_dramatic":"Character Development","universes":["engineer-world","ceremony-world","story-engine-world"],"timestamp":"2026-01-05T09:45:30.232Z","createdAt":"2026-01-05T09:45:30.232Z","narrative":{"description":"Commit 3427a35 enhances LAUNCH script with EAST/NORTH directional framing (+101/-8 lines)","prose":"Before executing, we ground. The LAUNCH script receives ceremonial additions: EAST intention (new beginning, place-based thinking) and NORTH storytelling protocol (reflection, not logging). The shell script—mere syntax before—becomes ritual object. MCP tool integration points Claude Code toward trading-chart-coaia-narrative for narrative storage. The blocker remains acknowledged but this commit says: when we do fix it, we will know why.","lessons":["Epistemological framing precedes execution","EAST: Place-based intention grounds the work","NORTH: Storytelling transforms logs into medicine","Blocker acknowledged in script documentation"]},"relationalAlignment":{"assessed":false,"score":null,"principles":[]},"fourDirections":{"north_vision":null,"east_intention":null,"south_emotion":null,"west_introspection":null}}}
|
|
13
|
+
{"type":"relation","from":"chart_1767434421888_chart","to":"chart_1767434421888_desired_outcome","relationType":"contains","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
14
|
+
{"type":"relation","from":"chart_1767434421888_chart","to":"chart_1767434421888_current_reality","relationType":"contains","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
15
|
+
{"type":"relation","from":"chart_1767434421888_current_reality","to":"chart_1767434421888_desired_outcome","relationType":"creates_tension_with","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
16
|
+
{"type":"relation","from":"chart_1767434421888_chart","to":"chart_1767434421888_action_1","relationType":"contains","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
17
|
+
{"type":"relation","from":"chart_1767434421888_action_1","to":"chart_1767434421888_desired_outcome","relationType":"advances_toward","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
18
|
+
{"type":"relation","from":"chart_1767434421888_chart","to":"chart_1767434421888_action_2","relationType":"contains","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
19
|
+
{"type":"relation","from":"chart_1767434421888_action_2","to":"chart_1767434421888_desired_outcome","relationType":"advances_toward","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
20
|
+
{"type":"relation","from":"chart_1767434421888_chart","to":"chart_1767434421888_action_3","relationType":"contains","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
21
|
+
{"type":"relation","from":"chart_1767434421888_action_3","to":"chart_1767434421888_desired_outcome","relationType":"advances_toward","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
22
|
+
{"type":"relation","from":"chart_1767434421888_chart","to":"chart_1767434421888_action_4","relationType":"contains","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
23
|
+
{"type":"relation","from":"chart_1767434421888_action_4","to":"chart_1767434421888_desired_outcome","relationType":"advances_toward","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
24
|
+
{"type":"relation","from":"chart_1767434421888_chart","to":"chart_1767434421888_action_5","relationType":"contains","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
25
|
+
{"type":"relation","from":"chart_1767434421888_action_5","to":"chart_1767434421888_desired_outcome","relationType":"advances_toward","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
26
|
+
{"type":"relation","from":"chart_1767434421888_chart","to":"chart_1767434421888_action_6","relationType":"contains","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
27
|
+
{"type":"relation","from":"chart_1767434421888_action_6","to":"chart_1767434421888_desired_outcome","relationType":"advances_toward","metadata":{"createdAt":"2026-01-03T10:00:21.888Z"}}
|
|
28
|
+
{"type":"relation","from":"chart_1767434421888_beat_1767606309464","to":"chart_1767434421888_chart","relationType":"documents","metadata":{"createdAt":"2026-01-05T09:45:09.467Z","description":"Narrative beat documents chart progress"}}
|
|
29
|
+
{"type":"relation","from":"chart_1767434421888_beat_1767606319012","to":"chart_1767434421888_chart","relationType":"documents","metadata":{"createdAt":"2026-01-05T09:45:19.014Z","description":"Narrative beat documents chart progress"}}
|
|
30
|
+
{"type":"relation","from":"chart_1767434421888_beat_1767606330232","to":"chart_1767434421888_chart","relationType":"documents","metadata":{"createdAt":"2026-01-05T09:45:30.234Z","description":"Narrative beat documents chart progress"}}
|
|
31
|
+
{"type":"relation","from":"chart_1767434421888","to":"chart_1767434421888_action_1","relationType":"contains","metadata":{}}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
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
|
|
@@ -0,0 +1,239 @@
|
|
|
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
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
echo "========================================="
|
|
5
|
+
echo "COAIA Visualizer MCP Integration Tests"
|
|
6
|
+
echo "========================================="
|
|
7
|
+
echo ""
|
|
8
|
+
|
|
9
|
+
# Wait for services to be ready
|
|
10
|
+
echo "Waiting for services to be ready..."
|
|
11
|
+
sleep 5
|
|
12
|
+
|
|
13
|
+
# Check if visualizer API is accessible
|
|
14
|
+
echo "Testing Visualizer API connectivity..."
|
|
15
|
+
if curl -f http://visualizer-app:4321/api/charts > /dev/null 2>&1; then
|
|
16
|
+
echo "✓ Visualizer API is accessible"
|
|
17
|
+
else
|
|
18
|
+
echo "✗ Visualizer API is not accessible"
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
echo ""
|
|
23
|
+
echo "Running MCP tool tests..."
|
|
24
|
+
echo ""
|
|
25
|
+
|
|
26
|
+
# Run individual test suites
|
|
27
|
+
/test-scripts/test-01-basic-operations.sh
|
|
28
|
+
/test-scripts/test-02-telescope-creation.sh
|
|
29
|
+
/test-scripts/test-03-navigation.sh
|
|
30
|
+
|
|
31
|
+
echo ""
|
|
32
|
+
echo "========================================="
|
|
33
|
+
echo "All tests completed!"
|
|
34
|
+
echo "========================================="
|
|
35
|
+
|
|
36
|
+
# Save results summary
|
|
37
|
+
date > /test-results/test-summary.txt
|
|
38
|
+
echo "All MCP integration tests passed" >> /test-results/test-summary.txt
|