@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.esm.js CHANGED
@@ -34226,10 +34226,7 @@ class SimpleSseMcpClient {
34226
34226
  version: "1.0.0",
34227
34227
  },
34228
34228
  });
34229
- try {
34230
- await this.request("notifications/initialized", {});
34231
- }
34232
- catch (ignored) { }
34229
+ // this.request("notifications/initialized", {});
34233
34230
  }
34234
34231
  ping() {
34235
34232
  this.request("ping", {});
@@ -34247,7 +34244,7 @@ class SimpleSseMcpClient {
34247
34244
  return message.result;
34248
34245
  }
34249
34246
  async request(method, params, signal) {
34250
- const id = method.startsWith("notifications/") ? null : uuidv4();
34247
+ const id = uuidv4();
34251
34248
  try {
34252
34249
  const callback = new Promise((resolve, reject) => {
34253
34250
  if (signal) {
@@ -34257,7 +34254,7 @@ class SimpleSseMcpClient {
34257
34254
  reject(error);
34258
34255
  });
34259
34256
  }
34260
- id && this.requestMap.set(id, resolve);
34257
+ this.requestMap.set(id, resolve);
34261
34258
  });
34262
34259
  Log.debug(`MCP Client, ${method}`, id, params);
34263
34260
  const response = await fetch(this.msgUrl, {
@@ -34304,7 +34301,7 @@ class SimpleSseMcpClient {
34304
34301
  }
34305
34302
  }
34306
34303
  finally {
34307
- id && this.requestMap.delete(id);
34304
+ this.requestMap.delete(id);
34308
34305
  }
34309
34306
  }
34310
34307
  isConnected() {
@@ -34314,13 +34311,6 @@ class SimpleSseMcpClient {
34314
34311
  return false;
34315
34312
  }
34316
34313
  async close() {
34317
- try {
34318
- await this.request("notifications/cancelled", {
34319
- requestId: uuidv4(),
34320
- reason: "User requested cancellation",
34321
- });
34322
- }
34323
- catch (ignored) { }
34324
34314
  this.pingTimer && clearInterval(this.pingTimer);
34325
34315
  this.reconnectTimer && clearTimeout(this.reconnectTimer);
34326
34316
  this.sseHandler && this.sseHandler.close && this.sseHandler.close();
@@ -34433,12 +34423,6 @@ class SimpleHttpMcpClient {
34433
34423
  version: "1.0.0",
34434
34424
  },
34435
34425
  }, signal);
34436
- if (this.mcpSessionId) {
34437
- try {
34438
- await this.request("notifications/initialized", {});
34439
- }
34440
- catch (ignored) { }
34441
- }
34442
34426
  this.connected = true;
34443
34427
  }
34444
34428
  async listTools(param, signal) {
@@ -34459,19 +34443,16 @@ class SimpleHttpMcpClient {
34459
34443
  async close() {
34460
34444
  this.connected = false;
34461
34445
  if (this.mcpSessionId) {
34462
- try {
34463
- await this.request("notifications/cancelled", {
34464
- requestId: uuidv4(),
34465
- reason: "User requested cancellation",
34466
- });
34467
- }
34468
- catch (ignored) { }
34446
+ this.request("notifications/cancelled", {
34447
+ requestId: uuidv4(),
34448
+ reason: "User requested cancellation",
34449
+ });
34469
34450
  this.mcpSessionId = null;
34470
34451
  }
34471
34452
  }
34472
34453
  async request(method, params, signal) {
34473
34454
  try {
34474
- const id = method.startsWith("notifications/") ? null : uuidv4();
34455
+ const id = uuidv4();
34475
34456
  const extHeaders = {};
34476
34457
  if (this.mcpSessionId && method !== "initialize") {
34477
34458
  extHeaders["Mcp-Session-Id"] = this.mcpSessionId;