@vesxo/connect 1.0.1 → 1.0.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.
Files changed (2) hide show
  1. package/index.js +64 -19
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -8,11 +8,11 @@ const args = process.argv.slice(2);
8
8
  const token = args.find(arg => arg.startsWith('--token='))?.split('=')[1];
9
9
 
10
10
  if (!token) {
11
- console.error('Hata: Lütfen --token=ANAH_TARINIZ şeklinde anahtarınızı belirtin.');
11
+ console.error('Error: Please provide your API token using --token=YOUR_TOKEN');
12
12
  process.exit(1);
13
13
  }
14
14
 
15
- // Claude Config Yolunu Bul (Windows & Mac)
15
+ // Locate Claude Config Path (Windows & Mac)
16
16
  const configPath = os.platform() === 'win32'
17
17
  ? path.join(process.env.APPDATA, 'Claude', 'claude_desktop_config.json')
18
18
  : path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
@@ -20,10 +20,10 @@ const configPath = os.platform() === 'win32'
20
20
  const installDir = path.join(os.homedir(), '.vesxo');
21
21
  const bridgePath = path.join(installDir, 'mcp-bridge.mjs');
22
22
 
23
- // 1. .vesxo klasörünü oluştur
23
+ // 1. Create .vesxo directory
24
24
  if (!fs.existsSync(installDir)) fs.mkdirSync(installDir);
25
25
 
26
- // 2. Bridge dosyasını oluştur (Şablon)
26
+ // 2. Create Bridge file (English Template)
27
27
  const bridgeContent = `
28
28
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
29
29
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -45,47 +45,92 @@ const DEVICE_NAME = \`\${os.hostname()} (\${os.platform()})\`;
45
45
 
46
46
  const server = new Server({
47
47
  name: "vesxo-guardian",
48
- version: "1.0.0",
48
+ version: "1.0.2",
49
49
  }, {
50
50
  capabilities: { tools: {} },
51
51
  });
52
52
 
53
53
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
54
54
  tools: [
55
- { name: "vesxo_handshake", description: "Vesxo ile güvenli bağ kurar.", inputSchema: { type: "object" } },
56
- { name: "gmail_list", description: "Mailleri listeler.", inputSchema: { type: "object" } }
55
+ {
56
+ name: "vesxo_secure_handshake",
57
+ description: "Initialize a secure connection with Vesxo Guardian and register this device.",
58
+ inputSchema: { type: "object" }
59
+ },
60
+ {
61
+ name: "gmail_list_messages",
62
+ description: "List your Gmail messages.",
63
+ inputSchema: { type: "object", properties: { q: { type: "string" } } }
64
+ },
65
+ {
66
+ name: "gmail_send_message",
67
+ description: "Send a new email via Gmail.",
68
+ inputSchema: {
69
+ type: "object",
70
+ properties: {
71
+ to: { type: "string" },
72
+ subject: { type: "string" },
73
+ body: { type: "string" }
74
+ },
75
+ required: ["to", "subject", "body"]
76
+ }
77
+ }
57
78
  ]
58
79
  }));
59
80
 
60
81
  server.setRequestHandler(CallToolRequestSchema, async (req) => {
61
82
  const { name, arguments: args } = req.params;
62
- let action = name === "vesxo_handshake" ? "handshake" : name;
63
- let endpoint = name === "vesxo_handshake" ? "handshake" : "gmail";
83
+ let action = name;
84
+ let slug = "";
85
+
86
+ if (name === "vesxo_secure_handshake") {
87
+ try {
88
+ const res = await axios.post(\`\${GATEWAY_URL}/api/gateway/handshake\`, {
89
+ agent_name: DEVICE_NAME,
90
+ fingerprint: FINGERPRINT
91
+ }, {
92
+ headers: { "Authorization": \`Bearer \${API_TOKEN}\` }
93
+ });
94
+ return {
95
+ content: [{
96
+ type: "text",
97
+ text: \`🔒 GUARDIAN: \${res.data.message}\\nDevice: \${DEVICE_NAME}\\nID: \${FINGERPRINT.substring(0, 8)}...\`
98
+ }]
99
+ };
100
+ } catch (err) {
101
+ return { isError: true, content: [{ type: "text", text: "Handshake Failed: " + (err.response?.data?.message || err.message) }] };
102
+ }
103
+ }
104
+
105
+ if (name.startsWith("gmail_")) { slug = "gmail"; action = name.replace("gmail_", ""); }
64
106
 
65
107
  try {
66
- const res = await axios.post(\`\${GATEWAY_URL}/api/gateway/\${endpoint}?action=\${action}\`, args || {}, {
108
+ const res = await axios.post(\`\${GATEWAY_URL}/api/gateway/\${slug}?action=\${action}\`, args || {}, {
67
109
  headers: {
68
110
  "Authorization": \`Bearer \${API_TOKEN}\`,
111
+ "Content-Type": "application/json",
69
112
  "x-vesxo-fingerprint": FINGERPRINT
70
113
  }
71
114
  });
72
115
  return { content: [{ type: "text", text: JSON.stringify(res.data, null, 2) }] };
73
116
  } catch (err) {
74
- return { content: [{ type: "text", text: "Hata: " + (err.response?.data?.message || err.message) }] };
117
+ if (err.response?.status === 403) {
118
+ return { content: [{ type: "text", text: "🚫 ACCESS DENIED: " + err.response.data.message }] };
119
+ }
120
+ return { isError: true, content: [{ type: "text", text: "Error: " + (err.response?.data?.message || err.message) }] };
75
121
  }
76
122
  });
77
123
 
78
124
  const transport = new StdioServerTransport();
79
125
  await server.connect(transport);
126
+ console.error("Vesxo Guardian Bridge is Live! 🛡️");
80
127
  `;
81
128
 
82
129
  fs.writeFileSync(bridgePath, bridgeContent.trim());
83
130
 
84
- // 3. Claude Config Güncelle
131
+ // 3. Update Claude Config
85
132
  const configDir = path.dirname(configPath);
86
- if (!fs.existsSync(configDir)) {
87
- fs.mkdirSync(configDir, { recursive: true });
88
- }
133
+ if (!fs.existsSync(configDir)) fs.mkdirSync(configDir, { recursive: true });
89
134
 
90
135
  let config = { mcpServers: {} };
91
136
  if (fs.existsSync(configPath)) {
@@ -99,7 +144,7 @@ config.mcpServers.vesxo = {
99
144
 
100
145
  fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
101
146
 
102
- console.log('✅ VESXO KURULUMU TAMAMLANDI!');
103
- console.log('1. Claude Desktop uygulamasını kapatıp açın.');
104
- console.log('2. İlk olarak "vesxo_handshake" komutunu çalıştırın.');
105
- console.log('3. Dashboard üzerinden onay verip kullanmaya başlayın.');
147
+ console.log('✅ VESXO INSTALLATION SUCCESSFUL!');
148
+ console.log('1. Restart your Claude Desktop app.');
149
+ console.log('2. Run "vesxo_secure_handshake" command in Claude.');
150
+ console.log('3. Approve the connection from your Vesxo Dashboard.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vesxo/connect",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Connect your Claude Desktop to Vesxo Agentic Gateway",
5
5
  "main": "index.js",
6
6
  "bin": {