@bgicli/bgicli 2.7.3 → 2.7.5
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/bgi.js +65 -36
- package/dist/bio.js +65 -36
- package/dist/mbp.js +65 -36
- package/package.json +1 -1
package/dist/bgi.js
CHANGED
|
@@ -17200,7 +17200,7 @@ function clearCheckpoints(sessionId) {
|
|
|
17200
17200
|
|
|
17201
17201
|
// src/index.ts
|
|
17202
17202
|
var import_fs7 = require("fs");
|
|
17203
|
-
var VERSION2 = "2.7.
|
|
17203
|
+
var VERSION2 = "2.7.4";
|
|
17204
17204
|
var BRAND2 = "bgi".toLowerCase();
|
|
17205
17205
|
var SKILLHUB_HUBS = {
|
|
17206
17206
|
bgi: { label: "BGI\u5185\u7F51", apiBase: "https://clawhub.ai", backend: "clawhub" },
|
|
@@ -17288,11 +17288,17 @@ function isNewer(latest, current) {
|
|
|
17288
17288
|
return lp > cp;
|
|
17289
17289
|
}
|
|
17290
17290
|
async function checkAndAutoUpdate() {
|
|
17291
|
+
const UPDATE_NOTIFIED_FILE = (0, import_path6.join)(BGI_DIR, ".update-notified");
|
|
17292
|
+
let alreadyNotified = "";
|
|
17293
|
+
try {
|
|
17294
|
+
alreadyNotified = (0, import_fs6.readFileSync)(UPDATE_NOTIFIED_FILE, "utf8").trim();
|
|
17295
|
+
} catch {
|
|
17296
|
+
}
|
|
17291
17297
|
let latest;
|
|
17292
17298
|
try {
|
|
17293
17299
|
latest = await new Promise((resolve4, reject) => {
|
|
17294
17300
|
const req = (0, import_https2.get)(
|
|
17295
|
-
"https://registry.
|
|
17301
|
+
"https://registry.npmmirror.com/@bgicli/bgicli/latest",
|
|
17296
17302
|
{ headers: { "User-Agent": `bgicli/${VERSION2}` } },
|
|
17297
17303
|
(res) => {
|
|
17298
17304
|
const chunks = [];
|
|
@@ -17316,6 +17322,11 @@ async function checkAndAutoUpdate() {
|
|
|
17316
17322
|
return;
|
|
17317
17323
|
}
|
|
17318
17324
|
if (!isNewer(latest, VERSION2)) return;
|
|
17325
|
+
if (alreadyNotified === latest) return;
|
|
17326
|
+
try {
|
|
17327
|
+
(0, import_fs6.writeFileSync)(UPDATE_NOTIFIED_FILE, latest, "utf8");
|
|
17328
|
+
} catch {
|
|
17329
|
+
}
|
|
17319
17330
|
process.stdout.write(
|
|
17320
17331
|
source_default.cyan(`
|
|
17321
17332
|
\u{1F504} \u53D1\u73B0\u65B0\u7248\u672C v${latest}\uFF08\u5F53\u524D v${VERSION2}\uFF09\uFF0C\u6B63\u5728\u81EA\u52A8\u66F4\u65B0...
|
|
@@ -17323,12 +17334,12 @@ async function checkAndAutoUpdate() {
|
|
|
17323
17334
|
);
|
|
17324
17335
|
const ok = await new Promise((resolve4) => {
|
|
17325
17336
|
(0, import_child_process2.exec)(
|
|
17326
|
-
`npm install -g @bgicli/bgicli@${latest} --registry https://registry.
|
|
17337
|
+
`npm install -g @bgicli/bgicli@${latest} --registry https://registry.npmmirror.com`,
|
|
17327
17338
|
(error) => resolve4(!error)
|
|
17328
17339
|
);
|
|
17329
17340
|
});
|
|
17330
17341
|
if (ok) {
|
|
17331
|
-
process.stdout.write(source_default.green(` \u2713 \u5DF2\u66F4\u65B0\u81F3 v${latest}\uFF0C\u91CD\u542F
|
|
17342
|
+
process.stdout.write(source_default.green(` \u2713 \u5DF2\u66F4\u65B0\u81F3 v${latest}\uFF0C\u91CD\u542F\u7EC8\u7AEF\u540E\u751F\u6548
|
|
17332
17343
|
|
|
17333
17344
|
`));
|
|
17334
17345
|
} else {
|
|
@@ -17404,41 +17415,58 @@ function installBundledData() {
|
|
|
17404
17415
|
}
|
|
17405
17416
|
}
|
|
17406
17417
|
function printBanner() {
|
|
17407
|
-
|
|
17408
|
-
|
|
17409
|
-
|
|
17410
|
-
|
|
17411
|
-
|
|
17412
|
-
|
|
17413
|
-
|
|
17418
|
+
function lerpColor(stops2, t2) {
|
|
17419
|
+
const n2 = stops2.length;
|
|
17420
|
+
if (n2 === 1) return stops2[0];
|
|
17421
|
+
const s2 = t2 * (n2 - 1);
|
|
17422
|
+
const idx = Math.min(Math.floor(s2), n2 - 2);
|
|
17423
|
+
const f2 = s2 - idx;
|
|
17424
|
+
const [ar2, ag, ab] = stops2[idx];
|
|
17425
|
+
const [br2, bg, bb] = stops2[idx + 1];
|
|
17426
|
+
return [Math.round(ar2 + (br2 - ar2) * f2), Math.round(ag + (bg - ag) * f2), Math.round(ab + (bb - ab) * f2)];
|
|
17427
|
+
}
|
|
17428
|
+
const chevron = [
|
|
17429
|
+
"\u2588\u2588\u2557 ",
|
|
17430
|
+
"\u255A\u2588\u2588\u2557 ",
|
|
17431
|
+
" \u255A\u2588\u2588\u2557 ",
|
|
17432
|
+
" \u2554\u2588\u2588\u2554\u255D",
|
|
17433
|
+
"\u2554\u2588\u2588\u2554\u255D ",
|
|
17434
|
+
"\u255A\u2550\u255D "
|
|
17435
|
+
];
|
|
17436
|
+
const bgiLetters = [
|
|
17437
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557",
|
|
17438
|
+
"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2551",
|
|
17439
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2551",
|
|
17440
|
+
"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551",
|
|
17441
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551",
|
|
17442
|
+
"\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D"
|
|
17414
17443
|
];
|
|
17415
|
-
const
|
|
17416
|
-
"
|
|
17417
|
-
"
|
|
17418
|
-
"
|
|
17419
|
-
"
|
|
17420
|
-
"
|
|
17421
|
-
"
|
|
17444
|
+
const bioLetters = [
|
|
17445
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ",
|
|
17446
|
+
"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557",
|
|
17447
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551",
|
|
17448
|
+
"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551",
|
|
17449
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D",
|
|
17450
|
+
"\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D "
|
|
17422
17451
|
];
|
|
17423
|
-
const
|
|
17424
|
-
"
|
|
17425
|
-
"
|
|
17426
|
-
"
|
|
17427
|
-
"
|
|
17428
|
-
"
|
|
17429
|
-
"
|
|
17452
|
+
const mbpLetters = [
|
|
17453
|
+
"\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ",
|
|
17454
|
+
"\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557",
|
|
17455
|
+
"\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D",
|
|
17456
|
+
"\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u255D ",
|
|
17457
|
+
"\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 ",
|
|
17458
|
+
"\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D "
|
|
17430
17459
|
];
|
|
17431
|
-
const
|
|
17432
|
-
const
|
|
17433
|
-
const
|
|
17434
|
-
const
|
|
17460
|
+
const letters = BRAND2 === "bio" ? bioLetters : BRAND2 === "mbp" ? mbpLetters : bgiLetters;
|
|
17461
|
+
const body = chevron.map((ch, i2) => " " + ch + letters[i2]);
|
|
17462
|
+
const maxW = body.reduce((m2, l2) => Math.max(m2, l2.length), 0);
|
|
17463
|
+
const border = " " + "\u2500".repeat(maxW);
|
|
17464
|
+
const allLines = [border, ...body, border];
|
|
17465
|
+
const stops = BRAND2 === "bio" ? [[60, 255, 100], [0, 255, 180], [0, 245, 255], [0, 190, 255], [0, 120, 255], [40, 50, 255], [110, 0, 255], [170, 0, 220]] : BRAND2 === "mbp" ? [[255, 60, 190], [255, 130, 50], [240, 50, 220], [190, 0, 255], [140, 0, 255], [90, 0, 255], [55, 0, 230], [30, 0, 180]] : [[0, 245, 255], [0, 215, 255], [0, 175, 255], [20, 125, 255], [60, 75, 255], [100, 30, 255], [150, 0, 255], [185, 0, 220]];
|
|
17435
17466
|
console.log();
|
|
17436
|
-
|
|
17437
|
-
const
|
|
17438
|
-
|
|
17439
|
-
const g3 = Math.round(g1 + (g2 - g1) * t2);
|
|
17440
|
-
const b3 = Math.round(b1 + (b2 - b1) * t2);
|
|
17441
|
-
console.log(source_default.bold.rgb(r3, g3, b3)(line));
|
|
17467
|
+
allLines.forEach((line, i2) => {
|
|
17468
|
+
const [r2, g2, b2] = lerpColor(stops, i2 / Math.max(allLines.length - 1, 1));
|
|
17469
|
+
console.log(source_default.bold.rgb(r2, g2, b2)(line));
|
|
17442
17470
|
});
|
|
17443
17471
|
console.log(source_default.dim(` v${VERSION2} \u751F\u7269\u4FE1\u606F\u5B66 AI \u7EC8\u7AEF\u52A9\u624B \u2014 Bioinformatics AI Terminal`));
|
|
17444
17472
|
console.log();
|
|
@@ -19391,9 +19419,10 @@ ${expanded}` : expanded;
|
|
|
19391
19419
|
const dIn = sessionStats.inputTokens - tokensBefore.in;
|
|
19392
19420
|
const dOut = sessionStats.outputTokens - tokensBefore.out;
|
|
19393
19421
|
const elapsed = (elapsedMs / 1e3).toFixed(2);
|
|
19422
|
+
const modelLabel = currentCfg.provider === "custom" ? currentCfg.customModel ?? currentCfg.model : currentCfg.model;
|
|
19394
19423
|
console.log(
|
|
19395
19424
|
source_default.dim(`
|
|
19396
|
-
\u23F1 ${elapsed}s`) + source_default.dim(" \xB7 ") + source_default.dim(`\u2191 ${dIn}`) + source_default.dim(" ") + source_default.dim(`\u2193 ${dOut} tokens`)
|
|
19425
|
+
\u23F1 ${elapsed}s`) + source_default.dim(" \xB7 ") + source_default.dim(`\u2191 ${dIn}`) + source_default.dim(" ") + source_default.dim(`\u2193 ${dOut} tokens`) + source_default.dim(" \xB7 ") + source_default.dim(modelLabel)
|
|
19397
19426
|
);
|
|
19398
19427
|
}
|
|
19399
19428
|
if (debugMode && reply) {
|
package/dist/bio.js
CHANGED
|
@@ -17200,7 +17200,7 @@ function clearCheckpoints(sessionId) {
|
|
|
17200
17200
|
|
|
17201
17201
|
// src/index.ts
|
|
17202
17202
|
var import_fs7 = require("fs");
|
|
17203
|
-
var VERSION2 = "2.7.
|
|
17203
|
+
var VERSION2 = "2.7.4";
|
|
17204
17204
|
var BRAND2 = "bio".toLowerCase();
|
|
17205
17205
|
var SKILLHUB_HUBS = {
|
|
17206
17206
|
bgi: { label: "BGI\u5185\u7F51", apiBase: "https://clawhub.ai", backend: "clawhub" },
|
|
@@ -17288,11 +17288,17 @@ function isNewer(latest, current) {
|
|
|
17288
17288
|
return lp > cp;
|
|
17289
17289
|
}
|
|
17290
17290
|
async function checkAndAutoUpdate() {
|
|
17291
|
+
const UPDATE_NOTIFIED_FILE = (0, import_path6.join)(BGI_DIR, ".update-notified");
|
|
17292
|
+
let alreadyNotified = "";
|
|
17293
|
+
try {
|
|
17294
|
+
alreadyNotified = (0, import_fs6.readFileSync)(UPDATE_NOTIFIED_FILE, "utf8").trim();
|
|
17295
|
+
} catch {
|
|
17296
|
+
}
|
|
17291
17297
|
let latest;
|
|
17292
17298
|
try {
|
|
17293
17299
|
latest = await new Promise((resolve4, reject) => {
|
|
17294
17300
|
const req = (0, import_https2.get)(
|
|
17295
|
-
"https://registry.
|
|
17301
|
+
"https://registry.npmmirror.com/@bgicli/bgicli/latest",
|
|
17296
17302
|
{ headers: { "User-Agent": `bgicli/${VERSION2}` } },
|
|
17297
17303
|
(res) => {
|
|
17298
17304
|
const chunks = [];
|
|
@@ -17316,6 +17322,11 @@ async function checkAndAutoUpdate() {
|
|
|
17316
17322
|
return;
|
|
17317
17323
|
}
|
|
17318
17324
|
if (!isNewer(latest, VERSION2)) return;
|
|
17325
|
+
if (alreadyNotified === latest) return;
|
|
17326
|
+
try {
|
|
17327
|
+
(0, import_fs6.writeFileSync)(UPDATE_NOTIFIED_FILE, latest, "utf8");
|
|
17328
|
+
} catch {
|
|
17329
|
+
}
|
|
17319
17330
|
process.stdout.write(
|
|
17320
17331
|
source_default.cyan(`
|
|
17321
17332
|
\u{1F504} \u53D1\u73B0\u65B0\u7248\u672C v${latest}\uFF08\u5F53\u524D v${VERSION2}\uFF09\uFF0C\u6B63\u5728\u81EA\u52A8\u66F4\u65B0...
|
|
@@ -17323,12 +17334,12 @@ async function checkAndAutoUpdate() {
|
|
|
17323
17334
|
);
|
|
17324
17335
|
const ok = await new Promise((resolve4) => {
|
|
17325
17336
|
(0, import_child_process2.exec)(
|
|
17326
|
-
`npm install -g @bgicli/bgicli@${latest} --registry https://registry.
|
|
17337
|
+
`npm install -g @bgicli/bgicli@${latest} --registry https://registry.npmmirror.com`,
|
|
17327
17338
|
(error) => resolve4(!error)
|
|
17328
17339
|
);
|
|
17329
17340
|
});
|
|
17330
17341
|
if (ok) {
|
|
17331
|
-
process.stdout.write(source_default.green(` \u2713 \u5DF2\u66F4\u65B0\u81F3 v${latest}\uFF0C\u91CD\u542F
|
|
17342
|
+
process.stdout.write(source_default.green(` \u2713 \u5DF2\u66F4\u65B0\u81F3 v${latest}\uFF0C\u91CD\u542F\u7EC8\u7AEF\u540E\u751F\u6548
|
|
17332
17343
|
|
|
17333
17344
|
`));
|
|
17334
17345
|
} else {
|
|
@@ -17404,41 +17415,58 @@ function installBundledData() {
|
|
|
17404
17415
|
}
|
|
17405
17416
|
}
|
|
17406
17417
|
function printBanner() {
|
|
17407
|
-
|
|
17408
|
-
|
|
17409
|
-
|
|
17410
|
-
|
|
17411
|
-
|
|
17412
|
-
|
|
17413
|
-
|
|
17418
|
+
function lerpColor(stops2, t2) {
|
|
17419
|
+
const n2 = stops2.length;
|
|
17420
|
+
if (n2 === 1) return stops2[0];
|
|
17421
|
+
const s2 = t2 * (n2 - 1);
|
|
17422
|
+
const idx = Math.min(Math.floor(s2), n2 - 2);
|
|
17423
|
+
const f2 = s2 - idx;
|
|
17424
|
+
const [ar2, ag, ab] = stops2[idx];
|
|
17425
|
+
const [br2, bg, bb] = stops2[idx + 1];
|
|
17426
|
+
return [Math.round(ar2 + (br2 - ar2) * f2), Math.round(ag + (bg - ag) * f2), Math.round(ab + (bb - ab) * f2)];
|
|
17427
|
+
}
|
|
17428
|
+
const chevron = [
|
|
17429
|
+
"\u2588\u2588\u2557 ",
|
|
17430
|
+
"\u255A\u2588\u2588\u2557 ",
|
|
17431
|
+
" \u255A\u2588\u2588\u2557 ",
|
|
17432
|
+
" \u2554\u2588\u2588\u2554\u255D",
|
|
17433
|
+
"\u2554\u2588\u2588\u2554\u255D ",
|
|
17434
|
+
"\u255A\u2550\u255D "
|
|
17435
|
+
];
|
|
17436
|
+
const bgiLetters = [
|
|
17437
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557",
|
|
17438
|
+
"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2551",
|
|
17439
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2551",
|
|
17440
|
+
"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551",
|
|
17441
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551",
|
|
17442
|
+
"\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D"
|
|
17414
17443
|
];
|
|
17415
|
-
const
|
|
17416
|
-
"
|
|
17417
|
-
"
|
|
17418
|
-
"
|
|
17419
|
-
"
|
|
17420
|
-
"
|
|
17421
|
-
"
|
|
17444
|
+
const bioLetters = [
|
|
17445
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ",
|
|
17446
|
+
"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557",
|
|
17447
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551",
|
|
17448
|
+
"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551",
|
|
17449
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D",
|
|
17450
|
+
"\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D "
|
|
17422
17451
|
];
|
|
17423
|
-
const
|
|
17424
|
-
"
|
|
17425
|
-
"
|
|
17426
|
-
"
|
|
17427
|
-
"
|
|
17428
|
-
"
|
|
17429
|
-
"
|
|
17452
|
+
const mbpLetters = [
|
|
17453
|
+
"\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ",
|
|
17454
|
+
"\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557",
|
|
17455
|
+
"\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D",
|
|
17456
|
+
"\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u255D ",
|
|
17457
|
+
"\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 ",
|
|
17458
|
+
"\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D "
|
|
17430
17459
|
];
|
|
17431
|
-
const
|
|
17432
|
-
const
|
|
17433
|
-
const
|
|
17434
|
-
const
|
|
17460
|
+
const letters = BRAND2 === "bio" ? bioLetters : BRAND2 === "mbp" ? mbpLetters : bgiLetters;
|
|
17461
|
+
const body = chevron.map((ch, i2) => " " + ch + letters[i2]);
|
|
17462
|
+
const maxW = body.reduce((m2, l2) => Math.max(m2, l2.length), 0);
|
|
17463
|
+
const border = " " + "\u2500".repeat(maxW);
|
|
17464
|
+
const allLines = [border, ...body, border];
|
|
17465
|
+
const stops = BRAND2 === "bio" ? [[60, 255, 100], [0, 255, 180], [0, 245, 255], [0, 190, 255], [0, 120, 255], [40, 50, 255], [110, 0, 255], [170, 0, 220]] : BRAND2 === "mbp" ? [[255, 60, 190], [255, 130, 50], [240, 50, 220], [190, 0, 255], [140, 0, 255], [90, 0, 255], [55, 0, 230], [30, 0, 180]] : [[0, 245, 255], [0, 215, 255], [0, 175, 255], [20, 125, 255], [60, 75, 255], [100, 30, 255], [150, 0, 255], [185, 0, 220]];
|
|
17435
17466
|
console.log();
|
|
17436
|
-
|
|
17437
|
-
const
|
|
17438
|
-
|
|
17439
|
-
const g3 = Math.round(g1 + (g2 - g1) * t2);
|
|
17440
|
-
const b3 = Math.round(b1 + (b2 - b1) * t2);
|
|
17441
|
-
console.log(source_default.bold.rgb(r3, g3, b3)(line));
|
|
17467
|
+
allLines.forEach((line, i2) => {
|
|
17468
|
+
const [r2, g2, b2] = lerpColor(stops, i2 / Math.max(allLines.length - 1, 1));
|
|
17469
|
+
console.log(source_default.bold.rgb(r2, g2, b2)(line));
|
|
17442
17470
|
});
|
|
17443
17471
|
console.log(source_default.dim(` v${VERSION2} \u751F\u7269\u4FE1\u606F\u5B66 AI \u7EC8\u7AEF\u52A9\u624B \u2014 Bioinformatics AI Terminal`));
|
|
17444
17472
|
console.log();
|
|
@@ -19391,9 +19419,10 @@ ${expanded}` : expanded;
|
|
|
19391
19419
|
const dIn = sessionStats.inputTokens - tokensBefore.in;
|
|
19392
19420
|
const dOut = sessionStats.outputTokens - tokensBefore.out;
|
|
19393
19421
|
const elapsed = (elapsedMs / 1e3).toFixed(2);
|
|
19422
|
+
const modelLabel = currentCfg.provider === "custom" ? currentCfg.customModel ?? currentCfg.model : currentCfg.model;
|
|
19394
19423
|
console.log(
|
|
19395
19424
|
source_default.dim(`
|
|
19396
|
-
\u23F1 ${elapsed}s`) + source_default.dim(" \xB7 ") + source_default.dim(`\u2191 ${dIn}`) + source_default.dim(" ") + source_default.dim(`\u2193 ${dOut} tokens`)
|
|
19425
|
+
\u23F1 ${elapsed}s`) + source_default.dim(" \xB7 ") + source_default.dim(`\u2191 ${dIn}`) + source_default.dim(" ") + source_default.dim(`\u2193 ${dOut} tokens`) + source_default.dim(" \xB7 ") + source_default.dim(modelLabel)
|
|
19397
19426
|
);
|
|
19398
19427
|
}
|
|
19399
19428
|
if (debugMode && reply) {
|
package/dist/mbp.js
CHANGED
|
@@ -17200,7 +17200,7 @@ function clearCheckpoints(sessionId) {
|
|
|
17200
17200
|
|
|
17201
17201
|
// src/index.ts
|
|
17202
17202
|
var import_fs7 = require("fs");
|
|
17203
|
-
var VERSION2 = "2.7.
|
|
17203
|
+
var VERSION2 = "2.7.4";
|
|
17204
17204
|
var BRAND2 = "mbp".toLowerCase();
|
|
17205
17205
|
var SKILLHUB_HUBS = {
|
|
17206
17206
|
bgi: { label: "BGI\u5185\u7F51", apiBase: "https://clawhub.ai", backend: "clawhub" },
|
|
@@ -17288,11 +17288,17 @@ function isNewer(latest, current) {
|
|
|
17288
17288
|
return lp > cp;
|
|
17289
17289
|
}
|
|
17290
17290
|
async function checkAndAutoUpdate() {
|
|
17291
|
+
const UPDATE_NOTIFIED_FILE = (0, import_path6.join)(BGI_DIR, ".update-notified");
|
|
17292
|
+
let alreadyNotified = "";
|
|
17293
|
+
try {
|
|
17294
|
+
alreadyNotified = (0, import_fs6.readFileSync)(UPDATE_NOTIFIED_FILE, "utf8").trim();
|
|
17295
|
+
} catch {
|
|
17296
|
+
}
|
|
17291
17297
|
let latest;
|
|
17292
17298
|
try {
|
|
17293
17299
|
latest = await new Promise((resolve4, reject) => {
|
|
17294
17300
|
const req = (0, import_https2.get)(
|
|
17295
|
-
"https://registry.
|
|
17301
|
+
"https://registry.npmmirror.com/@bgicli/bgicli/latest",
|
|
17296
17302
|
{ headers: { "User-Agent": `bgicli/${VERSION2}` } },
|
|
17297
17303
|
(res) => {
|
|
17298
17304
|
const chunks = [];
|
|
@@ -17316,6 +17322,11 @@ async function checkAndAutoUpdate() {
|
|
|
17316
17322
|
return;
|
|
17317
17323
|
}
|
|
17318
17324
|
if (!isNewer(latest, VERSION2)) return;
|
|
17325
|
+
if (alreadyNotified === latest) return;
|
|
17326
|
+
try {
|
|
17327
|
+
(0, import_fs6.writeFileSync)(UPDATE_NOTIFIED_FILE, latest, "utf8");
|
|
17328
|
+
} catch {
|
|
17329
|
+
}
|
|
17319
17330
|
process.stdout.write(
|
|
17320
17331
|
source_default.cyan(`
|
|
17321
17332
|
\u{1F504} \u53D1\u73B0\u65B0\u7248\u672C v${latest}\uFF08\u5F53\u524D v${VERSION2}\uFF09\uFF0C\u6B63\u5728\u81EA\u52A8\u66F4\u65B0...
|
|
@@ -17323,12 +17334,12 @@ async function checkAndAutoUpdate() {
|
|
|
17323
17334
|
);
|
|
17324
17335
|
const ok = await new Promise((resolve4) => {
|
|
17325
17336
|
(0, import_child_process2.exec)(
|
|
17326
|
-
`npm install -g @bgicli/bgicli@${latest} --registry https://registry.
|
|
17337
|
+
`npm install -g @bgicli/bgicli@${latest} --registry https://registry.npmmirror.com`,
|
|
17327
17338
|
(error) => resolve4(!error)
|
|
17328
17339
|
);
|
|
17329
17340
|
});
|
|
17330
17341
|
if (ok) {
|
|
17331
|
-
process.stdout.write(source_default.green(` \u2713 \u5DF2\u66F4\u65B0\u81F3 v${latest}\uFF0C\u91CD\u542F
|
|
17342
|
+
process.stdout.write(source_default.green(` \u2713 \u5DF2\u66F4\u65B0\u81F3 v${latest}\uFF0C\u91CD\u542F\u7EC8\u7AEF\u540E\u751F\u6548
|
|
17332
17343
|
|
|
17333
17344
|
`));
|
|
17334
17345
|
} else {
|
|
@@ -17404,41 +17415,58 @@ function installBundledData() {
|
|
|
17404
17415
|
}
|
|
17405
17416
|
}
|
|
17406
17417
|
function printBanner() {
|
|
17407
|
-
|
|
17408
|
-
|
|
17409
|
-
|
|
17410
|
-
|
|
17411
|
-
|
|
17412
|
-
|
|
17413
|
-
|
|
17418
|
+
function lerpColor(stops2, t2) {
|
|
17419
|
+
const n2 = stops2.length;
|
|
17420
|
+
if (n2 === 1) return stops2[0];
|
|
17421
|
+
const s2 = t2 * (n2 - 1);
|
|
17422
|
+
const idx = Math.min(Math.floor(s2), n2 - 2);
|
|
17423
|
+
const f2 = s2 - idx;
|
|
17424
|
+
const [ar2, ag, ab] = stops2[idx];
|
|
17425
|
+
const [br2, bg, bb] = stops2[idx + 1];
|
|
17426
|
+
return [Math.round(ar2 + (br2 - ar2) * f2), Math.round(ag + (bg - ag) * f2), Math.round(ab + (bb - ab) * f2)];
|
|
17427
|
+
}
|
|
17428
|
+
const chevron = [
|
|
17429
|
+
"\u2588\u2588\u2557 ",
|
|
17430
|
+
"\u255A\u2588\u2588\u2557 ",
|
|
17431
|
+
" \u255A\u2588\u2588\u2557 ",
|
|
17432
|
+
" \u2554\u2588\u2588\u2554\u255D",
|
|
17433
|
+
"\u2554\u2588\u2588\u2554\u255D ",
|
|
17434
|
+
"\u255A\u2550\u255D "
|
|
17435
|
+
];
|
|
17436
|
+
const bgiLetters = [
|
|
17437
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557",
|
|
17438
|
+
"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2551",
|
|
17439
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2551",
|
|
17440
|
+
"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551",
|
|
17441
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551",
|
|
17442
|
+
"\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D"
|
|
17414
17443
|
];
|
|
17415
|
-
const
|
|
17416
|
-
"
|
|
17417
|
-
"
|
|
17418
|
-
"
|
|
17419
|
-
"
|
|
17420
|
-
"
|
|
17421
|
-
"
|
|
17444
|
+
const bioLetters = [
|
|
17445
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ",
|
|
17446
|
+
"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557",
|
|
17447
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551",
|
|
17448
|
+
"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551",
|
|
17449
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D",
|
|
17450
|
+
"\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D "
|
|
17422
17451
|
];
|
|
17423
|
-
const
|
|
17424
|
-
"
|
|
17425
|
-
"
|
|
17426
|
-
"
|
|
17427
|
-
"
|
|
17428
|
-
"
|
|
17429
|
-
"
|
|
17452
|
+
const mbpLetters = [
|
|
17453
|
+
"\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 ",
|
|
17454
|
+
"\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557",
|
|
17455
|
+
"\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D",
|
|
17456
|
+
"\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u255D ",
|
|
17457
|
+
"\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 ",
|
|
17458
|
+
"\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D "
|
|
17430
17459
|
];
|
|
17431
|
-
const
|
|
17432
|
-
const
|
|
17433
|
-
const
|
|
17434
|
-
const
|
|
17460
|
+
const letters = BRAND2 === "bio" ? bioLetters : BRAND2 === "mbp" ? mbpLetters : bgiLetters;
|
|
17461
|
+
const body = chevron.map((ch, i2) => " " + ch + letters[i2]);
|
|
17462
|
+
const maxW = body.reduce((m2, l2) => Math.max(m2, l2.length), 0);
|
|
17463
|
+
const border = " " + "\u2500".repeat(maxW);
|
|
17464
|
+
const allLines = [border, ...body, border];
|
|
17465
|
+
const stops = BRAND2 === "bio" ? [[60, 255, 100], [0, 255, 180], [0, 245, 255], [0, 190, 255], [0, 120, 255], [40, 50, 255], [110, 0, 255], [170, 0, 220]] : BRAND2 === "mbp" ? [[255, 60, 190], [255, 130, 50], [240, 50, 220], [190, 0, 255], [140, 0, 255], [90, 0, 255], [55, 0, 230], [30, 0, 180]] : [[0, 245, 255], [0, 215, 255], [0, 175, 255], [20, 125, 255], [60, 75, 255], [100, 30, 255], [150, 0, 255], [185, 0, 220]];
|
|
17435
17466
|
console.log();
|
|
17436
|
-
|
|
17437
|
-
const
|
|
17438
|
-
|
|
17439
|
-
const g3 = Math.round(g1 + (g2 - g1) * t2);
|
|
17440
|
-
const b3 = Math.round(b1 + (b2 - b1) * t2);
|
|
17441
|
-
console.log(source_default.bold.rgb(r3, g3, b3)(line));
|
|
17467
|
+
allLines.forEach((line, i2) => {
|
|
17468
|
+
const [r2, g2, b2] = lerpColor(stops, i2 / Math.max(allLines.length - 1, 1));
|
|
17469
|
+
console.log(source_default.bold.rgb(r2, g2, b2)(line));
|
|
17442
17470
|
});
|
|
17443
17471
|
console.log(source_default.dim(` v${VERSION2} \u751F\u7269\u4FE1\u606F\u5B66 AI \u7EC8\u7AEF\u52A9\u624B \u2014 Bioinformatics AI Terminal`));
|
|
17444
17472
|
console.log();
|
|
@@ -19391,9 +19419,10 @@ ${expanded}` : expanded;
|
|
|
19391
19419
|
const dIn = sessionStats.inputTokens - tokensBefore.in;
|
|
19392
19420
|
const dOut = sessionStats.outputTokens - tokensBefore.out;
|
|
19393
19421
|
const elapsed = (elapsedMs / 1e3).toFixed(2);
|
|
19422
|
+
const modelLabel = currentCfg.provider === "custom" ? currentCfg.customModel ?? currentCfg.model : currentCfg.model;
|
|
19394
19423
|
console.log(
|
|
19395
19424
|
source_default.dim(`
|
|
19396
|
-
\u23F1 ${elapsed}s`) + source_default.dim(" \xB7 ") + source_default.dim(`\u2191 ${dIn}`) + source_default.dim(" ") + source_default.dim(`\u2193 ${dOut} tokens`)
|
|
19425
|
+
\u23F1 ${elapsed}s`) + source_default.dim(" \xB7 ") + source_default.dim(`\u2191 ${dIn}`) + source_default.dim(" ") + source_default.dim(`\u2193 ${dOut} tokens`) + source_default.dim(" \xB7 ") + source_default.dim(modelLabel)
|
|
19397
19426
|
);
|
|
19398
19427
|
}
|
|
19399
19428
|
if (debugMode && reply) {
|