@botconnector/bccli 0.4.0-beta.26 → 0.4.0-beta.28

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-RY6T7K6G.js");
38
+ const { runProviderCommand } = await import("./providerCli-II7TQDYQ.js");
39
39
  const { parseCliArgs } = await import("./args-XQYEBOKB.js");
40
40
  return runProviderCommand(parseCliArgs(["provider", "add", providerId]), {
41
41
  env: process.env,
@@ -238,6 +238,16 @@ var LUNA_TOOL_SEARCH_MIN_MCP_SCHEMA_CHARS = 32e3;
238
238
  var LUNA_PTC_SAFE_FUNCTIONS = /* @__PURE__ */ new Set(["read", "grep", "glob"]);
239
239
  var LUNA_PTC_TOOL_OUTPUT_TRIGGER_CHARS = 8e3;
240
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
+ var LUNA_PTC_FORCE_CUE = /\b(count|sum|total|average|aggregate|aggregation|filter|join|merge|dedupe|deduplicate|hitung|jumlah|rata[- ]?rata|agregasi|gabung|deduplikasi)\b/i;
242
+ function shouldForceLunaPtc(messages, enabled) {
243
+ if (!enabled) return false;
244
+ for (let i = messages.length - 1; i >= 0; i--) {
245
+ const message = messages[i];
246
+ if (message.role === "assistant" && message.responses_output_items?.some((item) => item.type === "program")) return true;
247
+ if (message.role === "user") return LUNA_PTC_FORCE_CUE.test(message.content);
248
+ }
249
+ return false;
250
+ }
241
251
  function shouldEnableLunaPtc(messages, enabled, programmaticToolNames = []) {
242
252
  if (!enabled) return false;
243
253
  let lastUser = -1;
@@ -269,12 +279,13 @@ function shouldEnableLunaPtc(messages, enabled, programmaticToolNames = []) {
269
279
  }
270
280
  return false;
271
281
  }
272
- function lunaToolPlan(tools, enableProgrammaticToolCalling = false, programmaticToolNames = []) {
282
+ function lunaToolPlan(tools, enableProgrammaticToolCalling = false, programmaticToolNames = [], forceProgrammaticOnly = false) {
273
283
  const native = (tools ?? []).map((tool) => ({
274
284
  type: "function",
275
285
  name: tool.function.name,
276
286
  description: tool.function.description,
277
287
  parameters: tool.function.parameters,
288
+ ...tool.function.output_schema ? { output_schema: tool.function.output_schema } : {},
278
289
  strict: false
279
290
  }));
280
291
  const mcpIndexes = native.map((tool, index) => String(tool.name).startsWith("mcp__") ? index : -1).filter((index) => index >= 0);
@@ -285,7 +296,7 @@ function lunaToolPlan(tools, enableProgrammaticToolCalling = false, programmatic
285
296
  if (enableProgrammaticToolCalling) {
286
297
  for (let index = 0; index < native.length; index++) {
287
298
  if (safeToolNames.has(String(native[index].name))) {
288
- native[index] = { ...native[index], allowed_callers: ["direct", "programmatic"] };
299
+ native[index] = { ...native[index], allowed_callers: forceProgrammaticOnly ? ["programmatic"] : ["direct", "programmatic"] };
289
300
  programmaticToolCount++;
290
301
  }
291
302
  }
@@ -314,8 +325,8 @@ function lunaToolPlan(tools, enableProgrammaticToolCalling = false, programmatic
314
325
  deferredSchemaChars
315
326
  };
316
327
  }
317
- function responseTools(tools, enableProgrammaticToolCalling = false, programmaticToolNames = []) {
318
- return lunaToolPlan(tools, enableProgrammaticToolCalling, programmaticToolNames).tools;
328
+ function responseTools(tools, enableProgrammaticToolCalling = false, programmaticToolNames = [], forceProgrammaticOnly = false) {
329
+ return lunaToolPlan(tools, enableProgrammaticToolCalling, programmaticToolNames, forceProgrammaticOnly).tools;
319
330
  }
320
331
  function responseReasoning(level) {
321
332
  if (level === "auto") return {};
@@ -710,7 +721,8 @@ function createProvider(options) {
710
721
  };
711
722
  async function chatLunaWebSocket(messages, tools, programmaticToolNames, reasoning, signal, onText) {
712
723
  const ptcEnabled = shouldEnableLunaPtc(messages, enableProgrammaticToolCalling, programmaticToolNames);
713
- const nativeTools = responseTools(tools, ptcEnabled, programmaticToolNames);
724
+ const forcePtc = shouldForceLunaPtc(messages, ptcEnabled);
725
+ const nativeTools = responseTools(tools, ptcEnabled, programmaticToolNames, forcePtc);
714
726
  const initialPlan = responseContinuationInput(messages, lunaContinuation);
715
727
  for (let attempt = 0; attempt < 2; attempt++) {
716
728
  if (signal?.aborted) throw signal.reason ?? new Error("Request aborted");
@@ -803,7 +815,8 @@ function createProvider(options) {
803
815
  }
804
816
  if (useNativeResponses) {
805
817
  const ptcEnabled = shouldEnableLunaPtc(messages, enableProgrammaticToolCalling, programmaticToolNames);
806
- const nativeTools = responseTools(tools, ptcEnabled, programmaticToolNames);
818
+ const forcePtc = shouldForceLunaPtc(messages, ptcEnabled);
819
+ const nativeTools = responseTools(tools, ptcEnabled, programmaticToolNames, forcePtc);
807
820
  const res2 = await post(
808
821
  "/responses",
809
822
  {
package/dist/cli.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  createProvider,
23
23
  hasPendingProgrammaticReplay,
24
24
  listAllModels
25
- } from "./chunk-MGCXWN3E.js";
25
+ } from "./chunk-WWQVALA5.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-WJWECLSO.js";
33
+ } from "./chunk-DJR4EAVL.js";
34
34
  import {
35
35
  Session,
36
36
  pruneSessions
@@ -783,7 +783,7 @@ var ALL_TOOLS = [readTool, writeTool, editTool, bashTool, grepTool, globTool, fe
783
783
  function toolDefinitions(tools) {
784
784
  return tools.map((tool) => {
785
785
  const { $schema: _ignored, ...parameters } = tool.jsonSchema ?? z8.toJSONSchema(tool.schema);
786
- return { type: "function", function: { name: tool.name, description: tool.description, parameters } };
786
+ return { type: "function", function: { name: tool.name, description: tool.description, parameters, ...tool.outputJsonSchema ? { output_schema: tool.outputJsonSchema } : {} } };
787
787
  });
788
788
  }
789
789
 
@@ -1247,6 +1247,7 @@ var McpManager = class {
1247
1247
  description: `[MCP ${server}] ${tool.description ?? tool.name}`.slice(0, 1024),
1248
1248
  schema: z9.record(z9.string(), z9.unknown()),
1249
1249
  jsonSchema: tool.inputSchema,
1250
+ ...tool.outputSchema ? { outputJsonSchema: tool.outputSchema } : {},
1250
1251
  kind: "mcp",
1251
1252
  programmaticSafe: tool.annotations?.readOnlyHint === true,
1252
1253
  target: (input) => {
@@ -1661,7 +1662,7 @@ function createRuntime(opts) {
1661
1662
  }
1662
1663
 
1663
1664
  // src/version.ts
1664
- var VERSION = true ? "0.4.0-beta.26" : "0.0.0-dev";
1665
+ var VERSION = true ? "0.4.0-beta.28" : "0.0.0-dev";
1665
1666
 
1666
1667
  // src/cli.ts
1667
1668
  function chooseLanguage(argv) {
@@ -1687,12 +1688,12 @@ async function main() {
1687
1688
  if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd);
1688
1689
  if (args.command === "mcp") {
1689
1690
  const { runMcpCommand } = await import("./mcpCli-J43FHF2H.js");
1690
- const { readSecret } = await import("./login-IUSX5CB3.js");
1691
+ const { readSecret } = await import("./login-HUPT4247.js");
1691
1692
  return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
1692
1693
  }
1693
1694
  if (args.command === "provider") {
1694
- const { runProviderCommand } = await import("./providerCli-RY6T7K6G.js");
1695
- const { readSecret } = await import("./login-IUSX5CB3.js");
1695
+ const { runProviderCommand } = await import("./providerCli-II7TQDYQ.js");
1696
+ const { readSecret } = await import("./login-HUPT4247.js");
1696
1697
  return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
1697
1698
  }
1698
1699
  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-WJWECLSO.js";
5
+ } from "./chunk-DJR4EAVL.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-MGCXWN3E.js";
5
+ } from "./chunk-WWQVALA5.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.26",
3
+ "version": "0.4.0-beta.28",
4
4
  "description": "BCCLI — BotConnector AI coding agent for the terminal",
5
5
  "type": "module",
6
6
  "bin": {