@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
package/dist/sdk.js CHANGED
@@ -2,9 +2,9 @@
2
2
  import { parseArgs } from "util";
3
3
 
4
4
  // src/config.ts
5
- import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
5
+ import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "fs";
6
6
  import { homedir } from "os";
7
- import { join } from "path";
7
+ import { dirname, join } from "path";
8
8
 
9
9
  // src/presets.ts
10
10
  var PRESETS = [
@@ -145,11 +145,13 @@ var ID = {
145
145
  Usage:
146
146
  bccli [task] interactive mode (optionally start with a task)
147
147
  bccli -p "task" run one task without interaction (scripts/CI)
148
- bccli login [provider] save an API key (default: bc-cloud)
148
+ bccli login [provider] OAuth login (or --key paste API key, --logout remove)
149
149
  bccli models [provider] list models (default: the active provider)
150
150
  bccli update install the newest bccli from npm
151
151
  bccli acp run as an ACP agent for editors (Zed, ...)
152
152
  bccli serve [--port N] serve sessions over HTTP+WS for IDEs/bots
153
+ bccli plugins list, install, remove, or update plugins
154
+ bccli gh-bot [serve] GitHub comment bot (off-by-default; needs config)
153
155
  bccli provider list|add <id>|remove <id> manage providers (custom: --url <url> [--name N] [--key-env ENV])
154
156
  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
155
157
  bccli integrations show the status of external agent integrations
@@ -173,11 +175,13 @@ Options:
173
175
  Pemakaian:
174
176
  bccli [tugas] mode interaktif (opsional langsung dengan tugas)
175
177
  bccli -p "tugas" jalankan satu tugas tanpa interaksi (skrip/CI)
176
- bccli login [provider] simpan API key (default: bc-cloud)
178
+ bccli login [provider] login OAuth (atau --key tempel API key, --logout hapus)
177
179
  bccli models [provider] daftar model (default: provider aktif)
178
180
  bccli update pasang bccli terbaru dari npm
179
181
  bccli acp jalankan sebagai agen ACP untuk editor (Zed, ...)
180
182
  bccli serve [--port N] sajikan sesi lewat HTTP+WS untuk IDE/bot
183
+ bccli plugins daftar, install, remove, atau perbarui plugin
184
+ bccli gh-bot [serve] bot komentar GitHub (nonaktif default; butuh config)
181
185
  bccli provider list|add <id>|remove <id> kelola provider (custom: --url <url> [--name N] [--key-env ENV])
182
186
  bccli mcp list|add <nama>|remove <nama>|auth <nama>|logout <nama>|serve [--base-url <url>] kelola server MCP, atau layani tools akun ini lewat stdio
183
187
  bccli integrations lihat status integrasi agent eksternal
@@ -221,6 +225,58 @@ Opsi:
221
225
  "A new bccli is available: {latest} (you have {current}). Run: bccli update": "bccli versi baru tersedia: {latest} (kamu punya {current}). Jalankan: bccli update",
222
226
  "Clipboard image saved to {path} \u2014 the path is inserted in the input; the model sees it when you send.": "Gambar clipboard disimpan ke {path} \u2014 path disisipkan ke input; model melihatnya saat kamu kirim.",
223
227
  "No image on the clipboard.": "Tidak ada gambar di clipboard.",
228
+ "githubBot secret env {env} is empty \u2014 set it before enabling the bot.": "secret env githubBot {env} kosong \u2014 setel sebelum mengaktifkan bot.",
229
+ "githubBot.{name} must be an array of strings.": "githubBot.{name} harus berupa array of string.",
230
+ "githubBot.{name} must be a positive integer.": "githubBot.{name} harus bilangan bulat positif.",
231
+ "githubBot.enabled must be a boolean.": "githubBot.enabled harus boolean.",
232
+ "githubBot.path must be an absolute path like /github.": "githubBot.path harus path absolut seperti /github.",
233
+ "githubBot.secretEnv must be a non-empty string.": "githubBot.secretEnv harus string tidak kosong.",
234
+ "Ignored empty command in delivery {id}.": "Mengabaikan perintah kosong di delivery {id}.",
235
+ "Unknown action: {action}. Use serve.": "Aksi tidak dikenal: {action}. Gunakan serve.",
236
+ "gh CLI not found (exit {code}) \u2014 install GitHub CLI before enabling gh-bot.": "gh CLI tidak ditemukan (exit {code}) \u2014 pasang GitHub CLI sebelum mengaktifkan gh-bot.",
237
+ "Unknown action: {action}. Use list, install <spec>, remove <name>, or update [name].": "Aksi tidak dikenal: {action}. Gunakan list, install <spec>, remove <nama>, atau update [nama].",
238
+ "Cannot read the plugin config while running {action}: {reason} at {path} \u2014 no changes were made; fix the config, then retry.": "Tidak bisa membaca config plugin saat menjalankan {action}: {reason} di {path} \u2014 tidak ada perubahan; perbaiki config, lalu coba lagi.",
239
+ "npm install failed ({code}): {stderr}": "npm install gagal ({code}): {stderr}",
240
+ "install requires a package spec: bccli plugins install <spec>": "install butuh spesifikasi paket: bccli plugins install <spec>",
241
+ "Invalid npm package spec: {spec}. Use a name, @scope/name, name@version, or name@tag \u2014 URLs, git, paths, and flags are not accepted.": "Spesifikasi paket npm tidak valid: {spec}. Pakai nama, @scope/nama, nama@versi, atau nama@tag \u2014 URL, git, path, dan flag tidak diterima.",
242
+ "npm finished but the config could not be read: {reason} \u2014 the entry list is unchanged; fix {path}, then rerun the same command (safe to repeat).": "npm selesai tetapi config gagal dibaca: {reason} \u2014 daftar entry tidak berubah; perbaiki {path}, lalu jalankan ulang perintah yang sama (aman diulang).",
243
+ "npm finished but the config update failed: {reason}. {name} stays enabled through its existing entry {entry}; the package files may already be new. Fix the config error at {path} \u2014 no entry change was required.": "npm selesai tetapi pembaruan config gagal: {reason}. {name} tetap aktif lewat entry lama {entry}; file paket mungkin sudah baru. Perbaiki error config di {path} \u2014 tidak ada perubahan entry yang diperlukan.",
244
+ 'npm finished but the config update failed: {reason}. {name} is installed but NOT enabled \u2014 fix the config error, then run "bccli plugins install {name}" again (safe to repeat), or add {entry} to {path} manually.': 'npm selesai tetapi pembaruan config gagal: {reason}. {name} terpasang tetapi TIDAK aktif \u2014 perbaiki error config, lalu jalankan lagi "bccli plugins install {name}" (aman diulang), atau tambahkan {entry} ke {path} secara manual.',
245
+ "{name} is already enabled.": "{name} sudah aktif.",
246
+ "{name} installed and enabled.": "{name} terpasang dan aktif.",
247
+ "Malformed managed entry: {entry} \u2014 fix it manually in {path}; bccli will not pass it to npm.": "Entry terelola rusak: {entry} \u2014 perbaiki manual di {path}; bccli tidak akan meneruskannya ke npm.",
248
+ "{entry} is a manual plugin entry \u2014 edit the global config.json directly to remove it.": "{entry} adalah entry plugin manual \u2014 edit config.json global langsung untuk menghapusnya.",
249
+ "{name} is not an installed managed plugin.": "{name} bukan plugin terelola yang terpasang.",
250
+ "Unknown plugin: {arg}.": "Plugin tidak dikenal: {arg}.",
251
+ "remove requires a plugin name: bccli plugins remove <name>": "remove butuh nama plugin: bccli plugins remove <nama>",
252
+ 'npm removed the files of {name} but the plugin config could not be read: {reason} \u2014 the entry list is unchanged; fix {path}, then run "bccli plugins remove {name}" again (safe to repeat).': 'npm sudah menghapus file {name} tetapi config plugin gagal dibaca: {reason} \u2014 daftar entry tidak berubah; perbaiki {path}, lalu jalankan lagi "bccli plugins remove {name}" (aman diulang).',
253
+ 'npm removed the files of {name} but the config entry {entry} remains: {reason}. bccli will refuse to start while that entry is listed \u2014 fix the config error at {path}, then run "bccli plugins remove {name}" again (safe to repeat), or delete the entry manually.': 'npm sudah menghapus file {name} tetapi entry config {entry} tertinggal: {reason}. bccli menolak start selama entry itu terdaftar \u2014 perbaiki error config di {path}, lalu jalankan lagi "bccli plugins remove {name}" (aman diulang), atau hapus entry secara manual.',
254
+ "Skipping malformed entry: {entry} \u2014 fix it manually in {path}.": "Melewatkan entry rusak: {entry} \u2014 perbaiki manual di {path}.",
255
+ "No managed plugins to update.": "Tidak ada plugin terelola untuk diperbarui.",
256
+ "update requires a plugin name or no argument: bccli plugins update [name]": "update butuh nama plugin atau tanpa argumen: bccli plugins update [nama]",
257
+ "{name} updated to latest.": "{name} diperbarui ke versi terbaru.",
258
+ "Use either --key or --logout, not both.": "Pakai --key atau --logout, jangan keduanya.",
259
+ "Logout is not supported for {id}; use bccli provider remove {id} to delete its stored key and config.": "Logout tidak didukung untuk {id}; pakai bccli provider remove {id} untuk menghapus key dan config tersimpan.",
260
+ "bccli login openrouter needs a terminal. Use --key to paste an API key instead.": "bccli login openrouter butuh terminal. Pakai --key untuk menempel API key.",
261
+ "Could not open the browser automatically \u2014 open this URL manually: {url}": "Tidak bisa membuka browser otomatis \u2014 buka URL ini manual: {url}",
262
+ "Paste the authorization code from the browser: ": "Tempel kode otorisasi dari browser: ",
263
+ "Failed to read the authorization code: {reason}. Your stored credential was not changed.": "Gagal membaca kode otorisasi: {reason}. Credential tersimpan tidak berubah.",
264
+ "Authorization code is empty. Run bccli login openrouter again.": "Kode otorisasi kosong. Jalankan bccli login openrouter lagi.",
265
+ "Login cancelled.": "Login dibatalkan.",
266
+ "The exchange with OpenRouter timed out after {seconds}s. Your stored credential was not changed.": "Pertukaran dengan OpenRouter habis waktu setelah {seconds} dtk. Credential tersimpan tidak berubah.",
267
+ "Could not reach OpenRouter: {reason}. Your stored credential was not changed.": "Tidak bisa menghubungi OpenRouter: {reason}. Credential tersimpan tidak berubah.",
268
+ "Authorization code expired \u2014 codes are valid for 10 minutes. Run bccli login openrouter again.": "Kode otorisasi kedaluwarsa \u2014 kode berlaku 10 menit. Jalankan bccli login openrouter lagi.",
269
+ "OpenRouter rejected the authorization code (403): {detail}. Run bccli login openrouter again.": "OpenRouter menolak kode otorisasi (403): {detail}. Jalankan bccli login openrouter lagi.",
270
+ "OpenRouter did not return an API key in the expected format. Your stored credential was not changed.": "OpenRouter tidak mengembalikan API key dengan format yang diharapkan. Credential tersimpan tidak berubah.",
271
+ "OpenRouter exchange failed ({status}): {detail}. Your stored credential was not changed.": "Pertukaran OpenRouter gagal ({status}): {detail}. Credential tersimpan tidak berubah.",
272
+ "The key was created on your OpenRouter account but could not be saved locally ({reason}). Manage it (copy or revoke) at {dashboard}, then run bccli login openrouter again.": "Key sudah dibuat di akun OpenRouter kamu tetapi gagal disimpan lokal ({reason}). Kelola (salin atau cabut) di {dashboard}, lalu jalankan bccli login openrouter lagi.",
273
+ "Logged in: openrouter credential saved.": "Login berhasil: credential openrouter tersimpan.",
274
+ "Note: {env} is set in the environment and takes priority over the stored credential.": "Catatan: {env} ter-set di environment dan lebih diutamakan daripada credential tersimpan.",
275
+ "Verify with: bccli models openrouter (your key is never printed).": "Verifikasi dengan: bccli models openrouter (key kamu tidak pernah dicetak).",
276
+ "openrouter credential removed.": "credential openrouter dihapus.",
277
+ "openrouter credential was not stored.": "credential openrouter tidak tersimpan.",
278
+ "Note: {env} is still set in the environment and will keep being used.": "Catatan: {env} masih ter-set di environment dan akan terus dipakai.",
279
+ "To revoke keys on your account, open {dashboard}.": "Untuk mencabut key akun kamu, buka {dashboard}.",
224
280
  "Budget exceeded ({kind}): {used} of {limit}. Further model calls are blocked; raise usageCap in ~/.bccli/config.json.": "Anggaran terlampaui ({kind}): {used} dari {limit}. Panggilan model selanjutnya diblokir; naikkan usageCap di ~/.bccli/config.json.",
225
281
  "Verifying edits: {cmds}": "Memverifikasi edit: {cmds}",
226
282
  "Verification passed.": "Verifikasi lulus.",
@@ -820,6 +876,8 @@ function parseCliArgs(argv) {
820
876
  name: { type: "string" },
821
877
  "key-env": { type: "string" },
822
878
  value: { type: "string", multiple: true },
879
+ key: { type: "boolean" },
880
+ logout: { type: "boolean" },
823
881
  port: { type: "string" },
824
882
  host: { type: "string" },
825
883
  token: { type: "string" },
@@ -840,7 +898,7 @@ function parseCliArgs(argv) {
840
898
  throw new ConfigError(t("--output-format must be one of: {formats}", { formats: "text, json, stream-json" }));
841
899
  }
842
900
  const [first, ...rest] = positionals;
843
- const SUBCOMMANDS = ["login", "models", "update", "acp", "serve", "provider", "mcp", "connect", "disconnect", "integrations"];
901
+ const SUBCOMMANDS = ["login", "models", "update", "acp", "serve", "plugins", "gh-bot", "provider", "mcp", "connect", "disconnect", "integrations"];
844
902
  const command = SUBCOMMANDS.includes(first) ? first : "run";
845
903
  const words2 = command === "run" ? positionals : rest;
846
904
  const port = values.port !== void 0 ? Number(values.port) : void 0;
@@ -867,7 +925,9 @@ function parseCliArgs(argv) {
867
925
  help: !!values.help,
868
926
  version: !!values.version,
869
927
  loginProvider: command === "login" ? rest[0] ?? "bc-cloud" : void 0,
870
- subArgs: ["models", "provider", "mcp", "connect", "disconnect", "integrations"].includes(command) ? rest : [],
928
+ key: !!values.key,
929
+ logout: !!values.logout,
930
+ subArgs: ["models", "plugins", "gh-bot", "provider", "mcp", "connect", "disconnect", "integrations"].includes(command) ? rest : [],
871
931
  url: values.url,
872
932
  name: values.name,
873
933
  keyEnv: values["key-env"],
@@ -1815,6 +1875,42 @@ function recoverTextToolCalls(text, tools) {
1815
1875
 
1816
1876
  // src/hooks.ts
1817
1877
  import { spawn } from "child_process";
1878
+
1879
+ // src/tools/shell.ts
1880
+ import { existsSync as existsSync2 } from "fs";
1881
+ import { win32 } from "path";
1882
+ var PS_PRELUDE = "[Console]::OutputEncoding=[Text.Encoding]::UTF8; $OutputEncoding=[Text.Encoding]::UTF8; ";
1883
+ var PS_EPILOGUE = "\nif ($LASTEXITCODE -ne $null) { exit $LASTEXITCODE } elseif (-not $?) { exit 1 }";
1884
+ function gitBashCandidates(env) {
1885
+ const roots = [env.ProgramW6432, env.ProgramFiles, env["ProgramFiles(x86)"], env.LOCALAPPDATA && win32.join(env.LOCALAPPDATA, "Programs")];
1886
+ const fromRoots = roots.filter((root) => !!root).map((root) => win32.join(root, "Git", "bin", "bash.exe"));
1887
+ const fromPath = (env.PATH ?? env.Path ?? "").split(";").filter(Boolean).map((dir) => win32.join(dir, "..", "bin", "bash.exe"));
1888
+ return [...fromRoots, ...fromPath];
1889
+ }
1890
+ function resolveShell(deps) {
1891
+ if (deps.platform !== "win32") return void 0;
1892
+ const bash = gitBashCandidates(deps.env).find((candidate) => deps.exists(candidate));
1893
+ if (bash) return { name: "bash", file: bash, args: (command) => ["-c", command] };
1894
+ return {
1895
+ name: "powershell",
1896
+ file: "powershell.exe",
1897
+ args: (command) => [
1898
+ "-NoProfile",
1899
+ "-NonInteractive",
1900
+ "-ExecutionPolicy",
1901
+ "Bypass",
1902
+ "-EncodedCommand",
1903
+ Buffer.from(PS_PRELUDE + command + PS_EPILOGUE, "utf16le").toString("base64")
1904
+ ]
1905
+ };
1906
+ }
1907
+ var cachedDefault = null;
1908
+ function defaultShell() {
1909
+ if (cachedDefault === null) cachedDefault = resolveShell({ platform: process.platform, env: process.env, exists: existsSync2 });
1910
+ return cachedDefault;
1911
+ }
1912
+
1913
+ // src/hooks.ts
1818
1914
  var DEFAULT_TIMEOUT_MS = 1e4;
1819
1915
  var MAX_CAPTURE = 8192;
1820
1916
  function globToRegExp(pattern) {
@@ -1842,8 +1938,18 @@ function runOne(command, event, payload, opts) {
1842
1938
  resolve4(result);
1843
1939
  };
1844
1940
  let child;
1941
+ const shell = defaultShell();
1845
1942
  try {
1846
- child = spawn(command, { shell: true, env, cwd: opts.cwd ?? process.cwd(), stdio: ["ignore", "pipe", "pipe"] });
1943
+ if (shell) {
1944
+ child = spawn(shell.file, shell.args(command), {
1945
+ shell: false,
1946
+ env,
1947
+ cwd: opts.cwd ?? process.cwd(),
1948
+ stdio: ["ignore", "pipe", "pipe"]
1949
+ });
1950
+ } else {
1951
+ child = spawn(command, { shell: true, env, cwd: opts.cwd ?? process.cwd(), stdio: ["ignore", "pipe", "pipe"] });
1952
+ }
1847
1953
  } catch (error) {
1848
1954
  resolve4({ failure: error.message });
1849
1955
  return;
@@ -1950,40 +2056,6 @@ function sandboxArgv(command, opts) {
1950
2056
  return void 0;
1951
2057
  }
1952
2058
 
1953
- // src/tools/shell.ts
1954
- import { existsSync as existsSync2 } from "fs";
1955
- import { win32 } from "path";
1956
- var PS_PRELUDE = "[Console]::OutputEncoding=[Text.Encoding]::UTF8; $OutputEncoding=[Text.Encoding]::UTF8; ";
1957
- var PS_EPILOGUE = "\nif ($LASTEXITCODE -ne $null) { exit $LASTEXITCODE } elseif (-not $?) { exit 1 }";
1958
- function gitBashCandidates(env) {
1959
- const roots = [env.ProgramW6432, env.ProgramFiles, env["ProgramFiles(x86)"], env.LOCALAPPDATA && win32.join(env.LOCALAPPDATA, "Programs")];
1960
- const fromRoots = roots.filter((root) => !!root).map((root) => win32.join(root, "Git", "bin", "bash.exe"));
1961
- const fromPath = (env.PATH ?? env.Path ?? "").split(";").filter(Boolean).map((dir) => win32.join(dir, "..", "bin", "bash.exe"));
1962
- return [...fromRoots, ...fromPath];
1963
- }
1964
- function resolveShell(deps) {
1965
- if (deps.platform !== "win32") return void 0;
1966
- const bash = gitBashCandidates(deps.env).find((candidate) => deps.exists(candidate));
1967
- if (bash) return { name: "bash", file: bash, args: (command) => ["-c", command] };
1968
- return {
1969
- name: "powershell",
1970
- file: "powershell.exe",
1971
- args: (command) => [
1972
- "-NoProfile",
1973
- "-NonInteractive",
1974
- "-ExecutionPolicy",
1975
- "Bypass",
1976
- "-EncodedCommand",
1977
- Buffer.from(PS_PRELUDE + command + PS_EPILOGUE, "utf16le").toString("base64")
1978
- ]
1979
- };
1980
- }
1981
- var cachedDefault = null;
1982
- function defaultShell() {
1983
- if (cachedDefault === null) cachedDefault = resolveShell({ platform: process.platform, env: process.env, exists: existsSync2 });
1984
- return cachedDefault;
1985
- }
1986
-
1987
2059
  // src/tools/types.ts
1988
2060
  function defineTool(tool) {
1989
2061
  return tool;
@@ -2070,8 +2142,8 @@ function startBackground(command, cwd, env, shell) {
2070
2142
  return task;
2071
2143
  }
2072
2144
  function backgroundStatus(task) {
2073
- if (task.status === "running") return `[running ${Math.round((Date.now() - task.startedAt) / 1e3)}s]`;
2074
2145
  if (task.killed) return "[killed]";
2146
+ if (task.status === "running") return `[running ${Math.round((Date.now() - task.startedAt) / 1e3)}s]`;
2075
2147
  return `[exit code ${task.exitCode}]`;
2076
2148
  }
2077
2149
  function backgroundOutput(task) {
@@ -2977,7 +3049,7 @@ var readTool = createReadTool({ vision: true });
2977
3049
  // src/tools/write.ts
2978
3050
  import { existsSync as existsSync4 } from "fs";
2979
3051
  import { mkdir, readFile as readFile4, writeFile as writeFile2 } from "fs/promises";
2980
- import { dirname } from "path";
3052
+ import { dirname as dirname2 } from "path";
2981
3053
  import { z as z7 } from "zod";
2982
3054
  var writeTool = defineTool({
2983
3055
  name: "write",
@@ -3004,7 +3076,7 @@ var writeTool = defineTool({
3004
3076
  }
3005
3077
  try {
3006
3078
  await ctx.checkpoint?.(abs);
3007
- await mkdir(dirname(abs), { recursive: true });
3079
+ await mkdir(dirname2(abs), { recursive: true });
3008
3080
  await writeFile2(abs, input.content);
3009
3081
  } catch (error) {
3010
3082
  return { output: `Failed to write ${input.path}: ${errorCode(error)}`, isError: true };
@@ -3643,7 +3715,7 @@ import { z as z9 } from "zod";
3643
3715
  // src/mcp/config.ts
3644
3716
  import { createHash } from "crypto";
3645
3717
  import { chmodSync as chmodSync2, existsSync as existsSync6, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
3646
- import { dirname as dirname2, join as join3, resolve as resolve3 } from "path";
3718
+ import { dirname as dirname3, join as join3, resolve as resolve3 } from "path";
3647
3719
  var ENV_REF = /\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-([^}]*))?\}/g;
3648
3720
  function expandEnvVars(config, env) {
3649
3721
  const expand = (value) => value.replace(ENV_REF, (match, name, fallback) => {
@@ -3667,7 +3739,7 @@ function expandEnvVars(config, env) {
3667
3739
  import { spawn as spawn3 } from "child_process";
3668
3740
  import { chmodSync as chmodSync3, existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
3669
3741
  import { createServer } from "http";
3670
- import { dirname as dirname3, join as join4 } from "path";
3742
+ import { dirname as dirname4, join as join4 } from "path";
3671
3743
  import { auth } from "@modelcontextprotocol/sdk/client/auth.js";
3672
3744
  var oauthStorePath = (home) => join4(home, "mcp-oauth.json");
3673
3745
  function readStore(home) {
@@ -3681,7 +3753,7 @@ function readStore(home) {
3681
3753
  }
3682
3754
  function writeStore(home, store) {
3683
3755
  const path = oauthStorePath(home);
3684
- mkdirSync3(dirname3(path), { recursive: true });
3756
+ mkdirSync3(dirname4(path), { recursive: true });
3685
3757
  writeFileSync3(path, `${JSON.stringify(store, null, 2)}
3686
3758
  `, { mode: 384 });
3687
3759
  chmodSync3(path, 384);
@@ -3937,7 +4009,7 @@ import { homedir as homedir2 } from "os";
3937
4009
 
3938
4010
  // src/context.ts
3939
4011
  import { existsSync as existsSync8, readFileSync as readFileSync5 } from "fs";
3940
- import { dirname as dirname4, join as join5 } from "path";
4012
+ import { dirname as dirname5, join as join5 } from "path";
3941
4013
  var FILES = ["AGENTS.md", "BCCLI.md"];
3942
4014
  function readIf(path) {
3943
4015
  try {
@@ -3948,9 +4020,9 @@ function readIf(path) {
3948
4020
  }
3949
4021
  function instructionPaths(cwd, home) {
3950
4022
  const dirs2 = [];
3951
- for (let dir = cwd; ; dir = dirname4(dir)) {
4023
+ for (let dir = cwd; ; dir = dirname5(dir)) {
3952
4024
  dirs2.unshift(dir);
3953
- if (dirname4(dir) === dir) break;
4025
+ if (dirname5(dir) === dir) break;
3954
4026
  }
3955
4027
  return [join5(home, "BCCLI.md"), ...dirs2.flatMap((dir) => FILES.map((name) => join5(dir, name)))];
3956
4028
  }
@@ -3964,9 +4036,9 @@ ${text}`);
3964
4036
  return parts.join("\n\n");
3965
4037
  }
3966
4038
  function isGitRepo(cwd) {
3967
- for (let dir = cwd; ; dir = dirname4(dir)) {
4039
+ for (let dir = cwd; ; dir = dirname5(dir)) {
3968
4040
  if (existsSync8(join5(dir, ".git"))) return true;
3969
- if (dirname4(dir) === dir) return false;
4041
+ if (dirname5(dir) === dir) return false;
3970
4042
  }
3971
4043
  }
3972
4044
  function buildSystemPrompt(opts) {
@@ -4151,7 +4223,7 @@ async function addProviderKey(providerId, key, deps) {
4151
4223
 
4152
4224
  // src/session.ts
4153
4225
  import { randomBytes as randomBytes2 } from "crypto";
4154
- import { appendFileSync, existsSync as existsSync10, mkdirSync as mkdirSync5, readdirSync as readdirSync2, readFileSync as readFileSync7, rmSync, statSync as statSync3 } from "fs";
4226
+ import { appendFileSync, existsSync as existsSync10, mkdirSync as mkdirSync5, readdirSync as readdirSync2, readFileSync as readFileSync7, rmSync as rmSync2, statSync as statSync3 } from "fs";
4155
4227
  import { join as join8 } from "path";
4156
4228
  function projectDir(home, cwd) {
4157
4229
  const slug = cwd.replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(-100) || "root";
@@ -4871,6 +4943,8 @@ function createRuntime(opts) {
4871
4943
  apiKey: resolved.apiKey,
4872
4944
  model: resolved.model,
4873
4945
  providerId: resolved.providerId,
4946
+ fetch: opts.fetch,
4947
+ // diteruskan penuh (spec gh-bot §6.6 — juga memperbaiki sdk fetch-injection)
4874
4948
  enableProgrammaticToolCalling: lunaPtcAutoEnabled(env)
4875
4949
  });
4876
4950
  };
@@ -4955,7 +5029,7 @@ function createRuntime(opts) {
4955
5029
  cwd: opts.cwd,
4956
5030
  history,
4957
5031
  reasoning,
4958
- maxSteps: config.maxSteps,
5032
+ maxSteps: opts.maxSteps ?? config.maxSteps,
4959
5033
  hooks: config.hooks,
4960
5034
  pluginEmit,
4961
5035
  env,
@@ -3,15 +3,15 @@ import {
3
3
  createFetchTool,
4
4
  createWebSearchTool,
5
5
  isPrivateHost
6
- } from "./chunk-HE33XAPZ.js";
6
+ } from "./chunk-QZM66F3A.js";
7
7
  import "./chunk-PSO7R5AD.js";
8
8
  import {
9
9
  loadConfig,
10
10
  readCredentials
11
- } from "./chunk-M7LLJQ7M.js";
11
+ } from "./chunk-AGIZBZ64.js";
12
12
  import {
13
13
  t
14
- } from "./chunk-M23QBX3V.js";
14
+ } from "./chunk-VBEX5YHF.js";
15
15
 
16
16
  // src/mcpServer/serve.ts
17
17
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -1,7 +1,13 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ createRuntime
4
+ } from "./chunk-HQB227LD.js";
5
+ import "./chunk-DRK3XTVZ.js";
6
+ import "./chunk-QZM66F3A.js";
7
+ import "./chunk-PSO7R5AD.js";
2
8
  import {
3
9
  VERSION
4
- } from "./chunk-EQQTTE2K.js";
10
+ } from "./chunk-Q2ZBR4OU.js";
5
11
  import {
6
12
  LOOPBACK_BIND,
7
13
  MAX_FRAME_BYTES,
@@ -10,31 +16,25 @@ import {
10
16
  parseClientFrame,
11
17
  randomToken,
12
18
  trustFence
13
- } from "./chunk-AS7VV7D3.js";
14
- import {
15
- createRuntime
16
- } from "./chunk-M4IYXI3V.js";
17
- import "./chunk-3HCOAJEQ.js";
18
- import "./chunk-DBHDZ5EP.js";
19
+ } from "./chunk-ADS5FDWL.js";
19
20
  import "./chunk-GAFJEQTJ.js";
20
- import "./chunk-JROUQ5YS.js";
21
+ import "./chunk-A2XKKKKU.js";
21
22
  import {
22
23
  listAllModels
23
- } from "./chunk-LN32JIZR.js";
24
- import "./chunk-SESBH44L.js";
24
+ } from "./chunk-LYFN6AEV.js";
25
+ import "./chunk-I422TPGX.js";
26
+ import "./chunk-7F3IWBPQ.js";
25
27
  import {
26
28
  Session
27
- } from "./chunk-VM7HYAJS.js";
28
- import "./chunk-GGNXHJL6.js";
29
- import "./chunk-NI5JZUZ3.js";
30
- import "./chunk-AVB6M4JE.js";
31
- import "./chunk-HE33XAPZ.js";
32
- import "./chunk-PSO7R5AD.js";
29
+ } from "./chunk-HVGXCPDG.js";
30
+ import "./chunk-LYQHLA43.js";
31
+ import "./chunk-AWNQDAOY.js";
32
+ import "./chunk-NFJPKNHL.js";
33
33
  import {
34
34
  bccliHome,
35
35
  loadConfig
36
- } from "./chunk-M7LLJQ7M.js";
37
- import "./chunk-M23QBX3V.js";
36
+ } from "./chunk-AGIZBZ64.js";
37
+ import "./chunk-VBEX5YHF.js";
38
38
 
39
39
  // src/serve.ts
40
40
  import { randomBytes } from "crypto";
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ Session,
4
+ pruneSessions
5
+ } from "./chunk-HVGXCPDG.js";
6
+ import "./chunk-LYQHLA43.js";
7
+ import "./chunk-AWNQDAOY.js";
8
+ import "./chunk-VBEX5YHF.js";
9
+ export {
10
+ Session,
11
+ pruneSessions
12
+ };
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ createRuntime,
4
+ lunaPtcAutoEnabled
5
+ } from "./chunk-HQB227LD.js";
6
+ import "./chunk-DRK3XTVZ.js";
7
+ import "./chunk-QZM66F3A.js";
8
+ import "./chunk-PSO7R5AD.js";
9
+ import "./chunk-GAFJEQTJ.js";
10
+ import "./chunk-A2XKKKKU.js";
11
+ import "./chunk-LYFN6AEV.js";
12
+ import "./chunk-I422TPGX.js";
13
+ import "./chunk-7F3IWBPQ.js";
14
+ import "./chunk-HVGXCPDG.js";
15
+ import "./chunk-LYQHLA43.js";
16
+ import "./chunk-AWNQDAOY.js";
17
+ import "./chunk-NFJPKNHL.js";
18
+ import "./chunk-AGIZBZ64.js";
19
+ import "./chunk-VBEX5YHF.js";
20
+ export {
21
+ createRuntime,
22
+ lunaPtcAutoEnabled
23
+ };
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  CATALOG,
4
4
  fillTemplate
5
- } from "./chunk-ISCT3PN3.js";
5
+ } from "./chunk-3P5N6UPF.js";
6
6
  import {
7
7
  MAX_VERIFY_ROUNDS,
8
8
  runVerify,
9
9
  toolLabel,
10
10
  verifyFollowup,
11
11
  worktreeListText
12
- } from "./chunk-BUHWQU3V.js";
12
+ } from "./chunk-O74EQFYI.js";
13
13
  import {
14
14
  BUILTIN_AGENTS,
15
15
  appendMemory,
@@ -21,7 +21,8 @@ import {
21
21
  renderBackgroundTasks,
22
22
  runHooks,
23
23
  validateGlobPattern
24
- } from "./chunk-DBHDZ5EP.js";
24
+ } from "./chunk-DRK3XTVZ.js";
25
+ import "./chunk-PSO7R5AD.js";
25
26
  import {
26
27
  nextMode
27
28
  } from "./chunk-GAFJEQTJ.js";
@@ -29,40 +30,39 @@ import {
29
30
  hasKey,
30
31
  providerName,
31
32
  writeGlobalConfig
32
- } from "./chunk-SESBH44L.js";
33
+ } from "./chunk-I422TPGX.js";
33
34
  import {
34
35
  Session
35
- } from "./chunk-VM7HYAJS.js";
36
+ } from "./chunk-HVGXCPDG.js";
36
37
  import {
37
38
  contentText
38
- } from "./chunk-GGNXHJL6.js";
39
+ } from "./chunk-LYQHLA43.js";
39
40
  import {
40
41
  REASONING_LEVELS,
41
42
  assertReasoningSupported,
42
43
  parseReasoningLevel,
43
44
  supportedReasoningLevels
44
- } from "./chunk-NI5JZUZ3.js";
45
+ } from "./chunk-AWNQDAOY.js";
45
46
  import {
46
47
  addGlobalServer,
47
48
  globalMcpPath,
48
49
  readMcpFile,
49
50
  removeGlobalServer
50
- } from "./chunk-AVB6M4JE.js";
51
- import "./chunk-PSO7R5AD.js";
51
+ } from "./chunk-NFJPKNHL.js";
52
52
  import {
53
53
  ACCENT,
54
54
  PRESETS,
55
55
  color,
56
56
  matchKeybind,
57
57
  removeCredential
58
- } from "./chunk-M7LLJQ7M.js";
58
+ } from "./chunk-AGIZBZ64.js";
59
59
  import {
60
60
  getLanguage,
61
61
  locale,
62
62
  parseLang,
63
63
  setLanguage,
64
64
  t
65
- } from "./chunk-M23QBX3V.js";
65
+ } from "./chunk-VBEX5YHF.js";
66
66
 
67
67
  // src/ui/index.tsx
68
68
  import { render } from "ink";
@@ -2239,7 +2239,7 @@ ${t2.output}`);
2239
2239
  import { jsx as jsx17 } from "react/jsx-runtime";
2240
2240
  async function startInteractive(rt, opts) {
2241
2241
  if (opts.resume) {
2242
- const { Session: Session2 } = await import("./session-H2YL5RSB.js");
2242
+ const { Session: Session2 } = await import("./session-VKVBMGCC.js");
2243
2243
  const list = Session2.list(rt.home, rt.cwd).slice(0, 20);
2244
2244
  if (!list.length) console.log(t("No sessions in this folder yet; starting a new one."));
2245
2245
  else {
@@ -2254,7 +2254,7 @@ async function startInteractive(rt, opts) {
2254
2254
  if (chosen) rt.resume(chosen.session);
2255
2255
  }
2256
2256
  }
2257
- const { serversToStart, setProjectTrust } = await import("./config-C4KLLDC6.js");
2257
+ const { serversToStart, setProjectTrust } = await import("./config-LFT2FNSE.js");
2258
2258
  const plan = serversToStart(rt.home, rt.cwd);
2259
2259
  if (plan.needTrust.length) {
2260
2260
  const { createInterface } = await import("readline/promises");
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-EQQTTE2K.js";
4
+ } from "./chunk-Q2ZBR4OU.js";
5
5
  import {
6
6
  t
7
- } from "./chunk-M23QBX3V.js";
7
+ } from "./chunk-VBEX5YHF.js";
8
8
 
9
9
  // src/update.ts
10
10
  import { spawnSync } from "child_process";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botconnector/bccli",
3
- "version": "0.4.0-beta.41",
3
+ "version": "0.4.0-beta.42",
4
4
  "description": "BCCLI — BotConnector AI coding agent for the terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // src/login.ts
4
- function readSecret(prompt) {
5
- return new Promise((resolve) => {
6
- process.stdout.write(prompt);
7
- const stdin = process.stdin;
8
- if (!stdin.isTTY) {
9
- let data = "";
10
- stdin.on("data", (d) => {
11
- data += d;
12
- });
13
- stdin.on("end", () => resolve(data.trim()));
14
- return;
15
- }
16
- let value = "";
17
- stdin.setRawMode(true);
18
- stdin.resume();
19
- const onData = (buffer) => {
20
- for (const ch of buffer.toString()) {
21
- if (ch === "\r" || ch === "\n") {
22
- stdin.setRawMode(false);
23
- stdin.pause();
24
- stdin.off("data", onData);
25
- process.stdout.write("\n");
26
- resolve(value.trim());
27
- return;
28
- }
29
- if (ch === "") process.exit(130);
30
- if (ch === "\x7F" || ch === "\b") value = value.slice(0, -1);
31
- else value += ch;
32
- }
33
- };
34
- stdin.on("data", onData);
35
- });
36
- }
37
- async function runLogin(providerId, cwd) {
38
- const { runProviderCommand } = await import("./providerCli-DDH4ZZUY.js");
39
- const { parseCliArgs } = await import("./args-4SMOHFN5.js");
40
- return runProviderCommand(parseCliArgs(["provider", "add", providerId]), {
41
- env: process.env,
42
- cwd,
43
- out: (s) => console.log(s),
44
- err: (s) => console.error(s),
45
- readSecret
46
- });
47
- }
48
-
49
- export {
50
- readSecret,
51
- runLogin
52
- };
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- readSecret,
4
- runLogin
5
- } from "./chunk-DSFHN5CH.js";
6
- export {
7
- readSecret,
8
- runLogin
9
- };
@@ -1,15 +0,0 @@
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
- };