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.
@@ -16338,7 +16338,7 @@
16338
16338
  })(exports.Tracking || (exports.Tracking = {}));
16339
16339
 
16340
16340
  const DEFAULT_JOB_POLL_INTERVAL_MS = 1000;
16341
- const DEFAULT_JOB_POLL_TIMEOUT_MS = 4 * 60 * 1000; // match server timeout (4 minutes)
16341
+ const DEFAULT_JOB_POLL_TIMEOUT_MS = 10 * 60 * 1000; // match server timeout (10 minutes)
16342
16342
  const DEFAULT_BASE_URL = "http://localhost:8888";
16343
16343
  /**
16344
16344
  * Lightweight client for the Navigator MCP chat HTTP endpoints.
@@ -16421,15 +16421,17 @@
16421
16421
  .map((step, idx) => (Object.assign(Object.assign({}, step), { index: typeof (step === null || step === void 0 ? void 0 : step.index) === "number" ? step.index : idx })));
16422
16422
  }
16423
16423
  waitForJobCompletion(envelope, auth) {
16424
- var _a, _b, _c, _d, _e;
16424
+ var _a, _b, _c, _d, _e, _f;
16425
16425
  return __awaiter(this, void 0, void 0, function* () {
16426
16426
  if (!envelope.jobId) {
16427
16427
  throw new Error("Chat job response did not include a jobId.");
16428
16428
  }
16429
16429
  const pollPath = (_a = envelope.pollUrl) !== null && _a !== void 0 ? _a : `/chat/jobs/${envelope.jobId}`;
16430
16430
  const startedAt = Date.now();
16431
+ let lastStatusPayload = null;
16431
16432
  while (Date.now() - startedAt < this.jobPollTimeoutMs) {
16432
16433
  const statusPayload = yield this.fetchJobStatus(pollPath, auth);
16434
+ lastStatusPayload = statusPayload;
16433
16435
  const status = statusPayload === null || statusPayload === void 0 ? void 0 : statusPayload.status;
16434
16436
  if (!status) {
16435
16437
  yield this.delay(this.jobPollIntervalMs);
@@ -16459,7 +16461,20 @@
16459
16461
  }
16460
16462
  yield this.delay(this.jobPollIntervalMs);
16461
16463
  }
16462
- throw new Error("Chat job polling timed out. Please try again later.");
16464
+ // Timeout: return a response object instead of throwing
16465
+ const combinedSteps = lastStatusPayload ? [
16466
+ ...(Array.isArray(lastStatusPayload.steps) ? lastStatusPayload.steps : []),
16467
+ ...(Array.isArray((_f = lastStatusPayload.result) === null || _f === void 0 ? void 0 : _f.steps) ? lastStatusPayload.result.steps : [])
16468
+ ] : [];
16469
+ const normalizedSteps = this.normalizeSteps(combinedSteps);
16470
+ return {
16471
+ text: "Chat job polling timed out. Please try again later.",
16472
+ steps: normalizedSteps,
16473
+ raw: lastStatusPayload !== null && lastStatusPayload !== void 0 ? lastStatusPayload : {},
16474
+ jobId: envelope.jobId,
16475
+ status: "TIMEOUT",
16476
+ anonymous: Boolean(lastStatusPayload === null || lastStatusPayload === void 0 ? void 0 : lastStatusPayload.anonymous)
16477
+ };
16463
16478
  });
16464
16479
  }
16465
16480
  fetchJobStatus(path, auth) {
@@ -16706,7 +16721,7 @@
16706
16721
  }
16707
16722
 
16708
16723
  // This is updated with the package.json version on build.
16709
- const VERSION = "7.0.5";
16724
+ const VERSION = "7.0.6";
16710
16725
 
16711
16726
  exports.VERSION = VERSION;
16712
16727
  exports.AbstractApi = AbstractApi;