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

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-YXBMSWYP.js} +2 -2
  2. package/dist/{args-HXDHQUL2.js → args-6MWRODGH.js} +4 -4
  3. package/dist/{chunk-FNCDUDOB.js → chunk-2QNYWBDG.js} +10 -10
  4. package/dist/{chunk-VQ4FJ7R2.js → chunk-33OBF43H.js} +3 -3
  5. package/dist/{chunk-F4XYLKG5.js → chunk-65OGHOGS.js} +1 -1
  6. package/dist/{chunk-IU7PB6US.js → chunk-6RML6SN7.js} +6 -6
  7. package/dist/{chunk-NJ5YDSSP.js → chunk-7PRH5NDO.js} +1 -1
  8. package/dist/{chunk-ERXWNEVU.js → chunk-ASJRO2WF.js} +68 -12
  9. package/dist/{chunk-RFSNTLOW.js → chunk-FIY424O5.js} +1 -1
  10. package/dist/{chunk-JKRSZHDV.js → chunk-GF6CRNT3.js} +1 -1
  11. package/dist/{chunk-JZ5XPSIA.js → chunk-GI5GVU2L.js} +4 -0
  12. package/dist/{chunk-IA35YV5K.js → chunk-IA5PRX4Z.js} +1 -1
  13. package/dist/{chunk-7BQQYDPU.js → chunk-IHYNME3G.js} +1 -1
  14. package/dist/{chunk-O33VFLLL.js → chunk-K3SWFB5S.js} +2 -2
  15. package/dist/{chunk-X5ZJGTWY.js → chunk-KDVKD3QA.js} +4 -4
  16. package/dist/{chunk-FNGFR7R6.js → chunk-NGHOZRIM.js} +2 -1
  17. package/dist/{chunk-W2ME7AGN.js → chunk-OZPSNMUD.js} +3 -3
  18. package/dist/{chunk-4BQAIMAM.js → chunk-PBBD37E7.js} +4 -4
  19. package/dist/{chunk-Q7DFEWE7.js → chunk-PQB4CGSL.js} +2 -2
  20. package/dist/cli.js +37 -37
  21. package/dist/{completion-5OLAKCX7.js → completion-D3HXSAQY.js} +1 -1
  22. package/dist/{config-LSB274W4.js → config-BAAESXVB.js} +3 -3
  23. package/dist/{config-2PLBQKNC.js → config-CJGPM5MJ.js} +2 -2
  24. package/dist/{ghBotCli-MB7KATUU.js → ghBotCli-DCCFACAA.js} +13 -13
  25. package/dist/{integrationCli-L7OLA3DG.js → integrationCli-EYAHT6VL.js} +2 -2
  26. package/dist/{login-4CIXDZZ7.js → login-FXTMDCCC.js} +3 -3
  27. package/dist/{mcpCli-SAJTQGI7.js → mcpCli-57JTECJY.js} +5 -5
  28. package/dist/{modelsCli-L6VODTVW.js → modelsCli-NH7W6MAZ.js} +6 -6
  29. package/dist/{oauthLogin-6TP475PO.js → oauthLogin-FTOPZW7X.js} +1 -1
  30. package/dist/{pluginsCli-LE2IDSST.js → pluginsCli-UUPFG2CF.js} +2 -2
  31. package/dist/{prCli-PQJDEF7H.js → prCli-6OQ5ZUBO.js} +1 -1
  32. package/dist/providerCli-L6SQHIRK.js +15 -0
  33. package/dist/sdk.js +71 -10
  34. package/dist/{serve-ZBCAEE72.js → serve-HPQ2K7UE.js} +14 -14
  35. package/dist/{serve-QAVMAYEU.js → serve-HZZYEI3J.js} +3 -3
  36. package/dist/session-QIZKAZK3.js +12 -0
  37. package/dist/setup-4I5FXW37.js +24 -0
  38. package/dist/{statsCli-AJG3IJTX.js → statsCli-G7GYLCPM.js} +1 -1
  39. package/dist/{transferCli-HNJMZYLV.js → transferCli-7FW2SJY4.js} +4 -4
  40. package/dist/{ui-ORZ5ZNIC.js → ui-KHNDA2RT.js} +120 -32
  41. package/dist/{update-REYFMT5X.js → update-UG7GWBXT.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
package/dist/cli.js CHANGED
@@ -2,47 +2,47 @@
2
2
  import {
3
3
  resolveWorktree,
4
4
  runPrint
5
- } from "./chunk-VQ4FJ7R2.js";
5
+ } from "./chunk-33OBF43H.js";
6
6
  import {
7
7
  createRuntime
8
- } from "./chunk-FNCDUDOB.js";
8
+ } from "./chunk-2QNYWBDG.js";
9
9
  import "./chunk-QZKLZELZ.js";
10
- import "./chunk-NJ5YDSSP.js";
11
- import "./chunk-JKRSZHDV.js";
10
+ import "./chunk-7PRH5NDO.js";
11
+ import "./chunk-GF6CRNT3.js";
12
12
  import "./chunk-PSO7R5AD.js";
13
13
  import {
14
14
  VERSION
15
- } from "./chunk-7BQQYDPU.js";
15
+ } from "./chunk-IHYNME3G.js";
16
16
  import {
17
17
  helpText,
18
18
  parseCliArgs
19
- } from "./chunk-W2ME7AGN.js";
19
+ } from "./chunk-OZPSNMUD.js";
20
20
  import "./chunk-GAFJEQTJ.js";
21
- import "./chunk-X5ZJGTWY.js";
22
- import "./chunk-4BQAIMAM.js";
21
+ import "./chunk-KDVKD3QA.js";
22
+ import "./chunk-PBBD37E7.js";
23
23
  import {
24
24
  readGlobalConfigFile
25
- } from "./chunk-F4XYLKG5.js";
25
+ } from "./chunk-65OGHOGS.js";
26
26
  import {
27
27
  defaultLoginDeps,
28
28
  runLogin
29
- } from "./chunk-IU7PB6US.js";
29
+ } from "./chunk-6RML6SN7.js";
30
30
  import "./chunk-7F3IWBPQ.js";
31
31
  import {
32
32
  pruneSessions
33
- } from "./chunk-IA35YV5K.js";
34
- import "./chunk-ERXWNEVU.js";
35
- import "./chunk-RFSNTLOW.js";
36
- import "./chunk-Q7DFEWE7.js";
33
+ } from "./chunk-IA5PRX4Z.js";
34
+ import "./chunk-ASJRO2WF.js";
35
+ import "./chunk-FIY424O5.js";
36
+ import "./chunk-PQB4CGSL.js";
37
37
  import {
38
38
  ConfigError,
39
39
  setTheme
40
- } from "./chunk-FNGFR7R6.js";
40
+ } from "./chunk-NGHOZRIM.js";
41
41
  import {
42
42
  resolveLanguage,
43
43
  setLanguage,
44
44
  t
45
- } from "./chunk-JZ5XPSIA.js";
45
+ } from "./chunk-GI5GVU2L.js";
46
46
 
47
47
  // src/exit.ts
48
48
  var EXIT_GRACE_MS = 1e3;
@@ -84,17 +84,17 @@ async function main() {
84
84
  if (args.worktree) cwd = (await resolveWorktree(cwd, args.worktree)).path;
85
85
  if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd, args, defaultLoginDeps());
86
86
  if (args.command === "mcp") {
87
- const { runMcpCommand } = await import("./mcpCli-SAJTQGI7.js");
88
- const { readSecret } = await import("./login-4CIXDZZ7.js");
87
+ const { runMcpCommand } = await import("./mcpCli-57JTECJY.js");
88
+ const { readSecret } = await import("./login-FXTMDCCC.js");
89
89
  return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
90
90
  }
91
91
  if (args.command === "provider") {
92
- const { runProviderCommand } = await import("./providerCli-SEAZ5OLH.js");
93
- const { readSecret } = await import("./login-4CIXDZZ7.js");
92
+ const { runProviderCommand } = await import("./providerCli-L6SQHIRK.js");
93
+ const { readSecret } = await import("./login-FXTMDCCC.js");
94
94
  return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
95
95
  }
96
96
  if (args.command === "connect" || args.command === "disconnect" || args.command === "integrations") {
97
- const { runIntegrationCommand } = await import("./integrationCli-L7OLA3DG.js");
97
+ const { runIntegrationCommand } = await import("./integrationCli-EYAHT6VL.js");
98
98
  return runIntegrationCommand(args, {
99
99
  env: process.env,
100
100
  cwd,
@@ -104,20 +104,20 @@ async function main() {
104
104
  });
105
105
  }
106
106
  if (args.command === "models") {
107
- const { runModelsCommand } = await import("./modelsCli-L6VODTVW.js");
107
+ const { runModelsCommand } = await import("./modelsCli-NH7W6MAZ.js");
108
108
  return runModelsCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), fetch: globalThis.fetch });
109
109
  }
110
110
  if (args.command === "update") {
111
- const { runUpdateCommand } = await import("./update-REYFMT5X.js");
111
+ const { runUpdateCommand } = await import("./update-UG7GWBXT.js");
112
112
  return runUpdateCommand({ env: process.env });
113
113
  }
114
114
  if (args.command === "acp") {
115
- const { runtimeAgent, runAcp } = await import("./acp-QUDKQCTK.js");
115
+ const { runtimeAgent, runAcp } = await import("./acp-YXBMSWYP.js");
116
116
  await runAcp(process.stdin, process.stdout, { cwd, newAgent: (c) => runtimeAgent(c) });
117
117
  return 0;
118
118
  }
119
119
  if (args.command === "serve") {
120
- const { startServe } = await import("./serve-ZBCAEE72.js");
120
+ const { startServe } = await import("./serve-HPQ2K7UE.js");
121
121
  const handle = await startServe({ port: args.port, host: args.host, token: args.token, cwd, env: process.env });
122
122
  process.stderr.write(`bccli serve ${handle.url} \u2014 Authorization: Bearer ${handle.token}
123
123
  `);
@@ -131,8 +131,8 @@ async function main() {
131
131
  return 0;
132
132
  }
133
133
  if (args.command === "plugins") {
134
- const { runPluginsCommand } = await import("./pluginsCli-LE2IDSST.js");
135
- const { readGlobalPlugins, updateGlobalConfig } = await import("./config-2PLBQKNC.js");
134
+ const { runPluginsCommand } = await import("./pluginsCli-UUPFG2CF.js");
135
+ const { readGlobalPlugins, updateGlobalConfig } = await import("./config-CJGPM5MJ.js");
136
136
  const { runNpmSync } = await import("./npmRunner-LU43GM3W.js");
137
137
  return runPluginsCommand(args, {
138
138
  out: (s) => console.log(s),
@@ -146,30 +146,30 @@ async function main() {
146
146
  });
147
147
  }
148
148
  if (args.command === "gh-bot") {
149
- const { runGhBotCommand } = await import("./ghBotCli-MB7KATUU.js");
149
+ const { runGhBotCommand } = await import("./ghBotCli-DCCFACAA.js");
150
150
  return runGhBotCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s) });
151
151
  }
152
152
  if (args.command === "completion") {
153
- const { runCompletionCommand } = await import("./completion-5OLAKCX7.js");
153
+ const { runCompletionCommand } = await import("./completion-D3HXSAQY.js");
154
154
  return runCompletionCommand(args, { out: (s) => console.log(s), err: (s) => console.error(s) });
155
155
  }
156
156
  if (args.command === "stats") {
157
- const { runStatsCommand } = await import("./statsCli-AJG3IJTX.js");
158
- const { bccliHome } = await import("./config-2PLBQKNC.js");
157
+ const { runStatsCommand } = await import("./statsCli-G7GYLCPM.js");
158
+ const { bccliHome } = await import("./config-CJGPM5MJ.js");
159
159
  return runStatsCommand(
160
160
  { subArgs: args.subArgs, home: bccliHome(process.env), cwd, days: args.days, tools: args.tools, models: args.models, project: args.project },
161
161
  { out: (s) => console.log(s), err: (s) => console.error(s) }
162
162
  );
163
163
  }
164
164
  if (args.command === "export" || args.command === "import") {
165
- const { runExportCommand, runImportCommand } = await import("./transferCli-HNJMZYLV.js");
166
- const { bccliHome } = await import("./config-2PLBQKNC.js");
165
+ const { runExportCommand, runImportCommand } = await import("./transferCli-7FW2SJY4.js");
166
+ const { bccliHome } = await import("./config-CJGPM5MJ.js");
167
167
  const deps = { subArgs: args.subArgs, home: bccliHome(process.env), cwd };
168
168
  const io = { out: (s) => console.log(s), err: (s) => console.error(s) };
169
169
  return args.command === "export" ? runExportCommand(deps, io) : runImportCommand(deps, io);
170
170
  }
171
171
  if (args.command === "pr") {
172
- const { runPrCommand } = await import("./prCli-PQJDEF7H.js");
172
+ const { runPrCommand } = await import("./prCli-6OQ5ZUBO.js");
173
173
  return runPrCommand({ subArgs: args.subArgs, cwd }, { out: (s) => console.log(s), err: (s) => console.error(s) });
174
174
  }
175
175
  const rt = createRuntime({ cwd, args });
@@ -180,7 +180,7 @@ async function main() {
180
180
  }
181
181
  if (args.print) {
182
182
  if (!args.prompt) throw new ConfigError(t('-p mode needs a task, e.g. bccli -p "explain this repo"'));
183
- const { serversToStart } = await import("./config-LSB274W4.js");
183
+ const { serversToStart } = await import("./config-BAAESXVB.js");
184
184
  const plan = serversToStart(rt.home, cwd);
185
185
  for (const s of plan.needTrust) {
186
186
  console.error(t('Project MCP server "{name}" skipped (not approved yet; run interactive bccli once to approve it).', { name: s.name }));
@@ -195,13 +195,13 @@ async function main() {
195
195
  if (!process.stdin.isTTY) throw new ConfigError(t('Interactive mode needs a terminal. For scripts/CI use: bccli -p "task"'));
196
196
  if (rt.config.updateCheck !== "off" && !process.env.BCCLI_NO_UPDATE_CHECK) {
197
197
  try {
198
- const { checkForUpdate } = await import("./update-REYFMT5X.js");
198
+ const { checkForUpdate } = await import("./update-UG7GWBXT.js");
199
199
  const update = await checkForUpdate({ home: rt.home, fetch: globalThis.fetch, now: /* @__PURE__ */ new Date() });
200
200
  if (update) console.error(update);
201
201
  } catch {
202
202
  }
203
203
  }
204
- const { startInteractive } = await import("./ui-ORZ5ZNIC.js");
204
+ const { startInteractive } = await import("./ui-KHNDA2RT.js");
205
205
  return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION });
206
206
  }
207
207
  main().then(
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  t
4
- } from "./chunk-JZ5XPSIA.js";
4
+ } from "./chunk-GI5GVU2L.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-Q7DFEWE7.js";
13
- import "./chunk-FNGFR7R6.js";
14
- import "./chunk-JZ5XPSIA.js";
12
+ } from "./chunk-PQB4CGSL.js";
13
+ import "./chunk-NGHOZRIM.js";
14
+ import "./chunk-GI5GVU2L.js";
15
15
  export {
16
16
  addGlobalServer,
17
17
  expandEnvVars,
@@ -12,8 +12,8 @@ import {
12
12
  resolveModel,
13
13
  saveCredential,
14
14
  updateGlobalConfig
15
- } from "./chunk-FNGFR7R6.js";
16
- import "./chunk-JZ5XPSIA.js";
15
+ } from "./chunk-NGHOZRIM.js";
16
+ import "./chunk-GI5GVU2L.js";
17
17
  export {
18
18
  ConfigError,
19
19
  DEFAULT_MAX_STEPS,
@@ -1,32 +1,32 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createRuntime
4
- } from "./chunk-FNCDUDOB.js";
4
+ } from "./chunk-2QNYWBDG.js";
5
5
  import "./chunk-QZKLZELZ.js";
6
- import "./chunk-NJ5YDSSP.js";
7
- import "./chunk-JKRSZHDV.js";
6
+ import "./chunk-7PRH5NDO.js";
7
+ import "./chunk-GF6CRNT3.js";
8
8
  import "./chunk-PSO7R5AD.js";
9
9
  import {
10
10
  LOOPBACK_BIND,
11
11
  parseCliArgs
12
- } from "./chunk-W2ME7AGN.js";
12
+ } from "./chunk-OZPSNMUD.js";
13
13
  import "./chunk-GAFJEQTJ.js";
14
- import "./chunk-X5ZJGTWY.js";
15
- import "./chunk-4BQAIMAM.js";
16
- import "./chunk-F4XYLKG5.js";
14
+ import "./chunk-KDVKD3QA.js";
15
+ import "./chunk-PBBD37E7.js";
16
+ import "./chunk-65OGHOGS.js";
17
17
  import "./chunk-7F3IWBPQ.js";
18
- import "./chunk-IA35YV5K.js";
19
- import "./chunk-ERXWNEVU.js";
20
- import "./chunk-RFSNTLOW.js";
21
- import "./chunk-Q7DFEWE7.js";
18
+ import "./chunk-IA5PRX4Z.js";
19
+ import "./chunk-ASJRO2WF.js";
20
+ import "./chunk-FIY424O5.js";
21
+ import "./chunk-PQB4CGSL.js";
22
22
  import {
23
23
  ConfigError,
24
24
  globalConfigPath,
25
25
  readJsonConfig
26
- } from "./chunk-FNGFR7R6.js";
26
+ } from "./chunk-NGHOZRIM.js";
27
27
  import {
28
28
  t
29
- } from "./chunk-JZ5XPSIA.js";
29
+ } from "./chunk-GI5GVU2L.js";
30
30
 
31
31
  // src/ghBotWebhook.ts
32
32
  import { createHmac, timingSafeEqual } from "crypto";
@@ -5,10 +5,10 @@ import {
5
5
  loadConfig,
6
6
  readCredentials,
7
7
  resolveModel
8
- } from "./chunk-FNGFR7R6.js";
8
+ } from "./chunk-NGHOZRIM.js";
9
9
  import {
10
10
  t
11
- } from "./chunk-JZ5XPSIA.js";
11
+ } from "./chunk-GI5GVU2L.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-IU7PB6US.js";
7
+ } from "./chunk-6RML6SN7.js";
8
8
  import "./chunk-7F3IWBPQ.js";
9
- import "./chunk-FNGFR7R6.js";
10
- import "./chunk-JZ5XPSIA.js";
9
+ import "./chunk-NGHOZRIM.js";
10
+ import "./chunk-GI5GVU2L.js";
11
11
  export {
12
12
  defaultLoginDeps,
13
13
  readLine,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CATALOG,
4
4
  fillTemplate
5
- } from "./chunk-O33VFLLL.js";
5
+ } from "./chunk-K3SWFB5S.js";
6
6
  import {
7
7
  authorizeMcpServer,
8
8
  clearTokens
@@ -12,20 +12,20 @@ import {
12
12
  globalMcpPath,
13
13
  readMcpFile,
14
14
  removeGlobalServer
15
- } from "./chunk-Q7DFEWE7.js";
15
+ } from "./chunk-PQB4CGSL.js";
16
16
  import {
17
17
  bccliHome
18
- } from "./chunk-FNGFR7R6.js";
18
+ } from "./chunk-NGHOZRIM.js";
19
19
  import {
20
20
  t
21
- } from "./chunk-JZ5XPSIA.js";
21
+ } from "./chunk-GI5GVU2L.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-QAVMAYEU.js");
28
+ const { runMcpServe } = await import("./serve-HZZYEI3J.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-4BQAIMAM.js";
5
- import "./chunk-F4XYLKG5.js";
6
- import "./chunk-ERXWNEVU.js";
7
- import "./chunk-RFSNTLOW.js";
4
+ } from "./chunk-PBBD37E7.js";
5
+ import "./chunk-65OGHOGS.js";
6
+ import "./chunk-ASJRO2WF.js";
7
+ import "./chunk-FIY424O5.js";
8
8
  import {
9
9
  loadConfig,
10
10
  resolveModel
11
- } from "./chunk-FNGFR7R6.js";
11
+ } from "./chunk-NGHOZRIM.js";
12
12
  import {
13
13
  t
14
- } from "./chunk-JZ5XPSIA.js";
14
+ } from "./chunk-GI5GVU2L.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-JZ5XPSIA.js";
4
+ } from "./chunk-GI5GVU2L.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-FNGFR7R6.js";
5
+ } from "./chunk-NGHOZRIM.js";
6
6
  import {
7
7
  t
8
- } from "./chunk-JZ5XPSIA.js";
8
+ } from "./chunk-GI5GVU2L.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-JZ5XPSIA.js";
4
+ } from "./chunk-GI5GVU2L.js";
5
5
 
6
6
  // src/prCli.ts
7
7
  import { spawn } from "child_process";
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ addProviderKey,
4
+ runProviderCommand
5
+ } from "./chunk-KDVKD3QA.js";
6
+ import "./chunk-PBBD37E7.js";
7
+ import "./chunk-65OGHOGS.js";
8
+ import "./chunk-ASJRO2WF.js";
9
+ import "./chunk-FIY424O5.js";
10
+ import "./chunk-NGHOZRIM.js";
11
+ import "./chunk-GI5GVU2L.js";
12
+ export {
13
+ addProviderKey,
14
+ runProviderCommand
15
+ };
package/dist/sdk.js CHANGED
@@ -68,6 +68,9 @@ var ID = {
68
68
  " enter save \xB7 esc cancel": " enter simpan \xB7 esc batal",
69
69
  "shift+tab switch mode": "shift+tab ganti mode",
70
70
  "{n} tokens": "{n} token",
71
+ "click to toggle": "klik untuk buka/tutup",
72
+ "Model: {model} \xB7 reasoning: {level}": "Model: {model} \xB7 penalaran: {level}",
73
+ "No reasoning summary received yet; tool activity remains visible above.": "Belum ada ringkasan penalaran dari model; aktivitas tool tetap terlihat di atas.",
71
74
  "esc to cancel": "esc batal",
72
75
  "/ for commands": "/ perintah",
73
76
  "\u2026 {n} earlier steps": "\u2026 {n} langkah sebelumnya",
@@ -284,6 +287,7 @@ Opsi:
284
287
  "Note: {env} is still set in the environment and will keep being used.": "Catatan: {env} masih ter-set di environment dan akan terus dipakai.",
285
288
  "To revoke keys on your account, open {dashboard}.": "Untuk mencabut key akun kamu, buka {dashboard}.",
286
289
  "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.",
290
+ "Could not save thinking visibility: {error}": "Gagal menyimpan pengaturan tampilan Thinking: {error}",
287
291
  "Verifying edits: {cmds}": "Memverifikasi edit: {cmds}",
288
292
  "Verification passed.": "Verifikasi lulus.",
289
293
  "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.",
@@ -683,6 +687,7 @@ function loadConfig(cwd, env = process.env) {
683
687
  model: project.model ?? global.model ?? DEFAULT_CONFIG.model,
684
688
  permissionMode: global.permissionMode ?? DEFAULT_CONFIG.permissionMode,
685
689
  reasoning: global.reasoning ?? DEFAULT_CONFIG.reasoning,
690
+ thinkingVisible: global.thinkingVisible === true,
686
691
  maxSteps: resolvedMaxSteps(global),
687
692
  hooks: global.hooks,
688
693
  vision: global.vision ?? DEFAULT_CONFIG.vision,
@@ -1054,6 +1059,13 @@ var ProviderError = class extends Error {
1054
1059
  status;
1055
1060
  code;
1056
1061
  };
1062
+ function outputReasoningSummary(items) {
1063
+ return (items ?? []).flatMap((item) => {
1064
+ if (!item || typeof item !== "object" || !("type" in item) || item.type !== "reasoning") return [];
1065
+ if (!("summary" in item) || !Array.isArray(item.summary)) return [];
1066
+ return item.summary;
1067
+ }).map((part) => part && typeof part === "object" && "text" in part && typeof part.text === "string" ? part.text : "").filter(Boolean).join("\n");
1068
+ }
1057
1069
  var retryable = (status) => status === 429 || status >= 500;
1058
1070
  function detectRepetition(text) {
1059
1071
  const tail = text.slice(-600);
@@ -1335,8 +1347,8 @@ function responseTools(tools, enableProgrammaticToolCalling = false, programmati
1335
1347
  return lunaToolPlan(tools, enableProgrammaticToolCalling, programmaticToolNames, forceProgrammaticOnly).tools;
1336
1348
  }
1337
1349
  function responseReasoning(level) {
1338
- if (level === "auto") return {};
1339
- return { reasoning: { effort: level === "off" ? "none" : level } };
1350
+ if (level === "off") return { reasoning: { effort: "none" } };
1351
+ return { reasoning: { ...level === "auto" ? {} : { effort: level }, summary: "auto" } };
1340
1352
  }
1341
1353
  function toResponsesUsage(usage) {
1342
1354
  return usage ? { inputTokens: usage.input_tokens ?? 0, outputTokens: usage.output_tokens ?? 0 } : void 0;
@@ -1363,8 +1375,9 @@ function hasPendingProgrammaticReplay(messages) {
1363
1375
  }
1364
1376
  return pending;
1365
1377
  }
1366
- async function readResponsesStream(res, onText) {
1378
+ async function readResponsesStream(res, onText, onThinking) {
1367
1379
  let text = "";
1380
+ let thinking = "";
1368
1381
  let usage;
1369
1382
  let finishReason;
1370
1383
  let loopAt = -1;
@@ -1395,6 +1408,12 @@ async function readResponsesStream(res, onText) {
1395
1408
  if (event.type === "response.failed") {
1396
1409
  throw new ProviderError(t("Error from the provider: {message}", { message: event.response?.error?.message ?? "Response failed" }));
1397
1410
  }
1411
+ if (event.type === "response.reasoning_summary_text.delta" || event.type === "response.reasoning_summary.delta") {
1412
+ const summary = String(event.delta ?? "");
1413
+ thinking += summary;
1414
+ if (summary) onThinking?.(summary);
1415
+ return;
1416
+ }
1398
1417
  if (event.type === "response.output_text.delta" || event.type === "response.refusal.delta") {
1399
1418
  emitText(String(event.delta ?? ""));
1400
1419
  return;
@@ -1431,12 +1450,26 @@ async function readResponsesStream(res, onText) {
1431
1450
  if (event.type === "response.completed") {
1432
1451
  usage = toResponsesUsage(event.response?.usage);
1433
1452
  responsesOutputItems = event.response?.output ?? [...outputItems.entries()].sort(([a], [b]) => a - b).map(([, item]) => item);
1453
+ if (!thinking) {
1454
+ const summary = outputReasoningSummary(responsesOutputItems);
1455
+ if (summary) {
1456
+ thinking = summary;
1457
+ onThinking?.(summary);
1458
+ }
1459
+ }
1434
1460
  finishReason = responsesFinishReason(responsesOutputItems, calls.size);
1435
1461
  return;
1436
1462
  }
1437
1463
  if (event.type === "response.incomplete") {
1438
1464
  usage = toResponsesUsage(event.response?.usage);
1439
1465
  responsesOutputItems = event.response?.output ?? [...outputItems.entries()].sort(([a], [b]) => a - b).map(([, item]) => item);
1466
+ if (!thinking) {
1467
+ const summary = outputReasoningSummary(responsesOutputItems);
1468
+ if (summary) {
1469
+ thinking = summary;
1470
+ onThinking?.(summary);
1471
+ }
1472
+ }
1440
1473
  finishReason = responsesFinishReason(
1441
1474
  responsesOutputItems,
1442
1475
  calls.size,
@@ -1460,14 +1493,16 @@ async function readResponsesStream(res, onText) {
1460
1493
  return {
1461
1494
  text,
1462
1495
  toolCalls: [...calls.entries()].sort(([a], [b]) => a - b).map(([, call]) => call),
1496
+ thinking: thinking || void 0,
1463
1497
  usage,
1464
1498
  finishReason,
1465
1499
  responsesOutputItems
1466
1500
  };
1467
1501
  }
1468
- async function readResponsesJson(res) {
1502
+ async function readResponsesJson(res, onThinking) {
1469
1503
  const body = await res.json();
1470
1504
  let text = "";
1505
+ let thinking = "";
1471
1506
  const toolCalls = [];
1472
1507
  for (const item of body.output ?? []) {
1473
1508
  if (item?.type === "message") {
@@ -1475,6 +1510,12 @@ async function readResponsesJson(res) {
1475
1510
  if (part?.type === "output_text" && typeof part.text === "string") text += part.text;
1476
1511
  else if (part?.type === "refusal" && typeof part.refusal === "string") text += part.refusal;
1477
1512
  }
1513
+ } else if (item?.type === "reasoning" && Array.isArray(item.summary)) {
1514
+ const summary = item.summary.filter((part) => typeof part === "object" && part !== null && typeof part.text === "string").map((part) => part.text).join("");
1515
+ if (summary) {
1516
+ thinking += summary;
1517
+ onThinking?.(summary);
1518
+ }
1478
1519
  } else if (item?.type === "function_call") {
1479
1520
  toolCalls.push({
1480
1521
  id: String(item.call_id || item.id || `call_${toolCalls.length}`),
@@ -1487,6 +1528,7 @@ async function readResponsesJson(res) {
1487
1528
  return {
1488
1529
  text,
1489
1530
  toolCalls,
1531
+ thinking: thinking || void 0,
1490
1532
  usage: toResponsesUsage(body.usage),
1491
1533
  responsesOutputItems: body.output,
1492
1534
  finishReason: responsesFinishReason(
@@ -1544,9 +1586,10 @@ function responseContinuationInput(messages, continuation) {
1544
1586
  incremental: true
1545
1587
  };
1546
1588
  }
1547
- async function readResponsesWebSocketTurn(events, ws, onText, signal) {
1589
+ async function readResponsesWebSocketTurn(events, ws, onText, onThinking, signal) {
1548
1590
  let responseId = "";
1549
1591
  let text = "";
1592
+ let thinking = "";
1550
1593
  let usage;
1551
1594
  let finishReason;
1552
1595
  let loopAt = -1;
@@ -1593,6 +1636,12 @@ async function readResponsesWebSocketTurn(events, ws, onText, signal) {
1593
1636
  responseId = String(event.response?.id || responseId);
1594
1637
  continue;
1595
1638
  }
1639
+ if (event.type === "response.reasoning_summary_text.delta") {
1640
+ const summary = String(event.delta ?? "");
1641
+ thinking += summary;
1642
+ if (summary) onThinking?.(summary);
1643
+ continue;
1644
+ }
1596
1645
  if (event.type === "response.output_text.delta" || event.type === "response.refusal.delta") {
1597
1646
  emitText(String(event.delta ?? ""));
1598
1647
  if (loopAt >= 0) {
@@ -1643,6 +1692,13 @@ async function readResponsesWebSocketTurn(events, ws, onText, signal) {
1643
1692
  responseId = String(event.response?.id || responseId);
1644
1693
  usage = toResponsesUsage(event.response?.usage);
1645
1694
  const responsesOutputItems = event.response?.output ?? [...outputItems.entries()].sort(([a], [b]) => a - b).map(([, item]) => item);
1695
+ if (!thinking) {
1696
+ const summary = outputReasoningSummary(responsesOutputItems);
1697
+ if (summary) {
1698
+ thinking = summary;
1699
+ onThinking?.(summary);
1700
+ }
1701
+ }
1646
1702
  finishReason = responsesFinishReason(
1647
1703
  responsesOutputItems,
1648
1704
  calls.size,
@@ -1653,6 +1709,7 @@ async function readResponsesWebSocketTurn(events, ws, onText, signal) {
1653
1709
  completion: {
1654
1710
  text,
1655
1711
  toolCalls: [...calls.entries()].sort(([a], [b]) => a - b).map(([, call]) => call),
1712
+ thinking: thinking || void 0,
1656
1713
  usage,
1657
1714
  finishReason,
1658
1715
  responsesOutputItems
@@ -1725,7 +1782,7 @@ function createProvider(options) {
1725
1782
  lunaWsIdleTimer = setTimeout(() => resetLunaWebSocket(), 10 * 6e4);
1726
1783
  lunaWsIdleTimer.unref?.();
1727
1784
  };
1728
- async function chatLunaWebSocket(messages, tools, programmaticToolNames, reasoning, signal, onText) {
1785
+ async function chatLunaWebSocket(messages, tools, programmaticToolNames, reasoning, signal, onText, onThinking) {
1729
1786
  const ptcEnabled = shouldEnableLunaPtc(messages, enableProgrammaticToolCalling, programmaticToolNames);
1730
1787
  const forcePtc = shouldForceLunaPtc(messages, ptcEnabled);
1731
1788
  const nativeTools = responseTools(tools, ptcEnabled, programmaticToolNames, forcePtc);
@@ -1750,9 +1807,13 @@ function createProvider(options) {
1750
1807
  if (delta) emittedText = true;
1751
1808
  onText?.(delta);
1752
1809
  };
1810
+ const trackSummary = (delta) => {
1811
+ if (delta) emittedText = true;
1812
+ onThinking?.(delta);
1813
+ };
1753
1814
  try {
1754
1815
  ws.send(createEvent);
1755
- const result = await readResponsesWebSocketTurn(events, ws, trackText, signal);
1816
+ const result = await readResponsesWebSocketTurn(events, ws, trackText, trackSummary, signal);
1756
1817
  if (result.completion.finishReason === "repetition") {
1757
1818
  resetLunaWebSocket();
1758
1819
  return result.completion;
@@ -1813,7 +1874,7 @@ function createProvider(options) {
1813
1874
  }
1814
1875
  if (useResponsesWebSocket) {
1815
1876
  try {
1816
- return await chatLunaWebSocket(messages, tools, programmaticToolNames, reasoning, signal, onText);
1877
+ return await chatLunaWebSocket(messages, tools, programmaticToolNames, reasoning, signal, onText, onThinking);
1817
1878
  } catch (error) {
1818
1879
  const err = error instanceof ProviderError ? error : new ProviderError(error.message);
1819
1880
  if (err.code !== "bc_ws_http_fallback") throw err;
@@ -1836,9 +1897,9 @@ function createProvider(options) {
1836
1897
  },
1837
1898
  signal
1838
1899
  );
1839
- if ((res2.headers.get("content-type") ?? "").includes("application/json")) return readResponsesJson(res2);
1900
+ if ((res2.headers.get("content-type") ?? "").includes("application/json")) return readResponsesJson(res2, onThinking);
1840
1901
  if (!res2.body) throw new ProviderError(t("Empty response from the provider"));
1841
- return readResponsesStream(res2, onText);
1902
+ return readResponsesStream(res2, onText, onThinking);
1842
1903
  }
1843
1904
  const res = await post(
1844
1905
  "/chat/completions",