bruce-models 7.0.5 → 7.0.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.
@@ -16653,7 +16653,7 @@ var Tracking;
16653
16653
  })(Tracking || (Tracking = {}));
16654
16654
 
16655
16655
  const DEFAULT_JOB_POLL_INTERVAL_MS = 1000;
16656
- const DEFAULT_JOB_POLL_TIMEOUT_MS = 4 * 60 * 1000; // match server timeout (4 minutes)
16656
+ const DEFAULT_JOB_POLL_TIMEOUT_MS = 10 * 60 * 1000; // match server timeout (10 minutes)
16657
16657
  const DEFAULT_BASE_URL = "http://localhost:8888";
16658
16658
  /**
16659
16659
  * Lightweight client for the Navigator MCP chat HTTP endpoints.
@@ -16736,15 +16736,17 @@ class NavigatorChatClient {
16736
16736
  .map((step, idx) => (Object.assign(Object.assign({}, step), { index: typeof (step === null || step === void 0 ? void 0 : step.index) === "number" ? step.index : idx })));
16737
16737
  }
16738
16738
  waitForJobCompletion(envelope, auth) {
16739
- var _a, _b, _c, _d, _e;
16739
+ var _a, _b, _c, _d, _e, _f;
16740
16740
  return __awaiter(this, void 0, void 0, function* () {
16741
16741
  if (!envelope.jobId) {
16742
16742
  throw new Error("Chat job response did not include a jobId.");
16743
16743
  }
16744
16744
  const pollPath = (_a = envelope.pollUrl) !== null && _a !== void 0 ? _a : `/chat/jobs/${envelope.jobId}`;
16745
16745
  const startedAt = Date.now();
16746
+ let lastStatusPayload = null;
16746
16747
  while (Date.now() - startedAt < this.jobPollTimeoutMs) {
16747
16748
  const statusPayload = yield this.fetchJobStatus(pollPath, auth);
16749
+ lastStatusPayload = statusPayload;
16748
16750
  const status = statusPayload === null || statusPayload === void 0 ? void 0 : statusPayload.status;
16749
16751
  if (!status) {
16750
16752
  yield this.delay(this.jobPollIntervalMs);
@@ -16774,7 +16776,20 @@ class NavigatorChatClient {
16774
16776
  }
16775
16777
  yield this.delay(this.jobPollIntervalMs);
16776
16778
  }
16777
- throw new Error("Chat job polling timed out. Please try again later.");
16779
+ // Timeout: return a response object instead of throwing
16780
+ const combinedSteps = lastStatusPayload ? [
16781
+ ...(Array.isArray(lastStatusPayload.steps) ? lastStatusPayload.steps : []),
16782
+ ...(Array.isArray((_f = lastStatusPayload.result) === null || _f === void 0 ? void 0 : _f.steps) ? lastStatusPayload.result.steps : [])
16783
+ ] : [];
16784
+ const normalizedSteps = this.normalizeSteps(combinedSteps);
16785
+ return {
16786
+ text: "Chat job polling timed out. Please try again later.",
16787
+ steps: normalizedSteps,
16788
+ raw: lastStatusPayload !== null && lastStatusPayload !== void 0 ? lastStatusPayload : {},
16789
+ jobId: envelope.jobId,
16790
+ status: "TIMEOUT",
16791
+ anonymous: Boolean(lastStatusPayload === null || lastStatusPayload === void 0 ? void 0 : lastStatusPayload.anonymous)
16792
+ };
16778
16793
  });
16779
16794
  }
16780
16795
  fetchJobStatus(path, auth) {
@@ -17021,7 +17036,7 @@ class NavigatorMcpWebSocketClient {
17021
17036
  }
17022
17037
 
17023
17038
  // This is updated with the package.json version on build.
17024
- const VERSION = "7.0.5";
17039
+ const VERSION = "7.0.6";
17025
17040
 
17026
17041
  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 };
17027
17042
  //# sourceMappingURL=bruce-models.es5.js.map