@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.
@@ -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,9 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ readSecret,
4
+ runLogin
5
+ } from "./chunk-E4BWUMQ2.js";
6
+ export {
7
+ readSecret,
8
+ runLogin
9
+ };
@@ -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
+ };
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ addProviderKey,
4
+ runProviderCommand
5
+ } from "./chunk-MANM7HY6.js";
6
+ import "./chunk-5C6NQFSI.js";
7
+ import "./chunk-Z5JM76EL.js";
8
+ export {
9
+ addProviderKey,
10
+ runProviderCommand
11
+ };
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ Session,
4
+ pruneSessions
5
+ } from "./chunk-SJH3YLW4.js";
6
+ export {
7
+ Session,
8
+ pruneSessions
9
+ };