edoardo 1.0.4 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edoardo",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "AI Agent with MCP plugin support - Chat with AI models and extend capabilities with plugins",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,7 +10,6 @@
10
10
  */
11
11
 
12
12
  import express from 'express';
13
- import cors from 'cors';
14
13
  import { spawn } from 'child_process';
15
14
  import { fileURLToPath } from 'url';
16
15
  import { dirname, join } from 'path';
@@ -29,19 +28,24 @@ const stdioServers = new Map();
29
28
 
30
29
  // ============ CORS (must be first for all requests!) ============
31
30
 
32
- const corsOptions = {
33
- origin: true,
34
- credentials: true,
35
- methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
36
- allowedHeaders: ['Content-Type', 'Authorization', 'X-MCP-Endpoint', 'X-MCP-Auth-Type', 'X-MCP-Auth-Token', 'X-MCP-Extra-Config', 'X-MCP-Type', 'X-MCP-Command', 'X-MCP-Args', 'X-MCP-Allowed-Paths'],
37
- preflightContinue: false,
38
- optionsSuccessStatus: 204
39
- };
31
+ // Manual CORS middleware - handles all requests including preflight
32
+ app.use((req, res, next) => {
33
+ const origin = req.headers.origin;
34
+
35
+ // Allow all origins (for standalone deployment)
36
+ res.setHeader('Access-Control-Allow-Origin', origin || '*');
37
+ res.setHeader('Access-Control-Allow-Credentials', 'true');
38
+ res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
39
+ res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-MCP-Endpoint, X-MCP-Auth-Type, X-MCP-Auth-Token, X-MCP-Extra-Config, X-MCP-Type, X-MCP-Command, X-MCP-Args, X-MCP-Allowed-Paths');
40
+ res.setHeader('Access-Control-Max-Age', '86400');
40
41
 
41
- app.use(cors(corsOptions));
42
+ // Handle preflight OPTIONS request
43
+ if (req.method === 'OPTIONS') {
44
+ return res.status(204).end();
45
+ }
42
46
 
43
- // Explicit OPTIONS handler for all routes (preflight)
44
- app.options('*', cors(corsOptions));
47
+ next();
48
+ });
45
49
 
46
50
  app.use(express.json());
47
51