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

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 (45) hide show
  1. package/dist/{acp-SZWZ5EE4.js → acp-PP7ZONVQ.js} +2 -2
  2. package/dist/{args-4SMOHFN5.js → args-3DGIMRTG.js} +4 -4
  3. package/dist/{chunk-ISCT3PN3.js → chunk-3P5N6UPF.js} +2 -2
  4. package/dist/{chunk-3HCOAJEQ.js → chunk-7F3IWBPQ.js} +1 -0
  5. package/dist/{chunk-JROUQ5YS.js → chunk-A2XKKKKU.js} +4 -4
  6. package/dist/{chunk-AS7VV7D3.js → chunk-ADS5FDWL.js} +12 -6
  7. package/dist/{chunk-M7LLJQ7M.js → chunk-AGIZBZ64.js} +64 -24
  8. package/dist/{chunk-NI5JZUZ3.js → chunk-AWNQDAOY.js} +1 -1
  9. package/dist/{chunk-DBHDZ5EP.js → chunk-DRK3XTVZ.js} +13 -3
  10. package/dist/{chunk-M4IYXI3V.js → chunk-HQB227LD.js} +23 -21
  11. package/dist/{chunk-VM7HYAJS.js → chunk-HVGXCPDG.js} +1 -1
  12. package/dist/{chunk-SESBH44L.js → chunk-I422TPGX.js} +1 -1
  13. package/dist/chunk-I4THUZRD.js +145 -0
  14. package/dist/{chunk-LN32JIZR.js → chunk-LYFN6AEV.js} +4 -4
  15. package/dist/{chunk-GGNXHJL6.js → chunk-LYQHLA43.js} +2 -2
  16. package/dist/{chunk-AVB6M4JE.js → chunk-NFJPKNHL.js} +2 -2
  17. package/dist/{chunk-BUHWQU3V.js → chunk-O74EQFYI.js} +3 -3
  18. package/dist/{chunk-EQQTTE2K.js → chunk-Q2ZBR4OU.js} +1 -1
  19. package/dist/{chunk-HE33XAPZ.js → chunk-QZM66F3A.js} +1 -1
  20. package/dist/{chunk-M23QBX3V.js → chunk-VBEX5YHF.js} +58 -2
  21. package/dist/cli.js +57 -37
  22. package/dist/{config-C4KLLDC6.js → config-LFT2FNSE.js} +3 -3
  23. package/dist/config-UKEKWMCG.js +30 -0
  24. package/dist/ghBotCli-DWQXAIKE.js +676 -0
  25. package/dist/{integrationCli-HR7CDUSI.js → integrationCli-RSJCJ3NW.js} +2 -2
  26. package/dist/login-L3SUO4H4.js +16 -0
  27. package/dist/{mcpCli-5QTXH7XJ.js → mcpCli-RSLEDQQ7.js} +6 -6
  28. package/dist/{modelsCli-DKTT3UZD.js → modelsCli-IKZLORLH.js} +6 -6
  29. package/dist/npmRunner-LU43GM3W.js +46 -0
  30. package/dist/oauthLogin-XHEMYL6L.js +210 -0
  31. package/dist/pluginsCli-MRS547WG.js +284 -0
  32. package/dist/providerCli-7GRUL3BS.js +15 -0
  33. package/dist/sdk.js +128 -54
  34. package/dist/{serve-I2VQUTHR.js → serve-A4E67R5E.js} +3 -3
  35. package/dist/{serve-KQ35P4W3.js → serve-GFNJ5PSL.js} +18 -18
  36. package/dist/session-VKVBMGCC.js +12 -0
  37. package/dist/setup-XWX64X5Q.js +23 -0
  38. package/dist/{ui-S4QFJJIB.js → ui-STI6HSOR.js} +13 -13
  39. package/dist/{update-VBDEHHMR.js → update-KMWE2P2I.js} +2 -2
  40. package/package.json +1 -1
  41. package/dist/chunk-DSFHN5CH.js +0 -52
  42. package/dist/login-T5S6SPZA.js +0 -9
  43. package/dist/providerCli-DDH4ZZUY.js +0 -15
  44. package/dist/session-H2YL5RSB.js +0 -12
  45. package/dist/setup-45WQXUBK.js +0 -23
@@ -97,8 +97,8 @@ function runAcp(input, output, opts) {
97
97
  function runtimeAgent(cwd) {
98
98
  return {
99
99
  async run(text, onChunk, signal) {
100
- const { parseCliArgs } = await import("./args-4SMOHFN5.js");
101
- const { createRuntime } = await import("./setup-45WQXUBK.js");
100
+ const { parseCliArgs } = await import("./args-3DGIMRTG.js");
101
+ const { createRuntime } = await import("./setup-XWX64X5Q.js");
102
102
  const rt = createRuntime({ cwd, args: { ...parseCliArgs([]), allowAll: true } });
103
103
  rt.agent.onEvent = (event) => {
104
104
  if (event.type === "text") onChunk(event.delta);
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  helpText,
4
4
  parseCliArgs
5
- } from "./chunk-AS7VV7D3.js";
5
+ } from "./chunk-ADS5FDWL.js";
6
6
  import "./chunk-GAFJEQTJ.js";
7
- import "./chunk-NI5JZUZ3.js";
8
- import "./chunk-M7LLJQ7M.js";
9
- import "./chunk-M23QBX3V.js";
7
+ import "./chunk-AWNQDAOY.js";
8
+ import "./chunk-AGIZBZ64.js";
9
+ import "./chunk-VBEX5YHF.js";
10
10
  export {
11
11
  helpText,
12
12
  parseCliArgs
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigError
4
- } from "./chunk-M7LLJQ7M.js";
4
+ } from "./chunk-AGIZBZ64.js";
5
5
  import {
6
6
  t
7
- } from "./chunk-M23QBX3V.js";
7
+ } from "./chunk-VBEX5YHF.js";
8
8
 
9
9
  // src/mcp/catalog.ts
10
10
  var CATALOG = [
@@ -185,6 +185,7 @@ async function authorizeMcpServer(spec, deps) {
185
185
  export {
186
186
  hasStoredTokens,
187
187
  clearTokens,
188
+ defaultOpen,
188
189
  FileOAuthProvider,
189
190
  authorizeMcpServer
190
191
  };
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  listAllModels
4
- } from "./chunk-LN32JIZR.js";
4
+ } from "./chunk-LYFN6AEV.js";
5
5
  import {
6
6
  hasKey,
7
7
  providerName,
8
8
  removeGlobalProvider,
9
9
  writeGlobalConfig
10
- } from "./chunk-SESBH44L.js";
10
+ } from "./chunk-I422TPGX.js";
11
11
  import {
12
12
  PRESETS,
13
13
  loadConfig,
14
14
  saveCredential
15
- } from "./chunk-M7LLJQ7M.js";
15
+ } from "./chunk-AGIZBZ64.js";
16
16
  import {
17
17
  t
18
- } from "./chunk-M23QBX3V.js";
18
+ } from "./chunk-VBEX5YHF.js";
19
19
 
20
20
  // src/providerCli.ts
21
21
  async function addProviderKey(providerId, key, deps) {
@@ -5,14 +5,14 @@ import {
5
5
  import {
6
6
  REASONING_LEVELS,
7
7
  isReasoningLevel
8
- } from "./chunk-NI5JZUZ3.js";
8
+ } from "./chunk-AWNQDAOY.js";
9
9
  import {
10
10
  ConfigError
11
- } from "./chunk-M7LLJQ7M.js";
11
+ } from "./chunk-AGIZBZ64.js";
12
12
  import {
13
13
  parseLang,
14
14
  t
15
- } from "./chunk-M23QBX3V.js";
15
+ } from "./chunk-VBEX5YHF.js";
16
16
 
17
17
  // src/args.ts
18
18
  import { parseArgs } from "util";
@@ -77,11 +77,13 @@ var HELP = `BCCLI \u2014 BotConnector's AI coding agent for the terminal
77
77
  Usage:
78
78
  bccli [task] interactive mode (optionally start with a task)
79
79
  bccli -p "task" run one task without interaction (scripts/CI)
80
- bccli login [provider] save an API key (default: bc-cloud)
80
+ bccli login [provider] OAuth login (or --key paste API key, --logout remove)
81
81
  bccli models [provider] list models (default: the active provider)
82
82
  bccli update install the newest bccli from npm
83
83
  bccli acp run as an ACP agent for editors (Zed, ...)
84
84
  bccli serve [--port N] serve sessions over HTTP+WS for IDEs/bots
85
+ bccli plugins list, install, remove, or update plugins
86
+ bccli gh-bot [serve] GitHub comment bot (off-by-default; needs config)
85
87
  bccli provider list|add <id>|remove <id> manage providers (custom: --url <url> [--name N] [--key-env ENV])
86
88
  bccli mcp list|add <name>|remove <name>|auth <name>|logout <name>|serve [--base-url <url>] manage MCP servers, or serve this account's tools over stdio
87
89
  bccli integrations show the status of external agent integrations
@@ -124,6 +126,8 @@ function parseCliArgs(argv) {
124
126
  name: { type: "string" },
125
127
  "key-env": { type: "string" },
126
128
  value: { type: "string", multiple: true },
129
+ key: { type: "boolean" },
130
+ logout: { type: "boolean" },
127
131
  port: { type: "string" },
128
132
  host: { type: "string" },
129
133
  token: { type: "string" },
@@ -144,7 +148,7 @@ function parseCliArgs(argv) {
144
148
  throw new ConfigError(t("--output-format must be one of: {formats}", { formats: "text, json, stream-json" }));
145
149
  }
146
150
  const [first, ...rest] = positionals;
147
- const SUBCOMMANDS = ["login", "models", "update", "acp", "serve", "provider", "mcp", "connect", "disconnect", "integrations"];
151
+ const SUBCOMMANDS = ["login", "models", "update", "acp", "serve", "plugins", "gh-bot", "provider", "mcp", "connect", "disconnect", "integrations"];
148
152
  const command = SUBCOMMANDS.includes(first) ? first : "run";
149
153
  const words = command === "run" ? positionals : rest;
150
154
  const port = values.port !== void 0 ? Number(values.port) : void 0;
@@ -171,7 +175,9 @@ function parseCliArgs(argv) {
171
175
  help: !!values.help,
172
176
  version: !!values.version,
173
177
  loginProvider: command === "login" ? rest[0] ?? "bc-cloud" : void 0,
174
- subArgs: ["models", "provider", "mcp", "connect", "disconnect", "integrations"].includes(command) ? rest : [],
178
+ key: !!values.key,
179
+ logout: !!values.logout,
180
+ subArgs: ["models", "plugins", "gh-bot", "provider", "mcp", "connect", "disconnect", "integrations"].includes(command) ? rest : [],
175
181
  url: values.url,
176
182
  name: values.name,
177
183
  keyEnv: values["key-env"],
@@ -1,7 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  t
4
- } from "./chunk-M23QBX3V.js";
4
+ } from "./chunk-VBEX5YHF.js";
5
+
6
+ // src/config.ts
7
+ import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "fs";
8
+ import { homedir } from "os";
9
+ import { dirname, join } from "path";
5
10
 
6
11
  // src/presets.ts
7
12
  var PRESETS = [
@@ -16,29 +21,6 @@ var PRESETS = [
16
21
  { id: "lmstudio", name: "LM Studio lokal", baseURL: "http://127.0.0.1:1234/v1", local: true }
17
22
  ];
18
23
 
19
- // src/ui/theme.ts
20
- var THEMES = ["default", "blue", "amber", "magenta", "mono"];
21
- var REMAP = {
22
- blue: { green: "blue" },
23
- amber: { green: "yellow" },
24
- magenta: { green: "magenta" }
25
- };
26
- var theme = "default";
27
- function setTheme(name) {
28
- theme = name;
29
- }
30
- function color(name) {
31
- if (process.env.NO_COLOR) return void 0;
32
- if (theme === "mono") return void 0;
33
- return REMAP[theme]?.[name] ?? name;
34
- }
35
- var ACCENT = "green";
36
-
37
- // src/config.ts
38
- import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
39
- import { homedir } from "os";
40
- import { join } from "path";
41
-
42
24
  // src/keybinds.ts
43
25
  var KEYBIND_ACTIONS = ["thinking", "toolOutput", "pasteImage"];
44
26
  var DEFAULT_KEYBINDS = {
@@ -62,6 +44,24 @@ function matchKeybind(kb, input, key) {
62
44
  return kb.ctrl === !!key.ctrl && kb.meta === !!key.meta && input.toLowerCase() === kb.key;
63
45
  }
64
46
 
47
+ // src/ui/theme.ts
48
+ var THEMES = ["default", "blue", "amber", "magenta", "mono"];
49
+ var REMAP = {
50
+ blue: { green: "blue" },
51
+ amber: { green: "yellow" },
52
+ magenta: { green: "magenta" }
53
+ };
54
+ var theme = "default";
55
+ function setTheme(name) {
56
+ theme = name;
57
+ }
58
+ function color(name) {
59
+ if (process.env.NO_COLOR) return void 0;
60
+ if (theme === "mono") return void 0;
61
+ return REMAP[theme]?.[name] ?? name;
62
+ }
63
+ var ACCENT = "green";
64
+
65
65
  // src/config.ts
66
66
  var ConfigError = class extends Error {
67
67
  };
@@ -251,6 +251,42 @@ function loadConfig(cwd, env = process.env) {
251
251
  allow: [...global.allow ?? []]
252
252
  };
253
253
  }
254
+ function globalConfigPath(env = process.env) {
255
+ return join(bccliHome(env), "config.json");
256
+ }
257
+ function readGlobalPlugins(env = process.env) {
258
+ const raw = readJsonConfig(globalConfigPath(env));
259
+ const value = raw.plugins;
260
+ if (value === void 0) return [];
261
+ if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string")) {
262
+ throw new ConfigError(t("plugins must be an array of strings."));
263
+ }
264
+ return value;
265
+ }
266
+ function writeFileAtomic(path, data) {
267
+ const tmp = `${path}.tmp-${process.pid}-${Date.now()}`;
268
+ try {
269
+ writeFileSync(tmp, data);
270
+ renameSync(tmp, path);
271
+ } catch (error) {
272
+ try {
273
+ rmSync(tmp, { force: true });
274
+ } catch {
275
+ }
276
+ throw error;
277
+ }
278
+ }
279
+ function updateGlobalConfig(env, mutate) {
280
+ const path = globalConfigPath(env);
281
+ let cfg = {};
282
+ if (existsSync(path)) {
283
+ cfg = JSON.parse(readFileSync(path, "utf8"));
284
+ }
285
+ mutate(cfg);
286
+ mkdirSync(dirname(path), { recursive: true });
287
+ writeFileAtomic(path, `${JSON.stringify(cfg, null, 2)}
288
+ `);
289
+ }
254
290
  function readCredentials(env = process.env) {
255
291
  const path = join(bccliHome(env), "credentials");
256
292
  if (!existsSync(path)) return {};
@@ -300,9 +336,13 @@ export {
300
336
  color,
301
337
  ACCENT,
302
338
  ConfigError,
339
+ DEFAULT_MAX_STEPS,
303
340
  bccliHome,
304
341
  readJsonConfig,
305
342
  loadConfig,
343
+ globalConfigPath,
344
+ readGlobalPlugins,
345
+ updateGlobalConfig,
306
346
  readCredentials,
307
347
  saveCredential,
308
348
  resolveModel,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  t
4
- } from "./chunk-M23QBX3V.js";
4
+ } from "./chunk-VBEX5YHF.js";
5
5
 
6
6
  // src/reasoning.ts
7
7
  var REASONING_LEVELS = ["auto", "off", "low", "medium", "high", "max"];
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-PSO7R5AD.js";
5
5
  import {
6
6
  t
7
- } from "./chunk-M23QBX3V.js";
7
+ } from "./chunk-VBEX5YHF.js";
8
8
 
9
9
  // src/tools/bash.ts
10
10
  import { spawn } from "child_process";
@@ -173,8 +173,8 @@ function startBackground(command, cwd, env, shell) {
173
173
  return task;
174
174
  }
175
175
  function backgroundStatus(task) {
176
- if (task.status === "running") return `[running ${Math.round((Date.now() - task.startedAt) / 1e3)}s]`;
177
176
  if (task.killed) return "[killed]";
177
+ if (task.status === "running") return `[running ${Math.round((Date.now() - task.startedAt) / 1e3)}s]`;
178
178
  return `[exit code ${task.exitCode}]`;
179
179
  }
180
180
  function backgroundOutput(task) {
@@ -585,8 +585,18 @@ function runOne(command, event, payload, opts) {
585
585
  resolve(result);
586
586
  };
587
587
  let child;
588
+ const shell = defaultShell();
588
589
  try {
589
- child = spawn2(command, { shell: true, env, cwd: opts.cwd ?? process.cwd(), stdio: ["ignore", "pipe", "pipe"] });
590
+ if (shell) {
591
+ child = spawn2(shell.file, shell.args(command), {
592
+ shell: false,
593
+ env,
594
+ cwd: opts.cwd ?? process.cwd(),
595
+ stdio: ["ignore", "pipe", "pipe"]
596
+ });
597
+ } else {
598
+ child = spawn2(command, { shell: true, env, cwd: opts.cwd ?? process.cwd(), stdio: ["ignore", "pipe", "pipe"] });
599
+ }
590
600
  } catch (error) {
591
601
  resolve({ failure: error.message });
592
602
  return;
@@ -1,8 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- FileOAuthProvider,
4
- hasStoredTokens
5
- } from "./chunk-3HCOAJEQ.js";
6
2
  import {
7
3
  BUILTIN_AGENTS,
8
4
  appendMemory,
@@ -17,47 +13,51 @@ import {
17
13
  parseFrontmatter,
18
14
  runHooks,
19
15
  validateGlobPattern
20
- } from "./chunk-DBHDZ5EP.js";
16
+ } from "./chunk-DRK3XTVZ.js";
17
+ import {
18
+ createWebSearchTool,
19
+ fetchTool
20
+ } from "./chunk-QZM66F3A.js";
21
+ import {
22
+ defineTool
23
+ } from "./chunk-PSO7R5AD.js";
21
24
  import {
22
25
  Permissions
23
26
  } from "./chunk-GAFJEQTJ.js";
24
27
  import {
25
28
  addProviderKey
26
- } from "./chunk-JROUQ5YS.js";
29
+ } from "./chunk-A2XKKKKU.js";
27
30
  import {
28
31
  listAllModels
29
- } from "./chunk-LN32JIZR.js";
32
+ } from "./chunk-LYFN6AEV.js";
30
33
  import {
31
34
  providerName
32
- } from "./chunk-SESBH44L.js";
35
+ } from "./chunk-I422TPGX.js";
36
+ import {
37
+ FileOAuthProvider,
38
+ hasStoredTokens
39
+ } from "./chunk-7F3IWBPQ.js";
33
40
  import {
34
41
  Session
35
- } from "./chunk-VM7HYAJS.js";
42
+ } from "./chunk-HVGXCPDG.js";
36
43
  import {
37
44
  completionAssistantMessage,
38
45
  createProvider,
39
46
  hasPendingProgrammaticReplay,
40
47
  imageUserMessage
41
- } from "./chunk-GGNXHJL6.js";
48
+ } from "./chunk-LYQHLA43.js";
42
49
  import {
43
50
  expandEnvVars
44
- } from "./chunk-AVB6M4JE.js";
45
- import {
46
- createWebSearchTool,
47
- fetchTool
48
- } from "./chunk-HE33XAPZ.js";
49
- import {
50
- defineTool
51
- } from "./chunk-PSO7R5AD.js";
51
+ } from "./chunk-NFJPKNHL.js";
52
52
  import {
53
53
  ConfigError,
54
54
  bccliHome,
55
55
  loadConfig,
56
56
  resolveModel
57
- } from "./chunk-M7LLJQ7M.js";
57
+ } from "./chunk-AGIZBZ64.js";
58
58
  import {
59
59
  t
60
- } from "./chunk-M23QBX3V.js";
60
+ } from "./chunk-VBEX5YHF.js";
61
61
 
62
62
  // src/textToolCalls.ts
63
63
  var PAIR = /(?:<arg_key>\s*|`)?([A-Za-z_]\w*)(?:\s*<\/arg_key>)?`?\s*(?:=\s*`|<arg_value>)([\s\S]*?)<\/arg_value>/g;
@@ -1909,6 +1909,8 @@ function createRuntime(opts) {
1909
1909
  apiKey: resolved.apiKey,
1910
1910
  model: resolved.model,
1911
1911
  providerId: resolved.providerId,
1912
+ fetch: opts.fetch,
1913
+ // diteruskan penuh (spec gh-bot §6.6 — juga memperbaiki sdk fetch-injection)
1912
1914
  enableProgrammaticToolCalling: lunaPtcAutoEnabled(env)
1913
1915
  });
1914
1916
  };
@@ -1993,7 +1995,7 @@ function createRuntime(opts) {
1993
1995
  cwd: opts.cwd,
1994
1996
  history,
1995
1997
  reasoning,
1996
- maxSteps: config.maxSteps,
1998
+ maxSteps: opts.maxSteps ?? config.maxSteps,
1997
1999
  hooks: config.hooks,
1998
2000
  pluginEmit,
1999
2001
  env,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  contentText
4
- } from "./chunk-GGNXHJL6.js";
4
+ } from "./chunk-LYQHLA43.js";
5
5
 
6
6
  // src/session.ts
7
7
  import { randomBytes } from "crypto";
@@ -5,7 +5,7 @@ import {
5
5
  readCredentials,
6
6
  readJsonConfig,
7
7
  removeCredential
8
- } from "./chunk-M7LLJQ7M.js";
8
+ } from "./chunk-AGIZBZ64.js";
9
9
 
10
10
  // src/providers.ts
11
11
  import { mkdirSync, writeFileSync } from "fs";
@@ -0,0 +1,145 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ defaultOpen
4
+ } from "./chunk-7F3IWBPQ.js";
5
+ import {
6
+ removeCredential,
7
+ saveCredential
8
+ } from "./chunk-AGIZBZ64.js";
9
+ import {
10
+ t
11
+ } from "./chunk-VBEX5YHF.js";
12
+
13
+ // src/login.ts
14
+ function readSecret(prompt) {
15
+ return new Promise((resolve) => {
16
+ process.stdout.write(prompt);
17
+ const stdin = process.stdin;
18
+ if (!stdin.isTTY) {
19
+ let data = "";
20
+ stdin.on("data", (d) => {
21
+ data += d;
22
+ });
23
+ stdin.on("end", () => resolve(data.trim()));
24
+ return;
25
+ }
26
+ let value = "";
27
+ stdin.setRawMode(true);
28
+ stdin.resume();
29
+ const onData = (buffer) => {
30
+ for (const ch of buffer.toString()) {
31
+ if (ch === "\r" || ch === "\n") {
32
+ stdin.setRawMode(false);
33
+ stdin.pause();
34
+ stdin.off("data", onData);
35
+ process.stdout.write("\n");
36
+ resolve(value.trim());
37
+ return;
38
+ }
39
+ if (ch === "") process.exit(130);
40
+ if (ch === "\x7F" || ch === "\b") value = value.slice(0, -1);
41
+ else value += ch;
42
+ }
43
+ };
44
+ stdin.on("data", onData);
45
+ });
46
+ }
47
+ function readLine(prompt) {
48
+ return new Promise((resolve) => {
49
+ process.stdout.write(prompt);
50
+ const stdin = process.stdin;
51
+ if (!stdin.isTTY) {
52
+ let data = "";
53
+ stdin.on("data", (d) => {
54
+ data += d;
55
+ });
56
+ stdin.on("end", () => resolve(data.trim()));
57
+ return;
58
+ }
59
+ let value = "";
60
+ stdin.setRawMode(true);
61
+ stdin.resume();
62
+ const onData = (buffer) => {
63
+ for (const ch of buffer.toString()) {
64
+ const code = ch.charCodeAt(0);
65
+ if (code === 13 || code === 10) {
66
+ stdin.setRawMode(false);
67
+ stdin.pause();
68
+ stdin.off("data", onData);
69
+ process.stdout.write("\n");
70
+ resolve(value.trim());
71
+ return;
72
+ }
73
+ if (code === 3) process.exit(130);
74
+ if (code === 127 || code === 8) value = value.slice(0, -1);
75
+ else value += ch;
76
+ }
77
+ };
78
+ stdin.on("data", onData);
79
+ });
80
+ }
81
+ function defaultLoginDeps() {
82
+ return {
83
+ out: (s) => console.log(s),
84
+ err: (s) => console.error(s),
85
+ env: process.env,
86
+ isTTY: process.stdin.isTTY ?? false,
87
+ open: (url) => defaultOpen(new URL(url)),
88
+ readLine,
89
+ saveCredential: (id, key) => saveCredential(id, key, process.env),
90
+ removeCredential: (id) => removeCredential(id, process.env),
91
+ fetch: globalThis.fetch,
92
+ // Wiring NYATA jalur lama: persis runLogin lama (provider add + prompt key).
93
+ legacyAdd: async (providerId, targetCwd) => {
94
+ const { runProviderCommand } = await import("./providerCli-7GRUL3BS.js");
95
+ const { parseCliArgs: parse } = await import("./args-3DGIMRTG.js");
96
+ return runProviderCommand(parse(["provider", "add", providerId]), {
97
+ env: process.env,
98
+ cwd: targetCwd,
99
+ out: (s) => console.log(s),
100
+ err: (s) => console.error(s),
101
+ readSecret
102
+ });
103
+ }
104
+ };
105
+ }
106
+ async function runLogin(providerId, cwd, args, deps) {
107
+ if (args.key && args.logout) {
108
+ deps.err(t("Use either --key or --logout, not both."));
109
+ return 1;
110
+ }
111
+ if (args.logout) {
112
+ if (providerId !== "openrouter") {
113
+ deps.err(
114
+ t("Logout is not supported for {id}; use bccli provider remove {id} to delete its stored key and config.", {
115
+ id: providerId
116
+ })
117
+ );
118
+ return 1;
119
+ }
120
+ const { runOauthLogout } = await import("./oauthLogin-XHEMYL6L.js");
121
+ return runOauthLogout({ out: deps.out, err: deps.err, env: deps.env, removeCredential: deps.removeCredential });
122
+ }
123
+ if (args.key) return deps.legacyAdd(providerId, cwd);
124
+ if (providerId === "openrouter") {
125
+ const { runOauthLogin } = await import("./oauthLogin-XHEMYL6L.js");
126
+ return runOauthLogin({
127
+ out: deps.out,
128
+ err: deps.err,
129
+ env: deps.env,
130
+ isTTY: deps.isTTY,
131
+ open: deps.open,
132
+ readLine: deps.readLine,
133
+ saveCredential: deps.saveCredential,
134
+ fetch: deps.fetch
135
+ });
136
+ }
137
+ return deps.legacyAdd(providerId, cwd);
138
+ }
139
+
140
+ export {
141
+ readSecret,
142
+ readLine,
143
+ defaultLoginDeps,
144
+ runLogin
145
+ };
@@ -2,17 +2,17 @@
2
2
  import {
3
3
  hasKey,
4
4
  providerName
5
- } from "./chunk-SESBH44L.js";
5
+ } from "./chunk-I422TPGX.js";
6
6
  import {
7
7
  createProvider
8
- } from "./chunk-GGNXHJL6.js";
8
+ } from "./chunk-LYQHLA43.js";
9
9
  import {
10
10
  PRESETS,
11
11
  readCredentials
12
- } from "./chunk-M7LLJQ7M.js";
12
+ } from "./chunk-AGIZBZ64.js";
13
13
  import {
14
14
  t
15
- } from "./chunk-M23QBX3V.js";
15
+ } from "./chunk-VBEX5YHF.js";
16
16
 
17
17
  // src/models.ts
18
18
  function order(ids) {
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  reasoningPayload
4
- } from "./chunk-NI5JZUZ3.js";
4
+ } from "./chunk-AWNQDAOY.js";
5
5
  import {
6
6
  t
7
- } from "./chunk-M23QBX3V.js";
7
+ } from "./chunk-VBEX5YHF.js";
8
8
 
9
9
  // src/provider.ts
10
10
  import OpenAI from "openai";
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigError
4
- } from "./chunk-M7LLJQ7M.js";
4
+ } from "./chunk-AGIZBZ64.js";
5
5
  import {
6
6
  t
7
- } from "./chunk-M23QBX3V.js";
7
+ } from "./chunk-VBEX5YHF.js";
8
8
 
9
9
  // src/mcp/config.ts
10
10
  import { createHash } from "crypto";
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  runCommand,
4
4
  runHooks
5
- } from "./chunk-DBHDZ5EP.js";
5
+ } from "./chunk-DRK3XTVZ.js";
6
6
  import {
7
7
  ConfigError
8
- } from "./chunk-M7LLJQ7M.js";
8
+ } from "./chunk-AGIZBZ64.js";
9
9
  import {
10
10
  t
11
- } from "./chunk-M23QBX3V.js";
11
+ } from "./chunk-VBEX5YHF.js";
12
12
 
13
13
  // src/verify.ts
14
14
  var MAX_VERIFY_ROUNDS = 2;
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/version.ts
4
- var VERSION = true ? "0.4.0-beta.41" : "0.0.0-dev";
4
+ var VERSION = true ? "0.4.0-beta.42" : "0.0.0-dev";
5
5
 
6
6
  export {
7
7
  VERSION
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-PSO7R5AD.js";
5
5
  import {
6
6
  t
7
- } from "./chunk-M23QBX3V.js";
7
+ } from "./chunk-VBEX5YHF.js";
8
8
 
9
9
  // src/tools/websearch.ts
10
10
  import { z } from "zod";