miadi 1.0.14 → 2.0.1

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 (53) hide show
  1. package/package.json +17 -48
  2. package/.env.example +0 -28
  3. package/ARCHITECTURE.md +0 -290
  4. package/CLAUDE.md +0 -269
  5. package/GEMINI.md +0 -80
  6. package/MCP_CONNECTOR_READY.md +0 -219
  7. package/MCP_LEARNING_NOTES.md +0 -178
  8. package/MCP_REBUILD_PLAN.md +0 -159
  9. package/MCP_REMOTE_SERVER_SPEC.md +0 -373
  10. package/MIA.md +0 -344
  11. package/MIETTE.md +0 -195
  12. package/README.md +0 -264
  13. package/REMOTE_MCP_TRANSFORMATION_GUIDE.md +0 -384
  14. package/STATUS.md +0 -191
  15. package/TOOL_SELECTION_PLAN.md +0 -340
  16. package/WAKE_UP_SUMMARY.md +0 -102
  17. package/__PUBLISH.sh +0 -1
  18. package/book/_/ledgers/ledger_miadi_mcp_analysis_250730.md +0 -0
  19. package/conversations/2507301433.claude.issue.11.2025-07-30-this-mcp-is-not-working-another-instance-of-yours.txt +0 -756
  20. package/conversations/2507301601.cursor.reverse_engineer_mcp_service_for.md +0 -808
  21. package/conversations/2508050125.llmcon.claude.MIADI_TOOLS-implement-what-is-in-toolselectionplanmd.txt +0 -1235
  22. package/conversations/2508051939.llmcon.claude.issue-14.TransitionToPlanningIT.implement-what-is-in-toolselectionplanmd.txt +0 -1424
  23. package/conversations/2508082352.llmcon.claude.MCP-Remote-Take-II.txt +0 -1658
  24. package/dist/index-remote.js +0 -54736
  25. package/dist/index.js +0 -32363
  26. package/mcp.sample.json +0 -14
  27. package/openapi.yml +0 -2161
  28. package/research/MCP_Research_Perplexity_2508060045.md +0 -410
  29. package/samples/README.md +0 -2
  30. package/scripts/ngrokserve.sh +0 -6
  31. package/scripts/start-remote.sh +0 -141
  32. package/scripts/start-with-ngrok.sh +0 -140
  33. package/src/api-client.ts +0 -254
  34. package/src/index-remote.ts +0 -406
  35. package/src/index-simple.ts +0 -232
  36. package/src/index.ts +0 -510
  37. package/src/tool-registry.ts +0 -223
  38. package/src/tools/ai-tools.ts +0 -69
  39. package/src/tools/capability-tools.ts +0 -79
  40. package/src/tools/forge-tools.ts +0 -51
  41. package/src/tools/memory-tools.ts +0 -137
  42. package/src/tools/session-tools.ts +0 -135
  43. package/src/tools/workflow-tools.ts +0 -65
  44. package/src/types.ts +0 -291
  45. package/src/utils.ts +0 -279
  46. package/tests/quick-test.sh +0 -116
  47. package/tests/run-all-tests.sh +0 -167
  48. package/tests/test-agent-capabilities.sh +0 -364
  49. package/tests/test-connectivity.sh +0 -90
  50. package/tests/test-memory-operations.sh +0 -236
  51. package/tests/test-session-management.sh +0 -320
  52. package/tests/test-tool-discovery.sh +0 -151
  53. package/tsconfig.json +0 -24
@@ -1,116 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Quick Test Script for Miadi MCP Server
4
- # Runs a subset of tests for rapid validation
5
-
6
- set -e
7
-
8
- # Colors
9
- RED='\033[0;31m'
10
- GREEN='\033[0;32m'
11
- YELLOW='\033[1;33m'
12
- BLUE='\033[0;34m'
13
- NC='\033[0m'
14
-
15
- echo -e "${BLUE}🚀 Quick Miadi MCP Server Test${NC}"
16
- echo -e "${BLUE}Running essential validation tests...${NC}"
17
- echo ""
18
-
19
- TEST_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
20
- PROJECT_DIR="$(dirname "$TEST_DIR")"
21
-
22
- # Check if we're in the right directory
23
- if [ ! -f "$PROJECT_DIR/package.json" ]; then
24
- echo -e "${RED}❌ Error: Not in MCP server project directory${NC}"
25
- exit 1
26
- fi
27
-
28
- cd "$PROJECT_DIR"
29
-
30
- # Test 1: Build verification
31
- echo -e "${YELLOW}📦 Building MCP server...${NC}"
32
- if npm run build > /dev/null 2>&1; then
33
- echo -e "${GREEN}✅ Build successful${NC}"
34
- else
35
- echo -e "${RED}❌ Build failed${NC}"
36
- exit 1
37
- fi
38
-
39
- # Test 2: Environment check
40
- echo -e "${YELLOW}🔧 Checking environment...${NC}"
41
- if [ -f .env ]; then
42
- if grep -q "EH_TOKEN" .env && grep -q "EH_API_URL" .env; then
43
- echo -e "${GREEN}✅ Environment variables configured${NC}"
44
- else
45
- echo -e "${YELLOW}⚠️ Environment variables may be incomplete${NC}"
46
- fi
47
- else
48
- echo -e "${YELLOW}⚠️ No .env file found${NC}"
49
- fi
50
-
51
- # Test 3: Server startup test
52
- echo -e "${YELLOW}🚀 Testing server startup...${NC}"
53
- timeout 5s npm start > /tmp/quick_test_startup.log 2>&1 || true
54
-
55
- if grep -q "✅ Miadi MCP Server is ready and listening!" /tmp/quick_test_startup.log; then
56
- echo -e "${GREEN}✅ Server starts successfully${NC}"
57
- else
58
- echo -e "${RED}❌ Server startup failed${NC}"
59
- echo -e "${YELLOW}📋 Startup log:${NC}"
60
- cat /tmp/quick_test_startup.log
61
- exit 1
62
- fi
63
-
64
- # Test 4: Tool registration check
65
- echo -e "${YELLOW}🔍 Checking tool registrations...${NC}"
66
- tool_count=$(grep -c "server.tool" src/index.ts || echo "0")
67
- if [ "$tool_count" -gt 20 ]; then
68
- echo -e "${GREEN}✅ $tool_count tools registered${NC}"
69
- else
70
- echo -e "${YELLOW}⚠️ Only $tool_count tools found${NC}"
71
- fi
72
-
73
- # Test 5: Basic tool execution test
74
- echo -e "${YELLOW}🧪 Testing basic tool execution...${NC}"
75
-
76
- cat > /tmp/quick_test_tool.json << 'EOF'
77
- {
78
- "jsonrpc": "2.0",
79
- "id": 1,
80
- "method": "tools/call",
81
- "params": {
82
- "name": "miadi-get-agent-info",
83
- "arguments": {}
84
- }
85
- }
86
- EOF
87
-
88
- timeout 10s bash -c '
89
- cat /tmp/quick_test_tool.json | node dist/index.js > /tmp/quick_test_tool_response.log 2>&1 &
90
- SERVER_PID=$!
91
- sleep 3
92
- kill $SERVER_PID 2>/dev/null || true
93
- wait $SERVER_PID 2>/dev/null || true
94
- ' || echo "Tool test completed"
95
-
96
- if [ -f /tmp/quick_test_tool_response.log ]; then
97
- if grep -q "miadi-get-agent-info" /tmp/quick_test_tool_response.log; then
98
- echo -e "${GREEN}✅ Tool execution working${NC}"
99
- else
100
- echo -e "${YELLOW}⚠️ Tool execution may have issues${NC}"
101
- fi
102
- else
103
- echo -e "${YELLOW}⚠️ No tool response captured${NC}"
104
- fi
105
-
106
- # Cleanup
107
- rm -f /tmp/quick_test_*.log /tmp/quick_test_*.json
108
-
109
- echo ""
110
- echo -e "${GREEN}🎉 Quick test completed successfully!${NC}"
111
- echo -e "${BLUE}💡 For comprehensive testing, run: ./tests/run-all-tests.sh${NC}"
112
- echo ""
113
- echo -e "${BLUE}🔧 Next steps:${NC}"
114
- echo -e "${BLUE} 1. Configure Claude Desktop with this MCP server${NC}"
115
- echo -e "${BLUE} 2. Test with MCP Inspector: npx @modelcontextprotocol/inspector npm start${NC}"
116
- echo -e "${BLUE} 3. Run full test suite: ./tests/run-all-tests.sh${NC}"
@@ -1,167 +0,0 @@
1
- #!/bin/bash
2
-
3
- # 🧠 Mia & 🌸 Miette: Miadi MCP Server Test Suite
4
- # Comprehensive testing for all MCP server functionality
5
-
6
- set -e # Exit on any error
7
-
8
- # Colors for output
9
- RED='\033[0;31m'
10
- GREEN='\033[0;32m'
11
- YELLOW='\033[1;33m'
12
- BLUE='\033[0;34m'
13
- NC='\033[0m' # No Color
14
-
15
- # Test configuration
16
- TEST_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
- PROJECT_DIR="$(dirname "$TEST_DIR")"
18
- SERVER_PID=""
19
- SERVER_LOG="$TEST_DIR/server.log"
20
- TEST_RESULTS="$TEST_DIR/test-results.json"
21
-
22
- echo -e "${BLUE}🧠 Mia: Initializing Miadi MCP Server Test Suite${NC}"
23
- echo -e "${BLUE}📁 Project Directory: $PROJECT_DIR${NC}"
24
- echo -e "${BLUE}📋 Test Directory: $TEST_DIR${NC}"
25
-
26
- # Function to start MCP server in background
27
- start_server() {
28
- echo -e "${YELLOW}🚀 Starting MCP Server...${NC}"
29
- cd "$PROJECT_DIR"
30
-
31
- # Build the server
32
- npm run build > /dev/null 2>&1
33
-
34
- # Start server in background with logging
35
- node dist/index.js > "$SERVER_LOG" 2>&1 &
36
- SERVER_PID=$!
37
-
38
- echo -e "${GREEN}✅ Server started with PID: $SERVER_PID${NC}"
39
-
40
- # Wait a moment for server to initialize
41
- sleep 2
42
-
43
- # Check if server is still running
44
- if ! kill -0 $SERVER_PID 2>/dev/null; then
45
- echo -e "${RED}❌ Server failed to start. Check logs:${NC}"
46
- cat "$SERVER_LOG"
47
- exit 1
48
- fi
49
-
50
- # Check for successful startup message
51
- if ! grep -q "✅ Miadi MCP Server is ready and listening!" "$SERVER_LOG" 2>/dev/null; then
52
- echo -e "${YELLOW}⚠️ Server started but startup message not found in logs${NC}"
53
- echo -e "${YELLOW}📋 Server logs:${NC}"
54
- cat "$SERVER_LOG"
55
- fi
56
-
57
- echo -e "${GREEN}✅ Server is running and ready${NC}"
58
- }
59
-
60
- # Function to stop MCP server
61
- stop_server() {
62
- if [ ! -z "$SERVER_PID" ] && kill -0 $SERVER_PID 2>/dev/null; then
63
- echo -e "${YELLOW}🛑 Stopping MCP Server (PID: $SERVER_PID)...${NC}"
64
- kill $SERVER_PID
65
- wait $SERVER_PID 2>/dev/null || true
66
- echo -e "${GREEN}✅ Server stopped${NC}"
67
- fi
68
- }
69
-
70
- # Function to run a test script
71
- run_test() {
72
- local test_name=$1
73
- local test_script=$2
74
-
75
- echo -e "${BLUE}🧪 Running test: $test_name${NC}"
76
-
77
- if bash "$TEST_DIR/$test_script"; then
78
- echo -e "${GREEN}✅ $test_name: PASSED${NC}"
79
- return 0
80
- else
81
- echo -e "${RED}❌ $test_name: FAILED${NC}"
82
- return 1
83
- fi
84
- }
85
-
86
- # Cleanup function
87
- cleanup() {
88
- echo -e "${YELLOW}🧹 Cleaning up...${NC}"
89
- stop_server
90
- exit
91
- }
92
-
93
- # Trap cleanup on script exit
94
- trap cleanup EXIT INT TERM
95
-
96
- # Main test execution
97
- main() {
98
- echo -e "${BLUE}🎯 Starting Miadi MCP Server Test Suite${NC}"
99
- echo -e "${BLUE}$(date)${NC}"
100
- echo ""
101
-
102
- # Start the server
103
- start_server
104
-
105
- # Initialize test results
106
- echo "{\"timestamp\": \"$(date -Iseconds)\", \"tests\": []}" > "$TEST_RESULTS"
107
-
108
- # Test counters
109
- local total_tests=0
110
- local passed_tests=0
111
- local failed_tests=0
112
-
113
- # Run test suites
114
- local tests=(
115
- "Server Connectivity:test-connectivity.sh"
116
- "Tool Discovery:test-tool-discovery.sh"
117
- "Memory Operations:test-memory-operations.sh"
118
- "Session Management:test-session-management.sh"
119
- "Agent Info & Capabilities:test-agent-capabilities.sh"
120
- )
121
-
122
- for test_info in "${tests[@]}"; do
123
- IFS=':' read -r test_name test_script <<< "$test_info"
124
- total_tests=$((total_tests + 1))
125
-
126
- echo ""
127
- echo -e "${BLUE}${'='*60}${NC}"
128
-
129
- if run_test "$test_name" "$test_script"; then
130
- passed_tests=$((passed_tests + 1))
131
- else
132
- failed_tests=$((failed_tests + 1))
133
- fi
134
-
135
- echo -e "${BLUE}${'='*60}${NC}"
136
- done
137
-
138
- # Print summary
139
- echo ""
140
- echo -e "${BLUE}📊 TEST SUMMARY${NC}"
141
- echo -e "${BLUE}${'='*40}${NC}"
142
- echo -e "${GREEN}✅ Passed: $passed_tests${NC}"
143
- echo -e "${RED}❌ Failed: $failed_tests${NC}"
144
- echo -e "${BLUE}📋 Total: $total_tests${NC}"
145
-
146
- if [ $failed_tests -eq 0 ]; then
147
- echo ""
148
- echo -e "${GREEN}🎉 All tests passed! MCP Server is working correctly.${NC}"
149
- echo -e "${GREEN}🌸 Miette: Yay! Everything is sparkling perfectly! ✨${NC}"
150
- exit 0
151
- else
152
- echo ""
153
- echo -e "${RED}⚠️ Some tests failed. Check individual test outputs above.${NC}"
154
- echo -e "${YELLOW}🧠 Mia: Review the logs and fix the failing components.${NC}"
155
- exit 1
156
- fi
157
- }
158
-
159
- # Check if we're in the right directory
160
- if [ ! -f "$PROJECT_DIR/package.json" ]; then
161
- echo -e "${RED}❌ Error: Not in MCP server project directory${NC}"
162
- echo -e "${RED}Expected package.json at: $PROJECT_DIR/package.json${NC}"
163
- exit 1
164
- fi
165
-
166
- # Run main function
167
- main "$@"
@@ -1,364 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Test 5: Agent Capabilities & Information
4
- # Tests capability resolution and agent info tools
5
-
6
- set -e
7
-
8
- # Colors
9
- RED='\033[0;31m'
10
- GREEN='\033[0;32m'
11
- YELLOW='\033[1;33m'
12
- BLUE='\033[0;34m'
13
- NC='\033[0m'
14
-
15
- echo -e "${YELLOW}🤖 Testing Agent Capabilities...${NC}"
16
-
17
- PROJECT_DIR="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)")"
18
- cd "$PROJECT_DIR"
19
-
20
- # Test 1: Get agent info (comprehensive system information)
21
- echo -e "${YELLOW} → Testing miadi-get-agent-info...${NC}"
22
-
23
- cat > /tmp/test_agent_info.json << 'EOF'
24
- {
25
- "jsonrpc": "2.0",
26
- "id": 1,
27
- "method": "tools/call",
28
- "params": {
29
- "name": "miadi-get-agent-info",
30
- "arguments": {}
31
- }
32
- }
33
- EOF
34
-
35
- timeout 15s bash -c '
36
- echo "Getting agent system information..."
37
- cat /tmp/test_agent_info.json | node dist/index.js > /tmp/agent_info_response.log 2>&1 &
38
- SERVER_PID=$!
39
- sleep 5
40
- kill $SERVER_PID 2>/dev/null || true
41
- wait $SERVER_PID 2>/dev/null || true
42
- ' || echo "Agent info test completed"
43
-
44
- if [ -f /tmp/agent_info_response.log ]; then
45
- if grep -q "error" /tmp/agent_info_response.log; then
46
- echo -e "${YELLOW} ⚠️ Agent info returned an error (expected if API is down)${NC}"
47
- echo -e "${YELLOW} 📋 Error preview:${NC}"
48
- head -5 /tmp/agent_info_response.log | sed 's/^/ /'
49
- else
50
- echo -e "${GREEN} ✅ Agent info tool executed successfully${NC}"
51
-
52
- # Check if response contains expected structure
53
- if grep -qi "persona\|mode\|capabilit" /tmp/agent_info_response.log; then
54
- echo -e "${GREEN} 📋 Response contains expected agent data${NC}"
55
- fi
56
- fi
57
- fi
58
-
59
- # Test 2: Resolve capabilities for specific persona/mode
60
- echo -e "${YELLOW} → Testing miadi-resolve-capabilities...${NC}"
61
-
62
- cat > /tmp/test_resolve_capabilities.json << 'EOF'
63
- {
64
- "jsonrpc": "2.0",
65
- "id": 2,
66
- "method": "tools/call",
67
- "params": {
68
- "name": "miadi-resolve-capabilities",
69
- "arguments": {
70
- "persona": "mia-recursive-architect",
71
- "mode": "desktop",
72
- "context": [
73
- {
74
- "name": "screen",
75
- "type": "device",
76
- "value": "large"
77
- },
78
- {
79
- "name": "focus_mode",
80
- "type": "custom",
81
- "value": "deep_work"
82
- }
83
- ]
84
- }
85
- }
86
- }
87
- EOF
88
-
89
- timeout 15s bash -c '
90
- echo "Resolving capabilities..."
91
- cat /tmp/test_resolve_capabilities.json | node dist/index.js > /tmp/resolve_capabilities_response.log 2>&1 &
92
- SERVER_PID=$!
93
- sleep 5
94
- kill $SERVER_PID 2>/dev/null || true
95
- wait $SERVER_PID 2>/dev/null || true
96
- ' || echo "Resolve capabilities test completed"
97
-
98
- if [ -f /tmp/resolve_capabilities_response.log ]; then
99
- if grep -q "error" /tmp/resolve_capabilities_response.log; then
100
- echo -e "${YELLOW} ⚠️ Capability resolution returned an error${NC}"
101
- else
102
- echo -e "${GREEN} ✅ Capability resolution tool executed${NC}"
103
- fi
104
- fi
105
-
106
- # Test 3: Detect cues for mode/persona switching
107
- echo -e "${YELLOW} → Testing miadi-detect-cues...${NC}"
108
-
109
- cat > /tmp/test_detect_cues.json << 'EOF'
110
- {
111
- "jsonrpc": "2.0",
112
- "id": 3,
113
- "method": "tools/call",
114
- "params": {
115
- "name": "miadi-detect-cues",
116
- "arguments": {
117
- "text": "I'm going for a walk now and need Mia's analytical approach for this problem",
118
- "availableModes": ["desktop", "walking", "mobile"],
119
- "availablePersonas": ["mia-recursive-architect", "miette-sprite"]
120
- }
121
- }
122
- }
123
- EOF
124
-
125
- timeout 15s bash -c '
126
- echo "Detecting cues..."
127
- cat /tmp/test_detect_cues.json | node dist/index.js > /tmp/detect_cues_response.log 2>&1 &
128
- SERVER_PID=$!
129
- sleep 5
130
- kill $SERVER_PID 2>/dev/null || true
131
- wait $SERVER_PID 2>/dev/null || true
132
- ' || echo "Detect cues test completed"
133
-
134
- if [ -f /tmp/detect_cues_response.log ]; then
135
- if grep -q "error" /tmp/detect_cues_response.log; then
136
- echo -e "${YELLOW} ⚠️ Cue detection returned an error${NC}"
137
- else
138
- echo -e "${GREEN} ✅ Cue detection tool executed${NC}"
139
- fi
140
- fi
141
-
142
- # Test 4: Test AI integration tools
143
- echo -e "${YELLOW} → Testing miadi-ai-request...${NC}"
144
-
145
- cat > /tmp/test_ai_request.json << 'EOF'
146
- {
147
- "jsonrpc": "2.0",
148
- "id": 4,
149
- "method": "tools/call",
150
- "params": {
151
- "name": "miadi-ai-request",
152
- "arguments": {
153
- "prompt": "Hello, this is a test prompt from the MCP server",
154
- "maxTokens": 50,
155
- "temperature": 0.7
156
- }
157
- }
158
- }
159
- EOF
160
-
161
- timeout 20s bash -c '
162
- echo "Testing AI request..."
163
- cat /tmp/test_ai_request.json | node dist/index.js > /tmp/ai_request_response.log 2>&1 &
164
- SERVER_PID=$!
165
- sleep 8
166
- kill $SERVER_PID 2>/dev/null || true
167
- wait $SERVER_PID 2>/dev/null || true
168
- ' || echo "AI request test completed"
169
-
170
- if [ -f /tmp/ai_request_response.log ]; then
171
- if grep -q "error" /tmp/ai_request_response.log; then
172
- echo -e "${YELLOW} ⚠️ AI request returned an error${NC}"
173
- else
174
- echo -e "${GREEN} ✅ AI request tool executed${NC}"
175
- fi
176
- fi
177
-
178
- # Test 5: Test OpenAI-specific request
179
- echo -e "${YELLOW} → Testing miadi-openai-request...${NC}"
180
-
181
- cat > /tmp/test_openai_request.json << 'EOF'
182
- {
183
- "jsonrpc": "2.0",
184
- "id": 5,
185
- "method": "tools/call",
186
- "params": {
187
- "name": "miadi-openai-request",
188
- "arguments": {
189
- "prompt": "Test prompt for OpenAI integration",
190
- "modelId": "gpt-3.5-turbo",
191
- "maxTokens": 30,
192
- "temperature": 0.5
193
- }
194
- }
195
- }
196
- EOF
197
-
198
- timeout 20s bash -c '
199
- echo "Testing OpenAI request..."
200
- cat /tmp/test_openai_request.json | node dist/index.js > /tmp/openai_request_response.log 2>&1 &
201
- SERVER_PID=$!
202
- sleep 8
203
- kill $SERVER_PID 2>/dev/null || true
204
- wait $SERVER_PID 2>/dev/null || true
205
- ' || echo "OpenAI request test completed"
206
-
207
- if [ -f /tmp/openai_request_response.log ]; then
208
- if grep -q "error" /tmp/openai_request_response.log; then
209
- echo -e "${YELLOW} ⚠️ OpenAI request returned an error${NC}"
210
- else
211
- echo -e "${GREEN} ✅ OpenAI request tool executed${NC}"
212
- fi
213
- fi
214
-
215
- # Test 6: Test workflow management
216
- echo -e "${YELLOW} → Testing miadi-get-workflow-howto...${NC}"
217
-
218
- cat > /tmp/test_workflow_howto.json << 'EOF'
219
- {
220
- "jsonrpc": "2.0",
221
- "id": 6,
222
- "method": "tools/call",
223
- "params": {
224
- "name": "miadi-get-workflow-howto",
225
- "arguments": {
226
- "topic": "agent-registration"
227
- }
228
- }
229
- }
230
- EOF
231
-
232
- timeout 15s bash -c '
233
- echo "Getting workflow howto..."
234
- cat /tmp/test_workflow_howto.json | node dist/index.js > /tmp/workflow_howto_response.log 2>&1 &
235
- SERVER_PID=$!
236
- sleep 5
237
- kill $SERVER_PID 2>/dev/null || true
238
- wait $SERVER_PID 2>/dev/null || true
239
- ' || echo "Workflow howto test completed"
240
-
241
- if [ -f /tmp/workflow_howto_response.log ]; then
242
- if grep -q "error" /tmp/workflow_howto_response.log; then
243
- echo -e "${YELLOW} ⚠️ Workflow howto returned an error${NC}"
244
- else
245
- echo -e "${GREEN} ✅ Workflow howto tool executed${NC}"
246
- fi
247
- fi
248
-
249
- # Test 7: Test forge state operations
250
- echo -e "${YELLOW} → Testing miadi-get-forge-state...${NC}"
251
-
252
- cat > /tmp/test_forge_state.json << 'EOF'
253
- {
254
- "jsonrpc": "2.0",
255
- "id": 7,
256
- "method": "tools/call",
257
- "params": {
258
- "name": "miadi-get-forge-state",
259
- "arguments": {}
260
- }
261
- }
262
- EOF
263
-
264
- timeout 15s bash -c '
265
- echo "Getting forge state..."
266
- cat /tmp/test_forge_state.json | node dist/index.js > /tmp/forge_state_response.log 2>&1 &
267
- SERVER_PID=$!
268
- sleep 5
269
- kill $SERVER_PID 2>/dev/null || true
270
- wait $SERVER_PID 2>/dev/null || true
271
- ' || echo "Forge state test completed"
272
-
273
- if [ -f /tmp/forge_state_response.log ]; then
274
- if grep -q "error" /tmp/forge_state_response.log; then
275
- echo -e "${YELLOW} ⚠️ Forge state returned an error${NC}"
276
- else
277
- echo -e "${GREEN} ✅ Forge state tool executed${NC}"
278
- fi
279
- fi
280
-
281
- # Test 8: Test glyph map retrieval
282
- echo -e "${YELLOW} → Testing miadi-get-glyph-map...${NC}"
283
-
284
- cat > /tmp/test_glyph_map.json << 'EOF'
285
- {
286
- "jsonrpc": "2.0",
287
- "id": 8,
288
- "method": "tools/call",
289
- "params": {
290
- "name": "miadi-get-glyph-map",
291
- "arguments": {}
292
- }
293
- }
294
- EOF
295
-
296
- timeout 15s bash -c '
297
- echo "Getting glyph map..."
298
- cat /tmp/test_glyph_map.json | node dist/index.js > /tmp/glyph_map_response.log 2>&1 &
299
- SERVER_PID=$!
300
- sleep 5
301
- kill $SERVER_PID 2>/dev/null || true
302
- wait $SERVER_PID 2>/dev/null || true
303
- ' || echo "Glyph map test completed"
304
-
305
- if [ -f /tmp/glyph_map_response.log ]; then
306
- if grep -q "error" /tmp/glyph_map_response.log; then
307
- echo -e "${YELLOW} ⚠️ Glyph map returned an error${NC}"
308
- else
309
- echo -e "${GREEN} ✅ Glyph map tool executed${NC}"
310
- fi
311
- fi
312
-
313
- # Test 9: Parameter validation for capability tools
314
- echo -e "${YELLOW} → Testing capability parameter validation...${NC}"
315
-
316
- # Test with invalid context structure
317
- cat > /tmp/test_invalid_capabilities.json << 'EOF'
318
- {
319
- "jsonrpc": "2.0",
320
- "id": 9,
321
- "method": "tools/call",
322
- "params": {
323
- "name": "miadi-resolve-capabilities",
324
- "arguments": {
325
- "persona": "",
326
- "mode": "",
327
- "context": "invalid_context_format"
328
- }
329
- }
330
- }
331
- EOF
332
-
333
- timeout 10s bash -c '
334
- echo "Testing invalid capability parameters..."
335
- cat /tmp/test_invalid_capabilities.json | node dist/index.js > /tmp/invalid_capabilities_response.log 2>&1 &
336
- SERVER_PID=$!
337
- sleep 3
338
- kill $SERVER_PID 2>/dev/null || true
339
- wait $SERVER_PID 2>/dev/null || true
340
- ' || echo "Invalid capability test completed"
341
-
342
- if [ -f /tmp/invalid_capabilities_response.log ]; then
343
- if grep -qi "validation\|schema\|required" /tmp/invalid_capabilities_response.log; then
344
- echo -e "${GREEN} ✅ Capability parameter validation is working${NC}"
345
- else
346
- echo -e "${YELLOW} ⚠️ Capability parameter validation may not be working${NC}"
347
- fi
348
- fi
349
-
350
- # Summary
351
- echo ""
352
- echo -e "${BLUE}📊 Agent Capabilities Test Summary:${NC}"
353
- echo -e "${GREEN} ✅ Agent info and discovery tested${NC}"
354
- echo -e "${GREEN} ✅ Capability resolution tested${NC}"
355
- echo -e "${GREEN} ✅ Cue detection tested${NC}"
356
- echo -e "${GREEN} ✅ AI integration tools tested${NC}"
357
- echo -e "${GREEN} ✅ Workflow and forge tools tested${NC}"
358
- echo -e "${GREEN} ✅ Parameter validation tested${NC}"
359
- echo -e "${YELLOW} ⚠️ Note: Some tools may show errors if API endpoints are not accessible${NC}"
360
-
361
- # Cleanup
362
- rm -f /tmp/test_*.json /tmp/*_response.log
363
-
364
- echo -e "${GREEN}🤖 Agent capabilities tests completed${NC}"