50c 3.0.13 → 3.0.14

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 (3) hide show
  1. package/bin/50c.js +23 -1
  2. package/lib/subagent.js +24 -2
  3. package/package.json +39 -39
package/bin/50c.js CHANGED
@@ -600,8 +600,30 @@ function startMCPMode() {
600
600
  const clean = line.trim();
601
601
  if (!clean) return;
602
602
  const request = JSON.parse(clean);
603
+
604
+ // Notifications (no id) don't get responses per JSON-RPC spec
605
+ if (request.method && request.method.startsWith('notifications/')) {
606
+ return;
607
+ }
608
+
609
+ // Handle initialize locally
610
+ if (request.method === 'initialize') {
611
+ process.stdout.write(JSON.stringify({
612
+ jsonrpc: '2.0',
613
+ id: request.id,
614
+ result: {
615
+ protocolVersion: '2024-11-05',
616
+ serverInfo: { name: '50c', version: VERSION },
617
+ capabilities: { tools: {} }
618
+ }
619
+ }) + '\n');
620
+ return;
621
+ }
622
+
603
623
  const response = await handleMCPRequest(request);
604
- process.stdout.write(JSON.stringify(response) + '\n');
624
+ if (response) {
625
+ process.stdout.write(JSON.stringify(response) + '\n');
626
+ }
605
627
  } catch (e) {
606
628
  process.stdout.write(JSON.stringify({
607
629
  jsonrpc: '2.0',
package/lib/subagent.js CHANGED
@@ -74,6 +74,7 @@ async function httpFetch(url, options = {}) {
74
74
 
75
75
  /**
76
76
  * SSH execution via native ssh command (spawned, not shell)
77
+ * Fixed: Uses explicit identity file for Windows compatibility
77
78
  */
78
79
  async function sshExec(server, command, options = {}) {
79
80
  const serverConfig = typeof server === 'string' ? KNOWN_SERVERS[server] : server;
@@ -84,12 +85,32 @@ async function sshExec(server, command, options = {}) {
84
85
 
85
86
  const { host, user = 'root', port = 22 } = serverConfig;
86
87
  const timeout = options.timeout || 30000;
88
+
89
+ // Try to find SSH key - common locations
90
+ const os = require('os');
91
+ const homeDir = os.homedir();
92
+ const keyPaths = [
93
+ path.join(homeDir, '.ssh', 'id_rsa'),
94
+ path.join(homeDir, '.ssh', 'id_ed25519'),
95
+ options.keyFile
96
+ ].filter(Boolean);
97
+
98
+ let identityArgs = [];
99
+ for (const keyPath of keyPaths) {
100
+ if (fs.existsSync(keyPath)) {
101
+ identityArgs = ['-i', keyPath];
102
+ break;
103
+ }
104
+ }
87
105
 
88
106
  return new Promise((resolve, reject) => {
89
107
  const args = [
90
108
  '-o', 'StrictHostKeyChecking=no',
109
+ '-o', 'UserKnownHostsFile=/dev/null',
91
110
  '-o', 'ConnectTimeout=10',
92
- '-o', 'BatchMode=yes',
111
+ '-o', 'ServerAliveInterval=5',
112
+ '-o', 'ServerAliveCountMax=2',
113
+ ...identityArgs,
93
114
  '-p', String(port),
94
115
  `${user}@${host}`,
95
116
  command
@@ -97,7 +118,8 @@ async function sshExec(server, command, options = {}) {
97
118
 
98
119
  const proc = spawn('ssh', args, {
99
120
  stdio: ['pipe', 'pipe', 'pipe'],
100
- timeout
121
+ timeout,
122
+ windowsHide: true
101
123
  });
102
124
 
103
125
  let stdout = '';
package/package.json CHANGED
@@ -1,39 +1,39 @@
1
- {
2
- "name": "50c",
3
- "version": "3.0.13",
4
- "description": "AI developer tools via MCP. Pay-per-use from $0.01. No subscriptions.",
5
- "bin": {
6
- "50c": "./bin/50c.js"
7
- },
8
- "scripts": {
9
- "postinstall": "node -e \"console.log('\\n50c Hub installed. Run: 50c install\\n')\""
10
- },
11
- "keywords": [
12
- "mcp",
13
- "ai",
14
- "llm",
15
- "cli",
16
- "agent",
17
- "50c",
18
- "hints",
19
- "genius",
20
- "beacon",
21
- "developer-tools",
22
- "context",
23
- "compression",
24
- "caz",
25
- "file-memory"
26
- ],
27
- "author": "genxis",
28
- "license": "SEE LICENSE IN LICENSE",
29
- "homepage": "https://50c.ai",
30
- "engines": {
31
- "node": ">=18.0.0"
32
- },
33
- "files": [
34
- "bin/",
35
- "lib/",
36
- "README.md",
37
- "LICENSE"
38
- ]
39
- }
1
+ {
2
+ "name": "50c",
3
+ "version": "3.0.14",
4
+ "description": "AI developer tools via MCP. Pay-per-use from $0.01. No subscriptions.",
5
+ "bin": {
6
+ "50c": "./bin/50c.js"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node -e \"console.log('\\n50c Hub installed. Run: 50c install\\n')\""
10
+ },
11
+ "keywords": [
12
+ "mcp",
13
+ "ai",
14
+ "llm",
15
+ "cli",
16
+ "agent",
17
+ "50c",
18
+ "hints",
19
+ "genius",
20
+ "beacon",
21
+ "developer-tools",
22
+ "context",
23
+ "compression",
24
+ "caz",
25
+ "file-memory"
26
+ ],
27
+ "author": "genxis",
28
+ "license": "SEE LICENSE IN LICENSE",
29
+ "homepage": "https://50c.ai",
30
+ "engines": {
31
+ "node": ">=18.0.0"
32
+ },
33
+ "files": [
34
+ "bin/",
35
+ "lib/",
36
+ "README.md",
37
+ "LICENSE"
38
+ ]
39
+ }