@botconnector/bccli 0.4.0-beta.2 → 0.4.0-beta.21

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,103 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ MODE_ORDER
4
+ } from "./chunk-ELML4KVQ.js";
5
+ import {
6
+ REASONING_LEVELS,
7
+ isReasoningLevel
8
+ } from "./chunk-SN3ODJZN.js";
9
+ import {
10
+ ConfigError,
11
+ parseLang,
12
+ t
13
+ } from "./chunk-EO7IVVX4.js";
14
+
15
+ // src/args.ts
16
+ import { parseArgs } from "util";
17
+ var HELP = `BCCLI \u2014 BotConnector's AI coding agent for the terminal
18
+
19
+ Usage:
20
+ bccli [task] interactive mode (optionally start with a task)
21
+ bccli -p "task" run one task without interaction (scripts/CI)
22
+ bccli login [provider] save an API key (default: bc-cloud)
23
+ bccli models list models from the active provider
24
+ bccli provider list|add <id>|remove <id> manage providers (custom: --url <url> [--name N] [--key-env ENV])
25
+ bccli mcp list|add <name>|remove <name> manage MCP servers (catalog, or --url <url>)
26
+ bccli integrations show the status of external agent integrations
27
+ bccli connect <agent> opencode, aider, cline, dsh, codex, claude-code, cursor, openai-cli, openai-sdk, openai-compatible
28
+ bccli disconnect <agent> remove an integration and restore the previous config
29
+
30
+ Options:
31
+ -m, --model <provider/model> choose a model, e.g. bc-cloud/glm-5.3-flash
32
+ --reasoning <level> auto | off | low | medium | high | max
33
+ -c, --continue continue the last session in this folder
34
+ -r, --resume pick a session to continue
35
+ --allow-all run all tools without asking for permission
36
+ --allowed-tools <a,b> tools allowed without asking: bash, edit, fetch
37
+ --permission-mode <mode> default | acceptEdits | plan | allowAll
38
+ --lang <en|id> interface language (default: en; or BCCLI_LANG, or "language" in config)
39
+ -v, --version version
40
+ -h, --help this help`;
41
+ var helpText = () => t(HELP);
42
+ function parseCliArgs(argv) {
43
+ const { values, positionals } = parseArgs({
44
+ args: argv,
45
+ allowPositionals: true,
46
+ options: {
47
+ print: { type: "boolean", short: "p" },
48
+ model: { type: "string", short: "m" },
49
+ reasoning: { type: "string" },
50
+ lang: { type: "string" },
51
+ continue: { type: "boolean", short: "c" },
52
+ resume: { type: "boolean", short: "r" },
53
+ "allow-all": { type: "boolean" },
54
+ "allowed-tools": { type: "string" },
55
+ "permission-mode": { type: "string" },
56
+ help: { type: "boolean", short: "h" },
57
+ version: { type: "boolean", short: "v" },
58
+ url: { type: "string" },
59
+ name: { type: "string" },
60
+ "key-env": { type: "string" },
61
+ value: { type: "string", multiple: true }
62
+ }
63
+ });
64
+ const reasoning = values.reasoning;
65
+ if (reasoning && !isReasoningLevel(reasoning)) {
66
+ throw new ConfigError(t("--reasoning must be one of: {levels}", { levels: REASONING_LEVELS.join(", ") }));
67
+ }
68
+ const mode = values["permission-mode"];
69
+ if (mode && !MODE_ORDER.includes(mode)) {
70
+ throw new ConfigError(t("--permission-mode must be one of: {modes}", { modes: MODE_ORDER.join(", ") }));
71
+ }
72
+ if (values.lang !== void 0 && !parseLang(values.lang)) throw new ConfigError(t("--lang must be one of: en, id"));
73
+ const [first, ...rest] = positionals;
74
+ const SUBCOMMANDS = ["login", "models", "provider", "mcp", "connect", "disconnect", "integrations"];
75
+ const command = SUBCOMMANDS.includes(first) ? first : "run";
76
+ const words = command === "run" ? positionals : rest;
77
+ return {
78
+ command,
79
+ prompt: command === "run" && words.length ? words.join(" ") : void 0,
80
+ print: !!values.print,
81
+ model: values.model,
82
+ reasoning,
83
+ lang: parseLang(values.lang),
84
+ continue: !!values.continue,
85
+ resume: !!values.resume,
86
+ allowAll: !!values["allow-all"],
87
+ allowedTools: (values["allowed-tools"] ?? "").split(",").map((s) => s.trim()).filter(Boolean),
88
+ permissionMode: mode,
89
+ help: !!values.help,
90
+ version: !!values.version,
91
+ loginProvider: command === "login" ? rest[0] ?? "bc-cloud" : void 0,
92
+ subArgs: ["provider", "mcp", "connect", "disconnect", "integrations"].includes(command) ? rest : [],
93
+ url: values.url,
94
+ name: values.name,
95
+ keyEnv: values["key-env"],
96
+ values: values.value ?? []
97
+ };
98
+ }
99
+
100
+ export {
101
+ helpText,
102
+ parseCliArgs
103
+ };
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ t
4
+ } from "./chunk-EO7IVVX4.js";
5
+
6
+ // src/reasoning.ts
7
+ var REASONING_LEVELS = ["auto", "off", "low", "medium", "high", "max"];
8
+ var OPENAI_LEVELS = ["auto", "low", "medium", "high"];
9
+ var BOTCONNECTOR_LEVELS = REASONING_LEVELS;
10
+ function isReasoningLevel(value) {
11
+ return REASONING_LEVELS.includes(value);
12
+ }
13
+ function parseReasoningLevel(value, label = "reasoning") {
14
+ if (!isReasoningLevel(value)) {
15
+ throw new Error(t("{label} must be one of: {levels}", { label, levels: REASONING_LEVELS.join(", ") }));
16
+ }
17
+ return value;
18
+ }
19
+ function reasoningCapability(providerId) {
20
+ switch (providerId) {
21
+ case "bc-cloud":
22
+ return { levels: BOTCONNECTOR_LEVELS, parameter: "reasoning_effort" };
23
+ case "openai":
24
+ return { levels: OPENAI_LEVELS, parameter: "reasoning_effort" };
25
+ case "openrouter":
26
+ return { levels: ["auto", "low", "medium", "high"], parameter: "reasoning" };
27
+ default:
28
+ return void 0;
29
+ }
30
+ }
31
+ function supportedReasoningLevels(providerId) {
32
+ return reasoningCapability(providerId)?.levels ?? ["auto"];
33
+ }
34
+ function assertReasoningSupported(providerId, level) {
35
+ if (level === "auto") return;
36
+ const capability = reasoningCapability(providerId);
37
+ if (!capability) {
38
+ throw new Error(t("This provider has no manual reasoning setting yet. Use Auto."));
39
+ }
40
+ if (!capability.levels.includes(level)) {
41
+ const supported = capability.levels.filter((x) => x !== "auto").map(capitalize).join("/");
42
+ throw new Error(t("This model/provider does not support reasoning level '{level}'. Use Auto{supported}.", { level, supported: supported ? `/${supported}` : "" }));
43
+ }
44
+ }
45
+ function reasoningPayload(providerId, level) {
46
+ if (level === "auto") return {};
47
+ assertReasoningSupported(providerId, level);
48
+ const capability = reasoningCapability(providerId);
49
+ if (capability.parameter === "reasoning") return { reasoning: { effort: level } };
50
+ return { reasoning_effort: level };
51
+ }
52
+ function capitalize(value) {
53
+ return value.charAt(0).toUpperCase() + value.slice(1);
54
+ }
55
+
56
+ export {
57
+ REASONING_LEVELS,
58
+ isReasoningLevel,
59
+ parseReasoningLevel,
60
+ supportedReasoningLevels,
61
+ assertReasoningSupported,
62
+ reasoningPayload
63
+ };
@@ -35,8 +35,8 @@ function readSecret(prompt) {
35
35
  });
36
36
  }
37
37
  async function runLogin(providerId, cwd) {
38
- const { runProviderCommand } = await import("./providerCli-G3X7KENO.js");
39
- const { parseCliArgs } = await import("./args-FCLPQ7TO.js");
38
+ const { runProviderCommand } = await import("./providerCli-6FXMBKQL.js");
39
+ const { parseCliArgs } = await import("./args-XQYEBOKB.js");
40
40
  return runProviderCommand(parseCliArgs(["provider", "add", providerId]), {
41
41
  env: process.env,
42
42
  cwd,