bruce-models 7.0.5 → 7.0.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.
@@ -1849,7 +1849,18 @@ var ENVIRONMENT;
1849
1849
  _getters.SetEnv(params.env);
1850
1850
  }
1851
1851
  }
1852
- ENVIRONMENT.PARAMS = Object.assign(Object.assign({}, ENVIRONMENT.PARAMS), params);
1852
+ if (params.dereference) {
1853
+ ENVIRONMENT.PARAMS = Object.assign(Object.assign({}, ENVIRONMENT.PARAMS), params);
1854
+ }
1855
+ else {
1856
+ const keys = Object.keys(params);
1857
+ for (const key of keys) {
1858
+ const value = params[key];
1859
+ if (value !== undefined) {
1860
+ ENVIRONMENT.PARAMS[key] = value;
1861
+ }
1862
+ }
1863
+ }
1853
1864
  (_a = ENVIRONMENT.OnParamsChange) === null || _a === void 0 ? void 0 : _a.Trigger();
1854
1865
  }
1855
1866
  ENVIRONMENT.Reset = Reset;
@@ -16653,7 +16664,7 @@ var Tracking;
16653
16664
  })(Tracking || (Tracking = {}));
16654
16665
 
16655
16666
  const DEFAULT_JOB_POLL_INTERVAL_MS = 1000;
16656
- const DEFAULT_JOB_POLL_TIMEOUT_MS = 4 * 60 * 1000; // match server timeout (4 minutes)
16667
+ const DEFAULT_JOB_POLL_TIMEOUT_MS = 10 * 60 * 1000; // match server timeout (10 minutes)
16657
16668
  const DEFAULT_BASE_URL = "http://localhost:8888";
16658
16669
  /**
16659
16670
  * Lightweight client for the Navigator MCP chat HTTP endpoints.
@@ -16736,15 +16747,17 @@ class NavigatorChatClient {
16736
16747
  .map((step, idx) => (Object.assign(Object.assign({}, step), { index: typeof (step === null || step === void 0 ? void 0 : step.index) === "number" ? step.index : idx })));
16737
16748
  }
16738
16749
  waitForJobCompletion(envelope, auth) {
16739
- var _a, _b, _c, _d, _e;
16750
+ var _a, _b, _c, _d, _e, _f;
16740
16751
  return __awaiter(this, void 0, void 0, function* () {
16741
16752
  if (!envelope.jobId) {
16742
16753
  throw new Error("Chat job response did not include a jobId.");
16743
16754
  }
16744
16755
  const pollPath = (_a = envelope.pollUrl) !== null && _a !== void 0 ? _a : `/chat/jobs/${envelope.jobId}`;
16745
16756
  const startedAt = Date.now();
16757
+ let lastStatusPayload = null;
16746
16758
  while (Date.now() - startedAt < this.jobPollTimeoutMs) {
16747
16759
  const statusPayload = yield this.fetchJobStatus(pollPath, auth);
16760
+ lastStatusPayload = statusPayload;
16748
16761
  const status = statusPayload === null || statusPayload === void 0 ? void 0 : statusPayload.status;
16749
16762
  if (!status) {
16750
16763
  yield this.delay(this.jobPollIntervalMs);
@@ -16774,7 +16787,20 @@ class NavigatorChatClient {
16774
16787
  }
16775
16788
  yield this.delay(this.jobPollIntervalMs);
16776
16789
  }
16777
- throw new Error("Chat job polling timed out. Please try again later.");
16790
+ // Timeout: return a response object instead of throwing
16791
+ const combinedSteps = lastStatusPayload ? [
16792
+ ...(Array.isArray(lastStatusPayload.steps) ? lastStatusPayload.steps : []),
16793
+ ...(Array.isArray((_f = lastStatusPayload.result) === null || _f === void 0 ? void 0 : _f.steps) ? lastStatusPayload.result.steps : [])
16794
+ ] : [];
16795
+ const normalizedSteps = this.normalizeSteps(combinedSteps);
16796
+ return {
16797
+ text: "Chat job polling timed out. Please try again later.",
16798
+ steps: normalizedSteps,
16799
+ raw: lastStatusPayload !== null && lastStatusPayload !== void 0 ? lastStatusPayload : {},
16800
+ jobId: envelope.jobId,
16801
+ status: "TIMEOUT",
16802
+ anonymous: Boolean(lastStatusPayload === null || lastStatusPayload === void 0 ? void 0 : lastStatusPayload.anonymous)
16803
+ };
16778
16804
  });
16779
16805
  }
16780
16806
  fetchJobStatus(path, auth) {
@@ -17021,7 +17047,7 @@ class NavigatorMcpWebSocketClient {
17021
17047
  }
17022
17048
 
17023
17049
  // This is updated with the package.json version on build.
17024
- const VERSION = "7.0.5";
17050
+ const VERSION = "7.0.7";
17025
17051
 
17026
17052
  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
17053
  //# sourceMappingURL=bruce-models.es5.js.map