adhdev 0.6.35 → 0.6.36
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 +146 -35
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +104 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1288,21 +1288,41 @@ var init_manager = __esm({
|
|
|
1288
1288
|
clickCount: 1
|
|
1289
1289
|
});
|
|
1290
1290
|
await new Promise((r) => setTimeout(r, 150));
|
|
1291
|
-
|
|
1291
|
+
const lines = text.split("\n");
|
|
1292
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1293
|
+
if (lines[i].length > 0) {
|
|
1294
|
+
await this.sendInternal("Input.insertText", { text: lines[i] });
|
|
1295
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
1296
|
+
}
|
|
1297
|
+
if (i < lines.length - 1) {
|
|
1298
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "rawKeyDown", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, modifiers: 8 });
|
|
1299
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "char", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, text: "\r", unmodifiedText: "\r", modifiers: 8 });
|
|
1300
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "keyUp", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, modifiers: 8 });
|
|
1301
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1292
1304
|
await new Promise((r) => setTimeout(r, 200));
|
|
1293
1305
|
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1294
1306
|
type: "rawKeyDown",
|
|
1295
1307
|
key: "Enter",
|
|
1296
1308
|
code: "Enter",
|
|
1297
1309
|
windowsVirtualKeyCode: 13,
|
|
1298
|
-
|
|
1310
|
+
text: "\r",
|
|
1311
|
+
unmodifiedText: "\r"
|
|
1299
1312
|
});
|
|
1300
1313
|
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1301
|
-
type: "
|
|
1314
|
+
type: "char",
|
|
1302
1315
|
key: "Enter",
|
|
1303
1316
|
code: "Enter",
|
|
1304
1317
|
windowsVirtualKeyCode: 13,
|
|
1305
|
-
|
|
1318
|
+
text: "\r",
|
|
1319
|
+
unmodifiedText: "\r"
|
|
1320
|
+
});
|
|
1321
|
+
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1322
|
+
type: "keyUp",
|
|
1323
|
+
key: "Enter",
|
|
1324
|
+
code: "Enter",
|
|
1325
|
+
windowsVirtualKeyCode: 13
|
|
1306
1326
|
});
|
|
1307
1327
|
this.log(`[CDP] typeAndSend: sent "${text.substring(0, 50)}..."`);
|
|
1308
1328
|
return true;
|
|
@@ -1356,21 +1376,41 @@ var init_manager = __esm({
|
|
|
1356
1376
|
windowsVirtualKeyCode: 8
|
|
1357
1377
|
});
|
|
1358
1378
|
await new Promise((r) => setTimeout(r, 150));
|
|
1359
|
-
|
|
1379
|
+
const lines = text.split("\n");
|
|
1380
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1381
|
+
if (lines[i].length > 0) {
|
|
1382
|
+
await this.sendInternal("Input.insertText", { text: lines[i] });
|
|
1383
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
1384
|
+
}
|
|
1385
|
+
if (i < lines.length - 1) {
|
|
1386
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "rawKeyDown", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, modifiers: 8 });
|
|
1387
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "char", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, text: "\r", unmodifiedText: "\r", modifiers: 8 });
|
|
1388
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "keyUp", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, modifiers: 8 });
|
|
1389
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1360
1392
|
await new Promise((r) => setTimeout(r, 200));
|
|
1361
1393
|
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1362
1394
|
type: "rawKeyDown",
|
|
1363
1395
|
key: "Enter",
|
|
1364
1396
|
code: "Enter",
|
|
1365
1397
|
windowsVirtualKeyCode: 13,
|
|
1366
|
-
|
|
1398
|
+
text: "\r",
|
|
1399
|
+
unmodifiedText: "\r"
|
|
1367
1400
|
});
|
|
1368
1401
|
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1369
|
-
type: "
|
|
1402
|
+
type: "char",
|
|
1370
1403
|
key: "Enter",
|
|
1371
1404
|
code: "Enter",
|
|
1372
1405
|
windowsVirtualKeyCode: 13,
|
|
1373
|
-
|
|
1406
|
+
text: "\r",
|
|
1407
|
+
unmodifiedText: "\r"
|
|
1408
|
+
});
|
|
1409
|
+
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1410
|
+
type: "keyUp",
|
|
1411
|
+
key: "Enter",
|
|
1412
|
+
code: "Enter",
|
|
1413
|
+
windowsVirtualKeyCode: 13
|
|
1374
1414
|
});
|
|
1375
1415
|
this.log(`[CDP] typeAndSendAt(${Math.round(x)},${Math.round(y)}): sent "${text.substring(0, 50)}..."`);
|
|
1376
1416
|
return true;
|
|
@@ -5151,7 +5191,9 @@ var init_provider_loader = __esm({
|
|
|
5151
5191
|
if (options?.builtinDir) {
|
|
5152
5192
|
this.builtinDirs = Array.isArray(options.builtinDir) ? options.builtinDir : [options.builtinDir];
|
|
5153
5193
|
} else {
|
|
5154
|
-
|
|
5194
|
+
const bundledDir = path6.resolve(__dirname, "../providers/_builtin");
|
|
5195
|
+
const devDir = path6.resolve(__dirname, "../../providers/_builtin");
|
|
5196
|
+
this.builtinDirs = [fs5.existsSync(devDir) ? devDir : bundledDir];
|
|
5155
5197
|
}
|
|
5156
5198
|
this.userDir = options?.userDir || path6.join(os7.homedir(), ".adhdev", "providers");
|
|
5157
5199
|
this.upstreamDir = path6.join(this.userDir, ".upstream");
|
|
@@ -26769,6 +26811,7 @@ var init_dev_server = __esm({
|
|
|
26769
26811
|
{ method: "GET", pattern: "/api/providers/versions", handler: (q, s) => this.handleDetectVersions(q, s) },
|
|
26770
26812
|
{ method: "POST", pattern: "/api/providers/reload", handler: (q, s) => this.handleReload(q, s) },
|
|
26771
26813
|
{ method: "POST", pattern: "/api/cdp/evaluate", handler: (q, s) => this.handleCdpEvaluate(q, s) },
|
|
26814
|
+
{ method: "POST", pattern: "/api/cdp/click", handler: (q, s) => this.handleCdpClick(q, s) },
|
|
26772
26815
|
{ method: "POST", pattern: "/api/cdp/dom/query", handler: (q, s) => this.handleCdpDomQuery(q, s) },
|
|
26773
26816
|
{ method: "POST", pattern: "/api/cdp/dom/inspect", handler: (q, s) => this.handleDomInspect(q, s) },
|
|
26774
26817
|
{ method: "POST", pattern: "/api/cdp/dom/children", handler: (q, s) => this.handleDomChildren(q, s) },
|
|
@@ -26799,6 +26842,7 @@ var init_dev_server = __esm({
|
|
|
26799
26842
|
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/file$/, handler: (q, s, p) => this.handleWriteFile(p[0], q, s) },
|
|
26800
26843
|
{ method: "GET", pattern: /^\/api\/providers\/([^/]+)\/source$/, handler: (q, s, p) => this.handleSource(p[0], q, s) },
|
|
26801
26844
|
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/save$/, handler: (q, s, p) => this.handleSave(p[0], q, s) },
|
|
26845
|
+
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/typeAndSend$/, handler: (q, s, p) => this.handleTypeAndSend(p[0], q, s) },
|
|
26802
26846
|
{ method: "GET", pattern: /^\/api\/providers\/([^/]+)\/config$/, handler: (q, s, p) => this.handleProviderConfig(p[0], q, s) },
|
|
26803
26847
|
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/dom-context$/, handler: (q, s, p) => this.handleDomContext(p[0], q, s) },
|
|
26804
26848
|
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/auto-implement$/, handler: (q, s, p) => this.handleAutoImplement(p[0], q, s) },
|
|
@@ -27041,6 +27085,7 @@ var init_dev_server = __esm({
|
|
|
27041
27085
|
} catch {
|
|
27042
27086
|
}
|
|
27043
27087
|
}
|
|
27088
|
+
this.log(`Script raw debug: typeof=${typeof raw}, raw=${JSON.stringify(raw)}, parsed=${JSON.stringify(result)}`);
|
|
27044
27089
|
this.json(res, 200, { type, script: scriptName, result });
|
|
27045
27090
|
} catch (e) {
|
|
27046
27091
|
this.json(res, 500, { error: `Script execution failed: ${e.message}` });
|
|
@@ -27075,6 +27120,26 @@ var init_dev_server = __esm({
|
|
|
27075
27120
|
this.json(res, 500, { error: e.message });
|
|
27076
27121
|
}
|
|
27077
27122
|
}
|
|
27123
|
+
async handleCdpClick(req, res) {
|
|
27124
|
+
const body = await this.readBody(req);
|
|
27125
|
+
const { ideType, x, y } = body;
|
|
27126
|
+
if (x == null || y == null) {
|
|
27127
|
+
this.json(res, 400, { error: "x and y coordinates required" });
|
|
27128
|
+
return;
|
|
27129
|
+
}
|
|
27130
|
+
const cdp = this.getCdp(ideType);
|
|
27131
|
+
if (!cdp?.isConnected) {
|
|
27132
|
+
this.json(res, 503, { error: "No CDP connection available" });
|
|
27133
|
+
return;
|
|
27134
|
+
}
|
|
27135
|
+
try {
|
|
27136
|
+
await cdp.send("Input.dispatchMouseEvent", { type: "mousePressed", x, y, button: "left", clickCount: 1 });
|
|
27137
|
+
await cdp.send("Input.dispatchMouseEvent", { type: "mouseReleased", x, y, button: "left", clickCount: 1 });
|
|
27138
|
+
this.json(res, 200, { success: true, clicked: true, x, y });
|
|
27139
|
+
} catch (e) {
|
|
27140
|
+
this.json(res, 500, { error: e.message });
|
|
27141
|
+
}
|
|
27142
|
+
}
|
|
27078
27143
|
async handleCdpDomQuery(req, res) {
|
|
27079
27144
|
const body = await this.readBody(req);
|
|
27080
27145
|
const { selector, limit = 10, ideType } = body;
|
|
@@ -27183,6 +27248,11 @@ var init_dev_server = __esm({
|
|
|
27183
27248
|
name: p.name,
|
|
27184
27249
|
category: p.category
|
|
27185
27250
|
}));
|
|
27251
|
+
for (const cdp of this.cdpManagers.values()) {
|
|
27252
|
+
if (!cdp.isConnected) {
|
|
27253
|
+
cdp._targetId = null;
|
|
27254
|
+
}
|
|
27255
|
+
}
|
|
27186
27256
|
this.json(res, 200, { reloaded: true, providers });
|
|
27187
27257
|
} catch (e) {
|
|
27188
27258
|
this.json(res, 500, { error: e.message });
|
|
@@ -27338,7 +27408,7 @@ var init_dev_server = __esm({
|
|
|
27338
27408
|
const provider = this.providerLoader.getMeta(type);
|
|
27339
27409
|
if (!provider) return null;
|
|
27340
27410
|
const cat = provider.category;
|
|
27341
|
-
const builtinDir = this.providerLoader.
|
|
27411
|
+
const builtinDir = this.providerLoader.builtinDirs?.[0] || path12.resolve(__dirname, "../providers/_builtin");
|
|
27342
27412
|
const userDir = path12.join(os14.homedir(), ".adhdev", "providers");
|
|
27343
27413
|
const directCandidates = [
|
|
27344
27414
|
path12.join(userDir, type),
|
|
@@ -27489,6 +27559,25 @@ var init_dev_server = __esm({
|
|
|
27489
27559
|
this.json(res, 500, { error: `Save failed: ${e.message}` });
|
|
27490
27560
|
}
|
|
27491
27561
|
}
|
|
27562
|
+
async handleTypeAndSend(type, req, res) {
|
|
27563
|
+
const body = await this.readBody(req);
|
|
27564
|
+
const { selector, text } = body;
|
|
27565
|
+
if (!selector || typeof selector !== "string" || !text || typeof text !== "string") {
|
|
27566
|
+
this.json(res, 400, { error: "selector and text strings required" });
|
|
27567
|
+
return;
|
|
27568
|
+
}
|
|
27569
|
+
const cdp = this.getCdp(type);
|
|
27570
|
+
if (!cdp) {
|
|
27571
|
+
this.json(res, 503, { error: `CDP not connected for '${type}'` });
|
|
27572
|
+
return;
|
|
27573
|
+
}
|
|
27574
|
+
try {
|
|
27575
|
+
const sent = await cdp.typeAndSend(selector, text);
|
|
27576
|
+
this.json(res, 200, { sent });
|
|
27577
|
+
} catch (e) {
|
|
27578
|
+
this.json(res, 500, { error: e.message });
|
|
27579
|
+
}
|
|
27580
|
+
}
|
|
27492
27581
|
async handleScriptHints(type, _req, res) {
|
|
27493
27582
|
const dir = this.findProviderDir(type);
|
|
27494
27583
|
if (!dir) {
|
|
@@ -27724,7 +27813,7 @@ var init_dev_server = __esm({
|
|
|
27724
27813
|
if (location === "user") {
|
|
27725
27814
|
targetDir = path12.join(os14.homedir(), ".adhdev", "providers", type);
|
|
27726
27815
|
} else {
|
|
27727
|
-
const builtinDir = path12.resolve(__dirname, "../providers/_builtin");
|
|
27816
|
+
const builtinDir = this.providerLoader.builtinDirs?.[0] || path12.resolve(__dirname, "../providers/_builtin");
|
|
27728
27817
|
targetDir = path12.join(builtinDir, category, type);
|
|
27729
27818
|
}
|
|
27730
27819
|
const jsonPath = path12.join(targetDir, "provider.json");
|
|
@@ -28534,7 +28623,7 @@ var init_dev_server = __esm({
|
|
|
28534
28623
|
const domContext = null;
|
|
28535
28624
|
this.sendAutoImplSSE({ event: "progress", data: { function: "_init", status: "loading_reference", message: `\uB808\uD37C\uB7F0\uC2A4 \uC2A4\uD06C\uB9BD\uD2B8 \uB85C\uB4DC \uC911 (${reference})...` } });
|
|
28536
28625
|
let referenceScripts = {};
|
|
28537
|
-
const builtinDir = this.providerLoader.
|
|
28626
|
+
const builtinDir = this.providerLoader.builtinDirs?.[0] || path12.resolve(__dirname, "../providers/_builtin");
|
|
28538
28627
|
const refDir = path12.join(builtinDir, "ide", reference);
|
|
28539
28628
|
if (fs9.existsSync(refDir)) {
|
|
28540
28629
|
const scriptsDir = path12.join(refDir, "scripts");
|
|
@@ -28734,7 +28823,7 @@ var init_dev_server = __esm({
|
|
|
28734
28823
|
}
|
|
28735
28824
|
if (model) args.push("--model", model);
|
|
28736
28825
|
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 "
|
|
28826
|
+
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
28827
|
shellCmd = `${command} ${escapedArgs} "${metaPrompt}"`;
|
|
28739
28828
|
} else {
|
|
28740
28829
|
const escapedArgs = baseArgs.map((a) => `'${a.replace(/'/g, "'\\''")}'`).join(" ");
|
|
@@ -28796,7 +28885,7 @@ var init_dev_server = __esm({
|
|
|
28796
28885
|
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
28886
|
approvalBuffer = (approvalBuffer + cleanData).slice(-1500);
|
|
28798
28887
|
const elapsed = Date.now() - spawnedAt;
|
|
28799
|
-
if (elapsed > 15e3 && approvalBuffer.includes("
|
|
28888
|
+
if (elapsed > 15e3 && approvalBuffer.includes("_PIPELINE_COMPLETE_SIGNAL_")) {
|
|
28800
28889
|
this.log(`Agent finished task after ${Math.round(elapsed / 1e3)}s. Terminating interactive CLI session to unblock pipeline.`);
|
|
28801
28890
|
this.sendAutoImplSSE({ event: "output", data: { chunk: `
|
|
28802
28891
|
[\u{1F916} ADHDev Pipeline] Completion token detected. Proceeding...
|
|
@@ -31184,7 +31273,7 @@ var init_adhdev_daemon = __esm({
|
|
|
31184
31273
|
fs11 = __toESM(require("fs"));
|
|
31185
31274
|
path14 = __toESM(require("path"));
|
|
31186
31275
|
import_chalk2 = __toESM(require("chalk"));
|
|
31187
|
-
pkgVersion = "0.6.
|
|
31276
|
+
pkgVersion = "0.6.36";
|
|
31188
31277
|
if (pkgVersion === "unknown") {
|
|
31189
31278
|
try {
|
|
31190
31279
|
const possiblePaths = [
|
|
@@ -32774,7 +32863,10 @@ function registerProviderCommands(program2) {
|
|
|
32774
32863
|
const pathMod = await import("path");
|
|
32775
32864
|
const fsMod = await import("fs");
|
|
32776
32865
|
const osMod = await import("os");
|
|
32777
|
-
|
|
32866
|
+
const { ProviderLoader: ProviderLoader2 } = await Promise.resolve().then(() => (init_src(), src_exports));
|
|
32867
|
+
const loader = new ProviderLoader2();
|
|
32868
|
+
const bDir = loader.builtinDirs[0];
|
|
32869
|
+
let targetDir = location === "builtin" ? pathMod.join(bDir, category, type) : pathMod.join(osMod.homedir(), ".adhdev", "providers", type);
|
|
32778
32870
|
if (fsMod.existsSync(targetDir)) return { error: `Provider already exists at ${targetDir}` };
|
|
32779
32871
|
const isExt = category === "extension";
|
|
32780
32872
|
const isIde = category === "ide";
|
|
@@ -32864,21 +32956,31 @@ function registerProviderCommands(program2) {
|
|
|
32864
32956
|
if (providerToFix && !isUserProvider(providerToFix)) {
|
|
32865
32957
|
console.log(import_chalk6.default.yellow(`
|
|
32866
32958
|
\u26A0\uFE0F [${type}] is an upstream provider.`));
|
|
32867
|
-
console.log(import_chalk6.default.yellow(` Any local modifications will be
|
|
32868
|
-
|
|
32869
|
-
|
|
32870
|
-
|
|
32871
|
-
|
|
32872
|
-
|
|
32959
|
+
console.log(import_chalk6.default.yellow(` Any local modifications will be normally OVERWRITTEN by the next auto-update!`));
|
|
32960
|
+
console.log(import_chalk6.default.gray(` We can disable upstream updates for this provider so your local edits are preserved.`));
|
|
32961
|
+
const actionAnswer = await inquirer2.prompt([{
|
|
32962
|
+
type: "list",
|
|
32963
|
+
name: "action",
|
|
32964
|
+
message: `How would you like to proceed?`,
|
|
32965
|
+
choices: [
|
|
32966
|
+
{ name: "Edit in-place (Copy locally and disable upstream updates)", value: "inplace" },
|
|
32967
|
+
{ name: `Clone to a custom provider ('my-${type}')`, value: "clone" },
|
|
32968
|
+
{ name: "Cancel", value: "cancel" }
|
|
32969
|
+
]
|
|
32873
32970
|
}]);
|
|
32874
|
-
if (
|
|
32875
|
-
|
|
32876
|
-
|
|
32877
|
-
|
|
32971
|
+
if (actionAnswer.action === "cancel") {
|
|
32972
|
+
console.log(import_chalk6.default.red("\n\u2717 Fix aborted.\n"));
|
|
32973
|
+
process.exit(1);
|
|
32974
|
+
}
|
|
32975
|
+
const pathMod2 = await import("path");
|
|
32976
|
+
const fsMod2 = await import("fs");
|
|
32977
|
+
const osMod2 = await import("os");
|
|
32978
|
+
const bDir = loader.builtinDirs[0];
|
|
32979
|
+
const builtinSrc = pathMod2.join(bDir, providerToFix.category, type);
|
|
32980
|
+
const downloadedSrc = pathMod2.join(osMod2.homedir(), ".adhdev", "providers", ".upstream", providerToFix.category, type);
|
|
32981
|
+
const sourceDir = fsMod2.existsSync(builtinSrc) ? builtinSrc : downloadedSrc;
|
|
32982
|
+
if (actionAnswer.action === "clone") {
|
|
32878
32983
|
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
32984
|
const targetDir = pathMod2.join(osMod2.homedir(), ".adhdev", "providers", newType);
|
|
32883
32985
|
if (fsMod2.existsSync(targetDir)) {
|
|
32884
32986
|
console.log(import_chalk6.default.red(`
|
|
@@ -32896,10 +32998,19 @@ function registerProviderCommands(program2) {
|
|
|
32896
32998
|
console.log(import_chalk6.default.green(`
|
|
32897
32999
|
\u2713 Successfully cloned to [${newType}]`));
|
|
32898
33000
|
type = newType;
|
|
32899
|
-
} else {
|
|
32900
|
-
|
|
32901
|
-
|
|
32902
|
-
|
|
33001
|
+
} else if (actionAnswer.action === "inplace") {
|
|
33002
|
+
const targetDir = pathMod2.join(osMod2.homedir(), ".adhdev", "providers", type);
|
|
33003
|
+
if (!fsMod2.existsSync(targetDir)) {
|
|
33004
|
+
fsMod2.cpSync(sourceDir, targetDir, { recursive: true });
|
|
33005
|
+
}
|
|
33006
|
+
const pJsonPath = pathMod2.join(targetDir, "provider.json");
|
|
33007
|
+
if (fsMod2.existsSync(pJsonPath)) {
|
|
33008
|
+
const pJson = JSON.parse(fsMod2.readFileSync(pJsonPath, "utf8"));
|
|
33009
|
+
pJson.disableUpstream = true;
|
|
33010
|
+
fsMod2.writeFileSync(pJsonPath, JSON.stringify(pJson, null, 2));
|
|
33011
|
+
}
|
|
33012
|
+
console.log(import_chalk6.default.green(`
|
|
33013
|
+
\u2713 Local copy created at [${targetDir}] with upstream updates disabled.`));
|
|
32903
33014
|
}
|
|
32904
33015
|
}
|
|
32905
33016
|
let agentName = options.agent || "codex-cli";
|
|
@@ -33192,8 +33303,8 @@ function registerProviderCommands(program2) {
|
|
|
33192
33303
|
const osMod = await import("os");
|
|
33193
33304
|
const possiblePaths = [
|
|
33194
33305
|
pathMod.join(osMod.homedir(), ".adhdev", "providers", type, "provider.js"),
|
|
33195
|
-
pathMod.resolve(
|
|
33196
|
-
pathMod.resolve(
|
|
33306
|
+
pathMod.join(new (await Promise.resolve().then(() => (init_src(), src_exports))).ProviderLoader().builtinDirs[0], "ide", type, "provider.js"),
|
|
33307
|
+
pathMod.join(new (await Promise.resolve().then(() => (init_src(), src_exports))).ProviderLoader().builtinDirs[0], "extension", type, "provider.js")
|
|
33197
33308
|
];
|
|
33198
33309
|
for (const p of possiblePaths) {
|
|
33199
33310
|
if (fsMod.existsSync(p)) {
|