@botconnector/bccli 0.4.10 → 0.4.12
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-L4WGVJTY.js → acp-JZW3XHE5.js} +20 -5
- package/dist/acp.d.ts +17 -1
- package/dist/args-XVO7TB4C.js +13 -0
- package/dist/budget.d.ts +4 -1
- package/dist/{chunk-67REFMSY.js → chunk-3CYQYHPK.js} +1 -1
- package/dist/{chunk-VXRW5SYP.js → chunk-6JK4IBGK.js} +25 -14
- package/dist/{chunk-MPYSYTSO.js → chunk-6SDRWEPN.js} +1 -1
- package/dist/{chunk-4WI5ON64.js → chunk-7GM6NN5E.js} +1 -1
- package/dist/{chunk-6RVAPAE5.js → chunk-7XD47KN5.js} +1 -1
- package/dist/{chunk-SXRQ2Q7A.js → chunk-INMSTUB2.js} +4 -4
- package/dist/{chunk-CIEPLTGS.js → chunk-ISOKH5WB.js} +5 -5
- package/dist/{chunk-6N2BBLIT.js → chunk-JUC3ZOCV.js} +2 -2
- package/dist/{chunk-3PUWH62K.js → chunk-KDVL2NP6.js} +34 -50
- package/dist/{chunk-24KDXQZT.js → chunk-KEKDRROL.js} +3 -3
- package/dist/{chunk-ZWXKBFKW.js → chunk-KJIXA6MP.js} +23 -9
- package/dist/{chunk-CBD52BYV.js → chunk-OFMZ6CE6.js} +1 -1
- package/dist/{chunk-7HDBPDAD.js → chunk-Q42ZGVAQ.js} +2 -2
- package/dist/{chunk-ED5TTYQU.js → chunk-R754XIBJ.js} +11 -3
- package/dist/{chunk-3K66L37W.js → chunk-S3QEZDKB.js} +3 -3
- package/dist/{chunk-PGDYPOQW.js → chunk-SWNRA3EW.js} +4 -4
- package/dist/{chunk-USFXL5BS.js → chunk-TLCL6DC7.js} +6 -6
- package/dist/{chunk-WFZKJY3R.js → chunk-YYTFJUO2.js} +3 -2
- package/dist/{chunk-5QCCV2JM.js → chunk-ZJRZTMJF.js} +47 -18
- package/dist/cli.js +39 -39
- package/dist/{completion-GEFRIQWV.js → completion-Q7VHOPPV.js} +1 -1
- package/dist/{config-JKMYKNAT.js → config-T7MKGJVG.js} +2 -2
- package/dist/{config-JLOH5M6B.js → config-YYEAEN2C.js} +3 -3
- package/dist/{ghBotCli-WEVS6S6O.js → ghBotCli-7VUGI63S.js} +18 -16
- package/dist/{integrationCli-PKMICTHC.js → integrationCli-TO42MBZB.js} +192 -12
- package/dist/{login-2TZRODUL.js → login-BSMUGW7L.js} +6 -4
- package/dist/login.d.ts +2 -0
- package/dist/{mcpCli-TAPKYGHO.js → mcpCli-ZT7CRYMP.js} +6 -6
- package/dist/{modelsCli-6PK7V2QZ.js → modelsCli-2ZRW4CC4.js} +6 -6
- package/dist/{oauthLogin-UI34LQZU.js → oauthLogin-THSM6FE7.js} +1 -1
- package/dist/{pluginsCli-RCF33U5J.js → pluginsCli-EKQI4CJW.js} +2 -2
- package/dist/{prCli-24PMW7NS.js → prCli-FMQTOBIV.js} +1 -1
- package/dist/providerCli-3TFEKV4C.js +15 -0
- package/dist/sdk.js +111 -75
- package/dist/{serve-7BFCIEPJ.js → serve-DC6YICSK.js} +16 -16
- package/dist/{serve-XNJI67DU.js → serve-V6YVZTNR.js} +3 -3
- package/dist/session-LX4UNPCD.js +12 -0
- package/dist/setup-MFG3BWEU.js +24 -0
- package/dist/setup.d.ts +5 -0
- package/dist/{statsCli-QDHE4TKB.js → statsCli-7MIQHLVW.js} +2 -2
- package/dist/tools/bash.d.ts +2 -0
- package/dist/{transferCli-7OKKYGG2.js → transferCli-SRSYQLSJ.js} +4 -4
- package/dist/{ui-SZAIIJC5.js → ui-IMCUSB6Q.js} +14 -14
- package/dist/{update-JSNVVXPS.js → update-POT5W6MC.js} +2 -2
- package/package.json +1 -1
- package/dist/args-EW7XJVQN.js +0 -13
- package/dist/providerCli-XA4LTWRD.js +0 -15
- package/dist/session-VAPIHHUG.js +0 -12
- package/dist/setup-GPIMZOWE.js +0 -24
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
t
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-R754XIBJ.js";
|
|
5
5
|
|
|
6
6
|
// src/config.ts
|
|
7
7
|
import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "fs";
|
|
@@ -149,6 +149,9 @@ function resolvedUsageCap(global) {
|
|
|
149
149
|
if (!price || !nonNegative(price.input) || !nonNegative(price.output)) {
|
|
150
150
|
throw new ConfigError(t('usageCap.prices["{key}"] must have numeric input and output (USD per 1M tokens).', { key }));
|
|
151
151
|
}
|
|
152
|
+
if (price.cachedInput !== void 0 && !nonNegative(price.cachedInput)) {
|
|
153
|
+
throw new ConfigError(t('usageCap.prices["{key}"].cachedInput must be a number >= 0 (USD per 1M tokens).', { key }));
|
|
154
|
+
}
|
|
152
155
|
}
|
|
153
156
|
}
|
|
154
157
|
if (tokens === void 0 && usd === void 0) throw new ConfigError(t("usageCap needs at least one of: tokens, usd."));
|
|
@@ -236,7 +239,7 @@ function loadConfig(cwd, env = process.env) {
|
|
|
236
239
|
const project = readJsonConfig(join(cwd, ".bccli", "config.json"));
|
|
237
240
|
const known = { ...DEFAULT_CONFIG.providers, ...global.providers };
|
|
238
241
|
const fromProject = untrustedProviders(project, known);
|
|
239
|
-
const rawFallbacks =
|
|
242
|
+
const rawFallbacks = global.fallbackModels;
|
|
240
243
|
const fallbackModels = Array.isArray(rawFallbacks) ? rawFallbacks.filter((m) => typeof m === "string" && m.includes("/")) : void 0;
|
|
241
244
|
return {
|
|
242
245
|
model: project.model ?? global.model ?? DEFAULT_CONFIG.model,
|
|
@@ -305,10 +308,7 @@ function quarantineCorruptFile(path, error) {
|
|
|
305
308
|
}
|
|
306
309
|
function updateGlobalConfig(env, mutate) {
|
|
307
310
|
const path = globalConfigPath(env);
|
|
308
|
-
|
|
309
|
-
if (existsSync(path)) {
|
|
310
|
-
cfg = JSON.parse(readFileSync(path, "utf8"));
|
|
311
|
-
}
|
|
311
|
+
const cfg = existsSync(path) ? readJsonConfig(path) : {};
|
|
312
312
|
mutate(cfg);
|
|
313
313
|
mkdirSync(dirname(path), { recursive: true });
|
|
314
314
|
writeFileAtomic(path, `${JSON.stringify(cfg, null, 2)}
|
|
@@ -94,7 +94,7 @@ var Permissions = class {
|
|
|
94
94
|
}
|
|
95
95
|
/** Rules that "[a] allow for this session" would add; undefined when it must always be asked. */
|
|
96
96
|
rulesFor(req) {
|
|
97
|
-
if (requiresSensitiveToolApproval(req) && (req.kind === "read" || process.env.BC_TOOL_POLICY_ENFORCE === "true"))
|
|
97
|
+
if (requiresSensitiveToolApproval(req) && (req.kind === "read" || req.kind === "edit" || process.env.BC_TOOL_POLICY_ENFORCE === "true"))
|
|
98
98
|
return void 0;
|
|
99
99
|
if (req.kind === "edit") return this.editInProject(req.target) ? ["edit(project)"] : void 0;
|
|
100
100
|
if (req.kind === "fetch") {
|
|
@@ -116,7 +116,8 @@ var Permissions = class {
|
|
|
116
116
|
}
|
|
117
117
|
check(req) {
|
|
118
118
|
if (this.mode === "plan" && req.kind !== "read") return "deny";
|
|
119
|
-
if (req.kind === "read" && this.mode !== "allowAll" && requiresSensitiveToolApproval(req))
|
|
119
|
+
if ((req.kind === "read" || req.kind === "edit") && this.mode !== "allowAll" && requiresSensitiveToolApproval(req))
|
|
120
|
+
return "ask";
|
|
120
121
|
if (process.env.BC_TOOL_POLICY_ENFORCE === "true" && requiresSensitiveToolApproval(req)) return "ask";
|
|
121
122
|
if (req.kind === "read") return "allow";
|
|
122
123
|
if (this.mode === "allowAll") return "allow";
|
|
@@ -24,52 +24,52 @@ import {
|
|
|
24
24
|
resolvePath,
|
|
25
25
|
runHooks,
|
|
26
26
|
validateGlobPattern
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-KDVL2NP6.js";
|
|
28
28
|
import {
|
|
29
29
|
createWebSearchTool,
|
|
30
30
|
fetchTool
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-7GM6NN5E.js";
|
|
32
32
|
import {
|
|
33
33
|
defineTool
|
|
34
34
|
} from "./chunk-PSO7R5AD.js";
|
|
35
35
|
import {
|
|
36
36
|
Permissions
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-YYTFJUO2.js";
|
|
38
38
|
import {
|
|
39
39
|
addProviderKey
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-SWNRA3EW.js";
|
|
41
41
|
import {
|
|
42
42
|
listAllModels
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-INMSTUB2.js";
|
|
44
44
|
import {
|
|
45
45
|
providerName
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-6SDRWEPN.js";
|
|
47
47
|
import {
|
|
48
48
|
FileOAuthProvider,
|
|
49
49
|
hasStoredTokens
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-3CYQYHPK.js";
|
|
51
51
|
import {
|
|
52
52
|
Session
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-KEKDRROL.js";
|
|
54
54
|
import {
|
|
55
55
|
completionAssistantMessage,
|
|
56
56
|
createProvider,
|
|
57
57
|
hasPendingProgrammaticReplay,
|
|
58
58
|
imageUserMessage,
|
|
59
59
|
withFallbackProvider
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-6JK4IBGK.js";
|
|
61
61
|
import {
|
|
62
62
|
expandEnvVars
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-Q42ZGVAQ.js";
|
|
64
64
|
import {
|
|
65
65
|
ConfigError,
|
|
66
66
|
bccliHome,
|
|
67
67
|
loadConfig,
|
|
68
68
|
resolveModel
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-TLCL6DC7.js";
|
|
70
70
|
import {
|
|
71
71
|
t
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-R754XIBJ.js";
|
|
73
73
|
|
|
74
74
|
// src/textToolCalls.ts
|
|
75
75
|
var PAIR = /(?:<arg_key>\s*|`)?([A-Za-z_]\w*)(?:\s*<\/arg_key>)?`?\s*(?:=\s*`|<arg_value>)([\s\S]*?)<\/arg_value>/g;
|
|
@@ -622,6 +622,12 @@ async function readTextResult(input, buffer) {
|
|
|
622
622
|
const lines = buffer.toString("utf8").split(/\r?\n/);
|
|
623
623
|
const start = (input.offset ?? 1) - 1;
|
|
624
624
|
const limit = input.limit ?? 2e3;
|
|
625
|
+
if (start >= lines.length) {
|
|
626
|
+
return {
|
|
627
|
+
output: `offset ${input.offset} is past the end of ${input.path} (${lines.length} line(s)); start at 1.`,
|
|
628
|
+
isError: true
|
|
629
|
+
};
|
|
630
|
+
}
|
|
625
631
|
const requested = lines.slice(start, start + limit);
|
|
626
632
|
const shown = [];
|
|
627
633
|
let size = 0;
|
|
@@ -703,7 +709,9 @@ var writeTool = defineTool({
|
|
|
703
709
|
target: (input) => input.path,
|
|
704
710
|
async validate(input, ctx) {
|
|
705
711
|
const abs = resolvePath(ctx.cwd, input.path);
|
|
706
|
-
|
|
712
|
+
if (existsSync(abs) && !ctx.readFiles.has(abs)) return `${input.path} already exists. Read it with read before overwriting it.`;
|
|
713
|
+
if (isFileModifiedSinceRead(ctx.readFiles, abs)) return `${input.path} has been modified since it was last read. Read it again before overwriting it.`;
|
|
714
|
+
return void 0;
|
|
707
715
|
},
|
|
708
716
|
async preview(input, ctx) {
|
|
709
717
|
const abs = resolvePath(ctx.cwd, input.path);
|
|
@@ -715,6 +723,9 @@ var writeTool = defineTool({
|
|
|
715
723
|
if (existsSync(abs) && !ctx.readFiles.has(abs)) {
|
|
716
724
|
return { output: `${input.path} already exists. Read it with read before overwriting it.`, isError: true };
|
|
717
725
|
}
|
|
726
|
+
if (isFileModifiedSinceRead(ctx.readFiles, abs)) {
|
|
727
|
+
return { output: `${input.path} has been modified since it was last read. Read it again before overwriting it.`, isError: true };
|
|
728
|
+
}
|
|
718
729
|
try {
|
|
719
730
|
await ctx.checkpoint?.(abs);
|
|
720
731
|
await mkdir(dirname2(abs), { recursive: true });
|
|
@@ -824,7 +835,9 @@ function budgetStatus(usage, cap, model) {
|
|
|
824
835
|
if (cap.usd !== void 0) {
|
|
825
836
|
const price = priceFor(cap, model);
|
|
826
837
|
if (price) {
|
|
827
|
-
const
|
|
838
|
+
const cached = Math.max(0, Math.min(usage.cachedInputTokens ?? 0, usage.inputTokens));
|
|
839
|
+
const cachedRate = price.cachedInput ?? price.input;
|
|
840
|
+
const usd = ((usage.inputTokens - cached) * price.input + cached * cachedRate + usage.outputTokens * price.output) / 1e6;
|
|
828
841
|
if (usd >= cap.usd) return { kind: "usd", used: usd, limit: cap.usd };
|
|
829
842
|
}
|
|
830
843
|
}
|
|
@@ -2366,6 +2379,15 @@ function loadPlugins(specs, opts) {
|
|
|
2366
2379
|
|
|
2367
2380
|
// src/setup.ts
|
|
2368
2381
|
var TOOL_RULES = { bash: "bash", edit: "edit", write: "edit", fetch: "fetch" };
|
|
2382
|
+
var pluginCache = /* @__PURE__ */ new Map();
|
|
2383
|
+
function loadPluginsOnce(specs, opts) {
|
|
2384
|
+
const key = JSON.stringify({ specs, home: opts.home, cwd: opts.cwd });
|
|
2385
|
+
const cached = pluginCache.get(key);
|
|
2386
|
+
if (cached) return cached;
|
|
2387
|
+
const loaded = loadPlugins(specs, opts);
|
|
2388
|
+
pluginCache.set(key, loaded);
|
|
2389
|
+
return loaded;
|
|
2390
|
+
}
|
|
2369
2391
|
function lunaPtcAutoEnabled(env) {
|
|
2370
2392
|
const value = String(env.BCCLI_LUNA_PTC ?? "").trim().toLowerCase();
|
|
2371
2393
|
return !["0", "false", "off", "no"].includes(value);
|
|
@@ -2373,6 +2395,7 @@ function lunaPtcAutoEnabled(env) {
|
|
|
2373
2395
|
function createRuntime(opts) {
|
|
2374
2396
|
const env = opts.env ?? process.env;
|
|
2375
2397
|
const home = bccliHome(env);
|
|
2398
|
+
const persistSession = opts.persistSession !== false;
|
|
2376
2399
|
let config = loadConfig(opts.cwd, env);
|
|
2377
2400
|
let modelRef = opts.args.model ?? config.model;
|
|
2378
2401
|
let reasoning = opts.args.reasoning ?? config.reasoning;
|
|
@@ -2461,7 +2484,7 @@ function createRuntime(opts) {
|
|
|
2461
2484
|
createRepoMapTool()
|
|
2462
2485
|
];
|
|
2463
2486
|
if (config.lsp?.servers.length) baseTools.push(createDiagnosticsTool(config.lsp.servers));
|
|
2464
|
-
const plugins =
|
|
2487
|
+
const plugins = loadPluginsOnce(config.plugins ?? [], {
|
|
2465
2488
|
home,
|
|
2466
2489
|
cwd: opts.cwd,
|
|
2467
2490
|
env,
|
|
@@ -2499,9 +2522,15 @@ function createRuntime(opts) {
|
|
|
2499
2522
|
usageCap: config.usageCap,
|
|
2500
2523
|
budgetModel: modelRef,
|
|
2501
2524
|
contextWindow: contextWindowFor(modelRef, env),
|
|
2502
|
-
onMessage: (m) =>
|
|
2503
|
-
|
|
2504
|
-
|
|
2525
|
+
onMessage: (m) => {
|
|
2526
|
+
if (persistSession) session.append(m);
|
|
2527
|
+
},
|
|
2528
|
+
onUsage: (u) => {
|
|
2529
|
+
if (persistSession) session.appendUsage({ ...u, model: modelRef });
|
|
2530
|
+
},
|
|
2531
|
+
onReset: () => {
|
|
2532
|
+
if (persistSession) session.reset();
|
|
2533
|
+
},
|
|
2505
2534
|
onTurnStart: () => {
|
|
2506
2535
|
for (let i = turnMarks.length - 1; i >= 0 && turnMarks[i] > agent.messages.length; i--) {
|
|
2507
2536
|
turnMarks.splice(i, 1);
|
package/dist/cli.js
CHANGED
|
@@ -3,47 +3,47 @@ import {
|
|
|
3
3
|
resolvePrintPrompt,
|
|
4
4
|
resolveWorktree,
|
|
5
5
|
runPrint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-S3QEZDKB.js";
|
|
7
7
|
import {
|
|
8
8
|
createRuntime
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZJRZTMJF.js";
|
|
10
10
|
import "./chunk-OK2USAXX.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-KDVL2NP6.js";
|
|
12
|
+
import "./chunk-7GM6NN5E.js";
|
|
13
13
|
import "./chunk-PSO7R5AD.js";
|
|
14
14
|
import {
|
|
15
15
|
VERSION
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OFMZ6CE6.js";
|
|
17
17
|
import {
|
|
18
18
|
helpText,
|
|
19
19
|
parseCliArgs
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-ISOKH5WB.js";
|
|
21
|
+
import "./chunk-YYTFJUO2.js";
|
|
22
|
+
import "./chunk-SWNRA3EW.js";
|
|
23
|
+
import "./chunk-INMSTUB2.js";
|
|
24
24
|
import {
|
|
25
25
|
readGlobalConfigFile
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6SDRWEPN.js";
|
|
27
27
|
import {
|
|
28
28
|
defaultLoginDeps,
|
|
29
29
|
runLogin
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-KJIXA6MP.js";
|
|
31
|
+
import "./chunk-3CYQYHPK.js";
|
|
32
32
|
import {
|
|
33
33
|
pruneSessions
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
34
|
+
} from "./chunk-KEKDRROL.js";
|
|
35
|
+
import "./chunk-6JK4IBGK.js";
|
|
36
|
+
import "./chunk-7XD47KN5.js";
|
|
37
|
+
import "./chunk-Q42ZGVAQ.js";
|
|
38
38
|
import {
|
|
39
39
|
ConfigError,
|
|
40
40
|
setTheme
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-TLCL6DC7.js";
|
|
42
42
|
import {
|
|
43
43
|
resolveLanguage,
|
|
44
44
|
setLanguage,
|
|
45
45
|
t
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-R754XIBJ.js";
|
|
47
47
|
|
|
48
48
|
// src/exit.ts
|
|
49
49
|
var EXIT_GRACE_MS = 1e3;
|
|
@@ -85,17 +85,17 @@ async function main() {
|
|
|
85
85
|
if (args.worktree) cwd = (await resolveWorktree(cwd, args.worktree)).path;
|
|
86
86
|
if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd, args, defaultLoginDeps());
|
|
87
87
|
if (args.command === "mcp") {
|
|
88
|
-
const { runMcpCommand } = await import("./mcpCli-
|
|
89
|
-
const { readSecret } = await import("./login-
|
|
88
|
+
const { runMcpCommand } = await import("./mcpCli-ZT7CRYMP.js");
|
|
89
|
+
const { readSecret } = await import("./login-BSMUGW7L.js");
|
|
90
90
|
return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
91
91
|
}
|
|
92
92
|
if (args.command === "provider") {
|
|
93
|
-
const { runProviderCommand } = await import("./providerCli-
|
|
94
|
-
const { readSecret } = await import("./login-
|
|
93
|
+
const { runProviderCommand } = await import("./providerCli-3TFEKV4C.js");
|
|
94
|
+
const { readSecret } = await import("./login-BSMUGW7L.js");
|
|
95
95
|
return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
96
96
|
}
|
|
97
97
|
if (args.command === "connect" || args.command === "disconnect" || args.command === "integrations") {
|
|
98
|
-
const { runIntegrationCommand } = await import("./integrationCli-
|
|
98
|
+
const { runIntegrationCommand } = await import("./integrationCli-TO42MBZB.js");
|
|
99
99
|
return runIntegrationCommand(args, {
|
|
100
100
|
env: process.env,
|
|
101
101
|
cwd,
|
|
@@ -105,20 +105,20 @@ async function main() {
|
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
if (args.command === "models") {
|
|
108
|
-
const { runModelsCommand } = await import("./modelsCli-
|
|
108
|
+
const { runModelsCommand } = await import("./modelsCli-2ZRW4CC4.js");
|
|
109
109
|
return runModelsCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), fetch: globalThis.fetch });
|
|
110
110
|
}
|
|
111
111
|
if (args.command === "update") {
|
|
112
|
-
const { runUpdateCommand } = await import("./update-
|
|
112
|
+
const { runUpdateCommand } = await import("./update-POT5W6MC.js");
|
|
113
113
|
return runUpdateCommand({ env: process.env });
|
|
114
114
|
}
|
|
115
115
|
if (args.command === "acp") {
|
|
116
|
-
const { runtimeAgent, runAcp } = await import("./acp-
|
|
116
|
+
const { runtimeAgent, runAcp } = await import("./acp-JZW3XHE5.js");
|
|
117
117
|
await runAcp(process.stdin, process.stdout, { cwd, newAgent: (c) => runtimeAgent(c, args.allowAll) });
|
|
118
118
|
return 0;
|
|
119
119
|
}
|
|
120
120
|
if (args.command === "serve") {
|
|
121
|
-
const { serveBanner, startServe } = await import("./serve-
|
|
121
|
+
const { serveBanner, startServe } = await import("./serve-DC6YICSK.js");
|
|
122
122
|
const handle = await startServe({ port: args.port, host: args.host, token: args.token, cwd, env: process.env });
|
|
123
123
|
process.stderr.write(serveBanner(handle, { token: args.token }));
|
|
124
124
|
await new Promise((resolve) => {
|
|
@@ -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-EKQI4CJW.js");
|
|
135
|
+
const { readGlobalPlugins, updateGlobalConfig } = await import("./config-T7MKGJVG.js");
|
|
136
136
|
const { runNpmSync } = await import("./npmRunner-LU43GM3W.js");
|
|
137
137
|
return runPluginsCommand(args, {
|
|
138
138
|
out: (s) => console.log(s),
|
|
@@ -146,30 +146,30 @@ 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-7VUGI63S.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-Q7VHOPPV.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-7MIQHLVW.js");
|
|
158
|
+
const { bccliHome } = await import("./config-T7MKGJVG.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-SRSYQLSJ.js");
|
|
166
|
+
const { bccliHome } = await import("./config-T7MKGJVG.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-FMQTOBIV.js");
|
|
173
173
|
return runPrCommand(
|
|
174
174
|
{
|
|
175
175
|
subArgs: args.subArgs,
|
|
@@ -199,7 +199,7 @@ async function main() {
|
|
|
199
199
|
}
|
|
200
200
|
const finalPrompt = resolvePrintPrompt(args.prompt, stdinText);
|
|
201
201
|
if (!finalPrompt) throw new ConfigError(t('-p mode needs a task, e.g. bccli -p "explain this repo"'));
|
|
202
|
-
const { serversToStart } = await import("./config-
|
|
202
|
+
const { serversToStart } = await import("./config-YYEAEN2C.js");
|
|
203
203
|
const plan = serversToStart(rt.home, cwd);
|
|
204
204
|
for (const s of plan.needTrust) {
|
|
205
205
|
console.error(t('Project MCP server "{name}" skipped (not approved yet; run interactive bccli once to approve it).', { name: s.name }));
|
|
@@ -215,13 +215,13 @@ async function main() {
|
|
|
215
215
|
let updateMessage;
|
|
216
216
|
if (rt.config.updateCheck !== "off" && !process.env.BCCLI_NO_UPDATE_CHECK) {
|
|
217
217
|
try {
|
|
218
|
-
const { checkForUpdate } = await import("./update-
|
|
218
|
+
const { checkForUpdate } = await import("./update-POT5W6MC.js");
|
|
219
219
|
const update = await checkForUpdate({ home: rt.home, fetch: globalThis.fetch, now: /* @__PURE__ */ new Date() });
|
|
220
220
|
updateMessage = update;
|
|
221
221
|
} catch {
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
const { startInteractive } = await import("./ui-
|
|
224
|
+
const { startInteractive } = await import("./ui-IMCUSB6Q.js");
|
|
225
225
|
return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION, updateMessage });
|
|
226
226
|
}
|
|
227
227
|
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-Q42ZGVAQ.js";
|
|
13
|
+
import "./chunk-TLCL6DC7.js";
|
|
14
|
+
import "./chunk-R754XIBJ.js";
|
|
15
15
|
export {
|
|
16
16
|
addGlobalServer,
|
|
17
17
|
expandEnvVars,
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createRuntime
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZJRZTMJF.js";
|
|
5
5
|
import "./chunk-OK2USAXX.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-KDVL2NP6.js";
|
|
7
|
+
import "./chunk-7GM6NN5E.js";
|
|
8
8
|
import "./chunk-PSO7R5AD.js";
|
|
9
9
|
import {
|
|
10
10
|
LOOPBACK_BIND,
|
|
11
11
|
parseCliArgs
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-ISOKH5WB.js";
|
|
13
|
+
import "./chunk-YYTFJUO2.js";
|
|
14
|
+
import "./chunk-SWNRA3EW.js";
|
|
15
|
+
import "./chunk-INMSTUB2.js";
|
|
16
|
+
import "./chunk-6SDRWEPN.js";
|
|
17
|
+
import "./chunk-3CYQYHPK.js";
|
|
18
|
+
import "./chunk-KEKDRROL.js";
|
|
19
|
+
import "./chunk-6JK4IBGK.js";
|
|
20
|
+
import "./chunk-7XD47KN5.js";
|
|
21
|
+
import "./chunk-Q42ZGVAQ.js";
|
|
22
22
|
import {
|
|
23
23
|
ConfigError,
|
|
24
24
|
globalConfigPath,
|
|
25
25
|
readJsonConfig
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-TLCL6DC7.js";
|
|
27
27
|
import {
|
|
28
28
|
t
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-R754XIBJ.js";
|
|
30
30
|
|
|
31
31
|
// src/ghBotWebhook.ts
|
|
32
32
|
import { createHmac, timingSafeEqual } from "crypto";
|
|
@@ -531,8 +531,10 @@ function makeRunJob(o, cfg, gh) {
|
|
|
531
531
|
provider: o.provider,
|
|
532
532
|
fetch: o.fetch ?? globalThis.fetch,
|
|
533
533
|
// injectable (review #3)
|
|
534
|
-
maxSteps: cfg.stepLimit
|
|
534
|
+
maxSteps: cfg.stepLimit,
|
|
535
535
|
// the knob the Agent actually uses
|
|
536
|
+
// A draft is one-shot: no session log (and no file per webhook comment).
|
|
537
|
+
persistSession: false
|
|
536
538
|
});
|
|
537
539
|
rt.agent.setSystemPrompt(ghSystemPrompt());
|
|
538
540
|
rt.agent.setTools([]);
|