@botconnector/bccli 0.1.0-beta.4 → 0.3.0-beta.1
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.md +103 -0
- package/dist/args-EVIFNGPQ.js +11 -0
- package/dist/chunk-5C6NQFSI.js +50 -0
- package/dist/chunk-5XN44Q55.js +70 -0
- package/dist/chunk-E4BWUMQ2.js +52 -0
- package/dist/chunk-MANM7HY6.js +248 -0
- package/dist/chunk-RDQ7HPWS.js +82 -0
- package/dist/chunk-SJH3YLW4.js +92 -0
- package/dist/chunk-TBPPXOOZ.js +165 -0
- package/dist/chunk-TV6LEHOH.js +45 -0
- package/dist/chunk-XQLXE666.js +69 -0
- package/dist/chunk-Z5JM76EL.js +111 -0
- package/dist/cli.js +1246 -0
- package/dist/config-XPWPGNZJ.js +22 -0
- package/dist/login-IXJD5O7Z.js +9 -0
- package/dist/mcpCli-BV3IGR47.js +65 -0
- package/dist/providerCli-7QNAYIFT.js +11 -0
- package/dist/session-7UB77CEG.js +9 -0
- package/dist/ui-6PGC4T6N.js +833 -0
- package/package.json +33 -19
- package/bin/bccli.js +0 -173
- package/default-config/botconnector-cloud.jsonc +0 -21
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
addGlobalServer,
|
|
4
|
+
globalMcpPath,
|
|
5
|
+
projectMcpPath,
|
|
6
|
+
projectTrust,
|
|
7
|
+
readMcpFile,
|
|
8
|
+
removeGlobalServer,
|
|
9
|
+
serversToStart,
|
|
10
|
+
setProjectTrust
|
|
11
|
+
} from "./chunk-XQLXE666.js";
|
|
12
|
+
import "./chunk-Z5JM76EL.js";
|
|
13
|
+
export {
|
|
14
|
+
addGlobalServer,
|
|
15
|
+
globalMcpPath,
|
|
16
|
+
projectMcpPath,
|
|
17
|
+
projectTrust,
|
|
18
|
+
readMcpFile,
|
|
19
|
+
removeGlobalServer,
|
|
20
|
+
serversToStart,
|
|
21
|
+
setProjectTrust
|
|
22
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
CATALOG,
|
|
4
|
+
fillTemplate
|
|
5
|
+
} from "./chunk-TV6LEHOH.js";
|
|
6
|
+
import {
|
|
7
|
+
addGlobalServer,
|
|
8
|
+
globalMcpPath,
|
|
9
|
+
readMcpFile,
|
|
10
|
+
removeGlobalServer
|
|
11
|
+
} from "./chunk-XQLXE666.js";
|
|
12
|
+
import {
|
|
13
|
+
bccliHome
|
|
14
|
+
} from "./chunk-Z5JM76EL.js";
|
|
15
|
+
|
|
16
|
+
// src/mcpCli.ts
|
|
17
|
+
async function runMcpCommand(args, deps) {
|
|
18
|
+
const home = bccliHome(deps.env);
|
|
19
|
+
const [action = "list", name] = args.subArgs;
|
|
20
|
+
const installed = readMcpFile(globalMcpPath(home));
|
|
21
|
+
if (action === "list") {
|
|
22
|
+
for (const entry2 of CATALOG) deps.out(`${installed[entry2.name] ? "\u2713" : "\u25CB"} ${entry2.name.padEnd(12)} ${entry2.description}`);
|
|
23
|
+
for (const other of Object.keys(installed).filter((n) => !CATALOG.some((c) => c.name === n))) deps.out(`\u2713 ${other.padEnd(12)} (custom)`);
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
if (!name) {
|
|
27
|
+
deps.err(`Pemakaian: bccli mcp ${action} <nama>`);
|
|
28
|
+
return 1;
|
|
29
|
+
}
|
|
30
|
+
if (action === "remove") {
|
|
31
|
+
removeGlobalServer(home, name);
|
|
32
|
+
deps.out(`${name} dihapus.`);
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
if (action !== "add") {
|
|
36
|
+
deps.err(`Aksi tidak dikenal: ${action}. Pakai list, add, atau remove.`);
|
|
37
|
+
return 1;
|
|
38
|
+
}
|
|
39
|
+
if (args.url) {
|
|
40
|
+
addGlobalServer(home, name, { type: "http", url: args.url });
|
|
41
|
+
deps.out(`${name} terpasang (${args.url}).`);
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
const entry = CATALOG.find((c) => c.name === name);
|
|
45
|
+
if (!entry) {
|
|
46
|
+
deps.err(`${name} tidak ada di katalog. Untuk server remote lain pakai: bccli mcp add ${name} --url <url>`);
|
|
47
|
+
return 1;
|
|
48
|
+
}
|
|
49
|
+
const values = Object.fromEntries(args.values.map((v) => [v.slice(0, v.indexOf("=")), v.slice(v.indexOf("=") + 1)]));
|
|
50
|
+
for (const input of entry.inputs ?? []) {
|
|
51
|
+
if (!values[input.key] && input.secret) values[input.key] = await deps.readSecret(`${input.label}: `);
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
addGlobalServer(home, name, fillTemplate(entry.config, values));
|
|
55
|
+
} catch (error) {
|
|
56
|
+
const hint = (entry.inputs ?? []).filter((i) => !i.secret).map((i) => `--value ${i.key}=\u2026`).join(" ");
|
|
57
|
+
deps.err(`${error.message}${hint ? `. Contoh: bccli mcp add ${name} ${hint}` : ""}`);
|
|
58
|
+
return 1;
|
|
59
|
+
}
|
|
60
|
+
deps.out(`${name} terpasang. Aktif di sesi bccli berikutnya.`);
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
runMcpCommand
|
|
65
|
+
};
|