@modootoday/datalab-extension-mcp 1.4.1 → 1.4.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/README.en.md +4 -4
- package/README.md +4 -4
- package/dist/{chunk-DDJ2JWP5.js → chunk-CBHNMIS3.js} +529 -322
- package/dist/cli.js +5 -5
- package/dist/{dist-Y7SH44SY.js → dist-WMNHKGZR.js} +34 -42
- package/dist/index.d.ts +28 -50
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
dispatchCli,
|
|
4
4
|
runAdapter,
|
|
5
5
|
runDaemon
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CBHNMIS3.js";
|
|
7
7
|
import "./chunk-MLKGABMK.js";
|
|
8
8
|
|
|
9
9
|
// src/cli.ts
|
|
@@ -15,7 +15,7 @@ function log(message) {
|
|
|
15
15
|
`);
|
|
16
16
|
}
|
|
17
17
|
async function runInstaller(sub, argv) {
|
|
18
|
-
const { createNodeIo, runInstall, runUninstall } = await import("./dist-
|
|
18
|
+
const { createNodeIo, runInstall, runUninstall } = await import("./dist-WMNHKGZR.js");
|
|
19
19
|
const opts = { version: VERSION };
|
|
20
20
|
for (let i = 0; i < argv.length; i += 1) {
|
|
21
21
|
const flag = argv[i];
|
|
@@ -41,9 +41,9 @@ async function runInstaller(sub, argv) {
|
|
|
41
41
|
async function main() {
|
|
42
42
|
await dispatchCli(process.argv, {
|
|
43
43
|
install: (sub, argv) => runInstaller(sub, argv),
|
|
44
|
-
// Run the inlined daemon in this process.
|
|
45
|
-
//
|
|
46
|
-
//
|
|
44
|
+
// Run the inlined daemon in this process. It reads the pairing token and
|
|
45
|
+
// extension id from the environment and binds the loopback port; if another
|
|
46
|
+
// daemon already owns it, it exits 0 — the daemon wanted already exists.
|
|
47
47
|
serve: () => {
|
|
48
48
|
runDaemon(process.env);
|
|
49
49
|
},
|
|
@@ -87,9 +87,9 @@ var CLI_HOSTS = [
|
|
|
87
87
|
tier: 1,
|
|
88
88
|
displayName: "Claude Code",
|
|
89
89
|
bin: "claude",
|
|
90
|
-
//
|
|
91
|
-
// whatever directory the
|
|
92
|
-
//
|
|
90
|
+
// 🔴 User scope is mandatory: the default local scope binds the server to
|
|
91
|
+
// whatever directory the command was pasted in, which reads as success and
|
|
92
|
+
// then does nothing everywhere else.
|
|
93
93
|
buildAddArgs(opts) {
|
|
94
94
|
const args = ["mcp", "add", SERVER_NAME, "--scope", "user"];
|
|
95
95
|
for (const pair of envPairs(opts)) {
|
|
@@ -107,8 +107,8 @@ var CLI_HOSTS = [
|
|
|
107
107
|
tier: 1,
|
|
108
108
|
displayName: "ChatGPT \uB370\uC2A4\uD06C\uD1B1 / Codex",
|
|
109
109
|
bin: "codex",
|
|
110
|
-
// The
|
|
111
|
-
//
|
|
110
|
+
// The CLI and the desktop app share one config, so a single registration
|
|
111
|
+
// covers both — worth saying out loud in the output.
|
|
112
112
|
note: CODEX_CHATGPT_NOTE,
|
|
113
113
|
buildAddArgs(opts) {
|
|
114
114
|
const args = ["mcp", "add", SERVER_NAME];
|
|
@@ -127,7 +127,7 @@ var CLI_HOSTS = [
|
|
|
127
127
|
tier: 1,
|
|
128
128
|
displayName: "Gemini CLI",
|
|
129
129
|
bin: "gemini",
|
|
130
|
-
//
|
|
130
|
+
// User scope, for the same cwd-binding reason as the entry above.
|
|
131
131
|
buildAddArgs(opts) {
|
|
132
132
|
const args = ["mcp", "add", "-s", "user"];
|
|
133
133
|
for (const pair of envPairs(opts)) {
|
|
@@ -224,7 +224,8 @@ var FILE_HOSTS = [
|
|
|
224
224
|
displayName: "Claude Desktop",
|
|
225
225
|
configKey: "mcpServers",
|
|
226
226
|
entryKind: "stdio",
|
|
227
|
-
// 🔴
|
|
227
|
+
// 🔴 Linux has no documented path, so a snippet host covers it; guessing
|
|
228
|
+
// one here would manufacture a false success.
|
|
228
229
|
configPath(io) {
|
|
229
230
|
return resolveHostPath(io, {
|
|
230
231
|
kind: "appData",
|
|
@@ -233,10 +234,9 @@ var FILE_HOSTS = [
|
|
|
233
234
|
});
|
|
234
235
|
},
|
|
235
236
|
/**
|
|
236
|
-
* 🔴 Store
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
* 택한다. 없으면 null 을 돌려 기존 `%APPDATA%` 경로로 되돌아간다.
|
|
237
|
+
* 🔴 A Store install writes inside its package container instead. The two
|
|
238
|
+
* install kinds use entirely different locations and the app does not say
|
|
239
|
+
* which it is, so an existing container wins and its absence falls back.
|
|
240
240
|
*/
|
|
241
241
|
async resolveConfigPath(io) {
|
|
242
242
|
const dir = await msixRoamingDir(io, "Claude_", "Claude");
|
|
@@ -251,8 +251,8 @@ var FILE_HOSTS = [
|
|
|
251
251
|
tier: 2,
|
|
252
252
|
displayName: "Cursor",
|
|
253
253
|
configKey: "mcpServers",
|
|
254
|
-
//
|
|
255
|
-
//
|
|
254
|
+
// Speaks local HTTP MCP, so it connects to the daemon directly and no
|
|
255
|
+
// adapter process is spawned for it.
|
|
256
256
|
entryKind: "url",
|
|
257
257
|
configPath(io) {
|
|
258
258
|
return resolveHostPath(io, {
|
|
@@ -262,10 +262,9 @@ var FILE_HOSTS = [
|
|
|
262
262
|
}
|
|
263
263
|
},
|
|
264
264
|
{
|
|
265
|
-
//
|
|
266
|
-
//
|
|
267
|
-
//
|
|
268
|
-
// install turns out to carry comments, so the promotion cannot corrupt.
|
|
265
|
+
// Documented strict JSON, so a single-key merge is safe. The hygiene floor
|
|
266
|
+
// still refuses and falls back to a snippet if an install turns out to
|
|
267
|
+
// carry comments.
|
|
269
268
|
id: "windsurf",
|
|
270
269
|
tier: 2,
|
|
271
270
|
displayName: "Windsurf",
|
|
@@ -282,10 +281,8 @@ var FILE_HOSTS = [
|
|
|
282
281
|
}
|
|
283
282
|
},
|
|
284
283
|
{
|
|
285
|
-
//
|
|
286
|
-
//
|
|
287
|
-
// 그 아래다. override 를 무시하면 사용자가 옮겨 둔 설정 대신 엉뚱한 곳에 써서
|
|
288
|
-
// "성공했다는데 안 보인다" 가 된다.
|
|
284
|
+
// 🔴 A home override env var wins when set. Ignoring it would write beside
|
|
285
|
+
// the config the user moved, reporting success the app never sees.
|
|
289
286
|
id: "copilot-cli",
|
|
290
287
|
tier: 2,
|
|
291
288
|
displayName: "GitHub Copilot CLI",
|
|
@@ -303,8 +300,7 @@ var FILE_HOSTS = [
|
|
|
303
300
|
}
|
|
304
301
|
},
|
|
305
302
|
{
|
|
306
|
-
//
|
|
307
|
-
// every OS.
|
|
303
|
+
// Documented strict-JSON user config, home-relative on every OS.
|
|
308
304
|
id: "junie",
|
|
309
305
|
tier: 2,
|
|
310
306
|
displayName: "JetBrains Junie",
|
|
@@ -318,7 +314,7 @@ var FILE_HOSTS = [
|
|
|
318
314
|
}
|
|
319
315
|
},
|
|
320
316
|
{
|
|
321
|
-
//
|
|
317
|
+
// Documented strict-JSON user settings, home-relative on every OS.
|
|
322
318
|
id: "kiro",
|
|
323
319
|
tier: 2,
|
|
324
320
|
displayName: "Kiro",
|
|
@@ -382,7 +378,6 @@ function zedConfigPath(io) {
|
|
|
382
378
|
return resolveHostPath(io, {
|
|
383
379
|
kind: "xdg",
|
|
384
380
|
segments: ["zed", "settings.json"],
|
|
385
|
-
// Zed 문서: Windows 만 `%APPDATA%\Zed` (대문자), 그 외는 `~/.config/zed`.
|
|
386
381
|
win32Segments: ["Zed", "settings.json"]
|
|
387
382
|
});
|
|
388
383
|
}
|
|
@@ -469,8 +464,8 @@ var SNIPPET_HOSTS = [
|
|
|
469
464
|
},
|
|
470
465
|
reason: "\uC8FC\uC11D\uC774 \uC788\uB294 \uC124\uC815 \uD30C\uC77C\uC774\uB77C \uC790\uB3D9 \uC218\uC815\uD558\uC9C0 \uC54A\uC544\uC694.",
|
|
471
466
|
pasteWhere: '\uC544\uB798 \uB0B4\uC6A9\uC744 \uC124\uC815 \uD30C\uC77C\uC758 "servers" \uD56D\uBAA9\uC5D0 \uC9C1\uC811 \uBD99\uC5EC\uB123\uC5B4 \uC8FC\uC138\uC694.',
|
|
472
|
-
// 🔴
|
|
473
|
-
//
|
|
467
|
+
// 🔴 The hint names the profile too: a non-default profile keeps its own
|
|
468
|
+
// config elsewhere, so pasting into the path above would not reach it.
|
|
474
469
|
createHint: "\uD30C\uC77C\uC774 \uC5C6\uC73C\uBA74 VS Code \uC5D0\uC11C \uBA85\uB839 \uD314\uB808\uD2B8(Ctrl+Shift+P) \u2192 'MCP: Open User Configuration' \uC744 \uC2E4\uD589\uD558\uBA74 \uB9CC\uB4E4\uC5B4\uC838\uC694. \uAE30\uBCF8 \uD504\uB85C\uD544\uC774 \uC544\uB2C8\uBA74 \uADF8 \uD504\uB85C\uD544\uC758 mcp.json \uC774 User/profiles \uC544\uB798\uC5D0 \uB530\uB85C \uC788\uC73C\uB2C8, \uADF8 \uBA85\uB839\uC73C\uB85C \uC5F4\uB9B0 \uD30C\uC77C\uC5D0 \uBD99\uC5EC\uB123\uC5B4 \uC8FC\uC138\uC694.",
|
|
475
470
|
bootstrapWhenAbsent: true,
|
|
476
471
|
buildSnippet(opts, platform) {
|
|
@@ -489,9 +484,9 @@ var SNIPPET_HOSTS = [
|
|
|
489
484
|
},
|
|
490
485
|
reason: "\uB3C4\uAD6C \uC804\uCCB4 \uC124\uC815 \uD30C\uC77C\uC774\uB77C \uC790\uB3D9 \uC218\uC815\uD558\uC9C0 \uC54A\uC544\uC694.",
|
|
491
486
|
pasteWhere: '\uC544\uB798 \uB0B4\uC6A9\uC744 \uC124\uC815 \uD30C\uC77C\uC758 "mcp" \uD56D\uBAA9\uC5D0 \uC9C1\uC811 \uBD99\uC5EC\uB123\uC5B4 \uC8FC\uC138\uC694.',
|
|
492
|
-
// 🔴
|
|
493
|
-
//
|
|
494
|
-
//
|
|
487
|
+
// 🔴 Never created for this host: the file is the tool's whole config and a
|
|
488
|
+
// sibling dialect may already hold it, so creating ours would leave two
|
|
489
|
+
// config files with no way for the user to know which wins.
|
|
495
490
|
createHint: "\uC124\uC815 \uD30C\uC77C\uC740 opencode.json \uB610\uB294 opencode.jsonc \uC608\uC694. \uC4F0\uACE0 \uC788\uB294 \uCABD\uC5D0 \uBD99\uC5EC\uB123\uC5B4 \uC8FC\uC138\uC694.",
|
|
496
491
|
buildSnippet(opts) {
|
|
497
492
|
return opencodeSnippet(opts);
|
|
@@ -518,10 +513,8 @@ var SNIPPET_HOSTS = [
|
|
|
518
513
|
}
|
|
519
514
|
},
|
|
520
515
|
{
|
|
521
|
-
//
|
|
522
|
-
//
|
|
523
|
-
// 벤더 문서는 "확장이 쓰는 설정 파일" 이라고만 하고 경로를 주지 않는다. 확인되지
|
|
524
|
-
// 않은 경로를 안내하면 붙여넣어도 아무 일이 없고, 사용자는 우리 안내를 의심한다.
|
|
516
|
+
// 🔴 One documented path only. An unverified path from a third-party table
|
|
517
|
+
// would have the user paste into a file nothing reads.
|
|
525
518
|
id: "cline",
|
|
526
519
|
tier: 3,
|
|
527
520
|
displayName: "Cline",
|
|
@@ -538,9 +531,9 @@ var SNIPPET_HOSTS = [
|
|
|
538
531
|
}
|
|
539
532
|
},
|
|
540
533
|
{
|
|
541
|
-
//
|
|
542
|
-
//
|
|
543
|
-
//
|
|
534
|
+
// Same entry shape, but the exact path is only medium-confidence, so it
|
|
535
|
+
// stays a snippet: a wrong detection costs a missing card, while a wrong
|
|
536
|
+
// auto-write would be a false success.
|
|
544
537
|
id: "lmstudio",
|
|
545
538
|
tier: 3,
|
|
546
539
|
displayName: "LM Studio",
|
|
@@ -557,8 +550,7 @@ var SNIPPET_HOSTS = [
|
|
|
557
550
|
}
|
|
558
551
|
},
|
|
559
552
|
{
|
|
560
|
-
//
|
|
561
|
-
// (medium-confidence path → snippet, not auto-write).
|
|
553
|
+
// Same entry shape, medium-confidence path — snippet, not auto-write.
|
|
562
554
|
id: "warp",
|
|
563
555
|
tier: 3,
|
|
564
556
|
displayName: "Warp",
|
|
@@ -587,8 +579,8 @@ var SNIPPET_HOSTS = [
|
|
|
587
579
|
detectedPath(io) {
|
|
588
580
|
return joinPath(io, io.homedir(), ".config", "Claude");
|
|
589
581
|
},
|
|
590
|
-
// Guessing a path here would manufacture false
|
|
591
|
-
//
|
|
582
|
+
// 🔴 Guessing a path here would manufacture a false success that only
|
|
583
|
+
// surfaces after a restart.
|
|
592
584
|
reason: "\uB9AC\uB205\uC2A4\uC6A9 \uACF5\uC2DD \uC124\uC815 \uD30C\uC77C \uACBD\uB85C\uAC00 \uD655\uC778\uB418\uC9C0 \uC54A\uC544 \uC790\uB3D9 \uC218\uC815\uD558\uC9C0 \uC54A\uC544\uC694.",
|
|
593
585
|
pasteWhere: "Claude Desktop \uACF5\uC2DD \uBB38\uC11C\uAC00 \uC548\uB0B4\uD558\uB294 \uC124\uC815 \uD30C\uC77C(claude_desktop_config.json)\uC5D0 \uC544\uB798 \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uBD99\uC5EC\uB123\uC5B4 \uC8FC\uC138\uC694.",
|
|
594
586
|
buildSnippet(opts, platform) {
|
|
@@ -613,7 +605,7 @@ var SNIPPET_HOSTS = [
|
|
|
613
605
|
},
|
|
614
606
|
reason: "Codex \uBA85\uB839\uC5B4(CLI)\uAC00 \uC124\uCE58\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC544 TOML \uC124\uC815 \uD30C\uC77C\uC744 \uC790\uB3D9 \uC218\uC815\uD558\uC9C0 \uC54A\uC544\uC694.",
|
|
615
607
|
pasteWhere: "\uC544\uB798 \uB0B4\uC6A9\uC744 \uC704 \uC124\uC815 \uD30C\uC77C\uC5D0 \uC9C1\uC811 \uBD99\uC5EC\uB123\uC5B4 \uC8FC\uC138\uC694.",
|
|
616
|
-
//
|
|
608
|
+
// The desktop app, the CLI, and the IDE extension share this one file.
|
|
617
609
|
createHint: "\uD30C\uC77C\uC774 \uC5C6\uC73C\uBA74 ChatGPT \uB370\uC2A4\uD06C\uD1B1\uC5D0\uC11C \uC124\uC815 \u2192 MCP \uC11C\uBC84 \u2192 \uC11C\uBC84 \uCD94\uAC00\uB97C \uD55C \uBC88 \uD558\uBA74 \uB9CC\uB4E4\uC5B4\uC838\uC694. \uD3F4\uB354\uAC00 \uC5C6\uC73C\uBA74 \uC9C1\uC811 \uB9CC\uB4E4\uC5B4\uB3C4 \uB3FC\uC694.",
|
|
618
610
|
bootstrapWhenAbsent: true,
|
|
619
611
|
buildSnippet(opts) {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,19 +2,13 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
|
2
2
|
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* The thin stdio adapter — a stdio
|
|
5
|
+
* The thin stdio adapter — a stdio-to-daemon proxy that owns nothing.
|
|
6
6
|
*
|
|
7
|
-
* An MCP host spawns this bin; it speaks MCP over stdio
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* one-server-per-host model was replaced — every host raced for the same port
|
|
13
|
-
* and only one survived.
|
|
14
|
-
*
|
|
15
|
-
* Everything with an edge (the readiness probe, the child spawn, the HTTP
|
|
16
|
-
* fetch) is injectable, so the whole proxy is unit-testable with neither a real
|
|
17
|
-
* socket nor a real daemon.
|
|
7
|
+
* An MCP host spawns this bin; it speaks MCP over stdio and forwards its two
|
|
8
|
+
* methods to the background daemon over loopback HTTP. It binds no port and
|
|
9
|
+
* holds no bridge, so many adapters (one per host) share one daemon. Every
|
|
10
|
+
* edge — readiness probe, child spawn, HTTP fetch — is injectable, which is
|
|
11
|
+
* what makes the proxy testable without a real socket or daemon.
|
|
18
12
|
*/
|
|
19
13
|
|
|
20
14
|
/** The `fetch` shape this module needs — injectable so tests need no real HTTP. */
|
|
@@ -39,18 +33,17 @@ interface EnsureRunningDeps {
|
|
|
39
33
|
/** Injected sleep so the ready-poll never waits real milliseconds in tests. */
|
|
40
34
|
sleep?: (ms: number) => Promise<void>;
|
|
41
35
|
/**
|
|
42
|
-
* Absolute path the spawner runs. Defaults to this bin
|
|
43
|
-
*
|
|
36
|
+
* Absolute path the spawner runs. Defaults to this bin, which starts the
|
|
37
|
+
* inlined daemon when run with the serve subcommand.
|
|
44
38
|
*/
|
|
45
39
|
daemonEntry?: string;
|
|
46
40
|
log?: (message: string) => void;
|
|
47
41
|
attempts?: number;
|
|
48
42
|
intervalMs?: number;
|
|
49
43
|
/**
|
|
50
|
-
* This adapter's own version. When set, a running daemon
|
|
51
|
-
* replaced
|
|
52
|
-
*
|
|
53
|
-
* a newer daemon. Unset ⇒ no reconciliation (the daemon is used as-is).
|
|
44
|
+
* This adapter's own version. When set, a running daemon older than this is
|
|
45
|
+
* replaced; one at this version or newer is left alone, so an older adapter
|
|
46
|
+
* never downgrades a newer daemon. Unset means no reconciliation at all.
|
|
54
47
|
*/
|
|
55
48
|
selfVersion?: string;
|
|
56
49
|
/** Pairing token authorising the shutdown. Defaults to `DATALAB_MCP_TOKEN`. */
|
|
@@ -61,17 +54,12 @@ interface EnsureRunningDeps {
|
|
|
61
54
|
shutdown?: (base: string, token: string) => Promise<boolean>;
|
|
62
55
|
}
|
|
63
56
|
/**
|
|
64
|
-
* Ensure a daemon is up before the adapter starts proxying.
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* needed to know it exists, so the probe socket is closed immediately and the
|
|
68
|
-
* real calls go over HTTP. Otherwise spawn THIS bin as `serve` (which runs the
|
|
69
|
-
* inlined daemon) and poll until it answers. Racing is fine: whichever daemon
|
|
70
|
-
* binds first wins and the losers exit 0 on EADDRINUSE.
|
|
57
|
+
* Ensure a daemon is up before the adapter starts proxying. A daemon already
|
|
58
|
+
* on the port ends it; otherwise spawn this bin as serve and poll. Racing is
|
|
59
|
+
* fine — whichever binds first wins and the losers exit 0 on EADDRINUSE.
|
|
71
60
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* than crashing the host's whole MCP session over a daemon that is slow to boot.
|
|
61
|
+
* Exceeding the budget logs and returns rather than throws: showing
|
|
62
|
+
* disconnected beats crashing the host's whole MCP session over a slow boot.
|
|
75
63
|
*/
|
|
76
64
|
declare function ensureDaemonRunning(deps?: EnsureRunningDeps): Promise<void>;
|
|
77
65
|
interface AdapterServerDeps {
|
|
@@ -85,20 +73,15 @@ interface AdapterServerDeps {
|
|
|
85
73
|
version?: string;
|
|
86
74
|
}
|
|
87
75
|
/**
|
|
88
|
-
* Build the low-level MCP
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* and declare no static schema — the catalog is discovered at runtime from the
|
|
92
|
-
* daemon and changes while running. The request-handler form matches that, and
|
|
93
|
-
* it is the same shape the daemon it replaced used, so the host sees no
|
|
94
|
-
* difference across the swap.
|
|
76
|
+
* Build the low-level MCP Server whose two handlers proxy to the daemon. The
|
|
77
|
+
* low-level form fits because we own no tools and declare no static schema —
|
|
78
|
+
* the catalog is discovered from the daemon and changes while running.
|
|
95
79
|
*/
|
|
96
80
|
declare function createAdapterServer(deps?: AdapterServerDeps): Server;
|
|
97
81
|
/**
|
|
98
|
-
* Read the daemon's
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* skipped here and never reach `onEvent`.
|
|
82
|
+
* Read the daemon's notification stream, invoking the callback with each data
|
|
83
|
+
* payload. Injectable so the subscription loop is testable without a real
|
|
84
|
+
* stream. Heartbeat comment lines are not data and never reach the callback.
|
|
102
85
|
*/
|
|
103
86
|
type SubscribeImpl = (url: string, onEvent: (data: string) => void, signal: AbortSignal) => Promise<void>;
|
|
104
87
|
interface RunAdapterDeps extends AdapterServerDeps {
|
|
@@ -110,12 +93,9 @@ interface RunAdapterDeps extends AdapterServerDeps {
|
|
|
110
93
|
subscribe?: SubscribeImpl;
|
|
111
94
|
}
|
|
112
95
|
/**
|
|
113
|
-
* Run the adapter: make sure a daemon exists, then serve MCP over stdio.
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* socket/spawn edges and `createAdapterServer` with the request handlers — so
|
|
117
|
-
* each is testable alone. This function is the only place that touches the real
|
|
118
|
-
* stdio transport, which is why it stays a thin composition.
|
|
96
|
+
* Run the adapter: make sure a daemon exists, then serve MCP over stdio. The
|
|
97
|
+
* two legs stay separate so each is testable alone, and this is the only place
|
|
98
|
+
* that touches the real stdio transport.
|
|
119
99
|
*/
|
|
120
100
|
declare function runAdapter(deps?: RunAdapterDeps): Promise<void>;
|
|
121
101
|
interface CliHandlers {
|
|
@@ -124,11 +104,9 @@ interface CliHandlers {
|
|
|
124
104
|
adapter: () => Promise<void>;
|
|
125
105
|
}
|
|
126
106
|
/**
|
|
127
|
-
* Route
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* handlers, without spawning a daemon or connecting a transport. The default
|
|
131
|
-
* (no recognised subcommand) is the adapter, which is what an MCP host spawns.
|
|
107
|
+
* Route argv to one of the three subcommand handlers. Kept out of the entry so
|
|
108
|
+
* the routing is testable with injected handlers. The default, with no
|
|
109
|
+
* recognised subcommand, is the adapter — what an MCP host spawns.
|
|
132
110
|
*/
|
|
133
111
|
declare function dispatchCli(argv: readonly string[], handlers: CliHandlers): Promise<void>;
|
|
134
112
|
|
package/dist/index.js
CHANGED