@adhdev/daemon-core 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/index.d.ts +2 -1
- package/dist/index.js +112 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/providers/_builtin/acp/codex-cli/provider.json +2 -2
- package/providers/_builtin/cli/codex-cli/provider.json +8 -18
- package/providers/_builtin/ide/antigravity/provider.json +2 -3
- package/providers/_builtin/ide/cursor/provider.json +2 -2
- package/providers/_builtin/ide/cursor/scripts/{0.49 → 1.0}/read_chat.js +1 -1
- package/providers/_builtin/ide/cursor/scripts/{0.49 → 1.0}/resolve_action.js +1 -1
- package/providers/_builtin/ide/windsurf/scripts/1.0/focus_editor.js +16 -10
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_chats.js +9 -103
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_models.js +43 -26
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_modes.js +51 -27
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_sessions.js +79 -0
- package/providers/_builtin/ide/windsurf/scripts/1.0/new_session.js +30 -41
- package/providers/_builtin/ide/windsurf/scripts/1.0/open_panel.js +44 -35
- package/providers/_builtin/ide/windsurf/scripts/1.0/read_chat.js +211 -273
- package/providers/_builtin/ide/windsurf/scripts/1.0/resolve_action.js +64 -50
- package/providers/_builtin/ide/windsurf/scripts/1.0/send_message.js +14 -81
- package/providers/_builtin/ide/windsurf/scripts/1.0/set_mode.js +34 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0/set_model.js +40 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0/switch_session.js +66 -42
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/focus_editor.js +30 -0
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_chats.js +117 -0
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_models.js +39 -0
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_modes.js +39 -0
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/new_session.js +69 -0
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/open_panel.js +58 -0
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/read_chat.js +315 -0
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/resolve_action.js +68 -0
- package/providers/_builtin/ide/{cursor/scripts/0.49 → windsurf/scripts/1.0.bak}/scripts.js +27 -23
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/send_message.js +87 -0
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/set_mode.js +15 -0
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/set_model.js +15 -0
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/switch_session.js +58 -0
- package/providers/_builtin/registry.json +5 -9
- package/src/cdp/manager.ts +38 -12
- package/src/commands/handler.ts +1 -8
- package/src/daemon/dev-server.ts +66 -8
- package/src/detection/ide-detector.ts +0 -3
- package/src/providers/provider-loader.ts +4 -2
- package/providers/_builtin/ide/antigravity/scripts/1.106/list_models.js +0 -38
- package/providers/_builtin/ide/antigravity/scripts/1.106/list_modes.js +0 -48
- package/providers/_builtin/ide/antigravity/scripts/1.106/read_chat.js +0 -290
- package/providers/_builtin/ide/antigravity/scripts/1.106/scripts.js +0 -57
- package/providers/_builtin/ide/antigravity/scripts/1.106/set_mode.js +0 -34
- package/providers/_builtin/ide/antigravity/scripts/1.106/set_model.js +0 -47
- package/providers/_builtin/ide/antigravity/scripts/1.107/focus_editor.js +0 -20
- package/providers/_builtin/ide/antigravity/scripts/1.107/list_chats.js +0 -137
- package/providers/_builtin/ide/antigravity/scripts/1.107/new_session.js +0 -75
- package/providers/_builtin/ide/antigravity/scripts/1.107/resolve_action.js +0 -63
- package/providers/_builtin/ide/antigravity/scripts/1.107/send_message.js +0 -56
- package/providers/_builtin/ide/antigravity/scripts/1.107/switch_session.js +0 -114
- package/providers/_builtin/ide/cursor/scripts/0.49/dismiss_notification.js +0 -30
- package/providers/_builtin/ide/cursor/scripts/0.49/focus_editor.js +0 -13
- package/providers/_builtin/ide/cursor/scripts/0.49/list_models.js +0 -78
- package/providers/_builtin/ide/cursor/scripts/0.49/list_modes.js +0 -40
- package/providers/_builtin/ide/cursor/scripts/0.49/list_notifications.js +0 -23
- package/providers/_builtin/ide/cursor/scripts/0.49/new_session.js +0 -20
- package/providers/_builtin/ide/cursor/scripts/0.49/open_panel.js +0 -23
- package/providers/_builtin/ide/cursor/scripts/0.49/send_message.js +0 -23
- package/providers/_builtin/ide/cursor/scripts/0.49/set_mode.js +0 -38
- package/providers/_builtin/ide/cursor/scripts/0.49/set_model.js +0 -81
- package/providers/_builtin/ide/cursor/scripts/0.49/switch_session.js +0 -28
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/list_sessions.js +0 -42
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/read_chat.js +0 -79
- package/providers/_builtin/ide/cursor/scripts/0.49.bak/resolve_action.js +0 -19
- /package/providers/_builtin/ide/antigravity/scripts/{1.106 → 1.0}/focus_editor.js +0 -0
- /package/providers/_builtin/ide/antigravity/scripts/{1.106 → 1.0}/list_chats.js +0 -0
- /package/providers/_builtin/ide/antigravity/scripts/{1.107 → 1.0}/list_models.js +0 -0
- /package/providers/_builtin/ide/antigravity/scripts/{1.107 → 1.0}/list_modes.js +0 -0
- /package/providers/_builtin/ide/antigravity/scripts/{1.106 → 1.0}/new_session.js +0 -0
- /package/providers/_builtin/ide/antigravity/scripts/{1.107 → 1.0}/read_chat.js +0 -0
- /package/providers/_builtin/ide/antigravity/scripts/{1.106 → 1.0}/resolve_action.js +0 -0
- /package/providers/_builtin/ide/antigravity/scripts/{1.107 → 1.0}/scripts.js +0 -0
- /package/providers/_builtin/ide/antigravity/scripts/{1.106 → 1.0}/send_message.js +0 -0
- /package/providers/_builtin/ide/antigravity/scripts/{1.107 → 1.0}/set_mode.js +0 -0
- /package/providers/_builtin/ide/antigravity/scripts/{1.107 → 1.0}/set_model.js +0 -0
- /package/providers/_builtin/ide/antigravity/scripts/{1.106 → 1.0}/switch_session.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/dismiss_notification.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/focus_editor.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/list_models.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/list_modes.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/list_notifications.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49 → 1.0}/list_sessions.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/new_session.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/open_panel.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/scripts.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/send_message.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/set_mode.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/set_model.js +0 -0
- /package/providers/_builtin/ide/cursor/scripts/{0.49.bak → 1.0}/switch_session.js +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -881,7 +881,6 @@ interface IDEInfo {
|
|
|
881
881
|
cliCommand: string | null;
|
|
882
882
|
version: string | null;
|
|
883
883
|
icon: string;
|
|
884
|
-
extensionSupport: 'full' | 'partial' | 'none';
|
|
885
884
|
notes?: string;
|
|
886
885
|
}
|
|
887
886
|
declare function detectIDEs(): Promise<IDEInfo[]>;
|
|
@@ -2810,6 +2809,7 @@ declare class DevServer {
|
|
|
2810
2809
|
private handleSpawnTest;
|
|
2811
2810
|
private handleRunScript;
|
|
2812
2811
|
private handleCdpEvaluate;
|
|
2812
|
+
private handleCdpClick;
|
|
2813
2813
|
private handleCdpDomQuery;
|
|
2814
2814
|
private handleScreenshot;
|
|
2815
2815
|
private handleScriptsRun;
|
|
@@ -2833,6 +2833,7 @@ declare class DevServer {
|
|
|
2833
2833
|
private handleWriteFile;
|
|
2834
2834
|
private handleSource;
|
|
2835
2835
|
private handleSave;
|
|
2836
|
+
private handleTypeAndSend;
|
|
2836
2837
|
private handleScriptHints;
|
|
2837
2838
|
private handleValidate;
|
|
2838
2839
|
private handleAcpChat;
|
package/dist/index.js
CHANGED
|
@@ -1420,8 +1420,7 @@ async function detectIDEs() {
|
|
|
1420
1420
|
path: appPath || cliPath,
|
|
1421
1421
|
cliCommand: resolvedCli || null,
|
|
1422
1422
|
version,
|
|
1423
|
-
icon: def.icon
|
|
1424
|
-
extensionSupport: def.extensionSupport
|
|
1423
|
+
icon: def.icon
|
|
1425
1424
|
});
|
|
1426
1425
|
}
|
|
1427
1426
|
return results;
|
|
@@ -1967,21 +1966,41 @@ var DaemonCdpManager = class {
|
|
|
1967
1966
|
clickCount: 1
|
|
1968
1967
|
});
|
|
1969
1968
|
await new Promise((r) => setTimeout(r, 150));
|
|
1970
|
-
|
|
1969
|
+
const lines = text.split("\n");
|
|
1970
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1971
|
+
if (lines[i].length > 0) {
|
|
1972
|
+
await this.sendInternal("Input.insertText", { text: lines[i] });
|
|
1973
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
1974
|
+
}
|
|
1975
|
+
if (i < lines.length - 1) {
|
|
1976
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "rawKeyDown", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, modifiers: 8 });
|
|
1977
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "char", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, text: "\r", unmodifiedText: "\r", modifiers: 8 });
|
|
1978
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "keyUp", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, modifiers: 8 });
|
|
1979
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1971
1982
|
await new Promise((r) => setTimeout(r, 200));
|
|
1972
1983
|
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1973
1984
|
type: "rawKeyDown",
|
|
1974
1985
|
key: "Enter",
|
|
1975
1986
|
code: "Enter",
|
|
1976
1987
|
windowsVirtualKeyCode: 13,
|
|
1977
|
-
|
|
1988
|
+
text: "\r",
|
|
1989
|
+
unmodifiedText: "\r"
|
|
1978
1990
|
});
|
|
1979
1991
|
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
1980
|
-
type: "
|
|
1992
|
+
type: "char",
|
|
1981
1993
|
key: "Enter",
|
|
1982
1994
|
code: "Enter",
|
|
1983
1995
|
windowsVirtualKeyCode: 13,
|
|
1984
|
-
|
|
1996
|
+
text: "\r",
|
|
1997
|
+
unmodifiedText: "\r"
|
|
1998
|
+
});
|
|
1999
|
+
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
2000
|
+
type: "keyUp",
|
|
2001
|
+
key: "Enter",
|
|
2002
|
+
code: "Enter",
|
|
2003
|
+
windowsVirtualKeyCode: 13
|
|
1985
2004
|
});
|
|
1986
2005
|
this.log(`[CDP] typeAndSend: sent "${text.substring(0, 50)}..."`);
|
|
1987
2006
|
return true;
|
|
@@ -2035,21 +2054,41 @@ var DaemonCdpManager = class {
|
|
|
2035
2054
|
windowsVirtualKeyCode: 8
|
|
2036
2055
|
});
|
|
2037
2056
|
await new Promise((r) => setTimeout(r, 150));
|
|
2038
|
-
|
|
2057
|
+
const lines = text.split("\n");
|
|
2058
|
+
for (let i = 0; i < lines.length; i++) {
|
|
2059
|
+
if (lines[i].length > 0) {
|
|
2060
|
+
await this.sendInternal("Input.insertText", { text: lines[i] });
|
|
2061
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
2062
|
+
}
|
|
2063
|
+
if (i < lines.length - 1) {
|
|
2064
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "rawKeyDown", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, modifiers: 8 });
|
|
2065
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "char", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, text: "\r", unmodifiedText: "\r", modifiers: 8 });
|
|
2066
|
+
await this.sendInternal("Input.dispatchKeyEvent", { type: "keyUp", key: "Enter", code: "Enter", windowsVirtualKeyCode: 13, modifiers: 8 });
|
|
2067
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2039
2070
|
await new Promise((r) => setTimeout(r, 200));
|
|
2040
2071
|
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
2041
2072
|
type: "rawKeyDown",
|
|
2042
2073
|
key: "Enter",
|
|
2043
2074
|
code: "Enter",
|
|
2044
2075
|
windowsVirtualKeyCode: 13,
|
|
2045
|
-
|
|
2076
|
+
text: "\r",
|
|
2077
|
+
unmodifiedText: "\r"
|
|
2046
2078
|
});
|
|
2047
2079
|
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
2048
|
-
type: "
|
|
2080
|
+
type: "char",
|
|
2049
2081
|
key: "Enter",
|
|
2050
2082
|
code: "Enter",
|
|
2051
2083
|
windowsVirtualKeyCode: 13,
|
|
2052
|
-
|
|
2084
|
+
text: "\r",
|
|
2085
|
+
unmodifiedText: "\r"
|
|
2086
|
+
});
|
|
2087
|
+
await this.sendInternal("Input.dispatchKeyEvent", {
|
|
2088
|
+
type: "keyUp",
|
|
2089
|
+
key: "Enter",
|
|
2090
|
+
code: "Enter",
|
|
2091
|
+
windowsVirtualKeyCode: 13
|
|
2053
2092
|
});
|
|
2054
2093
|
this.log(`[CDP] typeAndSendAt(${Math.round(x)},${Math.round(y)}): sent "${text.substring(0, 50)}..."`);
|
|
2055
2094
|
return true;
|
|
@@ -5508,14 +5547,7 @@ var DaemonCommandHandler = class {
|
|
|
5508
5547
|
}
|
|
5509
5548
|
return { success: false, error: `VSCode command not available: ${resolvedCmd || cmd}` };
|
|
5510
5549
|
}
|
|
5511
|
-
|
|
5512
|
-
case "open_tab":
|
|
5513
|
-
case "close_tab":
|
|
5514
|
-
case "open_folder":
|
|
5515
|
-
case "open_folder_picker":
|
|
5516
|
-
case "open_recent":
|
|
5517
|
-
case "get_commands":
|
|
5518
|
-
return { success: false, error: `${cmd} requires bridge-extension (removed)` };
|
|
5550
|
+
// ─── Workspace cmds ──────────────
|
|
5519
5551
|
case "get_recent_workspaces":
|
|
5520
5552
|
return this.handleGetRecentWorkspaces(args);
|
|
5521
5553
|
case "get_cli_history": {
|
|
@@ -5733,7 +5765,9 @@ var ProviderLoader = class _ProviderLoader {
|
|
|
5733
5765
|
if (options?.builtinDir) {
|
|
5734
5766
|
this.builtinDirs = Array.isArray(options.builtinDir) ? options.builtinDir : [options.builtinDir];
|
|
5735
5767
|
} else {
|
|
5736
|
-
|
|
5768
|
+
const bundledDir = path6.resolve(__dirname, "../providers/_builtin");
|
|
5769
|
+
const devDir = path6.resolve(__dirname, "../../providers/_builtin");
|
|
5770
|
+
this.builtinDirs = [fs5.existsSync(devDir) ? devDir : bundledDir];
|
|
5737
5771
|
}
|
|
5738
5772
|
this.userDir = options?.userDir || path6.join(os7.homedir(), ".adhdev", "providers");
|
|
5739
5773
|
this.upstreamDir = path6.join(this.userDir, ".upstream");
|
|
@@ -5965,7 +5999,6 @@ var ProviderLoader = class _ProviderLoader {
|
|
|
5965
5999
|
name: p.name,
|
|
5966
6000
|
displayName: p.displayName || p.name,
|
|
5967
6001
|
icon: p.icon || "\u{1F4BB}",
|
|
5968
|
-
extensionSupport: "full",
|
|
5969
6002
|
cli: p.cli,
|
|
5970
6003
|
paths: p.paths
|
|
5971
6004
|
});
|
|
@@ -10284,6 +10317,7 @@ var DevServer = class _DevServer {
|
|
|
10284
10317
|
{ method: "GET", pattern: "/api/providers/versions", handler: (q, s) => this.handleDetectVersions(q, s) },
|
|
10285
10318
|
{ method: "POST", pattern: "/api/providers/reload", handler: (q, s) => this.handleReload(q, s) },
|
|
10286
10319
|
{ method: "POST", pattern: "/api/cdp/evaluate", handler: (q, s) => this.handleCdpEvaluate(q, s) },
|
|
10320
|
+
{ method: "POST", pattern: "/api/cdp/click", handler: (q, s) => this.handleCdpClick(q, s) },
|
|
10287
10321
|
{ method: "POST", pattern: "/api/cdp/dom/query", handler: (q, s) => this.handleCdpDomQuery(q, s) },
|
|
10288
10322
|
{ method: "POST", pattern: "/api/cdp/dom/inspect", handler: (q, s) => this.handleDomInspect(q, s) },
|
|
10289
10323
|
{ method: "POST", pattern: "/api/cdp/dom/children", handler: (q, s) => this.handleDomChildren(q, s) },
|
|
@@ -10314,6 +10348,7 @@ var DevServer = class _DevServer {
|
|
|
10314
10348
|
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/file$/, handler: (q, s, p) => this.handleWriteFile(p[0], q, s) },
|
|
10315
10349
|
{ method: "GET", pattern: /^\/api\/providers\/([^/]+)\/source$/, handler: (q, s, p) => this.handleSource(p[0], q, s) },
|
|
10316
10350
|
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/save$/, handler: (q, s, p) => this.handleSave(p[0], q, s) },
|
|
10351
|
+
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/typeAndSend$/, handler: (q, s, p) => this.handleTypeAndSend(p[0], q, s) },
|
|
10317
10352
|
{ method: "GET", pattern: /^\/api\/providers\/([^/]+)\/config$/, handler: (q, s, p) => this.handleProviderConfig(p[0], q, s) },
|
|
10318
10353
|
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/dom-context$/, handler: (q, s, p) => this.handleDomContext(p[0], q, s) },
|
|
10319
10354
|
{ method: "POST", pattern: /^\/api\/providers\/([^/]+)\/auto-implement$/, handler: (q, s, p) => this.handleAutoImplement(p[0], q, s) },
|
|
@@ -10516,7 +10551,13 @@ var DevServer = class _DevServer {
|
|
|
10516
10551
|
return;
|
|
10517
10552
|
}
|
|
10518
10553
|
try {
|
|
10519
|
-
|
|
10554
|
+
let scriptCode = null;
|
|
10555
|
+
if (["sendMessage", "webviewSendMessage", "switchSession", "webviewSwitchSession", "setMode", "webviewSetMode", "setModel", "webviewSetModel"].includes(scriptName)) {
|
|
10556
|
+
const firstVal = params && typeof params === "object" && Object.keys(params).length > 0 ? Object.values(params)[0] : params;
|
|
10557
|
+
scriptCode = firstVal !== void 0 ? fn(firstVal) : fn();
|
|
10558
|
+
} else {
|
|
10559
|
+
scriptCode = params !== void 0 ? fn(params) : fn();
|
|
10560
|
+
}
|
|
10520
10561
|
if (!scriptCode) {
|
|
10521
10562
|
this.json(res, 500, { error: "Script function returned null" });
|
|
10522
10563
|
return;
|
|
@@ -10556,6 +10597,7 @@ var DevServer = class _DevServer {
|
|
|
10556
10597
|
} catch {
|
|
10557
10598
|
}
|
|
10558
10599
|
}
|
|
10600
|
+
this.log(`Script raw debug: typeof=${typeof raw}, raw=${JSON.stringify(raw)}, parsed=${JSON.stringify(result)}`);
|
|
10559
10601
|
this.json(res, 200, { type, script: scriptName, result });
|
|
10560
10602
|
} catch (e) {
|
|
10561
10603
|
this.json(res, 500, { error: `Script execution failed: ${e.message}` });
|
|
@@ -10590,6 +10632,26 @@ var DevServer = class _DevServer {
|
|
|
10590
10632
|
this.json(res, 500, { error: e.message });
|
|
10591
10633
|
}
|
|
10592
10634
|
}
|
|
10635
|
+
async handleCdpClick(req, res) {
|
|
10636
|
+
const body = await this.readBody(req);
|
|
10637
|
+
const { ideType, x, y } = body;
|
|
10638
|
+
if (x == null || y == null) {
|
|
10639
|
+
this.json(res, 400, { error: "x and y coordinates required" });
|
|
10640
|
+
return;
|
|
10641
|
+
}
|
|
10642
|
+
const cdp = this.getCdp(ideType);
|
|
10643
|
+
if (!cdp?.isConnected) {
|
|
10644
|
+
this.json(res, 503, { error: "No CDP connection available" });
|
|
10645
|
+
return;
|
|
10646
|
+
}
|
|
10647
|
+
try {
|
|
10648
|
+
await cdp.send("Input.dispatchMouseEvent", { type: "mousePressed", x, y, button: "left", clickCount: 1 });
|
|
10649
|
+
await cdp.send("Input.dispatchMouseEvent", { type: "mouseReleased", x, y, button: "left", clickCount: 1 });
|
|
10650
|
+
this.json(res, 200, { success: true, clicked: true, x, y });
|
|
10651
|
+
} catch (e) {
|
|
10652
|
+
this.json(res, 500, { error: e.message });
|
|
10653
|
+
}
|
|
10654
|
+
}
|
|
10593
10655
|
async handleCdpDomQuery(req, res) {
|
|
10594
10656
|
const body = await this.readBody(req);
|
|
10595
10657
|
const { selector, limit = 10, ideType } = body;
|
|
@@ -10698,6 +10760,11 @@ var DevServer = class _DevServer {
|
|
|
10698
10760
|
name: p.name,
|
|
10699
10761
|
category: p.category
|
|
10700
10762
|
}));
|
|
10763
|
+
for (const cdp of this.cdpManagers.values()) {
|
|
10764
|
+
if (!cdp.isConnected) {
|
|
10765
|
+
cdp._targetId = null;
|
|
10766
|
+
}
|
|
10767
|
+
}
|
|
10701
10768
|
this.json(res, 200, { reloaded: true, providers });
|
|
10702
10769
|
} catch (e) {
|
|
10703
10770
|
this.json(res, 500, { error: e.message });
|
|
@@ -10853,7 +10920,7 @@ var DevServer = class _DevServer {
|
|
|
10853
10920
|
const provider = this.providerLoader.getMeta(type);
|
|
10854
10921
|
if (!provider) return null;
|
|
10855
10922
|
const cat = provider.category;
|
|
10856
|
-
const builtinDir = this.providerLoader.
|
|
10923
|
+
const builtinDir = this.providerLoader.builtinDirs?.[0] || path12.resolve(__dirname, "../providers/_builtin");
|
|
10857
10924
|
const userDir = path12.join(os14.homedir(), ".adhdev", "providers");
|
|
10858
10925
|
const directCandidates = [
|
|
10859
10926
|
path12.join(userDir, type),
|
|
@@ -11004,6 +11071,25 @@ var DevServer = class _DevServer {
|
|
|
11004
11071
|
this.json(res, 500, { error: `Save failed: ${e.message}` });
|
|
11005
11072
|
}
|
|
11006
11073
|
}
|
|
11074
|
+
async handleTypeAndSend(type, req, res) {
|
|
11075
|
+
const body = await this.readBody(req);
|
|
11076
|
+
const { selector, text } = body;
|
|
11077
|
+
if (!selector || typeof selector !== "string" || !text || typeof text !== "string") {
|
|
11078
|
+
this.json(res, 400, { error: "selector and text strings required" });
|
|
11079
|
+
return;
|
|
11080
|
+
}
|
|
11081
|
+
const cdp = this.getCdp(type);
|
|
11082
|
+
if (!cdp) {
|
|
11083
|
+
this.json(res, 503, { error: `CDP not connected for '${type}'` });
|
|
11084
|
+
return;
|
|
11085
|
+
}
|
|
11086
|
+
try {
|
|
11087
|
+
const sent = await cdp.typeAndSend(selector, text);
|
|
11088
|
+
this.json(res, 200, { sent });
|
|
11089
|
+
} catch (e) {
|
|
11090
|
+
this.json(res, 500, { error: e.message });
|
|
11091
|
+
}
|
|
11092
|
+
}
|
|
11007
11093
|
async handleScriptHints(type, _req, res) {
|
|
11008
11094
|
const dir = this.findProviderDir(type);
|
|
11009
11095
|
if (!dir) {
|
|
@@ -11239,7 +11325,7 @@ var DevServer = class _DevServer {
|
|
|
11239
11325
|
if (location === "user") {
|
|
11240
11326
|
targetDir = path12.join(os14.homedir(), ".adhdev", "providers", type);
|
|
11241
11327
|
} else {
|
|
11242
|
-
const builtinDir = path12.resolve(__dirname, "../providers/_builtin");
|
|
11328
|
+
const builtinDir = this.providerLoader.builtinDirs?.[0] || path12.resolve(__dirname, "../providers/_builtin");
|
|
11243
11329
|
targetDir = path12.join(builtinDir, category, type);
|
|
11244
11330
|
}
|
|
11245
11331
|
const jsonPath = path12.join(targetDir, "provider.json");
|
|
@@ -12049,7 +12135,7 @@ var DevServer = class _DevServer {
|
|
|
12049
12135
|
const domContext = null;
|
|
12050
12136
|
this.sendAutoImplSSE({ event: "progress", data: { function: "_init", status: "loading_reference", message: `\uB808\uD37C\uB7F0\uC2A4 \uC2A4\uD06C\uB9BD\uD2B8 \uB85C\uB4DC \uC911 (${reference})...` } });
|
|
12051
12137
|
let referenceScripts = {};
|
|
12052
|
-
const builtinDir = this.providerLoader.
|
|
12138
|
+
const builtinDir = this.providerLoader.builtinDirs?.[0] || path12.resolve(__dirname, "../providers/_builtin");
|
|
12053
12139
|
const refDir = path12.join(builtinDir, "ide", reference);
|
|
12054
12140
|
if (fs9.existsSync(refDir)) {
|
|
12055
12141
|
const scriptsDir = path12.join(refDir, "scripts");
|
|
@@ -12249,7 +12335,7 @@ var DevServer = class _DevServer {
|
|
|
12249
12335
|
}
|
|
12250
12336
|
if (model) args.push("--model", model);
|
|
12251
12337
|
const escapedArgs = args.map((a) => `'${a.replace(/'/g, "'\\''")}'`).join(" ");
|
|
12252
|
-
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 "
|
|
12338
|
+
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.`;
|
|
12253
12339
|
shellCmd = `${command} ${escapedArgs} "${metaPrompt}"`;
|
|
12254
12340
|
} else {
|
|
12255
12341
|
const escapedArgs = baseArgs.map((a) => `'${a.replace(/'/g, "'\\''")}'`).join(" ");
|
|
@@ -12311,7 +12397,7 @@ var DevServer = class _DevServer {
|
|
|
12311
12397
|
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, " ");
|
|
12312
12398
|
approvalBuffer = (approvalBuffer + cleanData).slice(-1500);
|
|
12313
12399
|
const elapsed = Date.now() - spawnedAt;
|
|
12314
|
-
if (elapsed > 15e3 && approvalBuffer.includes("
|
|
12400
|
+
if (elapsed > 15e3 && approvalBuffer.includes("_PIPELINE_COMPLETE_SIGNAL_")) {
|
|
12315
12401
|
this.log(`Agent finished task after ${Math.round(elapsed / 1e3)}s. Terminating interactive CLI session to unblock pipeline.`);
|
|
12316
12402
|
this.sendAutoImplSSE({ event: "output", data: { chunk: `
|
|
12317
12403
|
[\u{1F916} ADHDev Pipeline] Completion token detected. Proceeding...
|