@dev-anywhere/proxy 0.9.4 → 0.9.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/{autostart-G2MSOPL7.js → autostart-TMACAYHZ.js} +104 -26
- package/dist/autostart-TMACAYHZ.js.map +1 -0
- package/dist/{chunk-HYDXGNKA.js → chunk-5COVSNQZ.js} +2 -2
- package/dist/chunk-5OARBB2B.js +36 -0
- package/dist/chunk-5OARBB2B.js.map +1 -0
- package/dist/chunk-724Y2CKO.js +94 -0
- package/dist/chunk-724Y2CKO.js.map +1 -0
- package/dist/{chunk-GIFG7KAJ.js → chunk-7FPUPHTZ.js} +817 -1177
- package/dist/chunk-7FPUPHTZ.js.map +1 -0
- package/dist/{chunk-DAFUSBKJ.js → chunk-AZ5MTPUR.js} +2 -91
- package/dist/chunk-AZ5MTPUR.js.map +1 -0
- package/dist/chunk-BUUAXCBP.js +93 -0
- package/dist/chunk-BUUAXCBP.js.map +1 -0
- package/dist/{chunk-XADKKDUV.js → chunk-BZWRTKXC.js} +2 -33
- package/dist/chunk-BZWRTKXC.js.map +1 -0
- package/dist/chunk-C2VZS676.js +377 -0
- package/dist/chunk-C2VZS676.js.map +1 -0
- package/dist/{chunk-GYL5JKWQ.js → chunk-DEMLXEB5.js} +3 -3
- package/dist/{chunk-KWODOJBK.js → chunk-EEXWF5SA.js} +6 -5
- package/dist/chunk-EEXWF5SA.js.map +1 -0
- package/dist/{chunk-EIXVJR3C.js → chunk-IEBAPWH3.js} +6 -44
- package/dist/chunk-IEBAPWH3.js.map +1 -0
- package/dist/chunk-LAFXAGDU.js +29 -0
- package/dist/chunk-LAFXAGDU.js.map +1 -0
- package/dist/{chunk-2YUDGRJ6.js → chunk-LIGQMX7K.js} +9 -7
- package/dist/{chunk-2YUDGRJ6.js.map → chunk-LIGQMX7K.js.map} +1 -1
- package/dist/chunk-SSTYQQSR.js +86 -0
- package/dist/chunk-SSTYQQSR.js.map +1 -0
- package/dist/{chunk-QZ3OZJBG.js → chunk-TIXHLU3Q.js} +6 -22
- package/dist/chunk-TIXHLU3Q.js.map +1 -0
- package/dist/{chunk-WLXTXXNY.js → chunk-TLY6IMDY.js} +39 -1
- package/dist/chunk-TLY6IMDY.js.map +1 -0
- package/dist/chunk-TQP3COOV.js +69 -0
- package/dist/chunk-TQP3COOV.js.map +1 -0
- package/dist/{chunk-M34C6LTF.js → chunk-UBWS5JVM.js} +19 -9
- package/dist/chunk-UBWS5JVM.js.map +1 -0
- package/dist/{chunk-YK2XKOP4.js → chunk-WEATMI5J.js} +8 -1
- package/dist/chunk-WEATMI5J.js.map +1 -0
- package/dist/chunk-WG3KLJFJ.js +64 -0
- package/dist/chunk-WG3KLJFJ.js.map +1 -0
- package/dist/{chunk-YYNHKGCH.js → chunk-ZRABX7EM.js} +2 -2
- package/dist/index.js +19 -15
- package/dist/index.js.map +1 -1
- package/dist/{logger-B7B64O4P.js → logger-XEIQC6K6.js} +3 -3
- package/dist/preview-worker.js +7871 -0
- package/dist/preview-worker.js.map +1 -0
- package/dist/{relay-token-N3BSBURG.js → relay-token-Y3IFNUMX.js} +4 -4
- package/dist/serve.js +2725 -10113
- package/dist/serve.js.map +1 -1
- package/dist/session-worker.js +35 -69
- package/dist/session-worker.js.map +1 -1
- package/dist/{terminal-UTFRKKZ4.js → terminal-FNVKGTTL.js} +17 -12
- package/dist/terminal-FNVKGTTL.js.map +1 -0
- package/dist/terminal-worker.js +29 -22
- package/dist/terminal-worker.js.map +1 -1
- package/dist/update-runner.js +4 -3
- package/dist/update-runner.js.map +1 -1
- package/package.json +3 -3
- package/dist/autostart-G2MSOPL7.js.map +0 -1
- package/dist/chunk-CMADETTC.js +0 -147
- package/dist/chunk-CMADETTC.js.map +0 -1
- package/dist/chunk-DAFUSBKJ.js.map +0 -1
- package/dist/chunk-EIXVJR3C.js.map +0 -1
- package/dist/chunk-GIFG7KAJ.js.map +0 -1
- package/dist/chunk-KWODOJBK.js.map +0 -1
- package/dist/chunk-M34C6LTF.js.map +0 -1
- package/dist/chunk-QZ3OZJBG.js.map +0 -1
- package/dist/chunk-WLXTXXNY.js.map +0 -1
- package/dist/chunk-XADKKDUV.js.map +0 -1
- package/dist/chunk-YK2XKOP4.js.map +0 -1
- package/dist/terminal-UTFRKKZ4.js.map +0 -1
- /package/dist/{chunk-HYDXGNKA.js.map → chunk-5COVSNQZ.js.map} +0 -0
- /package/dist/{chunk-GYL5JKWQ.js.map → chunk-DEMLXEB5.js.map} +0 -0
- /package/dist/{chunk-YYNHKGCH.js.map → chunk-ZRABX7EM.js.map} +0 -0
- /package/dist/{logger-B7B64O4P.js.map → logger-XEIQC6K6.js.map} +0 -0
- /package/dist/{relay-token-N3BSBURG.js.map → relay-token-Y3IFNUMX.js.map} +0 -0
package/dist/session-worker.js
CHANGED
|
@@ -3,41 +3,51 @@ import {
|
|
|
3
3
|
ControlRequestEventSchema,
|
|
4
4
|
SeqCounter,
|
|
5
5
|
createApprovalRequestIdFactory
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-NQDJ6QAM.js";
|
|
6
|
+
} from "./chunk-5COVSNQZ.js";
|
|
8
7
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
8
|
+
acceptCurrentWorkerSocketMessage,
|
|
9
|
+
readWorkerConnection,
|
|
10
|
+
releaseWorkerSocket,
|
|
11
|
+
takeoverWorkerSocket
|
|
12
|
+
} from "./chunk-WG3KLJFJ.js";
|
|
13
|
+
import "./chunk-NQDJ6QAM.js";
|
|
14
14
|
import {
|
|
15
15
|
CLAUDE_PROVIDER,
|
|
16
16
|
CODEX_PROVIDER,
|
|
17
17
|
KIMI_PROVIDER,
|
|
18
18
|
resolveCodexPermissionPolicy,
|
|
19
19
|
resolveKimiAcpMode
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-TIXHLU3Q.js";
|
|
21
21
|
import {
|
|
22
|
-
ControlErrorCode,
|
|
23
|
-
LineBuffer,
|
|
24
22
|
WORKER_IPC_PROTOCOL_VERSION,
|
|
25
23
|
createWorkerReader,
|
|
26
24
|
serializeWorkerMsg
|
|
27
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-C2VZS676.js";
|
|
26
|
+
import "./chunk-LAFXAGDU.js";
|
|
27
|
+
import {
|
|
28
|
+
ControlErrorCode,
|
|
29
|
+
LineBuffer
|
|
30
|
+
} from "./chunk-7FPUPHTZ.js";
|
|
28
31
|
import {
|
|
29
32
|
prepareLocalIpcEndpoint,
|
|
30
33
|
removeLocalIpcEndpoint,
|
|
31
34
|
setLocalIpcEndpointPermissions
|
|
32
35
|
} from "./chunk-77QVUYU7.js";
|
|
36
|
+
import {
|
|
37
|
+
terminateOwnedProcessTree
|
|
38
|
+
} from "./chunk-JZ7MWN24.js";
|
|
39
|
+
import {
|
|
40
|
+
PROXY_VERSION
|
|
41
|
+
} from "./chunk-EGNWMOPC.js";
|
|
33
42
|
import {
|
|
34
43
|
classifyCodexActiveWriterError,
|
|
35
44
|
sanitizeProviderErrorTail
|
|
36
45
|
} from "./chunk-J5V2TKSV.js";
|
|
37
46
|
import {
|
|
38
47
|
spawnCommand
|
|
39
|
-
} from "./chunk-
|
|
40
|
-
import "./chunk-
|
|
48
|
+
} from "./chunk-SSTYQQSR.js";
|
|
49
|
+
import "./chunk-TQP3COOV.js";
|
|
50
|
+
import "./chunk-WEATMI5J.js";
|
|
41
51
|
|
|
42
52
|
// src/session-worker.ts
|
|
43
53
|
import { createServer } from "net";
|
|
@@ -1295,59 +1305,15 @@ var KimiAcpSession = class {
|
|
|
1295
1305
|
}
|
|
1296
1306
|
};
|
|
1297
1307
|
|
|
1298
|
-
// src/worker/serve-
|
|
1308
|
+
// src/worker/serve-connection.ts
|
|
1299
1309
|
function readServeConnection(socket, sessionId2, callbacks, timeoutMs = 5e3) {
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
if (socket.destroyed) return;
|
|
1308
|
-
if (!accepted) {
|
|
1309
|
-
if (message.type !== "serve_protocol_hello" || message.sessionId !== sessionId2) {
|
|
1310
|
-
callbacks.onError(new Error("Serve IPC protocol handshake rejected"));
|
|
1311
|
-
socket.destroy();
|
|
1312
|
-
return;
|
|
1313
|
-
}
|
|
1314
|
-
accepted = true;
|
|
1315
|
-
clearTimeout(timeout);
|
|
1316
|
-
callbacks.onAccepted();
|
|
1317
|
-
return;
|
|
1318
|
-
}
|
|
1319
|
-
if (message.type === "serve_protocol_hello") {
|
|
1320
|
-
callbacks.onError(new Error("Duplicate serve IPC protocol hello"));
|
|
1321
|
-
socket.destroy();
|
|
1322
|
-
return;
|
|
1323
|
-
}
|
|
1324
|
-
callbacks.onMessage(message);
|
|
1325
|
-
},
|
|
1326
|
-
(error) => {
|
|
1327
|
-
if (socket.destroyed) return;
|
|
1328
|
-
callbacks.onError(error);
|
|
1329
|
-
if (!accepted) socket.destroy();
|
|
1330
|
-
}
|
|
1331
|
-
);
|
|
1332
|
-
}
|
|
1333
|
-
function takeoverServeSocket(prev, next) {
|
|
1334
|
-
if (prev && prev !== next) {
|
|
1335
|
-
try {
|
|
1336
|
-
prev.destroy();
|
|
1337
|
-
} catch {
|
|
1338
|
-
}
|
|
1339
|
-
}
|
|
1340
|
-
return next;
|
|
1341
|
-
}
|
|
1342
|
-
function acceptCurrentServeSocketMessage(current, candidate) {
|
|
1343
|
-
if (current === candidate) return true;
|
|
1344
|
-
candidate.destroy();
|
|
1345
|
-
return false;
|
|
1346
|
-
}
|
|
1347
|
-
function releaseServeSocket(current, closed, onCurrentClosed) {
|
|
1348
|
-
if (current !== closed) return current;
|
|
1349
|
-
onCurrentClosed();
|
|
1350
|
-
return null;
|
|
1310
|
+
readWorkerConnection(socket, {
|
|
1311
|
+
read: createWorkerReader,
|
|
1312
|
+
isHello: (message) => message.type === "serve_protocol_hello",
|
|
1313
|
+
acceptHello: (message) => message.type === "serve_protocol_hello" && message.sessionId === sessionId2,
|
|
1314
|
+
...callbacks,
|
|
1315
|
+
timeoutMs
|
|
1316
|
+
});
|
|
1351
1317
|
}
|
|
1352
1318
|
|
|
1353
1319
|
// src/session-worker.ts
|
|
@@ -1594,7 +1560,7 @@ function handleServeConnection(socket) {
|
|
|
1594
1560
|
onAccepted: () => {
|
|
1595
1561
|
const previousServeSocket = serveSocket;
|
|
1596
1562
|
serveSocket = socket;
|
|
1597
|
-
|
|
1563
|
+
takeoverWorkerSocket(previousServeSocket, socket);
|
|
1598
1564
|
socket.write(
|
|
1599
1565
|
serializeWorkerMsg({
|
|
1600
1566
|
type: "worker_protocol_hello",
|
|
@@ -1607,7 +1573,7 @@ function handleServeConnection(socket) {
|
|
|
1607
1573
|
replayServeState(socket);
|
|
1608
1574
|
},
|
|
1609
1575
|
onMessage: (msg) => {
|
|
1610
|
-
if (!
|
|
1576
|
+
if (!acceptCurrentWorkerSocketMessage(serveSocket, socket)) return;
|
|
1611
1577
|
if (!providerReady && msg.type !== "worker_stop") {
|
|
1612
1578
|
console.error(`[worker] serve message ${msg.type} arrived before provider readiness`);
|
|
1613
1579
|
socket.destroy();
|
|
@@ -1665,12 +1631,12 @@ function handleServeConnection(socket) {
|
|
|
1665
1631
|
}
|
|
1666
1632
|
});
|
|
1667
1633
|
socket.on("close", () => {
|
|
1668
|
-
serveSocket =
|
|
1634
|
+
serveSocket = releaseWorkerSocket(serveSocket, socket, () => {
|
|
1669
1635
|
rejectAllPendingApprovals("Serve connection closed");
|
|
1670
1636
|
});
|
|
1671
1637
|
});
|
|
1672
1638
|
socket.on("error", () => {
|
|
1673
|
-
serveSocket =
|
|
1639
|
+
serveSocket = releaseWorkerSocket(serveSocket, socket, () => {
|
|
1674
1640
|
rejectAllPendingApprovals("Serve connection error");
|
|
1675
1641
|
});
|
|
1676
1642
|
});
|