bruce-models 6.8.4 → 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,8 +16190,13 @@
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 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 })));
16193
16197
  return {
16194
16198
  text,
16199
+ steps,
16195
16200
  raw: data
16196
16201
  };
16197
16202
  });
@@ -16381,20 +16386,25 @@
16381
16386
  return urlInstance.toString();
16382
16387
  }
16383
16388
  handleMessage(raw) {
16384
- 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;
16385
16390
  return __awaiter(this, void 0, void 0, function* () {
16386
16391
  try {
16387
16392
  const message = typeof raw === "string" ? JSON.parse(raw) : raw;
16388
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
+ }
16389
16399
  if (method !== "tools/call") {
16390
- (_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);
16391
16401
  return;
16392
16402
  }
16393
- const toolName = (_c = message === null || message === void 0 ? void 0 : message.params) === null || _c === void 0 ? void 0 : _c.name;
16394
- 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;
16395
16405
  const messageId = message === null || message === void 0 ? void 0 : message.id;
16396
16406
  if (!toolName) {
16397
- (_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);
16398
16408
  return;
16399
16409
  }
16400
16410
  let result;
@@ -16406,7 +16416,7 @@
16406
16416
  });
16407
16417
  }
16408
16418
  catch (error) {
16409
- (_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);
16410
16420
  result = `Error: ${error instanceof Error ? error.message : String(error)}`;
16411
16421
  }
16412
16422
  this.send({
@@ -16416,7 +16426,7 @@
16416
16426
  });
16417
16427
  }
16418
16428
  catch (error) {
16419
- (_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);
16420
16430
  }
16421
16431
  });
16422
16432
  }
@@ -16428,7 +16438,7 @@
16428
16438
  }
16429
16439
 
16430
16440
  // This is updated with the package.json version on build.
16431
- const VERSION = "6.8.4";
16441
+ const VERSION = "6.8.6";
16432
16442
 
16433
16443
  exports.VERSION = VERSION;
16434
16444
  exports.AbstractApi = AbstractApi;