@vfarcic/dot-ai 0.3.0 → 0.3.2
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/dist/mcp/server.js +54 -0
- package/package.json +1 -1
package/dist/mcp/server.js
CHANGED
|
@@ -40,10 +40,64 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
40
40
|
};
|
|
41
41
|
})();
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
// EMERGENCY DEBUG: Log immediately when script starts
|
|
44
|
+
process.stderr.write('=== MCP SERVER SCRIPT STARTED ===\n');
|
|
45
|
+
process.stderr.write(`Script path: ${__filename}\n`);
|
|
46
|
+
process.stderr.write(`Working directory: ${process.cwd()}\n`);
|
|
47
|
+
process.stderr.write(`Arguments: ${JSON.stringify(process.argv)}\n`);
|
|
48
|
+
// EMERGENCY DEBUG: Test import paths
|
|
49
|
+
process.stderr.write('=== TESTING IMPORT PATHS ===\n');
|
|
50
|
+
const path = require('path');
|
|
51
|
+
const fs = require('fs');
|
|
52
|
+
const mcpPath = path.join(__dirname, '../interfaces/mcp.js');
|
|
53
|
+
const dotaiPath = path.join(__dirname, '../core/index.js');
|
|
54
|
+
process.stderr.write(`MCP path: ${mcpPath}\n`);
|
|
55
|
+
process.stderr.write(`MCP exists: ${fs.existsSync(mcpPath)}\n`);
|
|
56
|
+
process.stderr.write(`DotAI path: ${dotaiPath}\n`);
|
|
57
|
+
process.stderr.write(`DotAI exists: ${fs.existsSync(dotaiPath)}\n`);
|
|
58
|
+
process.stderr.write('=== ATTEMPTING IMPORTS ===\n');
|
|
43
59
|
const mcp_js_1 = require("../interfaces/mcp.js");
|
|
44
60
|
const index_js_1 = require("../core/index.js");
|
|
45
61
|
async function main() {
|
|
46
62
|
try {
|
|
63
|
+
// Enhanced debugging - log startup environment
|
|
64
|
+
process.stderr.write('=== MCP Server Startup Debug Info ===\n');
|
|
65
|
+
process.stderr.write(`Node.js version: ${process.version}\n`);
|
|
66
|
+
process.stderr.write(`Process ID: ${process.pid}\n`);
|
|
67
|
+
process.stderr.write(`Current working directory: ${process.cwd()}\n`);
|
|
68
|
+
process.stderr.write(`Command line arguments: ${JSON.stringify(process.argv)}\n`);
|
|
69
|
+
// Log all environment variables for debugging
|
|
70
|
+
process.stderr.write('=== Environment Variables ===\n');
|
|
71
|
+
const envVars = ['ANTHROPIC_API_KEY', 'KUBECONFIG', 'DOT_AI_SESSION_DIR', 'NODE_ENV', 'PATH'];
|
|
72
|
+
envVars.forEach(varName => {
|
|
73
|
+
const value = process.env[varName];
|
|
74
|
+
if (varName === 'ANTHROPIC_API_KEY' && value) {
|
|
75
|
+
process.stderr.write(`${varName}: ${value.substring(0, 20)}...\n`);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
process.stderr.write(`${varName}: ${value || 'NOT SET'}\n`);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
// Log file system access
|
|
82
|
+
process.stderr.write('=== File System Check ===\n');
|
|
83
|
+
const fs = await Promise.resolve().then(() => __importStar(require('fs')));
|
|
84
|
+
const path = await Promise.resolve().then(() => __importStar(require('path')));
|
|
85
|
+
// Check if prompts directory exists
|
|
86
|
+
const promptsDir = path.join(process.cwd(), 'prompts');
|
|
87
|
+
process.stderr.write(`Checking prompts directory: ${promptsDir}\n`);
|
|
88
|
+
try {
|
|
89
|
+
if (fs.existsSync(promptsDir)) {
|
|
90
|
+
const files = fs.readdirSync(promptsDir);
|
|
91
|
+
process.stderr.write(`Prompts directory exists with ${files.length} files: ${files.join(', ')}\n`);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
process.stderr.write('WARNING: Prompts directory does not exist\n');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
process.stderr.write(`ERROR checking prompts directory: ${error}\n`);
|
|
99
|
+
}
|
|
100
|
+
process.stderr.write('=== Starting Configuration Validation ===\n');
|
|
47
101
|
// Validate required environment variables
|
|
48
102
|
process.stderr.write('Validating MCP server configuration...\n');
|
|
49
103
|
// Check session directory configuration
|