@dsh-cc/mcp-client 0.8.2 → 0.8.3
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/lib/stdio-stderr.d.ts +36 -0
- package/lib/stdio-stderr.d.ts.map +1 -1
- package/lib/stdio-stderr.js +81 -36
- package/lib/stdio-stderr.js.map +1 -1
- package/package.json +11 -11
package/lib/stdio-stderr.d.ts
CHANGED
|
@@ -63,4 +63,40 @@ export declare function stdioStderrTail(transport: Transport): string;
|
|
|
63
63
|
* mid-rotation; async fs here would reintroduce real races.
|
|
64
64
|
*/
|
|
65
65
|
export declare function attachStdioStderrDrain(transport: StdioClientTransport, serverName: string, logDir?: string, maxBytes?: number): void;
|
|
66
|
+
export interface StdioStderrSink {
|
|
67
|
+
/** Append one pipe chunk: lazy-open, write, rotate when the tally crosses the cap. */
|
|
68
|
+
write(chunk: Buffer | string): void;
|
|
69
|
+
/**
|
|
70
|
+
* End every generation stream; resolves after their fds are closed (all
|
|
71
|
+
* buffered bytes flushed), so deterministic tests can await it.
|
|
72
|
+
*/
|
|
73
|
+
close(): Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Deterministic seam for the byte-routing/rotation decision: the exact
|
|
77
|
+
* production routing a live pipe chunk receives, but chunk boundaries are
|
|
78
|
+
* caller-driven inputs instead of OS-scheduling artifacts (delayed pipe
|
|
79
|
+
* consumption coalesces 60ms-spaced child writes). `attachStdioStderrDrain`
|
|
80
|
+
* delegates every `data` event here, so tests drive coalesced or per-chunk
|
|
81
|
+
* input deterministically without changing production behavior.
|
|
82
|
+
*
|
|
83
|
+
* ponytail: rotation is size-based with one backup generation (the previous
|
|
84
|
+
* `.log.1` is discarded on each rotation); concurrent dsh-cc sessions sharing
|
|
85
|
+
* a serverName may interleave (session header marks each generation);
|
|
86
|
+
* WriteStream buffer grows if the disk stalls — log must never block MCP.
|
|
87
|
+
* Documented rotation edges: (a) bytes buffered in the old stream at rotation
|
|
88
|
+
* time flush into `.log.1` after the rename — a crash between rename and
|
|
89
|
+
* flush loses at most one stream buffer; (b) another session holding the
|
|
90
|
+
* renamed `.log.1` writes into an anonymous inode whose bytes vanish on
|
|
91
|
+
* close — worst-case extra disk ≈ maxBytes × live sessions. A failed
|
|
92
|
+
* rotation rename (e.g. `.log.1` is a directory) sets `rotationDisabled` so
|
|
93
|
+
* appending cannot become a rename-retry storm per chunk; appending then
|
|
94
|
+
* grows unbounded, which is exactly the pre-rotation worst case.
|
|
95
|
+
*
|
|
96
|
+
* INVARIANT: all rotation fs ops (`statSync`/`renameSync`/`createWriteStream`)
|
|
97
|
+
* are SYNCHRONOUS and run inside `write`. PassThrough `data` events cannot
|
|
98
|
+
* interleave, and the `end` handler cannot fire mid-rotation; async fs here
|
|
99
|
+
* would reintroduce real races.
|
|
100
|
+
*/
|
|
101
|
+
export declare function createStdioStderrSink(path: string, maxBytes?: number): StdioStderrSink;
|
|
66
102
|
//# sourceMappingURL=stdio-stderr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio-stderr.d.ts","sourceRoot":"","sources":["../src/stdio-stderr.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAA;AAE9E,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,QAAW,CAAA;AAC5C,+EAA+E;AAC/E,eAAO,MAAM,oBAAoB,OAAO,CAAA;AACxC,gFAAgF;AAChF,eAAO,MAAM,mBAAmB,QAAkB,CAAA;AAIlD;;;;GAIG;AACH,qBAAa,WAAW;IAEV,OAAO,CAAC,QAAQ,CAAC,QAAQ;IADrC,OAAO,CAAC,MAAM,CAAK;gBACU,QAAQ,EAAE,MAAM;IAE7C,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOzB,QAAQ,IAAI,M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/B,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,GAAE,MAA4B,GACrC,IAAI,CAeN;AAED,MAAM,WAAW,eAAe;IAC9B,sFAAsF;IACtF,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IACnC;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAA4B,GAAG,eAAe,CAmD3G"}
|
package/lib/stdio-stderr.js
CHANGED
|
@@ -95,8 +95,44 @@ export function attachStdioStderrDrain(transport, serverName, logDir, maxBytes =
|
|
|
95
95
|
return;
|
|
96
96
|
const tail = new BoundedTail(STDERR_TAIL_CAPACITY);
|
|
97
97
|
tails.set(transport, tail);
|
|
98
|
-
const
|
|
99
|
-
|
|
98
|
+
const sink = createStdioStderrSink(join(logDir ?? defaultStdioLogDir(), `${serverName}.log`), maxBytes);
|
|
99
|
+
stream.on('data', (chunk) => {
|
|
100
|
+
const bytes = typeof chunk === 'string' ? Buffer.from(chunk) : chunk;
|
|
101
|
+
tail.push(bytes.toString('utf8'));
|
|
102
|
+
sink.write(bytes);
|
|
103
|
+
});
|
|
104
|
+
// SDK close() does not destroy the PassThrough; the child's stderr `end`
|
|
105
|
+
// does. Keep the data listener through SIGTERM grace so the last crash
|
|
106
|
+
// line lands in both the ring and the file.
|
|
107
|
+
stream.on('end', () => sink.close());
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Deterministic seam for the byte-routing/rotation decision: the exact
|
|
111
|
+
* production routing a live pipe chunk receives, but chunk boundaries are
|
|
112
|
+
* caller-driven inputs instead of OS-scheduling artifacts (delayed pipe
|
|
113
|
+
* consumption coalesces 60ms-spaced child writes). `attachStdioStderrDrain`
|
|
114
|
+
* delegates every `data` event here, so tests drive coalesced or per-chunk
|
|
115
|
+
* input deterministically without changing production behavior.
|
|
116
|
+
*
|
|
117
|
+
* ponytail: rotation is size-based with one backup generation (the previous
|
|
118
|
+
* `.log.1` is discarded on each rotation); concurrent dsh-cc sessions sharing
|
|
119
|
+
* a serverName may interleave (session header marks each generation);
|
|
120
|
+
* WriteStream buffer grows if the disk stalls — log must never block MCP.
|
|
121
|
+
* Documented rotation edges: (a) bytes buffered in the old stream at rotation
|
|
122
|
+
* time flush into `.log.1` after the rename — a crash between rename and
|
|
123
|
+
* flush loses at most one stream buffer; (b) another session holding the
|
|
124
|
+
* renamed `.log.1` writes into an anonymous inode whose bytes vanish on
|
|
125
|
+
* close — worst-case extra disk ≈ maxBytes × live sessions. A failed
|
|
126
|
+
* rotation rename (e.g. `.log.1` is a directory) sets `rotationDisabled` so
|
|
127
|
+
* appending cannot become a rename-retry storm per chunk; appending then
|
|
128
|
+
* grows unbounded, which is exactly the pre-rotation worst case.
|
|
129
|
+
*
|
|
130
|
+
* INVARIANT: all rotation fs ops (`statSync`/`renameSync`/`createWriteStream`)
|
|
131
|
+
* are SYNCHRONOUS and run inside `write`. PassThrough `data` events cannot
|
|
132
|
+
* interleave, and the `end` handler cannot fire mid-rotation; async fs here
|
|
133
|
+
* would reintroduce real races.
|
|
134
|
+
*/
|
|
135
|
+
export function createStdioStderrSink(path, maxBytes = STDIO_LOG_MAX_BYTES) {
|
|
100
136
|
let rotationDisabled = maxBytes <= 0;
|
|
101
137
|
let file;
|
|
102
138
|
// Byte tally for the currently open generation, reset to the just-opened
|
|
@@ -105,43 +141,52 @@ export function attachStdioStderrDrain(transport, serverName, logDir, maxBytes =
|
|
|
105
141
|
// deliberately NOT counted: the cap governs captured server output, not
|
|
106
142
|
// our bookkeeping lines.
|
|
107
143
|
let tally = 0;
|
|
108
|
-
|
|
144
|
+
// Resolved when a generation's fd is closed (buffered bytes flushed).
|
|
145
|
+
let flushes = [];
|
|
146
|
+
const endStream = (stream) => {
|
|
147
|
+
flushes.push(new Promise((resolve) => { stream.once('close', () => resolve(undefined)); stream.end(); }));
|
|
148
|
+
};
|
|
109
149
|
const open = () => {
|
|
110
|
-
file = openLogFile(path,
|
|
150
|
+
file = openLogFile(path, rotationDisabled ? 0 : maxBytes, (seed) => { tally = seed; });
|
|
111
151
|
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
152
|
+
return {
|
|
153
|
+
write(chunk) {
|
|
154
|
+
const bytes = typeof chunk === 'string' ? Buffer.from(chunk) : chunk;
|
|
155
|
+
if (file === undefined)
|
|
156
|
+
open(); // lazy: a silent server leaves no file
|
|
157
|
+
if (file === undefined)
|
|
158
|
+
return;
|
|
159
|
+
file.write(bytes);
|
|
160
|
+
tally += bytes.length;
|
|
161
|
+
if (!rotationDisabled && tally >= maxBytes) {
|
|
162
|
+
let renamed = false;
|
|
163
|
+
try {
|
|
164
|
+
// Rename WHILE the old stream is open: POSIX keeps the open fd on the
|
|
165
|
+
// inode, so buffered bytes flush into `.log.1` — no loss. The chunk
|
|
166
|
+
// that crossed the boundary stays in the old file; never split it.
|
|
167
|
+
renameSync(path, `${path}.1`);
|
|
168
|
+
renamed = true;
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
// Unrenamable backup path (EISDIR/EPERM/…): stop trying, or every
|
|
172
|
+
// subsequent chunk retriggers the same doomed rename.
|
|
173
|
+
rotationDisabled = true;
|
|
174
|
+
}
|
|
175
|
+
if (renamed) {
|
|
176
|
+
endStream(file);
|
|
177
|
+
open();
|
|
178
|
+
}
|
|
134
179
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
180
|
+
},
|
|
181
|
+
close() {
|
|
182
|
+
if (file !== undefined)
|
|
183
|
+
endStream(file);
|
|
184
|
+
file = undefined;
|
|
185
|
+
const done = Promise.all(flushes);
|
|
186
|
+
flushes = [];
|
|
187
|
+
return done.then(() => undefined);
|
|
188
|
+
},
|
|
189
|
+
};
|
|
145
190
|
}
|
|
146
191
|
/**
|
|
147
192
|
* Open (lazily) the generation log file: rotate an oversized existing file to
|
package/lib/stdio-stderr.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio-stderr.js","sourceRoot":"","sources":["../src/stdio-stderr.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAoB,MAAM,SAAS,CAAA;AACxG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAIzC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAG,IAAI,CAAA;AAC5C,+EAA+E;AAC/E,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAA;AACxC,gFAAgF;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA;AAElD,MAAM,KAAK,GAAG,IAAI,OAAO,EAA0B,CAAA;AAEnD;;;;GAIG;AACH,MAAM,OAAO,WAAW;IAEO;IADrB,MAAM,GAAG,EAAE,CAAA;IACnB,YAA6B,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;IAAG,CAAC;IAEjD,IAAI,CAAC,KAAa;QAChB,IAAI,CAAC,MAAM,IAAI,KAAK,CAAA;QACpB,IAAI,IAAI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,IAAI,CAAA;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,CAAA;IACV,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-cc/mcp-client",
|
|
3
3
|
"description": "MCP client bridge: connects to MCP servers and registers their tools on ctx.tools",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/dsh-cc/dsh-cc.git",
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
],
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@deepseek-ai/dsh-credentials": ">=0.
|
|
29
|
-
"@deepseek-ai/dsh-invariants": ">=0.
|
|
30
|
-
"@deepseek-ai/dsh-llm": ">=0.
|
|
31
|
-
"@deepseek-ai/dsh-skill": ">=0.
|
|
32
|
-
"@deepseek-ai/dsh-subprocess": ">=0.
|
|
33
|
-
"@deepseek-ai/dsh-timeout": ">=0.
|
|
34
|
-
"@deepseek-ai/cordis": ">=0.
|
|
28
|
+
"@deepseek-ai/dsh-credentials": ">=0.2.0-rc.2",
|
|
29
|
+
"@deepseek-ai/dsh-invariants": ">=0.2.0-rc.2",
|
|
30
|
+
"@deepseek-ai/dsh-llm": ">=0.2.0-rc.2",
|
|
31
|
+
"@deepseek-ai/dsh-skill": ">=0.2.0-rc.2",
|
|
32
|
+
"@deepseek-ai/dsh-subprocess": ">=0.2.0-rc.2",
|
|
33
|
+
"@deepseek-ai/dsh-timeout": ">=0.2.0-rc.2",
|
|
34
|
+
"@deepseek-ai/cordis": ">=0.2.0-rc.2",
|
|
35
35
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
36
|
-
"@dsh-cc/tools": "^0.8.
|
|
36
|
+
"@dsh-cc/tools": "^0.8.3"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@deepseek-ai/schemastery": "link:../../../../deepseek-harness/vendor/schemastery",
|
|
54
54
|
"@deepseek-ai/cordis-plugin-loader": "link:../../../../deepseek-harness/vendor/loader",
|
|
55
55
|
"@deepseek-ai/dsh-system-prompt": "link:../../../../deepseek-harness/packages/core/system-prompt",
|
|
56
|
-
"@dsh-cc/tools": "^0.8.
|
|
57
|
-
"@dsh-cc/tool-search": "^0.8.
|
|
56
|
+
"@dsh-cc/tools": "^0.8.3",
|
|
57
|
+
"@dsh-cc/tool-search": "^0.8.3"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|