@eko-ai/eko 3.0.8-alpha.2 → 3.0.8
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/dist/index.cjs.js +9 -28
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +9 -28
- package/dist/index.esm.js.map +1 -1
- package/dist/mcp/http.d.ts.map +1 -1
- package/dist/mcp/sse.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -34261,10 +34261,7 @@ class SimpleSseMcpClient {
|
|
|
34261
34261
|
version: "1.0.0",
|
|
34262
34262
|
},
|
|
34263
34263
|
});
|
|
34264
|
-
|
|
34265
|
-
await this.request("notifications/initialized", {});
|
|
34266
|
-
}
|
|
34267
|
-
catch (ignored) { }
|
|
34264
|
+
// this.request("notifications/initialized", {});
|
|
34268
34265
|
}
|
|
34269
34266
|
ping() {
|
|
34270
34267
|
this.request("ping", {});
|
|
@@ -34282,7 +34279,7 @@ class SimpleSseMcpClient {
|
|
|
34282
34279
|
return message.result;
|
|
34283
34280
|
}
|
|
34284
34281
|
async request(method, params, signal) {
|
|
34285
|
-
const id =
|
|
34282
|
+
const id = uuidv4();
|
|
34286
34283
|
try {
|
|
34287
34284
|
const callback = new Promise((resolve, reject) => {
|
|
34288
34285
|
if (signal) {
|
|
@@ -34292,7 +34289,7 @@ class SimpleSseMcpClient {
|
|
|
34292
34289
|
reject(error);
|
|
34293
34290
|
});
|
|
34294
34291
|
}
|
|
34295
|
-
|
|
34292
|
+
this.requestMap.set(id, resolve);
|
|
34296
34293
|
});
|
|
34297
34294
|
Log.debug(`MCP Client, ${method}`, id, params);
|
|
34298
34295
|
const response = await fetch(this.msgUrl, {
|
|
@@ -34339,7 +34336,7 @@ class SimpleSseMcpClient {
|
|
|
34339
34336
|
}
|
|
34340
34337
|
}
|
|
34341
34338
|
finally {
|
|
34342
|
-
|
|
34339
|
+
this.requestMap.delete(id);
|
|
34343
34340
|
}
|
|
34344
34341
|
}
|
|
34345
34342
|
isConnected() {
|
|
@@ -34349,13 +34346,6 @@ class SimpleSseMcpClient {
|
|
|
34349
34346
|
return false;
|
|
34350
34347
|
}
|
|
34351
34348
|
async close() {
|
|
34352
|
-
try {
|
|
34353
|
-
await this.request("notifications/cancelled", {
|
|
34354
|
-
requestId: uuidv4(),
|
|
34355
|
-
reason: "User requested cancellation",
|
|
34356
|
-
});
|
|
34357
|
-
}
|
|
34358
|
-
catch (ignored) { }
|
|
34359
34349
|
this.pingTimer && clearInterval(this.pingTimer);
|
|
34360
34350
|
this.reconnectTimer && clearTimeout(this.reconnectTimer);
|
|
34361
34351
|
this.sseHandler && this.sseHandler.close && this.sseHandler.close();
|
|
@@ -34468,12 +34458,6 @@ class SimpleHttpMcpClient {
|
|
|
34468
34458
|
version: "1.0.0",
|
|
34469
34459
|
},
|
|
34470
34460
|
}, signal);
|
|
34471
|
-
if (this.mcpSessionId) {
|
|
34472
|
-
try {
|
|
34473
|
-
await this.request("notifications/initialized", {});
|
|
34474
|
-
}
|
|
34475
|
-
catch (ignored) { }
|
|
34476
|
-
}
|
|
34477
34461
|
this.connected = true;
|
|
34478
34462
|
}
|
|
34479
34463
|
async listTools(param, signal) {
|
|
@@ -34494,19 +34478,16 @@ class SimpleHttpMcpClient {
|
|
|
34494
34478
|
async close() {
|
|
34495
34479
|
this.connected = false;
|
|
34496
34480
|
if (this.mcpSessionId) {
|
|
34497
|
-
|
|
34498
|
-
|
|
34499
|
-
|
|
34500
|
-
|
|
34501
|
-
});
|
|
34502
|
-
}
|
|
34503
|
-
catch (ignored) { }
|
|
34481
|
+
this.request("notifications/cancelled", {
|
|
34482
|
+
requestId: uuidv4(),
|
|
34483
|
+
reason: "User requested cancellation",
|
|
34484
|
+
});
|
|
34504
34485
|
this.mcpSessionId = null;
|
|
34505
34486
|
}
|
|
34506
34487
|
}
|
|
34507
34488
|
async request(method, params, signal) {
|
|
34508
34489
|
try {
|
|
34509
|
-
const id =
|
|
34490
|
+
const id = uuidv4();
|
|
34510
34491
|
const extHeaders = {};
|
|
34511
34492
|
if (this.mcpSessionId && method !== "initialize") {
|
|
34512
34493
|
extHeaders["Mcp-Session-Id"] = this.mcpSessionId;
|