adhdev 0.6.35 → 0.6.37
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/cli/index.js +182 -47
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +113 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -505,8 +505,7 @@ async function detectIDEs() {
|
|
|
505
505
|
path: appPath || cliPath,
|
|
506
506
|
cliCommand: resolvedCli || null,
|
|
507
507
|
version: version2,
|
|
508
|
-
icon: def.icon
|
|
509
|
-
extensionSupport: def.extensionSupport
|
|
508
|
+
icon: def.icon
|
|
510
509
|
});
|
|
511
510
|
}
|
|
512
511
|
return results;
|
|
@@ -1288,21 +1287,41 @@ var init_manager = __esm({
|
|
|
1288
1287
|
clickCount: 1
|
|
1289
1288
|
});
|
|
1290
1289
|
await new Promise((r) => setTimeout(r, 150));
|
|
1291
|
-
|
|
1290
|
+
const lines = text.split("\n");
|
|
1291
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1292
|
+
if (lines[i].length > 0) {
|
|
1293
|
+
await this.sendInternal("Input.insertText", { text: lines[i] });
|
|
1294
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
1295
|
+
}
|
|
1296
|
+
if (i < lines.length - 1) {
|
|
1297
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "rawKeyDown", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, modifiers: 8 });
|
|
1298
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "char", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, text: "\r", unmodifiedText: "\r", modifiers: 8 });
|
|
1299
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "keyUp", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, modifiers: 8 });
|
|
1300
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1292
1303
|
await new Promise((r) => setTimeout(r, 200));
|
|
1293
1304
|
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1294
1305
|
type: "rawKeyDown",
|
|
1295
1306
|
key: "Enter",
|
|
1296
1307
|
code: "Enter",
|
|
1297
1308
|
windowsVirtualKeyCode: 13,
|
|
1298
|
-
|
|
1309
|
+
text: "\r",
|
|
1310
|
+
unmodifiedText: "\r"
|
|
1299
1311
|
});
|
|
1300
1312
|
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1301
|
-
type: "
|
|
1313
|
+
type: "char",
|
|
1302
1314
|
key: "Enter",
|
|
1303
1315
|
code: "Enter",
|
|
1304
1316
|
windowsVirtualKeyCode: 13,
|
|
1305
|
-
|
|
1317
|
+
text: "\r",
|
|
1318
|
+
unmodifiedText: "\r"
|
|
1319
|
+
});
|
|
1320
|
+
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1321
|
+
type: "keyUp",
|
|
1322
|
+
key: "Enter",
|
|
1323
|
+
code: "Enter",
|
|
1324
|
+
windowsVirtualKeyCode: 13
|
|
1306
1325
|
});
|
|
1307
1326
|
this.log(`[CDP] typeAndSend: sent "${text.substring(0, 50)}..."`);
|
|
1308
1327
|
return true;
|
|
@@ -1356,21 +1375,41 @@ var init_manager = __esm({
|
|
|
1356
1375
|
windowsVirtualKeyCode: 8
|
|
1357
1376
|
});
|
|
1358
1377
|
await new Promise((r) => setTimeout(r, 150));
|
|
1359
|
-
|
|
1378
|
+
const lines = text.split("\n");
|
|
1379
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1380
|
+
if (lines[i].length > 0) {
|
|
1381
|
+
await this.sendInternal("Input.insertText", { text: lines[i] });
|
|
1382
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
1383
|
+
}
|
|
1384
|
+
if (i < lines.length - 1) {
|
|
1385
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "rawKeyDown", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, modifiers: 8 });
|
|
1386
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "char", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, text: "\r", unmodifiedText: "\r", modifiers: 8 });
|
|
1387
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "keyUp", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, modifiers: 8 });
|
|
1388
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1360
1391
|
await new Promise((r) => setTimeout(r, 200));
|
|
1361
1392
|
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1362
1393
|
type: "rawKeyDown",
|
|
1363
1394
|
key: "Enter",
|
|
1364
1395
|
code: "Enter",
|
|
1365
1396
|
windowsVirtualKeyCode: 13,
|
|
1366
|
-
|
|
1397
|
+
text: "\r",
|
|
1398
|
+
unmodifiedText: "\r"
|
|
1367
1399
|
});
|
|
1368
1400
|
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1369
|
-
type: "
|
|
1401
|
+
type: "char",
|
|
1370
1402
|
key: "Enter",
|
|
1371
1403
|
code: "Enter",
|
|
1372
1404
|
windowsVirtualKeyCode: 13,
|
|
1373
|
-
|
|
1405
|
+
text: "\r",
|
|
1406
|
+
unmodifiedText: "\r"
|
|
1407
|
+
});
|
|
1408
|
+
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1409
|
+
type: "keyUp",
|
|
1410
|
+
key: "Enter",
|
|
1411
|
+
code: "Enter",
|
|
1412
|
+
windowsVirtualKeyCode: 13
|
|
1374
1413
|
});
|
|
1375
1414
|
this.log(`[CDP] typeAndSendAt(${Math.round(x)},${Math.round(y)}): sent "${text.substring(0, 50)}..."`);
|
|
1376
1415
|
return true;
|
|
@@ -4925,14 +4964,7 @@ var init_handler = __esm({
|
|
|
4925
4964
|
}
|
|
4926
4965
|
return { success: false, error: `VSCode command not available: ${resolvedCmd || cmd}` };
|
|
4927
4966
|
}
|
|
4928
|
-
|
|
4929
|
-
case "open_tab":
|
|
4930
|
-
case "close_tab":
|
|
4931
|
-
case "open_folder":
|
|
4932
|
-
case "open_folder_picker":
|
|
4933
|
-
case "open_recent":
|
|
4934
|
-
case "get_commands":
|
|
4935
|
-
return { success: false, error: `${cmd} requires bridge-extension (removed)` };
|
|
4967
|
+
// ─── Workspace cmds ──────────────
|
|
4936
4968
|
case "get_recent_workspaces":
|
|
4937
4969
|
return this.handleGetRecentWorkspaces(args);
|
|
4938
4970
|
case "get_cli_history": {
|
|
@@ -5151,7 +5183,9 @@ var init_provider_loader = __esm({
|
|
|
5151
5183
|
if (options?.builtinDir) {
|
|
5152
5184
|
this.builtinDirs = Array.isArray(options.builtinDir) ? options.builtinDir : [options.builtinDir];
|
|
5153
5185
|
} else {
|
|
5154
|
-
|
|
5186
|
+
const bundledDir = path6.resolve(__dirname, "../providers/_builtin");
|
|
5187
|
+
const devDir = path6.resolve(__dirname, "../../providers/_builtin");
|
|
5188
|
+
this.builtinDirs = [fs5.existsSync(devDir) ? devDir : bundledDir];
|
|
5155
5189
|
}
|
|
5156
5190
|
this.userDir = options?.userDir || path6.join(os7.homedir(), ".adhdev", "providers");
|
|
5157
5191
|
this.upstreamDir = path6.join(this.userDir, ".upstream");
|
|
@@ -5383,7 +5417,6 @@ var init_provider_loader = __esm({
|
|
|
5383
5417
|
name: p.name,
|
|
5384
5418
|
displayName: p.displayName || p.name,
|
|
5385
5419
|
icon: p.icon || "\u{1F4BB}",
|
|
5386
|
-
extensionSupport: "full",
|
|
5387
5420
|
cli: p.cli,
|
|
5388
5421
|
paths: p.paths
|
|
5389
5422
|
});
|
|
@@ -26769,6 +26802,7 @@ var init_dev_server = __esm({
|
|
|
26769
26802
|
{ method: "GET", pattern: "/api/providers/versions", handler: (q, s) => this.handleDetectVersions(q, s) },
|
|
26770
26803
|
{ method: "POST", pattern: "/api/providers/reload", handler: (q, s) => this.handleReload(q, s) },
|
|
26771
26804
|
{ method: "POST", pattern: "/api/cdp/evaluate", handler: (q, s) => this.handleCdpEvaluate(q, s) },
|
|
26805
|
+
{ method: "POST", pattern: "/api/cdp/click", handler: (q, s) => this.handleCdpClick(q, s) },
|
|
26772
26806
|
{ method: "POST", pattern: "/api/cdp/dom/query", handler: (q, s) => this.handleCdpDomQuery(q, s) },
|
|
26773
26807
|
{ method: "POST", pattern: "/api/cdp/dom/inspect", handler: (q, s) => this.handleDomInspect(q, s) },
|
|
26774
26808
|
{ method: "POST", pattern: "/api/cdp/dom/children", handler: (q, s) => this.handleDomChildren(q, s) },
|
|
@@ -26799,6 +26833,7 @@ var init_dev_server = __esm({
|
|
|
26799
26833
|
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/file$/, handler: (q, s, p) => this.handleWriteFile(p[0], q, s) },
|
|
26800
26834
|
{ method: "GET", pattern: /^\/api\/providers\/([^/]+)\/source$/, handler: (q, s, p) => this.handleSource(p[0], q, s) },
|
|
26801
26835
|
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/save$/, handler: (q, s, p) => this.handleSave(p[0], q, s) },
|
|
26836
|
+
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/typeAndSend$/, handler: (q, s, p) => this.handleTypeAndSend(p[0], q, s) },
|
|
26802
26837
|
{ method: "GET", pattern: /^\/api\/providers\/([^/]+)\/config$/, handler: (q, s, p) => this.handleProviderConfig(p[0], q, s) },
|
|
26803
26838
|
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/dom-context$/, handler: (q, s, p) => this.handleDomContext(p[0], q, s) },
|
|
26804
26839
|
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/auto-implement$/, handler: (q, s, p) => this.handleAutoImplement(p[0], q, s) },
|
|
@@ -27001,7 +27036,13 @@ var init_dev_server = __esm({
|
|
|
27001
27036
|
return;
|
|
27002
27037
|
}
|
|
27003
27038
|
try {
|
|
27004
|
-
|
|
27039
|
+
let scriptCode = null;
|
|
27040
|
+
if (["sendMessage", "webviewSendMessage", "switchSession", "webviewSwitchSession", "setMode", "webviewSetMode", "setModel", "webviewSetModel"].includes(scriptName)) {
|
|
27041
|
+
const firstVal = params && typeof params === "object" && Object.keys(params).length > 0 ? Object.values(params)[0] : params;
|
|
27042
|
+
scriptCode = firstVal !== void 0 ? fn(firstVal) : fn();
|
|
27043
|
+
} else {
|
|
27044
|
+
scriptCode = params !== void 0 ? fn(params) : fn();
|
|
27045
|
+
}
|
|
27005
27046
|
if (!scriptCode) {
|
|
27006
27047
|
this.json(res, 500, { error: "Script function returned null" });
|
|
27007
27048
|
return;
|
|
@@ -27041,6 +27082,7 @@ var init_dev_server = __esm({
|
|
|
27041
27082
|
} catch {
|
|
27042
27083
|
}
|
|
27043
27084
|
}
|
|
27085
|
+
this.log(`Script raw debug: typeof=${typeof raw}, raw=${JSON.stringify(raw)}, parsed=${JSON.stringify(result)}`);
|
|
27044
27086
|
this.json(res, 200, { type, script: scriptName, result });
|
|
27045
27087
|
} catch (e) {
|
|
27046
27088
|
this.json(res, 500, { error: `Script execution failed: ${e.message}` });
|
|
@@ -27075,6 +27117,26 @@ var init_dev_server = __esm({
|
|
|
27075
27117
|
this.json(res, 500, { error: e.message });
|
|
27076
27118
|
}
|
|
27077
27119
|
}
|
|
27120
|
+
async handleCdpClick(req, res) {
|
|
27121
|
+
const body = await this.readBody(req);
|
|
27122
|
+
const { ideType, x, y } = body;
|
|
27123
|
+
if (x == null || y == null) {
|
|
27124
|
+
this.json(res, 400, { error: "x and y coordinates required" });
|
|
27125
|
+
return;
|
|
27126
|
+
}
|
|
27127
|
+
const cdp = this.getCdp(ideType);
|
|
27128
|
+
if (!cdp?.isConnected) {
|
|
27129
|
+
this.json(res, 503, { error: "No CDP connection available" });
|
|
27130
|
+
return;
|
|
27131
|
+
}
|
|
27132
|
+
try {
|
|
27133
|
+
await cdp.send("Input.dispatchMouseEvent", { type: "mousePressed", x, y, button: "left", clickCount: 1 });
|
|
27134
|
+
await cdp.send("Input.dispatchMouseEvent", { type: "mouseReleased", x, y, button: "left", clickCount: 1 });
|
|
27135
|
+
this.json(res, 200, { success: true, clicked: true, x, y });
|
|
27136
|
+
} catch (e) {
|
|
27137
|
+
this.json(res, 500, { error: e.message });
|
|
27138
|
+
}
|
|
27139
|
+
}
|
|
27078
27140
|
async handleCdpDomQuery(req, res) {
|
|
27079
27141
|
const body = await this.readBody(req);
|
|
27080
27142
|
const { selector, limit = 10, ideType } = body;
|
|
@@ -27183,6 +27245,11 @@ var init_dev_server = __esm({
|
|
|
27183
27245
|
name: p.name,
|
|
27184
27246
|
category: p.category
|
|
27185
27247
|
}));
|
|
27248
|
+
for (const cdp of this.cdpManagers.values()) {
|
|
27249
|
+
if (!cdp.isConnected) {
|
|
27250
|
+
cdp._targetId = null;
|
|
27251
|
+
}
|
|
27252
|
+
}
|
|
27186
27253
|
this.json(res, 200, { reloaded: true, providers });
|
|
27187
27254
|
} catch (e) {
|
|
27188
27255
|
this.json(res, 500, { error: e.message });
|
|
@@ -27338,7 +27405,7 @@ var init_dev_server = __esm({
|
|
|
27338
27405
|
const provider = this.providerLoader.getMeta(type);
|
|
27339
27406
|
if (!provider) return null;
|
|
27340
27407
|
const cat = provider.category;
|
|
27341
|
-
const builtinDir = this.providerLoader.
|
|
27408
|
+
const builtinDir = this.providerLoader.builtinDirs?.[0] || path12.resolve(__dirname, "../providers/_builtin");
|
|
27342
27409
|
const userDir = path12.join(os14.homedir(), ".adhdev", "providers");
|
|
27343
27410
|
const directCandidates = [
|
|
27344
27411
|
path12.join(userDir, type),
|
|
@@ -27489,6 +27556,25 @@ var init_dev_server = __esm({
|
|
|
27489
27556
|
this.json(res, 500, { error: `Save failed: ${e.message}` });
|
|
27490
27557
|
}
|
|
27491
27558
|
}
|
|
27559
|
+
async handleTypeAndSend(type, req, res) {
|
|
27560
|
+
const body = await this.readBody(req);
|
|
27561
|
+
const { selector, text } = body;
|
|
27562
|
+
if (!selector || typeof selector !== "string" || !text || typeof text !== "string") {
|
|
27563
|
+
this.json(res, 400, { error: "selector and text strings required" });
|
|
27564
|
+
return;
|
|
27565
|
+
}
|
|
27566
|
+
const cdp = this.getCdp(type);
|
|
27567
|
+
if (!cdp) {
|
|
27568
|
+
this.json(res, 503, { error: `CDP not connected for '${type}'` });
|
|
27569
|
+
return;
|
|
27570
|
+
}
|
|
27571
|
+
try {
|
|
27572
|
+
const sent = await cdp.typeAndSend(selector, text);
|
|
27573
|
+
this.json(res, 200, { sent });
|
|
27574
|
+
} catch (e) {
|
|
27575
|
+
this.json(res, 500, { error: e.message });
|
|
27576
|
+
}
|
|
27577
|
+
}
|
|
27492
27578
|
async handleScriptHints(type, _req, res) {
|
|
27493
27579
|
const dir = this.findProviderDir(type);
|
|
27494
27580
|
if (!dir) {
|
|
@@ -27724,7 +27810,7 @@ var init_dev_server = __esm({
|
|
|
27724
27810
|
if (location === "user") {
|
|
27725
27811
|
targetDir = path12.join(os14.homedir(), ".adhdev", "providers", type);
|
|
27726
27812
|
} else {
|
|
27727
|
-
const builtinDir = path12.resolve(__dirname, "../providers/_builtin");
|
|
27813
|
+
const builtinDir = this.providerLoader.builtinDirs?.[0] || path12.resolve(__dirname, "../providers/_builtin");
|
|
27728
27814
|
targetDir = path12.join(builtinDir, category, type);
|
|
27729
27815
|
}
|
|
27730
27816
|
const jsonPath = path12.join(targetDir, "provider.json");
|
|
@@ -28534,7 +28620,7 @@ var init_dev_server = __esm({
|
|
|
28534
28620
|
const domContext = null;
|
|
28535
28621
|
this.sendAutoImplSSE({ event: "progress", data: { function: "_init", status: "loading_reference", message: `\uB808\uD37C\uB7F0\uC2A4 \uC2A4\uD06C\uB9BD\uD2B8 \uB85C\uB4DC \uC911 (${reference})...` } });
|
|
28536
28622
|
let referenceScripts = {};
|
|
28537
|
-
const builtinDir = this.providerLoader.
|
|
28623
|
+
const builtinDir = this.providerLoader.builtinDirs?.[0] || path12.resolve(__dirname, "../providers/_builtin");
|
|
28538
28624
|
const refDir = path12.join(builtinDir, "ide", reference);
|
|
28539
28625
|
if (fs9.existsSync(refDir)) {
|
|
28540
28626
|
const scriptsDir = path12.join(refDir, "scripts");
|
|
@@ -28734,7 +28820,7 @@ var init_dev_server = __esm({
|
|
|
28734
28820
|
}
|
|
28735
28821
|
if (model) args.push("--model", model);
|
|
28736
28822
|
const escapedArgs = args.map((a) => `'${a.replace(/'/g, "'\\''")}'`).join(" ");
|
|
28737
|
-
const metaPrompt = `Read the file at ${promptFile} and follow ALL instructions recursively. You have full authority to implement ALL required script files, update provider.json configurations based on the reference patterns, and independently test them against 127.0.0.1:19280 via CDP CURL. Upon complete validation of ALL assigned files, print exactly "
|
|
28823
|
+
const metaPrompt = `Read the file at ${promptFile} and follow ALL instructions recursively. You have full authority to implement ALL required script files, update provider.json configurations based on the reference patterns, and independently test them against 127.0.0.1:19280 via CDP CURL. Upon complete validation of ALL assigned files, print exactly "_PIPELINE_COMPLETE_SIGNAL_" to gracefully close the pipeline. DO NOT WAIT FOR APPROVAL, execute completely autonomously.`;
|
|
28738
28824
|
shellCmd = `${command} ${escapedArgs} "${metaPrompt}"`;
|
|
28739
28825
|
} else {
|
|
28740
28826
|
const escapedArgs = baseArgs.map((a) => `'${a.replace(/'/g, "'\\''")}'`).join(" ");
|
|
@@ -28796,7 +28882,7 @@ var init_dev_server = __esm({
|
|
|
28796
28882
|
const cleanData = chunk.replace(/\x1B\[\d*[A-HJKSTfG]/g, " ").replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, "").replace(/\x1B\][^\x07]*\x07/g, "").replace(/\x1B\][^\x1B]*\x1B\\/g, "").replace(/ +/g, " ");
|
|
28797
28883
|
approvalBuffer = (approvalBuffer + cleanData).slice(-1500);
|
|
28798
28884
|
const elapsed = Date.now() - spawnedAt;
|
|
28799
|
-
if (elapsed > 15e3 && approvalBuffer.includes("
|
|
28885
|
+
if (elapsed > 15e3 && approvalBuffer.includes("_PIPELINE_COMPLETE_SIGNAL_")) {
|
|
28800
28886
|
this.log(`Agent finished task after ${Math.round(elapsed / 1e3)}s. Terminating interactive CLI session to unblock pipeline.`);
|
|
28801
28887
|
this.sendAutoImplSSE({ event: "output", data: { chunk: `
|
|
28802
28888
|
[\u{1F916} ADHDev Pipeline] Completion token detected. Proceeding...
|
|
@@ -31184,7 +31270,7 @@ var init_adhdev_daemon = __esm({
|
|
|
31184
31270
|
fs11 = __toESM(require("fs"));
|
|
31185
31271
|
path14 = __toESM(require("path"));
|
|
31186
31272
|
import_chalk2 = __toESM(require("chalk"));
|
|
31187
|
-
pkgVersion = "0.6.
|
|
31273
|
+
pkgVersion = "0.6.37";
|
|
31188
31274
|
if (pkgVersion === "unknown") {
|
|
31189
31275
|
try {
|
|
31190
31276
|
const possiblePaths = [
|
|
@@ -32413,6 +32499,32 @@ function registerDaemonCommands(program2, pkgVersion3) {
|
|
|
32413
32499
|
dev: options.dev || false
|
|
32414
32500
|
});
|
|
32415
32501
|
});
|
|
32502
|
+
program2.command("standalone").description("\u{1F5A5}\uFE0F Start ADHDev Standalone Server (Local Dashboard & Embedded Daemon)").option("-p, --port <port>", "Local HTTP/WS server port", "3847").option("--host <host>", "Bind to specific host (use 0.0.0.0 for LAN access)").option("--no-open", "Prevent opening browser automatically").option("--token <token>", "Require token authentication").option("--dev", "Enable Dev Mode").action(async (options) => {
|
|
32503
|
+
const { spawn: spawn3, execSync: execSync7 } = await import("child_process");
|
|
32504
|
+
console.log(import_chalk5.default.cyan("\n Starting ADHDev Standalone Server..."));
|
|
32505
|
+
const args = [];
|
|
32506
|
+
if (options.port) args.push("--port", options.port);
|
|
32507
|
+
if (options.host) args.push("--host", options.host);
|
|
32508
|
+
if (options.open === false) args.push("--no-open");
|
|
32509
|
+
if (options.token) args.push("--token", options.token);
|
|
32510
|
+
if (options.dev) args.push("--dev");
|
|
32511
|
+
let bin = "npx";
|
|
32512
|
+
const npxArgs = ["-y", "@adhdev/daemon-standalone@latest", ...args];
|
|
32513
|
+
try {
|
|
32514
|
+
execSync7("adhdev-standalone --help", { stdio: "ignore" });
|
|
32515
|
+
bin = "adhdev-standalone";
|
|
32516
|
+
} catch {
|
|
32517
|
+
}
|
|
32518
|
+
const spawnArgs = bin === "npx" ? npxArgs : args;
|
|
32519
|
+
const child = spawn3(bin, spawnArgs, {
|
|
32520
|
+
stdio: "inherit",
|
|
32521
|
+
shell: process.platform === "win32"
|
|
32522
|
+
});
|
|
32523
|
+
child.on("error", (err) => {
|
|
32524
|
+
console.error(import_chalk5.default.red(`
|
|
32525
|
+
\u2717 Failed to start standalone server: ${err.message}`));
|
|
32526
|
+
});
|
|
32527
|
+
});
|
|
32416
32528
|
program2.command("daemon:status").description("Check ADHDev Daemon status").action(async () => {
|
|
32417
32529
|
const { isDaemonRunning: isDaemonRunning2 } = await Promise.resolve().then(() => (init_adhdev_daemon(), adhdev_daemon_exports));
|
|
32418
32530
|
if (isDaemonRunning2()) {
|
|
@@ -32774,7 +32886,10 @@ function registerProviderCommands(program2) {
|
|
|
32774
32886
|
const pathMod = await import("path");
|
|
32775
32887
|
const fsMod = await import("fs");
|
|
32776
32888
|
const osMod = await import("os");
|
|
32777
|
-
|
|
32889
|
+
const { ProviderLoader: ProviderLoader2 } = await Promise.resolve().then(() => (init_src(), src_exports));
|
|
32890
|
+
const loader = new ProviderLoader2();
|
|
32891
|
+
const bDir = loader.builtinDirs[0];
|
|
32892
|
+
let targetDir = location === "builtin" ? pathMod.join(bDir, category, type) : pathMod.join(osMod.homedir(), ".adhdev", "providers", type);
|
|
32778
32893
|
if (fsMod.existsSync(targetDir)) return { error: `Provider already exists at ${targetDir}` };
|
|
32779
32894
|
const isExt = category === "extension";
|
|
32780
32895
|
const isIde = category === "ide";
|
|
@@ -32864,21 +32979,31 @@ function registerProviderCommands(program2) {
|
|
|
32864
32979
|
if (providerToFix && !isUserProvider(providerToFix)) {
|
|
32865
32980
|
console.log(import_chalk6.default.yellow(`
|
|
32866
32981
|
\u26A0\uFE0F [${type}] is an upstream provider.`));
|
|
32867
|
-
console.log(import_chalk6.default.yellow(` Any local modifications will be
|
|
32868
|
-
|
|
32869
|
-
|
|
32870
|
-
|
|
32871
|
-
|
|
32872
|
-
|
|
32982
|
+
console.log(import_chalk6.default.yellow(` Any local modifications will be normally OVERWRITTEN by the next auto-update!`));
|
|
32983
|
+
console.log(import_chalk6.default.gray(` We can disable upstream updates for this provider so your local edits are preserved.`));
|
|
32984
|
+
const actionAnswer = await inquirer2.prompt([{
|
|
32985
|
+
type: "list",
|
|
32986
|
+
name: "action",
|
|
32987
|
+
message: `How would you like to proceed?`,
|
|
32988
|
+
choices: [
|
|
32989
|
+
{ name: "Edit in-place (Copy locally and disable upstream updates)", value: "inplace" },
|
|
32990
|
+
{ name: `Clone to a custom provider ('my-${type}')`, value: "clone" },
|
|
32991
|
+
{ name: "Cancel", value: "cancel" }
|
|
32992
|
+
]
|
|
32873
32993
|
}]);
|
|
32874
|
-
if (
|
|
32875
|
-
|
|
32876
|
-
|
|
32877
|
-
|
|
32994
|
+
if (actionAnswer.action === "cancel") {
|
|
32995
|
+
console.log(import_chalk6.default.red("\n\u2717 Fix aborted.\n"));
|
|
32996
|
+
process.exit(1);
|
|
32997
|
+
}
|
|
32998
|
+
const pathMod2 = await import("path");
|
|
32999
|
+
const fsMod2 = await import("fs");
|
|
33000
|
+
const osMod2 = await import("os");
|
|
33001
|
+
const bDir = loader.builtinDirs[0];
|
|
33002
|
+
const builtinSrc = pathMod2.join(bDir, providerToFix.category, type);
|
|
33003
|
+
const downloadedSrc = pathMod2.join(osMod2.homedir(), ".adhdev", "providers", ".upstream", providerToFix.category, type);
|
|
33004
|
+
const sourceDir = fsMod2.existsSync(builtinSrc) ? builtinSrc : downloadedSrc;
|
|
33005
|
+
if (actionAnswer.action === "clone") {
|
|
32878
33006
|
const newType = `my-${type}`;
|
|
32879
|
-
const builtinSrc = pathMod2.resolve(__dirname, "../../providers/_builtin", providerToFix.category, type);
|
|
32880
|
-
const downloadedSrc = pathMod2.join(osMod2.homedir(), ".adhdev", "providers", ".upstream", providerToFix.category, type);
|
|
32881
|
-
const sourceDir = fsMod2.existsSync(builtinSrc) ? builtinSrc : downloadedSrc;
|
|
32882
33007
|
const targetDir = pathMod2.join(osMod2.homedir(), ".adhdev", "providers", newType);
|
|
32883
33008
|
if (fsMod2.existsSync(targetDir)) {
|
|
32884
33009
|
console.log(import_chalk6.default.red(`
|
|
@@ -32896,10 +33021,19 @@ function registerProviderCommands(program2) {
|
|
|
32896
33021
|
console.log(import_chalk6.default.green(`
|
|
32897
33022
|
\u2713 Successfully cloned to [${newType}]`));
|
|
32898
33023
|
type = newType;
|
|
32899
|
-
} else {
|
|
32900
|
-
|
|
32901
|
-
|
|
32902
|
-
|
|
33024
|
+
} else if (actionAnswer.action === "inplace") {
|
|
33025
|
+
const targetDir = pathMod2.join(osMod2.homedir(), ".adhdev", "providers", type);
|
|
33026
|
+
if (!fsMod2.existsSync(targetDir)) {
|
|
33027
|
+
fsMod2.cpSync(sourceDir, targetDir, { recursive: true });
|
|
33028
|
+
}
|
|
33029
|
+
const pJsonPath = pathMod2.join(targetDir, "provider.json");
|
|
33030
|
+
if (fsMod2.existsSync(pJsonPath)) {
|
|
33031
|
+
const pJson = JSON.parse(fsMod2.readFileSync(pJsonPath, "utf8"));
|
|
33032
|
+
pJson.disableUpstream = true;
|
|
33033
|
+
fsMod2.writeFileSync(pJsonPath, JSON.stringify(pJson, null, 2));
|
|
33034
|
+
}
|
|
33035
|
+
console.log(import_chalk6.default.green(`
|
|
33036
|
+
\u2713 Local copy created at [${targetDir}] with upstream updates disabled.`));
|
|
32903
33037
|
}
|
|
32904
33038
|
}
|
|
32905
33039
|
let agentName = options.agent || "codex-cli";
|
|
@@ -33192,8 +33326,8 @@ function registerProviderCommands(program2) {
|
|
|
33192
33326
|
const osMod = await import("os");
|
|
33193
33327
|
const possiblePaths = [
|
|
33194
33328
|
pathMod.join(osMod.homedir(), ".adhdev", "providers", type, "provider.js"),
|
|
33195
|
-
pathMod.resolve(
|
|
33196
|
-
pathMod.resolve(
|
|
33329
|
+
pathMod.join(new (await Promise.resolve().then(() => (init_src(), src_exports))).ProviderLoader().builtinDirs[0], "ide", type, "provider.js"),
|
|
33330
|
+
pathMod.join(new (await Promise.resolve().then(() => (init_src(), src_exports))).ProviderLoader().builtinDirs[0], "extension", type, "provider.js")
|
|
33197
33331
|
];
|
|
33198
33332
|
for (const p of possiblePaths) {
|
|
33199
33333
|
if (fsMod.existsSync(p)) {
|
|
@@ -33560,6 +33694,7 @@ if (process.argv.length <= 2) {
|
|
|
33560
33694
|
console.log();
|
|
33561
33695
|
console.log(import_chalk7.default.gray(" Quick start:"));
|
|
33562
33696
|
console.log(import_chalk7.default.gray(" adhdev daemon \u2014 Start unified daemon (Required)"));
|
|
33697
|
+
console.log(import_chalk7.default.gray(" adhdev standalone \u2014 Start standalone local dashboard & daemon"));
|
|
33563
33698
|
console.log(import_chalk7.default.gray(" adhdev launch cursor \u2014 Launch IDE with CDP (e.g. cursor, windsurf)"));
|
|
33564
33699
|
console.log(import_chalk7.default.gray(" adhdev launch claude \u2014 Launch CLI agent (e.g. gemini, claude)"));
|
|
33565
33700
|
console.log(import_chalk7.default.gray(" adhdev setup \u2014 First-time setup & configuration"));
|