@botconnector/bccli 0.4.0-beta.4 → 0.4.0-beta.41

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.
Files changed (46) hide show
  1. package/README.md +80 -1
  2. package/dist/acp-SZWZ5EE4.js +114 -0
  3. package/dist/args-4SMOHFN5.js +13 -0
  4. package/dist/chunk-3HCOAJEQ.js +190 -0
  5. package/dist/chunk-AS7VV7D3.js +195 -0
  6. package/dist/{chunk-NGLKANMD.js → chunk-AVB6M4JE.js} +24 -2
  7. package/dist/chunk-BUHWQU3V.js +231 -0
  8. package/dist/chunk-DBHDZ5EP.js +723 -0
  9. package/dist/{chunk-GW36UMHZ.js → chunk-DSFHN5CH.js} +2 -2
  10. package/dist/chunk-EQQTTE2K.js +8 -0
  11. package/dist/{chunk-ELML4KVQ.js → chunk-GAFJEQTJ.js} +32 -2
  12. package/dist/chunk-GGNXHJL6.js +884 -0
  13. package/dist/chunk-HE33XAPZ.js +341 -0
  14. package/dist/{chunk-UESQNU4A.js → chunk-ISCT3PN3.js} +14 -9
  15. package/dist/chunk-JROUQ5YS.js +76 -0
  16. package/dist/chunk-LN32JIZR.js +56 -0
  17. package/dist/chunk-M23QBX3V.js +419 -0
  18. package/dist/chunk-M4IYXI3V.js +2125 -0
  19. package/dist/chunk-M7LLJQ7M.js +310 -0
  20. package/dist/chunk-NI5JZUZ3.js +63 -0
  21. package/dist/chunk-PSO7R5AD.js +10 -0
  22. package/dist/{chunk-U7DLMVPZ.js → chunk-SESBH44L.js} +2 -1
  23. package/dist/{chunk-SJH3YLW4.js → chunk-VM7HYAJS.js} +4 -1
  24. package/dist/cli.js +94 -1278
  25. package/dist/{config-NPSYFAFD.js → config-C4KLLDC6.js} +5 -2
  26. package/dist/integrationCli-HR7CDUSI.js +685 -0
  27. package/dist/{login-F4G5QXOU.js → login-T5S6SPZA.js} +1 -1
  28. package/dist/{mcpCli-Q2H63ISP.js → mcpCli-5QTXH7XJ.js} +42 -9
  29. package/dist/modelsCli-DKTT3UZD.js +36 -0
  30. package/dist/providerCli-DDH4ZZUY.js +15 -0
  31. package/dist/sdk.js +5179 -0
  32. package/dist/serve-I2VQUTHR.js +178 -0
  33. package/dist/serve-KQ35P4W3.js +514 -0
  34. package/dist/session-H2YL5RSB.js +12 -0
  35. package/dist/setup-45WQXUBK.js +23 -0
  36. package/dist/ui-S4QFJJIB.js +2280 -0
  37. package/dist/update-VBDEHHMR.js +109 -0
  38. package/package.json +24 -3
  39. package/dist/args-FCLPQ7TO.js +0 -11
  40. package/dist/chunk-C5AFWX7H.js +0 -328
  41. package/dist/chunk-OSWQPSA4.js +0 -252
  42. package/dist/chunk-RZUJYAQV.js +0 -112
  43. package/dist/chunk-UN7QXPCB.js +0 -82
  44. package/dist/providerCli-MXV6PD6F.js +0 -11
  45. package/dist/session-7UB77CEG.js +0 -9
  46. package/dist/ui-7FXPXXGN.js +0 -1333
@@ -2,21 +2,32 @@
2
2
  import {
3
3
  CATALOG,
4
4
  fillTemplate
5
- } from "./chunk-UESQNU4A.js";
5
+ } from "./chunk-ISCT3PN3.js";
6
+ import {
7
+ authorizeMcpServer,
8
+ clearTokens
9
+ } from "./chunk-3HCOAJEQ.js";
6
10
  import {
7
11
  addGlobalServer,
8
12
  globalMcpPath,
9
13
  readMcpFile,
10
14
  removeGlobalServer
11
- } from "./chunk-NGLKANMD.js";
15
+ } from "./chunk-AVB6M4JE.js";
12
16
  import {
13
17
  bccliHome
14
- } from "./chunk-RZUJYAQV.js";
18
+ } from "./chunk-M7LLJQ7M.js";
19
+ import {
20
+ t
21
+ } from "./chunk-M23QBX3V.js";
15
22
 
16
23
  // src/mcpCli.ts
17
24
  async function runMcpCommand(args, deps) {
18
25
  const home = bccliHome(deps.env);
19
26
  const [action = "list", name] = args.subArgs;
27
+ if (action === "serve") {
28
+ const { runMcpServe } = await import("./serve-I2VQUTHR.js");
29
+ return runMcpServe(args, deps);
30
+ }
20
31
  const installed = readMcpFile(globalMcpPath(home));
21
32
  if (action === "list") {
22
33
  for (const entry2 of CATALOG) deps.out(`${installed[entry2.name] ? "\u2713" : "\u25CB"} ${entry2.name.padEnd(12)} ${entry2.description}`);
@@ -24,26 +35,48 @@ async function runMcpCommand(args, deps) {
24
35
  return 0;
25
36
  }
26
37
  if (!name) {
27
- deps.err(`Pemakaian: bccli mcp ${action} <nama>`);
38
+ deps.err(t("Usage: bccli mcp {action} <name>", { action }));
28
39
  return 1;
29
40
  }
30
41
  if (action === "remove") {
31
42
  removeGlobalServer(home, name);
32
- deps.out(`${name} dihapus.`);
43
+ deps.out(t("{name} removed.", { name }));
33
44
  return 0;
34
45
  }
46
+ if (action === "auth" || action === "logout") {
47
+ const config = installed[name];
48
+ if (config?.type !== "http") {
49
+ deps.err(
50
+ t("{name} is not an installed HTTP MCP server. Add it first with: bccli mcp add {name} --url <url>", { name })
51
+ );
52
+ return 1;
53
+ }
54
+ if (action === "logout") {
55
+ const removed = clearTokens(home, config.url);
56
+ deps.out(removed ? t("{name} logged out.", { name }) : t("{name} has no stored OAuth tokens.", { name }));
57
+ return 0;
58
+ }
59
+ try {
60
+ await authorizeMcpServer({ name, config }, { home });
61
+ deps.out(t("{name} authorized. Active in the next bccli session.", { name }));
62
+ return 0;
63
+ } catch (error) {
64
+ deps.err(t("OAuth login failed for {name}: {reason}", { name, reason: error.message }));
65
+ return 1;
66
+ }
67
+ }
35
68
  if (action !== "add") {
36
- deps.err(`Aksi tidak dikenal: ${action}. Pakai list, add, atau remove.`);
69
+ deps.err(t("Unknown action: {action}. Use list, add, remove, auth, logout, or serve.", { action }));
37
70
  return 1;
38
71
  }
39
72
  if (args.url) {
40
73
  addGlobalServer(home, name, { type: "http", url: args.url });
41
- deps.out(`${name} terpasang (${args.url}).`);
74
+ deps.out(t("{name} installed ({url}).", { name, url: args.url }));
42
75
  return 0;
43
76
  }
44
77
  const entry = CATALOG.find((c) => c.name === name);
45
78
  if (!entry) {
46
- deps.err(`${name} tidak ada di katalog. Untuk server remote lain pakai: bccli mcp add ${name} --url <url>`);
79
+ deps.err(t("{name} is not in the catalog. For another remote server use: bccli mcp add {name} --url <url>", { name }));
47
80
  return 1;
48
81
  }
49
82
  const values = Object.fromEntries(args.values.map((v) => [v.slice(0, v.indexOf("=")), v.slice(v.indexOf("=") + 1)]));
@@ -57,7 +90,7 @@ async function runMcpCommand(args, deps) {
57
90
  deps.err(`${error.message}${hint ? `. Contoh: bccli mcp add ${name} ${hint}` : ""}`);
58
91
  return 1;
59
92
  }
60
- deps.out(`${name} terpasang. Aktif di sesi bccli berikutnya.`);
93
+ deps.out(t("{name} installed. Active in the next bccli session.", { name }));
61
94
  return 0;
62
95
  }
63
96
  export {
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ listAllModels
4
+ } from "./chunk-LN32JIZR.js";
5
+ import "./chunk-SESBH44L.js";
6
+ import "./chunk-GGNXHJL6.js";
7
+ import "./chunk-NI5JZUZ3.js";
8
+ import {
9
+ loadConfig,
10
+ resolveModel
11
+ } from "./chunk-M7LLJQ7M.js";
12
+ import {
13
+ t
14
+ } from "./chunk-M23QBX3V.js";
15
+
16
+ // src/modelsCli.ts
17
+ async function runModelsCommand(args, deps) {
18
+ const config = loadConfig(deps.cwd, deps.env);
19
+ const arg = (args.subArgs[0] ?? "").trim();
20
+ const providerId = arg ? arg.split("/")[0] : resolveModel(config, args.model ?? config.model, deps.env).providerId;
21
+ if (!Object.hasOwn(config.providers, providerId)) {
22
+ deps.err(t('Provider "{id}" is not in the config. Available: {list}', { id: providerId, list: Object.keys(config.providers).join(", ") }));
23
+ return 1;
24
+ }
25
+ const groups = await listAllModels(config, deps.env, { fetch: deps.fetch, only: providerId });
26
+ const group = groups.find((g) => g.providerId === providerId);
27
+ if (!group || group.error) {
28
+ deps.err(`${providerId}: ${group?.error ?? t("could not be reached")}`);
29
+ return 1;
30
+ }
31
+ deps.out(group.models.map((m) => `${providerId}/${m}`).join("\n"));
32
+ return 0;
33
+ }
34
+ export {
35
+ runModelsCommand
36
+ };
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ addProviderKey,
4
+ runProviderCommand
5
+ } from "./chunk-JROUQ5YS.js";
6
+ import "./chunk-LN32JIZR.js";
7
+ import "./chunk-SESBH44L.js";
8
+ import "./chunk-GGNXHJL6.js";
9
+ import "./chunk-NI5JZUZ3.js";
10
+ import "./chunk-M7LLJQ7M.js";
11
+ import "./chunk-M23QBX3V.js";
12
+ export {
13
+ addProviderKey,
14
+ runProviderCommand
15
+ };