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

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.
@@ -247,19 +247,22 @@ function lunaToolPlan(tools, enableProgrammaticToolCalling = false) {
247
247
  const mcpIndexes = native.map((tool, index) => String(tool.name).startsWith("mcp__") ? index : -1).filter((index) => index >= 0);
248
248
  const deferredSchemaChars = mcpIndexes.reduce((sum, index) => sum + JSON.stringify(native[index]).length, 0);
249
249
  const useToolSearch = mcpIndexes.length >= LUNA_TOOL_SEARCH_MIN_MCP_TOOLS || deferredSchemaChars >= LUNA_TOOL_SEARCH_MIN_MCP_SCHEMA_CHARS;
250
+ let programmaticToolCount = 0;
250
251
  if (enableProgrammaticToolCalling) {
251
252
  for (let index = 0; index < native.length; index++) {
252
253
  if (LUNA_PTC_SAFE_FUNCTIONS.has(String(native[index].name))) {
253
254
  native[index] = { ...native[index], allowed_callers: ["direct", "programmatic"] };
255
+ programmaticToolCount++;
254
256
  }
255
257
  }
256
- native.push({ type: "programmatic_tool_calling" });
258
+ if (programmaticToolCount > 0) native.push({ type: "programmatic_tool_calling" });
257
259
  }
260
+ const useProgrammaticToolCalling = programmaticToolCount > 0;
258
261
  if (!useToolSearch) {
259
262
  return {
260
263
  tools: native,
261
264
  useToolSearch: false,
262
- useProgrammaticToolCalling: enableProgrammaticToolCalling,
265
+ useProgrammaticToolCalling,
263
266
  deferredToolCount: 0,
264
267
  deferredSchemaChars
265
268
  };
@@ -272,7 +275,7 @@ function lunaToolPlan(tools, enableProgrammaticToolCalling = false) {
272
275
  return {
273
276
  tools: native,
274
277
  useToolSearch: true,
275
- useProgrammaticToolCalling: enableProgrammaticToolCalling,
278
+ useProgrammaticToolCalling,
276
279
  deferredToolCount: mcpIndexes.length,
277
280
  deferredSchemaChars
278
281
  };
@@ -35,7 +35,7 @@ function readSecret(prompt) {
35
35
  });
36
36
  }
37
37
  async function runLogin(providerId, cwd) {
38
- const { runProviderCommand } = await import("./providerCli-Q3FWHOKL.js");
38
+ const { runProviderCommand } = await import("./providerCli-XD7MUX46.js");
39
39
  const { parseCliArgs } = await import("./args-XQYEBOKB.js");
40
40
  return runProviderCommand(parseCliArgs(["provider", "add", providerId]), {
41
41
  env: process.env,
package/dist/cli.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  createProvider,
23
23
  hasPendingProgrammaticReplay,
24
24
  listAllModels
25
- } from "./chunk-TUSJXGMP.js";
25
+ } from "./chunk-QXLXJWIL.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-XUJKRRPO.js";
33
+ } from "./chunk-ZBOI364S.js";
34
34
  import {
35
35
  Session,
36
36
  pruneSessions
@@ -1505,6 +1505,10 @@ function createTodoTool(store) {
1505
1505
 
1506
1506
  // src/setup.ts
1507
1507
  var TOOL_RULES = { bash: "bash", edit: "edit", write: "edit", fetch: "fetch" };
1508
+ function lunaPtcAutoEnabled(env) {
1509
+ const value = String(env.BCCLI_LUNA_PTC ?? "").trim().toLowerCase();
1510
+ return !["0", "false", "off", "no"].includes(value);
1511
+ }
1508
1512
  function createRuntime(opts) {
1509
1513
  const env = opts.env ?? process.env;
1510
1514
  const home = bccliHome(env);
@@ -1518,7 +1522,7 @@ function createRuntime(opts) {
1518
1522
  apiKey: resolved.apiKey,
1519
1523
  model: resolved.model,
1520
1524
  providerId: resolved.providerId,
1521
- enableProgrammaticToolCalling: env.BCCLI_LUNA_PTC === "1"
1525
+ enableProgrammaticToolCalling: lunaPtcAutoEnabled(env)
1522
1526
  });
1523
1527
  };
1524
1528
  const provider = makeProvider(modelRef);
@@ -1655,7 +1659,7 @@ function createRuntime(opts) {
1655
1659
  }
1656
1660
 
1657
1661
  // src/version.ts
1658
- var VERSION = true ? "0.4.0-beta.23" : "0.0.0-dev";
1662
+ var VERSION = true ? "0.4.0-beta.24" : "0.0.0-dev";
1659
1663
 
1660
1664
  // src/cli.ts
1661
1665
  function chooseLanguage(argv) {
@@ -1681,12 +1685,12 @@ async function main() {
1681
1685
  if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd);
1682
1686
  if (args.command === "mcp") {
1683
1687
  const { runMcpCommand } = await import("./mcpCli-J43FHF2H.js");
1684
- const { readSecret } = await import("./login-KHHIC6QQ.js");
1688
+ const { readSecret } = await import("./login-YHBC2ITY.js");
1685
1689
  return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
1686
1690
  }
1687
1691
  if (args.command === "provider") {
1688
- const { runProviderCommand } = await import("./providerCli-Q3FWHOKL.js");
1689
- const { readSecret } = await import("./login-KHHIC6QQ.js");
1692
+ const { runProviderCommand } = await import("./providerCli-XD7MUX46.js");
1693
+ const { readSecret } = await import("./login-YHBC2ITY.js");
1690
1694
  return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
1691
1695
  }
1692
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-XUJKRRPO.js";
5
+ } from "./chunk-ZBOI364S.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-TUSJXGMP.js";
5
+ } from "./chunk-QXLXJWIL.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.23",
3
+ "version": "0.4.0-beta.24",
4
4
  "description": "BCCLI — BotConnector AI coding agent for the terminal",
5
5
  "type": "module",
6
6
  "bin": {