@dev-anywhere/proxy 0.9.15 → 0.9.17
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/{autostart-VG7PVHTQ.js → autostart-ODHWAMK7.js} +1 -1
- package/dist/{chunk-J7XFB5AQ.js → chunk-5QXG76IO.js} +2 -2
- package/dist/{chunk-ZE73PMOL.js → chunk-FNZ5X2VZ.js} +9 -2
- package/dist/chunk-FNZ5X2VZ.js.map +1 -0
- package/dist/{chunk-6I5YPQPN.js → chunk-FPNOC7HY.js} +8 -1
- package/dist/chunk-FPNOC7HY.js.map +1 -0
- package/dist/{chunk-KDISKSDP.js → chunk-LJZS7VNV.js} +2 -2
- package/dist/{chunk-U4CHGJJM.js → chunk-N4DATVNM.js} +2 -2
- package/dist/{chunk-7UICNI4Q.js → chunk-TCQAVGKW.js} +3 -3
- package/dist/{chunk-WLLKRNXA.js → chunk-X76ZR6GL.js} +2 -2
- package/dist/index.js +6 -6
- package/dist/preview-worker.js +2 -2
- package/dist/serve.js +107 -14
- package/dist/serve.js.map +1 -1
- package/dist/session-worker.js +3 -3
- package/dist/{terminal-WZJO6TAN.js → terminal-OUKZRIMW.js} +5 -5
- package/dist/terminal-worker.js +5 -5
- package/package.json +3 -3
- package/dist/chunk-6I5YPQPN.js.map +0 -1
- package/dist/chunk-ZE73PMOL.js.map +0 -1
- /package/dist/{autostart-VG7PVHTQ.js.map → autostart-ODHWAMK7.js.map} +0 -0
- /package/dist/{chunk-J7XFB5AQ.js.map → chunk-5QXG76IO.js.map} +0 -0
- /package/dist/{chunk-KDISKSDP.js.map → chunk-LJZS7VNV.js.map} +0 -0
- /package/dist/{chunk-U4CHGJJM.js.map → chunk-N4DATVNM.js.map} +0 -0
- /package/dist/{chunk-7UICNI4Q.js.map → chunk-TCQAVGKW.js.map} +0 -0
- /package/dist/{chunk-WLLKRNXA.js.map → chunk-X76ZR6GL.js.map} +0 -0
- /package/dist/{terminal-WZJO6TAN.js.map → terminal-OUKZRIMW.js.map} +0 -0
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
encodeBinaryFrame,
|
|
8
8
|
providerValues,
|
|
9
9
|
ptySemanticStateValues
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FPNOC7HY.js";
|
|
11
11
|
|
|
12
12
|
// src/ipc/ipc-protocol.ts
|
|
13
13
|
import { z } from "zod";
|
|
@@ -374,4 +374,4 @@ export {
|
|
|
374
374
|
serializeIpc,
|
|
375
375
|
createIpcReader
|
|
376
376
|
};
|
|
377
|
-
//# sourceMappingURL=chunk-
|
|
377
|
+
//# sourceMappingURL=chunk-N4DATVNM.js.map
|
|
@@ -17,14 +17,14 @@ import {
|
|
|
17
17
|
CLAUDE_PROVIDER,
|
|
18
18
|
CODEX_PROVIDER,
|
|
19
19
|
KIMI_PROVIDER
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FNZ5X2VZ.js";
|
|
21
21
|
import {
|
|
22
22
|
ControlErrorCode,
|
|
23
23
|
PTY_INITIAL_MAX_COLS,
|
|
24
24
|
PTY_INITIAL_MAX_ROWS,
|
|
25
25
|
PTY_INITIAL_MIN_COLS,
|
|
26
26
|
PTY_INITIAL_MIN_ROWS
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-FPNOC7HY.js";
|
|
28
28
|
import {
|
|
29
29
|
classifyCodexActiveWriterError,
|
|
30
30
|
sanitizeProviderErrorTail
|
|
@@ -404,4 +404,4 @@ export {
|
|
|
404
404
|
buildHostedPtyArgs,
|
|
405
405
|
PtyRuntime
|
|
406
406
|
};
|
|
407
|
-
//# sourceMappingURL=chunk-
|
|
407
|
+
//# sourceMappingURL=chunk-TCQAVGKW.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
TerminalShellFamilySchema,
|
|
7
7
|
providerValues
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FPNOC7HY.js";
|
|
9
9
|
|
|
10
10
|
// src/cli-args.ts
|
|
11
11
|
function normalizeCliArgs(args) {
|
|
@@ -115,4 +115,4 @@ export {
|
|
|
115
115
|
sessionRuntimeIpcVersionMatches,
|
|
116
116
|
writeSessionRuntimeIpcVersions
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
118
|
+
//# sourceMappingURL=chunk-X76ZR6GL.js.map
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
readSessionRuntimeIpcVersions,
|
|
10
10
|
sessionRuntimeIpcVersionMatches,
|
|
11
11
|
stripProxyProfileArgs
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-X76ZR6GL.js";
|
|
13
13
|
import {
|
|
14
14
|
getErrorMessage,
|
|
15
15
|
probeProcess
|
|
@@ -30,8 +30,8 @@ import "./chunk-CFO5GU5U.js";
|
|
|
30
30
|
import {
|
|
31
31
|
TERMINAL_IPC_PROTOCOL_VERSION,
|
|
32
32
|
WORKER_IPC_PROTOCOL_VERSION
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-N4DATVNM.js";
|
|
34
|
+
import "./chunk-FPNOC7HY.js";
|
|
35
35
|
import "./chunk-G4QN6LOR.js";
|
|
36
36
|
import {
|
|
37
37
|
PROXY_VERSION
|
|
@@ -253,7 +253,7 @@ var program = new Command("dev-anywhere").description("Dev Anywhere - transparen
|
|
|
253
253
|
console.error(err instanceof Error ? err.message : String(err));
|
|
254
254
|
process.exit(1);
|
|
255
255
|
}
|
|
256
|
-
const { startTerminal } = await import("./terminal-
|
|
256
|
+
const { startTerminal } = await import("./terminal-OUKZRIMW.js");
|
|
257
257
|
const { provider, args } = invocation;
|
|
258
258
|
await startTerminal(args, provider);
|
|
259
259
|
});
|
|
@@ -309,12 +309,12 @@ for (const [action, description] of [
|
|
|
309
309
|
["status", "Show automatic startup status"]
|
|
310
310
|
]) {
|
|
311
311
|
autostart.command(action).description(description).option("--system", "Use a system service that runs without desktop login").option("--now", "Start the system service now and restart Proxy (enable --system only)").action(async (options) => {
|
|
312
|
-
const { runAutostartCommand } = await import("./autostart-
|
|
312
|
+
const { runAutostartCommand } = await import("./autostart-ODHWAMK7.js");
|
|
313
313
|
await runAutostartCommand(action, options);
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
316
|
autostart.command("run", { hidden: true }).option("--daemon", "Detach after service readiness (systemd login trigger)").option("--system", "Run the persistent system service host").action(async (_options, command) => {
|
|
317
|
-
const { startAutostartService } = await import("./autostart-
|
|
317
|
+
const { startAutostartService } = await import("./autostart-ODHWAMK7.js");
|
|
318
318
|
const options = command.optsWithGlobals();
|
|
319
319
|
await startAutostartService(Boolean(options.daemon), Boolean(options.system));
|
|
320
320
|
});
|
package/dist/preview-worker.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
isPreviewControlRequest,
|
|
16
16
|
readPreviewWorkerMessages,
|
|
17
17
|
writePreviewWorkerMessage
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-5QXG76IO.js";
|
|
19
19
|
import {
|
|
20
20
|
acceptCurrentWorkerSocketMessage,
|
|
21
21
|
readWorkerConnection,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
encodeDevicePreviewFrame,
|
|
46
46
|
encodeDevicePreviewH264ProxyPacket,
|
|
47
47
|
serializeControl
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-FPNOC7HY.js";
|
|
49
49
|
import {
|
|
50
50
|
prepareLocalIpcEndpoint,
|
|
51
51
|
removeLocalIpcEndpoint,
|
package/dist/serve.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
sessionRuntimeIpcVersionMatches,
|
|
13
13
|
stripProxyProfileArgs,
|
|
14
14
|
writeSessionRuntimeIpcVersions
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-X76ZR6GL.js";
|
|
16
16
|
import {
|
|
17
17
|
processExistsOrIsInaccessible
|
|
18
18
|
} from "./chunk-5OARBB2B.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
isPreviewControlRequest,
|
|
22
22
|
readPreviewWorkerMessages,
|
|
23
23
|
writePreviewWorkerMessage
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-5QXG76IO.js";
|
|
25
25
|
import {
|
|
26
26
|
ContentBlockDeltaSchema,
|
|
27
27
|
IGNORED_EVENT_TYPES,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
import {
|
|
41
41
|
buildHostedPtyArgs,
|
|
42
42
|
parseTerminalWorkerCliArgs
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-TCQAVGKW.js";
|
|
44
44
|
import {
|
|
45
45
|
ReconnectSupervisor,
|
|
46
46
|
TERMINAL_ADMISSION_FRAME_MAX_BYTES,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
detectAgentCliStatus,
|
|
70
70
|
resolveCodexPermissionPolicy,
|
|
71
71
|
resolveKimiAcpMode
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-FNZ5X2VZ.js";
|
|
73
73
|
import {
|
|
74
74
|
TERMINAL_IPC_PROTOCOL_VERSION,
|
|
75
75
|
WORKER_IPC_PROTOCOL_VERSION,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
createWorkerReader,
|
|
78
78
|
serializeIpc,
|
|
79
79
|
serializeWorkerMsg
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-N4DATVNM.js";
|
|
81
81
|
import "./chunk-5RESCDN4.js";
|
|
82
82
|
import {
|
|
83
83
|
ControlErrorCode,
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
isProxyProtocolRejectDirection,
|
|
106
106
|
serializeControl,
|
|
107
107
|
summarizeToolActivity
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-FPNOC7HY.js";
|
|
109
109
|
import {
|
|
110
110
|
localIpcEndpointMayExist,
|
|
111
111
|
removeLocalIpcEndpoint,
|
|
@@ -1116,8 +1116,8 @@ var MemoryMessageQueue = class {
|
|
|
1116
1116
|
|
|
1117
1117
|
// src/serve/relay-connection.ts
|
|
1118
1118
|
var DEFAULT_PROXY_ID_PATH = join2(homedir(), ".dev-anywhere", "proxy-id");
|
|
1119
|
-
function proxyOsName(
|
|
1120
|
-
return { darwin: "macOS", win32: "Windows", linux: "Linux" }[
|
|
1119
|
+
function proxyOsName(platform2 = process.platform) {
|
|
1120
|
+
return { darwin: "macOS", win32: "Windows", linux: "Linux" }[platform2];
|
|
1121
1121
|
}
|
|
1122
1122
|
var MAX_BACKOFF_MS = 3e4;
|
|
1123
1123
|
var BASE_BACKOFF_MS = 1e3;
|
|
@@ -5603,10 +5603,10 @@ function listTerminalShells(env = process.env, options = {}) {
|
|
|
5603
5603
|
return windowsTerminalShells(env, options).map(({ id, label }) => ({ id, label }));
|
|
5604
5604
|
}
|
|
5605
5605
|
function resolveTerminalShell(shell, env = process.env, options = {}) {
|
|
5606
|
-
const
|
|
5607
|
-
if (
|
|
5606
|
+
const platform2 = options.platform ?? process.platform;
|
|
5607
|
+
if (platform2 !== "win32") {
|
|
5608
5608
|
if (shell !== void 0) throw new Error("CMD \u548C PowerShell \u9009\u9879\u4EC5\u652F\u6301 Windows \u5F00\u53D1\u673A");
|
|
5609
|
-
return { command: defaultShell(env,
|
|
5609
|
+
return { command: defaultShell(env, platform2) };
|
|
5610
5610
|
}
|
|
5611
5611
|
const available = windowsTerminalShells(env, options);
|
|
5612
5612
|
const resolved = shell === void 0 ? available[0] : available.find(({ id }) => id === shell);
|
|
@@ -5617,6 +5617,72 @@ function resolveTerminalShell(shell, env = process.env, options = {}) {
|
|
|
5617
5617
|
return { command: resolved.command, label: resolved.label };
|
|
5618
5618
|
}
|
|
5619
5619
|
|
|
5620
|
+
// src/common/filesystem-roots.ts
|
|
5621
|
+
import { execFile } from "child_process";
|
|
5622
|
+
import { readdir as readdir5, readFile as readFile3 } from "fs/promises";
|
|
5623
|
+
import { platform } from "os";
|
|
5624
|
+
import { basename as basename3 } from "path";
|
|
5625
|
+
import { promisify } from "util";
|
|
5626
|
+
var execFileAsync = promisify(execFile);
|
|
5627
|
+
function uniqueRoots(roots) {
|
|
5628
|
+
return [...new Map(roots.map((root) => [root.path, root])).values()];
|
|
5629
|
+
}
|
|
5630
|
+
function decodeMountPath(path) {
|
|
5631
|
+
return path.replace(
|
|
5632
|
+
/\\([0-7]{3})/g,
|
|
5633
|
+
(_, octal) => String.fromCharCode(Number.parseInt(octal, 8))
|
|
5634
|
+
);
|
|
5635
|
+
}
|
|
5636
|
+
function linuxMountRoots(mountinfo) {
|
|
5637
|
+
const roots = [{ name: "/", path: "/" }];
|
|
5638
|
+
for (const line of mountinfo.split("\n")) {
|
|
5639
|
+
const [mount, filesystem] = line.split(" - ");
|
|
5640
|
+
if (!mount || !filesystem) continue;
|
|
5641
|
+
const fields = mount.split(" ");
|
|
5642
|
+
const [type, source] = filesystem.split(" ");
|
|
5643
|
+
const path = decodeMountPath(fields[4] ?? "");
|
|
5644
|
+
const mountRoot = decodeMountPath(fields[3] ?? "");
|
|
5645
|
+
if (!path.startsWith("/") || path === "/") continue;
|
|
5646
|
+
const userMount = /^\/(?:mnt|media|run\/media)(?:\/|$)/.test(path);
|
|
5647
|
+
const volume = source?.startsWith("/dev/") && mountRoot === "/";
|
|
5648
|
+
const network = /^(?:nfs\d*|cifs|smb3?|fuse\..+)$/.test(type ?? "");
|
|
5649
|
+
if (userMount || volume || network) roots.push({ name: basename3(path), path });
|
|
5650
|
+
}
|
|
5651
|
+
return uniqueRoots(roots);
|
|
5652
|
+
}
|
|
5653
|
+
async function listFileSystemRoots() {
|
|
5654
|
+
if (platform() === "win32") {
|
|
5655
|
+
const { stdout } = await execFileAsync(
|
|
5656
|
+
"powershell.exe",
|
|
5657
|
+
[
|
|
5658
|
+
"-NoProfile",
|
|
5659
|
+
"-NonInteractive",
|
|
5660
|
+
"-Command",
|
|
5661
|
+
"$ErrorActionPreference='Stop'; [Console]::OutputEncoding=[Text.UTF8Encoding]::new($false); ConvertTo-Json -InputObject @([System.IO.Directory]::GetLogicalDrives()) -Compress"
|
|
5662
|
+
],
|
|
5663
|
+
{ encoding: "utf8", windowsHide: true, timeout: 5e3, maxBuffer: 64 * 1024 }
|
|
5664
|
+
);
|
|
5665
|
+
const paths = JSON.parse(stdout.replace(/^\uFEFF/, "").trim());
|
|
5666
|
+
if (!Array.isArray(paths) || paths.some((path) => typeof path !== "string" || !/^[a-z]:\\$/i.test(path))) {
|
|
5667
|
+
throw new Error("Invalid logical drive list");
|
|
5668
|
+
}
|
|
5669
|
+
return uniqueRoots(paths.sort().map((path) => ({ name: path, path })));
|
|
5670
|
+
}
|
|
5671
|
+
if (platform() === "darwin") {
|
|
5672
|
+
const volumes = await readdir5("/Volumes", { withFileTypes: true });
|
|
5673
|
+
return [
|
|
5674
|
+
{ name: "/", path: "/" },
|
|
5675
|
+
...volumes.filter(
|
|
5676
|
+
(volume) => !volume.name.startsWith(".") && (volume.isDirectory() || volume.isSymbolicLink())
|
|
5677
|
+
).map((volume) => ({ name: volume.name, path: `/Volumes/${volume.name}` }))
|
|
5678
|
+
];
|
|
5679
|
+
}
|
|
5680
|
+
if (platform() === "linux") {
|
|
5681
|
+
return linuxMountRoots(await readFile3("/proc/self/mountinfo", "utf8"));
|
|
5682
|
+
}
|
|
5683
|
+
return [{ name: "/", path: "/" }];
|
|
5684
|
+
}
|
|
5685
|
+
|
|
5620
5686
|
// src/serve/relay-resource-handlers.ts
|
|
5621
5687
|
function errorMessage(err) {
|
|
5622
5688
|
return err instanceof Error ? err.message : String(err);
|
|
@@ -5694,6 +5760,30 @@ var RelayResourceHandlers = class {
|
|
|
5694
5760
|
serviceLogger.warn({ provider, path: rawPath, error }, "Agent CLI path update rejected");
|
|
5695
5761
|
}
|
|
5696
5762
|
}
|
|
5763
|
+
async onFileSystemRootsRequest(msg) {
|
|
5764
|
+
try {
|
|
5765
|
+
const roots = await listFileSystemRoots();
|
|
5766
|
+
this.deps.relaySend(
|
|
5767
|
+
serializeControl({
|
|
5768
|
+
type: "filesystem_roots_response",
|
|
5769
|
+
requestId: msg.requestId,
|
|
5770
|
+
roots
|
|
5771
|
+
})
|
|
5772
|
+
);
|
|
5773
|
+
} catch (err) {
|
|
5774
|
+
const error = errorMessage(err);
|
|
5775
|
+
serviceLogger.warn({ error }, "Filesystem root listing failed");
|
|
5776
|
+
this.deps.relaySend(
|
|
5777
|
+
serializeControl({
|
|
5778
|
+
type: "filesystem_roots_response",
|
|
5779
|
+
requestId: msg.requestId,
|
|
5780
|
+
roots: [],
|
|
5781
|
+
errorCode: ControlErrorCode.UNKNOWN,
|
|
5782
|
+
error: "\u65E0\u6CD5\u8BFB\u53D6\u78C1\u76D8\u4F4D\u7F6E"
|
|
5783
|
+
})
|
|
5784
|
+
);
|
|
5785
|
+
}
|
|
5786
|
+
}
|
|
5697
5787
|
onDirListRequest(msg) {
|
|
5698
5788
|
this.deps.controlHandlers.handleDirListRequest({
|
|
5699
5789
|
path: msg.path ?? "",
|
|
@@ -6872,6 +6962,9 @@ var RelayRouter = class {
|
|
|
6872
6962
|
case "dir_list_request":
|
|
6873
6963
|
this.resourceHandlers.onDirListRequest(msg);
|
|
6874
6964
|
return;
|
|
6965
|
+
case "filesystem_roots_request":
|
|
6966
|
+
void this.resourceHandlers.onFileSystemRootsRequest(msg);
|
|
6967
|
+
return;
|
|
6875
6968
|
case "dir_create_request":
|
|
6876
6969
|
this.resourceHandlers.onDirCreateRequest(msg);
|
|
6877
6970
|
return;
|
|
@@ -8885,7 +8978,7 @@ var RemoteFileUploadManager = class {
|
|
|
8885
8978
|
|
|
8886
8979
|
// src/serve/remote-file-stream.ts
|
|
8887
8980
|
import { createReadStream as createReadStream3, statSync as statSync3 } from "fs";
|
|
8888
|
-
import { basename as
|
|
8981
|
+
import { basename as basename4 } from "path";
|
|
8889
8982
|
|
|
8890
8983
|
// src/serve/remote-file-path.ts
|
|
8891
8984
|
import { realpathSync as realpathSync2 } from "fs";
|
|
@@ -8983,7 +9076,7 @@ var RemoteFileStreamManager = class {
|
|
|
8983
9076
|
path,
|
|
8984
9077
|
mimeType: guessMimeType(resolvedPath),
|
|
8985
9078
|
size: stat2.size,
|
|
8986
|
-
fileName:
|
|
9079
|
+
fileName: basename4(resolvedPath) || "download"
|
|
8987
9080
|
});
|
|
8988
9081
|
serviceLogger.info(
|
|
8989
9082
|
{ sessionId, requestId, path, size: stat2.size },
|
|
@@ -9058,7 +9151,7 @@ var RemoteFileStreamManager = class {
|
|
|
9058
9151
|
path,
|
|
9059
9152
|
mimeType: guessMimeType(resolvedPath),
|
|
9060
9153
|
size: stat2.size,
|
|
9061
|
-
fileName:
|
|
9154
|
+
fileName: basename4(resolvedPath) || "download"
|
|
9062
9155
|
});
|
|
9063
9156
|
stream.on("data", (chunk) => {
|
|
9064
9157
|
if (active.canceled) return;
|