@modootoday/datalab-extension-mcp 1.2.5
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/LICENSE +21 -0
- package/README.en.md +273 -0
- package/README.md +249 -0
- package/dist/chunk-BF4AMIXC.js +31306 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +56 -0
- package/dist/dist-XA5GBOXU.js +1471 -0
- package/dist/index.d.ts +135 -0
- package/dist/index.js +13 -0
- package/package.json +49 -0
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
dispatchCli,
|
|
4
|
+
runAdapter,
|
|
5
|
+
runDaemon
|
|
6
|
+
} from "./chunk-BF4AMIXC.js";
|
|
7
|
+
import "./chunk-MLKGABMK.js";
|
|
8
|
+
|
|
9
|
+
// src/cli.ts
|
|
10
|
+
import { createRequire } from "module";
|
|
11
|
+
var NAME = "datalab-extension-mcp";
|
|
12
|
+
var VERSION = createRequire(import.meta.url)("../package.json").version;
|
|
13
|
+
function log(message) {
|
|
14
|
+
process.stderr.write(`[${NAME}] ${message}
|
|
15
|
+
`);
|
|
16
|
+
}
|
|
17
|
+
async function runInstaller(sub, argv) {
|
|
18
|
+
const { createNodeIo, runInstall, runUninstall } = await import("./dist-XA5GBOXU.js");
|
|
19
|
+
const opts = { version: VERSION };
|
|
20
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
21
|
+
const flag = argv[i];
|
|
22
|
+
if (flag === "--token") opts.token = argv[i += 1];
|
|
23
|
+
else if (flag === "--extension-id") opts.extensionId = argv[i += 1];
|
|
24
|
+
else if (flag === "--port") opts.port = argv[i += 1];
|
|
25
|
+
else if (flag === "--yes" || flag === "-y") opts.yes = true;
|
|
26
|
+
else if (flag === "--host") {
|
|
27
|
+
opts.hosts = opts.hosts ?? [];
|
|
28
|
+
const host = argv[i += 1];
|
|
29
|
+
if (host) opts.hosts.push(host);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const io = createNodeIo();
|
|
33
|
+
let code;
|
|
34
|
+
if (sub === "install") {
|
|
35
|
+
code = await runInstall(opts, io);
|
|
36
|
+
} else {
|
|
37
|
+
code = await runUninstall(opts, io);
|
|
38
|
+
}
|
|
39
|
+
process.exit(code);
|
|
40
|
+
}
|
|
41
|
+
async function main() {
|
|
42
|
+
await dispatchCli(process.argv, {
|
|
43
|
+
install: (sub, argv) => runInstaller(sub, argv),
|
|
44
|
+
// Run the inlined daemon in this process. `runDaemon` reads the pairing
|
|
45
|
+
// token and extension id from the environment and binds the loopback port;
|
|
46
|
+
// if another daemon already owns it, it exits 0 (success by proxy).
|
|
47
|
+
serve: () => {
|
|
48
|
+
runDaemon(process.env);
|
|
49
|
+
},
|
|
50
|
+
adapter: () => runAdapter({ name: NAME, version: VERSION })
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
main().catch((err) => {
|
|
54
|
+
log(err instanceof Error ? err.stack ?? err.message : String(err));
|
|
55
|
+
process.exit(1);
|
|
56
|
+
});
|