@liberseek/boft-cli-linux-x64 0.7.5 → 0.7.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/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +17950 -0
- package/app/console-web.js +27484 -0
- package/app/desktop-controller.mjs +221 -33
- package/app/host-runtime.mjs +3590 -1251
- package/app/plugins/antigravity/plugin.mjs +726 -357
- package/app/plugins/claude-code/plugin.mjs +3067 -2208
- package/app/plugins/codebuddy/plugin.mjs +798 -386
- package/app/plugins/cursor-cli/manifest.json +1 -1
- package/app/plugins/cursor-cli/plugin.mjs +1230 -555
- package/app/plugins/deepseek-harness/plugin.mjs +4761 -4967
- package/app/plugins/grok/plugin.mjs +670 -361
- package/app/plugins/hermes/plugin.mjs +764 -441
- package/app/plugins/kimi-code/plugin.mjs +1095 -428
- package/app/plugins/kiro-cli/plugin.mjs +603 -332
- package/app/plugins/muse/plugin.mjs +189 -58
- package/app/plugins/omp/plugin.mjs +689 -334
- package/app/plugins/opencode/plugin.mjs +946 -478
- package/app/plugins/pi/plugin.mjs +1325 -587
- package/app/plugins/qoder/plugin.mjs +756 -308
- package/app/plugins/qoder-cn/plugin.mjs +555 -99
- package/app/plugins/workbuddy/plugin.mjs +192 -58
- package/app/renderer-extension.js +3703 -1703
- package/bin/boft +0 -0
- package/libexec/boft-shim +0 -0
- package/libexec/boft-updater +0 -0
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// packages/desktop-control/src/production-controller.ts
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
|
-
import
|
|
3
|
+
import path2 from "node:path";
|
|
4
4
|
|
|
5
5
|
// packages/desktop-control/src/controller-attachment-server.ts
|
|
6
6
|
import { createServer } from "node:net";
|
|
@@ -87,7 +87,106 @@ async function startControllerAttachmentServer(options) {
|
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
// packages/desktop-control/src/controller-status.ts
|
|
91
|
+
import { randomBytes } from "node:crypto";
|
|
92
|
+
import { mkdir, rename, rm, writeFile } from "node:fs/promises";
|
|
93
|
+
import os from "node:os";
|
|
94
|
+
import path from "node:path";
|
|
95
|
+
var DESKTOP_CONTROLLER_STATUS_FILE = "desktop-controller-v1.json";
|
|
96
|
+
var ERROR_MAX_LENGTH = 1e3;
|
|
97
|
+
function defaultControllerStatusPath(environment = process.env) {
|
|
98
|
+
const dataDirectory = environment.CODEXHOST_DATA_DIR ? path.resolve(environment.CODEXHOST_DATA_DIR) : path.join(os.homedir(), ".codexhost");
|
|
99
|
+
return path.join(dataDirectory, "diagnostics", DESKTOP_CONTROLLER_STATUS_FILE);
|
|
100
|
+
}
|
|
101
|
+
function errorMessage(error) {
|
|
102
|
+
const parts = [];
|
|
103
|
+
let current = error;
|
|
104
|
+
for (let depth = 0; depth < 4 && current !== void 0; depth += 1) {
|
|
105
|
+
parts.push(current instanceof Error ? current.message : String(current));
|
|
106
|
+
current = current instanceof Error ? current.cause : void 0;
|
|
107
|
+
}
|
|
108
|
+
return parts.join(": ").slice(0, ERROR_MAX_LENGTH) || "Renderer installation failed";
|
|
109
|
+
}
|
|
110
|
+
function createRendererStatusReporter(publish, now = Date.now, pid = process.pid) {
|
|
111
|
+
const startedAt = now();
|
|
112
|
+
let current;
|
|
113
|
+
const update = (next) => {
|
|
114
|
+
if (current && current.state === next.state && current.error === next.error && current.failures === next.failures) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
current = { ...next, updatedAt: now() };
|
|
118
|
+
publish({ schemaVersion: 1, pid, startedAt, renderer: current });
|
|
119
|
+
};
|
|
120
|
+
return {
|
|
121
|
+
installing() {
|
|
122
|
+
update({
|
|
123
|
+
state: "installing",
|
|
124
|
+
error: current?.error ?? null,
|
|
125
|
+
failures: current?.failures ?? 0,
|
|
126
|
+
lastError: current?.lastError ?? null,
|
|
127
|
+
lastFailedAt: current?.lastFailedAt ?? null,
|
|
128
|
+
lastInstalledAt: current?.lastInstalledAt ?? null
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
installed() {
|
|
132
|
+
if (current?.state === "installed") return;
|
|
133
|
+
update({
|
|
134
|
+
state: "installed",
|
|
135
|
+
error: null,
|
|
136
|
+
failures: current?.failures ?? 0,
|
|
137
|
+
lastError: current?.lastError ?? null,
|
|
138
|
+
lastFailedAt: current?.lastFailedAt ?? null,
|
|
139
|
+
lastInstalledAt: now()
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
failed(error) {
|
|
143
|
+
const message = errorMessage(error);
|
|
144
|
+
update({
|
|
145
|
+
state: "unavailable",
|
|
146
|
+
error: message,
|
|
147
|
+
failures: (current?.failures ?? 0) + 1,
|
|
148
|
+
lastError: message,
|
|
149
|
+
lastFailedAt: now(),
|
|
150
|
+
lastInstalledAt: current?.lastInstalledAt ?? null
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
async function writeControllerStatusFile(filePath, document) {
|
|
156
|
+
const directory = path.dirname(filePath);
|
|
157
|
+
await mkdir(directory, { recursive: true, mode: 448 });
|
|
158
|
+
const temporaryPath = path.join(
|
|
159
|
+
directory,
|
|
160
|
+
`.${path.basename(filePath)}.${randomBytes(6).toString("hex")}.tmp`
|
|
161
|
+
);
|
|
162
|
+
try {
|
|
163
|
+
await writeFile(temporaryPath, `${JSON.stringify(document)}
|
|
164
|
+
`, {
|
|
165
|
+
encoding: "utf8",
|
|
166
|
+
mode: 384,
|
|
167
|
+
flag: "wx"
|
|
168
|
+
});
|
|
169
|
+
await rename(temporaryPath, filePath);
|
|
170
|
+
} catch (error) {
|
|
171
|
+
await rm(temporaryPath, { force: true });
|
|
172
|
+
throw error;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function createControllerStatusPublisher(filePath = defaultControllerStatusPath()) {
|
|
176
|
+
let queue = Promise.resolve();
|
|
177
|
+
return (document) => {
|
|
178
|
+
queue = queue.then(() => writeControllerStatusFile(filePath, document)).catch(() => void 0);
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
90
182
|
// packages/desktop-control/src/cdp-client.ts
|
|
183
|
+
function cdpExceptionMessage(details, fallback) {
|
|
184
|
+
const exception = details.exception;
|
|
185
|
+
if (isRecord(exception) && typeof exception.description === "string" && exception.description) {
|
|
186
|
+
return exception.description;
|
|
187
|
+
}
|
|
188
|
+
return typeof details.text === "string" && details.text ? details.text : fallback;
|
|
189
|
+
}
|
|
91
190
|
function isRecord(value) {
|
|
92
191
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
93
192
|
}
|
|
@@ -120,8 +219,8 @@ function parseTarget(value) {
|
|
|
120
219
|
webSocketDebuggerUrl
|
|
121
220
|
};
|
|
122
221
|
}
|
|
123
|
-
function defaultFetch(url) {
|
|
124
|
-
return fetch(url);
|
|
222
|
+
function defaultFetch(url, init) {
|
|
223
|
+
return fetch(url, init);
|
|
125
224
|
}
|
|
126
225
|
function defaultSocketFactory(url) {
|
|
127
226
|
return new WebSocket(url);
|
|
@@ -148,10 +247,10 @@ function parseResponse(value) {
|
|
|
148
247
|
}
|
|
149
248
|
return response;
|
|
150
249
|
}
|
|
151
|
-
async function listCdpTargets(endpoint, fetchImpl = defaultFetch) {
|
|
250
|
+
async function listCdpTargets(endpoint, fetchImpl = defaultFetch, signal) {
|
|
152
251
|
const baseUrl = loopbackUrl(endpoint, ["http:", "https:"]);
|
|
153
252
|
const targetsUrl = new URL("/json/list", baseUrl).toString();
|
|
154
|
-
const response = await fetchImpl(targetsUrl);
|
|
253
|
+
const response = await fetchImpl(targetsUrl, signal ? { signal } : void 0);
|
|
155
254
|
if (!response.ok) throw new Error(`CDP target discovery failed with HTTP ${response.status}`);
|
|
156
255
|
const value = await response.json();
|
|
157
256
|
if (!Array.isArray(value)) throw new Error("CDP target discovery did not return an array");
|
|
@@ -244,8 +343,7 @@ var CdpClient = class _CdpClient {
|
|
|
244
343
|
});
|
|
245
344
|
if (!isRecord(response)) throw new Error("Runtime.evaluate returned an invalid result");
|
|
246
345
|
if (isRecord(response.exceptionDetails)) {
|
|
247
|
-
|
|
248
|
-
throw new Error(text);
|
|
346
|
+
throw new Error(cdpExceptionMessage(response.exceptionDetails, "Renderer evaluation failed"));
|
|
249
347
|
}
|
|
250
348
|
if (!isRecord(response.result) || !("value" in response.result)) {
|
|
251
349
|
throw new Error("Runtime.evaluate did not return a value");
|
|
@@ -298,14 +396,25 @@ var CdpClient = class _CdpClient {
|
|
|
298
396
|
|
|
299
397
|
// packages/desktop-control/src/renderer-react-ownership.ts
|
|
300
398
|
function committedReactAncestors(value) {
|
|
301
|
-
const MAX_VISITED_FIBERS =
|
|
399
|
+
const MAX_VISITED_FIBERS = 2e5;
|
|
302
400
|
const fiber = (value2) => typeof value2 === "object" && value2 !== null ? value2 : null;
|
|
401
|
+
const exhausted = () => {
|
|
402
|
+
const target = globalThis;
|
|
403
|
+
if (typeof target.dispatchEvent === "function" && typeof CustomEvent === "function")
|
|
404
|
+
target.dispatchEvent(
|
|
405
|
+
new CustomEvent("codexhost:react-fiber-walk-limit", {
|
|
406
|
+
detail: { limit: MAX_VISITED_FIBERS }
|
|
407
|
+
})
|
|
408
|
+
);
|
|
409
|
+
return [];
|
|
410
|
+
};
|
|
303
411
|
const first = fiber(value);
|
|
304
412
|
if (!first) return [];
|
|
305
413
|
const previous = [];
|
|
306
414
|
const seen = /* @__PURE__ */ new Set();
|
|
307
415
|
for (let node = first; node; node = fiber(node.return)) {
|
|
308
|
-
if (seen.has(node)
|
|
416
|
+
if (seen.has(node)) return [];
|
|
417
|
+
if (seen.size >= MAX_VISITED_FIBERS) return exhausted();
|
|
309
418
|
seen.add(node);
|
|
310
419
|
previous.push(node);
|
|
311
420
|
}
|
|
@@ -313,8 +422,30 @@ function committedReactAncestors(value) {
|
|
|
313
422
|
if (!rootState || !("current" in rootState)) return previous;
|
|
314
423
|
const current = fiber(rootState.current);
|
|
315
424
|
if (!current) return [];
|
|
316
|
-
const stack = [{ node: current, parent: null }];
|
|
317
425
|
const alternate = fiber(first.alternate);
|
|
426
|
+
const path3 = [current];
|
|
427
|
+
seen.clear();
|
|
428
|
+
seen.add(current);
|
|
429
|
+
for (let index = previous.length - 2; index >= 0; index -= 1) {
|
|
430
|
+
const expected = previous[index];
|
|
431
|
+
const expectedAlternate = fiber(expected?.alternate);
|
|
432
|
+
let child = fiber(path3.at(-1)?.child);
|
|
433
|
+
let matched = false;
|
|
434
|
+
while (child && !seen.has(child) && seen.size < MAX_VISITED_FIBERS) {
|
|
435
|
+
seen.add(child);
|
|
436
|
+
if (child === expected || child === expectedAlternate) {
|
|
437
|
+
matched = true;
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
child = fiber(child.sibling);
|
|
441
|
+
}
|
|
442
|
+
if (!matched || !child) break;
|
|
443
|
+
path3.push(child);
|
|
444
|
+
}
|
|
445
|
+
if (path3.length === previous.length && (path3.at(-1) === first || path3.at(-1) === alternate)) {
|
|
446
|
+
return path3.reverse();
|
|
447
|
+
}
|
|
448
|
+
const stack = [{ node: current, parent: null }];
|
|
318
449
|
seen.clear();
|
|
319
450
|
while (stack.length > 0 && seen.size < MAX_VISITED_FIBERS) {
|
|
320
451
|
const entry = stack.pop();
|
|
@@ -332,7 +463,7 @@ function committedReactAncestors(value) {
|
|
|
332
463
|
const child = fiber(entry.node.child);
|
|
333
464
|
if (child) stack.push({ node: child, parent: entry });
|
|
334
465
|
}
|
|
335
|
-
return [];
|
|
466
|
+
return stack.length > 0 ? exhausted() : [];
|
|
336
467
|
}
|
|
337
468
|
|
|
338
469
|
// packages/desktop-control/src/renderer-host-response-ownership.ts
|
|
@@ -1188,6 +1319,33 @@ function isRecord2(value) {
|
|
|
1188
1319
|
function sleep(milliseconds) {
|
|
1189
1320
|
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
1190
1321
|
}
|
|
1322
|
+
function discoveryTimeoutSignal(timeoutMs, signal) {
|
|
1323
|
+
const timeout = AbortSignal.timeout(timeoutMs);
|
|
1324
|
+
return signal ? AbortSignal.any([timeout, signal]) : timeout;
|
|
1325
|
+
}
|
|
1326
|
+
function abortFailure(signal, fallback) {
|
|
1327
|
+
return signal.reason instanceof Error ? signal.reason : new Error(fallback);
|
|
1328
|
+
}
|
|
1329
|
+
function awaitWithSignal(promise, signal, timeoutMessage) {
|
|
1330
|
+
if (signal.aborted) return Promise.reject(abortFailure(signal, timeoutMessage));
|
|
1331
|
+
return new Promise((resolve, reject) => {
|
|
1332
|
+
const onAbort = () => {
|
|
1333
|
+
signal.removeEventListener("abort", onAbort);
|
|
1334
|
+
reject(abortFailure(signal, timeoutMessage));
|
|
1335
|
+
};
|
|
1336
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
1337
|
+
promise.then(
|
|
1338
|
+
(value) => {
|
|
1339
|
+
signal.removeEventListener("abort", onAbort);
|
|
1340
|
+
resolve(value);
|
|
1341
|
+
},
|
|
1342
|
+
(error) => {
|
|
1343
|
+
signal.removeEventListener("abort", onAbort);
|
|
1344
|
+
reject(error);
|
|
1345
|
+
}
|
|
1346
|
+
);
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1191
1349
|
function sameAgents(actual, expected) {
|
|
1192
1350
|
const expectedSet = new Set(expected);
|
|
1193
1351
|
return actual.length === expected.length && new Set(actual).size === actual.length && actual.every((agent) => expectedSet.has(agent));
|
|
@@ -1227,21 +1385,36 @@ function validateBindingStatus(value, expectedAgents) {
|
|
|
1227
1385
|
}
|
|
1228
1386
|
return value;
|
|
1229
1387
|
}
|
|
1230
|
-
async function waitForPrimaryTarget(endpoint, operations, timeoutMs, pollIntervalMs, preferredTargetId) {
|
|
1231
|
-
const
|
|
1388
|
+
async function waitForPrimaryTarget(endpoint, operations, timeoutMs, pollIntervalMs, preferredTargetId, signal) {
|
|
1389
|
+
const discovery = discoveryTimeoutSignal(timeoutMs, signal);
|
|
1232
1390
|
let lastError;
|
|
1233
|
-
while (
|
|
1391
|
+
while (!discovery.aborted) {
|
|
1234
1392
|
try {
|
|
1235
1393
|
const target = selectPrimaryRendererTarget(
|
|
1236
|
-
await
|
|
1394
|
+
await awaitWithSignal(
|
|
1395
|
+
operations.listTargets(endpoint, discovery),
|
|
1396
|
+
discovery,
|
|
1397
|
+
"Renderer CDP target discovery timed out"
|
|
1398
|
+
),
|
|
1237
1399
|
preferredTargetId
|
|
1238
1400
|
);
|
|
1239
1401
|
if (target) return target;
|
|
1240
1402
|
lastError = new Error("Renderer CDP has no primary app://-/index.html page target");
|
|
1241
1403
|
} catch (error) {
|
|
1242
1404
|
lastError = error;
|
|
1405
|
+
if (discovery.aborted) break;
|
|
1406
|
+
}
|
|
1407
|
+
if (discovery.aborted) break;
|
|
1408
|
+
try {
|
|
1409
|
+
await awaitWithSignal(
|
|
1410
|
+
sleep(pollIntervalMs),
|
|
1411
|
+
discovery,
|
|
1412
|
+
"Renderer CDP target discovery timed out"
|
|
1413
|
+
);
|
|
1414
|
+
} catch (error) {
|
|
1415
|
+
lastError = error;
|
|
1416
|
+
break;
|
|
1243
1417
|
}
|
|
1244
|
-
await sleep(pollIntervalMs);
|
|
1245
1418
|
}
|
|
1246
1419
|
const detail = lastError instanceof Error ? `: ${lastError.message}` : "";
|
|
1247
1420
|
throw new Error(`Primary Codex Renderer CDP target did not become ready${detail}`);
|
|
@@ -1253,8 +1426,9 @@ async function evaluateSource(renderer, source) {
|
|
|
1253
1426
|
});
|
|
1254
1427
|
if (!isRecord2(response)) throw new Error("Renderer source evaluation returned an invalid result");
|
|
1255
1428
|
if (isRecord2(response.exceptionDetails)) {
|
|
1256
|
-
|
|
1257
|
-
|
|
1429
|
+
throw new Error(
|
|
1430
|
+
cdpExceptionMessage(response.exceptionDetails, "Renderer source evaluation failed")
|
|
1431
|
+
);
|
|
1258
1432
|
}
|
|
1259
1433
|
}
|
|
1260
1434
|
async function readBinding(renderer) {
|
|
@@ -1382,7 +1556,7 @@ var InstalledRendererCdpControlSession = class {
|
|
|
1382
1556
|
}
|
|
1383
1557
|
};
|
|
1384
1558
|
var defaultOperations = {
|
|
1385
|
-
listTargets: (endpoint) => listCdpTargets(endpoint),
|
|
1559
|
+
listTargets: (endpoint, signal) => listCdpTargets(endpoint, fetch, signal),
|
|
1386
1560
|
connect: (webSocketDebuggerUrl) => CdpClient.connect(webSocketDebuggerUrl),
|
|
1387
1561
|
installDraftPrewarmPolicy: installRendererDraftPrewarmPolicyDirect
|
|
1388
1562
|
};
|
|
@@ -1395,7 +1569,9 @@ async function createRendererCdpControlSession(options) {
|
|
|
1395
1569
|
options.rendererCdpEndpoint,
|
|
1396
1570
|
operations,
|
|
1397
1571
|
timeoutMs,
|
|
1398
|
-
pollIntervalMs
|
|
1572
|
+
pollIntervalMs,
|
|
1573
|
+
void 0,
|
|
1574
|
+
options.signal
|
|
1399
1575
|
);
|
|
1400
1576
|
const installed = await installTarget(
|
|
1401
1577
|
target,
|
|
@@ -1454,6 +1630,7 @@ var defaultDependencies = {
|
|
|
1454
1630
|
process.stdout.write(`${serializeDesktopControllerReadiness(readiness)}
|
|
1455
1631
|
`);
|
|
1456
1632
|
},
|
|
1633
|
+
publishStatus: createControllerStatusPublisher(),
|
|
1457
1634
|
sleep: (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)),
|
|
1458
1635
|
monitorIntervalMs: 500
|
|
1459
1636
|
};
|
|
@@ -1485,8 +1662,8 @@ function parseDesktopControllerArguments(arguments_) {
|
|
|
1485
1662
|
if (argument === "--renderer") {
|
|
1486
1663
|
if (rendererPath !== void 0) throw new Error("--renderer may only be provided once");
|
|
1487
1664
|
if (!value) throw new Error("--renderer requires a value");
|
|
1488
|
-
if (!
|
|
1489
|
-
rendererPath =
|
|
1665
|
+
if (!path2.isAbsolute(value)) throw new Error("--renderer must be an absolute path");
|
|
1666
|
+
rendererPath = path2.normalize(value);
|
|
1490
1667
|
index += 1;
|
|
1491
1668
|
continue;
|
|
1492
1669
|
}
|
|
@@ -1568,15 +1745,22 @@ async function runDesktopController(options, signal, dependencies = defaultDepen
|
|
|
1568
1745
|
let session;
|
|
1569
1746
|
let nextRecoveryAt = 0;
|
|
1570
1747
|
let recoveryDelayMs = RECOVERY_RETRY_INITIAL_MS;
|
|
1571
|
-
const
|
|
1748
|
+
const status = createRendererStatusReporter(
|
|
1749
|
+
(document) => dependencies.publishStatus?.(document),
|
|
1750
|
+
now
|
|
1751
|
+
);
|
|
1752
|
+
const recordRecoveryFailure = (error) => {
|
|
1572
1753
|
nextRecoveryAt = now() + recoveryDelayMs;
|
|
1573
1754
|
recoveryDelayMs = Math.min(recoveryDelayMs * 2, RECOVERY_RETRY_MAX_MS);
|
|
1755
|
+
status.failed(error);
|
|
1574
1756
|
};
|
|
1575
1757
|
const recordRecoverySuccess = () => {
|
|
1576
1758
|
nextRecoveryAt = 0;
|
|
1577
1759
|
recoveryDelayMs = RECOVERY_RETRY_INITIAL_MS;
|
|
1760
|
+
status.installed();
|
|
1578
1761
|
};
|
|
1579
1762
|
const createSession = async () => {
|
|
1763
|
+
status.installing();
|
|
1580
1764
|
startupTrace("reading Renderer bundle");
|
|
1581
1765
|
const rendererSource = await dependencies.readRenderer(options.rendererPath);
|
|
1582
1766
|
if (rendererSource.trim().length === 0) throw new Error("production Renderer Bundle is empty");
|
|
@@ -1606,7 +1790,8 @@ ${rendererSource}`,
|
|
|
1606
1790
|
"qoder-cn",
|
|
1607
1791
|
"kimi-code"
|
|
1608
1792
|
],
|
|
1609
|
-
timeoutMs: PRODUCTION_INSTALL_TIMEOUT_MS
|
|
1793
|
+
timeoutMs: PRODUCTION_INSTALL_TIMEOUT_MS,
|
|
1794
|
+
signal
|
|
1610
1795
|
},
|
|
1611
1796
|
dependencies
|
|
1612
1797
|
);
|
|
@@ -1614,14 +1799,6 @@ ${rendererSource}`,
|
|
|
1614
1799
|
return installed;
|
|
1615
1800
|
};
|
|
1616
1801
|
startupTrace("initialization started");
|
|
1617
|
-
try {
|
|
1618
|
-
session = await createSession();
|
|
1619
|
-
recordRecoverySuccess();
|
|
1620
|
-
} catch (error) {
|
|
1621
|
-
startupTrace("initial Renderer Session unavailable", error);
|
|
1622
|
-
session = void 0;
|
|
1623
|
-
recordRecoveryFailure();
|
|
1624
|
-
}
|
|
1625
1802
|
let operation = Promise.resolve(void 0);
|
|
1626
1803
|
const useSession = (callback) => {
|
|
1627
1804
|
const next = operation.then(callback, callback);
|
|
@@ -1647,7 +1824,7 @@ ${rendererSource}`,
|
|
|
1647
1824
|
return current;
|
|
1648
1825
|
} catch (error) {
|
|
1649
1826
|
resetSession();
|
|
1650
|
-
recordRecoveryFailure();
|
|
1827
|
+
recordRecoveryFailure(error);
|
|
1651
1828
|
throw error;
|
|
1652
1829
|
}
|
|
1653
1830
|
};
|
|
@@ -1669,6 +1846,17 @@ ${rendererSource}`,
|
|
|
1669
1846
|
state: "compatible",
|
|
1670
1847
|
issues: []
|
|
1671
1848
|
});
|
|
1849
|
+
await useSession(async () => {
|
|
1850
|
+
if (session) return;
|
|
1851
|
+
try {
|
|
1852
|
+
session = await createSession();
|
|
1853
|
+
recordRecoverySuccess();
|
|
1854
|
+
} catch (error) {
|
|
1855
|
+
startupTrace("initial Renderer Session unavailable", error);
|
|
1856
|
+
session = void 0;
|
|
1857
|
+
recordRecoveryFailure(error);
|
|
1858
|
+
}
|
|
1859
|
+
});
|
|
1672
1860
|
while (!signal.aborted) {
|
|
1673
1861
|
await dependencies.sleep(dependencies.monitorIntervalMs);
|
|
1674
1862
|
if (signal.aborted) continue;
|