converse-mcp-server 2.27.0 → 2.27.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/package.json +5 -5
- package/src/providers/copilot.js +7 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "converse-mcp-server",
|
|
3
|
-
"version": "2.27.
|
|
3
|
+
"version": "2.27.2",
|
|
4
4
|
"description": "Converse MCP Server - Converse with other LLMs with chat and consensus tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -94,14 +94,14 @@
|
|
|
94
94
|
".env.example"
|
|
95
95
|
],
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@anthropic-ai/claude-agent-sdk": "^0.3.
|
|
97
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.169",
|
|
98
98
|
"@anthropic-ai/sdk": "^0.102.0",
|
|
99
|
-
"@github/copilot-sdk": "^0.
|
|
99
|
+
"@github/copilot-sdk": "^1.0.0",
|
|
100
100
|
"@google/genai": "^2.8.0",
|
|
101
101
|
"@mistralai/mistralai": "^2.2.5",
|
|
102
102
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
103
|
-
"@openai/codex-sdk": "^0.
|
|
104
|
-
"ai": "^6.0.
|
|
103
|
+
"@openai/codex-sdk": "^0.138.0",
|
|
104
|
+
"ai": "^6.0.198",
|
|
105
105
|
"ai-sdk-provider-gemini-cli": "^2.0.1",
|
|
106
106
|
"cors": "^2.8.6",
|
|
107
107
|
"dotenv": "^17.4.2",
|
package/src/providers/copilot.js
CHANGED
|
@@ -7,12 +7,11 @@
|
|
|
7
7
|
* Key differences from traditional providers:
|
|
8
8
|
* - Uses GitHub Copilot CLI subscription authentication - NOT API keys
|
|
9
9
|
* - Manages a singleton CopilotClient (spawns CLI process via JSON-RPC)
|
|
10
|
-
* - Creates a fresh CopilotSession per request,
|
|
10
|
+
* - Creates a fresh CopilotSession per request, disconnected after each request
|
|
11
11
|
* - Bridges SDK push-based events to pull-based async generator for streaming
|
|
12
12
|
* - Requires GitHub CLI authenticated (gh auth login) with active Copilot subscription
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { register } from 'node:module';
|
|
16
15
|
import { debugLog, debugError } from '../utils/console.js';
|
|
17
16
|
import { ProviderError, ErrorCodes, StopReasons } from './interface.js';
|
|
18
17
|
|
|
@@ -317,28 +316,10 @@ function isCopilotSDKAvailable() {
|
|
|
317
316
|
return _sdkAvailable;
|
|
318
317
|
}
|
|
319
318
|
|
|
320
|
-
/**
|
|
321
|
-
* Register a module resolution hook to fix the extensionless
|
|
322
|
-
* "vscode-jsonrpc/node" import in @github/copilot-sdk >=0.1.29.
|
|
323
|
-
* The SDK's session.js imports "vscode-jsonrpc/node" without a .js extension,
|
|
324
|
-
* which fails under Node.js strict ESM resolution. The hook rewrites it to
|
|
325
|
-
* "vscode-jsonrpc/node.js". Runs once, works regardless of package manager.
|
|
326
|
-
*/
|
|
327
|
-
let _hookRegistered = false;
|
|
328
|
-
function ensureJsonrpcResolveHook() {
|
|
329
|
-
if (_hookRegistered) return;
|
|
330
|
-
_hookRegistered = true;
|
|
331
|
-
register(`data:text/javascript,${encodeURIComponent(
|
|
332
|
-
'export function resolve(s,c,n){' +
|
|
333
|
-
'return s==="vscode-jsonrpc/node"?n("vscode-jsonrpc/node.js",c):n(s,c);}',
|
|
334
|
-
)}`);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
319
|
/**
|
|
338
320
|
* Dynamically import Copilot SDK (lazy loading)
|
|
339
321
|
*/
|
|
340
322
|
async function getCopilotSDK() {
|
|
341
|
-
ensureJsonrpcResolveHook();
|
|
342
323
|
try {
|
|
343
324
|
const { CopilotClient } = await import('@github/copilot-sdk');
|
|
344
325
|
return CopilotClient;
|
|
@@ -370,14 +351,13 @@ async function getCopilotClient(cwd) {
|
|
|
370
351
|
|
|
371
352
|
clientInitPromise = (async () => {
|
|
372
353
|
const CopilotClient = await getCopilotSDK();
|
|
354
|
+
const workingDirectory = cwd || process.cwd();
|
|
373
355
|
clientInstance = new CopilotClient({
|
|
374
|
-
autoStart: true,
|
|
375
|
-
autoRestart: true,
|
|
376
356
|
useLoggedInUser: true,
|
|
377
|
-
|
|
357
|
+
workingDirectory,
|
|
378
358
|
});
|
|
379
359
|
await clientInstance.start();
|
|
380
|
-
debugLog('[Copilot SDK] Client started (cwd: %s)',
|
|
360
|
+
debugLog('[Copilot SDK] Client started (cwd: %s)', workingDirectory);
|
|
381
361
|
return clientInstance;
|
|
382
362
|
})();
|
|
383
363
|
|
|
@@ -808,9 +788,9 @@ async function* createStreamingGenerator(client, prompt, options, signal, config
|
|
|
808
788
|
}
|
|
809
789
|
} finally {
|
|
810
790
|
try {
|
|
811
|
-
await session.
|
|
812
|
-
} catch (
|
|
813
|
-
debugError('[Copilot SDK] Session
|
|
791
|
+
await session.disconnect();
|
|
792
|
+
} catch (disconnectError) {
|
|
793
|
+
debugError('[Copilot SDK] Session disconnect error', disconnectError);
|
|
814
794
|
}
|
|
815
795
|
}
|
|
816
796
|
}
|