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.
- package/dist/bruce-models.es5.js +31 -5
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +31 -5
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/environment.js +12 -1
- package/dist/lib/environment.js.map +1 -1
- package/dist/lib/mcp/navigator-chat.js +18 -3
- package/dist/lib/mcp/navigator-chat.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/environment.d.ts +4 -1
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -1833,7 +1833,18 @@
|
|
|
1833
1833
|
_getters.SetEnv(params.env);
|
|
1834
1834
|
}
|
|
1835
1835
|
}
|
|
1836
|
-
|
|
1836
|
+
if (params.dereference) {
|
|
1837
|
+
ENVIRONMENT.PARAMS = Object.assign(Object.assign({}, ENVIRONMENT.PARAMS), params);
|
|
1838
|
+
}
|
|
1839
|
+
else {
|
|
1840
|
+
const keys = Object.keys(params);
|
|
1841
|
+
for (const key of keys) {
|
|
1842
|
+
const value = params[key];
|
|
1843
|
+
if (value !== undefined) {
|
|
1844
|
+
ENVIRONMENT.PARAMS[key] = value;
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1837
1848
|
(_a = ENVIRONMENT.OnParamsChange) === null || _a === void 0 ? void 0 : _a.Trigger();
|
|
1838
1849
|
}
|
|
1839
1850
|
ENVIRONMENT.Reset = Reset;
|
|
@@ -16338,7 +16349,7 @@
|
|
|
16338
16349
|
})(exports.Tracking || (exports.Tracking = {}));
|
|
16339
16350
|
|
|
16340
16351
|
const DEFAULT_JOB_POLL_INTERVAL_MS = 1000;
|
|
16341
|
-
const DEFAULT_JOB_POLL_TIMEOUT_MS =
|
|
16352
|
+
const DEFAULT_JOB_POLL_TIMEOUT_MS = 10 * 60 * 1000; // match server timeout (10 minutes)
|
|
16342
16353
|
const DEFAULT_BASE_URL = "http://localhost:8888";
|
|
16343
16354
|
/**
|
|
16344
16355
|
* Lightweight client for the Navigator MCP chat HTTP endpoints.
|
|
@@ -16421,15 +16432,17 @@
|
|
|
16421
16432
|
.map((step, idx) => (Object.assign(Object.assign({}, step), { index: typeof (step === null || step === void 0 ? void 0 : step.index) === "number" ? step.index : idx })));
|
|
16422
16433
|
}
|
|
16423
16434
|
waitForJobCompletion(envelope, auth) {
|
|
16424
|
-
var _a, _b, _c, _d, _e;
|
|
16435
|
+
var _a, _b, _c, _d, _e, _f;
|
|
16425
16436
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16426
16437
|
if (!envelope.jobId) {
|
|
16427
16438
|
throw new Error("Chat job response did not include a jobId.");
|
|
16428
16439
|
}
|
|
16429
16440
|
const pollPath = (_a = envelope.pollUrl) !== null && _a !== void 0 ? _a : `/chat/jobs/${envelope.jobId}`;
|
|
16430
16441
|
const startedAt = Date.now();
|
|
16442
|
+
let lastStatusPayload = null;
|
|
16431
16443
|
while (Date.now() - startedAt < this.jobPollTimeoutMs) {
|
|
16432
16444
|
const statusPayload = yield this.fetchJobStatus(pollPath, auth);
|
|
16445
|
+
lastStatusPayload = statusPayload;
|
|
16433
16446
|
const status = statusPayload === null || statusPayload === void 0 ? void 0 : statusPayload.status;
|
|
16434
16447
|
if (!status) {
|
|
16435
16448
|
yield this.delay(this.jobPollIntervalMs);
|
|
@@ -16459,7 +16472,20 @@
|
|
|
16459
16472
|
}
|
|
16460
16473
|
yield this.delay(this.jobPollIntervalMs);
|
|
16461
16474
|
}
|
|
16462
|
-
|
|
16475
|
+
// Timeout: return a response object instead of throwing
|
|
16476
|
+
const combinedSteps = lastStatusPayload ? [
|
|
16477
|
+
...(Array.isArray(lastStatusPayload.steps) ? lastStatusPayload.steps : []),
|
|
16478
|
+
...(Array.isArray((_f = lastStatusPayload.result) === null || _f === void 0 ? void 0 : _f.steps) ? lastStatusPayload.result.steps : [])
|
|
16479
|
+
] : [];
|
|
16480
|
+
const normalizedSteps = this.normalizeSteps(combinedSteps);
|
|
16481
|
+
return {
|
|
16482
|
+
text: "Chat job polling timed out. Please try again later.",
|
|
16483
|
+
steps: normalizedSteps,
|
|
16484
|
+
raw: lastStatusPayload !== null && lastStatusPayload !== void 0 ? lastStatusPayload : {},
|
|
16485
|
+
jobId: envelope.jobId,
|
|
16486
|
+
status: "TIMEOUT",
|
|
16487
|
+
anonymous: Boolean(lastStatusPayload === null || lastStatusPayload === void 0 ? void 0 : lastStatusPayload.anonymous)
|
|
16488
|
+
};
|
|
16463
16489
|
});
|
|
16464
16490
|
}
|
|
16465
16491
|
fetchJobStatus(path, auth) {
|
|
@@ -16706,7 +16732,7 @@
|
|
|
16706
16732
|
}
|
|
16707
16733
|
|
|
16708
16734
|
// This is updated with the package.json version on build.
|
|
16709
|
-
const VERSION = "7.0.
|
|
16735
|
+
const VERSION = "7.0.7";
|
|
16710
16736
|
|
|
16711
16737
|
exports.VERSION = VERSION;
|
|
16712
16738
|
exports.AbstractApi = AbstractApi;
|