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.
@@ -16505,7 +16505,10 @@ class NavigatorChatClient {
16505
16505
  }, auth);
16506
16506
  const data = yield this.parseJson(response);
16507
16507
  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 : "";
16508
- const steps = Array.isArray(data === null || data === void 0 ? void 0 : data.steps) ? data.steps : [];
16508
+ const rawSteps = Array.isArray(data === null || data === void 0 ? void 0 : data.steps) ? data.steps : [];
16509
+ const steps = rawSteps
16510
+ .filter((step) => step)
16511
+ .map((step, idx) => (Object.assign(Object.assign({}, step), { index: typeof (step === null || step === void 0 ? void 0 : step.index) === "number" ? step.index : idx })));
16509
16512
  return {
16510
16513
  text,
16511
16514
  steps,
@@ -16698,20 +16701,25 @@ class NavigatorMcpWebSocketClient {
16698
16701
  return urlInstance.toString();
16699
16702
  }
16700
16703
  handleMessage(raw) {
16701
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
16704
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
16702
16705
  return __awaiter(this, void 0, void 0, function* () {
16703
16706
  try {
16704
16707
  const message = typeof raw === "string" ? JSON.parse(raw) : raw;
16705
16708
  const method = message === null || message === void 0 ? void 0 : message.method;
16709
+ if (method === "chat/event") {
16710
+ const payload = ((_a = message === null || message === void 0 ? void 0 : message.params) !== null && _a !== void 0 ? _a : {});
16711
+ (_c = (_b = this.options).onChatEvent) === null || _c === void 0 ? void 0 : _c.call(_b, payload);
16712
+ return;
16713
+ }
16706
16714
  if (method !== "tools/call") {
16707
- (_b = (_a = this.logger()).debug) === null || _b === void 0 ? void 0 : _b.call(_a, "[NavigatorMcpWS] Ignoring non tool-call message", message);
16715
+ (_e = (_d = this.logger()).debug) === null || _e === void 0 ? void 0 : _e.call(_d, "[NavigatorMcpWS] Ignoring unsupported message", message);
16708
16716
  return;
16709
16717
  }
16710
- const toolName = (_c = message === null || message === void 0 ? void 0 : message.params) === null || _c === void 0 ? void 0 : _c.name;
16711
- const toolArgs = (_d = message === null || message === void 0 ? void 0 : message.params) === null || _d === void 0 ? void 0 : _d.arguments;
16718
+ const toolName = (_f = message === null || message === void 0 ? void 0 : message.params) === null || _f === void 0 ? void 0 : _f.name;
16719
+ const toolArgs = (_g = message === null || message === void 0 ? void 0 : message.params) === null || _g === void 0 ? void 0 : _g.arguments;
16712
16720
  const messageId = message === null || message === void 0 ? void 0 : message.id;
16713
16721
  if (!toolName) {
16714
- (_f = (_e = this.logger()).warn) === null || _f === void 0 ? void 0 : _f.call(_e, "[NavigatorMcpWS] Received tool call without name", message);
16722
+ (_j = (_h = this.logger()).warn) === null || _j === void 0 ? void 0 : _j.call(_h, "[NavigatorMcpWS] Received tool call without name", message);
16715
16723
  return;
16716
16724
  }
16717
16725
  let result;
@@ -16723,7 +16731,7 @@ class NavigatorMcpWebSocketClient {
16723
16731
  });
16724
16732
  }
16725
16733
  catch (error) {
16726
- (_h = (_g = this.logger()).error) === null || _h === void 0 ? void 0 : _h.call(_g, "[NavigatorMcpWS] Tool handler threw", error);
16734
+ (_l = (_k = this.logger()).error) === null || _l === void 0 ? void 0 : _l.call(_k, "[NavigatorMcpWS] Tool handler threw", error);
16727
16735
  result = `Error: ${error instanceof Error ? error.message : String(error)}`;
16728
16736
  }
16729
16737
  this.send({
@@ -16733,7 +16741,7 @@ class NavigatorMcpWebSocketClient {
16733
16741
  });
16734
16742
  }
16735
16743
  catch (error) {
16736
- (_k = (_j = this.logger()).error) === null || _k === void 0 ? void 0 : _k.call(_j, "[NavigatorMcpWS] Invalid message", error);
16744
+ (_o = (_m = this.logger()).error) === null || _o === void 0 ? void 0 : _o.call(_m, "[NavigatorMcpWS] Invalid message", error);
16737
16745
  }
16738
16746
  });
16739
16747
  }
@@ -16745,7 +16753,7 @@ class NavigatorMcpWebSocketClient {
16745
16753
  }
16746
16754
 
16747
16755
  // This is updated with the package.json version on build.
16748
- const VERSION = "6.8.5";
16756
+ const VERSION = "6.8.6";
16749
16757
 
16750
16758
  export { VERSION, Assembly, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewBookmarkGroup, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, UserMfaMethod, Account, AccountInvite, AccountFeatures, AccountLimits, AccountTemplate, AccountType, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataLabGroup, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource, Scenario, Tracking, NavigatorChatClient, NavigatorMcpWebSocketClient };
16751
16759
  //# sourceMappingURL=bruce-models.es5.js.map