doer-agent 0.1.4 → 0.1.6
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/agent.js
CHANGED
|
@@ -178,23 +178,11 @@ function resolvePlaywrightMcpProxyPath() {
|
|
|
178
178
|
return "";
|
|
179
179
|
}
|
|
180
180
|
const PLAYWRIGHT_MCP_PROXY_LAUNCHER_PATH = path.join(AGENT_PROJECT_DIR, "runtime/bin/playwright-mcp-proxy-launcher.sh");
|
|
181
|
-
function resolvePlaywrightMcpDaemonSocketPath(stateDir) {
|
|
182
|
-
if (process.platform === "win32") {
|
|
183
|
-
const suffix = stateDir
|
|
184
|
-
.toLowerCase()
|
|
185
|
-
.replace(/[^a-z0-9]+/g, "-")
|
|
186
|
-
.replace(/^-+|-+$/g, "")
|
|
187
|
-
.slice(-48) || "default";
|
|
188
|
-
return `\\\\.\\pipe\\doer-playwright-mcp-${suffix}`;
|
|
189
|
-
}
|
|
190
|
-
return path.join(stateDir, "playwright-mcp-daemon", "playwright-mcp.sock");
|
|
191
|
-
}
|
|
192
181
|
function resolvePlaywrightMcpDaemonStatePaths() {
|
|
193
|
-
const
|
|
194
|
-
const daemonDir = path.join(stateDir, "playwright-mcp-daemon");
|
|
182
|
+
const daemonDir = path.join(resolveAgentStateDir(), "playwright-mcp-daemon");
|
|
195
183
|
return {
|
|
196
184
|
daemonDir,
|
|
197
|
-
socketPath:
|
|
185
|
+
socketPath: path.join(daemonDir, "playwright-mcp.sock"),
|
|
198
186
|
pidPath: path.join(daemonDir, "daemon.pid"),
|
|
199
187
|
metaPath: path.join(daemonDir, "daemon-meta.json"),
|
|
200
188
|
};
|
|
@@ -38,14 +38,6 @@ function resolveSocketPath() {
|
|
|
38
38
|
return explicit;
|
|
39
39
|
}
|
|
40
40
|
const stateDir = (process.env.DOER_AGENT_STATE_DIR || "").trim() || path.join(homedir(), ".doer-agent");
|
|
41
|
-
if (process.platform === "win32") {
|
|
42
|
-
const suffix = stateDir
|
|
43
|
-
.toLowerCase()
|
|
44
|
-
.replace(/[^a-z0-9]+/g, "-")
|
|
45
|
-
.replace(/^-+|-+$/g, "")
|
|
46
|
-
.slice(-48) || "default";
|
|
47
|
-
return `\\\\.\\pipe\\doer-playwright-mcp-${suffix}`;
|
|
48
|
-
}
|
|
49
41
|
return path.join(stateDir, "playwright-mcp-daemon", "playwright-mcp.sock");
|
|
50
42
|
}
|
|
51
43
|
function decodeToolArgs(argsBase64) {
|
|
@@ -14,9 +14,6 @@ function parseInteger(value, fallback) {
|
|
|
14
14
|
const socketPath = process.env.DOER_PLAYWRIGHT_MCP_DAEMON_SOCKET?.trim() || "";
|
|
15
15
|
const targetCommand = process.env.DOER_PLAYWRIGHT_MCP_TARGET_COMMAND?.trim() || "";
|
|
16
16
|
const idleTtlSeconds = parseInteger(process.env.DOER_PLAYWRIGHT_MCP_DAEMON_IDLE_TTL_SECONDS, 10800);
|
|
17
|
-
function isWindowsNamedPipePath(value) {
|
|
18
|
-
return process.platform === "win32" && value.startsWith("\\\\.\\pipe\\");
|
|
19
|
-
}
|
|
20
17
|
let targetArgs = [];
|
|
21
18
|
try {
|
|
22
19
|
const parsed = JSON.parse(process.env.DOER_PLAYWRIGHT_MCP_TARGET_ARGS_JSON || "[]");
|
|
@@ -106,17 +103,15 @@ async function shutdown(server) {
|
|
|
106
103
|
child = null;
|
|
107
104
|
}
|
|
108
105
|
await new Promise((resolve) => server.close(() => resolve()));
|
|
109
|
-
if (
|
|
106
|
+
if (existsSync(socketPath)) {
|
|
110
107
|
await rm(socketPath, { force: true });
|
|
111
108
|
}
|
|
112
109
|
process.exit(0);
|
|
113
110
|
}
|
|
114
111
|
async function main() {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
await rm(socketPath, { force: true });
|
|
119
|
-
}
|
|
112
|
+
await mkdir(path.dirname(socketPath), { recursive: true });
|
|
113
|
+
if (existsSync(socketPath)) {
|
|
114
|
+
await rm(socketPath, { force: true });
|
|
120
115
|
}
|
|
121
116
|
const server = net.createServer((socket) => {
|
|
122
117
|
if (activeClient && !activeClient.destroyed) {
|