bruce-models 6.8.5 → 6.8.7

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,
@@ -16533,10 +16536,8 @@ class NavigatorChatClient {
16533
16536
  if (path.startsWith("http://") || path.startsWith("https://")) {
16534
16537
  return path;
16535
16538
  }
16536
- if (!path.startsWith("/")) {
16537
- path = `/${path}`;
16538
- }
16539
- return `${this.baseUrl}${path}`;
16539
+ // Use URL constructor to properly handle path joining and avoid double slashes
16540
+ return new URL(path, this.baseUrl).toString();
16540
16541
  }
16541
16542
  fetchFromEndpoint(path, init, auth) {
16542
16543
  var _a;
@@ -16698,20 +16699,25 @@ class NavigatorMcpWebSocketClient {
16698
16699
  return urlInstance.toString();
16699
16700
  }
16700
16701
  handleMessage(raw) {
16701
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
16702
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
16702
16703
  return __awaiter(this, void 0, void 0, function* () {
16703
16704
  try {
16704
16705
  const message = typeof raw === "string" ? JSON.parse(raw) : raw;
16705
16706
  const method = message === null || message === void 0 ? void 0 : message.method;
16707
+ if (method === "chat/event") {
16708
+ const payload = ((_a = message === null || message === void 0 ? void 0 : message.params) !== null && _a !== void 0 ? _a : {});
16709
+ (_c = (_b = this.options).onChatEvent) === null || _c === void 0 ? void 0 : _c.call(_b, payload);
16710
+ return;
16711
+ }
16706
16712
  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);
16713
+ (_e = (_d = this.logger()).debug) === null || _e === void 0 ? void 0 : _e.call(_d, "[NavigatorMcpWS] Ignoring unsupported message", message);
16708
16714
  return;
16709
16715
  }
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;
16716
+ const toolName = (_f = message === null || message === void 0 ? void 0 : message.params) === null || _f === void 0 ? void 0 : _f.name;
16717
+ const toolArgs = (_g = message === null || message === void 0 ? void 0 : message.params) === null || _g === void 0 ? void 0 : _g.arguments;
16712
16718
  const messageId = message === null || message === void 0 ? void 0 : message.id;
16713
16719
  if (!toolName) {
16714
- (_f = (_e = this.logger()).warn) === null || _f === void 0 ? void 0 : _f.call(_e, "[NavigatorMcpWS] Received tool call without name", message);
16720
+ (_j = (_h = this.logger()).warn) === null || _j === void 0 ? void 0 : _j.call(_h, "[NavigatorMcpWS] Received tool call without name", message);
16715
16721
  return;
16716
16722
  }
16717
16723
  let result;
@@ -16723,7 +16729,7 @@ class NavigatorMcpWebSocketClient {
16723
16729
  });
16724
16730
  }
16725
16731
  catch (error) {
16726
- (_h = (_g = this.logger()).error) === null || _h === void 0 ? void 0 : _h.call(_g, "[NavigatorMcpWS] Tool handler threw", error);
16732
+ (_l = (_k = this.logger()).error) === null || _l === void 0 ? void 0 : _l.call(_k, "[NavigatorMcpWS] Tool handler threw", error);
16727
16733
  result = `Error: ${error instanceof Error ? error.message : String(error)}`;
16728
16734
  }
16729
16735
  this.send({
@@ -16733,7 +16739,7 @@ class NavigatorMcpWebSocketClient {
16733
16739
  });
16734
16740
  }
16735
16741
  catch (error) {
16736
- (_k = (_j = this.logger()).error) === null || _k === void 0 ? void 0 : _k.call(_j, "[NavigatorMcpWS] Invalid message", error);
16742
+ (_o = (_m = this.logger()).error) === null || _o === void 0 ? void 0 : _o.call(_m, "[NavigatorMcpWS] Invalid message", error);
16737
16743
  }
16738
16744
  });
16739
16745
  }
@@ -16745,7 +16751,7 @@ class NavigatorMcpWebSocketClient {
16745
16751
  }
16746
16752
 
16747
16753
  // This is updated with the package.json version on build.
16748
- const VERSION = "6.8.5";
16754
+ const VERSION = "6.8.7";
16749
16755
 
16750
16756
  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
16757
  //# sourceMappingURL=bruce-models.es5.js.map