@botconnector/bccli 0.4.0-beta.24 → 0.4.0-beta.25

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.
@@ -35,7 +35,7 @@ function readSecret(prompt) {
35
35
  });
36
36
  }
37
37
  async function runLogin(providerId, cwd) {
38
- const { runProviderCommand } = await import("./providerCli-XD7MUX46.js");
38
+ const { runProviderCommand } = await import("./providerCli-ELUAGUNX.js");
39
39
  const { parseCliArgs } = await import("./args-XQYEBOKB.js");
40
40
  return runProviderCommand(parseCliArgs(["provider", "add", providerId]), {
41
41
  env: process.env,
@@ -236,6 +236,38 @@ function responseInputFromMessages(messages) {
236
236
  var LUNA_TOOL_SEARCH_MIN_MCP_TOOLS = 20;
237
237
  var LUNA_TOOL_SEARCH_MIN_MCP_SCHEMA_CHARS = 32e3;
238
238
  var LUNA_PTC_SAFE_FUNCTIONS = /* @__PURE__ */ new Set(["read", "grep", "glob"]);
239
+ var LUNA_PTC_TOOL_OUTPUT_TRIGGER_CHARS = 8e3;
240
+ var LUNA_PTC_MULTI_WORK_CUE = /\b(both|all|multiple|several|compare|comparison|aggregate|aggregation|total|count|sum|average|filter|join|merge|dedupe|deduplicate|rank|scan|across|every|semua|keduanya|beberapa|bandingkan|perbandingan|agregasi|hitung|jumlah|rata[- ]?rata|gabung|deduplikasi|urutkan|pindai|seluruh)\b|\b(many|banyak)\s+(files?|file|records?|rows?|items?|dokumen|berkas)\b/i;
241
+ function shouldEnableLunaPtc(messages, enabled) {
242
+ if (!enabled) return false;
243
+ let lastUser = -1;
244
+ for (let i = messages.length - 1; i >= 0; i--) {
245
+ if (messages[i].role === "user") {
246
+ lastUser = i;
247
+ break;
248
+ }
249
+ }
250
+ const turn = messages.slice(Math.max(0, lastUser));
251
+ const latestUser = lastUser >= 0 ? messages[lastUser] : void 0;
252
+ const prompt = latestUser?.role === "user" ? latestUser.content : "";
253
+ if (LUNA_PTC_MULTI_WORK_CUE.test(prompt)) return true;
254
+ const safeCalls = /* @__PURE__ */ new Set();
255
+ let safeOutputChars = 0;
256
+ for (const message of turn) {
257
+ if (message.role === "assistant") {
258
+ if (message.responses_output_items?.some((item) => item.type === "program")) return true;
259
+ for (const call of message.tool_calls ?? []) {
260
+ if (LUNA_PTC_SAFE_FUNCTIONS.has(call.function.name)) safeCalls.add(call.id);
261
+ }
262
+ continue;
263
+ }
264
+ if (message.role === "tool" && safeCalls.has(message.tool_call_id)) {
265
+ safeOutputChars += message.content.length;
266
+ if (safeOutputChars >= LUNA_PTC_TOOL_OUTPUT_TRIGGER_CHARS) return true;
267
+ }
268
+ }
269
+ return false;
270
+ }
239
271
  function lunaToolPlan(tools, enableProgrammaticToolCalling = false) {
240
272
  const native = (tools ?? []).map((tool) => ({
241
273
  type: "function",
@@ -675,7 +707,7 @@ function createProvider(options) {
675
707
  lunaWsIdleTimer.unref?.();
676
708
  };
677
709
  async function chatLunaWebSocket(messages, tools, reasoning, signal, onText) {
678
- const nativeTools = responseTools(tools, enableProgrammaticToolCalling);
710
+ const nativeTools = responseTools(tools, shouldEnableLunaPtc(messages, enableProgrammaticToolCalling));
679
711
  const initialPlan = responseContinuationInput(messages, lunaContinuation);
680
712
  for (let attempt = 0; attempt < 2; attempt++) {
681
713
  if (signal?.aborted) throw signal.reason ?? new Error("Request aborted");
@@ -767,7 +799,7 @@ function createProvider(options) {
767
799
  }
768
800
  }
769
801
  if (useNativeResponses) {
770
- const nativeTools = responseTools(tools, enableProgrammaticToolCalling);
802
+ const nativeTools = responseTools(tools, shouldEnableLunaPtc(messages, enableProgrammaticToolCalling));
771
803
  const res2 = await post(
772
804
  "/responses",
773
805
  {
package/dist/cli.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  createProvider,
23
23
  hasPendingProgrammaticReplay,
24
24
  listAllModels
25
- } from "./chunk-QXLXJWIL.js";
25
+ } from "./chunk-Z4CIQZA5.js";
26
26
  import {
27
27
  providerName,
28
28
  readGlobalConfigFile
@@ -30,7 +30,7 @@ import {
30
30
  import "./chunk-SN3ODJZN.js";
31
31
  import {
32
32
  runLogin
33
- } from "./chunk-ZBOI364S.js";
33
+ } from "./chunk-FRB3MUQY.js";
34
34
  import {
35
35
  Session,
36
36
  pruneSessions
@@ -1659,7 +1659,7 @@ function createRuntime(opts) {
1659
1659
  }
1660
1660
 
1661
1661
  // src/version.ts
1662
- var VERSION = true ? "0.4.0-beta.24" : "0.0.0-dev";
1662
+ var VERSION = true ? "0.4.0-beta.25" : "0.0.0-dev";
1663
1663
 
1664
1664
  // src/cli.ts
1665
1665
  function chooseLanguage(argv) {
@@ -1685,12 +1685,12 @@ async function main() {
1685
1685
  if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd);
1686
1686
  if (args.command === "mcp") {
1687
1687
  const { runMcpCommand } = await import("./mcpCli-J43FHF2H.js");
1688
- const { readSecret } = await import("./login-YHBC2ITY.js");
1688
+ const { readSecret } = await import("./login-LXPNZMD7.js");
1689
1689
  return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
1690
1690
  }
1691
1691
  if (args.command === "provider") {
1692
- const { runProviderCommand } = await import("./providerCli-XD7MUX46.js");
1693
- const { readSecret } = await import("./login-YHBC2ITY.js");
1692
+ const { runProviderCommand } = await import("./providerCli-ELUAGUNX.js");
1693
+ const { readSecret } = await import("./login-LXPNZMD7.js");
1694
1694
  return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
1695
1695
  }
1696
1696
  if (args.command === "connect" || args.command === "disconnect" || args.command === "integrations") {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  readSecret,
4
4
  runLogin
5
- } from "./chunk-ZBOI364S.js";
5
+ } from "./chunk-FRB3MUQY.js";
6
6
  export {
7
7
  readSecret,
8
8
  runLogin
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  addProviderKey,
4
4
  runProviderCommand
5
- } from "./chunk-QXLXJWIL.js";
5
+ } from "./chunk-Z4CIQZA5.js";
6
6
  import "./chunk-K5JNR3HL.js";
7
7
  import "./chunk-SN3ODJZN.js";
8
8
  import "./chunk-EO7IVVX4.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botconnector/bccli",
3
- "version": "0.4.0-beta.24",
3
+ "version": "0.4.0-beta.25",
4
4
  "description": "BCCLI — BotConnector AI coding agent for the terminal",
5
5
  "type": "module",
6
6
  "bin": {