@botconnector/bccli 0.4.0-beta.26 → 0.4.0-beta.27
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.
- package/dist/{chunk-WJWECLSO.js → chunk-CJEIJ5VW.js} +1 -1
- package/dist/{chunk-MGCXWN3E.js → chunk-IXAVAK7R.js} +18 -6
- package/dist/cli.js +6 -6
- package/dist/{login-IUSX5CB3.js → login-MOXJVDKB.js} +1 -1
- package/dist/{providerCli-RY6T7K6G.js → providerCli-G5OGC2UN.js} +1 -1
- package/package.json +1 -1
|
@@ -35,7 +35,7 @@ function readSecret(prompt) {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
async function runLogin(providerId, cwd) {
|
|
38
|
-
const { runProviderCommand } = await import("./providerCli-
|
|
38
|
+
const { runProviderCommand } = await import("./providerCli-G5OGC2UN.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,7 +279,7 @@ 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,
|
|
@@ -285,7 +295,7 @@ function lunaToolPlan(tools, enableProgrammaticToolCalling = false, programmatic
|
|
|
285
295
|
if (enableProgrammaticToolCalling) {
|
|
286
296
|
for (let index = 0; index < native.length; index++) {
|
|
287
297
|
if (safeToolNames.has(String(native[index].name))) {
|
|
288
|
-
native[index] = { ...native[index], allowed_callers: ["direct", "programmatic"] };
|
|
298
|
+
native[index] = { ...native[index], allowed_callers: forceProgrammaticOnly ? ["programmatic"] : ["direct", "programmatic"] };
|
|
289
299
|
programmaticToolCount++;
|
|
290
300
|
}
|
|
291
301
|
}
|
|
@@ -314,8 +324,8 @@ function lunaToolPlan(tools, enableProgrammaticToolCalling = false, programmatic
|
|
|
314
324
|
deferredSchemaChars
|
|
315
325
|
};
|
|
316
326
|
}
|
|
317
|
-
function responseTools(tools, enableProgrammaticToolCalling = false, programmaticToolNames = []) {
|
|
318
|
-
return lunaToolPlan(tools, enableProgrammaticToolCalling, programmaticToolNames).tools;
|
|
327
|
+
function responseTools(tools, enableProgrammaticToolCalling = false, programmaticToolNames = [], forceProgrammaticOnly = false) {
|
|
328
|
+
return lunaToolPlan(tools, enableProgrammaticToolCalling, programmaticToolNames, forceProgrammaticOnly).tools;
|
|
319
329
|
}
|
|
320
330
|
function responseReasoning(level) {
|
|
321
331
|
if (level === "auto") return {};
|
|
@@ -710,7 +720,8 @@ function createProvider(options) {
|
|
|
710
720
|
};
|
|
711
721
|
async function chatLunaWebSocket(messages, tools, programmaticToolNames, reasoning, signal, onText) {
|
|
712
722
|
const ptcEnabled = shouldEnableLunaPtc(messages, enableProgrammaticToolCalling, programmaticToolNames);
|
|
713
|
-
const
|
|
723
|
+
const forcePtc = shouldForceLunaPtc(messages, ptcEnabled);
|
|
724
|
+
const nativeTools = responseTools(tools, ptcEnabled, programmaticToolNames, forcePtc);
|
|
714
725
|
const initialPlan = responseContinuationInput(messages, lunaContinuation);
|
|
715
726
|
for (let attempt = 0; attempt < 2; attempt++) {
|
|
716
727
|
if (signal?.aborted) throw signal.reason ?? new Error("Request aborted");
|
|
@@ -803,7 +814,8 @@ function createProvider(options) {
|
|
|
803
814
|
}
|
|
804
815
|
if (useNativeResponses) {
|
|
805
816
|
const ptcEnabled = shouldEnableLunaPtc(messages, enableProgrammaticToolCalling, programmaticToolNames);
|
|
806
|
-
const
|
|
817
|
+
const forcePtc = shouldForceLunaPtc(messages, ptcEnabled);
|
|
818
|
+
const nativeTools = responseTools(tools, ptcEnabled, programmaticToolNames, forcePtc);
|
|
807
819
|
const res2 = await post(
|
|
808
820
|
"/responses",
|
|
809
821
|
{
|
package/dist/cli.js
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
createProvider,
|
|
23
23
|
hasPendingProgrammaticReplay,
|
|
24
24
|
listAllModels
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-IXAVAK7R.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-
|
|
33
|
+
} from "./chunk-CJEIJ5VW.js";
|
|
34
34
|
import {
|
|
35
35
|
Session,
|
|
36
36
|
pruneSessions
|
|
@@ -1661,7 +1661,7 @@ function createRuntime(opts) {
|
|
|
1661
1661
|
}
|
|
1662
1662
|
|
|
1663
1663
|
// src/version.ts
|
|
1664
|
-
var VERSION = true ? "0.4.0-beta.
|
|
1664
|
+
var VERSION = true ? "0.4.0-beta.27" : "0.0.0-dev";
|
|
1665
1665
|
|
|
1666
1666
|
// src/cli.ts
|
|
1667
1667
|
function chooseLanguage(argv) {
|
|
@@ -1687,12 +1687,12 @@ async function main() {
|
|
|
1687
1687
|
if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd);
|
|
1688
1688
|
if (args.command === "mcp") {
|
|
1689
1689
|
const { runMcpCommand } = await import("./mcpCli-J43FHF2H.js");
|
|
1690
|
-
const { readSecret } = await import("./login-
|
|
1690
|
+
const { readSecret } = await import("./login-MOXJVDKB.js");
|
|
1691
1691
|
return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
1692
1692
|
}
|
|
1693
1693
|
if (args.command === "provider") {
|
|
1694
|
-
const { runProviderCommand } = await import("./providerCli-
|
|
1695
|
-
const { readSecret } = await import("./login-
|
|
1694
|
+
const { runProviderCommand } = await import("./providerCli-G5OGC2UN.js");
|
|
1695
|
+
const { readSecret } = await import("./login-MOXJVDKB.js");
|
|
1696
1696
|
return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
1697
1697
|
}
|
|
1698
1698
|
if (args.command === "connect" || args.command === "disconnect" || args.command === "integrations") {
|