@botconnector/bccli 0.4.0-beta.30 → 0.4.0-beta.31
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/{args-XQYEBOKB.js → args-EFFR44JW.js} +3 -3
- package/dist/{chunk-K5JNR3HL.js → chunk-AOVIQXXO.js} +1 -1
- package/dist/{chunk-44MXWCFN.js → chunk-CDUPYHNL.js} +1 -1
- package/dist/{chunk-WWQVALA5.js → chunk-CX5U4EHX.js} +3 -3
- package/dist/{chunk-BEXQSEBI.js → chunk-GEG6QT5H.js} +1 -1
- package/dist/{chunk-EO7IVVX4.js → chunk-IJGTX7RC.js} +1 -0
- package/dist/{chunk-ON6JYPE7.js → chunk-NM3C75BT.js} +2 -2
- package/dist/{chunk-22CEHQVR.js → chunk-NWVFCTTO.js} +1 -1
- package/dist/{chunk-SN3ODJZN.js → chunk-UJH2JT6H.js} +1 -1
- package/dist/{chunk-DJR4EAVL.js → chunk-Z37BR5H4.js} +2 -2
- package/dist/cli.js +115 -40
- package/dist/{config-PBEZ3IGD.js → config-DMF4AO7E.js} +2 -2
- package/dist/{integrationCli-ZTZSZLO7.js → integrationCli-G4C6XQUE.js} +1 -1
- package/dist/{login-HUPT4247.js → login-AP2ODLJX.js} +1 -1
- package/dist/{mcpCli-J43FHF2H.js → mcpCli-UGNEDBMU.js} +3 -3
- package/dist/providerCli-J4Y7D6PF.js +12 -0
- package/dist/{ui-HO3Z5LYD.js → ui-EFY7SNIW.js} +12 -8
- package/package.json +1 -1
- package/dist/providerCli-II7TQDYQ.js +0 -12
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
helpText,
|
|
4
4
|
parseCliArgs
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NM3C75BT.js";
|
|
6
6
|
import "./chunk-ELML4KVQ.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-UJH2JT6H.js";
|
|
8
|
+
import "./chunk-IJGTX7RC.js";
|
|
9
9
|
export {
|
|
10
10
|
helpText,
|
|
11
11
|
parseCliArgs
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
providerName,
|
|
5
5
|
removeGlobalProvider,
|
|
6
6
|
writeGlobalConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AOVIQXXO.js";
|
|
8
8
|
import {
|
|
9
9
|
reasoningPayload
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UJH2JT6H.js";
|
|
11
11
|
import {
|
|
12
12
|
PRESETS,
|
|
13
13
|
loadConfig,
|
|
14
14
|
readCredentials,
|
|
15
15
|
saveCredential,
|
|
16
16
|
t
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IJGTX7RC.js";
|
|
18
18
|
|
|
19
19
|
// src/provider.ts
|
|
20
20
|
import OpenAI from "openai";
|
|
@@ -285,6 +285,7 @@ Opsi:
|
|
|
285
285
|
"\u273B Thinking (ctrl+t to hide)": "\u273B Berpikir (ctrl+t tutup)",
|
|
286
286
|
" \u23F3 queued: {q}": " \u23F3 antri: {q}",
|
|
287
287
|
"Thinking": "Berpikir",
|
|
288
|
+
"Cancelling": "Membatalkan",
|
|
288
289
|
"Language: {lang}. Change it with /language en or /language id.": "Bahasa: {lang}. Ganti dengan /language en atau /language id.",
|
|
289
290
|
'Unknown language "{lang}". Use en or id.': 'Bahasa "{lang}" tidak dikenal. Pakai en atau id.',
|
|
290
291
|
"Could not save the language: {error}": "Gagal menyimpan bahasa: {error}",
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
REASONING_LEVELS,
|
|
7
7
|
isReasoningLevel
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UJH2JT6H.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigError,
|
|
11
11
|
parseLang,
|
|
12
12
|
t
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IJGTX7RC.js";
|
|
14
14
|
|
|
15
15
|
// src/args.ts
|
|
16
16
|
import { parseArgs } from "util";
|
|
@@ -35,8 +35,8 @@ function readSecret(prompt) {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
async function runLogin(providerId, cwd) {
|
|
38
|
-
const { runProviderCommand } = await import("./providerCli-
|
|
39
|
-
const { parseCliArgs } = await import("./args-
|
|
38
|
+
const { runProviderCommand } = await import("./providerCli-J4Y7D6PF.js");
|
|
39
|
+
const { parseCliArgs } = await import("./args-EFFR44JW.js");
|
|
40
40
|
return runProviderCommand(parseCliArgs(["provider", "add", providerId]), {
|
|
41
41
|
env: process.env,
|
|
42
42
|
cwd,
|
package/dist/cli.js
CHANGED
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
parseFrontmatter,
|
|
11
11
|
runPrint,
|
|
12
12
|
validateGlobPattern
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NWVFCTTO.js";
|
|
14
14
|
import {
|
|
15
15
|
helpText,
|
|
16
16
|
parseCliArgs
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NM3C75BT.js";
|
|
18
18
|
import {
|
|
19
19
|
Permissions
|
|
20
20
|
} from "./chunk-ELML4KVQ.js";
|
|
@@ -24,15 +24,15 @@ import {
|
|
|
24
24
|
createProvider,
|
|
25
25
|
hasPendingProgrammaticReplay,
|
|
26
26
|
listAllModels
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-CX5U4EHX.js";
|
|
28
28
|
import {
|
|
29
29
|
providerName,
|
|
30
30
|
readGlobalConfigFile
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-AOVIQXXO.js";
|
|
32
|
+
import "./chunk-UJH2JT6H.js";
|
|
33
33
|
import {
|
|
34
34
|
runLogin
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-Z37BR5H4.js";
|
|
36
36
|
import {
|
|
37
37
|
Session,
|
|
38
38
|
pruneSessions
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
resolveModel,
|
|
46
46
|
setLanguage,
|
|
47
47
|
t
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-IJGTX7RC.js";
|
|
49
49
|
|
|
50
50
|
// src/textToolCalls.ts
|
|
51
51
|
var PAIR = /(?:<arg_key>\s*|`)?([A-Za-z_]\w*)(?:\s*<\/arg_key>)?`?\s*(?:=\s*`|<arg_value>)([\s\S]*?)<\/arg_value>/g;
|
|
@@ -574,6 +574,42 @@ var fetchTool = createFetchTool();
|
|
|
574
574
|
// src/tools/glob.ts
|
|
575
575
|
import { glob as nativeGlob } from "fs/promises";
|
|
576
576
|
import { z as z4 } from "zod";
|
|
577
|
+
|
|
578
|
+
// src/abort.ts
|
|
579
|
+
var ABORTED = /* @__PURE__ */ Symbol("aborted");
|
|
580
|
+
function raceAbort(promise, signal) {
|
|
581
|
+
if (signal.aborted) return Promise.resolve(ABORTED);
|
|
582
|
+
return new Promise((resolve2, reject) => {
|
|
583
|
+
const onAbort = () => resolve2(ABORTED);
|
|
584
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
585
|
+
promise.then(
|
|
586
|
+
(value) => {
|
|
587
|
+
signal.removeEventListener("abort", onAbort);
|
|
588
|
+
resolve2(value);
|
|
589
|
+
},
|
|
590
|
+
(error) => {
|
|
591
|
+
signal.removeEventListener("abort", onAbort);
|
|
592
|
+
reject(error);
|
|
593
|
+
}
|
|
594
|
+
);
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
async function collectUntilAbort(iterable, signal, onItem) {
|
|
598
|
+
const iterator = iterable[Symbol.asyncIterator]();
|
|
599
|
+
try {
|
|
600
|
+
for (; ; ) {
|
|
601
|
+
const next = signal ? await raceAbort(iterator.next(), signal) : await iterator.next();
|
|
602
|
+
if (next === ABORTED) return false;
|
|
603
|
+
if (next.done) return true;
|
|
604
|
+
onItem(next.value);
|
|
605
|
+
}
|
|
606
|
+
} finally {
|
|
607
|
+
Promise.resolve(iterator.return?.(void 0)).catch(() => {
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// src/tools/glob.ts
|
|
577
613
|
var MAX_OUTPUT_CHARS = 24e3;
|
|
578
614
|
var globTool = defineTool({
|
|
579
615
|
name: "glob",
|
|
@@ -589,9 +625,12 @@ var globTool = defineTool({
|
|
|
589
625
|
if (invalid) return { output: invalid, isError: true };
|
|
590
626
|
const root = resolvePath(ctx.cwd, input.path ?? ".");
|
|
591
627
|
const files = [];
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
628
|
+
const finished = await collectUntilAbort(
|
|
629
|
+
nativeGlob(input.pattern, { cwd: root, exclude: ignorePatterns(root) }),
|
|
630
|
+
ctx.signal,
|
|
631
|
+
(file) => files.push(normalizeGlobPath(file))
|
|
632
|
+
);
|
|
633
|
+
if (!finished) return { output: "Cancelled by the user.", isError: true };
|
|
595
634
|
files.sort();
|
|
596
635
|
if (!files.length) return { output: "No matching files." };
|
|
597
636
|
const first = files.slice(0, 500);
|
|
@@ -621,11 +660,15 @@ var MAX_OUTPUT_CHARS2 = 24e3;
|
|
|
621
660
|
async function grepJs(pattern, opts) {
|
|
622
661
|
const regex = new RegExp(pattern, opts.ignoreCase ? "i" : "");
|
|
623
662
|
const files = [];
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
663
|
+
const finished = await collectUntilAbort(
|
|
664
|
+
nativeGlob2(opts.glob ?? "**/*", { cwd: opts.root, exclude: ignorePatterns(opts.root) }),
|
|
665
|
+
opts.signal,
|
|
666
|
+
(file) => files.push(normalizeGlobPath(file))
|
|
667
|
+
);
|
|
627
668
|
const out = [];
|
|
669
|
+
if (!finished) return out;
|
|
628
670
|
for (const file of files.sort()) {
|
|
671
|
+
if (opts.signal?.aborted) break;
|
|
629
672
|
let text;
|
|
630
673
|
try {
|
|
631
674
|
const buffer = await readFile2(resolvePath(opts.root, file));
|
|
@@ -648,7 +691,8 @@ function grepRg(pattern, opts) {
|
|
|
648
691
|
if (opts.glob) args.push("-g", opts.glob);
|
|
649
692
|
args.push(".");
|
|
650
693
|
return new Promise((resolve2) => {
|
|
651
|
-
execFile("rg", args, { cwd: opts.root, maxBuffer: 10 * 1024 * 1024 }, (error, stdout) => {
|
|
694
|
+
execFile("rg", args, { cwd: opts.root, maxBuffer: 10 * 1024 * 1024, signal: opts.signal }, (error, stdout) => {
|
|
695
|
+
if (opts.signal?.aborted) return resolve2([]);
|
|
652
696
|
const code = error?.code;
|
|
653
697
|
if (code === "ENOENT") return resolve2(void 0);
|
|
654
698
|
if (error && error.code !== 1) return resolve2(void 0);
|
|
@@ -672,13 +716,14 @@ var grepTool = defineTool({
|
|
|
672
716
|
const invalid = validateGlobPattern(input.glob);
|
|
673
717
|
if (invalid) return { output: invalid, isError: true };
|
|
674
718
|
}
|
|
675
|
-
const opts = { root: resolvePath(ctx.cwd, input.path ?? "."), glob: input.glob, ignoreCase: input.ignore_case };
|
|
719
|
+
const opts = { root: resolvePath(ctx.cwd, input.path ?? "."), glob: input.glob, ignoreCase: input.ignore_case, signal: ctx.signal };
|
|
676
720
|
try {
|
|
677
721
|
new RegExp(input.pattern);
|
|
678
722
|
} catch (error) {
|
|
679
723
|
return { output: `Invalid regex: ${error.message}`, isError: true };
|
|
680
724
|
}
|
|
681
725
|
const matches = await grepRg(input.pattern, opts) ?? await grepJs(input.pattern, opts);
|
|
726
|
+
if (ctx.signal.aborted) return { output: "Cancelled by the user.", isError: true };
|
|
682
727
|
if (!matches.length) return { output: "No matches." };
|
|
683
728
|
const shown = [];
|
|
684
729
|
let size = 0;
|
|
@@ -877,6 +922,7 @@ var WebBudget = class {
|
|
|
877
922
|
};
|
|
878
923
|
|
|
879
924
|
// src/agent.ts
|
|
925
|
+
var CANCELLED = "Cancelled by the user.";
|
|
880
926
|
var estimateTokens = (text) => Math.ceil(text.length / 4);
|
|
881
927
|
var COMPACT_PROMPT = "Summarize the conversation so far for yourself so you can continue the work with no other context. Include: the user goals, decisions made, files touched and their current state, commands run and results, the task in progress and the next step. Be concise but complete.";
|
|
882
928
|
var Agent = class {
|
|
@@ -964,6 +1010,16 @@ ${completion.text}` });
|
|
|
964
1010
|
this.push({ role: "assistant", content: "OK, I will continue from this summary." });
|
|
965
1011
|
this.onEvent({ type: "compacted" });
|
|
966
1012
|
}
|
|
1013
|
+
/**
|
|
1014
|
+
* Events of one tool execution. A cancelled turn gives up on a tool that does not stop, and whatever that tool
|
|
1015
|
+
* reports later must not reach the screen or a newer turn, so this is per execution and not per call id (ids repeat).
|
|
1016
|
+
*/
|
|
1017
|
+
report(ticket, event) {
|
|
1018
|
+
if (ticket.abandoned) return;
|
|
1019
|
+
if (event.type === "toolStart") ticket.open = true;
|
|
1020
|
+
if (event.type === "toolEnd") ticket.open = false;
|
|
1021
|
+
this.onEvent(event);
|
|
1022
|
+
}
|
|
967
1023
|
async run(text, signal) {
|
|
968
1024
|
this.turnTools = this.tools;
|
|
969
1025
|
this.turnDefinitions = this.definitions;
|
|
@@ -1020,25 +1076,33 @@ ${completion.text}` });
|
|
|
1020
1076
|
let i = 0;
|
|
1021
1077
|
while (i < calls.length) {
|
|
1022
1078
|
if (signal.aborted) {
|
|
1023
|
-
|
|
1024
|
-
this.push({
|
|
1025
|
-
role: "tool",
|
|
1026
|
-
tool_call_id: pending.id,
|
|
1027
|
-
content: "Cancelled by the user.",
|
|
1028
|
-
...pending.caller ? { responses_caller: pending.caller } : {}
|
|
1029
|
-
});
|
|
1079
|
+
this.cancelCalls(calls.slice(i));
|
|
1030
1080
|
this.onEvent({ type: "aborted" });
|
|
1031
1081
|
return;
|
|
1032
1082
|
}
|
|
1033
1083
|
let j = i + 1;
|
|
1034
1084
|
if (this.isParallelSafe(calls[i])) while (j < calls.length && this.isParallelSafe(calls[j])) j++;
|
|
1035
1085
|
const batch = calls.slice(i, j);
|
|
1036
|
-
const
|
|
1086
|
+
const tickets = batch.map(() => ({ abandoned: false, open: false }));
|
|
1087
|
+
const running = Promise.all(batch.map((c, k) => this.runTool(c, signal, tickets[k])));
|
|
1088
|
+
const outcome = await raceAbort(running, signal);
|
|
1089
|
+
if (outcome === ABORTED) {
|
|
1090
|
+
batch.forEach((c, k) => {
|
|
1091
|
+
const ticket = tickets[k];
|
|
1092
|
+
ticket.abandoned = true;
|
|
1093
|
+
if (ticket.open) this.onEvent({ type: "toolEnd", id: c.id, tool: c.name, output: CANCELLED, isError: true });
|
|
1094
|
+
});
|
|
1095
|
+
running.catch(() => {
|
|
1096
|
+
});
|
|
1097
|
+
this.cancelCalls(calls.slice(i));
|
|
1098
|
+
this.onEvent({ type: "aborted" });
|
|
1099
|
+
return;
|
|
1100
|
+
}
|
|
1037
1101
|
batch.forEach((c, k) => {
|
|
1038
1102
|
this.push({
|
|
1039
1103
|
role: "tool",
|
|
1040
1104
|
tool_call_id: c.id,
|
|
1041
|
-
content:
|
|
1105
|
+
content: outcome[k],
|
|
1042
1106
|
...c.caller ? { responses_caller: c.caller } : {}
|
|
1043
1107
|
});
|
|
1044
1108
|
});
|
|
@@ -1064,10 +1128,21 @@ ${t("This model may not support tool calling. Try another model with /model.")}`
|
|
|
1064
1128
|
});
|
|
1065
1129
|
}
|
|
1066
1130
|
}
|
|
1067
|
-
|
|
1131
|
+
/** Every tool call needs an answer in the history, or the next request to the model is rejected. */
|
|
1132
|
+
cancelCalls(calls) {
|
|
1133
|
+
for (const pending of calls)
|
|
1134
|
+
this.push({
|
|
1135
|
+
role: "tool",
|
|
1136
|
+
tool_call_id: pending.id,
|
|
1137
|
+
content: CANCELLED,
|
|
1138
|
+
...pending.caller ? { responses_caller: pending.caller } : {}
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
async runTool(call, signal, ticket) {
|
|
1142
|
+
const emit = (event) => this.report(ticket, event);
|
|
1068
1143
|
const fail = (output, target2 = "") => {
|
|
1069
|
-
|
|
1070
|
-
|
|
1144
|
+
emit({ type: "toolStart", id: call.id, tool: call.name, target: target2 });
|
|
1145
|
+
emit({ type: "toolEnd", id: call.id, tool: call.name, output, isError: true });
|
|
1071
1146
|
return output;
|
|
1072
1147
|
};
|
|
1073
1148
|
const tool = this.turnTools.find((t2) => t2.name === call.name);
|
|
@@ -1091,7 +1166,7 @@ ${t("This model may not support tool calling. Try another model with /model.")}`
|
|
|
1091
1166
|
signal,
|
|
1092
1167
|
readFiles: this.readFiles,
|
|
1093
1168
|
callId: call.id,
|
|
1094
|
-
emit
|
|
1169
|
+
emit,
|
|
1095
1170
|
ask: (req) => this.askPermission(req),
|
|
1096
1171
|
checkpoint: this.opts.checkpoint,
|
|
1097
1172
|
refundFetch: () => this.webBudget.refund(),
|
|
@@ -1101,10 +1176,10 @@ ${t("This model may not support tool calling. Try another model with /model.")}`
|
|
|
1101
1176
|
this.onEvent({ type: "usage", ...this.totalUsage });
|
|
1102
1177
|
}
|
|
1103
1178
|
};
|
|
1104
|
-
|
|
1179
|
+
emit({ type: "toolStart", id: call.id, tool: tool.name, target });
|
|
1105
1180
|
const invalid = await tool.validate?.(input, ctx).catch((error) => error.message);
|
|
1106
1181
|
if (invalid) {
|
|
1107
|
-
|
|
1182
|
+
emit({ type: "toolEnd", id: call.id, tool: tool.name, output: invalid, isError: true });
|
|
1108
1183
|
return invalid;
|
|
1109
1184
|
}
|
|
1110
1185
|
const request = { tool: tool.name, kind: tool.kind, target };
|
|
@@ -1123,7 +1198,7 @@ ${t("This model may not support tool calling. Try another model with /model.")}`
|
|
|
1123
1198
|
}
|
|
1124
1199
|
if (decision === "deny") {
|
|
1125
1200
|
const output = this.permissions.mode === "plan" ? "Denied: plan mode only allows reading and searching. Write the plan for the user without changing anything." : "The user declined to run this tool. Ask the user what they want, or try another approach.";
|
|
1126
|
-
|
|
1201
|
+
emit({ type: "toolEnd", id: call.id, tool: tool.name, output, isError: true });
|
|
1127
1202
|
return output;
|
|
1128
1203
|
}
|
|
1129
1204
|
let result;
|
|
@@ -1133,7 +1208,7 @@ ${t("This model may not support tool calling. Try another model with /model.")}`
|
|
|
1133
1208
|
result = { output: `Error: ${error.message}`, isError: true };
|
|
1134
1209
|
}
|
|
1135
1210
|
if (tool.name === "fetch" && !result.isError) this.webBudget.record(result.output.length);
|
|
1136
|
-
|
|
1211
|
+
emit({ type: "toolEnd", id: call.id, tool: tool.name, output: result.output, display: result.display, isError: !!result.isError });
|
|
1137
1212
|
return result.output;
|
|
1138
1213
|
}
|
|
1139
1214
|
};
|
|
@@ -1677,7 +1752,7 @@ function createRuntime(opts) {
|
|
|
1677
1752
|
}
|
|
1678
1753
|
|
|
1679
1754
|
// src/version.ts
|
|
1680
|
-
var VERSION = true ? "0.4.0-beta.
|
|
1755
|
+
var VERSION = true ? "0.4.0-beta.31" : "0.0.0-dev";
|
|
1681
1756
|
|
|
1682
1757
|
// src/cli.ts
|
|
1683
1758
|
function chooseLanguage(argv) {
|
|
@@ -1702,17 +1777,17 @@ async function main() {
|
|
|
1702
1777
|
const cwd = process.cwd();
|
|
1703
1778
|
if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd);
|
|
1704
1779
|
if (args.command === "mcp") {
|
|
1705
|
-
const { runMcpCommand } = await import("./mcpCli-
|
|
1706
|
-
const { readSecret } = await import("./login-
|
|
1780
|
+
const { runMcpCommand } = await import("./mcpCli-UGNEDBMU.js");
|
|
1781
|
+
const { readSecret } = await import("./login-AP2ODLJX.js");
|
|
1707
1782
|
return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
1708
1783
|
}
|
|
1709
1784
|
if (args.command === "provider") {
|
|
1710
|
-
const { runProviderCommand } = await import("./providerCli-
|
|
1711
|
-
const { readSecret } = await import("./login-
|
|
1785
|
+
const { runProviderCommand } = await import("./providerCli-J4Y7D6PF.js");
|
|
1786
|
+
const { readSecret } = await import("./login-AP2ODLJX.js");
|
|
1712
1787
|
return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
1713
1788
|
}
|
|
1714
1789
|
if (args.command === "connect" || args.command === "disconnect" || args.command === "integrations") {
|
|
1715
|
-
const { runIntegrationCommand } = await import("./integrationCli-
|
|
1790
|
+
const { runIntegrationCommand } = await import("./integrationCli-G4C6XQUE.js");
|
|
1716
1791
|
return runIntegrationCommand(args, {
|
|
1717
1792
|
env: process.env,
|
|
1718
1793
|
cwd,
|
|
@@ -1735,7 +1810,7 @@ async function main() {
|
|
|
1735
1810
|
}
|
|
1736
1811
|
if (args.print) {
|
|
1737
1812
|
if (!args.prompt) throw new ConfigError(t('-p mode needs a task, e.g. bccli -p "explain this repo"'));
|
|
1738
|
-
const { serversToStart } = await import("./config-
|
|
1813
|
+
const { serversToStart } = await import("./config-DMF4AO7E.js");
|
|
1739
1814
|
const plan = serversToStart(rt.home, cwd);
|
|
1740
1815
|
for (const s of plan.needTrust) {
|
|
1741
1816
|
console.error(t('Project MCP server "{name}" skipped (not approved yet; run interactive bccli once to approve it).', { name: s.name }));
|
|
@@ -1748,7 +1823,7 @@ async function main() {
|
|
|
1748
1823
|
}
|
|
1749
1824
|
}
|
|
1750
1825
|
if (!process.stdin.isTTY) throw new ConfigError(t('Interactive mode needs a terminal. For scripts/CI use: bccli -p "task"'));
|
|
1751
|
-
const { startInteractive } = await import("./ui-
|
|
1826
|
+
const { startInteractive } = await import("./ui-EFY7SNIW.js");
|
|
1752
1827
|
return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION });
|
|
1753
1828
|
}
|
|
1754
1829
|
main().then(
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CATALOG,
|
|
4
4
|
fillTemplate
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GEG6QT5H.js";
|
|
6
6
|
import {
|
|
7
7
|
addGlobalServer,
|
|
8
8
|
globalMcpPath,
|
|
9
9
|
readMcpFile,
|
|
10
10
|
removeGlobalServer
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CDUPYHNL.js";
|
|
12
12
|
import {
|
|
13
13
|
bccliHome,
|
|
14
14
|
t
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IJGTX7RC.js";
|
|
16
16
|
|
|
17
17
|
// src/mcpCli.ts
|
|
18
18
|
async function runMcpCommand(args, deps) {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
parseFrontmatter,
|
|
8
8
|
toolLabel,
|
|
9
9
|
validateGlobPattern
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NWVFCTTO.js";
|
|
11
11
|
import {
|
|
12
12
|
nextMode
|
|
13
13
|
} from "./chunk-ELML4KVQ.js";
|
|
@@ -15,26 +15,26 @@ import {
|
|
|
15
15
|
hasKey,
|
|
16
16
|
providerName,
|
|
17
17
|
writeGlobalConfig
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-AOVIQXXO.js";
|
|
19
19
|
import {
|
|
20
20
|
REASONING_LEVELS,
|
|
21
21
|
assertReasoningSupported,
|
|
22
22
|
parseReasoningLevel,
|
|
23
23
|
supportedReasoningLevels
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-UJH2JT6H.js";
|
|
25
25
|
import {
|
|
26
26
|
Session
|
|
27
27
|
} from "./chunk-SJH3YLW4.js";
|
|
28
28
|
import {
|
|
29
29
|
CATALOG,
|
|
30
30
|
fillTemplate
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-GEG6QT5H.js";
|
|
32
32
|
import {
|
|
33
33
|
addGlobalServer,
|
|
34
34
|
globalMcpPath,
|
|
35
35
|
readMcpFile,
|
|
36
36
|
removeGlobalServer
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-CDUPYHNL.js";
|
|
38
38
|
import {
|
|
39
39
|
PRESETS,
|
|
40
40
|
getLanguage,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
removeCredential,
|
|
44
44
|
setLanguage,
|
|
45
45
|
t
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-IJGTX7RC.js";
|
|
47
47
|
|
|
48
48
|
// src/ui/index.tsx
|
|
49
49
|
import { render } from "ink";
|
|
@@ -1133,6 +1133,7 @@ function App({ runtime, initialPrompt, version }) {
|
|
|
1133
1133
|
const { exit } = useApp();
|
|
1134
1134
|
const [transcript, setTranscript] = useState8(() => ({ done: [entry({ kind: "header" })], live: [] }));
|
|
1135
1135
|
const [busy, setBusy] = useState8(false);
|
|
1136
|
+
const [cancelling, setCancelling] = useState8(false);
|
|
1136
1137
|
const [startedAt, setStartedAt] = useState8(0);
|
|
1137
1138
|
const [mode, setMode] = useState8(runtime.agent.permissions.mode);
|
|
1138
1139
|
const [reasoning, setReasoning] = useState8(runtime.reasoning);
|
|
@@ -1186,6 +1187,7 @@ function App({ runtime, initialPrompt, version }) {
|
|
|
1186
1187
|
controller.current = null;
|
|
1187
1188
|
setTranscript(endTurn);
|
|
1188
1189
|
setBusy(false);
|
|
1190
|
+
setCancelling(false);
|
|
1189
1191
|
},
|
|
1190
1192
|
[runtime]
|
|
1191
1193
|
);
|
|
@@ -1219,6 +1221,7 @@ function App({ runtime, initialPrompt, version }) {
|
|
|
1219
1221
|
}
|
|
1220
1222
|
controller.current = null;
|
|
1221
1223
|
setBusy(false);
|
|
1224
|
+
setCancelling(false);
|
|
1222
1225
|
return;
|
|
1223
1226
|
}
|
|
1224
1227
|
case "reasoning": {
|
|
@@ -1618,6 +1621,7 @@ ARGUMENTS: ${slash.args}`);
|
|
|
1618
1621
|
setMode(next);
|
|
1619
1622
|
} else if (key.escape && busy && !pending) {
|
|
1620
1623
|
controller.current?.abort();
|
|
1624
|
+
setCancelling(true);
|
|
1621
1625
|
if (queued.length) {
|
|
1622
1626
|
setQueued([]);
|
|
1623
1627
|
notice(t("{n} queued messages cancelled.", { n: queued.length }), "warn");
|
|
@@ -1742,7 +1746,7 @@ ${t2.output}`);
|
|
|
1742
1746
|
return /* @__PURE__ */ jsxs11(Box13, { flexDirection: "column", children: [
|
|
1743
1747
|
/* @__PURE__ */ jsx15(Static, { items: transcript.done, children: renderEntry }),
|
|
1744
1748
|
transcript.live.map(renderEntry),
|
|
1745
|
-
busy && !pending && !planAsk ? /* @__PURE__ */ jsx15(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx15(Spinner, { label: t("Thinking"), startedAt }) }) : null,
|
|
1749
|
+
busy && !pending && !planAsk ? /* @__PURE__ */ jsx15(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx15(Spinner, { label: cancelling ? t("Cancelling") : t("Thinking"), startedAt }) }) : null,
|
|
1746
1750
|
pending ? /* @__PURE__ */ jsx15(PermissionPrompt, { request: pending.request, onAnswer: answer }, pending.id) : null,
|
|
1747
1751
|
picker ? /* @__PURE__ */ jsx15(
|
|
1748
1752
|
ModelPicker,
|
|
@@ -1810,7 +1814,7 @@ async function startInteractive(rt, opts) {
|
|
|
1810
1814
|
if (chosen) rt.resume(chosen.session);
|
|
1811
1815
|
}
|
|
1812
1816
|
}
|
|
1813
|
-
const { serversToStart, setProjectTrust } = await import("./config-
|
|
1817
|
+
const { serversToStart, setProjectTrust } = await import("./config-DMF4AO7E.js");
|
|
1814
1818
|
const plan = serversToStart(rt.home, rt.cwd);
|
|
1815
1819
|
if (plan.needTrust.length) {
|
|
1816
1820
|
const { createInterface } = await import("readline/promises");
|
package/package.json
CHANGED