bruce-models 6.8.5 → 6.8.6

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.
@@ -16190,7 +16190,10 @@
16190
16190
  }, auth);
16191
16191
  const data = yield this.parseJson(response);
16192
16192
  const text = (_b = (_a = data === null || data === void 0 ? void 0 : data.Text) !== null && _a !== void 0 ? _a : data === null || data === void 0 ? void 0 : data.text) !== null && _b !== void 0 ? _b : "";
16193
- const steps = Array.isArray(data === null || data === void 0 ? void 0 : data.steps) ? data.steps : [];
16193
+ const rawSteps = Array.isArray(data === null || data === void 0 ? void 0 : data.steps) ? data.steps : [];
16194
+ const steps = rawSteps
16195
+ .filter((step) => step)
16196
+ .map((step, idx) => (Object.assign(Object.assign({}, step), { index: typeof (step === null || step === void 0 ? void 0 : step.index) === "number" ? step.index : idx })));
16194
16197
  return {
16195
16198
  text,
16196
16199
  steps,
@@ -16383,20 +16386,25 @@
16383
16386
  return urlInstance.toString();
16384
16387
  }
16385
16388
  handleMessage(raw) {
16386
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
16389
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
16387
16390
  return __awaiter(this, void 0, void 0, function* () {
16388
16391
  try {
16389
16392
  const message = typeof raw === "string" ? JSON.parse(raw) : raw;
16390
16393
  const method = message === null || message === void 0 ? void 0 : message.method;
16394
+ if (method === "chat/event") {
16395
+ const payload = ((_a = message === null || message === void 0 ? void 0 : message.params) !== null && _a !== void 0 ? _a : {});
16396
+ (_c = (_b = this.options).onChatEvent) === null || _c === void 0 ? void 0 : _c.call(_b, payload);
16397
+ return;
16398
+ }
16391
16399
  if (method !== "tools/call") {
16392
- (_b = (_a = this.logger()).debug) === null || _b === void 0 ? void 0 : _b.call(_a, "[NavigatorMcpWS] Ignoring non tool-call message", message);
16400
+ (_e = (_d = this.logger()).debug) === null || _e === void 0 ? void 0 : _e.call(_d, "[NavigatorMcpWS] Ignoring unsupported message", message);
16393
16401
  return;
16394
16402
  }
16395
- const toolName = (_c = message === null || message === void 0 ? void 0 : message.params) === null || _c === void 0 ? void 0 : _c.name;
16396
- const toolArgs = (_d = message === null || message === void 0 ? void 0 : message.params) === null || _d === void 0 ? void 0 : _d.arguments;
16403
+ const toolName = (_f = message === null || message === void 0 ? void 0 : message.params) === null || _f === void 0 ? void 0 : _f.name;
16404
+ const toolArgs = (_g = message === null || message === void 0 ? void 0 : message.params) === null || _g === void 0 ? void 0 : _g.arguments;
16397
16405
  const messageId = message === null || message === void 0 ? void 0 : message.id;
16398
16406
  if (!toolName) {
16399
- (_f = (_e = this.logger()).warn) === null || _f === void 0 ? void 0 : _f.call(_e, "[NavigatorMcpWS] Received tool call without name", message);
16407
+ (_j = (_h = this.logger()).warn) === null || _j === void 0 ? void 0 : _j.call(_h, "[NavigatorMcpWS] Received tool call without name", message);
16400
16408
  return;
16401
16409
  }
16402
16410
  let result;
@@ -16408,7 +16416,7 @@
16408
16416
  });
16409
16417
  }
16410
16418
  catch (error) {
16411
- (_h = (_g = this.logger()).error) === null || _h === void 0 ? void 0 : _h.call(_g, "[NavigatorMcpWS] Tool handler threw", error);
16419
+ (_l = (_k = this.logger()).error) === null || _l === void 0 ? void 0 : _l.call(_k, "[NavigatorMcpWS] Tool handler threw", error);
16412
16420
  result = `Error: ${error instanceof Error ? error.message : String(error)}`;
16413
16421
  }
16414
16422
  this.send({
@@ -16418,7 +16426,7 @@
16418
16426
  });
16419
16427
  }
16420
16428
  catch (error) {
16421
- (_k = (_j = this.logger()).error) === null || _k === void 0 ? void 0 : _k.call(_j, "[NavigatorMcpWS] Invalid message", error);
16429
+ (_o = (_m = this.logger()).error) === null || _o === void 0 ? void 0 : _o.call(_m, "[NavigatorMcpWS] Invalid message", error);
16422
16430
  }
16423
16431
  });
16424
16432
  }
@@ -16430,7 +16438,7 @@
16430
16438
  }
16431
16439
 
16432
16440
  // This is updated with the package.json version on build.
16433
- const VERSION = "6.8.5";
16441
+ const VERSION = "6.8.6";
16434
16442
 
16435
16443
  exports.VERSION = VERSION;
16436
16444
  exports.AbstractApi = AbstractApi;