shenxiang-ai-cli 0.5.3 → 0.5.4
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/index.js +4 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2221,11 +2221,12 @@ ${truncated}
|
|
|
2221
2221
|
// src/ui/banner.ts
|
|
2222
2222
|
import boxen from "boxen";
|
|
2223
2223
|
import chalk3 from "chalk";
|
|
2224
|
+
import stripAnsi from "strip-ansi";
|
|
2224
2225
|
function showBanner() {
|
|
2225
2226
|
console.clear();
|
|
2226
2227
|
const p = chalk3.hex("#A78BFA");
|
|
2227
2228
|
const w = chalk3.white;
|
|
2228
|
-
const version = "v0.5.
|
|
2229
|
+
const version = "v0.5.4";
|
|
2229
2230
|
const avatarLines = [
|
|
2230
2231
|
` ${p("\u2584\u2580\u2580\u2580\u2584")}`,
|
|
2231
2232
|
` ${p("\u2588")} ${w("\u2580")} ${w("\u2580")} ${p("\u2588")}`,
|
|
@@ -2236,7 +2237,6 @@ function showBanner() {
|
|
|
2236
2237
|
const terminalWidth = process.stdout.columns || 80;
|
|
2237
2238
|
const boxWidth = Math.max(60, Math.min(terminalWidth - 4, 120));
|
|
2238
2239
|
const leftColWidth = Math.floor(boxWidth * 0.45);
|
|
2239
|
-
const rightColWidth = boxWidth - leftColWidth - 4;
|
|
2240
2240
|
const leftContent = [
|
|
2241
2241
|
"",
|
|
2242
2242
|
" Welcome back!",
|
|
@@ -2251,7 +2251,6 @@ function showBanner() {
|
|
|
2251
2251
|
theme.brand("Tips for getting started"),
|
|
2252
2252
|
`Run ${theme.code("/help")} for a list of commands`,
|
|
2253
2253
|
"",
|
|
2254
|
-
// Removed /init
|
|
2255
2254
|
theme.brand("Recent activity"),
|
|
2256
2255
|
"No recent activity",
|
|
2257
2256
|
"",
|
|
@@ -2262,7 +2261,7 @@ function showBanner() {
|
|
|
2262
2261
|
const lines = [];
|
|
2263
2262
|
for (let i = 0; i < maxLines; i++) {
|
|
2264
2263
|
const left = leftContent[i] || "";
|
|
2265
|
-
const leftVisible = left
|
|
2264
|
+
const leftVisible = stripAnsi(left).length;
|
|
2266
2265
|
const leftPadding = " ".repeat(Math.max(0, leftColWidth - leftVisible));
|
|
2267
2266
|
const right = rightContent[i] || "";
|
|
2268
2267
|
lines.push(`${left}${leftPadding} ${theme.dim("\u2502")} ${right}`);
|
|
@@ -2271,7 +2270,6 @@ function showBanner() {
|
|
|
2271
2270
|
console.log(boxen(content, {
|
|
2272
2271
|
padding: { top: 0, bottom: 0, left: 1, right: 1 },
|
|
2273
2272
|
margin: 0,
|
|
2274
|
-
// No margin since we clear screen and want full width likely
|
|
2275
2273
|
borderStyle: "round",
|
|
2276
2274
|
borderColor: "#A78BFA",
|
|
2277
2275
|
title: chalk3.hex("#A78BFA")(" \u6C88\u7FD4\u7684AI\u7F16\u7A0B\u52A9\u7406 "),
|
|
@@ -3372,7 +3370,7 @@ function fmtTokens3(n) {
|
|
|
3372
3370
|
var program = new Command();
|
|
3373
3371
|
var config2 = getConfig();
|
|
3374
3372
|
setLocale(config2.locale);
|
|
3375
|
-
program.name("sxai").description(t("description")).version("0.5.
|
|
3373
|
+
program.name("sxai").description(t("description")).version("0.5.4");
|
|
3376
3374
|
program.command("chat", { isDefault: true }).description("\u542F\u52A8\u4EA4\u4E92\u5F0FAI\u5BF9\u8BDD\uFF08\u9ED8\u8BA4\u547D\u4EE4\uFF09").option("-m, --model <model>", "\u6307\u5B9AAI\u6A21\u578B", config2.model).option("-y, --yolo", "\u81EA\u52A8\u6A21\u5F0F\uFF1A\u8DF3\u8FC7\u6240\u6709\u786E\u8BA4\uFF0C\u8BA9AI\u81EA\u4E3B\u6267\u884C").action(async (options) => {
|
|
3377
3375
|
if (options.model && options.model !== config2.model) {
|
|
3378
3376
|
setConfig("model", options.model);
|