@botconnector/bccli 0.4.0-beta.49 → 0.4.0-beta.50
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/{acp-HMH7DCSE.js → acp-V5RP42VB.js} +2 -2
- package/dist/{args-BTFKKLNQ.js → args-2R45YZ42.js} +4 -4
- package/dist/{chunk-6AW3CPSO.js → chunk-2QYHSESB.js} +1 -1
- package/dist/{chunk-MA4SBA6I.js → chunk-4WVIPZFV.js} +2 -2
- package/dist/{chunk-R72DRWZ6.js → chunk-DP7EBW53.js} +1 -1
- package/dist/{chunk-P6JWJ7D7.js → chunk-EUCSCUYP.js} +1 -1
- package/dist/{chunk-HBR62GF2.js → chunk-F6ACN47V.js} +54 -6
- package/dist/{chunk-VMWT4IRJ.js → chunk-FTFVW7XD.js} +3 -3
- package/dist/{chunk-TQA7WGVC.js → chunk-H73FO5YK.js} +2 -2
- package/dist/{chunk-GSZZA5KX.js → chunk-KD2LMIS4.js} +6 -6
- package/dist/{chunk-KH4HOMBL.js → chunk-KIZC5XV4.js} +10 -10
- package/dist/{chunk-H3S2WAQT.js → chunk-N7KP6RNP.js} +4 -4
- package/dist/{chunk-GKNLIIRL.js → chunk-NDEJUL44.js} +10 -1
- package/dist/{chunk-WKUYO6HY.js → chunk-QXOV4DUZ.js} +4 -4
- package/dist/{chunk-EC67VAZX.js → chunk-R4BJBTWC.js} +2 -2
- package/dist/{chunk-YGITX6JU.js → chunk-SNKVS26H.js} +1 -1
- package/dist/{chunk-67ORWLS2.js → chunk-TQWCM5RO.js} +3 -3
- package/dist/{chunk-JRUQQRP6.js → chunk-XLC6T4SX.js} +1 -0
- package/dist/{chunk-DAFJ7VOQ.js → chunk-YIYX3FFS.js} +1 -1
- package/dist/cli.js +38 -38
- package/dist/{completion-QO5B6N4R.js → completion-OV3MW2N4.js} +1 -1
- package/dist/{config-SUUUHLRX.js → config-AZZFOXKV.js} +3 -3
- package/dist/{config-46ESEU4Z.js → config-H5A7XHHK.js} +2 -2
- package/dist/{ghBotCli-2INYL4WH.js → ghBotCli-7WDYF4L7.js} +13 -13
- package/dist/{integrationCli-VKVDUAPU.js → integrationCli-ZMTSILYF.js} +2 -2
- package/dist/{login-4JQLULNJ.js → login-W4Y6WHLV.js} +3 -3
- package/dist/{mcpCli-TG6BMOE6.js → mcpCli-5QISTOFK.js} +5 -5
- package/dist/{modelsCli-LOUEMOGH.js → modelsCli-FZMBD4OE.js} +6 -6
- package/dist/{oauthLogin-ZVKAVGJH.js → oauthLogin-VESMXG4M.js} +1 -1
- package/dist/{pluginsCli-QYL6C6IK.js → pluginsCli-GEHR7FQR.js} +2 -2
- package/dist/{prCli-26OUBDFO.js → prCli-JXA7DJW4.js} +1 -1
- package/dist/providerCli-EUZGKP5F.js +15 -0
- package/dist/sdk.js +63 -5
- package/dist/{serve-CG3HVPOA.js → serve-6KX4MXHC.js} +3 -3
- package/dist/{serve-UR2LWREA.js → serve-XDHMB7TO.js} +14 -14
- package/dist/session-F6MG3UCU.js +12 -0
- package/dist/setup-LLWREJQH.js +24 -0
- package/dist/{statsCli-ZHURTHK7.js → statsCli-H4HEY5ID.js} +1 -1
- package/dist/{transferCli-PQCFSIVT.js → transferCli-2XUKBG2L.js} +4 -4
- package/dist/{ui-XJ657AHE.js → ui-6HJVYI46.js} +26 -30
- package/dist/{update-6LN4CCR2.js → update-IQR346E5.js} +2 -2
- package/package.json +1 -1
- package/dist/providerCli-S4233ZA5.js +0 -15
- package/dist/session-GDPYDGOX.js +0 -12
- package/dist/setup-TRKD4EQ6.js +0 -24
|
@@ -97,8 +97,8 @@ function runAcp(input, output, opts) {
|
|
|
97
97
|
function runtimeAgent(cwd) {
|
|
98
98
|
return {
|
|
99
99
|
async run(text, onChunk, signal) {
|
|
100
|
-
const { parseCliArgs } = await import("./args-
|
|
101
|
-
const { createRuntime } = await import("./setup-
|
|
100
|
+
const { parseCliArgs } = await import("./args-2R45YZ42.js");
|
|
101
|
+
const { createRuntime } = await import("./setup-LLWREJQH.js");
|
|
102
102
|
const rt = createRuntime({ cwd, args: { ...parseCliArgs([]), allowAll: true } });
|
|
103
103
|
rt.agent.onEvent = (event) => {
|
|
104
104
|
if (event.type === "text") onChunk(event.delta);
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
helpText,
|
|
4
4
|
parseCliArgs
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FTFVW7XD.js";
|
|
6
6
|
import "./chunk-GAFJEQTJ.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-SNKVS26H.js";
|
|
8
|
+
import "./chunk-NDEJUL44.js";
|
|
9
|
+
import "./chunk-XLC6T4SX.js";
|
|
10
10
|
export {
|
|
11
11
|
helpText,
|
|
12
12
|
parseCliArgs
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
contentText
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-R4BJBTWC.js";
|
|
5
5
|
|
|
6
6
|
// src/session.ts
|
|
7
7
|
import { randomBytes } from "crypto";
|
|
@@ -58,23 +58,71 @@ var Session = class _Session {
|
|
|
58
58
|
reset() {
|
|
59
59
|
this.write({ t: "reset" });
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
records() {
|
|
62
62
|
if (!existsSync(this.file)) return [];
|
|
63
|
-
|
|
63
|
+
const out = [];
|
|
64
64
|
for (const line of readFileSync(this.file, "utf8").split("\n")) {
|
|
65
65
|
if (!line.trim()) continue;
|
|
66
|
-
let record;
|
|
67
66
|
try {
|
|
68
|
-
|
|
67
|
+
out.push(JSON.parse(line));
|
|
69
68
|
} catch {
|
|
70
|
-
continue;
|
|
71
69
|
}
|
|
70
|
+
}
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
73
|
+
/** What the model continues from: everything after the last reset (after a compaction that is the summary and the recent turns). */
|
|
74
|
+
load() {
|
|
75
|
+
let messages = [];
|
|
76
|
+
for (const record of this.records()) {
|
|
72
77
|
if (record.t === "reset") messages = [];
|
|
73
78
|
else if (record.t === "msg") messages.push(record.m);
|
|
74
79
|
}
|
|
75
80
|
return repairTail(messages);
|
|
76
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* What the user sees on resume: the whole conversation. Compaction only shrinks what the model is sent, so
|
|
84
|
+
* its reset does not hide the older turns here. A real reset (/clear, rewind) still starts over, the
|
|
85
|
+
* synthetic summary pair is never shown, and the recent turns a compaction re-writes are not shown twice.
|
|
86
|
+
*/
|
|
87
|
+
loadHistory() {
|
|
88
|
+
const segments = [[]];
|
|
89
|
+
for (const record of this.records()) {
|
|
90
|
+
if (record.t === "reset") segments.push([]);
|
|
91
|
+
else if (record.t === "msg") segments[segments.length - 1].push(record.m);
|
|
92
|
+
}
|
|
93
|
+
let shown = segments[0];
|
|
94
|
+
for (const segment of segments.slice(1)) {
|
|
95
|
+
if (!isCompactionSummary(segment[0])) {
|
|
96
|
+
shown = segment;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const kept = segment.slice(2);
|
|
100
|
+
let at = 0;
|
|
101
|
+
while (at <= shown.length && !endsWithPrefixOf(shown, at, kept)) at++;
|
|
102
|
+
shown = [...shown, ...kept.slice(shown.length - at)];
|
|
103
|
+
}
|
|
104
|
+
return repairTail(shown.filter((m) => !isCompactionSummary(m) && !isCompactionAck(m)));
|
|
105
|
+
}
|
|
77
106
|
};
|
|
107
|
+
var SUMMARY_PREFIX = "Summary of the previous conversation:";
|
|
108
|
+
var SUMMARY_ACK = "OK, I will continue from this summary.";
|
|
109
|
+
function isCompactionSummary(m) {
|
|
110
|
+
return m?.role === "user" && typeof m.content === "string" && m.content.startsWith(SUMMARY_PREFIX);
|
|
111
|
+
}
|
|
112
|
+
function isCompactionAck(m) {
|
|
113
|
+
return m.role === "assistant" && m.content === SUMMARY_ACK;
|
|
114
|
+
}
|
|
115
|
+
function sameMessage(a, b) {
|
|
116
|
+
if (a.role !== b.role) return false;
|
|
117
|
+
if (a.role === "tool" && b.role === "tool") return a.tool_call_id === b.tool_call_id;
|
|
118
|
+
return JSON.stringify(a.content) === JSON.stringify(b.content) && JSON.stringify("tool_calls" in a && a.tool_calls) === JSON.stringify("tool_calls" in b && b.tool_calls);
|
|
119
|
+
}
|
|
120
|
+
function endsWithPrefixOf(shown, at, kept) {
|
|
121
|
+
const n = shown.length - at;
|
|
122
|
+
if (n > kept.length) return false;
|
|
123
|
+
for (let j = 0; j < n; j++) if (!sameMessage(shown[at + j], kept[j])) return false;
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
78
126
|
function pruneSessions(home, now = Date.now(), maxAgeDays = 30) {
|
|
79
127
|
const root = join(home, "sessions");
|
|
80
128
|
if (!existsSync(root)) return 0;
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
REASONING_LEVELS,
|
|
7
7
|
isReasoningLevel
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SNKVS26H.js";
|
|
9
9
|
import {
|
|
10
10
|
ConfigError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NDEJUL44.js";
|
|
12
12
|
import {
|
|
13
13
|
parseLang,
|
|
14
14
|
t
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XLC6T4SX.js";
|
|
16
16
|
|
|
17
17
|
// src/args.ts
|
|
18
18
|
import { parseArgs } from "util";
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
removeCredential,
|
|
7
7
|
saveCredential
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NDEJUL44.js";
|
|
9
9
|
import {
|
|
10
10
|
t
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XLC6T4SX.js";
|
|
12
12
|
|
|
13
13
|
// src/login.ts
|
|
14
14
|
function readSecret(prompt) {
|
|
@@ -91,8 +91,8 @@ function defaultLoginDeps() {
|
|
|
91
91
|
fetch: globalThis.fetch,
|
|
92
92
|
// Wiring NYATA jalur lama: persis runLogin lama (provider add + prompt key).
|
|
93
93
|
legacyAdd: async (providerId, targetCwd) => {
|
|
94
|
-
const { runProviderCommand } = await import("./providerCli-
|
|
95
|
-
const { parseCliArgs: parse } = await import("./args-
|
|
94
|
+
const { runProviderCommand } = await import("./providerCli-EUZGKP5F.js");
|
|
95
|
+
const { parseCliArgs: parse } = await import("./args-2R45YZ42.js");
|
|
96
96
|
return runProviderCommand(parse(["provider", "add", providerId]), {
|
|
97
97
|
env: process.env,
|
|
98
98
|
cwd: targetCwd,
|
|
@@ -117,12 +117,12 @@ async function runLogin(providerId, cwd, args, deps) {
|
|
|
117
117
|
);
|
|
118
118
|
return 1;
|
|
119
119
|
}
|
|
120
|
-
const { runOauthLogout } = await import("./oauthLogin-
|
|
120
|
+
const { runOauthLogout } = await import("./oauthLogin-VESMXG4M.js");
|
|
121
121
|
return runOauthLogout({ out: deps.out, err: deps.err, env: deps.env, removeCredential: deps.removeCredential });
|
|
122
122
|
}
|
|
123
123
|
if (args.key) return deps.legacyAdd(providerId, cwd);
|
|
124
124
|
if (providerId === "openrouter") {
|
|
125
|
-
const { runOauthLogin } = await import("./oauthLogin-
|
|
125
|
+
const { runOauthLogin } = await import("./oauthLogin-VESMXG4M.js");
|
|
126
126
|
return runOauthLogin({
|
|
127
127
|
out: deps.out,
|
|
128
128
|
err: deps.err,
|
|
@@ -20,11 +20,11 @@ import {
|
|
|
20
20
|
parseFrontmatter,
|
|
21
21
|
runHooks,
|
|
22
22
|
validateGlobPattern
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-YIYX3FFS.js";
|
|
24
24
|
import {
|
|
25
25
|
createWebSearchTool,
|
|
26
26
|
fetchTool
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-DP7EBW53.js";
|
|
28
28
|
import {
|
|
29
29
|
defineTool
|
|
30
30
|
} from "./chunk-PSO7R5AD.js";
|
|
@@ -33,38 +33,38 @@ import {
|
|
|
33
33
|
} from "./chunk-GAFJEQTJ.js";
|
|
34
34
|
import {
|
|
35
35
|
addProviderKey
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-N7KP6RNP.js";
|
|
37
37
|
import {
|
|
38
38
|
listAllModels
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-QXOV4DUZ.js";
|
|
40
40
|
import {
|
|
41
41
|
providerName
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-2QYHSESB.js";
|
|
43
43
|
import {
|
|
44
44
|
FileOAuthProvider,
|
|
45
45
|
hasStoredTokens
|
|
46
46
|
} from "./chunk-7F3IWBPQ.js";
|
|
47
47
|
import {
|
|
48
48
|
Session
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-F6ACN47V.js";
|
|
50
50
|
import {
|
|
51
51
|
completionAssistantMessage,
|
|
52
52
|
createProvider,
|
|
53
53
|
hasPendingProgrammaticReplay,
|
|
54
54
|
imageUserMessage
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-R4BJBTWC.js";
|
|
56
56
|
import {
|
|
57
57
|
expandEnvVars
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-H73FO5YK.js";
|
|
59
59
|
import {
|
|
60
60
|
ConfigError,
|
|
61
61
|
bccliHome,
|
|
62
62
|
loadConfig,
|
|
63
63
|
resolveModel
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-NDEJUL44.js";
|
|
65
65
|
import {
|
|
66
66
|
t
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-XLC6T4SX.js";
|
|
68
68
|
|
|
69
69
|
// src/textToolCalls.ts
|
|
70
70
|
var PAIR = /(?:<arg_key>\s*|`)?([A-Za-z_]\w*)(?:\s*<\/arg_key>)?`?\s*(?:=\s*`|<arg_value>)([\s\S]*?)<\/arg_value>/g;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
listAllModels
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QXOV4DUZ.js";
|
|
5
5
|
import {
|
|
6
6
|
hasKey,
|
|
7
7
|
providerName,
|
|
8
8
|
removeGlobalProvider,
|
|
9
9
|
writeGlobalConfig
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2QYHSESB.js";
|
|
11
11
|
import {
|
|
12
12
|
PRESETS,
|
|
13
13
|
loadConfig,
|
|
14
14
|
saveCredential
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NDEJUL44.js";
|
|
16
16
|
import {
|
|
17
17
|
t
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-XLC6T4SX.js";
|
|
19
19
|
|
|
20
20
|
// src/providerCli.ts
|
|
21
21
|
async function addProviderKey(providerId, key, deps) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
t
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XLC6T4SX.js";
|
|
5
5
|
|
|
6
6
|
// src/config.ts
|
|
7
7
|
import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "fs";
|
|
@@ -101,6 +101,14 @@ function resolvedMaxSteps(global) {
|
|
|
101
101
|
}
|
|
102
102
|
return Math.max(1, Math.floor(value));
|
|
103
103
|
}
|
|
104
|
+
function resolvedSessionRetentionDays(global) {
|
|
105
|
+
const value = global.sessionRetentionDays;
|
|
106
|
+
if (value === void 0 || value === null || value === 0) return null;
|
|
107
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
|
|
108
|
+
throw new ConfigError(t("sessionRetentionDays must be a positive number of days, or 0/null to keep sessions."));
|
|
109
|
+
}
|
|
110
|
+
return Math.max(1, Math.floor(value));
|
|
111
|
+
}
|
|
104
112
|
function resolvedNetworkPolicy(global) {
|
|
105
113
|
const value = global.networkPolicy ?? "allow";
|
|
106
114
|
if (value !== "allow" && value !== "offline") {
|
|
@@ -234,6 +242,7 @@ function loadConfig(cwd, env = process.env) {
|
|
|
234
242
|
reasoning: global.reasoning ?? DEFAULT_CONFIG.reasoning,
|
|
235
243
|
thinkingVisible: global.thinkingVisible === true,
|
|
236
244
|
thinkingClickCollapse: global.thinkingClickCollapse === true,
|
|
245
|
+
sessionRetentionDays: resolvedSessionRetentionDays(global),
|
|
237
246
|
maxSteps: resolvedMaxSteps(global),
|
|
238
247
|
hooks: global.hooks,
|
|
239
248
|
vision: global.vision ?? DEFAULT_CONFIG.vision,
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
hasKey,
|
|
4
4
|
providerName
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2QYHSESB.js";
|
|
6
6
|
import {
|
|
7
7
|
createProvider
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-R4BJBTWC.js";
|
|
9
9
|
import {
|
|
10
10
|
PRESETS,
|
|
11
11
|
readCredentials
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NDEJUL44.js";
|
|
13
13
|
import {
|
|
14
14
|
t
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XLC6T4SX.js";
|
|
16
16
|
|
|
17
17
|
// src/models.ts
|
|
18
18
|
function order(ids) {
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runCommand,
|
|
4
4
|
runHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YIYX3FFS.js";
|
|
6
6
|
import {
|
|
7
7
|
ConfigError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NDEJUL44.js";
|
|
9
9
|
import {
|
|
10
10
|
t
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XLC6T4SX.js";
|
|
12
12
|
|
|
13
13
|
// src/verify.ts
|
|
14
14
|
var MAX_VERIFY_ROUNDS = 2;
|
|
@@ -266,6 +266,7 @@ Opsi:
|
|
|
266
266
|
"--output-format must be one of: {formats}": "--output-format harus salah satu dari: {formats}",
|
|
267
267
|
"Invalid config: {path} ({error})": "Config tidak valid: {path} ({error})",
|
|
268
268
|
"maxSteps must be a positive number, or 0/null to disable the limit.": "maxSteps harus berupa angka positif, atau 0/null untuk menonaktifkan batas.",
|
|
269
|
+
"sessionRetentionDays must be a positive number of days, or 0/null to keep sessions.": "sessionRetentionDays harus berupa jumlah hari positif, atau 0/null untuk menyimpan sesi.",
|
|
269
270
|
"Hook {event} failed: {reason}": "Hook {event} gagal: {reason}",
|
|
270
271
|
"list background tasks": "daftar tugas latar belakang",
|
|
271
272
|
"Nothing to rewind.": "Tidak ada yang bisa di-rewind.",
|
package/dist/cli.js
CHANGED
|
@@ -2,47 +2,47 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resolveWorktree,
|
|
4
4
|
runPrint
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TQWCM5RO.js";
|
|
6
6
|
import {
|
|
7
7
|
createRuntime
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KIZC5XV4.js";
|
|
9
9
|
import "./chunk-QZKLZELZ.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-YIYX3FFS.js";
|
|
11
|
+
import "./chunk-DP7EBW53.js";
|
|
12
12
|
import "./chunk-PSO7R5AD.js";
|
|
13
13
|
import {
|
|
14
14
|
VERSION
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EUCSCUYP.js";
|
|
16
16
|
import {
|
|
17
17
|
helpText,
|
|
18
18
|
parseCliArgs
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-FTFVW7XD.js";
|
|
20
20
|
import "./chunk-GAFJEQTJ.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-N7KP6RNP.js";
|
|
22
|
+
import "./chunk-QXOV4DUZ.js";
|
|
23
23
|
import {
|
|
24
24
|
readGlobalConfigFile
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-2QYHSESB.js";
|
|
26
26
|
import {
|
|
27
27
|
defaultLoginDeps,
|
|
28
28
|
runLogin
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-KD2LMIS4.js";
|
|
30
30
|
import "./chunk-7F3IWBPQ.js";
|
|
31
31
|
import {
|
|
32
32
|
pruneSessions
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-F6ACN47V.js";
|
|
34
|
+
import "./chunk-R4BJBTWC.js";
|
|
35
|
+
import "./chunk-SNKVS26H.js";
|
|
36
|
+
import "./chunk-H73FO5YK.js";
|
|
37
37
|
import {
|
|
38
38
|
ConfigError,
|
|
39
39
|
setTheme
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-NDEJUL44.js";
|
|
41
41
|
import {
|
|
42
42
|
resolveLanguage,
|
|
43
43
|
setLanguage,
|
|
44
44
|
t
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-XLC6T4SX.js";
|
|
46
46
|
|
|
47
47
|
// src/exit.ts
|
|
48
48
|
var EXIT_GRACE_MS = 1e3;
|
|
@@ -84,17 +84,17 @@ async function main() {
|
|
|
84
84
|
if (args.worktree) cwd = (await resolveWorktree(cwd, args.worktree)).path;
|
|
85
85
|
if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd, args, defaultLoginDeps());
|
|
86
86
|
if (args.command === "mcp") {
|
|
87
|
-
const { runMcpCommand } = await import("./mcpCli-
|
|
88
|
-
const { readSecret } = await import("./login-
|
|
87
|
+
const { runMcpCommand } = await import("./mcpCli-5QISTOFK.js");
|
|
88
|
+
const { readSecret } = await import("./login-W4Y6WHLV.js");
|
|
89
89
|
return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
90
90
|
}
|
|
91
91
|
if (args.command === "provider") {
|
|
92
|
-
const { runProviderCommand } = await import("./providerCli-
|
|
93
|
-
const { readSecret } = await import("./login-
|
|
92
|
+
const { runProviderCommand } = await import("./providerCli-EUZGKP5F.js");
|
|
93
|
+
const { readSecret } = await import("./login-W4Y6WHLV.js");
|
|
94
94
|
return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
95
95
|
}
|
|
96
96
|
if (args.command === "connect" || args.command === "disconnect" || args.command === "integrations") {
|
|
97
|
-
const { runIntegrationCommand } = await import("./integrationCli-
|
|
97
|
+
const { runIntegrationCommand } = await import("./integrationCli-ZMTSILYF.js");
|
|
98
98
|
return runIntegrationCommand(args, {
|
|
99
99
|
env: process.env,
|
|
100
100
|
cwd,
|
|
@@ -104,20 +104,20 @@ async function main() {
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
if (args.command === "models") {
|
|
107
|
-
const { runModelsCommand } = await import("./modelsCli-
|
|
107
|
+
const { runModelsCommand } = await import("./modelsCli-FZMBD4OE.js");
|
|
108
108
|
return runModelsCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), fetch: globalThis.fetch });
|
|
109
109
|
}
|
|
110
110
|
if (args.command === "update") {
|
|
111
|
-
const { runUpdateCommand } = await import("./update-
|
|
111
|
+
const { runUpdateCommand } = await import("./update-IQR346E5.js");
|
|
112
112
|
return runUpdateCommand({ env: process.env });
|
|
113
113
|
}
|
|
114
114
|
if (args.command === "acp") {
|
|
115
|
-
const { runtimeAgent, runAcp } = await import("./acp-
|
|
115
|
+
const { runtimeAgent, runAcp } = await import("./acp-V5RP42VB.js");
|
|
116
116
|
await runAcp(process.stdin, process.stdout, { cwd, newAgent: (c) => runtimeAgent(c) });
|
|
117
117
|
return 0;
|
|
118
118
|
}
|
|
119
119
|
if (args.command === "serve") {
|
|
120
|
-
const { startServe } = await import("./serve-
|
|
120
|
+
const { startServe } = await import("./serve-XDHMB7TO.js");
|
|
121
121
|
const handle = await startServe({ port: args.port, host: args.host, token: args.token, cwd, env: process.env });
|
|
122
122
|
process.stderr.write(`bccli serve ${handle.url} \u2014 Authorization: Bearer ${handle.token}
|
|
123
123
|
`);
|
|
@@ -131,8 +131,8 @@ async function main() {
|
|
|
131
131
|
return 0;
|
|
132
132
|
}
|
|
133
133
|
if (args.command === "plugins") {
|
|
134
|
-
const { runPluginsCommand } = await import("./pluginsCli-
|
|
135
|
-
const { readGlobalPlugins, updateGlobalConfig } = await import("./config-
|
|
134
|
+
const { runPluginsCommand } = await import("./pluginsCli-GEHR7FQR.js");
|
|
135
|
+
const { readGlobalPlugins, updateGlobalConfig } = await import("./config-H5A7XHHK.js");
|
|
136
136
|
const { runNpmSync } = await import("./npmRunner-LU43GM3W.js");
|
|
137
137
|
return runPluginsCommand(args, {
|
|
138
138
|
out: (s) => console.log(s),
|
|
@@ -146,41 +146,41 @@ async function main() {
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
if (args.command === "gh-bot") {
|
|
149
|
-
const { runGhBotCommand } = await import("./ghBotCli-
|
|
149
|
+
const { runGhBotCommand } = await import("./ghBotCli-7WDYF4L7.js");
|
|
150
150
|
return runGhBotCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s) });
|
|
151
151
|
}
|
|
152
152
|
if (args.command === "completion") {
|
|
153
|
-
const { runCompletionCommand } = await import("./completion-
|
|
153
|
+
const { runCompletionCommand } = await import("./completion-OV3MW2N4.js");
|
|
154
154
|
return runCompletionCommand(args, { out: (s) => console.log(s), err: (s) => console.error(s) });
|
|
155
155
|
}
|
|
156
156
|
if (args.command === "stats") {
|
|
157
|
-
const { runStatsCommand } = await import("./statsCli-
|
|
158
|
-
const { bccliHome } = await import("./config-
|
|
157
|
+
const { runStatsCommand } = await import("./statsCli-H4HEY5ID.js");
|
|
158
|
+
const { bccliHome } = await import("./config-H5A7XHHK.js");
|
|
159
159
|
return runStatsCommand(
|
|
160
160
|
{ subArgs: args.subArgs, home: bccliHome(process.env), cwd, days: args.days, tools: args.tools, models: args.models, project: args.project },
|
|
161
161
|
{ out: (s) => console.log(s), err: (s) => console.error(s) }
|
|
162
162
|
);
|
|
163
163
|
}
|
|
164
164
|
if (args.command === "export" || args.command === "import") {
|
|
165
|
-
const { runExportCommand, runImportCommand } = await import("./transferCli-
|
|
166
|
-
const { bccliHome } = await import("./config-
|
|
165
|
+
const { runExportCommand, runImportCommand } = await import("./transferCli-2XUKBG2L.js");
|
|
166
|
+
const { bccliHome } = await import("./config-H5A7XHHK.js");
|
|
167
167
|
const deps = { subArgs: args.subArgs, home: bccliHome(process.env), cwd };
|
|
168
168
|
const io = { out: (s) => console.log(s), err: (s) => console.error(s) };
|
|
169
169
|
return args.command === "export" ? runExportCommand(deps, io) : runImportCommand(deps, io);
|
|
170
170
|
}
|
|
171
171
|
if (args.command === "pr") {
|
|
172
|
-
const { runPrCommand } = await import("./prCli-
|
|
172
|
+
const { runPrCommand } = await import("./prCli-JXA7DJW4.js");
|
|
173
173
|
return runPrCommand({ subArgs: args.subArgs, cwd }, { out: (s) => console.log(s), err: (s) => console.error(s) });
|
|
174
174
|
}
|
|
175
175
|
const rt = createRuntime({ cwd, args });
|
|
176
176
|
setTheme(rt.config.theme);
|
|
177
177
|
try {
|
|
178
|
-
pruneSessions(rt.home);
|
|
178
|
+
if (rt.config.sessionRetentionDays) pruneSessions(rt.home, Date.now(), rt.config.sessionRetentionDays);
|
|
179
179
|
} catch {
|
|
180
180
|
}
|
|
181
181
|
if (args.print) {
|
|
182
182
|
if (!args.prompt) throw new ConfigError(t('-p mode needs a task, e.g. bccli -p "explain this repo"'));
|
|
183
|
-
const { serversToStart } = await import("./config-
|
|
183
|
+
const { serversToStart } = await import("./config-AZZFOXKV.js");
|
|
184
184
|
const plan = serversToStart(rt.home, cwd);
|
|
185
185
|
for (const s of plan.needTrust) {
|
|
186
186
|
console.error(t('Project MCP server "{name}" skipped (not approved yet; run interactive bccli once to approve it).', { name: s.name }));
|
|
@@ -195,13 +195,13 @@ async function main() {
|
|
|
195
195
|
if (!process.stdin.isTTY) throw new ConfigError(t('Interactive mode needs a terminal. For scripts/CI use: bccli -p "task"'));
|
|
196
196
|
if (rt.config.updateCheck !== "off" && !process.env.BCCLI_NO_UPDATE_CHECK) {
|
|
197
197
|
try {
|
|
198
|
-
const { checkForUpdate } = await import("./update-
|
|
198
|
+
const { checkForUpdate } = await import("./update-IQR346E5.js");
|
|
199
199
|
const update = await checkForUpdate({ home: rt.home, fetch: globalThis.fetch, now: /* @__PURE__ */ new Date() });
|
|
200
200
|
if (update) console.error(update);
|
|
201
201
|
} catch {
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
const { startInteractive } = await import("./ui-
|
|
204
|
+
const { startInteractive } = await import("./ui-6HJVYI46.js");
|
|
205
205
|
return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION });
|
|
206
206
|
}
|
|
207
207
|
main().then(
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
removeGlobalServer,
|
|
10
10
|
serversToStart,
|
|
11
11
|
setProjectTrust
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-H73FO5YK.js";
|
|
13
|
+
import "./chunk-NDEJUL44.js";
|
|
14
|
+
import "./chunk-XLC6T4SX.js";
|
|
15
15
|
export {
|
|
16
16
|
addGlobalServer,
|
|
17
17
|
expandEnvVars,
|