getmy-ruflo 3.5.46 → 3.5.48
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,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* @claude-flow/cli - CLI Entry Point
|
|
4
4
|
*
|
|
@@ -71,18 +71,12 @@ if (isMCPMode) {
|
|
|
71
71
|
const params = message.params || {};
|
|
72
72
|
|
|
73
73
|
switch (message.method) {
|
|
74
|
-
case 'initialize':
|
|
75
|
-
// Negotiate protocol version: echo client's version if supported,
|
|
76
|
-
// otherwise fall back to the default version.
|
|
77
|
-
const supportedVersions = ['2024-11-05', '2025-11-05'];
|
|
78
|
-
const negotiatedVersion = supportedVersions.includes(params.protocolVersion)
|
|
79
|
-
? params.protocolVersion
|
|
80
|
-
: '2024-11-05';
|
|
74
|
+
case 'initialize':
|
|
81
75
|
return {
|
|
82
76
|
jsonrpc: '2.0',
|
|
83
77
|
id: message.id,
|
|
84
78
|
result: {
|
|
85
|
-
protocolVersion:
|
|
79
|
+
protocolVersion: '2024-11-05',
|
|
86
80
|
serverInfo: { name: 'claude-flow', version: VERSION },
|
|
87
81
|
capabilities: {
|
|
88
82
|
tools: { listChanged: true },
|
|
@@ -90,7 +84,6 @@ if (isMCPMode) {
|
|
|
90
84
|
},
|
|
91
85
|
},
|
|
92
86
|
};
|
|
93
|
-
}
|
|
94
87
|
|
|
95
88
|
case 'tools/list': {
|
|
96
89
|
const tools = listMCPTools();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* @claude-flow/cli - MCP Server Entry Point
|
|
4
4
|
*
|
|
@@ -107,18 +107,12 @@ async function handleMessage(message) {
|
|
|
107
107
|
|
|
108
108
|
try {
|
|
109
109
|
switch (message.method) {
|
|
110
|
-
case 'initialize':
|
|
111
|
-
// Negotiate protocol version: echo client's version if supported,
|
|
112
|
-
// otherwise fall back to the default version.
|
|
113
|
-
const supportedVersions = ['2024-11-05', '2025-11-05'];
|
|
114
|
-
const negotiatedVersion = supportedVersions.includes(params.protocolVersion)
|
|
115
|
-
? params.protocolVersion
|
|
116
|
-
: '2024-11-05';
|
|
110
|
+
case 'initialize':
|
|
117
111
|
return {
|
|
118
112
|
jsonrpc: '2.0',
|
|
119
113
|
id: message.id,
|
|
120
114
|
result: {
|
|
121
|
-
protocolVersion:
|
|
115
|
+
protocolVersion: '2024-11-05',
|
|
122
116
|
serverInfo: { name: 'claude-flow', version: VERSION },
|
|
123
117
|
capabilities: {
|
|
124
118
|
tools: { listChanged: true },
|
|
@@ -126,7 +120,6 @@ async function handleMessage(message) {
|
|
|
126
120
|
},
|
|
127
121
|
},
|
|
128
122
|
};
|
|
129
|
-
}
|
|
130
123
|
|
|
131
124
|
case 'tools/list': {
|
|
132
125
|
const tools = listMCPTools();
|
|
@@ -15,8 +15,7 @@ import { randomUUID, timingSafeEqual } from 'crypto';
|
|
|
15
15
|
import { listMCPTools, callMCPTool, hasTool, initializePluginTools } from '../dist/src/mcp-client.js';
|
|
16
16
|
|
|
17
17
|
const VERSION = '3.0.0';
|
|
18
|
-
const
|
|
19
|
-
const DEFAULT_PROTOCOL_VERSION = '2024-11-05';
|
|
18
|
+
const PROTOCOL_VERSION = '2025-11-05';
|
|
20
19
|
const KEEPALIVE_INTERVAL_MS = 30_000;
|
|
21
20
|
|
|
22
21
|
// ---------------------------------------------------------------------------
|
|
@@ -120,20 +119,12 @@ async function handleMessage(message, sessionId) {
|
|
|
120
119
|
const sid = sessionId || `mcp-${Date.now()}-${randomUUID().slice(0, 8)}`;
|
|
121
120
|
sessions.set(sid, { createdAt: Date.now() });
|
|
122
121
|
metrics.sessionsCreated++;
|
|
123
|
-
|
|
124
|
-
// Negotiate protocol version: echo client's version if supported,
|
|
125
|
-
// otherwise fall back to the default version the client expects.
|
|
126
|
-
const requestedVersion = params.protocolVersion;
|
|
127
|
-
const negotiatedVersion = SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion)
|
|
128
|
-
? requestedVersion
|
|
129
|
-
: DEFAULT_PROTOCOL_VERSION;
|
|
130
|
-
|
|
131
122
|
return {
|
|
132
123
|
_sessionId: sid,
|
|
133
124
|
jsonrpc: '2.0',
|
|
134
125
|
id: message.id,
|
|
135
126
|
result: {
|
|
136
|
-
protocolVersion:
|
|
127
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
137
128
|
serverInfo: { name: 'claude-flow', version: VERSION },
|
|
138
129
|
capabilities: {
|
|
139
130
|
tools: { listChanged: true },
|
|
@@ -238,7 +229,7 @@ async function handleMessage(message, sessionId) {
|
|
|
238
229
|
function broadcastSSE(sessionId, data) {
|
|
239
230
|
const conns = sseConnections.get(sessionId);
|
|
240
231
|
if (!conns) return;
|
|
241
|
-
const payload = `
|
|
232
|
+
const payload = `event: message\ndata: ${JSON.stringify(data)}\n\n`;
|
|
242
233
|
for (const conn of conns) {
|
|
243
234
|
try {
|
|
244
235
|
conn.write(payload);
|
|
@@ -381,7 +372,7 @@ const server = createServer(async (req, res) => {
|
|
|
381
372
|
tools: tools.length,
|
|
382
373
|
uptime: uptimeSeconds,
|
|
383
374
|
sessions: sessions.size,
|
|
384
|
-
protocolVersion:
|
|
375
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
385
376
|
}));
|
|
386
377
|
return;
|
|
387
378
|
}
|
|
@@ -502,7 +493,7 @@ const server = createServer(async (req, res) => {
|
|
|
502
493
|
headers['Cache-Control'] = 'no-cache';
|
|
503
494
|
headers['Connection'] = 'keep-alive';
|
|
504
495
|
res.writeHead(200, headers);
|
|
505
|
-
res.write(`
|
|
496
|
+
res.write(`event: message\ndata: ${JSON.stringify(response)}\n\n`);
|
|
506
497
|
res.end();
|
|
507
498
|
} else {
|
|
508
499
|
// Respond as plain JSON
|
|
@@ -602,7 +593,7 @@ server.listen(port, host, () => {
|
|
|
602
593
|
platform: process.platform,
|
|
603
594
|
port,
|
|
604
595
|
protocol: 'streamable-http',
|
|
605
|
-
protocolVersion:
|
|
596
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
606
597
|
tools: tools.length,
|
|
607
598
|
version: VERSION,
|
|
608
599
|
}));
|