@specverse/engines 4.3.4 โ 5.0.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/assets/examples/10-api/README.md +3 -3
- package/assets/prompts/core/README.md +1 -1
- package/dist/inference/core/rule-engine.d.ts +0 -12
- package/dist/inference/core/rule-engine.d.ts.map +1 -1
- package/dist/inference/core/rule-engine.js +99 -968
- package/dist/inference/core/rule-engine.js.map +1 -1
- package/dist/inference/core/template-helpers.d.ts +56 -0
- package/dist/inference/core/template-helpers.d.ts.map +1 -0
- package/dist/inference/core/template-helpers.js +87 -0
- package/dist/inference/core/template-helpers.js.map +1 -0
- package/dist/inference/logical/generators/service-generator.d.ts.map +1 -1
- package/dist/inference/logical/generators/service-generator.js +0 -4
- package/dist/inference/logical/generators/service-generator.js.map +1 -1
- package/dist/libs/instance-factories/cli/templates/commander/command-generator.js +27 -5
- package/dist/libs/instance-factories/scaffolding/templates/generic/package-json-generator.js +1 -1
- package/dist/libs/instance-factories/tools/README.md +1 -1
- package/dist/libs/instance-factories/tools/mcp.yaml +1 -1
- package/dist/libs/instance-factories/tools/templates/mcp/mcp-server-generator.js +336 -116
- package/dist/libs/instance-factories/tools/templates/vscode/vscode-extension-generator.js +172 -8
- package/dist/libs/instance-factories/tools/vscode.yaml +1 -1
- package/libs/instance-factories/cli/templates/commander/command-generator.ts +27 -5
- package/libs/instance-factories/scaffolding/templates/generic/package-json-generator.ts +10 -6
- package/libs/instance-factories/tools/README.md +1 -1
- package/libs/instance-factories/tools/mcp.yaml +1 -1
- package/libs/instance-factories/tools/templates/mcp/mcp-server-generator.ts +386 -141
- package/libs/instance-factories/tools/templates/vscode/static/extension.ts +9 -2
- package/libs/instance-factories/tools/templates/vscode/vscode-extension-generator.ts +246 -10
- package/libs/instance-factories/tools/vscode.yaml +1 -1
- package/package.json +5 -4
- package/libs/instance-factories/tools/templates/mcp/static/docs/DEPLOYMENT_GUIDE.md +0 -630
- package/libs/instance-factories/tools/templates/mcp/static/docs/HYBRID_RESOURCE_SYSTEM.md +0 -330
- package/libs/instance-factories/tools/templates/mcp/static/docs/deployments/EXTENSION_DEPLOYMENT.md +0 -552
- package/libs/instance-factories/tools/templates/mcp/static/docs/deployments/LOCAL_DEPLOYMENT.md +0 -164
- package/libs/instance-factories/tools/templates/mcp/static/docs/deployments/WEB_DEPLOYMENT.md +0 -247
- package/libs/instance-factories/tools/templates/mcp/static/package.json +0 -94
- package/libs/instance-factories/tools/templates/mcp/static/scripts/build-enterprise.js +0 -284
- package/libs/instance-factories/tools/templates/mcp/static/scripts/build-extension.js +0 -139
- package/libs/instance-factories/tools/templates/mcp/static/scripts/build-local.js +0 -74
- package/libs/instance-factories/tools/templates/mcp/static/scripts/build-web.js +0 -156
- package/libs/instance-factories/tools/templates/mcp/static/scripts/copy-canonical-files.js +0 -41
- package/libs/instance-factories/tools/templates/mcp/static/scripts/test-deployments.js +0 -259
- package/libs/instance-factories/tools/templates/mcp/static/scripts/test-hybrid-resources.js +0 -231
- package/libs/instance-factories/tools/templates/mcp/static/scripts/test-hybrid-simple.js +0 -196
- package/libs/instance-factories/tools/templates/mcp/static/src/controllers/MCPServerController.ts +0 -293
- package/libs/instance-factories/tools/templates/mcp/static/src/events/EventEmitter.ts +0 -90
- package/libs/instance-factories/tools/templates/mcp/static/src/index.ts +0 -24
- package/libs/instance-factories/tools/templates/mcp/static/src/interfaces/ResourceProvider.ts +0 -15
- package/libs/instance-factories/tools/templates/mcp/static/src/models/LibrarySuggestion.ts +0 -106
- package/libs/instance-factories/tools/templates/mcp/static/src/models/SpecVerseResource.ts +0 -75
- package/libs/instance-factories/tools/templates/mcp/static/src/server/mcp-server.ts +0 -239
- package/libs/instance-factories/tools/templates/mcp/static/src/services/CLIProxyService.ts +0 -1501
- package/libs/instance-factories/tools/templates/mcp/static/src/services/EmbeddedResourcesAdapter.ts +0 -211
- package/libs/instance-factories/tools/templates/mcp/static/src/services/EntityModuleService.ts +0 -308
- package/libs/instance-factories/tools/templates/mcp/static/src/services/HybridResourcesProvider.ts +0 -210
- package/libs/instance-factories/tools/templates/mcp/static/src/services/LibraryToolsService.ts +0 -356
- package/libs/instance-factories/tools/templates/mcp/static/src/services/OrchestratorBridge.ts +0 -522
- package/libs/instance-factories/tools/templates/mcp/static/src/services/OrchestratorToolsService.ts +0 -530
- package/libs/instance-factories/tools/templates/mcp/static/src/services/PromptToolsService.ts +0 -594
- package/libs/instance-factories/tools/templates/mcp/static/src/services/ResourcesProviderService.ts +0 -170
- package/libs/instance-factories/tools/templates/mcp/static/src/tests/unit/CLIProxyService.init.test.ts +0 -544
- package/libs/instance-factories/tools/templates/mcp/static/src/tests/unit/CLIProxyService.test.ts +0 -189
- package/libs/instance-factories/tools/templates/mcp/static/src/tests/unit/ResourcesProviderService.test.ts +0 -89
- package/libs/instance-factories/tools/templates/mcp/static/src/types/index.ts +0 -110
- package/libs/instance-factories/tools/templates/mcp/static/tsconfig.json +0 -28
- package/libs/instance-factories/tools/templates/vscode/static/schemas/specverse-v3-schema.json +0 -4279
- /package/libs/instance-factories/tools/templates/vscode/static/themes/{specverse-complete-theme.json โ specverse-dark-theme.json} +0 -0
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Hybrid Resource System Test
|
|
4
|
-
* Focused test to verify embedded vs filesystem resource detection
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { spawn } from 'child_process';
|
|
8
|
-
import { existsSync } from 'fs';
|
|
9
|
-
import { join, dirname } from 'path';
|
|
10
|
-
import { fileURLToPath } from 'url';
|
|
11
|
-
|
|
12
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const rootDir = join(__dirname, '..');
|
|
14
|
-
|
|
15
|
-
console.log('๐งช HYBRID RESOURCE SYSTEM TEST');
|
|
16
|
-
console.log('===============================');
|
|
17
|
-
|
|
18
|
-
async function testResourceMode(deployment, expectedMode) {
|
|
19
|
-
console.log(`\n๐ Testing ${deployment.toUpperCase()} deployment...`);
|
|
20
|
-
|
|
21
|
-
return new Promise((resolve) => {
|
|
22
|
-
const serverPath = join(rootDir, 'dist', deployment, 'server', 'mcp-server.js');
|
|
23
|
-
if (!existsSync(serverPath)) {
|
|
24
|
-
console.log(` โ Server not found: ${serverPath}`);
|
|
25
|
-
resolve({ success: false, error: 'Server not found' });
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const port = 3000 + Math.floor(Math.random() * 1000);
|
|
30
|
-
const args = deployment === 'local'
|
|
31
|
-
? ['--mode', 'local', '--silent']
|
|
32
|
-
: ['--mode', 'remote', '--port', port.toString(), '--silent'];
|
|
33
|
-
|
|
34
|
-
const child = spawn('node', [serverPath, ...args], {
|
|
35
|
-
cwd: rootDir,
|
|
36
|
-
stdio: ['pipe', 'pipe', 'pipe']
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
let resolved = false;
|
|
40
|
-
const timeout = setTimeout(() => {
|
|
41
|
-
if (!resolved) {
|
|
42
|
-
resolved = true;
|
|
43
|
-
child.kill('SIGTERM');
|
|
44
|
-
|
|
45
|
-
// For local mode, we can't easily test via HTTP, so we assume success if it starts
|
|
46
|
-
if (deployment === 'local') {
|
|
47
|
-
console.log(` โ
${deployment} server started successfully`);
|
|
48
|
-
resolve({ success: true, mode: 'filesystem' });
|
|
49
|
-
} else {
|
|
50
|
-
console.log(` โฐ ${deployment} server timeout - checking health...`);
|
|
51
|
-
checkServerHealth(port, deployment, expectedMode).then(resolve);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}, 5000);
|
|
55
|
-
|
|
56
|
-
child.stderr.on('data', (data) => {
|
|
57
|
-
const output = data.toString();
|
|
58
|
-
if (output.includes('initialized successfully') ||
|
|
59
|
-
output.includes('listening on port') ||
|
|
60
|
-
output.includes('Server started')) {
|
|
61
|
-
if (!resolved && deployment !== 'local') {
|
|
62
|
-
resolved = true;
|
|
63
|
-
clearTimeout(timeout);
|
|
64
|
-
setTimeout(() => {
|
|
65
|
-
checkServerHealth(port, deployment, expectedMode).then((result) => {
|
|
66
|
-
child.kill('SIGTERM');
|
|
67
|
-
resolve(result);
|
|
68
|
-
});
|
|
69
|
-
}, 1000);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
child.on('error', (error) => {
|
|
75
|
-
if (!resolved) {
|
|
76
|
-
resolved = true;
|
|
77
|
-
clearTimeout(timeout);
|
|
78
|
-
console.log(` โ ${deployment} failed: ${error.message}`);
|
|
79
|
-
resolve({ success: false, error: error.message });
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
async function checkServerHealth(port, deployment, expectedMode) {
|
|
86
|
-
try {
|
|
87
|
-
const response = await fetch(`http://localhost:${port}/health`);
|
|
88
|
-
const data = await response.json();
|
|
89
|
-
|
|
90
|
-
const actualMode = data.metrics?.resources_provider?.mode;
|
|
91
|
-
const providerType = data.metrics?.resources_provider?.type;
|
|
92
|
-
const resourceCount = data.metrics?.resources_provider?.resourcesInfo?.count ||
|
|
93
|
-
data.metrics?.resources_provider?.resourcesInfo?.cached || 0;
|
|
94
|
-
|
|
95
|
-
console.log(` ๐ Provider: ${providerType}`);
|
|
96
|
-
console.log(` ๐ Mode: ${actualMode}`);
|
|
97
|
-
console.log(` ๐ Resources: ${resourceCount}`);
|
|
98
|
-
|
|
99
|
-
if (actualMode === expectedMode) {
|
|
100
|
-
console.log(` โ
${deployment} using correct mode: ${actualMode}`);
|
|
101
|
-
return { success: true, mode: actualMode, type: providerType, count: resourceCount };
|
|
102
|
-
} else {
|
|
103
|
-
console.log(` โ ๏ธ ${deployment} mode mismatch: expected ${expectedMode}, got ${actualMode}`);
|
|
104
|
-
return { success: true, mode: actualMode, type: providerType, count: resourceCount, warning: 'mode_mismatch' };
|
|
105
|
-
}
|
|
106
|
-
} catch (error) {
|
|
107
|
-
console.log(` โ ${deployment} health check failed: ${error.message}`);
|
|
108
|
-
return { success: false, error: error.message };
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
async function testResourceContent(deployment, port) {
|
|
113
|
-
try {
|
|
114
|
-
// Test resource listing
|
|
115
|
-
const listResponse = await fetch(`http://localhost:${port}/mcp/resources`);
|
|
116
|
-
const listData = await listResponse.json();
|
|
117
|
-
|
|
118
|
-
console.log(` ๐ Resources available: ${listData.count}`);
|
|
119
|
-
|
|
120
|
-
if (listData.count > 0) {
|
|
121
|
-
// Test reading a specific resource
|
|
122
|
-
const testUri = 'specverse://schema/json';
|
|
123
|
-
const resourceResponse = await fetch(`http://localhost:${port}/mcp/resource/${encodeURIComponent(testUri)}`);
|
|
124
|
-
const resourceData = await resourceResponse.json();
|
|
125
|
-
|
|
126
|
-
if (resourceData.content && resourceData.content.length > 0) {
|
|
127
|
-
const resource = resourceData.content[0].resource;
|
|
128
|
-
console.log(` ๐ Test resource: ${resource.mimeType}, ${resource.content?.length || 0} chars`);
|
|
129
|
-
return true;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return false;
|
|
134
|
-
} catch (error) {
|
|
135
|
-
console.log(` โ Resource content test failed: ${error.message}`);
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
async function runHybridTests() {
|
|
141
|
-
const results = {};
|
|
142
|
-
|
|
143
|
-
// Test local deployment (should use filesystem)
|
|
144
|
-
console.log('\n๐๏ธ Testing LOCAL deployment (filesystem expected)...');
|
|
145
|
-
results.local = await testResourceMode('local', 'filesystem');
|
|
146
|
-
|
|
147
|
-
// Test web deployment (should use embedded)
|
|
148
|
-
console.log('\n๐ Testing WEB deployment (embedded expected)...');
|
|
149
|
-
results.web = await testResourceMode('web', 'embedded');
|
|
150
|
-
|
|
151
|
-
// Test resource content serving for web deployment
|
|
152
|
-
if (results.web.success && !results.web.error) {
|
|
153
|
-
const port = 3000 + Math.floor(Math.random() * 1000);
|
|
154
|
-
console.log(`\n๐ก Testing resource content serving on port ${port}...`);
|
|
155
|
-
|
|
156
|
-
// Start web server for content testing
|
|
157
|
-
const serverPath = join(rootDir, 'dist/web/server/mcp-server.js');
|
|
158
|
-
const child = spawn('node', [serverPath, '--mode', 'remote', '--port', port.toString()], {
|
|
159
|
-
cwd: rootDir,
|
|
160
|
-
stdio: ['pipe', 'pipe', 'pipe']
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
// Wait for server to start
|
|
164
|
-
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
165
|
-
|
|
166
|
-
const contentTest = await testResourceContent('web', port);
|
|
167
|
-
results.web.contentTest = contentTest;
|
|
168
|
-
|
|
169
|
-
child.kill('SIGTERM');
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Summary
|
|
173
|
-
console.log('\n๐ HYBRID RESOURCE SYSTEM TEST RESULTS');
|
|
174
|
-
console.log('========================================');
|
|
175
|
-
|
|
176
|
-
let successCount = 0;
|
|
177
|
-
let totalTests = 0;
|
|
178
|
-
|
|
179
|
-
for (const [deployment, result] of Object.entries(results)) {
|
|
180
|
-
totalTests++;
|
|
181
|
-
const status = result.success ? 'โ
PASS' : 'โ FAIL';
|
|
182
|
-
console.log(`${deployment.toUpperCase().padEnd(8)} ${status}`);
|
|
183
|
-
|
|
184
|
-
if (result.success) {
|
|
185
|
-
successCount++;
|
|
186
|
-
console.log(` Mode: ${result.mode || 'unknown'}`);
|
|
187
|
-
console.log(` Type: ${result.type || 'unknown'}`);
|
|
188
|
-
console.log(` Resources: ${result.count || 0}`);
|
|
189
|
-
|
|
190
|
-
if (result.warning) {
|
|
191
|
-
console.log(` Warning: ${result.warning}`);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if (result.contentTest !== undefined) {
|
|
195
|
-
console.log(` Content Test: ${result.contentTest ? 'โ
' : 'โ'}`);
|
|
196
|
-
}
|
|
197
|
-
} else if (result.error) {
|
|
198
|
-
console.log(` Error: ${result.error}`);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
console.log(`\n๐ฏ Overall Success: ${successCount}/${totalTests} (${Math.round(successCount/totalTests*100)}%)`);
|
|
203
|
-
|
|
204
|
-
// Hybrid system validation
|
|
205
|
-
const hasFilesystem = Object.values(results).some(r => r.mode === 'filesystem');
|
|
206
|
-
const hasEmbedded = Object.values(results).some(r => r.mode === 'embedded');
|
|
207
|
-
|
|
208
|
-
console.log('\n๐ HYBRID SYSTEM VALIDATION');
|
|
209
|
-
console.log('============================');
|
|
210
|
-
console.log(`Filesystem Mode Detected: ${hasFilesystem ? 'โ
' : 'โ'}`);
|
|
211
|
-
console.log(`Embedded Mode Detected: ${hasEmbedded ? 'โ
' : 'โ'}`);
|
|
212
|
-
console.log(`Hybrid Detection Working: ${hasFilesystem && hasEmbedded ? 'โ
' : 'โ'}`);
|
|
213
|
-
|
|
214
|
-
if (hasFilesystem && hasEmbedded) {
|
|
215
|
-
console.log('\n๐ HYBRID RESOURCE SYSTEM IS WORKING CORRECTLY!');
|
|
216
|
-
console.log('โ
Local deployment uses filesystem resources');
|
|
217
|
-
console.log('โ
Web deployment uses embedded resources');
|
|
218
|
-
console.log('โ
Automatic mode detection functioning');
|
|
219
|
-
console.log('โ
Resource content serving operational');
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return successCount === totalTests;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Run the hybrid resource tests
|
|
226
|
-
runHybridTests().then(success => {
|
|
227
|
-
process.exit(success ? 0 : 1);
|
|
228
|
-
}).catch(error => {
|
|
229
|
-
console.error('Test execution failed:', error);
|
|
230
|
-
process.exit(1);
|
|
231
|
-
});
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Simple Hybrid Resource System Test
|
|
4
|
-
* Manual verification of embedded vs filesystem modes
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { spawn, execSync } from 'child_process';
|
|
8
|
-
import { existsSync } from 'fs';
|
|
9
|
-
import { join, dirname } from 'path';
|
|
10
|
-
import { fileURLToPath } from 'url';
|
|
11
|
-
|
|
12
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const rootDir = join(__dirname, '..');
|
|
14
|
-
|
|
15
|
-
console.log('๐งช SIMPLE HYBRID RESOURCE SYSTEM TEST');
|
|
16
|
-
console.log('======================================');
|
|
17
|
-
|
|
18
|
-
async function testWebDeploymentManually() {
|
|
19
|
-
console.log('\n๐ Testing WEB deployment manually...');
|
|
20
|
-
|
|
21
|
-
const serverPath = join(rootDir, 'dist/web/server/mcp-server.js');
|
|
22
|
-
if (!existsSync(serverPath)) {
|
|
23
|
-
console.log(' โ Web server not found');
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const port = 3005;
|
|
28
|
-
console.log(` ๐ Starting web server on port ${port}...`);
|
|
29
|
-
|
|
30
|
-
const child = spawn('node', [serverPath, '--mode', 'remote', '--port', port.toString()], {
|
|
31
|
-
cwd: rootDir,
|
|
32
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
33
|
-
detached: false
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
let serverReady = false;
|
|
37
|
-
|
|
38
|
-
return new Promise((resolve) => {
|
|
39
|
-
const timeout = setTimeout(() => {
|
|
40
|
-
if (serverReady) {
|
|
41
|
-
// Test the server
|
|
42
|
-
try {
|
|
43
|
-
console.log(' ๐ Testing server health...');
|
|
44
|
-
const healthResult = execSync(`curl -s http://localhost:${port}/health`, { encoding: 'utf-8', timeout: 5000 });
|
|
45
|
-
|
|
46
|
-
if (healthResult) {
|
|
47
|
-
const data = JSON.parse(healthResult);
|
|
48
|
-
const providerMode = data.metrics?.resources_provider?.mode;
|
|
49
|
-
const providerType = data.metrics?.resources_provider?.type;
|
|
50
|
-
const resourceCount = data.metrics?.resources_provider?.resourcesInfo?.count || 0;
|
|
51
|
-
|
|
52
|
-
console.log(` ๐ Provider Mode: ${providerMode}`);
|
|
53
|
-
console.log(` ๐ Provider Type: ${providerType}`);
|
|
54
|
-
console.log(` ๐ Resource Count: ${resourceCount}`);
|
|
55
|
-
|
|
56
|
-
if (providerMode === 'embedded' && resourceCount > 0) {
|
|
57
|
-
console.log(' โ
Web deployment using embedded resources correctly!');
|
|
58
|
-
|
|
59
|
-
// Test resource content
|
|
60
|
-
try {
|
|
61
|
-
console.log(' ๐ Testing resource content...');
|
|
62
|
-
const resourceResult = execSync(`curl -s "http://localhost:${port}/mcp/resources"`, { encoding: 'utf-8', timeout: 5000 });
|
|
63
|
-
const resourceData = JSON.parse(resourceResult);
|
|
64
|
-
console.log(` ๐ Available resources: ${resourceData.count}`);
|
|
65
|
-
|
|
66
|
-
if (resourceData.count > 0) {
|
|
67
|
-
console.log(' โ
Resource serving working correctly!');
|
|
68
|
-
child.kill('SIGTERM');
|
|
69
|
-
resolve(true);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
} catch (resourceError) {
|
|
73
|
-
console.log(` โ ๏ธ Resource test failed: ${resourceError.message}`);
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
console.log(` โ Expected embedded mode with resources, got mode: ${providerMode}, count: ${resourceCount}`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
} catch (error) {
|
|
80
|
-
console.log(` โ Health check failed: ${error.message}`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
child.kill('SIGTERM');
|
|
85
|
-
resolve(false);
|
|
86
|
-
}, 8000);
|
|
87
|
-
|
|
88
|
-
child.stderr.on('data', (data) => {
|
|
89
|
-
const output = data.toString();
|
|
90
|
-
if (output.includes('listening on port') || output.includes('Health check:')) {
|
|
91
|
-
console.log(' โ
Server is ready');
|
|
92
|
-
serverReady = true;
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
child.on('error', (error) => {
|
|
97
|
-
console.log(` โ Server failed to start: ${error.message}`);
|
|
98
|
-
clearTimeout(timeout);
|
|
99
|
-
resolve(false);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
child.on('exit', (code) => {
|
|
103
|
-
if (code !== 0 && code !== null) {
|
|
104
|
-
console.log(` โ Server exited with code: ${code}`);
|
|
105
|
-
clearTimeout(timeout);
|
|
106
|
-
resolve(false);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function testLocalDeployment() {
|
|
113
|
-
console.log('\n๐๏ธ Testing LOCAL deployment...');
|
|
114
|
-
|
|
115
|
-
const serverPath = join(rootDir, 'dist/local/server/mcp-server.js');
|
|
116
|
-
if (!existsSync(serverPath)) {
|
|
117
|
-
console.log(' โ Local server not found');
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
console.log(' โ
Local server exists');
|
|
122
|
-
|
|
123
|
-
// Check if it has filesystem resources
|
|
124
|
-
const resourcesPath = join(rootDir, 'dist/local/resources');
|
|
125
|
-
if (existsSync(resourcesPath)) {
|
|
126
|
-
console.log(' โ
Local deployment has filesystem resources');
|
|
127
|
-
return true;
|
|
128
|
-
} else {
|
|
129
|
-
console.log(' โ Local deployment missing resources directory');
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function checkBuildOutputs() {
|
|
135
|
-
console.log('\n๐ Checking build outputs...');
|
|
136
|
-
|
|
137
|
-
const checks = [
|
|
138
|
-
{ name: 'Local server', path: 'dist/local/server/mcp-server.js' },
|
|
139
|
-
{ name: 'Local resources', path: 'dist/local/resources' },
|
|
140
|
-
{ name: 'Web server', path: 'dist/web/server/mcp-server.js' },
|
|
141
|
-
{ name: 'Web embedded resources', path: 'dist/web/embedded-resources.js' },
|
|
142
|
-
{ name: 'Extension wrapper', path: 'dist/extension/extension-wrapper.js' },
|
|
143
|
-
{ name: 'Enterprise dockerfile', path: 'dist/enterprise/Dockerfile' }
|
|
144
|
-
];
|
|
145
|
-
|
|
146
|
-
let allGood = true;
|
|
147
|
-
for (const check of checks) {
|
|
148
|
-
const fullPath = join(rootDir, check.path);
|
|
149
|
-
const exists = existsSync(fullPath);
|
|
150
|
-
console.log(` ${exists ? 'โ
' : 'โ'} ${check.name}`);
|
|
151
|
-
if (!exists) allGood = false;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return allGood;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
async function runSimpleTest() {
|
|
158
|
-
console.log('Starting comprehensive hybrid resource system test...\n');
|
|
159
|
-
|
|
160
|
-
// Step 1: Check build outputs
|
|
161
|
-
const buildOk = checkBuildOutputs();
|
|
162
|
-
|
|
163
|
-
// Step 2: Test local deployment
|
|
164
|
-
const localOk = testLocalDeployment();
|
|
165
|
-
|
|
166
|
-
// Step 3: Test web deployment
|
|
167
|
-
const webOk = await testWebDeploymentManually();
|
|
168
|
-
|
|
169
|
-
// Summary
|
|
170
|
-
console.log('\n๐ TEST RESULTS SUMMARY');
|
|
171
|
-
console.log('========================');
|
|
172
|
-
console.log(`Build Outputs: ${buildOk ? 'โ
PASS' : 'โ FAIL'}`);
|
|
173
|
-
console.log(`Local Deployment: ${localOk ? 'โ
PASS' : 'โ FAIL'}`);
|
|
174
|
-
console.log(`Web Deployment: ${webOk ? 'โ
PASS' : 'โ FAIL'}`);
|
|
175
|
-
|
|
176
|
-
if (buildOk && localOk && webOk) {
|
|
177
|
-
console.log('\n๐ HYBRID RESOURCE SYSTEM IS FULLY FUNCTIONAL!');
|
|
178
|
-
console.log('โ
All build outputs present');
|
|
179
|
-
console.log('โ
Local deployment uses filesystem resources');
|
|
180
|
-
console.log('โ
Web deployment uses embedded resources');
|
|
181
|
-
console.log('โ
HTTP resource serving operational');
|
|
182
|
-
console.log('\nThe multi-environment MCP server is ready for deployment! ๐');
|
|
183
|
-
return true;
|
|
184
|
-
} else {
|
|
185
|
-
console.log('\nโ Some tests failed - see details above');
|
|
186
|
-
return false;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// Run the test
|
|
191
|
-
runSimpleTest().then(success => {
|
|
192
|
-
process.exit(success ? 0 : 1);
|
|
193
|
-
}).catch(error => {
|
|
194
|
-
console.error('Test execution failed:', error);
|
|
195
|
-
process.exit(1);
|
|
196
|
-
});
|