@botconnector/bccli 0.4.0-beta.45 → 0.4.0-beta.47

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-QUDKQCTK.js → acp-QMD7IKKI.js} +2 -2
  2. package/dist/{args-HXDHQUL2.js → args-6T55MFPG.js} +4 -4
  3. package/dist/{chunk-7BQQYDPU.js → chunk-226R2FBX.js} +1 -1
  4. package/dist/{chunk-FNCDUDOB.js → chunk-3ETD6HSV.js} +31 -18
  5. package/dist/{chunk-W2ME7AGN.js → chunk-5D35DOMD.js} +3 -3
  6. package/dist/{chunk-4BQAIMAM.js → chunk-5YTZXUGU.js} +4 -4
  7. package/dist/{chunk-NJ5YDSSP.js → chunk-DAFJ7VOQ.js} +1 -1
  8. package/dist/{chunk-ERXWNEVU.js → chunk-EC67VAZX.js} +68 -12
  9. package/dist/{chunk-O33VFLLL.js → chunk-FNECQ433.js} +2 -2
  10. package/dist/{chunk-IA35YV5K.js → chunk-HBR62GF2.js} +1 -1
  11. package/dist/{chunk-JZ5XPSIA.js → chunk-JRUQQRP6.js} +5 -4
  12. package/dist/{chunk-X5ZJGTWY.js → chunk-KVXONGYT.js} +4 -4
  13. package/dist/{chunk-IU7PB6US.js → chunk-QGTAINBU.js} +6 -6
  14. package/dist/{chunk-JKRSZHDV.js → chunk-R72DRWZ6.js} +1 -1
  15. package/dist/{chunk-Q7DFEWE7.js → chunk-SJTJHATK.js} +2 -2
  16. package/dist/{chunk-VQ4FJ7R2.js → chunk-SVGARF5B.js} +3 -3
  17. package/dist/{chunk-FNGFR7R6.js → chunk-TSZFE2RV.js} +2 -1
  18. package/dist/{chunk-F4XYLKG5.js → chunk-Y7F5CZ4D.js} +1 -1
  19. package/dist/{chunk-RFSNTLOW.js → chunk-YGITX6JU.js} +1 -1
  20. package/dist/cli.js +37 -37
  21. package/dist/{completion-5OLAKCX7.js → completion-QO5B6N4R.js} +1 -1
  22. package/dist/{config-LSB274W4.js → config-67RNJLDR.js} +3 -3
  23. package/dist/{config-2PLBQKNC.js → config-TBRDIB7O.js} +2 -2
  24. package/dist/{ghBotCli-MB7KATUU.js → ghBotCli-4SXXJQGT.js} +13 -13
  25. package/dist/{integrationCli-L7OLA3DG.js → integrationCli-KTHSQC4Y.js} +2 -2
  26. package/dist/{login-4CIXDZZ7.js → login-7T6M25XB.js} +3 -3
  27. package/dist/{mcpCli-SAJTQGI7.js → mcpCli-7RR5N7SX.js} +5 -5
  28. package/dist/{modelsCli-L6VODTVW.js → modelsCli-GDE5RVD4.js} +6 -6
  29. package/dist/{oauthLogin-6TP475PO.js → oauthLogin-ZVKAVGJH.js} +1 -1
  30. package/dist/{pluginsCli-LE2IDSST.js → pluginsCli-UKMRWPVT.js} +2 -2
  31. package/dist/{prCli-PQJDEF7H.js → prCli-26OUBDFO.js} +1 -1
  32. package/dist/providerCli-QVYG6PFQ.js +15 -0
  33. package/dist/sdk.js +93 -22
  34. package/dist/{serve-QAVMAYEU.js → serve-PAXJYBVI.js} +3 -3
  35. package/dist/{serve-ZBCAEE72.js → serve-SEGKQ5DM.js} +14 -14
  36. package/dist/session-GDPYDGOX.js +12 -0
  37. package/dist/setup-HRZW73ZW.js +24 -0
  38. package/dist/{statsCli-AJG3IJTX.js → statsCli-ZHURTHK7.js} +1 -1
  39. package/dist/{transferCli-HNJMZYLV.js → transferCli-PQCFSIVT.js} +4 -4
  40. package/dist/{ui-ORZ5ZNIC.js → ui-52SWT2AL.js} +139 -44
  41. package/dist/{update-REYFMT5X.js → update-URVV6UXT.js} +2 -2
  42. package/package.json +1 -1
  43. package/dist/providerCli-SEAZ5OLH.js +0 -15
  44. package/dist/session-3I64N64B.js +0 -12
  45. package/dist/setup-N3PMYREM.js +0 -24
@@ -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-HXDHQUL2.js");
101
- const { createRuntime } = await import("./setup-N3PMYREM.js");
100
+ const { parseCliArgs } = await import("./args-6T55MFPG.js");
101
+ const { createRuntime } = await import("./setup-HRZW73ZW.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-W2ME7AGN.js";
5
+ } from "./chunk-5D35DOMD.js";
6
6
  import "./chunk-GAFJEQTJ.js";
7
- import "./chunk-RFSNTLOW.js";
8
- import "./chunk-FNGFR7R6.js";
9
- import "./chunk-JZ5XPSIA.js";
7
+ import "./chunk-YGITX6JU.js";
8
+ import "./chunk-TSZFE2RV.js";
9
+ import "./chunk-JRUQQRP6.js";
10
10
  export {
11
11
  helpText,
12
12
  parseCliArgs
@@ -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.45" : "0.0.0-dev";
4
+ var VERSION = true ? "0.4.0-beta.47" : "0.0.0-dev";
5
5
 
6
6
  export {
7
7
  VERSION
@@ -20,11 +20,11 @@ import {
20
20
  parseFrontmatter,
21
21
  runHooks,
22
22
  validateGlobPattern
23
- } from "./chunk-NJ5YDSSP.js";
23
+ } from "./chunk-DAFJ7VOQ.js";
24
24
  import {
25
25
  createWebSearchTool,
26
26
  fetchTool
27
- } from "./chunk-JKRSZHDV.js";
27
+ } from "./chunk-R72DRWZ6.js";
28
28
  import {
29
29
  defineTool
30
30
  } from "./chunk-PSO7R5AD.js";
@@ -33,38 +33,38 @@ import {
33
33
  } from "./chunk-GAFJEQTJ.js";
34
34
  import {
35
35
  addProviderKey
36
- } from "./chunk-X5ZJGTWY.js";
36
+ } from "./chunk-KVXONGYT.js";
37
37
  import {
38
38
  listAllModels
39
- } from "./chunk-4BQAIMAM.js";
39
+ } from "./chunk-5YTZXUGU.js";
40
40
  import {
41
41
  providerName
42
- } from "./chunk-F4XYLKG5.js";
42
+ } from "./chunk-Y7F5CZ4D.js";
43
43
  import {
44
44
  FileOAuthProvider,
45
45
  hasStoredTokens
46
46
  } from "./chunk-7F3IWBPQ.js";
47
47
  import {
48
48
  Session
49
- } from "./chunk-IA35YV5K.js";
49
+ } from "./chunk-HBR62GF2.js";
50
50
  import {
51
51
  completionAssistantMessage,
52
52
  createProvider,
53
53
  hasPendingProgrammaticReplay,
54
54
  imageUserMessage
55
- } from "./chunk-ERXWNEVU.js";
55
+ } from "./chunk-EC67VAZX.js";
56
56
  import {
57
57
  expandEnvVars
58
- } from "./chunk-Q7DFEWE7.js";
58
+ } from "./chunk-SJTJHATK.js";
59
59
  import {
60
60
  ConfigError,
61
61
  bccliHome,
62
62
  loadConfig,
63
63
  resolveModel
64
- } from "./chunk-FNGFR7R6.js";
64
+ } from "./chunk-TSZFE2RV.js";
65
65
  import {
66
66
  t
67
- } from "./chunk-JZ5XPSIA.js";
67
+ } from "./chunk-JRUQQRP6.js";
68
68
 
69
69
  // src/textToolCalls.ts
70
70
  var PAIR = /(?:<arg_key>\s*|`)?([A-Za-z_]\w*)(?:\s*<\/arg_key>)?`?\s*(?:=\s*`|<arg_value>)([\s\S]*?)<\/arg_value>/g;
@@ -750,13 +750,15 @@ var Agent = class {
750
750
  const keepTokens = Math.min(15e3, Math.floor(this.contextWindow * 0.1));
751
751
  const [older, keep] = splitKeepRecent(this.messages, keepTokens);
752
752
  const history = trimToFit(older, Math.floor(this.contextWindow * 0.8));
753
- const completion = await this.provider.chat({
753
+ const pending = this.provider.chat({
754
754
  messages: [{ role: "system", content: this.systemPrompt }, ...history, { role: "user", content: COMPACT_PROMPT }],
755
755
  // Some gateways reject tool_calls in history when no tools are declared.
756
756
  tools: this.definitions,
757
757
  signal,
758
758
  reasoning: this.reasoning
759
759
  });
760
+ const completion = await raceAbort(pending, signal);
761
+ if (completion === ABORTED) throw new Error("aborted");
760
762
  this.clear();
761
763
  this.push({ role: "user", content: `Summary of the previous conversation:
762
764
  ${completion.text}` });
@@ -798,15 +800,26 @@ ${completion.text}` });
798
800
  this.onEvent({ type: "budgetExceeded", ...over });
799
801
  return;
800
802
  }
801
- let completion = await this.provider.chat({
803
+ const pendingCompletion = this.provider.chat({
802
804
  messages: [{ role: "system", content: this.systemPrompt }, ...this.messages],
803
805
  tools: this.turnDefinitions,
804
806
  programmaticToolNames: this.turnTools.filter((tool) => tool.programmaticSafe).map((tool) => tool.name),
805
807
  signal,
806
- onText: (delta) => this.onEvent({ type: "text", delta }),
807
- onThinking: (delta) => this.onEvent({ type: "thinking", delta }),
808
+ // Late output from a cancelled provider must not leak into the next turn.
809
+ onText: (delta) => {
810
+ if (!signal.aborted) this.onEvent({ type: "text", delta });
811
+ },
812
+ onThinking: (delta) => {
813
+ if (!signal.aborted) this.onEvent({ type: "thinking", delta });
814
+ },
808
815
  reasoning: this.reasoning
809
816
  });
817
+ const outcome = await raceAbort(pendingCompletion, signal);
818
+ if (outcome === ABORTED) {
819
+ this.onEvent({ type: "aborted" });
820
+ return;
821
+ }
822
+ let completion = outcome;
810
823
  if (!completion.toolCalls.length && completion.finishReason !== "repetition") {
811
824
  const recovered = recoverTextToolCalls(completion.text, this.turnDefinitions);
812
825
  if (recovered) {
@@ -853,8 +866,8 @@ ${completion.text}` });
853
866
  const batch = calls.slice(i, j);
854
867
  const tickets = batch.map(() => ({ abandoned: false, open: false }));
855
868
  const running = Promise.all(batch.map((c, k) => this.runTool(c, signal, tickets[k])));
856
- const outcome = await raceAbort(running, signal);
857
- if (outcome === ABORTED) {
869
+ const outcome2 = await raceAbort(running, signal);
870
+ if (outcome2 === ABORTED) {
858
871
  batch.forEach((c, k) => {
859
872
  const ticket = tickets[k];
860
873
  ticket.abandoned = true;
@@ -867,11 +880,11 @@ ${completion.text}` });
867
880
  return;
868
881
  }
869
882
  batch.forEach((c, k) => {
870
- roundImages.push(...outcome[k].images ?? []);
883
+ roundImages.push(...outcome2[k].images ?? []);
871
884
  this.push({
872
885
  role: "tool",
873
886
  tool_call_id: c.id,
874
- content: outcome[k].output,
887
+ content: outcome2[k].output,
875
888
  ...c.caller ? { responses_caller: c.caller } : {}
876
889
  });
877
890
  });
@@ -5,14 +5,14 @@ import {
5
5
  import {
6
6
  REASONING_LEVELS,
7
7
  isReasoningLevel
8
- } from "./chunk-RFSNTLOW.js";
8
+ } from "./chunk-YGITX6JU.js";
9
9
  import {
10
10
  ConfigError
11
- } from "./chunk-FNGFR7R6.js";
11
+ } from "./chunk-TSZFE2RV.js";
12
12
  import {
13
13
  parseLang,
14
14
  t
15
- } from "./chunk-JZ5XPSIA.js";
15
+ } from "./chunk-JRUQQRP6.js";
16
16
 
17
17
  // src/args.ts
18
18
  import { parseArgs } from "util";
@@ -2,17 +2,17 @@
2
2
  import {
3
3
  hasKey,
4
4
  providerName
5
- } from "./chunk-F4XYLKG5.js";
5
+ } from "./chunk-Y7F5CZ4D.js";
6
6
  import {
7
7
  createProvider
8
- } from "./chunk-ERXWNEVU.js";
8
+ } from "./chunk-EC67VAZX.js";
9
9
  import {
10
10
  PRESETS,
11
11
  readCredentials
12
- } from "./chunk-FNGFR7R6.js";
12
+ } from "./chunk-TSZFE2RV.js";
13
13
  import {
14
14
  t
15
- } from "./chunk-JZ5XPSIA.js";
15
+ } from "./chunk-JRUQQRP6.js";
16
16
 
17
17
  // src/models.ts
18
18
  function order(ids) {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-PSO7R5AD.js";
5
5
  import {
6
6
  t
7
- } from "./chunk-JZ5XPSIA.js";
7
+ } from "./chunk-JRUQQRP6.js";
8
8
 
9
9
  // src/tools/bash.ts
10
10
  import { spawn } from "child_process";
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  reasoningPayload
4
- } from "./chunk-RFSNTLOW.js";
4
+ } from "./chunk-YGITX6JU.js";
5
5
  import {
6
6
  t
7
- } from "./chunk-JZ5XPSIA.js";
7
+ } from "./chunk-JRUQQRP6.js";
8
8
 
9
9
  // src/provider.ts
10
10
  import OpenAI from "openai";
@@ -70,6 +70,13 @@ var ProviderError = class extends Error {
70
70
  status;
71
71
  code;
72
72
  };
73
+ function outputReasoningSummary(items) {
74
+ return (items ?? []).flatMap((item) => {
75
+ if (!item || typeof item !== "object" || !("type" in item) || item.type !== "reasoning") return [];
76
+ if (!("summary" in item) || !Array.isArray(item.summary)) return [];
77
+ return item.summary;
78
+ }).map((part) => part && typeof part === "object" && "text" in part && typeof part.text === "string" ? part.text : "").filter(Boolean).join("\n");
79
+ }
73
80
  var retryable = (status) => status === 429 || status >= 500;
74
81
  function detectRepetition(text) {
75
82
  const tail = text.slice(-600);
@@ -351,8 +358,8 @@ function responseTools(tools, enableProgrammaticToolCalling = false, programmati
351
358
  return lunaToolPlan(tools, enableProgrammaticToolCalling, programmaticToolNames, forceProgrammaticOnly).tools;
352
359
  }
353
360
  function responseReasoning(level) {
354
- if (level === "auto") return {};
355
- return { reasoning: { effort: level === "off" ? "none" : level } };
361
+ if (level === "off") return { reasoning: { effort: "none" } };
362
+ return { reasoning: { ...level === "auto" ? {} : { effort: level }, summary: "auto" } };
356
363
  }
357
364
  function toResponsesUsage(usage) {
358
365
  return usage ? { inputTokens: usage.input_tokens ?? 0, outputTokens: usage.output_tokens ?? 0 } : void 0;
@@ -379,8 +386,9 @@ function hasPendingProgrammaticReplay(messages) {
379
386
  }
380
387
  return pending;
381
388
  }
382
- async function readResponsesStream(res, onText) {
389
+ async function readResponsesStream(res, onText, onThinking) {
383
390
  let text = "";
391
+ let thinking = "";
384
392
  let usage;
385
393
  let finishReason;
386
394
  let loopAt = -1;
@@ -411,6 +419,12 @@ async function readResponsesStream(res, onText) {
411
419
  if (event.type === "response.failed") {
412
420
  throw new ProviderError(t("Error from the provider: {message}", { message: event.response?.error?.message ?? "Response failed" }));
413
421
  }
422
+ if (event.type === "response.reasoning_summary_text.delta" || event.type === "response.reasoning_summary.delta") {
423
+ const summary = String(event.delta ?? "");
424
+ thinking += summary;
425
+ if (summary) onThinking?.(summary);
426
+ return;
427
+ }
414
428
  if (event.type === "response.output_text.delta" || event.type === "response.refusal.delta") {
415
429
  emitText(String(event.delta ?? ""));
416
430
  return;
@@ -447,12 +461,26 @@ async function readResponsesStream(res, onText) {
447
461
  if (event.type === "response.completed") {
448
462
  usage = toResponsesUsage(event.response?.usage);
449
463
  responsesOutputItems = event.response?.output ?? [...outputItems.entries()].sort(([a], [b]) => a - b).map(([, item]) => item);
464
+ if (!thinking) {
465
+ const summary = outputReasoningSummary(responsesOutputItems);
466
+ if (summary) {
467
+ thinking = summary;
468
+ onThinking?.(summary);
469
+ }
470
+ }
450
471
  finishReason = responsesFinishReason(responsesOutputItems, calls.size);
451
472
  return;
452
473
  }
453
474
  if (event.type === "response.incomplete") {
454
475
  usage = toResponsesUsage(event.response?.usage);
455
476
  responsesOutputItems = event.response?.output ?? [...outputItems.entries()].sort(([a], [b]) => a - b).map(([, item]) => item);
477
+ if (!thinking) {
478
+ const summary = outputReasoningSummary(responsesOutputItems);
479
+ if (summary) {
480
+ thinking = summary;
481
+ onThinking?.(summary);
482
+ }
483
+ }
456
484
  finishReason = responsesFinishReason(
457
485
  responsesOutputItems,
458
486
  calls.size,
@@ -476,14 +504,16 @@ async function readResponsesStream(res, onText) {
476
504
  return {
477
505
  text,
478
506
  toolCalls: [...calls.entries()].sort(([a], [b]) => a - b).map(([, call]) => call),
507
+ thinking: thinking || void 0,
479
508
  usage,
480
509
  finishReason,
481
510
  responsesOutputItems
482
511
  };
483
512
  }
484
- async function readResponsesJson(res) {
513
+ async function readResponsesJson(res, onThinking) {
485
514
  const body = await res.json();
486
515
  let text = "";
516
+ let thinking = "";
487
517
  const toolCalls = [];
488
518
  for (const item of body.output ?? []) {
489
519
  if (item?.type === "message") {
@@ -491,6 +521,12 @@ async function readResponsesJson(res) {
491
521
  if (part?.type === "output_text" && typeof part.text === "string") text += part.text;
492
522
  else if (part?.type === "refusal" && typeof part.refusal === "string") text += part.refusal;
493
523
  }
524
+ } else if (item?.type === "reasoning" && Array.isArray(item.summary)) {
525
+ const summary = item.summary.filter((part) => typeof part === "object" && part !== null && typeof part.text === "string").map((part) => part.text).join("");
526
+ if (summary) {
527
+ thinking += summary;
528
+ onThinking?.(summary);
529
+ }
494
530
  } else if (item?.type === "function_call") {
495
531
  toolCalls.push({
496
532
  id: String(item.call_id || item.id || `call_${toolCalls.length}`),
@@ -503,6 +539,7 @@ async function readResponsesJson(res) {
503
539
  return {
504
540
  text,
505
541
  toolCalls,
542
+ thinking: thinking || void 0,
506
543
  usage: toResponsesUsage(body.usage),
507
544
  responsesOutputItems: body.output,
508
545
  finishReason: responsesFinishReason(
@@ -560,9 +597,10 @@ function responseContinuationInput(messages, continuation) {
560
597
  incremental: true
561
598
  };
562
599
  }
563
- async function readResponsesWebSocketTurn(events, ws, onText, signal) {
600
+ async function readResponsesWebSocketTurn(events, ws, onText, onThinking, signal) {
564
601
  let responseId = "";
565
602
  let text = "";
603
+ let thinking = "";
566
604
  let usage;
567
605
  let finishReason;
568
606
  let loopAt = -1;
@@ -609,6 +647,12 @@ async function readResponsesWebSocketTurn(events, ws, onText, signal) {
609
647
  responseId = String(event.response?.id || responseId);
610
648
  continue;
611
649
  }
650
+ if (event.type === "response.reasoning_summary_text.delta") {
651
+ const summary = String(event.delta ?? "");
652
+ thinking += summary;
653
+ if (summary) onThinking?.(summary);
654
+ continue;
655
+ }
612
656
  if (event.type === "response.output_text.delta" || event.type === "response.refusal.delta") {
613
657
  emitText(String(event.delta ?? ""));
614
658
  if (loopAt >= 0) {
@@ -659,6 +703,13 @@ async function readResponsesWebSocketTurn(events, ws, onText, signal) {
659
703
  responseId = String(event.response?.id || responseId);
660
704
  usage = toResponsesUsage(event.response?.usage);
661
705
  const responsesOutputItems = event.response?.output ?? [...outputItems.entries()].sort(([a], [b]) => a - b).map(([, item]) => item);
706
+ if (!thinking) {
707
+ const summary = outputReasoningSummary(responsesOutputItems);
708
+ if (summary) {
709
+ thinking = summary;
710
+ onThinking?.(summary);
711
+ }
712
+ }
662
713
  finishReason = responsesFinishReason(
663
714
  responsesOutputItems,
664
715
  calls.size,
@@ -669,6 +720,7 @@ async function readResponsesWebSocketTurn(events, ws, onText, signal) {
669
720
  completion: {
670
721
  text,
671
722
  toolCalls: [...calls.entries()].sort(([a], [b]) => a - b).map(([, call]) => call),
723
+ thinking: thinking || void 0,
672
724
  usage,
673
725
  finishReason,
674
726
  responsesOutputItems
@@ -741,7 +793,7 @@ function createProvider(options) {
741
793
  lunaWsIdleTimer = setTimeout(() => resetLunaWebSocket(), 10 * 6e4);
742
794
  lunaWsIdleTimer.unref?.();
743
795
  };
744
- async function chatLunaWebSocket(messages, tools, programmaticToolNames, reasoning, signal, onText) {
796
+ async function chatLunaWebSocket(messages, tools, programmaticToolNames, reasoning, signal, onText, onThinking) {
745
797
  const ptcEnabled = shouldEnableLunaPtc(messages, enableProgrammaticToolCalling, programmaticToolNames);
746
798
  const forcePtc = shouldForceLunaPtc(messages, ptcEnabled);
747
799
  const nativeTools = responseTools(tools, ptcEnabled, programmaticToolNames, forcePtc);
@@ -766,9 +818,13 @@ function createProvider(options) {
766
818
  if (delta) emittedText = true;
767
819
  onText?.(delta);
768
820
  };
821
+ const trackSummary = (delta) => {
822
+ if (delta) emittedText = true;
823
+ onThinking?.(delta);
824
+ };
769
825
  try {
770
826
  ws.send(createEvent);
771
- const result = await readResponsesWebSocketTurn(events, ws, trackText, signal);
827
+ const result = await readResponsesWebSocketTurn(events, ws, trackText, trackSummary, signal);
772
828
  if (result.completion.finishReason === "repetition") {
773
829
  resetLunaWebSocket();
774
830
  return result.completion;
@@ -829,7 +885,7 @@ function createProvider(options) {
829
885
  }
830
886
  if (useResponsesWebSocket) {
831
887
  try {
832
- return await chatLunaWebSocket(messages, tools, programmaticToolNames, reasoning, signal, onText);
888
+ return await chatLunaWebSocket(messages, tools, programmaticToolNames, reasoning, signal, onText, onThinking);
833
889
  } catch (error) {
834
890
  const err = error instanceof ProviderError ? error : new ProviderError(error.message);
835
891
  if (err.code !== "bc_ws_http_fallback") throw err;
@@ -852,9 +908,9 @@ function createProvider(options) {
852
908
  },
853
909
  signal
854
910
  );
855
- if ((res2.headers.get("content-type") ?? "").includes("application/json")) return readResponsesJson(res2);
911
+ if ((res2.headers.get("content-type") ?? "").includes("application/json")) return readResponsesJson(res2, onThinking);
856
912
  if (!res2.body) throw new ProviderError(t("Empty response from the provider"));
857
- return readResponsesStream(res2, onText);
913
+ return readResponsesStream(res2, onText, onThinking);
858
914
  }
859
915
  const res = await post(
860
916
  "/chat/completions",
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigError
4
- } from "./chunk-FNGFR7R6.js";
4
+ } from "./chunk-TSZFE2RV.js";
5
5
  import {
6
6
  t
7
- } from "./chunk-JZ5XPSIA.js";
7
+ } from "./chunk-JRUQQRP6.js";
8
8
 
9
9
  // src/mcp/catalog.ts
10
10
  var CATALOG = [
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  contentText
4
- } from "./chunk-ERXWNEVU.js";
4
+ } from "./chunk-EC67VAZX.js";
5
5
 
6
6
  // src/session.ts
7
7
  import { randomBytes } from "crypto";
@@ -26,6 +26,10 @@ var ID = {
26
26
  " enter save \xB7 esc cancel": " enter simpan \xB7 esc batal",
27
27
  "shift+tab switch mode": "shift+tab ganti mode",
28
28
  "{n} tokens": "{n} token",
29
+ "\u273B Thinking": "\u273B Berpikir",
30
+ "click to toggle": "klik untuk buka/tutup",
31
+ "Model: {model} \xB7 reasoning: {level}": "Model: {model} \xB7 penalaran: {level}",
32
+ "No reasoning summary received yet; tool activity remains visible above.": "Belum ada ringkasan penalaran dari model; aktivitas tool tetap terlihat di atas.",
29
33
  "esc to cancel": "esc batal",
30
34
  "/ for commands": "/ perintah",
31
35
  "\u2026 {n} earlier steps": "\u2026 {n} langkah sebelumnya",
@@ -242,6 +246,7 @@ Opsi:
242
246
  "Note: {env} is still set in the environment and will keep being used.": "Catatan: {env} masih ter-set di environment dan akan terus dipakai.",
243
247
  "To revoke keys on your account, open {dashboard}.": "Untuk mencabut key akun kamu, buka {dashboard}.",
244
248
  "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.",
249
+ "Could not save thinking visibility: {error}": "Gagal menyimpan pengaturan tampilan Thinking: {error}",
245
250
  "Verifying edits: {cmds}": "Memverifikasi edit: {cmds}",
246
251
  "Verification passed.": "Verifikasi lulus.",
247
252
  "Verification still failing after {n} fix round(s). Run the commands manually to see why.": "Verifikasi masih gagal setelah {n} ronde perbaikan. Jalankan perintahnya secara manual untuk melihat penyebabnya.",
@@ -406,15 +411,11 @@ Opsi:
406
411
  "Unknown command: /{name}. Type /help.": "Perintah tidak dikenal: /{name}. Ketik /help.",
407
412
  "Skill {name} cannot be read: {error}": "Skill {name} tidak bisa dibaca: {error}",
408
413
  "{n} queued messages cancelled.": "{n} pesan antrian dibatalkan.",
409
- "Thinking shown ({bind} to hide).": "Thinking ditampilkan ({bind} untuk menutup).",
410
- "Thinking hidden ({bind} to show).": "Thinking disembunyikan ({bind} untuk membuka).",
411
414
  "MCP {name} removed.": "MCP {name} dihapus.",
412
415
  "MCP {name} installed, connecting\u2026": "MCP {name} dipasang, menghubungkan\u2026",
413
416
  "MCP {name} active \xB7 {n} tools.": "MCP {name} aktif \xB7 {n} alat.",
414
417
  "MCP {name} failed: {error}": "MCP {name} gagal: {error}",
415
418
  "unknown": "tidak diketahui",
416
- "\u273B Thinking \xB7 {n} lines \xB7 {bind} to show": "\u273B Berpikir \xB7 {n} baris \xB7 {bind} buka",
417
- "\u273B Thinking ({bind} to hide)": "\u273B Berpikir ({bind} tutup)",
418
419
  " \u23F3 queued: {q}": " \u23F3 antri: {q}",
419
420
  "Thinking": "Berpikir",
420
421
  "Cancelling": "Membatalkan",
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  listAllModels
4
- } from "./chunk-4BQAIMAM.js";
4
+ } from "./chunk-5YTZXUGU.js";
5
5
  import {
6
6
  hasKey,
7
7
  providerName,
8
8
  removeGlobalProvider,
9
9
  writeGlobalConfig
10
- } from "./chunk-F4XYLKG5.js";
10
+ } from "./chunk-Y7F5CZ4D.js";
11
11
  import {
12
12
  PRESETS,
13
13
  loadConfig,
14
14
  saveCredential
15
- } from "./chunk-FNGFR7R6.js";
15
+ } from "./chunk-TSZFE2RV.js";
16
16
  import {
17
17
  t
18
- } from "./chunk-JZ5XPSIA.js";
18
+ } from "./chunk-JRUQQRP6.js";
19
19
 
20
20
  // src/providerCli.ts
21
21
  async function addProviderKey(providerId, key, deps) {
@@ -5,10 +5,10 @@ import {
5
5
  import {
6
6
  removeCredential,
7
7
  saveCredential
8
- } from "./chunk-FNGFR7R6.js";
8
+ } from "./chunk-TSZFE2RV.js";
9
9
  import {
10
10
  t
11
- } from "./chunk-JZ5XPSIA.js";
11
+ } from "./chunk-JRUQQRP6.js";
12
12
 
13
13
  // src/login.ts
14
14
  function readSecret(prompt) {
@@ -91,8 +91,8 @@ function defaultLoginDeps() {
91
91
  fetch: globalThis.fetch,
92
92
  // Wiring NYATA jalur lama: persis runLogin lama (provider add + prompt key).
93
93
  legacyAdd: async (providerId, targetCwd) => {
94
- const { runProviderCommand } = await import("./providerCli-SEAZ5OLH.js");
95
- const { parseCliArgs: parse } = await import("./args-HXDHQUL2.js");
94
+ const { runProviderCommand } = await import("./providerCli-QVYG6PFQ.js");
95
+ const { parseCliArgs: parse } = await import("./args-6T55MFPG.js");
96
96
  return runProviderCommand(parse(["provider", "add", providerId]), {
97
97
  env: process.env,
98
98
  cwd: targetCwd,
@@ -117,12 +117,12 @@ async function runLogin(providerId, cwd, args, deps) {
117
117
  );
118
118
  return 1;
119
119
  }
120
- const { runOauthLogout } = await import("./oauthLogin-6TP475PO.js");
120
+ const { runOauthLogout } = await import("./oauthLogin-ZVKAVGJH.js");
121
121
  return runOauthLogout({ out: deps.out, err: deps.err, env: deps.env, removeCredential: deps.removeCredential });
122
122
  }
123
123
  if (args.key) return deps.legacyAdd(providerId, cwd);
124
124
  if (providerId === "openrouter") {
125
- const { runOauthLogin } = await import("./oauthLogin-6TP475PO.js");
125
+ const { runOauthLogin } = await import("./oauthLogin-ZVKAVGJH.js");
126
126
  return runOauthLogin({
127
127
  out: deps.out,
128
128
  err: deps.err,
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-PSO7R5AD.js";
5
5
  import {
6
6
  t
7
- } from "./chunk-JZ5XPSIA.js";
7
+ } from "./chunk-JRUQQRP6.js";
8
8
 
9
9
  // src/tools/websearch.ts
10
10
  import { z } from "zod";
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigError
4
- } from "./chunk-FNGFR7R6.js";
4
+ } from "./chunk-TSZFE2RV.js";
5
5
  import {
6
6
  t
7
- } from "./chunk-JZ5XPSIA.js";
7
+ } from "./chunk-JRUQQRP6.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-NJ5YDSSP.js";
5
+ } from "./chunk-DAFJ7VOQ.js";
6
6
  import {
7
7
  ConfigError
8
- } from "./chunk-FNGFR7R6.js";
8
+ } from "./chunk-TSZFE2RV.js";
9
9
  import {
10
10
  t
11
- } from "./chunk-JZ5XPSIA.js";
11
+ } from "./chunk-JRUQQRP6.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
  import {
3
3
  t
4
- } from "./chunk-JZ5XPSIA.js";
4
+ } from "./chunk-JRUQQRP6.js";
5
5
 
6
6
  // src/config.ts
7
7
  import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "fs";
@@ -232,6 +232,7 @@ function loadConfig(cwd, env = process.env) {
232
232
  model: project.model ?? global.model ?? DEFAULT_CONFIG.model,
233
233
  permissionMode: global.permissionMode ?? DEFAULT_CONFIG.permissionMode,
234
234
  reasoning: global.reasoning ?? DEFAULT_CONFIG.reasoning,
235
+ thinkingVisible: global.thinkingVisible === true,
235
236
  maxSteps: resolvedMaxSteps(global),
236
237
  hooks: global.hooks,
237
238
  vision: global.vision ?? DEFAULT_CONFIG.vision,
@@ -5,7 +5,7 @@ import {
5
5
  readCredentials,
6
6
  readJsonConfig,
7
7
  removeCredential
8
- } from "./chunk-FNGFR7R6.js";
8
+ } from "./chunk-TSZFE2RV.js";
9
9
 
10
10
  // src/providers.ts
11
11
  import { mkdirSync, writeFileSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  t
4
- } from "./chunk-JZ5XPSIA.js";
4
+ } from "./chunk-JRUQQRP6.js";
5
5
 
6
6
  // src/reasoning.ts
7
7
  var REASONING_LEVELS = ["auto", "off", "low", "medium", "high", "max"];