staff-mcp 1.1.2 → 1.3.0
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/README.md +46 -1
- package/README_zh.md +36 -1
- package/dist/src/constants.d.ts +6 -0
- package/dist/src/constants.js +6 -0
- package/dist/src/constants.js.map +1 -1
- package/dist/src/index.js +41 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/lsp/manager.d.ts +2 -0
- package/dist/src/lsp/manager.js +22 -10
- package/dist/src/lsp/manager.js.map +1 -1
- package/dist/src/server.js +1 -1
- package/dist/src/server.js.map +1 -1
- package/dist/src/tools/mcp-client-tools.js +7 -3
- package/dist/src/tools/mcp-client-tools.js.map +1 -1
- package/dist/src/tools/shell-tools.js +13 -4
- package/dist/src/tools/shell-tools.js.map +1 -1
- package/dist/src/tools/skills.js +2 -2
- package/dist/src/tools/skills.js.map +1 -1
- package/dist/src/tools/system-tools.d.ts +9 -3
- package/dist/src/tools/system-tools.js +31 -48
- package/dist/src/tools/system-tools.js.map +1 -1
- package/dist/src/transports/http.d.ts +2 -1
- package/dist/src/transports/http.js +26 -3
- package/dist/src/transports/http.js.map +1 -1
- package/dist/src/transports/reverse.d.ts +5 -1
- package/dist/src/transports/reverse.js +4 -2
- package/dist/src/transports/reverse.js.map +1 -1
- package/dist/src/transports/stdio.d.ts +1 -0
- package/dist/src/transports/stdio.js +6 -4
- package/dist/src/transports/stdio.js.map +1 -1
- package/dist/src/utils/proxy.d.ts +1 -1
- package/dist/src/utils/proxy.js.map +1 -1
- package/package.json +15 -16
- package/dist/tests/docker-proxy.test.d.ts +0 -1
- package/dist/tests/docker-proxy.test.js +0 -395
- package/dist/tests/docker-proxy.test.js.map +0 -1
- package/dist/tests/file-write-queue.test.d.ts +0 -1
- package/dist/tests/file-write-queue.test.js +0 -105
- package/dist/tests/file-write-queue.test.js.map +0 -1
- package/dist/tests/fte-lifecycle.test.d.ts +0 -1
- package/dist/tests/fte-lifecycle.test.js +0 -118
- package/dist/tests/fte-lifecycle.test.js.map +0 -1
- package/dist/tests/lsp-client.test.d.ts +0 -1
- package/dist/tests/lsp-client.test.js +0 -52
- package/dist/tests/lsp-client.test.js.map +0 -1
- package/dist/tests/package-info.test.d.ts +0 -1
- package/dist/tests/package-info.test.js +0 -54
- package/dist/tests/package-info.test.js.map +0 -1
- package/dist/tests/proxy-no-proxy.test.d.ts +0 -1
- package/dist/tests/proxy-no-proxy.test.js +0 -156
- package/dist/tests/proxy-no-proxy.test.js.map +0 -1
- package/dist/tests/proxy.test.d.ts +0 -1
- package/dist/tests/proxy.test.js +0 -89
- package/dist/tests/proxy.test.js.map +0 -1
- package/dist/tests/reverse-reconnect.test.d.ts +0 -1
- package/dist/tests/reverse-reconnect.test.js +0 -89
- package/dist/tests/reverse-reconnect.test.js.map +0 -1
- package/dist/tests/security.test.d.ts +0 -1
- package/dist/tests/security.test.js +0 -21
- package/dist/tests/security.test.js.map +0 -1
- package/dist/tests/shell-tools.test.d.ts +0 -1
- package/dist/tests/shell-tools.test.js +0 -113
- package/dist/tests/shell-tools.test.js.map +0 -1
- package/dist/tests/test_files/test.d.ts +0 -1
- package/dist/tests/test_files/test.js +0 -4
- package/dist/tests/test_files/test.js.map +0 -1
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { test, before, after } from "node:test";
|
|
3
|
-
import * as fs from "fs/promises";
|
|
4
|
-
import * as path from "path";
|
|
5
|
-
import * as os from "os";
|
|
6
|
-
import { enqueueFileWrite, atomicWriteFile } from "../src/utils/file-write-queue.js";
|
|
7
|
-
let tmpDir;
|
|
8
|
-
before(async () => {
|
|
9
|
-
tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "fwq-test-"));
|
|
10
|
-
});
|
|
11
|
-
after(async () => {
|
|
12
|
-
await fs.rm(tmpDir, { recursive: true, force: true });
|
|
13
|
-
});
|
|
14
|
-
test("concurrent read-modify-write cycles lose no updates", async () => {
|
|
15
|
-
const file = path.join(tmpDir, "concurrent.txt");
|
|
16
|
-
await fs.writeFile(file, "", "utf-8");
|
|
17
|
-
// The regression this guards against: N concurrent read-modify-write
|
|
18
|
-
// cycles (the edit_file_by_replace pattern) must all survive.
|
|
19
|
-
const N = 50;
|
|
20
|
-
await Promise.all(Array.from({ length: N }, (_, i) => enqueueFileWrite(file, async () => {
|
|
21
|
-
const content = await fs.readFile(file, "utf-8");
|
|
22
|
-
await atomicWriteFile(file, content + `line-${i}\n`);
|
|
23
|
-
})));
|
|
24
|
-
const final = await fs.readFile(file, "utf-8");
|
|
25
|
-
const lines = final.trim().split("\n");
|
|
26
|
-
assert.equal(lines.length, N, "all appends must survive");
|
|
27
|
-
for (let i = 0; i < N; i++) {
|
|
28
|
-
assert.ok(lines.includes(`line-${i}`), `missing line-${i}`);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
test("atomic write never produces torn content under concurrency", async () => {
|
|
32
|
-
const file = path.join(tmpDir, "atomic.txt");
|
|
33
|
-
const bigA = "A".repeat(200_000);
|
|
34
|
-
const bigB = "B".repeat(200_000);
|
|
35
|
-
await Promise.all([
|
|
36
|
-
enqueueFileWrite(file, () => atomicWriteFile(file, bigA)),
|
|
37
|
-
enqueueFileWrite(file, () => atomicWriteFile(file, bigB)),
|
|
38
|
-
enqueueFileWrite(file, () => atomicWriteFile(file, bigA)),
|
|
39
|
-
enqueueFileWrite(file, () => atomicWriteFile(file, bigB)),
|
|
40
|
-
]);
|
|
41
|
-
const final = await fs.readFile(file, "utf-8");
|
|
42
|
-
assert.ok(final === bigA || final === bigB, "content must be one complete version, never mixed");
|
|
43
|
-
});
|
|
44
|
-
test("writes to different paths still run in parallel", async () => {
|
|
45
|
-
const fileA = path.join(tmpDir, "a.txt");
|
|
46
|
-
const fileB = path.join(tmpDir, "b.txt");
|
|
47
|
-
let aRunning = false;
|
|
48
|
-
let overlapObserved = false;
|
|
49
|
-
await Promise.all([
|
|
50
|
-
enqueueFileWrite(fileA, async () => {
|
|
51
|
-
aRunning = true;
|
|
52
|
-
await new Promise((r) => setTimeout(r, 50));
|
|
53
|
-
aRunning = false;
|
|
54
|
-
await atomicWriteFile(fileA, "a");
|
|
55
|
-
}),
|
|
56
|
-
enqueueFileWrite(fileB, async () => {
|
|
57
|
-
if (aRunning)
|
|
58
|
-
overlapObserved = true;
|
|
59
|
-
await atomicWriteFile(fileB, "b");
|
|
60
|
-
}),
|
|
61
|
-
]);
|
|
62
|
-
assert.equal(overlapObserved, true, "different paths must not block each other");
|
|
63
|
-
assert.equal(await fs.readFile(fileA, "utf-8"), "a");
|
|
64
|
-
assert.equal(await fs.readFile(fileB, "utf-8"), "b");
|
|
65
|
-
});
|
|
66
|
-
test("a failing task does not poison the queue", async () => {
|
|
67
|
-
const file = path.join(tmpDir, "poison.txt");
|
|
68
|
-
await assert.rejects(enqueueFileWrite(file, async () => {
|
|
69
|
-
throw new Error("boom");
|
|
70
|
-
}), /boom/);
|
|
71
|
-
// Subsequent task on the same path must still run.
|
|
72
|
-
const result = await enqueueFileWrite(file, async () => {
|
|
73
|
-
await atomicWriteFile(file, "alive");
|
|
74
|
-
return "ok";
|
|
75
|
-
});
|
|
76
|
-
assert.equal(result, "ok");
|
|
77
|
-
assert.equal(await fs.readFile(file, "utf-8"), "alive");
|
|
78
|
-
});
|
|
79
|
-
test("atomicWriteFile leaves no temp file behind", async () => {
|
|
80
|
-
const file = path.join(tmpDir, "clean.txt");
|
|
81
|
-
await atomicWriteFile(file, "content-中文-🎉");
|
|
82
|
-
assert.equal(await fs.readFile(file, "utf-8"), "content-中文-🎉");
|
|
83
|
-
const siblings = await fs.readdir(tmpDir);
|
|
84
|
-
assert.ok(!siblings.some((name) => name.endsWith(".tmp")), `temp file leaked: ${siblings.join(", ")}`);
|
|
85
|
-
});
|
|
86
|
-
test("atomicWriteFile cleans up temp file when write fails", async () => {
|
|
87
|
-
const dirFile = path.join(tmpDir, "is-a-dir");
|
|
88
|
-
await fs.mkdir(dirFile); // rename onto an existing non-empty path is fine, but writing INTO a dir path fails below
|
|
89
|
-
const blocked = path.join(dirFile, "sub.txt");
|
|
90
|
-
await fs.writeFile(blocked, "x");
|
|
91
|
-
// rename(file, existing-empty-dir) is OK on POSIX, so force failure differently:
|
|
92
|
-
// make the directory read-only so the temp file cannot be created.
|
|
93
|
-
const roDir = path.join(tmpDir, "read-only");
|
|
94
|
-
await fs.mkdir(roDir);
|
|
95
|
-
await fs.chmod(roDir, 0o500);
|
|
96
|
-
try {
|
|
97
|
-
await assert.rejects(atomicWriteFile(path.join(roDir, "x.txt"), "data"));
|
|
98
|
-
const leftovers = await fs.readdir(roDir);
|
|
99
|
-
assert.deepEqual(leftovers, [], "temp file must be cleaned up on failure");
|
|
100
|
-
}
|
|
101
|
-
finally {
|
|
102
|
-
await fs.chmod(roDir, 0o700);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
//# sourceMappingURL=file-write-queue.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-write-queue.test.js","sourceRoot":"","sources":["../../tests/file-write-queue.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAErF,IAAI,MAAc,CAAC;AAEnB,MAAM,CAAC,KAAK,IAAI,EAAE;IAChB,MAAM,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC;AACjE,CAAC,CAAC,CAAC;AAEH,KAAK,CAAC,KAAK,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C,OAAO,EAAE,GAAG,CAAC,CAAC;IAEjC,iFAAiF;IACjF,mEAAmE;IACnE,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC7C,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtB,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7B,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QACzE,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,EAAE,yCAAyC,CAAC,CAAC;IAC7E,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { test } from "node:test";
|
|
3
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
-
import { FteServer } from "mcp-fte";
|
|
5
|
-
import { installFteTransportLifecycle } from "../src/transports/fte-lifecycle.js";
|
|
6
|
-
class TestTransport {
|
|
7
|
-
startFailure;
|
|
8
|
-
closeBeforeReject;
|
|
9
|
-
closeGate;
|
|
10
|
-
onclose;
|
|
11
|
-
onerror;
|
|
12
|
-
onmessage;
|
|
13
|
-
closeCalls = 0;
|
|
14
|
-
constructor(startFailure, closeBeforeReject = false, closeGate) {
|
|
15
|
-
this.startFailure = startFailure;
|
|
16
|
-
this.closeBeforeReject = closeBeforeReject;
|
|
17
|
-
this.closeGate = closeGate;
|
|
18
|
-
}
|
|
19
|
-
async start() {
|
|
20
|
-
if (this.startFailure) {
|
|
21
|
-
if (this.closeBeforeReject)
|
|
22
|
-
this.onclose?.();
|
|
23
|
-
throw this.startFailure;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
async send() { }
|
|
27
|
-
async close() {
|
|
28
|
-
this.closeCalls++;
|
|
29
|
-
this.onclose?.();
|
|
30
|
-
this.closeGate?.started();
|
|
31
|
-
await this.closeGate?.wait;
|
|
32
|
-
}
|
|
33
|
-
disconnect() {
|
|
34
|
-
this.onclose?.();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function createServer(cleanupCounter) {
|
|
38
|
-
const server = new McpServer({ name: "fte-lifecycle-test", version: "1.0.0" });
|
|
39
|
-
installFteTransportLifecycle(server, [], (transport, config) => {
|
|
40
|
-
const wrapped = FteServer.wrapTransport(transport, config);
|
|
41
|
-
const close = wrapped.close.bind(wrapped);
|
|
42
|
-
wrapped.close = async () => {
|
|
43
|
-
cleanupCounter.value++;
|
|
44
|
-
await close();
|
|
45
|
-
};
|
|
46
|
-
return wrapped;
|
|
47
|
-
});
|
|
48
|
-
return server;
|
|
49
|
-
}
|
|
50
|
-
async function flushCleanup() {
|
|
51
|
-
await new Promise((resolve) => setImmediate(resolve));
|
|
52
|
-
}
|
|
53
|
-
test("self-closing reverse transports dispose the FTE wrapper exactly once and allow reconnect", async () => {
|
|
54
|
-
const cleanupCounter = { value: 0 };
|
|
55
|
-
const server = createServer(cleanupCounter);
|
|
56
|
-
const first = new TestTransport();
|
|
57
|
-
await server.connect(first);
|
|
58
|
-
assert.equal(server.isConnected(), true);
|
|
59
|
-
first.disconnect();
|
|
60
|
-
await flushCleanup();
|
|
61
|
-
assert.equal(server.isConnected(), false);
|
|
62
|
-
assert.equal(cleanupCounter.value, 1);
|
|
63
|
-
const second = new TestTransport();
|
|
64
|
-
await server.connect(second);
|
|
65
|
-
assert.equal(server.isConnected(), true);
|
|
66
|
-
await server.close();
|
|
67
|
-
await flushCleanup();
|
|
68
|
-
assert.equal(server.isConnected(), false);
|
|
69
|
-
assert.equal(cleanupCounter.value, 2);
|
|
70
|
-
});
|
|
71
|
-
test("failed starts clean up FTE state even when the transport does not emit onclose", async () => {
|
|
72
|
-
const cleanupCounter = { value: 0 };
|
|
73
|
-
const server = createServer(cleanupCounter);
|
|
74
|
-
const failed = new TestTransport(new Error("connect failed"), false);
|
|
75
|
-
await assert.rejects(server.connect(failed), /connect failed/);
|
|
76
|
-
await flushCleanup();
|
|
77
|
-
assert.equal(server.isConnected(), false);
|
|
78
|
-
assert.equal(cleanupCounter.value, 1);
|
|
79
|
-
const next = new TestTransport();
|
|
80
|
-
await server.connect(next);
|
|
81
|
-
assert.equal(server.isConnected(), true);
|
|
82
|
-
await server.close();
|
|
83
|
-
});
|
|
84
|
-
test("failed starts that already emitted onclose still clean up only once", async () => {
|
|
85
|
-
const cleanupCounter = { value: 0 };
|
|
86
|
-
const server = createServer(cleanupCounter);
|
|
87
|
-
const failed = new TestTransport(new Error("closed while connecting"), true);
|
|
88
|
-
await assert.rejects(server.connect(failed), /closed while connecting/);
|
|
89
|
-
await flushCleanup();
|
|
90
|
-
assert.equal(server.isConnected(), false);
|
|
91
|
-
assert.equal(cleanupCounter.value, 1);
|
|
92
|
-
});
|
|
93
|
-
test("stale failed-transport cleanup cannot detach a newer connection", async () => {
|
|
94
|
-
const cleanupCounter = { value: 0 };
|
|
95
|
-
const server = createServer(cleanupCounter);
|
|
96
|
-
let markCloseStarted;
|
|
97
|
-
const closeStarted = new Promise((resolve) => {
|
|
98
|
-
markCloseStarted = resolve;
|
|
99
|
-
});
|
|
100
|
-
let releaseClose;
|
|
101
|
-
const closeWait = new Promise((resolve) => {
|
|
102
|
-
releaseClose = resolve;
|
|
103
|
-
});
|
|
104
|
-
const failed = new TestTransport(new Error("first connect failed"), false, { started: markCloseStarted, wait: closeWait });
|
|
105
|
-
const firstConnect = server.connect(failed);
|
|
106
|
-
await closeStarted;
|
|
107
|
-
// The first delegate has synchronously fired onclose, so Protocol is free to
|
|
108
|
-
// bind a replacement while the old FTE close remains asynchronously pending.
|
|
109
|
-
const replacement = new TestTransport();
|
|
110
|
-
await server.connect(replacement);
|
|
111
|
-
assert.equal(server.isConnected(), true);
|
|
112
|
-
releaseClose();
|
|
113
|
-
await assert.rejects(firstConnect, /first connect failed/);
|
|
114
|
-
assert.equal(server.isConnected(), true);
|
|
115
|
-
assert.equal(server.server.transport !== undefined, true);
|
|
116
|
-
await server.close();
|
|
117
|
-
});
|
|
118
|
-
//# sourceMappingURL=fte-lifecycle.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fte-lifecycle.test.js","sourceRoot":"","sources":["../../tests/fte-lifecycle.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAElF,MAAM,aAAa;IAOE;IACA;IACA;IARnB,OAAO,CAAc;IACrB,OAAO,CAA0B;IACjC,SAAS,CAA0B;IACnC,UAAU,GAAG,CAAC,CAAC;IAEf,YACmB,YAAoB,EACpB,oBAAoB,KAAK,EACzB,SAAwD;QAFxD,iBAAY,GAAZ,YAAY,CAAQ;QACpB,sBAAiB,GAAjB,iBAAiB,CAAQ;QACzB,cAAS,GAAT,SAAS,CAA+C;IACxE,CAAC;IAEJ,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,IAAI,CAAC,iBAAiB;gBAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;YAC7C,MAAM,IAAI,CAAC,YAAY,CAAC;QAC1B,CAAC;IACH,C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AO,CAAC;IAC7B,CAAC,CAAC,CAAC;IACH,IAAI,YAAyB,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAC9C,YAAY,GAAG,OAAO,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,aAAa,CAC9B,IAAI,KAAK,CAAC,sBAAsB,CAAC,EACjC,KAAK,EACL,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,CAC/C,CAAC;IACF,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,YAAY,CAAC;IAEnB,6EAA6E;IAC7E,6EAA6E;IAC7E,MAAM,WAAW,GAAG,IAAI,aAAa,EAAE,CAAC;IACxC,MAAM,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAClC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;IAEzC,YAAY,EAAE,CAAC;IACf,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,sBAAsB,CAAC,CAAC;IAC3D,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;IACzC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,EAAE,IAAI,CAAC,CAAC;IAE1D,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
|
-
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
3
|
-
async function run() {
|
|
4
|
-
console.log("Starting full LSP suite test via MCP...");
|
|
5
|
-
const transport = new StdioClientTransport({
|
|
6
|
-
command: "npx",
|
|
7
|
-
args: ["tsx", "src/index.ts", "--enable-lsp"]
|
|
8
|
-
});
|
|
9
|
-
const client = new Client({ name: "test-client", version: "1.0.0" }, { capabilities: {} });
|
|
10
|
-
await client.connect(transport);
|
|
11
|
-
console.log("Connected to MCP server");
|
|
12
|
-
const filesToTest = [
|
|
13
|
-
{ path: "tests/test_files/test.ts", line: 1, character: 8, label: "TypeScript" },
|
|
14
|
-
{ path: "tests/test_files/test.py", line: 1, character: 6, label: "Python" },
|
|
15
|
-
{ path: "tests/test_files/test.sh", line: 2, character: 2, label: "Bash" }
|
|
16
|
-
];
|
|
17
|
-
for (const file of filesToTest) {
|
|
18
|
-
try {
|
|
19
|
-
console.log(`\n================ Testing ${file.label} ================`);
|
|
20
|
-
console.log("Testing get_diagnostics...");
|
|
21
|
-
const diags = await client.callTool({
|
|
22
|
-
name: "get_diagnostics",
|
|
23
|
-
arguments: { path: file.path }
|
|
24
|
-
});
|
|
25
|
-
console.log(`Diagnostics:`, Array.isArray(diags.content) ? diags.content[0].text : "None");
|
|
26
|
-
console.log("Testing hover...");
|
|
27
|
-
const hoverInfo = await client.callTool({
|
|
28
|
-
name: "hover",
|
|
29
|
-
arguments: { path: file.path, line: file.line, character: file.character }
|
|
30
|
-
});
|
|
31
|
-
console.log("Hover output snippet:", JSON.stringify(hoverInfo).substring(0, 100) + "...");
|
|
32
|
-
console.log("Testing get_document_symbols...");
|
|
33
|
-
const symbols = await client.callTool({
|
|
34
|
-
name: "get_document_symbols",
|
|
35
|
-
arguments: { path: file.path }
|
|
36
|
-
});
|
|
37
|
-
console.log("Symbols snippet:", JSON.stringify(symbols).substring(0, 150));
|
|
38
|
-
}
|
|
39
|
-
catch (err) {
|
|
40
|
-
console.error(`Tool call failed for ${file.label}:`, err.message);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
// Close the transport so the spawned server process is terminated
|
|
44
|
-
// instead of leaking as an orphan (which also hangs `npm test`).
|
|
45
|
-
await client.close();
|
|
46
|
-
process.exit(0);
|
|
47
|
-
}
|
|
48
|
-
run().catch(async (err) => {
|
|
49
|
-
console.error(err);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=lsp-client.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-client.test.js","sourceRoot":"","sources":["../../tests/lsp-client.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAGjF,KAAK,UAAU,GAAG;IAChB,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,IAAI,oBAAoB,CAAC;QACzC,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,cAAc,CAAC;KAC9C,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,EACzC,EAAE,YAAY,EAAE,EAAE,EAAE,CACrB,CAAC;IAEF,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,MAAM,WAAW,GAAG;QAClB,EAAE,IAAI,EAAE,0BAA0B,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE;QAChF,EAAE,IAAI,EAAE,0BAA0B,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE;QAC5E,EAAE,IAAI,EAAE,0BAA0B,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE;KAC3E,CAA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AAkB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QAE7E,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,KAAK,CAAC,wBAAwB,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;IAED,kEAAkE;IAClE,iEAAiE;IACjE,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACxB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { execFile } from "node:child_process";
|
|
3
|
-
import * as fs from "node:fs";
|
|
4
|
-
import * as path from "node:path";
|
|
5
|
-
import { pathToFileURL } from "node:url";
|
|
6
|
-
import { promisify } from "node:util";
|
|
7
|
-
import { test } from "node:test";
|
|
8
|
-
import { findPackageRoot, readPackageVersion, STAFF_MCP_PACKAGE_ROOT, STAFF_MCP_VERSION, } from "../src/package-info.js";
|
|
9
|
-
const execFileAsync = promisify(execFile);
|
|
10
|
-
test("runtime package metadata comes from the staff-mcp package.json", () => {
|
|
11
|
-
const packageJson = JSON.parse(fs.readFileSync(path.join(STAFF_MCP_PACKAGE_ROOT, "package.json"), "utf8"));
|
|
12
|
-
assert.equal(packageJson.name, "staff-mcp");
|
|
13
|
-
assert.equal(STAFF_MCP_VERSION, packageJson.version);
|
|
14
|
-
assert.equal(readPackageVersion(STAFF_MCP_PACKAGE_ROOT), packageJson.version);
|
|
15
|
-
assert.equal(findPackageRoot(path.join(STAFF_MCP_PACKAGE_ROOT, "src", "tools")), STAFF_MCP_PACKAGE_ROOT);
|
|
16
|
-
});
|
|
17
|
-
test("CLI --version reports the package version", async () => {
|
|
18
|
-
const cliPath = path.join(STAFF_MCP_PACKAGE_ROOT, "dist", "src", "index.js");
|
|
19
|
-
const { stdout } = await execFileAsync(process.execPath, [cliPath, "--version"], {
|
|
20
|
-
cwd: STAFF_MCP_PACKAGE_ROOT,
|
|
21
|
-
});
|
|
22
|
-
assert.equal(stdout.trim(), STAFF_MCP_VERSION);
|
|
23
|
-
});
|
|
24
|
-
test("MCP initialize response advertises the package version", async () => {
|
|
25
|
-
const serverUrl = pathToFileURL(path.join(STAFF_MCP_PACKAGE_ROOT, "dist", "src", "server.js")).href;
|
|
26
|
-
const packageInfoUrl = pathToFileURL(path.join(STAFF_MCP_PACKAGE_ROOT, "dist", "src", "package-info.js")).href;
|
|
27
|
-
const script = `
|
|
28
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
29
|
-
import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
30
|
-
import { createServerFactory } from ${JSON.stringify(serverUrl)};
|
|
31
|
-
import { STAFF_MCP_VERSION } from ${JSON.stringify(packageInfoUrl)};
|
|
32
|
-
|
|
33
|
-
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
|
|
34
|
-
const server = createServerFactory(
|
|
35
|
-
"staff-mcp",
|
|
36
|
-
STAFF_MCP_VERSION,
|
|
37
|
-
process.cwd(),
|
|
38
|
-
[],
|
|
39
|
-
"default",
|
|
40
|
-
5,
|
|
41
|
-
false
|
|
42
|
-
)();
|
|
43
|
-
const client = new Client({ name: "version-test", version: "0.0.0" }, { capabilities: {} });
|
|
44
|
-
await Promise.all([server.connect(serverTransport), client.connect(clientTransport)]);
|
|
45
|
-
console.log(JSON.stringify(client.getServerVersion()));
|
|
46
|
-
process.exit(0);
|
|
47
|
-
`;
|
|
48
|
-
const { stdout } = await execFileAsync(process.execPath, ["--input-type=module", "--eval", script], { cwd: STAFF_MCP_PACKAGE_ROOT, timeout: 10_000 });
|
|
49
|
-
const outputLines = stdout.trim().split("\n");
|
|
50
|
-
const serverVersion = JSON.parse(outputLines.at(-1));
|
|
51
|
-
assert.equal(serverVersion.name, "staff-mcp");
|
|
52
|
-
assert.equal(serverVersion.version, STAFF_MCP_VERSION);
|
|
53
|
-
});
|
|
54
|
-
//# sourceMappingURL=package-info.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-info.test.js","sourceRoot":"","sources":["../../tests/package-info.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,IAAI,CAAC,gEAAgE,EAAE,GAAG,EAAE;IAC1E,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CACtC,CAAC;IAEvC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC5C,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,WAA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,OAAO,CAAC,QAAQ,EAChB,CAAC,qBAAqB,EAAE,QAAQ,EAAE,MAAM,CAAC,EACzC,EAAE,GAAG,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,EAAE,CACjD,CAAC;IACF,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAsC,CAAC;IAE3F,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC9C,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;AACzD,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { test, after } from "node:test";
|
|
3
|
-
import http from "node:http";
|
|
4
|
-
import net from "node:net";
|
|
5
|
-
import { fetch } from "undici";
|
|
6
|
-
import { EnvProxyDispatcher, matchesNoProxy, parseNoProxy, selectProxyForOrigin, } from "../src/utils/proxy.js";
|
|
7
|
-
// ------------------------------------------------------------
|
|
8
|
-
// Pure matcher tests
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
function m(noProxy, host, port = 80) {
|
|
11
|
-
return matchesNoProxy(host, port, parseNoProxy(noProxy));
|
|
12
|
-
}
|
|
13
|
-
test("NO_PROXY wildcard bypasses everything", () => {
|
|
14
|
-
assert.equal(m("*", "anything.example.com", 443), true);
|
|
15
|
-
assert.equal(m("*,proxy.internal", "proxy.internal"), true);
|
|
16
|
-
});
|
|
17
|
-
test("NO_PROXY exact hosts and case-insensitivity", () => {
|
|
18
|
-
assert.equal(m("172.25.44.201", "172.25.44.201"), true);
|
|
19
|
-
assert.equal(m("172.25.44.201", "172.25.44.202"), false);
|
|
20
|
-
assert.equal(m("EXAMPLE.com", "example.COM"), true);
|
|
21
|
-
assert.equal(m("example.com.", "example.com"), true); // FQDN trailing dot
|
|
22
|
-
assert.equal(m("example.com", "example.com."), true);
|
|
23
|
-
});
|
|
24
|
-
test("NO_PROXY domain suffixes (leading dot, star, bare domain)", () => {
|
|
25
|
-
assert.equal(m(".example.com", "www.example.com"), true);
|
|
26
|
-
assert.equal(m(".example.com", "example.com"), true);
|
|
27
|
-
assert.equal(m("*.example.com", "a.b.example.com"), true);
|
|
28
|
-
// bare domain covers subdomains too (curl/wget semantics)
|
|
29
|
-
assert.equal(m("example.com", "www.example.com"), true);
|
|
30
|
-
assert.equal(m("example.com", "notexample.com"), false);
|
|
31
|
-
assert.equal(m("ample.com", "example.com"), false);
|
|
32
|
-
});
|
|
33
|
-
test("NO_PROXY port qualifier restricts the entry to that port", () => {
|
|
34
|
-
assert.equal(m("example.com:8080", "example.com", 8080), true);
|
|
35
|
-
assert.equal(m("example.com:8080", "example.com", 80), false);
|
|
36
|
-
assert.equal(m("10.0.0.0/8:8080", "10.1.2.3", 8080), true);
|
|
37
|
-
assert.equal(m("10.0.0.0/8:8080", "10.1.2.3", 80), false);
|
|
38
|
-
});
|
|
39
|
-
test("NO_PROXY IPv4 CIDR ranges", () => {
|
|
40
|
-
// the corporate container case: 172.16.0.0/12 covers 172.16.0.0 - 172.31.255.255
|
|
41
|
-
assert.equal(m("172.16.0.0/12", "172.25.44.201"), true);
|
|
42
|
-
assert.equal(m("172.16.0.0/12", "172.31.255.254"), true);
|
|
43
|
-
assert.equal(m("172.16.0.0/12", "172.32.0.1"), false);
|
|
44
|
-
assert.equal(m("172.16.0.0/12", "10.0.0.1"), false);
|
|
45
|
-
assert.equal(m("10.0.0.0/8", "10.3.0.4"), true);
|
|
46
|
-
assert.equal(m("192.168.0.0/16", "192.168.1.1"), true);
|
|
47
|
-
assert.equal(m("192.168.0.0/16", "192.167.1.1"), false);
|
|
48
|
-
// boundary prefix lengths
|
|
49
|
-
assert.equal(m("0.0.0.0/0", "203.0.113.9"), true);
|
|
50
|
-
assert.equal(m("10.1.2.3/32", "10.1.2.3"), true);
|
|
51
|
-
assert.equal(m("10.1.2.3/32", "10.1.2.4"), false);
|
|
52
|
-
// hostnames never match IP CIDRs
|
|
53
|
-
assert.equal(m("10.0.0.0/8", "host.example.com"), false);
|
|
54
|
-
});
|
|
55
|
-
test("NO_PROXY IPv6 literals and CIDR ranges", () => {
|
|
56
|
-
assert.equal(m("::1", "::1"), true);
|
|
57
|
-
assert.equal(m("::1", "[::1]"), true);
|
|
58
|
-
assert.equal(m("[::1]", "::1"), true);
|
|
59
|
-
assert.equal(m("fd00::/8", "fd12::3456"), true);
|
|
60
|
-
assert.equal(m("fd00::/8", "fe80::1"), false);
|
|
61
|
-
assert.equal(m("fe80::/10", "fe80::1%eth0"), true); // zone id tolerated
|
|
62
|
-
// embedded IPv4 tail
|
|
63
|
-
assert.equal(m("::ffff:10.0.0.0/104", "::ffff:10.1.2.3"), true);
|
|
64
|
-
});
|
|
65
|
-
test("NO_PROXY invalid entries never match and never throw", () => {
|
|
66
|
-
assert.equal(m("10.0.0.0/33", "10.1.2.3"), false);
|
|
67
|
-
assert.equal(m("garbage///", "garbage"), false);
|
|
68
|
-
assert.equal(m("", "anything"), false);
|
|
69
|
-
assert.doesNotThrow(() => parseNoProxy(":::,,,[/8,"));
|
|
70
|
-
});
|
|
71
|
-
test("selectProxyForOrigin routing decisions", () => {
|
|
72
|
-
const cfg = { httpProxy: "http://proxy:10808", httpsProxy: "http://sproxy:10809" };
|
|
73
|
-
// CIDR bypass — the exact regression scenario from the field report
|
|
74
|
-
assert.equal(selectProxyForOrigin("http://172.25.44.201/api/mcp/reverse/sse", {
|
|
75
|
-
httpProxy: "http://172.25.44.201:10808",
|
|
76
|
-
noProxy: "localhost,127.0.0.1,192.168.0.0/16,172.16.0.0/12,10.0.0.0/8",
|
|
77
|
-
}), null);
|
|
78
|
-
// not covered by NO_PROXY → use the per-protocol proxy
|
|
79
|
-
assert.equal(selectProxyForOrigin("http://8.8.8.8/x", { ...cfg, noProxy: "172.16.0.0/12" }), "http://proxy:10808");
|
|
80
|
-
assert.equal(selectProxyForOrigin("https://8.8.8.8/x", { ...cfg, noProxy: "" }), "http://sproxy:10809");
|
|
81
|
-
// https falls back to HTTP_PROXY when HTTPS_PROXY is unset (undici semantics)
|
|
82
|
-
assert.equal(selectProxyForOrigin("https://8.8.8.8/x", { httpProxy: "http://proxy:10808" }), "http://proxy:10808");
|
|
83
|
-
// http never uses HTTPS_PROXY
|
|
84
|
-
assert.equal(selectProxyForOrigin("http://8.8.8.8/x", { httpsProxy: "http://sproxy:10809" }), null);
|
|
85
|
-
// default ports participate in port-qualified NO_PROXY entries
|
|
86
|
-
assert.equal(selectProxyForOrigin("http://example.com/path", { httpProxy: "http://p:1", noProxy: "example.com:80" }), null);
|
|
87
|
-
assert.equal(selectProxyForOrigin("http://example.com:8080/path", { httpProxy: "http://p:1", noProxy: "example.com:80" }), "http://p:1");
|
|
88
|
-
// non-http protocols and garbage go direct
|
|
89
|
-
assert.equal(selectProxyForOrigin("ws://example.com/x", cfg), null);
|
|
90
|
-
assert.equal(selectProxyForOrigin("not a url", cfg), null);
|
|
91
|
-
});
|
|
92
|
-
async function startTargetServer() {
|
|
93
|
-
const server = http.createServer((req, res) => {
|
|
94
|
-
res.writeHead(200, { "content-type": "text/plain" });
|
|
95
|
-
res.end("target-ok");
|
|
96
|
-
});
|
|
97
|
-
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
98
|
-
const { port } = server.address();
|
|
99
|
-
return {
|
|
100
|
-
url: `http://127.0.0.1:${port}`,
|
|
101
|
-
close: () => new Promise((resolve) => server.close(() => resolve())),
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
/** Minimal HTTP proxy that handles CONNECT tunnels and counts them. */
|
|
105
|
-
async function startConnectProxy() {
|
|
106
|
-
let hits = 0;
|
|
107
|
-
const server = http.createServer((req, res) => {
|
|
108
|
-
res.writeHead(418);
|
|
109
|
-
res.end("unexpected plain proxy request");
|
|
110
|
-
});
|
|
111
|
-
server.on("connect", (req, socket, head) => {
|
|
112
|
-
hits++;
|
|
113
|
-
const [host, portStr] = (req.url ?? "").split(":");
|
|
114
|
-
const upstream = net.connect(Number(portStr), host, () => {
|
|
115
|
-
socket.write("HTTP/1.1 200 Connection Established\r\n\r\n");
|
|
116
|
-
if (head?.length)
|
|
117
|
-
upstream.write(head);
|
|
118
|
-
upstream.pipe(socket);
|
|
119
|
-
socket.pipe(upstream);
|
|
120
|
-
});
|
|
121
|
-
upstream.on("error", () => socket.end());
|
|
122
|
-
socket.on("error", () => upstream.destroy());
|
|
123
|
-
});
|
|
124
|
-
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
125
|
-
const { port } = server.address();
|
|
126
|
-
return {
|
|
127
|
-
url: `http://127.0.0.1:${port}`,
|
|
128
|
-
hits: () => hits,
|
|
129
|
-
close: () => new Promise((resolve) => server.close(() => resolve())),
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
const cleanups = [];
|
|
133
|
-
after(async () => {
|
|
134
|
-
for (const cleanup of cleanups.splice(0))
|
|
135
|
-
await cleanup();
|
|
136
|
-
});
|
|
137
|
-
test("EnvProxyDispatcher bypasses NO_PROXY CIDR targets, proxies the rest", async () => {
|
|
138
|
-
const target = await startTargetServer();
|
|
139
|
-
const proxy = await startConnectProxy();
|
|
140
|
-
cleanups.push(target.close, proxy.close);
|
|
141
|
-
// 1) target inside NO_PROXY range → direct, proxy untouched
|
|
142
|
-
const bypass = new EnvProxyDispatcher({ httpProxy: proxy.url, noProxy: "127.0.0.0/8" });
|
|
143
|
-
cleanups.push(() => bypass.close());
|
|
144
|
-
const res1 = await fetch(`${target.url}/ping`, { dispatcher: bypass });
|
|
145
|
-
assert.equal(res1.status, 200);
|
|
146
|
-
assert.equal(await res1.text(), "target-ok");
|
|
147
|
-
assert.equal(proxy.hits(), 0, "proxy must not be consulted for NO_PROXY targets");
|
|
148
|
-
// 2) target outside NO_PROXY range → CONNECT through the proxy
|
|
149
|
-
const proxied = new EnvProxyDispatcher({ httpProxy: proxy.url, noProxy: "10.0.0.0/8" });
|
|
150
|
-
cleanups.push(() => proxied.close());
|
|
151
|
-
const res2 = await fetch(`${target.url}/ping`, { dispatcher: proxied });
|
|
152
|
-
assert.equal(res2.status, 200);
|
|
153
|
-
assert.equal(await res2.text(), "target-ok");
|
|
154
|
-
assert.ok(proxy.hits() >= 1, "request should have been tunneled through the proxy");
|
|
155
|
-
});
|
|
156
|
-
//# sourceMappingURL=proxy-no-proxy.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-no-proxy.test.js","sourceRoot":"","sources":["../../tests/proxy-no-proxy.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,+DAA+D;AAC/D,sBAAsB;AACtB,+DAA+D;AAE/D,SAAS,CAAC,CAAC,OAAe,EAAE,IAAY,EAAE,OAAsB,EAAE;IAChE,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,IAAI,CAAC,uCAAuC,EAAE,GAAG,EAAE;IACjD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,sBAAsB,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,KAAK,CAAC,CAAC,C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