@botconnector/bccli 0.4.1 → 0.4.2

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 (69) hide show
  1. package/dist/{acp-3PHBAI64.js → acp-UYC6APR5.js} +30 -6
  2. package/dist/acp.d.ts +1 -0
  3. package/dist/agent.d.ts +5 -1
  4. package/dist/args-NRTZWWEV.js +13 -0
  5. package/dist/args.d.ts +2 -0
  6. package/dist/checkpoints.d.ts +1 -0
  7. package/dist/{chunk-BKGFA2PT.js → chunk-266SY3MC.js} +1 -1
  8. package/dist/{chunk-MFHCQQEN.js → chunk-3I5BW3ZT.js} +3 -2
  9. package/dist/{chunk-UZWJQF67.js → chunk-3WHI4LN3.js} +2 -1
  10. package/dist/{chunk-WNACAUDK.js → chunk-5YJ3ZQVR.js} +66 -9
  11. package/dist/{chunk-24JN75FZ.js → chunk-6M55UPES.js} +2 -2
  12. package/dist/{chunk-XV7ZVL4J.js → chunk-6UO5GX55.js} +26 -12
  13. package/dist/{chunk-R5RE46CW.js → chunk-C64KM37J.js} +36 -6
  14. package/dist/{chunk-GN4W3T6E.js → chunk-H7XJDKJY.js} +4 -4
  15. package/dist/{chunk-JHPGOAXU.js → chunk-HQW4BROS.js} +4 -5
  16. package/dist/{chunk-75BECX4F.js → chunk-IYR5PYA3.js} +4 -4
  17. package/dist/{chunk-45SDLMTV.js → chunk-JXM6REER.js} +1 -1
  18. package/dist/{chunk-BLOYFIAD.js → chunk-KPTML72Q.js} +1 -1
  19. package/dist/{chunk-WI22M2ID.js → chunk-NQOGVP3I.js} +2 -2
  20. package/dist/{chunk-QZKLZELZ.js → chunk-OK2USAXX.js} +28 -4
  21. package/dist/{chunk-PZRKU4UM.js → chunk-R72OV7RF.js} +421 -108
  22. package/dist/{chunk-FLQPE4S5.js → chunk-RX4UQX43.js} +4 -1
  23. package/dist/{chunk-BC7UXFE4.js → chunk-SVD4LHJC.js} +64 -3
  24. package/dist/{chunk-BXQQCUAC.js → chunk-TIMSYZIR.js} +7 -7
  25. package/dist/{chunk-MHIYLXJC.js → chunk-WFZKJY3R.js} +8 -4
  26. package/dist/{chunk-BGXNR74O.js → chunk-ZEPTUKNW.js} +119 -31
  27. package/dist/cli.js +60 -43
  28. package/dist/{completion-HPPFDAPB.js → completion-D2BSBTQO.js} +1 -1
  29. package/dist/{config-DIDLDONU.js → config-ENDRMOTP.js} +3 -3
  30. package/dist/{config-IU76CPK2.js → config-LAINORU5.js} +2 -2
  31. package/dist/config.d.ts +2 -0
  32. package/dist/{ghBotCli-E3VPHNZY.js → ghBotCli-TSLRORJJ.js} +21 -20
  33. package/dist/{integrationCli-Q2YPDTPG.js → integrationCli-HXCSEWH2.js} +2 -2
  34. package/dist/{login-FP3BB44A.js → login-RYESFZG6.js} +4 -4
  35. package/dist/lsp.d.ts +3 -0
  36. package/dist/mcp/manager.d.ts +18 -0
  37. package/dist/{mcpCli-SNBDUWJN.js → mcpCli-SETTCL3K.js} +6 -6
  38. package/dist/{modelsCli-CZ2HNGKR.js → modelsCli-OP7CDZC7.js} +6 -6
  39. package/dist/{oauthLogin-6FWQABJ7.js → oauthLogin-XWY7OHCG.js} +1 -1
  40. package/dist/{pluginsCli-LPIUUDWB.js → pluginsCli-ZQNKWZHJ.js} +2 -2
  41. package/dist/{prCli-5IMV3VNQ.js → prCli-6PUWTMTP.js} +20 -4
  42. package/dist/prCli.d.ts +13 -0
  43. package/dist/print.d.ts +2 -0
  44. package/dist/provider.d.ts +5 -0
  45. package/dist/providerCli-5OZI2GQQ.js +15 -0
  46. package/dist/sdk.d.ts +5 -1
  47. package/dist/sdk.js +733 -176
  48. package/dist/{serve-X2ZV4S5U.js → serve-4J7HA4JO.js} +17 -17
  49. package/dist/{serve-KWOECK5W.js → serve-K5AH4MGO.js} +3 -3
  50. package/dist/session-YQXCCKXI.js +12 -0
  51. package/dist/session.d.ts +3 -0
  52. package/dist/setup-S4AJT6XE.js +24 -0
  53. package/dist/slash/info.d.ts +1 -0
  54. package/dist/{statsCli-CF3R7ATL.js → statsCli-XR6BEZQQ.js} +2 -2
  55. package/dist/tokenBudget.d.ts +1 -1
  56. package/dist/tools/edit.d.ts +7 -2
  57. package/dist/tools/grep.d.ts +14 -2
  58. package/dist/tools/ignore.d.ts +2 -2
  59. package/dist/tools/paths.d.ts +2 -0
  60. package/dist/{transferCli-YUFPI6AH.js → transferCli-R2KEIWQR.js} +8 -6
  61. package/dist/ui/complete.d.ts +5 -0
  62. package/dist/ui/vim.d.ts +1 -1
  63. package/dist/{ui-IVIFNUCC.js → ui-36ZEK65V.js} +177 -54
  64. package/dist/{update-TZ2G6KQ3.js → update-FSS7X5WV.js} +2 -2
  65. package/package.json +1 -1
  66. package/dist/args-W6BNKY7K.js +0 -13
  67. package/dist/providerCli-NMUFXAAS.js +0 -15
  68. package/dist/session-GKEXDJKZ.js +0 -12
  69. package/dist/setup-OV3NWQN5.js +0 -24
package/dist/cli.js CHANGED
@@ -1,48 +1,49 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ resolvePrintPrompt,
3
4
  resolveWorktree,
4
5
  runPrint
5
- } from "./chunk-R5RE46CW.js";
6
+ } from "./chunk-C64KM37J.js";
6
7
  import {
7
8
  createRuntime
8
- } from "./chunk-PZRKU4UM.js";
9
- import "./chunk-QZKLZELZ.js";
10
- import "./chunk-BGXNR74O.js";
11
- import "./chunk-45SDLMTV.js";
9
+ } from "./chunk-R72OV7RF.js";
10
+ import "./chunk-OK2USAXX.js";
11
+ import "./chunk-ZEPTUKNW.js";
12
+ import "./chunk-JXM6REER.js";
12
13
  import "./chunk-PSO7R5AD.js";
13
14
  import {
14
15
  VERSION
15
- } from "./chunk-BKGFA2PT.js";
16
+ } from "./chunk-266SY3MC.js";
16
17
  import {
17
18
  helpText,
18
19
  parseCliArgs
19
- } from "./chunk-XV7ZVL4J.js";
20
- import "./chunk-MHIYLXJC.js";
21
- import "./chunk-GN4W3T6E.js";
22
- import "./chunk-75BECX4F.js";
20
+ } from "./chunk-6UO5GX55.js";
21
+ import "./chunk-WFZKJY3R.js";
22
+ import "./chunk-H7XJDKJY.js";
23
+ import "./chunk-IYR5PYA3.js";
23
24
  import {
24
25
  readGlobalConfigFile
25
- } from "./chunk-JHPGOAXU.js";
26
+ } from "./chunk-HQW4BROS.js";
26
27
  import {
27
28
  defaultLoginDeps,
28
29
  runLogin
29
- } from "./chunk-BXQQCUAC.js";
30
- import "./chunk-MFHCQQEN.js";
30
+ } from "./chunk-TIMSYZIR.js";
31
+ import "./chunk-3I5BW3ZT.js";
31
32
  import {
32
33
  pruneSessions
33
- } from "./chunk-BC7UXFE4.js";
34
- import "./chunk-WNACAUDK.js";
35
- import "./chunk-BLOYFIAD.js";
36
- import "./chunk-24JN75FZ.js";
34
+ } from "./chunk-SVD4LHJC.js";
35
+ import "./chunk-5YJ3ZQVR.js";
36
+ import "./chunk-KPTML72Q.js";
37
+ import "./chunk-6M55UPES.js";
37
38
  import {
38
39
  ConfigError,
39
40
  setTheme
40
- } from "./chunk-FLQPE4S5.js";
41
+ } from "./chunk-RX4UQX43.js";
41
42
  import {
42
43
  resolveLanguage,
43
44
  setLanguage,
44
45
  t
45
- } from "./chunk-UZWJQF67.js";
46
+ } from "./chunk-3WHI4LN3.js";
46
47
 
47
48
  // src/exit.ts
48
49
  var EXIT_GRACE_MS = 1e3;
@@ -84,17 +85,17 @@ async function main() {
84
85
  if (args.worktree) cwd = (await resolveWorktree(cwd, args.worktree)).path;
85
86
  if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd, args, defaultLoginDeps());
86
87
  if (args.command === "mcp") {
87
- const { runMcpCommand } = await import("./mcpCli-SNBDUWJN.js");
88
- const { readSecret } = await import("./login-FP3BB44A.js");
88
+ const { runMcpCommand } = await import("./mcpCli-SETTCL3K.js");
89
+ const { readSecret } = await import("./login-RYESFZG6.js");
89
90
  return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
90
91
  }
91
92
  if (args.command === "provider") {
92
- const { runProviderCommand } = await import("./providerCli-NMUFXAAS.js");
93
- const { readSecret } = await import("./login-FP3BB44A.js");
93
+ const { runProviderCommand } = await import("./providerCli-5OZI2GQQ.js");
94
+ const { readSecret } = await import("./login-RYESFZG6.js");
94
95
  return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
95
96
  }
96
97
  if (args.command === "connect" || args.command === "disconnect" || args.command === "integrations") {
97
- const { runIntegrationCommand } = await import("./integrationCli-Q2YPDTPG.js");
98
+ const { runIntegrationCommand } = await import("./integrationCli-HXCSEWH2.js");
98
99
  return runIntegrationCommand(args, {
99
100
  env: process.env,
100
101
  cwd,
@@ -104,20 +105,20 @@ async function main() {
104
105
  });
105
106
  }
106
107
  if (args.command === "models") {
107
- const { runModelsCommand } = await import("./modelsCli-CZ2HNGKR.js");
108
+ const { runModelsCommand } = await import("./modelsCli-OP7CDZC7.js");
108
109
  return runModelsCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), fetch: globalThis.fetch });
109
110
  }
110
111
  if (args.command === "update") {
111
- const { runUpdateCommand } = await import("./update-TZ2G6KQ3.js");
112
+ const { runUpdateCommand } = await import("./update-FSS7X5WV.js");
112
113
  return runUpdateCommand({ env: process.env });
113
114
  }
114
115
  if (args.command === "acp") {
115
- const { runtimeAgent, runAcp } = await import("./acp-3PHBAI64.js");
116
+ const { runtimeAgent, runAcp } = await import("./acp-UYC6APR5.js");
116
117
  await runAcp(process.stdin, process.stdout, { cwd, newAgent: (c) => runtimeAgent(c, args.allowAll) });
117
118
  return 0;
118
119
  }
119
120
  if (args.command === "serve") {
120
- const { serveBanner, startServe } = await import("./serve-X2ZV4S5U.js");
121
+ const { serveBanner, startServe } = await import("./serve-4J7HA4JO.js");
121
122
  const handle = await startServe({ port: args.port, host: args.host, token: args.token, cwd, env: process.env });
122
123
  process.stderr.write(serveBanner(handle, { token: args.token }));
123
124
  await new Promise((resolve) => {
@@ -130,8 +131,8 @@ async function main() {
130
131
  return 0;
131
132
  }
132
133
  if (args.command === "plugins") {
133
- const { runPluginsCommand } = await import("./pluginsCli-LPIUUDWB.js");
134
- const { readGlobalPlugins, updateGlobalConfig } = await import("./config-IU76CPK2.js");
134
+ const { runPluginsCommand } = await import("./pluginsCli-ZQNKWZHJ.js");
135
+ const { readGlobalPlugins, updateGlobalConfig } = await import("./config-LAINORU5.js");
135
136
  const { runNpmSync } = await import("./npmRunner-LU43GM3W.js");
136
137
  return runPluginsCommand(args, {
137
138
  out: (s) => console.log(s),
@@ -145,32 +146,41 @@ async function main() {
145
146
  });
146
147
  }
147
148
  if (args.command === "gh-bot") {
148
- const { runGhBotCommand } = await import("./ghBotCli-E3VPHNZY.js");
149
+ const { runGhBotCommand } = await import("./ghBotCli-TSLRORJJ.js");
149
150
  return runGhBotCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s) });
150
151
  }
151
152
  if (args.command === "completion") {
152
- const { runCompletionCommand } = await import("./completion-HPPFDAPB.js");
153
+ const { runCompletionCommand } = await import("./completion-D2BSBTQO.js");
153
154
  return runCompletionCommand(args, { out: (s) => console.log(s), err: (s) => console.error(s) });
154
155
  }
155
156
  if (args.command === "stats") {
156
- const { runStatsCommand } = await import("./statsCli-CF3R7ATL.js");
157
- const { bccliHome } = await import("./config-IU76CPK2.js");
157
+ const { runStatsCommand } = await import("./statsCli-XR6BEZQQ.js");
158
+ const { bccliHome } = await import("./config-LAINORU5.js");
158
159
  return runStatsCommand(
159
160
  { subArgs: args.subArgs, home: bccliHome(process.env), cwd, days: args.days, tools: args.tools, models: args.models, project: args.project },
160
161
  { out: (s) => console.log(s), err: (s) => console.error(s) }
161
162
  );
162
163
  }
163
164
  if (args.command === "export" || args.command === "import") {
164
- const { runExportCommand, runImportCommand } = await import("./transferCli-YUFPI6AH.js");
165
- const { bccliHome } = await import("./config-IU76CPK2.js");
165
+ const { runExportCommand, runImportCommand } = await import("./transferCli-R2KEIWQR.js");
166
+ const { bccliHome } = await import("./config-LAINORU5.js");
166
167
  const deps = { subArgs: args.subArgs, home: bccliHome(process.env), cwd };
167
168
  const io = { out: (s) => console.log(s), err: (s) => console.error(s) };
168
169
  return args.command === "export" ? runExportCommand(deps, io) : runImportCommand(deps, io);
169
170
  }
170
171
  if (args.command === "pr") {
171
- const { runPrCommand } = await import("./prCli-5IMV3VNQ.js");
172
+ const { runPrCommand } = await import("./prCli-6PUWTMTP.js");
172
173
  return runPrCommand(
173
- { subArgs: args.subArgs, cwd, allowAll: args.allowAll },
174
+ {
175
+ subArgs: args.subArgs,
176
+ cwd,
177
+ allowAll: args.allowAll,
178
+ repo: args.repo,
179
+ model: args.model,
180
+ reasoning: args.reasoning,
181
+ permissionMode: args.permissionMode,
182
+ allowedTools: args.allowedTools
183
+ },
174
184
  { out: (s) => console.log(s), err: (s) => console.error(s) }
175
185
  );
176
186
  }
@@ -181,15 +191,22 @@ async function main() {
181
191
  } catch {
182
192
  }
183
193
  if (args.print) {
184
- if (!args.prompt) throw new ConfigError(t('-p mode needs a task, e.g. bccli -p "explain this repo"'));
185
- const { serversToStart } = await import("./config-DIDLDONU.js");
194
+ let stdinText;
195
+ if (!process.stdin.isTTY) {
196
+ const chunks = [];
197
+ for await (const chunk of process.stdin) chunks.push(Buffer.from(chunk));
198
+ if (chunks.length) stdinText = Buffer.concat(chunks).toString("utf8");
199
+ }
200
+ const finalPrompt = resolvePrintPrompt(args.prompt, stdinText);
201
+ if (!finalPrompt) throw new ConfigError(t('-p mode needs a task, e.g. bccli -p "explain this repo"'));
202
+ const { serversToStart } = await import("./config-ENDRMOTP.js");
186
203
  const plan = serversToStart(rt.home, cwd);
187
204
  for (const s of plan.needTrust) {
188
205
  console.error(t('Project MCP server "{name}" skipped (not approved yet; run interactive bccli once to approve it).', { name: s.name }));
189
206
  }
190
207
  await rt.startMcp(plan.start);
191
208
  try {
192
- return await runPrint(rt, args.prompt, void 0, { allowAll: args.allowAll, outputFormat: args.outputFormat });
209
+ return await runPrint(rt, finalPrompt, void 0, { allowAll: args.allowAll, outputFormat: args.outputFormat });
193
210
  } finally {
194
211
  await rt.mcp.stop();
195
212
  }
@@ -198,13 +215,13 @@ async function main() {
198
215
  let updateMessage;
199
216
  if (rt.config.updateCheck !== "off" && !process.env.BCCLI_NO_UPDATE_CHECK) {
200
217
  try {
201
- const { checkForUpdate } = await import("./update-TZ2G6KQ3.js");
218
+ const { checkForUpdate } = await import("./update-FSS7X5WV.js");
202
219
  const update = await checkForUpdate({ home: rt.home, fetch: globalThis.fetch, now: /* @__PURE__ */ new Date() });
203
220
  updateMessage = update;
204
221
  } catch {
205
222
  }
206
223
  }
207
- const { startInteractive } = await import("./ui-IVIFNUCC.js");
224
+ const { startInteractive } = await import("./ui-36ZEK65V.js");
208
225
  return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION, updateMessage });
209
226
  }
210
227
  main().then(
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  t
4
- } from "./chunk-UZWJQF67.js";
4
+ } from "./chunk-3WHI4LN3.js";
5
5
 
6
6
  // src/completion.ts
7
7
  var SHELLS = ["bash", "zsh", "fish", "powershell"];
@@ -9,9 +9,9 @@ import {
9
9
  removeGlobalServer,
10
10
  serversToStart,
11
11
  setProjectTrust
12
- } from "./chunk-24JN75FZ.js";
13
- import "./chunk-FLQPE4S5.js";
14
- import "./chunk-UZWJQF67.js";
12
+ } from "./chunk-6M55UPES.js";
13
+ import "./chunk-RX4UQX43.js";
14
+ import "./chunk-3WHI4LN3.js";
15
15
  export {
16
16
  addGlobalServer,
17
17
  expandEnvVars,
@@ -14,8 +14,8 @@ import {
14
14
  saveCredential,
15
15
  updateGlobalConfig,
16
16
  writeFileAtomic
17
- } from "./chunk-FLQPE4S5.js";
18
- import "./chunk-UZWJQF67.js";
17
+ } from "./chunk-RX4UQX43.js";
18
+ import "./chunk-3WHI4LN3.js";
19
19
  export {
20
20
  ConfigError,
21
21
  DEFAULT_MAX_STEPS,
package/dist/config.d.ts CHANGED
@@ -12,6 +12,8 @@ export interface ProviderConfig {
12
12
  }
13
13
  export interface Config {
14
14
  model: string;
15
+ /** Optional list of fallback model refs tried in order on 429 / 5xx / connection errors. */
16
+ fallbackModels?: string[];
15
17
  permissionMode: PermissionMode;
16
18
  reasoning: ReasoningLevel;
17
19
  /** Show provider-supplied reasoning summaries in the TUI. Global setting only. */
@@ -1,32 +1,32 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createRuntime
4
- } from "./chunk-PZRKU4UM.js";
5
- import "./chunk-QZKLZELZ.js";
6
- import "./chunk-BGXNR74O.js";
7
- import "./chunk-45SDLMTV.js";
4
+ } from "./chunk-R72OV7RF.js";
5
+ import "./chunk-OK2USAXX.js";
6
+ import "./chunk-ZEPTUKNW.js";
7
+ import "./chunk-JXM6REER.js";
8
8
  import "./chunk-PSO7R5AD.js";
9
9
  import {
10
10
  LOOPBACK_BIND,
11
11
  parseCliArgs
12
- } from "./chunk-XV7ZVL4J.js";
13
- import "./chunk-MHIYLXJC.js";
14
- import "./chunk-GN4W3T6E.js";
15
- import "./chunk-75BECX4F.js";
16
- import "./chunk-JHPGOAXU.js";
17
- import "./chunk-MFHCQQEN.js";
18
- import "./chunk-BC7UXFE4.js";
19
- import "./chunk-WNACAUDK.js";
20
- import "./chunk-BLOYFIAD.js";
21
- import "./chunk-24JN75FZ.js";
12
+ } from "./chunk-6UO5GX55.js";
13
+ import "./chunk-WFZKJY3R.js";
14
+ import "./chunk-H7XJDKJY.js";
15
+ import "./chunk-IYR5PYA3.js";
16
+ import "./chunk-HQW4BROS.js";
17
+ import "./chunk-3I5BW3ZT.js";
18
+ import "./chunk-SVD4LHJC.js";
19
+ import "./chunk-5YJ3ZQVR.js";
20
+ import "./chunk-KPTML72Q.js";
21
+ import "./chunk-6M55UPES.js";
22
22
  import {
23
23
  ConfigError,
24
24
  globalConfigPath,
25
25
  readJsonConfig
26
- } from "./chunk-FLQPE4S5.js";
26
+ } from "./chunk-RX4UQX43.js";
27
27
  import {
28
28
  t
29
- } from "./chunk-UZWJQF67.js";
29
+ } from "./chunk-3WHI4LN3.js";
30
30
 
31
31
  // src/ghBotWebhook.ts
32
32
  import { createHmac, timingSafeEqual } from "crypto";
@@ -435,16 +435,17 @@ async function collectGhContext(d, deps) {
435
435
  ## diff (truncated)
436
436
  ${truncateHeadTailUtf8(diffRes.stdout, 1e5)}`;
437
437
  }
438
- const comment = truncateUtf8Bytes(d.body, 8192);
438
+ const sanitizeUntrusted = (s) => s.replace(/<\/untrusted-github>/gi, "&lt;/untrusted-github&gt;");
439
+ const comment = sanitizeUntrusted(truncateUtf8Bytes(d.body, 8192));
439
440
  const context = [
440
441
  "<untrusted-github>",
441
442
  `## Comment by ${d.author} (${d.repo}#${d.number})`,
442
443
  comment,
443
444
  "",
444
- `## Issue/PR title: ${title}`,
445
+ `## Issue/PR title: ${sanitizeUntrusted(title)}`,
445
446
  "## Issue/PR body",
446
- issueBody,
447
- diffBlock,
447
+ sanitizeUntrusted(issueBody),
448
+ sanitizeUntrusted(diffBlock),
448
449
  "</untrusted-github>",
449
450
  "",
450
451
  "Draft your reply to the comment above following your system rules."
@@ -5,10 +5,10 @@ import {
5
5
  loadConfig,
6
6
  readCredentials,
7
7
  resolveModel
8
- } from "./chunk-FLQPE4S5.js";
8
+ } from "./chunk-RX4UQX43.js";
9
9
  import {
10
10
  t
11
- } from "./chunk-UZWJQF67.js";
11
+ } from "./chunk-3WHI4LN3.js";
12
12
 
13
13
  // src/integrationCli.ts
14
14
  import { chmodSync, copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
@@ -4,10 +4,10 @@ import {
4
4
  readLine,
5
5
  readSecret,
6
6
  runLogin
7
- } from "./chunk-BXQQCUAC.js";
8
- import "./chunk-MFHCQQEN.js";
9
- import "./chunk-FLQPE4S5.js";
10
- import "./chunk-UZWJQF67.js";
7
+ } from "./chunk-TIMSYZIR.js";
8
+ import "./chunk-3I5BW3ZT.js";
9
+ import "./chunk-RX4UQX43.js";
10
+ import "./chunk-3WHI4LN3.js";
11
11
  export {
12
12
  defaultLoginDeps,
13
13
  readLine,
package/dist/lsp.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export declare function languageIdFor(file: string): string;
2
+ export declare function useShellForLsp(command: string, platform?: NodeJS.Platform): boolean;
1
3
  export interface LspServer {
2
4
  extensions: string[];
3
5
  command: string;
@@ -43,5 +45,6 @@ export declare function getDiagnostics(opts: {
43
45
  cwd: string;
44
46
  file: string;
45
47
  timeoutMs?: number;
48
+ signal?: AbortSignal;
46
49
  }): Promise<LspDiagnostic[]>;
47
50
  export {};
@@ -1,5 +1,23 @@
1
1
  import type { Tool } from '../tools/types';
2
2
  import type { McpServerSpec } from './config';
3
+ export interface McpContentItem {
4
+ type: string;
5
+ text?: string;
6
+ data?: string;
7
+ mimeType?: string;
8
+ resource?: {
9
+ uri?: string;
10
+ text?: string;
11
+ };
12
+ }
13
+ export declare function formatMcpContent(content: McpContentItem[] | undefined): {
14
+ output: string;
15
+ images?: {
16
+ mediaType: string;
17
+ data: string;
18
+ path: string;
19
+ }[];
20
+ };
3
21
  /** Safe env for spawned MCP servers: whitelist from the parent + the server's own config.env. */
4
22
  export declare function mcpChildEnv(extra?: Record<string, string>): Record<string, string>;
5
23
  export interface McpServerState {
@@ -2,30 +2,30 @@
2
2
  import {
3
3
  CATALOG,
4
4
  fillTemplate
5
- } from "./chunk-WI22M2ID.js";
5
+ } from "./chunk-NQOGVP3I.js";
6
6
  import {
7
7
  authorizeMcpServer,
8
8
  clearTokens
9
- } from "./chunk-MFHCQQEN.js";
9
+ } from "./chunk-3I5BW3ZT.js";
10
10
  import {
11
11
  addGlobalServer,
12
12
  globalMcpPath,
13
13
  readMcpFile,
14
14
  removeGlobalServer
15
- } from "./chunk-24JN75FZ.js";
15
+ } from "./chunk-6M55UPES.js";
16
16
  import {
17
17
  bccliHome
18
- } from "./chunk-FLQPE4S5.js";
18
+ } from "./chunk-RX4UQX43.js";
19
19
  import {
20
20
  t
21
- } from "./chunk-UZWJQF67.js";
21
+ } from "./chunk-3WHI4LN3.js";
22
22
 
23
23
  // src/mcpCli.ts
24
24
  async function runMcpCommand(args, deps) {
25
25
  const home = bccliHome(deps.env);
26
26
  const [action = "list", name] = args.subArgs;
27
27
  if (action === "serve") {
28
- const { runMcpServe } = await import("./serve-KWOECK5W.js");
28
+ const { runMcpServe } = await import("./serve-K5AH4MGO.js");
29
29
  return runMcpServe(args, deps);
30
30
  }
31
31
  const installed = readMcpFile(globalMcpPath(home));
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  listAllModels
4
- } from "./chunk-75BECX4F.js";
5
- import "./chunk-JHPGOAXU.js";
6
- import "./chunk-WNACAUDK.js";
7
- import "./chunk-BLOYFIAD.js";
4
+ } from "./chunk-IYR5PYA3.js";
5
+ import "./chunk-HQW4BROS.js";
6
+ import "./chunk-5YJ3ZQVR.js";
7
+ import "./chunk-KPTML72Q.js";
8
8
  import {
9
9
  loadConfig,
10
10
  resolveModel
11
- } from "./chunk-FLQPE4S5.js";
11
+ } from "./chunk-RX4UQX43.js";
12
12
  import {
13
13
  t
14
- } from "./chunk-UZWJQF67.js";
14
+ } from "./chunk-3WHI4LN3.js";
15
15
 
16
16
  // src/modelsCli.ts
17
17
  async function runModelsCommand(args, deps) {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  t
4
- } from "./chunk-UZWJQF67.js";
4
+ } from "./chunk-3WHI4LN3.js";
5
5
 
6
6
  // src/oauthLogin.ts
7
7
  import { createHash, randomBytes } from "crypto";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  bccliHome,
4
4
  globalConfigPath
5
- } from "./chunk-FLQPE4S5.js";
5
+ } from "./chunk-RX4UQX43.js";
6
6
  import {
7
7
  t
8
- } from "./chunk-UZWJQF67.js";
8
+ } from "./chunk-3WHI4LN3.js";
9
9
 
10
10
  // src/pluginsCli.ts
11
11
  import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  t
4
- } from "./chunk-UZWJQF67.js";
4
+ } from "./chunk-3WHI4LN3.js";
5
5
 
6
6
  // src/prCli.ts
7
7
  import { spawn } from "child_process";
@@ -21,7 +21,15 @@ function defaultGh(argv) {
21
21
  });
22
22
  }
23
23
  function prTaskArgv(entry, opts) {
24
- return [entry, ...opts.prompt ? ["-p", opts.prompt] : [], ...opts.allowAll ? ["--allow-all"] : []];
24
+ return [
25
+ entry,
26
+ ...opts.prompt ? ["-p", opts.prompt] : [],
27
+ ...opts.model ? ["-m", opts.model] : [],
28
+ ...opts.reasoning ? ["--reasoning", opts.reasoning] : [],
29
+ ...opts.permissionMode ? ["--permission-mode", opts.permissionMode] : [],
30
+ ...opts.allowedTools?.length ? ["--allowed-tools", opts.allowedTools.join(",")] : [],
31
+ ...opts.allowAll ? ["--allow-all"] : []
32
+ ];
25
33
  }
26
34
  async function defaultRunTask(opts) {
27
35
  const entry = process.argv[1];
@@ -38,7 +46,7 @@ async function defaultRunTask(opts) {
38
46
  }
39
47
  async function runPrCommand(args, deps) {
40
48
  const rest = [...args.subArgs];
41
- let repo;
49
+ let repo = args.repo;
42
50
  const words = [];
43
51
  for (let i = 0; i < rest.length; i++) {
44
52
  if (rest[i] === "--repo") {
@@ -70,7 +78,15 @@ async function runPrCommand(args, deps) {
70
78
  const runTask = deps.runTask ?? defaultRunTask;
71
79
  const allowAll = args.allowAll === true;
72
80
  if (allowAll) deps.err?.(t("--allow-all: the PR task runs every tool without asking"));
73
- return runTask({ prompt: task, allowAll, cwd: args.cwd });
81
+ return runTask({
82
+ prompt: task,
83
+ allowAll,
84
+ cwd: args.cwd,
85
+ ...args.model ? { model: args.model } : {},
86
+ ...args.reasoning ? { reasoning: args.reasoning } : {},
87
+ ...args.permissionMode ? { permissionMode: args.permissionMode } : {},
88
+ ...args.allowedTools?.length ? { allowedTools: args.allowedTools } : {}
89
+ });
74
90
  }
75
91
  export {
76
92
  prTaskArgv,
package/dist/prCli.d.ts CHANGED
@@ -3,6 +3,11 @@ export interface PrCliArgs {
3
3
  cwd: string;
4
4
  /** Set only when the user asked for `bccli pr … --allow-all`. */
5
5
  allowAll?: boolean;
6
+ repo?: string;
7
+ model?: string;
8
+ reasoning?: string;
9
+ permissionMode?: string;
10
+ allowedTools?: string[];
6
11
  }
7
12
  export interface PrDeps {
8
13
  out(line: string): void;
@@ -18,12 +23,20 @@ export interface PrDeps {
18
23
  prompt?: string;
19
24
  allowAll: boolean;
20
25
  cwd: string;
26
+ model?: string;
27
+ reasoning?: string;
28
+ permissionMode?: string;
29
+ allowedTools?: string[];
21
30
  }): Promise<number>;
22
31
  }
23
32
  /** argv for the child running the PR task; `--allow-all` only when the user asked for it. */
24
33
  export declare function prTaskArgv(entry: string, opts: {
25
34
  prompt?: string;
26
35
  allowAll?: boolean;
36
+ model?: string;
37
+ reasoning?: string;
38
+ permissionMode?: string;
39
+ allowedTools?: string[];
27
40
  }): string[];
28
41
  /**
29
42
  * `bccli pr <number> [--repo owner/name] [task]` — check out a GitHub PR
package/dist/print.d.ts CHANGED
@@ -4,6 +4,8 @@ interface Writer {
4
4
  }
5
5
  export declare function toolLabel(tool: string): string;
6
6
  export type OutputFormat = 'text' | 'json' | 'stream-json';
7
+ /** Combines an optional piped stdin payload with the `-p` prompt argument. */
8
+ export declare function resolvePrintPrompt(prompt: string | undefined, stdinText: string | undefined): string | undefined;
7
9
  export declare function runPrint(rt: Runtime, prompt: string, io?: {
8
10
  out: Writer;
9
11
  err: Writer;
@@ -137,4 +137,9 @@ export declare function responseContinuationInput(messages: ChatMessage[], conti
137
137
  incremental: boolean;
138
138
  };
139
139
  export declare function createProvider(options: ProviderOptions): Provider;
140
+ /**
141
+ * Wraps a primary provider with automatic fallback providers tried in order when the primary
142
+ * fails before emitting any text (e.g. HTTP 429 rate-limit/quota, 5xx, or connection failure).
143
+ */
144
+ export declare function withFallbackProvider(primary: Provider, fallbacks: () => Provider[]): Provider;
140
145
  export {};
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ addProviderKey,
4
+ runProviderCommand
5
+ } from "./chunk-H7XJDKJY.js";
6
+ import "./chunk-IYR5PYA3.js";
7
+ import "./chunk-HQW4BROS.js";
8
+ import "./chunk-5YJ3ZQVR.js";
9
+ import "./chunk-KPTML72Q.js";
10
+ import "./chunk-RX4UQX43.js";
11
+ import "./chunk-3WHI4LN3.js";
12
+ export {
13
+ addProviderKey,
14
+ runProviderCommand
15
+ };
package/dist/sdk.d.ts CHANGED
@@ -26,7 +26,8 @@ export interface SdkResult {
26
26
  inputTokens: number;
27
27
  outputTokens: number;
28
28
  };
29
- stopReason: 'done' | 'stepLimit' | 'aborted' | 'budgetExceeded';
29
+ stopReason: 'done' | 'stepLimit' | 'aborted' | 'budgetExceeded' | 'error';
30
+ error?: string;
30
31
  }
31
32
  export type SdkEvent = {
32
33
  type: 'text';
@@ -48,6 +49,9 @@ export type SdkEvent = {
48
49
  type: 'usage';
49
50
  inputTokens: number;
50
51
  outputTokens: number;
52
+ } | {
53
+ type: 'error';
54
+ message: string;
51
55
  } | {
52
56
  type: 'result';
53
57
  result: SdkResult;