bravecode-cli 0.1.5 → 0.1.7
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/cli.cjs +44 -15
- package/dist/cli.cjs.map +3 -3
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -40726,17 +40726,39 @@ async function startSimpleTUI(model, agentId) {
|
|
|
40726
40726
|
...agentConfig,
|
|
40727
40727
|
model: modelName
|
|
40728
40728
|
});
|
|
40729
|
-
|
|
40730
|
-
console.
|
|
40729
|
+
const termWidth = process.stdout.columns || 80;
|
|
40730
|
+
console.clear();
|
|
40731
|
+
const bannerLines = BANNER.trim().split("\n");
|
|
40732
|
+
const maxBannerWidth = Math.max(...bannerLines.map((l) => l.length));
|
|
40733
|
+
const bannerPadding = Math.max(0, Math.floor((termWidth - maxBannerWidth) / 2));
|
|
40734
|
+
console.log("\n".repeat(2));
|
|
40735
|
+
for (const line of bannerLines) {
|
|
40736
|
+
console.log(" ".repeat(bannerPadding) + "\x1B[1m\x1B[37m" + line + "\x1B[0m");
|
|
40737
|
+
}
|
|
40738
|
+
console.log("\n".repeat(2));
|
|
40739
|
+
const boxWidth = Math.min(60, termWidth - 4);
|
|
40740
|
+
const boxPadding = Math.max(0, Math.floor((termWidth - boxWidth) / 2));
|
|
40741
|
+
console.log(" ".repeat(boxPadding) + "\x1B[90m\u250C" + "\u2500".repeat(boxWidth - 2) + "\u2510\x1B[0m");
|
|
40742
|
+
console.log(
|
|
40743
|
+
" ".repeat(boxPadding) + '\x1B[90m\u2502\x1B[0m \x1B[90mAsk anything... "What is the tech stack of this project?"\x1B[0m' + " ".repeat(Math.max(0, boxWidth - 48)) + "\x1B[90m\u2502\x1B[0m"
|
|
40744
|
+
);
|
|
40745
|
+
console.log(" ".repeat(boxPadding) + "\x1B[90m\u2514" + "\u2500".repeat(boxWidth - 2) + "\u2518\x1B[0m");
|
|
40746
|
+
console.log("");
|
|
40747
|
+
console.log(
|
|
40748
|
+
" ".repeat(boxPadding) + "\x1B[36m" + agentName + "\x1B[0m \x1B[90m\xB7\x1B[0m \x1B[37m" + modelName + "\x1B[0m"
|
|
40749
|
+
);
|
|
40750
|
+
console.log("");
|
|
40751
|
+
console.log(" ".repeat(boxPadding) + "\x1B[90mtab agents ctrl+p commands\x1B[0m");
|
|
40752
|
+
console.log("\n");
|
|
40731
40753
|
const rl = readline.createInterface({
|
|
40732
40754
|
input: process.stdin,
|
|
40733
40755
|
output: process.stdout
|
|
40734
40756
|
});
|
|
40735
40757
|
const prompt = () => {
|
|
40736
|
-
rl.question("\x1B[
|
|
40758
|
+
rl.question("\x1B[36m>\x1B[0m ", async (input) => {
|
|
40737
40759
|
const trimmed = input.trim();
|
|
40738
40760
|
if (trimmed === "exit" || trimmed === "quit") {
|
|
40739
|
-
console.log("\
|
|
40761
|
+
console.log("\n\x1B[90mGoodbye!\x1B[0m");
|
|
40740
40762
|
rl.close();
|
|
40741
40763
|
process.exit(0);
|
|
40742
40764
|
}
|
|
@@ -40744,6 +40766,7 @@ async function startSimpleTUI(model, agentId) {
|
|
|
40744
40766
|
prompt();
|
|
40745
40767
|
return;
|
|
40746
40768
|
}
|
|
40769
|
+
console.log("\x1B[90m" + trimmed + "\x1B[0m\n");
|
|
40747
40770
|
try {
|
|
40748
40771
|
let response = "";
|
|
40749
40772
|
await agent.run(trimmed, (chunk) => {
|
|
@@ -40753,20 +40776,20 @@ async function startSimpleTUI(model, agentId) {
|
|
|
40753
40776
|
console.log("\n");
|
|
40754
40777
|
} catch (error40) {
|
|
40755
40778
|
console.error(`
|
|
40756
|
-
|
|
40779
|
+
\x1B[31mError: ${error40.message}\x1B[0m
|
|
40757
40780
|
`);
|
|
40758
40781
|
}
|
|
40759
40782
|
prompt();
|
|
40760
40783
|
});
|
|
40761
40784
|
};
|
|
40762
40785
|
rl.on("SIGINT", () => {
|
|
40763
|
-
console.log("\
|
|
40786
|
+
console.log("\n\x1B[90mGoodbye!\x1B[0m");
|
|
40764
40787
|
rl.close();
|
|
40765
40788
|
process.exit(0);
|
|
40766
40789
|
});
|
|
40767
40790
|
prompt();
|
|
40768
40791
|
}
|
|
40769
|
-
var readline;
|
|
40792
|
+
var readline, BANNER;
|
|
40770
40793
|
var init_simple_tui = __esm({
|
|
40771
40794
|
"src/core/tui/simple-tui.ts"() {
|
|
40772
40795
|
"use strict";
|
|
@@ -40774,6 +40797,13 @@ var init_simple_tui = __esm({
|
|
|
40774
40797
|
init_provider();
|
|
40775
40798
|
init_tool();
|
|
40776
40799
|
init_agent();
|
|
40800
|
+
BANNER = `
|
|
40801
|
+
____ _ __ __ ____ _ __
|
|
40802
|
+
| __ ) _ __ _____ _(_)___/ /__ / / | __ )_ __(_)___ ____ _/ /_____ _____
|
|
40803
|
+
| _ \\| '__/ _ \\ \\ / / / __/ //_/ / / | _ \\| '__/ __ \\ / __ \`/ __/ __ \\/ ___/
|
|
40804
|
+
| |_) | | | (_) \\ V / / /__/ , < / / | |_) | | | / / / / /_/ / /_/ /_/ / /
|
|
40805
|
+
|____/|_| \\___/ \\_/_/\\___/_/|_| /_/ |____/|_| /_/ /_/\\__,_/\\__/\\____/_/
|
|
40806
|
+
`;
|
|
40777
40807
|
}
|
|
40778
40808
|
});
|
|
40779
40809
|
|
|
@@ -41398,16 +41428,15 @@ var UpdateChecker = class {
|
|
|
41398
41428
|
var import_fs9 = require("fs");
|
|
41399
41429
|
var import_path7 = require("path");
|
|
41400
41430
|
var program2 = new Command();
|
|
41401
|
-
var
|
|
41402
|
-
|
|
41403
|
-
|
|
41404
|
-
|
|
41405
|
-
|
|
41406
|
-
|
|
41407
|
-
\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D
|
|
41431
|
+
var BANNER2 = `
|
|
41432
|
+
____ _ __ __ ____ _ __
|
|
41433
|
+
| __ ) _ __ _____ _(_)___/ /__ / / | __ )_ __(_)___ ____ _/ /_____ _____
|
|
41434
|
+
| _ \\| '__/ _ \\ \\ / / / __/ //_/ / / | _ \\| '__/ __ \\ / __ \`/ __/ __ \\/ ___/
|
|
41435
|
+
| |_) | | | (_) \\ V / / /__/ , < / / | |_) | | | / / / / /_/ / /_/ /_/ / /
|
|
41436
|
+
|____/|_| \\___/ \\_/_/\\___/_/|_| /_/ |____/|_| /_/ /_/\\__,_/\\__/\\____/_/
|
|
41408
41437
|
`;
|
|
41409
41438
|
program2.name("bravecode").description("BraveCode AI - Agentic AI Vibe Coding CLI with free model support").version("0.1.2").action(async () => {
|
|
41410
|
-
console.log(
|
|
41439
|
+
console.log(BANNER2);
|
|
41411
41440
|
const { startSimpleTUI: startSimpleTUI2 } = await Promise.resolve().then(() => (init_simple_tui(), simple_tui_exports));
|
|
41412
41441
|
await startSimpleTUI2();
|
|
41413
41442
|
});
|