@adhdev/daemon-standalone 0.9.82-rc.129 → 0.9.82-rc.130
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/index.js +174 -121
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24286,19 +24286,19 @@ Follow these recovery rules:
|
|
|
24286
24286
|
return null;
|
|
24287
24287
|
}
|
|
24288
24288
|
function execAsync(cmd, timeoutMs = 5e3) {
|
|
24289
|
-
return new Promise((
|
|
24289
|
+
return new Promise((resolve18) => {
|
|
24290
24290
|
const child = (0, import_child_process.exec)(cmd, {
|
|
24291
24291
|
encoding: "utf-8",
|
|
24292
24292
|
timeout: timeoutMs,
|
|
24293
24293
|
...process.platform === "win32" ? { windowsHide: true } : {}
|
|
24294
24294
|
}, (err, stdout) => {
|
|
24295
24295
|
if (err || !stdout?.trim()) {
|
|
24296
|
-
|
|
24296
|
+
resolve18(null);
|
|
24297
24297
|
} else {
|
|
24298
|
-
|
|
24298
|
+
resolve18(stdout.trim());
|
|
24299
24299
|
}
|
|
24300
24300
|
});
|
|
24301
|
-
child.on("error", () =>
|
|
24301
|
+
child.on("error", () => resolve18(null));
|
|
24302
24302
|
});
|
|
24303
24303
|
}
|
|
24304
24304
|
async function detectCLIs(providerLoader, options) {
|
|
@@ -27542,7 +27542,7 @@ ${lastSnapshot}`;
|
|
|
27542
27542
|
`[${this.cliType}] Waiting for interactive prompt: status=${status} stableMs=${stableMs} recentOutputMs=${recentlyOutput} screen=${JSON.stringify(summarizeCliTraceText(screenText, 220)).slice(0, 260)}`
|
|
27543
27543
|
);
|
|
27544
27544
|
}
|
|
27545
|
-
await new Promise((
|
|
27545
|
+
await new Promise((resolve18) => setTimeout(resolve18, 50));
|
|
27546
27546
|
}
|
|
27547
27547
|
const finalScreenText = this.terminalScreen.getText() || "";
|
|
27548
27548
|
LOG2.warn(
|
|
@@ -28787,7 +28787,7 @@ ${lastSnapshot}`;
|
|
|
28787
28787
|
const deadline = Date.now() + 1e4;
|
|
28788
28788
|
while (this.startupParseGate && Date.now() < deadline) {
|
|
28789
28789
|
this.resolveStartupState("send_wait");
|
|
28790
|
-
await new Promise((
|
|
28790
|
+
await new Promise((resolve18) => setTimeout(resolve18, 50));
|
|
28791
28791
|
}
|
|
28792
28792
|
}
|
|
28793
28793
|
const parsedStatusBeforeSend = !allowInputDuringGeneration ? (() => {
|
|
@@ -28884,13 +28884,13 @@ ${lastSnapshot}`;
|
|
|
28884
28884
|
}
|
|
28885
28885
|
this.responseEpoch += 1;
|
|
28886
28886
|
this.responseSettleIgnoreUntil = Date.now() + submitDelayMs + this.timeouts.outputSettle + 250;
|
|
28887
|
-
await new Promise((
|
|
28887
|
+
await new Promise((resolve18, reject) => {
|
|
28888
28888
|
let resolved = false;
|
|
28889
28889
|
const completion = {
|
|
28890
28890
|
resolveOnce: () => {
|
|
28891
28891
|
if (resolved) return;
|
|
28892
28892
|
resolved = true;
|
|
28893
|
-
|
|
28893
|
+
resolve18();
|
|
28894
28894
|
},
|
|
28895
28895
|
rejectOnce: (error48) => {
|
|
28896
28896
|
if (resolved) return;
|
|
@@ -29048,17 +29048,17 @@ ${lastSnapshot}`;
|
|
|
29048
29048
|
}
|
|
29049
29049
|
}
|
|
29050
29050
|
waitForStopped(timeoutMs) {
|
|
29051
|
-
return new Promise((
|
|
29051
|
+
return new Promise((resolve18) => {
|
|
29052
29052
|
const startedAt = Date.now();
|
|
29053
29053
|
const timer = setInterval(() => {
|
|
29054
29054
|
if (!this.ptyProcess || this.currentStatus === "stopped") {
|
|
29055
29055
|
clearInterval(timer);
|
|
29056
|
-
|
|
29056
|
+
resolve18(true);
|
|
29057
29057
|
return;
|
|
29058
29058
|
}
|
|
29059
29059
|
if (Date.now() - startedAt >= timeoutMs) {
|
|
29060
29060
|
clearInterval(timer);
|
|
29061
|
-
|
|
29061
|
+
resolve18(false);
|
|
29062
29062
|
}
|
|
29063
29063
|
}, 100);
|
|
29064
29064
|
});
|
|
@@ -33114,7 +33114,7 @@ ${lastSnapshot}`;
|
|
|
33114
33114
|
* Returns multiple entries if multiple IDE windows are open on same port
|
|
33115
33115
|
*/
|
|
33116
33116
|
static listAllTargets(port) {
|
|
33117
|
-
return new Promise((
|
|
33117
|
+
return new Promise((resolve18) => {
|
|
33118
33118
|
const req = http.get(`http://127.0.0.1:${port}/json`, (res) => {
|
|
33119
33119
|
let data = "";
|
|
33120
33120
|
res.on("data", (chunk) => data += chunk.toString());
|
|
@@ -33130,16 +33130,16 @@ ${lastSnapshot}`;
|
|
|
33130
33130
|
(t) => !isNonMain(t.title || "") && t.url?.includes("workbench.html") && !t.url?.includes("agent")
|
|
33131
33131
|
);
|
|
33132
33132
|
const fallbackPages = pages.filter((t) => !isNonMain(t.title || ""));
|
|
33133
|
-
|
|
33133
|
+
resolve18(mainPages.length > 0 ? mainPages : fallbackPages);
|
|
33134
33134
|
} catch {
|
|
33135
|
-
|
|
33135
|
+
resolve18([]);
|
|
33136
33136
|
}
|
|
33137
33137
|
});
|
|
33138
33138
|
});
|
|
33139
|
-
req.on("error", () =>
|
|
33139
|
+
req.on("error", () => resolve18([]));
|
|
33140
33140
|
req.setTimeout(2e3, () => {
|
|
33141
33141
|
req.destroy();
|
|
33142
|
-
|
|
33142
|
+
resolve18([]);
|
|
33143
33143
|
});
|
|
33144
33144
|
});
|
|
33145
33145
|
}
|
|
@@ -33179,7 +33179,7 @@ ${lastSnapshot}`;
|
|
|
33179
33179
|
}
|
|
33180
33180
|
}
|
|
33181
33181
|
findTargetOnPort(port) {
|
|
33182
|
-
return new Promise((
|
|
33182
|
+
return new Promise((resolve18) => {
|
|
33183
33183
|
const req = http.get(`http://127.0.0.1:${port}/json`, (res) => {
|
|
33184
33184
|
let data = "";
|
|
33185
33185
|
res.on("data", (chunk) => data += chunk.toString());
|
|
@@ -33190,7 +33190,7 @@ ${lastSnapshot}`;
|
|
|
33190
33190
|
(t) => (t.type === "page" || t.type === "browser" || t.type === "Page") && t.webSocketDebuggerUrl
|
|
33191
33191
|
);
|
|
33192
33192
|
if (pages.length === 0) {
|
|
33193
|
-
|
|
33193
|
+
resolve18(targets.find((t) => t.webSocketDebuggerUrl) || null);
|
|
33194
33194
|
return;
|
|
33195
33195
|
}
|
|
33196
33196
|
const titleFilteredPages = pages.filter((t) => !this.isNonMainTitle(t.title || ""));
|
|
@@ -33209,25 +33209,25 @@ ${lastSnapshot}`;
|
|
|
33209
33209
|
this._targetId = selected.target.id;
|
|
33210
33210
|
}
|
|
33211
33211
|
this._pageTitle = selected.target.title || "";
|
|
33212
|
-
|
|
33212
|
+
resolve18(selected.target);
|
|
33213
33213
|
return;
|
|
33214
33214
|
}
|
|
33215
33215
|
if (previousTargetId) {
|
|
33216
33216
|
this.log(`[CDP] Target ${previousTargetId} not found in page list`);
|
|
33217
|
-
|
|
33217
|
+
resolve18(null);
|
|
33218
33218
|
return;
|
|
33219
33219
|
}
|
|
33220
33220
|
this._pageTitle = list[0]?.title || "";
|
|
33221
|
-
|
|
33221
|
+
resolve18(list[0]);
|
|
33222
33222
|
} catch {
|
|
33223
|
-
|
|
33223
|
+
resolve18(null);
|
|
33224
33224
|
}
|
|
33225
33225
|
});
|
|
33226
33226
|
});
|
|
33227
|
-
req.on("error", () =>
|
|
33227
|
+
req.on("error", () => resolve18(null));
|
|
33228
33228
|
req.setTimeout(2e3, () => {
|
|
33229
33229
|
req.destroy();
|
|
33230
|
-
|
|
33230
|
+
resolve18(null);
|
|
33231
33231
|
});
|
|
33232
33232
|
});
|
|
33233
33233
|
}
|
|
@@ -33238,7 +33238,7 @@ ${lastSnapshot}`;
|
|
|
33238
33238
|
this.extensionProviders = providers;
|
|
33239
33239
|
}
|
|
33240
33240
|
connectToTarget(wsUrl) {
|
|
33241
|
-
return new Promise((
|
|
33241
|
+
return new Promise((resolve18) => {
|
|
33242
33242
|
this.ws = new import_ws2.default(wsUrl);
|
|
33243
33243
|
this.ws.on("open", async () => {
|
|
33244
33244
|
this._connected = true;
|
|
@@ -33248,17 +33248,17 @@ ${lastSnapshot}`;
|
|
|
33248
33248
|
}
|
|
33249
33249
|
this.connectBrowserWs().catch(() => {
|
|
33250
33250
|
});
|
|
33251
|
-
|
|
33251
|
+
resolve18(true);
|
|
33252
33252
|
});
|
|
33253
33253
|
this.ws.on("message", (data) => {
|
|
33254
33254
|
try {
|
|
33255
33255
|
const msg = JSON.parse(data.toString());
|
|
33256
33256
|
if (msg.id && this.pending.has(msg.id)) {
|
|
33257
|
-
const { resolve:
|
|
33257
|
+
const { resolve: resolve19, reject } = this.pending.get(msg.id);
|
|
33258
33258
|
this.pending.delete(msg.id);
|
|
33259
33259
|
this.failureCount = 0;
|
|
33260
33260
|
if (msg.error) reject(new Error(msg.error.message));
|
|
33261
|
-
else
|
|
33261
|
+
else resolve19(msg.result);
|
|
33262
33262
|
} else if (msg.method === "Runtime.executionContextCreated") {
|
|
33263
33263
|
this.contexts.add(msg.params.context.id);
|
|
33264
33264
|
} else if (msg.method === "Runtime.executionContextDestroyed") {
|
|
@@ -33281,7 +33281,7 @@ ${lastSnapshot}`;
|
|
|
33281
33281
|
this.ws.on("error", (err) => {
|
|
33282
33282
|
this.log(`[CDP] WebSocket error: ${err.message}`);
|
|
33283
33283
|
this._connected = false;
|
|
33284
|
-
|
|
33284
|
+
resolve18(false);
|
|
33285
33285
|
});
|
|
33286
33286
|
});
|
|
33287
33287
|
}
|
|
@@ -33295,7 +33295,7 @@ ${lastSnapshot}`;
|
|
|
33295
33295
|
return;
|
|
33296
33296
|
}
|
|
33297
33297
|
this.log(`[CDP] Connecting browser WS for target discovery...`);
|
|
33298
|
-
await new Promise((
|
|
33298
|
+
await new Promise((resolve18, reject) => {
|
|
33299
33299
|
this.browserWs = new import_ws2.default(browserWsUrl);
|
|
33300
33300
|
this.browserWs.on("open", async () => {
|
|
33301
33301
|
this._browserConnected = true;
|
|
@@ -33305,16 +33305,16 @@ ${lastSnapshot}`;
|
|
|
33305
33305
|
} catch (e) {
|
|
33306
33306
|
this.log(`[CDP] setDiscoverTargets failed: ${e.message}`);
|
|
33307
33307
|
}
|
|
33308
|
-
|
|
33308
|
+
resolve18();
|
|
33309
33309
|
});
|
|
33310
33310
|
this.browserWs.on("message", (data) => {
|
|
33311
33311
|
try {
|
|
33312
33312
|
const msg = JSON.parse(data.toString());
|
|
33313
33313
|
if (msg.id && this.browserPending.has(msg.id)) {
|
|
33314
|
-
const { resolve:
|
|
33314
|
+
const { resolve: resolve19, reject: reject2 } = this.browserPending.get(msg.id);
|
|
33315
33315
|
this.browserPending.delete(msg.id);
|
|
33316
33316
|
if (msg.error) reject2(new Error(msg.error.message));
|
|
33317
|
-
else
|
|
33317
|
+
else resolve19(msg.result);
|
|
33318
33318
|
}
|
|
33319
33319
|
} catch {
|
|
33320
33320
|
}
|
|
@@ -33334,31 +33334,31 @@ ${lastSnapshot}`;
|
|
|
33334
33334
|
}
|
|
33335
33335
|
}
|
|
33336
33336
|
getBrowserWsUrl() {
|
|
33337
|
-
return new Promise((
|
|
33337
|
+
return new Promise((resolve18) => {
|
|
33338
33338
|
const req = http.get(`http://127.0.0.1:${this.port}/json/version`, (res) => {
|
|
33339
33339
|
let data = "";
|
|
33340
33340
|
res.on("data", (chunk) => data += chunk.toString());
|
|
33341
33341
|
res.on("end", () => {
|
|
33342
33342
|
try {
|
|
33343
33343
|
const info = JSON.parse(data);
|
|
33344
|
-
|
|
33344
|
+
resolve18(info.webSocketDebuggerUrl || null);
|
|
33345
33345
|
} catch {
|
|
33346
|
-
|
|
33346
|
+
resolve18(null);
|
|
33347
33347
|
}
|
|
33348
33348
|
});
|
|
33349
33349
|
});
|
|
33350
|
-
req.on("error", () =>
|
|
33350
|
+
req.on("error", () => resolve18(null));
|
|
33351
33351
|
req.setTimeout(3e3, () => {
|
|
33352
33352
|
req.destroy();
|
|
33353
|
-
|
|
33353
|
+
resolve18(null);
|
|
33354
33354
|
});
|
|
33355
33355
|
});
|
|
33356
33356
|
}
|
|
33357
33357
|
sendBrowser(method, params = {}, timeoutMs = 15e3) {
|
|
33358
|
-
return new Promise((
|
|
33358
|
+
return new Promise((resolve18, reject) => {
|
|
33359
33359
|
if (!this.browserWs || !this._browserConnected) return reject(new Error("Browser WS not connected"));
|
|
33360
33360
|
const id = this.browserMsgId++;
|
|
33361
|
-
this.browserPending.set(id, { resolve:
|
|
33361
|
+
this.browserPending.set(id, { resolve: resolve18, reject });
|
|
33362
33362
|
this.browserWs.send(JSON.stringify({ id, method, params }));
|
|
33363
33363
|
setTimeout(() => {
|
|
33364
33364
|
if (this.browserPending.has(id)) {
|
|
@@ -33398,11 +33398,11 @@ ${lastSnapshot}`;
|
|
|
33398
33398
|
}
|
|
33399
33399
|
// ─── CDP Protocol ────────────────────────────────────────
|
|
33400
33400
|
sendInternal(method, params = {}, timeoutMs = 15e3) {
|
|
33401
|
-
return new Promise((
|
|
33401
|
+
return new Promise((resolve18, reject) => {
|
|
33402
33402
|
if (!this.ws || !this._connected) return reject(new Error("CDP not connected"));
|
|
33403
33403
|
if (this.ws.readyState !== import_ws2.default.OPEN) return reject(new Error("WebSocket not open"));
|
|
33404
33404
|
const id = this.msgId++;
|
|
33405
|
-
this.pending.set(id, { resolve:
|
|
33405
|
+
this.pending.set(id, { resolve: resolve18, reject });
|
|
33406
33406
|
this.ws.send(JSON.stringify({ id, method, params }));
|
|
33407
33407
|
setTimeout(() => {
|
|
33408
33408
|
if (this.pending.has(id)) {
|
|
@@ -33651,7 +33651,7 @@ ${lastSnapshot}`;
|
|
|
33651
33651
|
const browserWs = this.browserWs;
|
|
33652
33652
|
let msgId = this.browserMsgId;
|
|
33653
33653
|
const sendWs = (method, params = {}, sessionId) => {
|
|
33654
|
-
return new Promise((
|
|
33654
|
+
return new Promise((resolve18, reject) => {
|
|
33655
33655
|
const mid = msgId++;
|
|
33656
33656
|
this.browserMsgId = msgId;
|
|
33657
33657
|
const handler = (raw) => {
|
|
@@ -33660,7 +33660,7 @@ ${lastSnapshot}`;
|
|
|
33660
33660
|
if (msg.id === mid) {
|
|
33661
33661
|
browserWs.removeListener("message", handler);
|
|
33662
33662
|
if (msg.error) reject(new Error(msg.error.message || JSON.stringify(msg.error)));
|
|
33663
|
-
else
|
|
33663
|
+
else resolve18(msg.result);
|
|
33664
33664
|
}
|
|
33665
33665
|
} catch {
|
|
33666
33666
|
}
|
|
@@ -33861,14 +33861,14 @@ ${lastSnapshot}`;
|
|
|
33861
33861
|
if (!ws || ws.readyState !== import_ws2.default.OPEN) {
|
|
33862
33862
|
throw new Error("CDP not connected");
|
|
33863
33863
|
}
|
|
33864
|
-
return new Promise((
|
|
33864
|
+
return new Promise((resolve18, reject) => {
|
|
33865
33865
|
const id = getNextId();
|
|
33866
33866
|
pendingMap.set(id, {
|
|
33867
33867
|
resolve: (result) => {
|
|
33868
33868
|
if (result?.result?.subtype === "error") {
|
|
33869
33869
|
reject(new Error(result.result.description));
|
|
33870
33870
|
} else {
|
|
33871
|
-
|
|
33871
|
+
resolve18(result?.result?.value);
|
|
33872
33872
|
}
|
|
33873
33873
|
},
|
|
33874
33874
|
reject
|
|
@@ -33900,10 +33900,10 @@ ${lastSnapshot}`;
|
|
|
33900
33900
|
throw new Error("CDP not connected");
|
|
33901
33901
|
}
|
|
33902
33902
|
const sendViaSession = (method, params = {}) => {
|
|
33903
|
-
return new Promise((
|
|
33903
|
+
return new Promise((resolve18, reject) => {
|
|
33904
33904
|
const pendingMap = this._browserConnected ? this.browserPending : this.pending;
|
|
33905
33905
|
const id = this._browserConnected ? this.browserMsgId++ : this.msgId++;
|
|
33906
|
-
pendingMap.set(id, { resolve:
|
|
33906
|
+
pendingMap.set(id, { resolve: resolve18, reject });
|
|
33907
33907
|
ws.send(JSON.stringify({ id, sessionId, method, params }));
|
|
33908
33908
|
setTimeout(() => {
|
|
33909
33909
|
if (pendingMap.has(id)) {
|
|
@@ -38947,7 +38947,7 @@ ${effect.notification.body || ""}`.trim();
|
|
|
38947
38947
|
return normalizeInputEnvelope(args?.input ? { input: args.input } : args);
|
|
38948
38948
|
}
|
|
38949
38949
|
function sleep(ms) {
|
|
38950
|
-
return new Promise((
|
|
38950
|
+
return new Promise((resolve18) => setTimeout(resolve18, ms));
|
|
38951
38951
|
}
|
|
38952
38952
|
async function waitOnceForFreshHermesCliStart(adapter, log) {
|
|
38953
38953
|
if (adapter.cliType !== "hermes-cli") return;
|
|
@@ -39187,6 +39187,39 @@ ${effect.notification.body || ""}`.trim();
|
|
|
39187
39187
|
return historySessionId === targetSessionId || instanceId === targetSessionId;
|
|
39188
39188
|
});
|
|
39189
39189
|
}
|
|
39190
|
+
function normalizeComparableWorkspace(value) {
|
|
39191
|
+
const text = typeof value === "string" ? value.trim() : "";
|
|
39192
|
+
if (!text) return "";
|
|
39193
|
+
return path12.resolve(text);
|
|
39194
|
+
}
|
|
39195
|
+
function isCurrentRuntimePtySafelyAttributed(args) {
|
|
39196
|
+
if (args.adapter.cliType !== "codex-cli") return false;
|
|
39197
|
+
if (!Array.isArray(args.ptyMessages) || args.ptyMessages.length === 0) return false;
|
|
39198
|
+
const targetSessionId = typeof args.readChatArgs?.targetSessionId === "string" ? args.readChatArgs.targetSessionId.trim() : "";
|
|
39199
|
+
const currentSession = args.helpers.currentSession;
|
|
39200
|
+
const currentSessionId = typeof currentSession?.sessionId === "string" ? currentSession.sessionId.trim() : "";
|
|
39201
|
+
if (!targetSessionId || !currentSessionId || targetSessionId !== currentSessionId) return false;
|
|
39202
|
+
const runtimeMeta = typeof args.adapter.getRuntimeMetadata === "function" ? args.adapter.getRuntimeMetadata() : null;
|
|
39203
|
+
const runtimeId = typeof runtimeMeta?.runtimeId === "string" ? runtimeMeta.runtimeId.trim() : "";
|
|
39204
|
+
if (!runtimeId || runtimeId !== targetSessionId) return false;
|
|
39205
|
+
const surfaceKind = typeof runtimeMeta?.surfaceKind === "string" ? runtimeMeta.surfaceKind : "";
|
|
39206
|
+
if (surfaceKind === "inactive_record" || surfaceKind === "recovery_snapshot") return false;
|
|
39207
|
+
const sessionWorkspace = normalizeComparableWorkspace(args.sessionWorkspace);
|
|
39208
|
+
const adapterWorkspace = normalizeComparableWorkspace(args.adapter.workingDir);
|
|
39209
|
+
if (!sessionWorkspace || !adapterWorkspace || sessionWorkspace !== adapterWorkspace) return false;
|
|
39210
|
+
const intendedWorkspace = normalizeComparableWorkspace(args.intendedWorkspace);
|
|
39211
|
+
if (intendedWorkspace && intendedWorkspace !== sessionWorkspace) return false;
|
|
39212
|
+
const registryEntry = args.helpers.ctx?.sessionRegistry?.get?.(targetSessionId);
|
|
39213
|
+
const registryInstanceKey = typeof registryEntry?.adapterKey === "string" && registryEntry.adapterKey.trim() ? registryEntry.adapterKey.trim() : typeof registryEntry?.instanceKey === "string" && registryEntry.instanceKey.trim() ? registryEntry.instanceKey.trim() : "";
|
|
39214
|
+
if (registryInstanceKey) {
|
|
39215
|
+
const targetInstance = args.helpers.ctx?.instanceManager?.getInstance?.(registryInstanceKey);
|
|
39216
|
+
if (targetInstance) {
|
|
39217
|
+
const instanceType = typeof targetInstance.type === "string" ? targetInstance.type : "";
|
|
39218
|
+
if (instanceType && instanceType !== args.adapter.cliType) return false;
|
|
39219
|
+
}
|
|
39220
|
+
}
|
|
39221
|
+
return true;
|
|
39222
|
+
}
|
|
39190
39223
|
function supportsCliNativeTranscript(providerType, provider) {
|
|
39191
39224
|
if (CLI_NATIVE_TRANSCRIPT_PROVIDERS.has(providerType)) return true;
|
|
39192
39225
|
return provider?.category === "cli" && isNativeSourceCanonicalHistory(provider?.canonicalHistory);
|
|
@@ -39804,7 +39837,7 @@ ${effect.notification.body || ""}`.trim();
|
|
|
39804
39837
|
async function getStableExtensionBaseline(h) {
|
|
39805
39838
|
const first = await readExtensionChatState(h);
|
|
39806
39839
|
if (getStateMessageCount(first) > 0 || getStateLastSignature(first)) return first;
|
|
39807
|
-
await new Promise((
|
|
39840
|
+
await new Promise((resolve18) => setTimeout(resolve18, 150));
|
|
39808
39841
|
const second = await readExtensionChatState(h);
|
|
39809
39842
|
return getStateMessageCount(second) >= getStateMessageCount(first) ? second : first;
|
|
39810
39843
|
}
|
|
@@ -39812,7 +39845,7 @@ ${effect.notification.body || ""}`.trim();
|
|
|
39812
39845
|
const beforeCount = getStateMessageCount(before);
|
|
39813
39846
|
const beforeSignature = getStateLastSignature(before);
|
|
39814
39847
|
for (let attempt = 0; attempt < 12; attempt += 1) {
|
|
39815
|
-
await new Promise((
|
|
39848
|
+
await new Promise((resolve18) => setTimeout(resolve18, 250));
|
|
39816
39849
|
const state = await readExtensionChatState(h);
|
|
39817
39850
|
if (state?.status === "waiting_approval") return true;
|
|
39818
39851
|
const afterCount = getStateMessageCount(state);
|
|
@@ -40035,8 +40068,16 @@ ${effect.notification.body || ""}`.trim();
|
|
|
40035
40068
|
freshEnough
|
|
40036
40069
|
});
|
|
40037
40070
|
const unsafeNativeFallback = adapter.cliType === "codex-cli" && isUnsafeNativeTranscriptFallback(fallbackReason);
|
|
40038
|
-
const
|
|
40039
|
-
|
|
40071
|
+
const safeCurrentRuntimePtyMessages = unsafeNativeFallback && isCurrentRuntimePtySafelyAttributed({
|
|
40072
|
+
adapter,
|
|
40073
|
+
helpers: h,
|
|
40074
|
+
readChatArgs: args,
|
|
40075
|
+
sessionWorkspace,
|
|
40076
|
+
intendedWorkspace,
|
|
40077
|
+
ptyMessages: returnedMessages
|
|
40078
|
+
});
|
|
40079
|
+
const safeRuntimeAckMessages = unsafeNativeFallback && !safeCurrentRuntimePtyMessages ? selectRuntimeInputAckMessages(returnedMessages) : [];
|
|
40080
|
+
const exactRuntimeMirrorMessages = unsafeNativeFallback && !safeCurrentRuntimePtyMessages && safeRuntimeAckMessages.length === 0 ? readExactRuntimeMirrorMessages({
|
|
40040
40081
|
providerType,
|
|
40041
40082
|
targetSessionId: typeof args?.targetSessionId === "string" ? args.targetSessionId : void 0,
|
|
40042
40083
|
currentSessionId: typeof h.currentSession?.sessionId === "string" ? h.currentSession.sessionId : void 0,
|
|
@@ -40045,10 +40086,17 @@ ${effect.notification.body || ""}`.trim();
|
|
|
40045
40086
|
}) : [];
|
|
40046
40087
|
const safeDaemonMessages = safeRuntimeAckMessages.length > 0 ? safeRuntimeAckMessages : exactRuntimeMirrorMessages;
|
|
40047
40088
|
if (unsafeNativeFallback) {
|
|
40048
|
-
|
|
40049
|
-
|
|
40050
|
-
|
|
40051
|
-
|
|
40089
|
+
if (safeCurrentRuntimePtyMessages) {
|
|
40090
|
+
selectedMessages = returnedMessages;
|
|
40091
|
+
selectedTranscriptAuthority = "daemon";
|
|
40092
|
+
selectedCoverage = coverage || "current-turn";
|
|
40093
|
+
selectedStatus = returnedStatus;
|
|
40094
|
+
} else {
|
|
40095
|
+
selectedMessages = safeDaemonMessages;
|
|
40096
|
+
selectedTranscriptAuthority = safeDaemonMessages.length > 0 ? "daemon" : void 0;
|
|
40097
|
+
selectedCoverage = safeDaemonMessages.length > 0 ? "tail" : void 0;
|
|
40098
|
+
selectedStatus = coerceUnsafeNativeFallbackStatus(returnedStatus, activeModal);
|
|
40099
|
+
}
|
|
40052
40100
|
}
|
|
40053
40101
|
messageSource = buildCliMessageSourceProvenance({
|
|
40054
40102
|
selected: "pty-parser",
|
|
@@ -40066,11 +40114,16 @@ ${effect.notification.body || ""}`.trim();
|
|
|
40066
40114
|
unavailableReason,
|
|
40067
40115
|
nativeMessages,
|
|
40068
40116
|
ptyMessages: returnedMessages,
|
|
40069
|
-
returnedMessages: unsafeNativeFallback ? safeDaemonMessages : returnedMessages,
|
|
40117
|
+
returnedMessages: unsafeNativeFallback && !safeCurrentRuntimePtyMessages ? safeDaemonMessages : returnedMessages,
|
|
40070
40118
|
safeMapping,
|
|
40071
40119
|
freshEnough,
|
|
40072
|
-
ptyStatusApprovalOnly: unsafeNativeFallback
|
|
40120
|
+
ptyStatusApprovalOnly: unsafeNativeFallback && !safeCurrentRuntimePtyMessages
|
|
40073
40121
|
});
|
|
40122
|
+
if (safeCurrentRuntimePtyMessages) {
|
|
40123
|
+
messageSource.selectedDaemonSource = "current-runtime-pty";
|
|
40124
|
+
messageSource.transcriptAuthority = "daemon";
|
|
40125
|
+
messageSource.runtimeMappingSafe = true;
|
|
40126
|
+
}
|
|
40074
40127
|
if (unsafeNativeFallback && exactRuntimeMirrorMessages.length > 0) {
|
|
40075
40128
|
messageSource.selectedDaemonSource = "exact-runtime-mirror";
|
|
40076
40129
|
messageSource.transcriptAuthority = "daemon";
|
|
@@ -41743,7 +41796,7 @@ ${effect.notification.body || ""}`.trim();
|
|
|
41743
41796
|
const enterCount = cliCommand.enterCount || 1;
|
|
41744
41797
|
await adapter.writeRaw(cliCommand.text + "\r");
|
|
41745
41798
|
for (let i = 1; i < enterCount; i += 1) {
|
|
41746
|
-
await new Promise((
|
|
41799
|
+
await new Promise((resolve18) => setTimeout(resolve18, 50));
|
|
41747
41800
|
await adapter.writeRaw("\r");
|
|
41748
41801
|
}
|
|
41749
41802
|
}
|
|
@@ -42428,7 +42481,7 @@ ${effect.notification.body || ""}`.trim();
|
|
|
42428
42481
|
try {
|
|
42429
42482
|
const http3 = await import("http");
|
|
42430
42483
|
const postData = JSON.stringify(body);
|
|
42431
|
-
const result = await new Promise((
|
|
42484
|
+
const result = await new Promise((resolve18, reject) => {
|
|
42432
42485
|
const req = http3.request({
|
|
42433
42486
|
hostname: "127.0.0.1",
|
|
42434
42487
|
port: 19280,
|
|
@@ -42440,9 +42493,9 @@ ${effect.notification.body || ""}`.trim();
|
|
|
42440
42493
|
res.on("data", (chunk) => data += chunk);
|
|
42441
42494
|
res.on("end", () => {
|
|
42442
42495
|
try {
|
|
42443
|
-
|
|
42496
|
+
resolve18(JSON.parse(data));
|
|
42444
42497
|
} catch {
|
|
42445
|
-
|
|
42498
|
+
resolve18({ raw: data });
|
|
42446
42499
|
}
|
|
42447
42500
|
});
|
|
42448
42501
|
});
|
|
@@ -42460,15 +42513,15 @@ ${effect.notification.body || ""}`.trim();
|
|
|
42460
42513
|
if (!providerType) return { success: false, error: "providerType required" };
|
|
42461
42514
|
try {
|
|
42462
42515
|
const http3 = await import("http");
|
|
42463
|
-
const result = await new Promise((
|
|
42516
|
+
const result = await new Promise((resolve18, reject) => {
|
|
42464
42517
|
http3.get(`http://127.0.0.1:19280/api/providers/${providerType}/${endpoint}`, (res) => {
|
|
42465
42518
|
let data = "";
|
|
42466
42519
|
res.on("data", (chunk) => data += chunk);
|
|
42467
42520
|
res.on("end", () => {
|
|
42468
42521
|
try {
|
|
42469
|
-
|
|
42522
|
+
resolve18(JSON.parse(data));
|
|
42470
42523
|
} catch {
|
|
42471
|
-
|
|
42524
|
+
resolve18({ raw: data });
|
|
42472
42525
|
}
|
|
42473
42526
|
});
|
|
42474
42527
|
}).on("error", reject);
|
|
@@ -42482,7 +42535,7 @@ ${effect.notification.body || ""}`.trim();
|
|
|
42482
42535
|
try {
|
|
42483
42536
|
const http3 = await import("http");
|
|
42484
42537
|
const postData = JSON.stringify(args || {});
|
|
42485
|
-
const result = await new Promise((
|
|
42538
|
+
const result = await new Promise((resolve18, reject) => {
|
|
42486
42539
|
const req = http3.request({
|
|
42487
42540
|
hostname: "127.0.0.1",
|
|
42488
42541
|
port: 19280,
|
|
@@ -42494,9 +42547,9 @@ ${effect.notification.body || ""}`.trim();
|
|
|
42494
42547
|
res.on("data", (chunk) => data += chunk);
|
|
42495
42548
|
res.on("end", () => {
|
|
42496
42549
|
try {
|
|
42497
|
-
|
|
42550
|
+
resolve18(JSON.parse(data));
|
|
42498
42551
|
} catch {
|
|
42499
|
-
|
|
42552
|
+
resolve18({ raw: data });
|
|
42500
42553
|
}
|
|
42501
42554
|
});
|
|
42502
42555
|
});
|
|
@@ -42732,7 +42785,7 @@ ${effect.notification.body || ""}`.trim();
|
|
|
42732
42785
|
if (status === "stopped") {
|
|
42733
42786
|
throw new Error("CLI runtime stopped before it became ready");
|
|
42734
42787
|
}
|
|
42735
|
-
await new Promise((
|
|
42788
|
+
await new Promise((resolve18) => setTimeout(resolve18, pollMs));
|
|
42736
42789
|
}
|
|
42737
42790
|
throw new Error(`CLI runtime did not become ready within ${timeoutMs}ms`);
|
|
42738
42791
|
}
|
|
@@ -43130,7 +43183,7 @@ ${effect.notification.body || ""}`.trim();
|
|
|
43130
43183
|
const enterCount = cliCommand.enterCount || 1;
|
|
43131
43184
|
await this.adapter.writeRaw(cliCommand.text + "\r");
|
|
43132
43185
|
for (let i = 1; i < enterCount; i += 1) {
|
|
43133
|
-
await new Promise((
|
|
43186
|
+
await new Promise((resolve18) => setTimeout(resolve18, 50));
|
|
43134
43187
|
await this.adapter.writeRaw("\r");
|
|
43135
43188
|
}
|
|
43136
43189
|
}
|
|
@@ -44565,13 +44618,13 @@ ${effect.notification.body || ""}`.trim();
|
|
|
44565
44618
|
}
|
|
44566
44619
|
this.currentStatus = "waiting_approval";
|
|
44567
44620
|
this.detectStatusTransition();
|
|
44568
|
-
const approved = await new Promise((
|
|
44569
|
-
this.permissionResolvers.push(
|
|
44621
|
+
const approved = await new Promise((resolve18) => {
|
|
44622
|
+
this.permissionResolvers.push(resolve18);
|
|
44570
44623
|
setTimeout(() => {
|
|
44571
|
-
const idx = this.permissionResolvers.indexOf(
|
|
44624
|
+
const idx = this.permissionResolvers.indexOf(resolve18);
|
|
44572
44625
|
if (idx >= 0) {
|
|
44573
44626
|
this.permissionResolvers.splice(idx, 1);
|
|
44574
|
-
|
|
44627
|
+
resolve18(false);
|
|
44575
44628
|
}
|
|
44576
44629
|
}, 3e5);
|
|
44577
44630
|
});
|
|
@@ -45274,7 +45327,7 @@ ${rawInput}` : rawInput;
|
|
|
45274
45327
|
} catch {
|
|
45275
45328
|
return false;
|
|
45276
45329
|
}
|
|
45277
|
-
await new Promise((
|
|
45330
|
+
await new Promise((resolve18) => setTimeout(resolve18, ZERO_MESSAGE_STARTING_SEND_WAIT_MS));
|
|
45278
45331
|
try {
|
|
45279
45332
|
return hasZeroMessageStartingLaunch(adapter);
|
|
45280
45333
|
} catch {
|
|
@@ -47366,7 +47419,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
47366
47419
|
return { updated: false };
|
|
47367
47420
|
}
|
|
47368
47421
|
try {
|
|
47369
|
-
const etag = await new Promise((
|
|
47422
|
+
const etag = await new Promise((resolve18, reject) => {
|
|
47370
47423
|
const options = {
|
|
47371
47424
|
method: "HEAD",
|
|
47372
47425
|
hostname: "github.com",
|
|
@@ -47384,7 +47437,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
47384
47437
|
headers: { "User-Agent": "adhdev-launcher" },
|
|
47385
47438
|
timeout: 1e4
|
|
47386
47439
|
}, (res2) => {
|
|
47387
|
-
|
|
47440
|
+
resolve18(res2.headers.etag || res2.headers["last-modified"] || "");
|
|
47388
47441
|
});
|
|
47389
47442
|
req2.on("error", reject);
|
|
47390
47443
|
req2.on("timeout", () => {
|
|
@@ -47393,7 +47446,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
47393
47446
|
});
|
|
47394
47447
|
req2.end();
|
|
47395
47448
|
} else {
|
|
47396
|
-
|
|
47449
|
+
resolve18(res.headers.etag || res.headers["last-modified"] || "");
|
|
47397
47450
|
}
|
|
47398
47451
|
});
|
|
47399
47452
|
req.on("error", reject);
|
|
@@ -47457,7 +47510,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
47457
47510
|
downloadFile(url2, destPath) {
|
|
47458
47511
|
const https = require("https");
|
|
47459
47512
|
const http3 = require("http");
|
|
47460
|
-
return new Promise((
|
|
47513
|
+
return new Promise((resolve18, reject) => {
|
|
47461
47514
|
const doRequest = (reqUrl, redirectCount = 0) => {
|
|
47462
47515
|
if (redirectCount > 5) {
|
|
47463
47516
|
reject(new Error("Too many redirects"));
|
|
@@ -47477,7 +47530,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
47477
47530
|
res.pipe(ws);
|
|
47478
47531
|
ws.on("finish", () => {
|
|
47479
47532
|
ws.close();
|
|
47480
|
-
|
|
47533
|
+
resolve18();
|
|
47481
47534
|
});
|
|
47482
47535
|
ws.on("error", reject);
|
|
47483
47536
|
});
|
|
@@ -47976,10 +48029,10 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
47976
48029
|
return pids;
|
|
47977
48030
|
}
|
|
47978
48031
|
async function execQuiet(command, options = {}) {
|
|
47979
|
-
return new Promise((
|
|
48032
|
+
return new Promise((resolve18) => {
|
|
47980
48033
|
(0, import_child_process6.exec)(command, options, (error48, stdout) => {
|
|
47981
|
-
if (error48) return
|
|
47982
|
-
|
|
48034
|
+
if (error48) return resolve18("");
|
|
48035
|
+
resolve18(stdout.toString());
|
|
47983
48036
|
});
|
|
47984
48037
|
});
|
|
47985
48038
|
}
|
|
@@ -48060,17 +48113,17 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48060
48113
|
throw new Error("No free port found");
|
|
48061
48114
|
}
|
|
48062
48115
|
function checkPortFree(port) {
|
|
48063
|
-
return new Promise((
|
|
48116
|
+
return new Promise((resolve18) => {
|
|
48064
48117
|
const server = net3.createServer();
|
|
48065
48118
|
server.unref();
|
|
48066
|
-
server.on("error", () =>
|
|
48119
|
+
server.on("error", () => resolve18(false));
|
|
48067
48120
|
server.listen(port, "127.0.0.1", () => {
|
|
48068
|
-
server.close(() =>
|
|
48121
|
+
server.close(() => resolve18(true));
|
|
48069
48122
|
});
|
|
48070
48123
|
});
|
|
48071
48124
|
}
|
|
48072
48125
|
async function isCdpActive(port) {
|
|
48073
|
-
return new Promise((
|
|
48126
|
+
return new Promise((resolve18) => {
|
|
48074
48127
|
const req = require("http").get(`http://127.0.0.1:${port}/json/version`, {
|
|
48075
48128
|
timeout: 2e3
|
|
48076
48129
|
}, (res) => {
|
|
@@ -48079,16 +48132,16 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
48079
48132
|
res.on("end", () => {
|
|
48080
48133
|
try {
|
|
48081
48134
|
const info = JSON.parse(data);
|
|
48082
|
-
|
|
48135
|
+
resolve18(!!info["WebKit-Version"] || !!info["Browser"]);
|
|
48083
48136
|
} catch {
|
|
48084
|
-
|
|
48137
|
+
resolve18(false);
|
|
48085
48138
|
}
|
|
48086
48139
|
});
|
|
48087
48140
|
});
|
|
48088
|
-
req.on("error", () =>
|
|
48141
|
+
req.on("error", () => resolve18(false));
|
|
48089
48142
|
req.on("timeout", () => {
|
|
48090
48143
|
req.destroy();
|
|
48091
|
-
|
|
48144
|
+
resolve18(false);
|
|
48092
48145
|
});
|
|
48093
48146
|
});
|
|
48094
48147
|
}
|
|
@@ -49322,7 +49375,7 @@ ${(0, import_node_path.resolve)(workspace || os17.tmpdir())}`;
|
|
|
49322
49375
|
while (Date.now() - start < timeoutMs) {
|
|
49323
49376
|
try {
|
|
49324
49377
|
process.kill(pid, 0);
|
|
49325
|
-
await new Promise((
|
|
49378
|
+
await new Promise((resolve18) => setTimeout(resolve18, 250));
|
|
49326
49379
|
} catch {
|
|
49327
49380
|
return;
|
|
49328
49381
|
}
|
|
@@ -49433,7 +49486,7 @@ ${(0, import_node_path.resolve)(workspace || os17.tmpdir())}`;
|
|
|
49433
49486
|
appendUpgradeLog(installOutput.trim());
|
|
49434
49487
|
}
|
|
49435
49488
|
if (process.platform === "win32") {
|
|
49436
|
-
await new Promise((
|
|
49489
|
+
await new Promise((resolve18) => setTimeout(resolve18, 500));
|
|
49437
49490
|
cleanupStaleGlobalInstallDirs(payload.packageName, installCommand.surface);
|
|
49438
49491
|
appendUpgradeLog("Post-install staging cleanup complete");
|
|
49439
49492
|
}
|
|
@@ -53629,7 +53682,7 @@ ${e?.stderr || ""}`
|
|
|
53629
53682
|
const setupPromise = finishWorktreeSetup();
|
|
53630
53683
|
const setupResult = await Promise.race([
|
|
53631
53684
|
setupPromise.then((value) => ({ completed: true, value })),
|
|
53632
|
-
new Promise((
|
|
53685
|
+
new Promise((resolve18) => setTimeout(() => resolve18({ completed: false }), setupWaitMs))
|
|
53633
53686
|
]);
|
|
53634
53687
|
if (!setupResult.completed) {
|
|
53635
53688
|
setupPromise.catch((error48) => {
|
|
@@ -55015,7 +55068,7 @@ ${block2}`);
|
|
|
55015
55068
|
const beforeCount = this.messageCount(before);
|
|
55016
55069
|
const beforeSignature = this.lastMessageSignature(before);
|
|
55017
55070
|
for (let attempt = 0; attempt < 12; attempt += 1) {
|
|
55018
|
-
await new Promise((
|
|
55071
|
+
await new Promise((resolve18) => setTimeout(resolve18, 250));
|
|
55019
55072
|
let state;
|
|
55020
55073
|
try {
|
|
55021
55074
|
state = await this.readChat(evaluate);
|
|
@@ -55037,7 +55090,7 @@ ${block2}`);
|
|
|
55037
55090
|
if (this.messageCount(first) > 0 || this.lastMessageSignature(first)) {
|
|
55038
55091
|
return first;
|
|
55039
55092
|
}
|
|
55040
|
-
await new Promise((
|
|
55093
|
+
await new Promise((resolve18) => setTimeout(resolve18, 150));
|
|
55041
55094
|
const second = await this.readChat(evaluate);
|
|
55042
55095
|
return this.messageCount(second) >= this.messageCount(first) ? second : first;
|
|
55043
55096
|
}
|
|
@@ -55188,7 +55241,7 @@ ${block2}`);
|
|
|
55188
55241
|
if (typeof data.error === "string" && data.error.trim()) return false;
|
|
55189
55242
|
}
|
|
55190
55243
|
for (let attempt = 0; attempt < 6; attempt += 1) {
|
|
55191
|
-
await new Promise((
|
|
55244
|
+
await new Promise((resolve18) => setTimeout(resolve18, 250));
|
|
55192
55245
|
const state = await this.readChat(evaluate);
|
|
55193
55246
|
const title = this.getStateTitle(state);
|
|
55194
55247
|
if (this.titlesMatch(title, sessionId)) return true;
|
|
@@ -56106,13 +56159,13 @@ ${block2}`);
|
|
|
56106
56159
|
}
|
|
56107
56160
|
};
|
|
56108
56161
|
async function runCommand(cmd, timeout = 1e4) {
|
|
56109
|
-
return new Promise((
|
|
56162
|
+
return new Promise((resolve18) => {
|
|
56110
56163
|
(0, import_child_process9.exec)(cmd, {
|
|
56111
56164
|
encoding: "utf-8",
|
|
56112
56165
|
timeout
|
|
56113
56166
|
}, (error48, stdout) => {
|
|
56114
|
-
if (error48) return
|
|
56115
|
-
|
|
56167
|
+
if (error48) return resolve18(null);
|
|
56168
|
+
resolve18(stdout.trim());
|
|
56116
56169
|
});
|
|
56117
56170
|
});
|
|
56118
56171
|
}
|
|
@@ -57791,7 +57844,7 @@ async (params) => {
|
|
|
57791
57844
|
return { target, instance, adapter };
|
|
57792
57845
|
}
|
|
57793
57846
|
function sleep2(ms) {
|
|
57794
|
-
return new Promise((
|
|
57847
|
+
return new Promise((resolve18) => setTimeout(resolve18, ms));
|
|
57795
57848
|
}
|
|
57796
57849
|
async function waitForCliReady(ctx, type, instanceId, timeoutMs) {
|
|
57797
57850
|
const startedAt = Date.now();
|
|
@@ -60042,15 +60095,15 @@ data: ${JSON.stringify(msg.data)}
|
|
|
60042
60095
|
this.json(res, 500, { error: e.message });
|
|
60043
60096
|
}
|
|
60044
60097
|
});
|
|
60045
|
-
return new Promise((
|
|
60098
|
+
return new Promise((resolve18, reject) => {
|
|
60046
60099
|
this.server.listen(port, "127.0.0.1", () => {
|
|
60047
60100
|
this.log(`Dev server listening on http://127.0.0.1:${port}`);
|
|
60048
|
-
|
|
60101
|
+
resolve18();
|
|
60049
60102
|
});
|
|
60050
60103
|
this.server.on("error", (e) => {
|
|
60051
60104
|
if (e.code === "EADDRINUSE") {
|
|
60052
60105
|
this.log(`Port ${port} in use, skipping dev server`);
|
|
60053
|
-
|
|
60106
|
+
resolve18();
|
|
60054
60107
|
} else {
|
|
60055
60108
|
reject(e);
|
|
60056
60109
|
}
|
|
@@ -60132,20 +60185,20 @@ data: ${JSON.stringify(msg.data)}
|
|
|
60132
60185
|
child.stderr?.on("data", (d) => {
|
|
60133
60186
|
stderr += d.toString().slice(0, 2e3);
|
|
60134
60187
|
});
|
|
60135
|
-
await new Promise((
|
|
60188
|
+
await new Promise((resolve18) => {
|
|
60136
60189
|
const timer = setTimeout(() => {
|
|
60137
60190
|
child.kill();
|
|
60138
|
-
|
|
60191
|
+
resolve18();
|
|
60139
60192
|
}, 3e3);
|
|
60140
60193
|
child.on("exit", () => {
|
|
60141
60194
|
clearTimeout(timer);
|
|
60142
|
-
|
|
60195
|
+
resolve18();
|
|
60143
60196
|
});
|
|
60144
60197
|
child.stdout?.once("data", () => {
|
|
60145
60198
|
setTimeout(() => {
|
|
60146
60199
|
child.kill();
|
|
60147
60200
|
clearTimeout(timer);
|
|
60148
|
-
|
|
60201
|
+
resolve18();
|
|
60149
60202
|
}, 500);
|
|
60150
60203
|
});
|
|
60151
60204
|
});
|
|
@@ -60648,14 +60701,14 @@ data: ${JSON.stringify(msg.data)}
|
|
|
60648
60701
|
child.stderr?.on("data", (d) => {
|
|
60649
60702
|
stderr += d.toString();
|
|
60650
60703
|
});
|
|
60651
|
-
await new Promise((
|
|
60704
|
+
await new Promise((resolve18) => {
|
|
60652
60705
|
const timer = setTimeout(() => {
|
|
60653
60706
|
child.kill();
|
|
60654
|
-
|
|
60707
|
+
resolve18();
|
|
60655
60708
|
}, timeout);
|
|
60656
60709
|
child.on("exit", () => {
|
|
60657
60710
|
clearTimeout(timer);
|
|
60658
|
-
|
|
60711
|
+
resolve18();
|
|
60659
60712
|
});
|
|
60660
60713
|
});
|
|
60661
60714
|
const elapsed = Date.now() - start;
|
|
@@ -61325,14 +61378,14 @@ data: ${JSON.stringify(msg.data)}
|
|
|
61325
61378
|
res.end(JSON.stringify(data, null, 2));
|
|
61326
61379
|
}
|
|
61327
61380
|
async readBody(req) {
|
|
61328
|
-
return new Promise((
|
|
61381
|
+
return new Promise((resolve18) => {
|
|
61329
61382
|
let body = "";
|
|
61330
61383
|
req.on("data", (chunk) => body += chunk);
|
|
61331
61384
|
req.on("end", () => {
|
|
61332
61385
|
try {
|
|
61333
|
-
|
|
61386
|
+
resolve18(JSON.parse(body));
|
|
61334
61387
|
} catch {
|
|
61335
|
-
|
|
61388
|
+
resolve18({});
|
|
61336
61389
|
}
|
|
61337
61390
|
});
|
|
61338
61391
|
});
|
|
@@ -61862,7 +61915,7 @@ data: ${JSON.stringify(msg.data)}
|
|
|
61862
61915
|
const deadline = Date.now() + timeoutMs;
|
|
61863
61916
|
while (Date.now() < deadline) {
|
|
61864
61917
|
if (await canConnect(endpoint, requiredRequestTypes)) return;
|
|
61865
|
-
await new Promise((
|
|
61918
|
+
await new Promise((resolve18) => setTimeout(resolve18, STARTUP_POLL_MS));
|
|
61866
61919
|
}
|
|
61867
61920
|
throw new Error(`Session host did not become ready within ${timeoutMs}ms`);
|
|
61868
61921
|
}
|
|
@@ -62038,10 +62091,10 @@ data: ${JSON.stringify(msg.data)}
|
|
|
62038
62091
|
const buffer = Buffer.from(await res.arrayBuffer());
|
|
62039
62092
|
const fs17 = await import("fs");
|
|
62040
62093
|
fs17.writeFileSync(vsixPath, buffer);
|
|
62041
|
-
return new Promise((
|
|
62094
|
+
return new Promise((resolve18) => {
|
|
62042
62095
|
const cmd = `"${ide.cliCommand}" --install-extension "${vsixPath}" --force`;
|
|
62043
62096
|
(0, import_child_process10.exec)(cmd, { timeout: 6e4 }, (error48, _stdout, stderr) => {
|
|
62044
|
-
|
|
62097
|
+
resolve18({
|
|
62045
62098
|
extensionId: extension.id,
|
|
62046
62099
|
marketplaceId: extension.marketplaceId,
|
|
62047
62100
|
success: !error48,
|
|
@@ -62054,11 +62107,11 @@ data: ${JSON.stringify(msg.data)}
|
|
|
62054
62107
|
} catch (e) {
|
|
62055
62108
|
}
|
|
62056
62109
|
}
|
|
62057
|
-
return new Promise((
|
|
62110
|
+
return new Promise((resolve18) => {
|
|
62058
62111
|
const cmd = `"${ide.cliCommand}" --install-extension ${extension.marketplaceId} --force`;
|
|
62059
62112
|
(0, import_child_process10.exec)(cmd, { timeout: 6e4 }, (error48, stdout, stderr) => {
|
|
62060
62113
|
if (error48) {
|
|
62061
|
-
|
|
62114
|
+
resolve18({
|
|
62062
62115
|
extensionId: extension.id,
|
|
62063
62116
|
marketplaceId: extension.marketplaceId,
|
|
62064
62117
|
success: false,
|
|
@@ -62066,7 +62119,7 @@ data: ${JSON.stringify(msg.data)}
|
|
|
62066
62119
|
error: stderr || error48.message
|
|
62067
62120
|
});
|
|
62068
62121
|
} else {
|
|
62069
|
-
|
|
62122
|
+
resolve18({
|
|
62070
62123
|
extensionId: extension.id,
|
|
62071
62124
|
marketplaceId: extension.marketplaceId,
|
|
62072
62125
|
success: true,
|