@botconnector/bccli 0.4.0-beta.36 → 0.4.0-beta.38
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/README.md +1 -0
- package/dist/args-MNVI2OJI.js +13 -0
- package/dist/chunk-3HCOAJEQ.js +190 -0
- package/dist/{chunk-CZMTWXCE.js → chunk-4RMP4CNT.js} +38 -124
- package/dist/{chunk-BTCJNE7R.js → chunk-ASTNW3X2.js} +17 -5
- package/dist/chunk-C6PKRYUX.js +115 -0
- package/dist/chunk-H5N4ST6B.js +149 -0
- package/dist/{chunk-QKWSDZJQ.js → chunk-H66PC2EB.js} +46 -119
- package/dist/{chunk-5LSTEXSG.js → chunk-HPZSXX4W.js} +6 -2
- package/dist/chunk-HXSREA7S.js +785 -0
- package/dist/{chunk-NSCC5VMS.js → chunk-OB7FN66F.js} +2 -2
- package/dist/{chunk-ELML4KVQ.js → chunk-R3ND76LW.js} +16 -2
- package/dist/{chunk-SZRM2VOB.js → chunk-TASYQW7B.js} +23 -2
- package/dist/{chunk-3DHJO7NC.js → chunk-U66JJ6RN.js} +1 -1
- package/dist/{chunk-SJH3YLW4.js → chunk-XFTBML3H.js} +4 -1
- package/dist/{chunk-3NTTXK4Y.js → chunk-YURAIW7A.js} +1 -1
- package/dist/cli.js +633 -290
- package/dist/{config-53MC3AH2.js → config-JRO5EOKZ.js} +5 -2
- package/dist/{integrationCli-JWLY6E7E.js → integrationCli-ZTZTQD2I.js} +4 -2
- package/dist/{login-LKAO5PVR.js → login-THRU4U4L.js} +1 -1
- package/dist/{mcpCli-THHBIX7I.js → mcpCli-5ZSAMBJS.js} +33 -5
- package/dist/providerCli-TGDE3633.js +14 -0
- package/dist/session-TVOWVP6Y.js +12 -0
- package/dist/{ui-I5BTZATT.js → ui-W4C6SRHA.js} +87 -38
- package/package.json +2 -1
- package/dist/args-GJUGK4F4.js +0 -12
- package/dist/chunk-HKHKYFZI.js +0 -297
- package/dist/providerCli-WJXJW3W2.js +0 -12
- package/dist/session-7UB77CEG.js +0 -9
|
@@ -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-TGDE3633.js");
|
|
39
|
+
const { parseCliArgs } = await import("./args-MNVI2OJI.js");
|
|
40
40
|
return runProviderCommand(parseCliArgs(["provider", "add", providerId]), {
|
|
41
41
|
env: process.env,
|
|
42
42
|
cwd,
|
|
@@ -6,10 +6,23 @@ var MODE_ORDER = ["default", "acceptEdits", "plan", "allowAll"];
|
|
|
6
6
|
function nextMode(mode) {
|
|
7
7
|
return MODE_ORDER[(MODE_ORDER.indexOf(mode) + 1) % MODE_ORDER.length];
|
|
8
8
|
}
|
|
9
|
-
var
|
|
9
|
+
var ALWAYS_ASK_COMMANDS = /* @__PURE__ */ new Set(["sudo", "sh", "bash", "zsh", "su"]);
|
|
10
|
+
function isAlwaysAsk(segment) {
|
|
11
|
+
const words = segment.trim().split(/\s+/);
|
|
12
|
+
const first = words[0] ?? "";
|
|
13
|
+
if (ALWAYS_ASK_COMMANDS.has(first)) return true;
|
|
14
|
+
const flags = words.slice(1).filter((w) => w.startsWith("-"));
|
|
15
|
+
if (first === "rm" && flags.some((w) => w.includes("r"))) return true;
|
|
16
|
+
if (first === "chmod" && flags.some((w) => w.includes("R"))) return true;
|
|
17
|
+
if (first === "kill" && words.slice(1).includes("-9")) return true;
|
|
18
|
+
if (first === "git" && words[1] === "push") {
|
|
19
|
+
return words.slice(2).some((w) => w === "-f" || w === "--force" || w.startsWith("--force="));
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
10
23
|
function commandKey(segment) {
|
|
11
24
|
const words = segment.trim().split(/\s+/);
|
|
12
|
-
return
|
|
25
|
+
return words[1] ? `${words[0]} ${words[1]}` : words[0];
|
|
13
26
|
}
|
|
14
27
|
var Permissions = class {
|
|
15
28
|
constructor(mode, rules = [], cwd = process.cwd()) {
|
|
@@ -42,6 +55,7 @@ var Permissions = class {
|
|
|
42
55
|
if (/`|\$\(|[<>]|^\s*[({]/.test(req.target)) return void 0;
|
|
43
56
|
const segments = req.target.split(/&&|\|\||[;&|\n]/).map((s) => s.trim()).filter(Boolean);
|
|
44
57
|
if (!segments.length) return void 0;
|
|
58
|
+
if (segments.some(isAlwaysAsk)) return void 0;
|
|
45
59
|
return [...new Set(segments.map((s) => `bash(${commandKey(s)})`))];
|
|
46
60
|
}
|
|
47
61
|
if (req.kind === "mcp") return [`mcp(${req.tool})`];
|
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
ConfigError
|
|
3
|
+
ConfigError
|
|
4
|
+
} from "./chunk-H5N4ST6B.js";
|
|
5
|
+
import {
|
|
4
6
|
t
|
|
5
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4RMP4CNT.js";
|
|
6
8
|
|
|
7
9
|
// src/mcp/config.ts
|
|
8
10
|
import { createHash } from "crypto";
|
|
9
11
|
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
10
12
|
import { dirname, join, resolve } from "path";
|
|
13
|
+
var ENV_REF = /\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-([^}]*))?\}/g;
|
|
14
|
+
function expandEnvVars(config, env) {
|
|
15
|
+
const expand = (value) => value.replace(ENV_REF, (match, name, fallback) => {
|
|
16
|
+
const resolved = env[name];
|
|
17
|
+
if (resolved !== void 0) return resolved;
|
|
18
|
+
return fallback !== void 0 ? fallback : match;
|
|
19
|
+
});
|
|
20
|
+
const expandMap = (map) => Object.fromEntries(Object.entries(map).map(([k, v]) => [k, expand(v)]));
|
|
21
|
+
if (config.type === "http") {
|
|
22
|
+
return { ...config, url: expand(config.url), ...config.headers ? { headers: expandMap(config.headers) } : {} };
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
...config,
|
|
26
|
+
command: expand(config.command),
|
|
27
|
+
...config.args ? { args: config.args.map(expand) } : {},
|
|
28
|
+
...config.env ? { env: expandMap(config.env) } : {}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
11
31
|
var globalMcpPath = (home) => join(home, "mcp.json");
|
|
12
32
|
var projectMcpPath = (cwd) => join(cwd, ".bccli", "mcp.json");
|
|
13
33
|
var trustPath = (home) => join(home, "trusted-mcp.json");
|
|
@@ -59,6 +79,7 @@ function serversToStart(home, cwd) {
|
|
|
59
79
|
}
|
|
60
80
|
|
|
61
81
|
export {
|
|
82
|
+
expandEnvVars,
|
|
62
83
|
globalMcpPath,
|
|
63
84
|
projectMcpPath,
|
|
64
85
|
readMcpFile,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
contentText
|
|
4
|
+
} from "./chunk-H66PC2EB.js";
|
|
2
5
|
|
|
3
6
|
// src/session.ts
|
|
4
7
|
import { randomBytes } from "crypto";
|
|
@@ -36,7 +39,7 @@ var Session = class _Session {
|
|
|
36
39
|
return readdirSync(dir).filter((f) => f.endsWith(".jsonl")).map((f) => {
|
|
37
40
|
const session = new _Session(join(dir, f));
|
|
38
41
|
const first = session.load().find((m) => m.role === "user");
|
|
39
|
-
return { session, mtime: statSync(session.file).mtime, preview: first ?
|
|
42
|
+
return { session, mtime: statSync(session.file).mtime, preview: first ? contentText(first.content).slice(0, 80) : "" };
|
|
40
43
|
}).sort((a, b) => b.mtime.getTime() - a.mtime.getTime() || b.session.file.localeCompare(a.session.file));
|
|
41
44
|
}
|
|
42
45
|
static latest(home, cwd) {
|