@adhdev/daemon-core 0.9.71 → 0.9.72
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/commands/mesh-coordinator.d.ts +7 -0
- package/dist/index.js +174 -113
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +173 -112
- package/dist/index.mjs.map +1 -1
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/commands/mesh-coordinator.ts +82 -1
- package/src/commands/router.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2222,7 +2222,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
2222
2222
|
`[${this.cliType}] Waiting for interactive prompt: status=${status} stableMs=${stableMs} recentOutputMs=${recentlyOutput} screen=${JSON.stringify(summarizeCliTraceText(screenText, 220)).slice(0, 260)}`
|
|
2223
2223
|
);
|
|
2224
2224
|
}
|
|
2225
|
-
await new Promise((
|
|
2225
|
+
await new Promise((resolve16) => setTimeout(resolve16, 50));
|
|
2226
2226
|
}
|
|
2227
2227
|
const finalScreenText = this.terminalScreen.getText() || "";
|
|
2228
2228
|
LOG.warn(
|
|
@@ -3132,7 +3132,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
3132
3132
|
const deadline = Date.now() + 1e4;
|
|
3133
3133
|
while (this.startupParseGate && Date.now() < deadline) {
|
|
3134
3134
|
this.resolveStartupState("send_wait");
|
|
3135
|
-
await new Promise((
|
|
3135
|
+
await new Promise((resolve16) => setTimeout(resolve16, 50));
|
|
3136
3136
|
}
|
|
3137
3137
|
}
|
|
3138
3138
|
if (!allowInterventionPrompt) {
|
|
@@ -3208,13 +3208,13 @@ var init_provider_cli_adapter = __esm({
|
|
|
3208
3208
|
}
|
|
3209
3209
|
this.responseEpoch += 1;
|
|
3210
3210
|
this.responseSettleIgnoreUntil = Date.now() + submitDelayMs + this.timeouts.outputSettle + 250;
|
|
3211
|
-
await new Promise((
|
|
3211
|
+
await new Promise((resolve16, reject) => {
|
|
3212
3212
|
let resolved = false;
|
|
3213
3213
|
const completion = {
|
|
3214
3214
|
resolveOnce: () => {
|
|
3215
3215
|
if (resolved) return;
|
|
3216
3216
|
resolved = true;
|
|
3217
|
-
|
|
3217
|
+
resolve16();
|
|
3218
3218
|
},
|
|
3219
3219
|
rejectOnce: (error) => {
|
|
3220
3220
|
if (resolved) return;
|
|
@@ -3372,17 +3372,17 @@ var init_provider_cli_adapter = __esm({
|
|
|
3372
3372
|
}
|
|
3373
3373
|
}
|
|
3374
3374
|
waitForStopped(timeoutMs) {
|
|
3375
|
-
return new Promise((
|
|
3375
|
+
return new Promise((resolve16) => {
|
|
3376
3376
|
const startedAt = Date.now();
|
|
3377
3377
|
const timer = setInterval(() => {
|
|
3378
3378
|
if (!this.ptyProcess || this.currentStatus === "stopped") {
|
|
3379
3379
|
clearInterval(timer);
|
|
3380
|
-
|
|
3380
|
+
resolve16(true);
|
|
3381
3381
|
return;
|
|
3382
3382
|
}
|
|
3383
3383
|
if (Date.now() - startedAt >= timeoutMs) {
|
|
3384
3384
|
clearInterval(timer);
|
|
3385
|
-
|
|
3385
|
+
resolve16(false);
|
|
3386
3386
|
}
|
|
3387
3387
|
}, 100);
|
|
3388
3388
|
});
|
|
@@ -5633,8 +5633,8 @@ async function detectIDEs(providerLoader) {
|
|
|
5633
5633
|
if (existsSync5(bundledCli)) resolvedCli = bundledCli;
|
|
5634
5634
|
}
|
|
5635
5635
|
if (!resolvedCli && appPath && os21 === "win32") {
|
|
5636
|
-
const { dirname:
|
|
5637
|
-
const appDir =
|
|
5636
|
+
const { dirname: dirname8 } = await import("path");
|
|
5637
|
+
const appDir = dirname8(appPath);
|
|
5638
5638
|
const candidates = [
|
|
5639
5639
|
`${appDir}\\\\bin\\\\${def.cli}.cmd`,
|
|
5640
5640
|
`${appDir}\\\\bin\\\\${def.cli}`,
|
|
@@ -5698,19 +5698,19 @@ function resolveCommandPath(command) {
|
|
|
5698
5698
|
return null;
|
|
5699
5699
|
}
|
|
5700
5700
|
function execAsync(cmd, timeoutMs = 5e3) {
|
|
5701
|
-
return new Promise((
|
|
5701
|
+
return new Promise((resolve16) => {
|
|
5702
5702
|
const child = exec(cmd, {
|
|
5703
5703
|
encoding: "utf-8",
|
|
5704
5704
|
timeout: timeoutMs,
|
|
5705
5705
|
...process.platform === "win32" ? { windowsHide: true } : {}
|
|
5706
5706
|
}, (err, stdout) => {
|
|
5707
5707
|
if (err || !stdout?.trim()) {
|
|
5708
|
-
|
|
5708
|
+
resolve16(null);
|
|
5709
5709
|
} else {
|
|
5710
|
-
|
|
5710
|
+
resolve16(stdout.trim());
|
|
5711
5711
|
}
|
|
5712
5712
|
});
|
|
5713
|
-
child.on("error", () =>
|
|
5713
|
+
child.on("error", () => resolve16(null));
|
|
5714
5714
|
});
|
|
5715
5715
|
}
|
|
5716
5716
|
async function detectCLIs(providerLoader, options) {
|
|
@@ -6075,7 +6075,7 @@ var DaemonCdpManager = class {
|
|
|
6075
6075
|
* Returns multiple entries if multiple IDE windows are open on same port
|
|
6076
6076
|
*/
|
|
6077
6077
|
static listAllTargets(port) {
|
|
6078
|
-
return new Promise((
|
|
6078
|
+
return new Promise((resolve16) => {
|
|
6079
6079
|
const req = http.get(`http://127.0.0.1:${port}/json`, (res) => {
|
|
6080
6080
|
let data = "";
|
|
6081
6081
|
res.on("data", (chunk) => data += chunk.toString());
|
|
@@ -6091,16 +6091,16 @@ var DaemonCdpManager = class {
|
|
|
6091
6091
|
(t) => !isNonMain(t.title || "") && t.url?.includes("workbench.html") && !t.url?.includes("agent")
|
|
6092
6092
|
);
|
|
6093
6093
|
const fallbackPages = pages.filter((t) => !isNonMain(t.title || ""));
|
|
6094
|
-
|
|
6094
|
+
resolve16(mainPages.length > 0 ? mainPages : fallbackPages);
|
|
6095
6095
|
} catch {
|
|
6096
|
-
|
|
6096
|
+
resolve16([]);
|
|
6097
6097
|
}
|
|
6098
6098
|
});
|
|
6099
6099
|
});
|
|
6100
|
-
req.on("error", () =>
|
|
6100
|
+
req.on("error", () => resolve16([]));
|
|
6101
6101
|
req.setTimeout(2e3, () => {
|
|
6102
6102
|
req.destroy();
|
|
6103
|
-
|
|
6103
|
+
resolve16([]);
|
|
6104
6104
|
});
|
|
6105
6105
|
});
|
|
6106
6106
|
}
|
|
@@ -6140,7 +6140,7 @@ var DaemonCdpManager = class {
|
|
|
6140
6140
|
}
|
|
6141
6141
|
}
|
|
6142
6142
|
findTargetOnPort(port) {
|
|
6143
|
-
return new Promise((
|
|
6143
|
+
return new Promise((resolve16) => {
|
|
6144
6144
|
const req = http.get(`http://127.0.0.1:${port}/json`, (res) => {
|
|
6145
6145
|
let data = "";
|
|
6146
6146
|
res.on("data", (chunk) => data += chunk.toString());
|
|
@@ -6151,7 +6151,7 @@ var DaemonCdpManager = class {
|
|
|
6151
6151
|
(t) => (t.type === "page" || t.type === "browser" || t.type === "Page") && t.webSocketDebuggerUrl
|
|
6152
6152
|
);
|
|
6153
6153
|
if (pages.length === 0) {
|
|
6154
|
-
|
|
6154
|
+
resolve16(targets.find((t) => t.webSocketDebuggerUrl) || null);
|
|
6155
6155
|
return;
|
|
6156
6156
|
}
|
|
6157
6157
|
const titleFilteredPages = pages.filter((t) => !this.isNonMainTitle(t.title || ""));
|
|
@@ -6170,25 +6170,25 @@ var DaemonCdpManager = class {
|
|
|
6170
6170
|
this._targetId = selected.target.id;
|
|
6171
6171
|
}
|
|
6172
6172
|
this._pageTitle = selected.target.title || "";
|
|
6173
|
-
|
|
6173
|
+
resolve16(selected.target);
|
|
6174
6174
|
return;
|
|
6175
6175
|
}
|
|
6176
6176
|
if (previousTargetId) {
|
|
6177
6177
|
this.log(`[CDP] Target ${previousTargetId} not found in page list`);
|
|
6178
|
-
|
|
6178
|
+
resolve16(null);
|
|
6179
6179
|
return;
|
|
6180
6180
|
}
|
|
6181
6181
|
this._pageTitle = list[0]?.title || "";
|
|
6182
|
-
|
|
6182
|
+
resolve16(list[0]);
|
|
6183
6183
|
} catch {
|
|
6184
|
-
|
|
6184
|
+
resolve16(null);
|
|
6185
6185
|
}
|
|
6186
6186
|
});
|
|
6187
6187
|
});
|
|
6188
|
-
req.on("error", () =>
|
|
6188
|
+
req.on("error", () => resolve16(null));
|
|
6189
6189
|
req.setTimeout(2e3, () => {
|
|
6190
6190
|
req.destroy();
|
|
6191
|
-
|
|
6191
|
+
resolve16(null);
|
|
6192
6192
|
});
|
|
6193
6193
|
});
|
|
6194
6194
|
}
|
|
@@ -6199,7 +6199,7 @@ var DaemonCdpManager = class {
|
|
|
6199
6199
|
this.extensionProviders = providers;
|
|
6200
6200
|
}
|
|
6201
6201
|
connectToTarget(wsUrl) {
|
|
6202
|
-
return new Promise((
|
|
6202
|
+
return new Promise((resolve16) => {
|
|
6203
6203
|
this.ws = new WebSocket(wsUrl);
|
|
6204
6204
|
this.ws.on("open", async () => {
|
|
6205
6205
|
this._connected = true;
|
|
@@ -6209,17 +6209,17 @@ var DaemonCdpManager = class {
|
|
|
6209
6209
|
}
|
|
6210
6210
|
this.connectBrowserWs().catch(() => {
|
|
6211
6211
|
});
|
|
6212
|
-
|
|
6212
|
+
resolve16(true);
|
|
6213
6213
|
});
|
|
6214
6214
|
this.ws.on("message", (data) => {
|
|
6215
6215
|
try {
|
|
6216
6216
|
const msg = JSON.parse(data.toString());
|
|
6217
6217
|
if (msg.id && this.pending.has(msg.id)) {
|
|
6218
|
-
const { resolve:
|
|
6218
|
+
const { resolve: resolve17, reject } = this.pending.get(msg.id);
|
|
6219
6219
|
this.pending.delete(msg.id);
|
|
6220
6220
|
this.failureCount = 0;
|
|
6221
6221
|
if (msg.error) reject(new Error(msg.error.message));
|
|
6222
|
-
else
|
|
6222
|
+
else resolve17(msg.result);
|
|
6223
6223
|
} else if (msg.method === "Runtime.executionContextCreated") {
|
|
6224
6224
|
this.contexts.add(msg.params.context.id);
|
|
6225
6225
|
} else if (msg.method === "Runtime.executionContextDestroyed") {
|
|
@@ -6242,7 +6242,7 @@ var DaemonCdpManager = class {
|
|
|
6242
6242
|
this.ws.on("error", (err) => {
|
|
6243
6243
|
this.log(`[CDP] WebSocket error: ${err.message}`);
|
|
6244
6244
|
this._connected = false;
|
|
6245
|
-
|
|
6245
|
+
resolve16(false);
|
|
6246
6246
|
});
|
|
6247
6247
|
});
|
|
6248
6248
|
}
|
|
@@ -6256,7 +6256,7 @@ var DaemonCdpManager = class {
|
|
|
6256
6256
|
return;
|
|
6257
6257
|
}
|
|
6258
6258
|
this.log(`[CDP] Connecting browser WS for target discovery...`);
|
|
6259
|
-
await new Promise((
|
|
6259
|
+
await new Promise((resolve16, reject) => {
|
|
6260
6260
|
this.browserWs = new WebSocket(browserWsUrl);
|
|
6261
6261
|
this.browserWs.on("open", async () => {
|
|
6262
6262
|
this._browserConnected = true;
|
|
@@ -6266,16 +6266,16 @@ var DaemonCdpManager = class {
|
|
|
6266
6266
|
} catch (e) {
|
|
6267
6267
|
this.log(`[CDP] setDiscoverTargets failed: ${e.message}`);
|
|
6268
6268
|
}
|
|
6269
|
-
|
|
6269
|
+
resolve16();
|
|
6270
6270
|
});
|
|
6271
6271
|
this.browserWs.on("message", (data) => {
|
|
6272
6272
|
try {
|
|
6273
6273
|
const msg = JSON.parse(data.toString());
|
|
6274
6274
|
if (msg.id && this.browserPending.has(msg.id)) {
|
|
6275
|
-
const { resolve:
|
|
6275
|
+
const { resolve: resolve17, reject: reject2 } = this.browserPending.get(msg.id);
|
|
6276
6276
|
this.browserPending.delete(msg.id);
|
|
6277
6277
|
if (msg.error) reject2(new Error(msg.error.message));
|
|
6278
|
-
else
|
|
6278
|
+
else resolve17(msg.result);
|
|
6279
6279
|
}
|
|
6280
6280
|
} catch {
|
|
6281
6281
|
}
|
|
@@ -6295,31 +6295,31 @@ var DaemonCdpManager = class {
|
|
|
6295
6295
|
}
|
|
6296
6296
|
}
|
|
6297
6297
|
getBrowserWsUrl() {
|
|
6298
|
-
return new Promise((
|
|
6298
|
+
return new Promise((resolve16) => {
|
|
6299
6299
|
const req = http.get(`http://127.0.0.1:${this.port}/json/version`, (res) => {
|
|
6300
6300
|
let data = "";
|
|
6301
6301
|
res.on("data", (chunk) => data += chunk.toString());
|
|
6302
6302
|
res.on("end", () => {
|
|
6303
6303
|
try {
|
|
6304
6304
|
const info = JSON.parse(data);
|
|
6305
|
-
|
|
6305
|
+
resolve16(info.webSocketDebuggerUrl || null);
|
|
6306
6306
|
} catch {
|
|
6307
|
-
|
|
6307
|
+
resolve16(null);
|
|
6308
6308
|
}
|
|
6309
6309
|
});
|
|
6310
6310
|
});
|
|
6311
|
-
req.on("error", () =>
|
|
6311
|
+
req.on("error", () => resolve16(null));
|
|
6312
6312
|
req.setTimeout(3e3, () => {
|
|
6313
6313
|
req.destroy();
|
|
6314
|
-
|
|
6314
|
+
resolve16(null);
|
|
6315
6315
|
});
|
|
6316
6316
|
});
|
|
6317
6317
|
}
|
|
6318
6318
|
sendBrowser(method, params = {}, timeoutMs = 15e3) {
|
|
6319
|
-
return new Promise((
|
|
6319
|
+
return new Promise((resolve16, reject) => {
|
|
6320
6320
|
if (!this.browserWs || !this._browserConnected) return reject(new Error("Browser WS not connected"));
|
|
6321
6321
|
const id = this.browserMsgId++;
|
|
6322
|
-
this.browserPending.set(id, { resolve:
|
|
6322
|
+
this.browserPending.set(id, { resolve: resolve16, reject });
|
|
6323
6323
|
this.browserWs.send(JSON.stringify({ id, method, params }));
|
|
6324
6324
|
setTimeout(() => {
|
|
6325
6325
|
if (this.browserPending.has(id)) {
|
|
@@ -6359,11 +6359,11 @@ var DaemonCdpManager = class {
|
|
|
6359
6359
|
}
|
|
6360
6360
|
// ─── CDP Protocol ────────────────────────────────────────
|
|
6361
6361
|
sendInternal(method, params = {}, timeoutMs = 15e3) {
|
|
6362
|
-
return new Promise((
|
|
6362
|
+
return new Promise((resolve16, reject) => {
|
|
6363
6363
|
if (!this.ws || !this._connected) return reject(new Error("CDP not connected"));
|
|
6364
6364
|
if (this.ws.readyState !== WebSocket.OPEN) return reject(new Error("WebSocket not open"));
|
|
6365
6365
|
const id = this.msgId++;
|
|
6366
|
-
this.pending.set(id, { resolve:
|
|
6366
|
+
this.pending.set(id, { resolve: resolve16, reject });
|
|
6367
6367
|
this.ws.send(JSON.stringify({ id, method, params }));
|
|
6368
6368
|
setTimeout(() => {
|
|
6369
6369
|
if (this.pending.has(id)) {
|
|
@@ -6612,7 +6612,7 @@ var DaemonCdpManager = class {
|
|
|
6612
6612
|
const browserWs = this.browserWs;
|
|
6613
6613
|
let msgId = this.browserMsgId;
|
|
6614
6614
|
const sendWs = (method, params = {}, sessionId) => {
|
|
6615
|
-
return new Promise((
|
|
6615
|
+
return new Promise((resolve16, reject) => {
|
|
6616
6616
|
const mid = msgId++;
|
|
6617
6617
|
this.browserMsgId = msgId;
|
|
6618
6618
|
const handler = (raw) => {
|
|
@@ -6621,7 +6621,7 @@ var DaemonCdpManager = class {
|
|
|
6621
6621
|
if (msg.id === mid) {
|
|
6622
6622
|
browserWs.removeListener("message", handler);
|
|
6623
6623
|
if (msg.error) reject(new Error(msg.error.message || JSON.stringify(msg.error)));
|
|
6624
|
-
else
|
|
6624
|
+
else resolve16(msg.result);
|
|
6625
6625
|
}
|
|
6626
6626
|
} catch {
|
|
6627
6627
|
}
|
|
@@ -6822,14 +6822,14 @@ var DaemonCdpManager = class {
|
|
|
6822
6822
|
if (!ws || ws.readyState !== WebSocket.OPEN) {
|
|
6823
6823
|
throw new Error("CDP not connected");
|
|
6824
6824
|
}
|
|
6825
|
-
return new Promise((
|
|
6825
|
+
return new Promise((resolve16, reject) => {
|
|
6826
6826
|
const id = getNextId();
|
|
6827
6827
|
pendingMap.set(id, {
|
|
6828
6828
|
resolve: (result) => {
|
|
6829
6829
|
if (result?.result?.subtype === "error") {
|
|
6830
6830
|
reject(new Error(result.result.description));
|
|
6831
6831
|
} else {
|
|
6832
|
-
|
|
6832
|
+
resolve16(result?.result?.value);
|
|
6833
6833
|
}
|
|
6834
6834
|
},
|
|
6835
6835
|
reject
|
|
@@ -6861,10 +6861,10 @@ var DaemonCdpManager = class {
|
|
|
6861
6861
|
throw new Error("CDP not connected");
|
|
6862
6862
|
}
|
|
6863
6863
|
const sendViaSession = (method, params = {}) => {
|
|
6864
|
-
return new Promise((
|
|
6864
|
+
return new Promise((resolve16, reject) => {
|
|
6865
6865
|
const pendingMap = this._browserConnected ? this.browserPending : this.pending;
|
|
6866
6866
|
const id = this._browserConnected ? this.browserMsgId++ : this.msgId++;
|
|
6867
|
-
pendingMap.set(id, { resolve:
|
|
6867
|
+
pendingMap.set(id, { resolve: resolve16, reject });
|
|
6868
6868
|
ws.send(JSON.stringify({ id, sessionId, method, params }));
|
|
6869
6869
|
setTimeout(() => {
|
|
6870
6870
|
if (pendingMap.has(id)) {
|
|
@@ -12049,7 +12049,7 @@ function getCliVisibleTranscriptCount(adapter) {
|
|
|
12049
12049
|
async function getStableExtensionBaseline(h) {
|
|
12050
12050
|
const first = await readExtensionChatState(h);
|
|
12051
12051
|
if (getStateMessageCount(first) > 0 || getStateLastSignature(first)) return first;
|
|
12052
|
-
await new Promise((
|
|
12052
|
+
await new Promise((resolve16) => setTimeout(resolve16, 150));
|
|
12053
12053
|
const second = await readExtensionChatState(h);
|
|
12054
12054
|
return getStateMessageCount(second) >= getStateMessageCount(first) ? second : first;
|
|
12055
12055
|
}
|
|
@@ -12057,7 +12057,7 @@ async function verifyExtensionSendObserved(h, before) {
|
|
|
12057
12057
|
const beforeCount = getStateMessageCount(before);
|
|
12058
12058
|
const beforeSignature = getStateLastSignature(before);
|
|
12059
12059
|
for (let attempt = 0; attempt < 12; attempt += 1) {
|
|
12060
|
-
await new Promise((
|
|
12060
|
+
await new Promise((resolve16) => setTimeout(resolve16, 250));
|
|
12061
12061
|
const state = await readExtensionChatState(h);
|
|
12062
12062
|
if (state?.status === "waiting_approval") return true;
|
|
12063
12063
|
const afterCount = getStateMessageCount(state);
|
|
@@ -13690,7 +13690,7 @@ async function executeProviderScript(h, args, scriptName) {
|
|
|
13690
13690
|
const enterCount = cliCommand.enterCount || 1;
|
|
13691
13691
|
await adapter.writeRaw(cliCommand.text + "\r");
|
|
13692
13692
|
for (let i = 1; i < enterCount; i += 1) {
|
|
13693
|
-
await new Promise((
|
|
13693
|
+
await new Promise((resolve16) => setTimeout(resolve16, 50));
|
|
13694
13694
|
await adapter.writeRaw("\r");
|
|
13695
13695
|
}
|
|
13696
13696
|
}
|
|
@@ -14375,7 +14375,7 @@ var DaemonCommandHandler = class {
|
|
|
14375
14375
|
try {
|
|
14376
14376
|
const http3 = await import("http");
|
|
14377
14377
|
const postData = JSON.stringify(body);
|
|
14378
|
-
const result = await new Promise((
|
|
14378
|
+
const result = await new Promise((resolve16, reject) => {
|
|
14379
14379
|
const req = http3.request({
|
|
14380
14380
|
hostname: "127.0.0.1",
|
|
14381
14381
|
port: 19280,
|
|
@@ -14387,9 +14387,9 @@ var DaemonCommandHandler = class {
|
|
|
14387
14387
|
res.on("data", (chunk) => data += chunk);
|
|
14388
14388
|
res.on("end", () => {
|
|
14389
14389
|
try {
|
|
14390
|
-
|
|
14390
|
+
resolve16(JSON.parse(data));
|
|
14391
14391
|
} catch {
|
|
14392
|
-
|
|
14392
|
+
resolve16({ raw: data });
|
|
14393
14393
|
}
|
|
14394
14394
|
});
|
|
14395
14395
|
});
|
|
@@ -14407,15 +14407,15 @@ var DaemonCommandHandler = class {
|
|
|
14407
14407
|
if (!providerType) return { success: false, error: "providerType required" };
|
|
14408
14408
|
try {
|
|
14409
14409
|
const http3 = await import("http");
|
|
14410
|
-
const result = await new Promise((
|
|
14410
|
+
const result = await new Promise((resolve16, reject) => {
|
|
14411
14411
|
http3.get(`http://127.0.0.1:19280/api/providers/${providerType}/${endpoint}`, (res) => {
|
|
14412
14412
|
let data = "";
|
|
14413
14413
|
res.on("data", (chunk) => data += chunk);
|
|
14414
14414
|
res.on("end", () => {
|
|
14415
14415
|
try {
|
|
14416
|
-
|
|
14416
|
+
resolve16(JSON.parse(data));
|
|
14417
14417
|
} catch {
|
|
14418
|
-
|
|
14418
|
+
resolve16({ raw: data });
|
|
14419
14419
|
}
|
|
14420
14420
|
});
|
|
14421
14421
|
}).on("error", reject);
|
|
@@ -14429,7 +14429,7 @@ var DaemonCommandHandler = class {
|
|
|
14429
14429
|
try {
|
|
14430
14430
|
const http3 = await import("http");
|
|
14431
14431
|
const postData = JSON.stringify(args || {});
|
|
14432
|
-
const result = await new Promise((
|
|
14432
|
+
const result = await new Promise((resolve16, reject) => {
|
|
14433
14433
|
const req = http3.request({
|
|
14434
14434
|
hostname: "127.0.0.1",
|
|
14435
14435
|
port: 19280,
|
|
@@ -14441,9 +14441,9 @@ var DaemonCommandHandler = class {
|
|
|
14441
14441
|
res.on("data", (chunk) => data += chunk);
|
|
14442
14442
|
res.on("end", () => {
|
|
14443
14443
|
try {
|
|
14444
|
-
|
|
14444
|
+
resolve16(JSON.parse(data));
|
|
14445
14445
|
} catch {
|
|
14446
|
-
|
|
14446
|
+
resolve16({ raw: data });
|
|
14447
14447
|
}
|
|
14448
14448
|
});
|
|
14449
14449
|
});
|
|
@@ -14567,7 +14567,7 @@ async function waitForCliAdapterReady(adapter, options) {
|
|
|
14567
14567
|
if (status === "stopped") {
|
|
14568
14568
|
throw new Error("CLI runtime stopped before it became ready");
|
|
14569
14569
|
}
|
|
14570
|
-
await new Promise((
|
|
14570
|
+
await new Promise((resolve16) => setTimeout(resolve16, pollMs));
|
|
14571
14571
|
}
|
|
14572
14572
|
throw new Error(`CLI runtime did not become ready within ${timeoutMs}ms`);
|
|
14573
14573
|
}
|
|
@@ -14910,7 +14910,7 @@ var CliProviderInstance = class {
|
|
|
14910
14910
|
const enterCount = cliCommand.enterCount || 1;
|
|
14911
14911
|
await this.adapter.writeRaw(cliCommand.text + "\r");
|
|
14912
14912
|
for (let i = 1; i < enterCount; i += 1) {
|
|
14913
|
-
await new Promise((
|
|
14913
|
+
await new Promise((resolve16) => setTimeout(resolve16, 50));
|
|
14914
14914
|
await this.adapter.writeRaw("\r");
|
|
14915
14915
|
}
|
|
14916
14916
|
}
|
|
@@ -16020,13 +16020,13 @@ var AcpProviderInstance = class {
|
|
|
16020
16020
|
}
|
|
16021
16021
|
this.currentStatus = "waiting_approval";
|
|
16022
16022
|
this.detectStatusTransition();
|
|
16023
|
-
const approved = await new Promise((
|
|
16024
|
-
this.permissionResolvers.push(
|
|
16023
|
+
const approved = await new Promise((resolve16) => {
|
|
16024
|
+
this.permissionResolvers.push(resolve16);
|
|
16025
16025
|
setTimeout(() => {
|
|
16026
|
-
const idx = this.permissionResolvers.indexOf(
|
|
16026
|
+
const idx = this.permissionResolvers.indexOf(resolve16);
|
|
16027
16027
|
if (idx >= 0) {
|
|
16028
16028
|
this.permissionResolvers.splice(idx, 1);
|
|
16029
|
-
|
|
16029
|
+
resolve16(false);
|
|
16030
16030
|
}
|
|
16031
16031
|
}, 3e5);
|
|
16032
16032
|
});
|
|
@@ -18612,7 +18612,7 @@ var ProviderLoader = class _ProviderLoader {
|
|
|
18612
18612
|
return { updated: false };
|
|
18613
18613
|
}
|
|
18614
18614
|
try {
|
|
18615
|
-
const etag = await new Promise((
|
|
18615
|
+
const etag = await new Promise((resolve16, reject) => {
|
|
18616
18616
|
const options = {
|
|
18617
18617
|
method: "HEAD",
|
|
18618
18618
|
hostname: "github.com",
|
|
@@ -18630,7 +18630,7 @@ var ProviderLoader = class _ProviderLoader {
|
|
|
18630
18630
|
headers: { "User-Agent": "adhdev-launcher" },
|
|
18631
18631
|
timeout: 1e4
|
|
18632
18632
|
}, (res2) => {
|
|
18633
|
-
|
|
18633
|
+
resolve16(res2.headers.etag || res2.headers["last-modified"] || "");
|
|
18634
18634
|
});
|
|
18635
18635
|
req2.on("error", reject);
|
|
18636
18636
|
req2.on("timeout", () => {
|
|
@@ -18639,7 +18639,7 @@ var ProviderLoader = class _ProviderLoader {
|
|
|
18639
18639
|
});
|
|
18640
18640
|
req2.end();
|
|
18641
18641
|
} else {
|
|
18642
|
-
|
|
18642
|
+
resolve16(res.headers.etag || res.headers["last-modified"] || "");
|
|
18643
18643
|
}
|
|
18644
18644
|
});
|
|
18645
18645
|
req.on("error", reject);
|
|
@@ -18703,7 +18703,7 @@ var ProviderLoader = class _ProviderLoader {
|
|
|
18703
18703
|
downloadFile(url, destPath) {
|
|
18704
18704
|
const https = __require("https");
|
|
18705
18705
|
const http3 = __require("http");
|
|
18706
|
-
return new Promise((
|
|
18706
|
+
return new Promise((resolve16, reject) => {
|
|
18707
18707
|
const doRequest = (reqUrl, redirectCount = 0) => {
|
|
18708
18708
|
if (redirectCount > 5) {
|
|
18709
18709
|
reject(new Error("Too many redirects"));
|
|
@@ -18723,7 +18723,7 @@ var ProviderLoader = class _ProviderLoader {
|
|
|
18723
18723
|
res.pipe(ws);
|
|
18724
18724
|
ws.on("finish", () => {
|
|
18725
18725
|
ws.close();
|
|
18726
|
-
|
|
18726
|
+
resolve16();
|
|
18727
18727
|
});
|
|
18728
18728
|
ws.on("error", reject);
|
|
18729
18729
|
});
|
|
@@ -19302,17 +19302,17 @@ async function findFreePort(ports) {
|
|
|
19302
19302
|
throw new Error("No free port found");
|
|
19303
19303
|
}
|
|
19304
19304
|
function checkPortFree(port) {
|
|
19305
|
-
return new Promise((
|
|
19305
|
+
return new Promise((resolve16) => {
|
|
19306
19306
|
const server = net.createServer();
|
|
19307
19307
|
server.unref();
|
|
19308
|
-
server.on("error", () =>
|
|
19308
|
+
server.on("error", () => resolve16(false));
|
|
19309
19309
|
server.listen(port, "127.0.0.1", () => {
|
|
19310
|
-
server.close(() =>
|
|
19310
|
+
server.close(() => resolve16(true));
|
|
19311
19311
|
});
|
|
19312
19312
|
});
|
|
19313
19313
|
}
|
|
19314
19314
|
async function isCdpActive(port) {
|
|
19315
|
-
return new Promise((
|
|
19315
|
+
return new Promise((resolve16) => {
|
|
19316
19316
|
const req = __require("http").get(`http://127.0.0.1:${port}/json/version`, {
|
|
19317
19317
|
timeout: 2e3
|
|
19318
19318
|
}, (res) => {
|
|
@@ -19321,16 +19321,16 @@ async function isCdpActive(port) {
|
|
|
19321
19321
|
res.on("end", () => {
|
|
19322
19322
|
try {
|
|
19323
19323
|
const info = JSON.parse(data);
|
|
19324
|
-
|
|
19324
|
+
resolve16(!!info["WebKit-Version"] || !!info["Browser"]);
|
|
19325
19325
|
} catch {
|
|
19326
|
-
|
|
19326
|
+
resolve16(false);
|
|
19327
19327
|
}
|
|
19328
19328
|
});
|
|
19329
19329
|
});
|
|
19330
|
-
req.on("error", () =>
|
|
19330
|
+
req.on("error", () => resolve16(false));
|
|
19331
19331
|
req.on("timeout", () => {
|
|
19332
19332
|
req.destroy();
|
|
19333
|
-
|
|
19333
|
+
resolve16(false);
|
|
19334
19334
|
});
|
|
19335
19335
|
});
|
|
19336
19336
|
}
|
|
@@ -19806,7 +19806,9 @@ cleanOldFiles();
|
|
|
19806
19806
|
init_logger();
|
|
19807
19807
|
|
|
19808
19808
|
// src/commands/mesh-coordinator.ts
|
|
19809
|
-
import {
|
|
19809
|
+
import { existsSync as existsSync14, realpathSync as realpathSync2 } from "fs";
|
|
19810
|
+
import { createRequire as createRequire2 } from "module";
|
|
19811
|
+
import { dirname as dirname3, join as join17, resolve as resolve13 } from "path";
|
|
19810
19812
|
var DEFAULT_SERVER_NAME = "adhdev-mesh";
|
|
19811
19813
|
var DEFAULT_ADHDEV_MCP_COMMAND = "adhdev-mcp";
|
|
19812
19814
|
function resolveMeshCoordinatorSetup(options) {
|
|
@@ -19831,11 +19833,23 @@ function resolveMeshCoordinatorSetup(options) {
|
|
|
19831
19833
|
if (!path26) {
|
|
19832
19834
|
return { kind: "unsupported", reason: "Provider auto-import MCP config is missing a config path" };
|
|
19833
19835
|
}
|
|
19836
|
+
const mcpServer = resolveAdhdevMcpServerLaunch({
|
|
19837
|
+
meshId,
|
|
19838
|
+
nodeExecutable: options.nodeExecutable,
|
|
19839
|
+
adhdevMcpEntryPath: options.adhdevMcpEntryPath
|
|
19840
|
+
});
|
|
19841
|
+
if (!mcpServer) {
|
|
19842
|
+
return {
|
|
19843
|
+
kind: "unsupported",
|
|
19844
|
+
reason: "Could not resolve the ADHDev MCP server entrypoint without relying on a PATH bin shim"
|
|
19845
|
+
};
|
|
19846
|
+
}
|
|
19834
19847
|
return {
|
|
19835
19848
|
kind: "auto_import",
|
|
19836
19849
|
serverName,
|
|
19837
19850
|
configPath: join17(workspace, path26),
|
|
19838
|
-
configFormat: mcpConfig.format
|
|
19851
|
+
configFormat: mcpConfig.format,
|
|
19852
|
+
mcpServer
|
|
19839
19853
|
};
|
|
19840
19854
|
}
|
|
19841
19855
|
if (mcpConfig.mode === "manual") {
|
|
@@ -19867,6 +19881,53 @@ function resolveMeshCoordinatorSetup(options) {
|
|
|
19867
19881
|
function renderMeshCoordinatorTemplate(template, values) {
|
|
19868
19882
|
return template.replace(/\{\{\s*(meshId|workspace|serverName|adhdevMcpCommand)\s*\}\}/g, (_, key) => values[key] || "");
|
|
19869
19883
|
}
|
|
19884
|
+
function resolveAdhdevMcpServerLaunch(options) {
|
|
19885
|
+
const entryPath = resolveAdhdevMcpEntryPath(options.adhdevMcpEntryPath);
|
|
19886
|
+
if (!entryPath) return null;
|
|
19887
|
+
return {
|
|
19888
|
+
command: options.nodeExecutable?.trim() || process.execPath,
|
|
19889
|
+
args: [entryPath, "--repo-mesh", options.meshId]
|
|
19890
|
+
};
|
|
19891
|
+
}
|
|
19892
|
+
function resolveAdhdevMcpEntryPath(explicitPath) {
|
|
19893
|
+
const explicit = explicitPath?.trim();
|
|
19894
|
+
if (explicit) return normalizeExistingPath(explicit) || explicit;
|
|
19895
|
+
const envPath = process.env.ADHDEV_MCP_SERVER_PATH?.trim();
|
|
19896
|
+
if (envPath) return normalizeExistingPath(envPath) || envPath;
|
|
19897
|
+
const candidates = [];
|
|
19898
|
+
const addCandidate = (candidate) => {
|
|
19899
|
+
if (!candidates.includes(candidate)) candidates.push(candidate);
|
|
19900
|
+
};
|
|
19901
|
+
const addPackagedCandidates = (baseFile) => {
|
|
19902
|
+
if (!baseFile) return;
|
|
19903
|
+
const realBase = normalizeExistingPath(baseFile) || baseFile;
|
|
19904
|
+
const dir = dirname3(realBase);
|
|
19905
|
+
addCandidate(resolve13(dir, "../vendor/mcp-server/index.js"));
|
|
19906
|
+
addCandidate(resolve13(dir, "../../vendor/mcp-server/index.js"));
|
|
19907
|
+
addCandidate(resolve13(dir, "../../../vendor/mcp-server/index.js"));
|
|
19908
|
+
};
|
|
19909
|
+
addPackagedCandidates(process.argv[1]);
|
|
19910
|
+
for (const candidate of candidates) {
|
|
19911
|
+
const normalized = normalizeExistingPath(candidate);
|
|
19912
|
+
if (normalized) return normalized;
|
|
19913
|
+
}
|
|
19914
|
+
try {
|
|
19915
|
+
const requireBase = process.argv[1] ? normalizeExistingPath(process.argv[1]) || process.argv[1] : join17(process.cwd(), "adhdev-daemon.js");
|
|
19916
|
+
const req = createRequire2(requireBase);
|
|
19917
|
+
const resolvedModule = req.resolve("@adhdev/mcp-server");
|
|
19918
|
+
return normalizeExistingPath(resolvedModule) || resolvedModule;
|
|
19919
|
+
} catch {
|
|
19920
|
+
return null;
|
|
19921
|
+
}
|
|
19922
|
+
}
|
|
19923
|
+
function normalizeExistingPath(filePath) {
|
|
19924
|
+
try {
|
|
19925
|
+
if (!existsSync14(filePath)) return null;
|
|
19926
|
+
return realpathSync2.native(filePath);
|
|
19927
|
+
} catch {
|
|
19928
|
+
return null;
|
|
19929
|
+
}
|
|
19930
|
+
}
|
|
19870
19931
|
|
|
19871
19932
|
// src/status/snapshot.ts
|
|
19872
19933
|
init_config();
|
|
@@ -20374,7 +20435,7 @@ async function waitForPidExit(pid, timeoutMs) {
|
|
|
20374
20435
|
while (Date.now() - start < timeoutMs) {
|
|
20375
20436
|
try {
|
|
20376
20437
|
process.kill(pid, 0);
|
|
20377
|
-
await new Promise((
|
|
20438
|
+
await new Promise((resolve16) => setTimeout(resolve16, 250));
|
|
20378
20439
|
} catch {
|
|
20379
20440
|
return;
|
|
20380
20441
|
}
|
|
@@ -20485,7 +20546,7 @@ async function runDaemonUpgradeHelper(payload) {
|
|
|
20485
20546
|
appendUpgradeLog(installOutput.trim());
|
|
20486
20547
|
}
|
|
20487
20548
|
if (process.platform === "win32") {
|
|
20488
|
-
await new Promise((
|
|
20549
|
+
await new Promise((resolve16) => setTimeout(resolve16, 500));
|
|
20489
20550
|
cleanupStaleGlobalInstallDirs(payload.packageName, installCommand.surface);
|
|
20490
20551
|
appendUpgradeLog("Post-install staging cleanup complete");
|
|
20491
20552
|
}
|
|
@@ -21371,9 +21432,9 @@ var DaemonCommandRouter = class {
|
|
|
21371
21432
|
workspace
|
|
21372
21433
|
};
|
|
21373
21434
|
}
|
|
21374
|
-
const { existsSync:
|
|
21435
|
+
const { existsSync: existsSync22, readFileSync: readFileSync15, writeFileSync: writeFileSync12, copyFileSync: copyFileSync3 } = await import("fs");
|
|
21375
21436
|
const mcpConfigPath = coordinatorSetup.configPath;
|
|
21376
|
-
const hadExistingMcpConfig =
|
|
21437
|
+
const hadExistingMcpConfig = existsSync22(mcpConfigPath);
|
|
21377
21438
|
let existingMcpConfig = {};
|
|
21378
21439
|
if (hadExistingMcpConfig) {
|
|
21379
21440
|
try {
|
|
@@ -21387,8 +21448,8 @@ var DaemonCommandRouter = class {
|
|
|
21387
21448
|
mcpServers: {
|
|
21388
21449
|
...existingMcpConfig.mcpServers || {},
|
|
21389
21450
|
[coordinatorSetup.serverName]: {
|
|
21390
|
-
command:
|
|
21391
|
-
args:
|
|
21451
|
+
command: coordinatorSetup.mcpServer.command,
|
|
21452
|
+
args: coordinatorSetup.mcpServer.args
|
|
21392
21453
|
}
|
|
21393
21454
|
}
|
|
21394
21455
|
};
|
|
@@ -22042,7 +22103,7 @@ var ProviderStreamAdapter = class {
|
|
|
22042
22103
|
const beforeCount = this.messageCount(before);
|
|
22043
22104
|
const beforeSignature = this.lastMessageSignature(before);
|
|
22044
22105
|
for (let attempt = 0; attempt < 12; attempt += 1) {
|
|
22045
|
-
await new Promise((
|
|
22106
|
+
await new Promise((resolve16) => setTimeout(resolve16, 250));
|
|
22046
22107
|
let state;
|
|
22047
22108
|
try {
|
|
22048
22109
|
state = await this.readChat(evaluate);
|
|
@@ -22064,7 +22125,7 @@ var ProviderStreamAdapter = class {
|
|
|
22064
22125
|
if (this.messageCount(first) > 0 || this.lastMessageSignature(first)) {
|
|
22065
22126
|
return first;
|
|
22066
22127
|
}
|
|
22067
|
-
await new Promise((
|
|
22128
|
+
await new Promise((resolve16) => setTimeout(resolve16, 150));
|
|
22068
22129
|
const second = await this.readChat(evaluate);
|
|
22069
22130
|
return this.messageCount(second) >= this.messageCount(first) ? second : first;
|
|
22070
22131
|
}
|
|
@@ -22215,7 +22276,7 @@ var ProviderStreamAdapter = class {
|
|
|
22215
22276
|
if (typeof data.error === "string" && data.error.trim()) return false;
|
|
22216
22277
|
}
|
|
22217
22278
|
for (let attempt = 0; attempt < 6; attempt += 1) {
|
|
22218
|
-
await new Promise((
|
|
22279
|
+
await new Promise((resolve16) => setTimeout(resolve16, 250));
|
|
22219
22280
|
const state = await this.readChat(evaluate);
|
|
22220
22281
|
const title = this.getStateTitle(state);
|
|
22221
22282
|
if (this.titlesMatch(title, sessionId)) return true;
|
|
@@ -24808,7 +24869,7 @@ function getCliTargetBundle(ctx, type, instanceId) {
|
|
|
24808
24869
|
return { target, instance, adapter };
|
|
24809
24870
|
}
|
|
24810
24871
|
function sleep(ms) {
|
|
24811
|
-
return new Promise((
|
|
24872
|
+
return new Promise((resolve16) => setTimeout(resolve16, ms));
|
|
24812
24873
|
}
|
|
24813
24874
|
async function waitForCliReady(ctx, type, instanceId, timeoutMs) {
|
|
24814
24875
|
const startedAt = Date.now();
|
|
@@ -27054,15 +27115,15 @@ var DevServer = class _DevServer {
|
|
|
27054
27115
|
this.json(res, 500, { error: e.message });
|
|
27055
27116
|
}
|
|
27056
27117
|
});
|
|
27057
|
-
return new Promise((
|
|
27118
|
+
return new Promise((resolve16, reject) => {
|
|
27058
27119
|
this.server.listen(port, "127.0.0.1", () => {
|
|
27059
27120
|
this.log(`Dev server listening on http://127.0.0.1:${port}`);
|
|
27060
|
-
|
|
27121
|
+
resolve16();
|
|
27061
27122
|
});
|
|
27062
27123
|
this.server.on("error", (e) => {
|
|
27063
27124
|
if (e.code === "EADDRINUSE") {
|
|
27064
27125
|
this.log(`Port ${port} in use, skipping dev server`);
|
|
27065
|
-
|
|
27126
|
+
resolve16();
|
|
27066
27127
|
} else {
|
|
27067
27128
|
reject(e);
|
|
27068
27129
|
}
|
|
@@ -27144,20 +27205,20 @@ var DevServer = class _DevServer {
|
|
|
27144
27205
|
child.stderr?.on("data", (d) => {
|
|
27145
27206
|
stderr += d.toString().slice(0, 2e3);
|
|
27146
27207
|
});
|
|
27147
|
-
await new Promise((
|
|
27208
|
+
await new Promise((resolve16) => {
|
|
27148
27209
|
const timer = setTimeout(() => {
|
|
27149
27210
|
child.kill();
|
|
27150
|
-
|
|
27211
|
+
resolve16();
|
|
27151
27212
|
}, 3e3);
|
|
27152
27213
|
child.on("exit", () => {
|
|
27153
27214
|
clearTimeout(timer);
|
|
27154
|
-
|
|
27215
|
+
resolve16();
|
|
27155
27216
|
});
|
|
27156
27217
|
child.stdout?.once("data", () => {
|
|
27157
27218
|
setTimeout(() => {
|
|
27158
27219
|
child.kill();
|
|
27159
27220
|
clearTimeout(timer);
|
|
27160
|
-
|
|
27221
|
+
resolve16();
|
|
27161
27222
|
}, 500);
|
|
27162
27223
|
});
|
|
27163
27224
|
});
|
|
@@ -27660,14 +27721,14 @@ var DevServer = class _DevServer {
|
|
|
27660
27721
|
child.stderr?.on("data", (d) => {
|
|
27661
27722
|
stderr += d.toString();
|
|
27662
27723
|
});
|
|
27663
|
-
await new Promise((
|
|
27724
|
+
await new Promise((resolve16) => {
|
|
27664
27725
|
const timer = setTimeout(() => {
|
|
27665
27726
|
child.kill();
|
|
27666
|
-
|
|
27727
|
+
resolve16();
|
|
27667
27728
|
}, timeout);
|
|
27668
27729
|
child.on("exit", () => {
|
|
27669
27730
|
clearTimeout(timer);
|
|
27670
|
-
|
|
27731
|
+
resolve16();
|
|
27671
27732
|
});
|
|
27672
27733
|
});
|
|
27673
27734
|
const elapsed = Date.now() - start;
|
|
@@ -28337,14 +28398,14 @@ data: ${JSON.stringify(msg.data)}
|
|
|
28337
28398
|
res.end(JSON.stringify(data, null, 2));
|
|
28338
28399
|
}
|
|
28339
28400
|
async readBody(req) {
|
|
28340
|
-
return new Promise((
|
|
28401
|
+
return new Promise((resolve16) => {
|
|
28341
28402
|
let body = "";
|
|
28342
28403
|
req.on("data", (chunk) => body += chunk);
|
|
28343
28404
|
req.on("end", () => {
|
|
28344
28405
|
try {
|
|
28345
|
-
|
|
28406
|
+
resolve16(JSON.parse(body));
|
|
28346
28407
|
} catch {
|
|
28347
|
-
|
|
28408
|
+
resolve16({});
|
|
28348
28409
|
}
|
|
28349
28410
|
});
|
|
28350
28411
|
});
|
|
@@ -28859,7 +28920,7 @@ async function waitForReady(endpoint, timeoutMs = STARTUP_TIMEOUT_MS) {
|
|
|
28859
28920
|
const deadline = Date.now() + timeoutMs;
|
|
28860
28921
|
while (Date.now() < deadline) {
|
|
28861
28922
|
if (await canConnect(endpoint)) return;
|
|
28862
|
-
await new Promise((
|
|
28923
|
+
await new Promise((resolve16) => setTimeout(resolve16, STARTUP_POLL_MS));
|
|
28863
28924
|
}
|
|
28864
28925
|
throw new Error(`Session host did not become ready within ${timeoutMs}ms`);
|
|
28865
28926
|
}
|
|
@@ -29037,10 +29098,10 @@ async function installExtension(ide, extension) {
|
|
|
29037
29098
|
const buffer = Buffer.from(await res.arrayBuffer());
|
|
29038
29099
|
const fs16 = await import("fs");
|
|
29039
29100
|
fs16.writeFileSync(vsixPath, buffer);
|
|
29040
|
-
return new Promise((
|
|
29101
|
+
return new Promise((resolve16) => {
|
|
29041
29102
|
const cmd = `"${ide.cliCommand}" --install-extension "${vsixPath}" --force`;
|
|
29042
29103
|
exec2(cmd, { timeout: 6e4 }, (error, _stdout, stderr) => {
|
|
29043
|
-
|
|
29104
|
+
resolve16({
|
|
29044
29105
|
extensionId: extension.id,
|
|
29045
29106
|
marketplaceId: extension.marketplaceId,
|
|
29046
29107
|
success: !error,
|
|
@@ -29053,11 +29114,11 @@ async function installExtension(ide, extension) {
|
|
|
29053
29114
|
} catch (e) {
|
|
29054
29115
|
}
|
|
29055
29116
|
}
|
|
29056
|
-
return new Promise((
|
|
29117
|
+
return new Promise((resolve16) => {
|
|
29057
29118
|
const cmd = `"${ide.cliCommand}" --install-extension ${extension.marketplaceId} --force`;
|
|
29058
29119
|
exec2(cmd, { timeout: 6e4 }, (error, stdout, stderr) => {
|
|
29059
29120
|
if (error) {
|
|
29060
|
-
|
|
29121
|
+
resolve16({
|
|
29061
29122
|
extensionId: extension.id,
|
|
29062
29123
|
marketplaceId: extension.marketplaceId,
|
|
29063
29124
|
success: false,
|
|
@@ -29065,7 +29126,7 @@ async function installExtension(ide, extension) {
|
|
|
29065
29126
|
error: stderr || error.message
|
|
29066
29127
|
});
|
|
29067
29128
|
} else {
|
|
29068
|
-
|
|
29129
|
+
resolve16({
|
|
29069
29130
|
extensionId: extension.id,
|
|
29070
29131
|
marketplaceId: extension.marketplaceId,
|
|
29071
29132
|
success: true,
|