@bgicli/bgicli 2.8.4 → 2.8.6
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 +44 -28
- package/dist/bio.js +44 -28
- package/dist/mbp.js +44 -28
- package/package.json +1 -1
package/dist/bgi.js
CHANGED
|
@@ -15172,13 +15172,20 @@ ${label} `);
|
|
|
15172
15172
|
clearSpinner();
|
|
15173
15173
|
process.stdout.write(`${label}
|
|
15174
15174
|
`);
|
|
15175
|
+
let heartbeatActive = false;
|
|
15175
15176
|
heartbeat = setInterval(() => {
|
|
15176
|
-
if (Date.now() - lastChunkTime >=
|
|
15177
|
-
const totalSecs = ((Date.now() - t0) / 1e3).toFixed(
|
|
15178
|
-
|
|
15179
|
-
|
|
15177
|
+
if (Date.now() - lastChunkTime >= 3e3) {
|
|
15178
|
+
const totalSecs = ((Date.now() - t0) / 1e3).toFixed(1);
|
|
15179
|
+
if (!heartbeatActive) {
|
|
15180
|
+
process.stdout.write("\n");
|
|
15181
|
+
heartbeatActive = true;
|
|
15182
|
+
}
|
|
15183
|
+
process.stdout.write(`\r${source_default.dim(` \u2502 \u23F1 \u8FD0\u884C\u4E2D... ${totalSecs}s`)}\x1B[K`);
|
|
15184
|
+
} else if (heartbeatActive) {
|
|
15185
|
+
process.stdout.write("\r\x1B[K");
|
|
15186
|
+
heartbeatActive = false;
|
|
15180
15187
|
}
|
|
15181
|
-
},
|
|
15188
|
+
}, 100);
|
|
15182
15189
|
}
|
|
15183
15190
|
let i2 = 0;
|
|
15184
15191
|
while (i2 < chunk.length) {
|
|
@@ -15287,40 +15294,45 @@ async function streamOnce(client, messages, model, signal) {
|
|
|
15287
15294
|
text += s2;
|
|
15288
15295
|
normalWritten = true;
|
|
15289
15296
|
};
|
|
15297
|
+
let thinkLinePartial = "";
|
|
15298
|
+
let thinkLineCount = 0;
|
|
15299
|
+
const flushThinkLine = (line) => {
|
|
15300
|
+
const chunks = line.match(/.{1,78}/g) ?? [""];
|
|
15301
|
+
for (const c2 of chunks) process.stdout.write(source_default.dim(` \u2502 ${c2}
|
|
15302
|
+
`));
|
|
15303
|
+
thinkLineCount++;
|
|
15304
|
+
};
|
|
15305
|
+
const writeThinkChunk = (s2) => {
|
|
15306
|
+
thinkLinePartial += s2;
|
|
15307
|
+
const parts = thinkLinePartial.split("\n");
|
|
15308
|
+
for (let i2 = 0; i2 < parts.length - 1; i2++) {
|
|
15309
|
+
if (parts[i2] !== "") flushThinkLine(parts[i2]);
|
|
15310
|
+
}
|
|
15311
|
+
thinkLinePartial = parts[parts.length - 1];
|
|
15312
|
+
};
|
|
15290
15313
|
const startThinkBlock = () => {
|
|
15291
15314
|
inThink = true;
|
|
15292
15315
|
thinkBuf = "";
|
|
15293
15316
|
thinkStartMs = Date.now();
|
|
15317
|
+
thinkLineCount = 0;
|
|
15318
|
+
thinkLinePartial = "";
|
|
15294
15319
|
if (!normalWritten) process.stdout.write("\n");
|
|
15295
|
-
process.stdout.write(source_default.dim(
|
|
15296
|
-
|
|
15297
|
-
spinInterval = setInterval(() => {
|
|
15298
|
-
spinIdx = (spinIdx + 1) % SPIN_FRAMES.length;
|
|
15299
|
-
process.stdout.write(`\r${source_default.dim(` ${SPIN_FRAMES[spinIdx]} \u601D\u8003\u4E2D...`)}`);
|
|
15300
|
-
}, 80);
|
|
15320
|
+
process.stdout.write(source_default.dim(` \u256D${"\u2500".repeat(44)}
|
|
15321
|
+
`));
|
|
15301
15322
|
};
|
|
15302
15323
|
const endThinkBlock = () => {
|
|
15303
15324
|
if (spinInterval) {
|
|
15304
15325
|
clearInterval(spinInterval);
|
|
15305
15326
|
spinInterval = null;
|
|
15306
15327
|
}
|
|
15307
|
-
|
|
15328
|
+
if (thinkLinePartial.trim()) flushThinkLine(thinkLinePartial);
|
|
15329
|
+
thinkLinePartial = "";
|
|
15308
15330
|
const elapsed = ((Date.now() - thinkStartMs) / 1e3).toFixed(1);
|
|
15309
|
-
const
|
|
15310
|
-
|
|
15311
|
-
|
|
15312
|
-
const suffix = ` \u2713 ${elapsed}s`;
|
|
15313
|
-
process.stdout.write(source_default.dim(` \u256D${"\u2500".repeat(W2)}
|
|
15314
|
-
`));
|
|
15315
|
-
for (const line of trimmed.split("\n")) {
|
|
15316
|
-
const chunks = line.match(/.{1,78}/g) ?? [""];
|
|
15317
|
-
for (const c2 of chunks) process.stdout.write(source_default.dim(` \u2502 ${c2}
|
|
15318
|
-
`));
|
|
15319
|
-
}
|
|
15320
|
-
process.stdout.write(source_default.dim(` \u2570${"\u2500".repeat(Math.max(0, W2 - suffix.length))}${suffix}
|
|
15331
|
+
const suffix = ` \u2713 ${elapsed}s`;
|
|
15332
|
+
const W2 = 44;
|
|
15333
|
+
process.stdout.write(source_default.dim(` \u2570${"\u2500".repeat(Math.max(0, W2 - suffix.length))}${suffix}
|
|
15321
15334
|
|
|
15322
15335
|
`));
|
|
15323
|
-
}
|
|
15324
15336
|
inThink = false;
|
|
15325
15337
|
thinkBuf = "";
|
|
15326
15338
|
};
|
|
@@ -15350,11 +15362,15 @@ async function streamOnce(client, messages, model, signal) {
|
|
|
15350
15362
|
const closeIdx = pendingBuf.indexOf(THINK_CLOSE);
|
|
15351
15363
|
if (closeIdx === -1) {
|
|
15352
15364
|
const hold = partialTagLen(pendingBuf, THINK_CLOSE);
|
|
15353
|
-
|
|
15365
|
+
const safe2 = pendingBuf.slice(0, pendingBuf.length - hold);
|
|
15366
|
+
thinkBuf += safe2;
|
|
15367
|
+
writeThinkChunk(safe2);
|
|
15354
15368
|
pendingBuf = hold > 0 ? pendingBuf.slice(-hold) : "";
|
|
15355
15369
|
break;
|
|
15356
15370
|
}
|
|
15357
|
-
|
|
15371
|
+
const safe = pendingBuf.slice(0, closeIdx);
|
|
15372
|
+
thinkBuf += safe;
|
|
15373
|
+
writeThinkChunk(safe);
|
|
15358
15374
|
pendingBuf = pendingBuf.slice(closeIdx + THINK_CLOSE.length);
|
|
15359
15375
|
endThinkBlock();
|
|
15360
15376
|
if (!normalWritten) process.stdout.write(source_default.green(`${BRAND} \u203A `));
|
|
@@ -17912,7 +17928,7 @@ function clearCheckpoints(sessionId) {
|
|
|
17912
17928
|
|
|
17913
17929
|
// src/index.ts
|
|
17914
17930
|
var import_fs7 = require("fs");
|
|
17915
|
-
var VERSION2 = "2.8.
|
|
17931
|
+
var VERSION2 = "2.8.6";
|
|
17916
17932
|
var BRAND2 = "bgi".toLowerCase();
|
|
17917
17933
|
var SKILLHUB_HUBS = {
|
|
17918
17934
|
bgi: { label: "BGI \u672C\u5730", apiBase: "", backend: "local" },
|
package/dist/bio.js
CHANGED
|
@@ -15172,13 +15172,20 @@ ${label} `);
|
|
|
15172
15172
|
clearSpinner();
|
|
15173
15173
|
process.stdout.write(`${label}
|
|
15174
15174
|
`);
|
|
15175
|
+
let heartbeatActive = false;
|
|
15175
15176
|
heartbeat = setInterval(() => {
|
|
15176
|
-
if (Date.now() - lastChunkTime >=
|
|
15177
|
-
const totalSecs = ((Date.now() - t0) / 1e3).toFixed(
|
|
15178
|
-
|
|
15179
|
-
|
|
15177
|
+
if (Date.now() - lastChunkTime >= 3e3) {
|
|
15178
|
+
const totalSecs = ((Date.now() - t0) / 1e3).toFixed(1);
|
|
15179
|
+
if (!heartbeatActive) {
|
|
15180
|
+
process.stdout.write("\n");
|
|
15181
|
+
heartbeatActive = true;
|
|
15182
|
+
}
|
|
15183
|
+
process.stdout.write(`\r${source_default.dim(` \u2502 \u23F1 \u8FD0\u884C\u4E2D... ${totalSecs}s`)}\x1B[K`);
|
|
15184
|
+
} else if (heartbeatActive) {
|
|
15185
|
+
process.stdout.write("\r\x1B[K");
|
|
15186
|
+
heartbeatActive = false;
|
|
15180
15187
|
}
|
|
15181
|
-
},
|
|
15188
|
+
}, 100);
|
|
15182
15189
|
}
|
|
15183
15190
|
let i2 = 0;
|
|
15184
15191
|
while (i2 < chunk.length) {
|
|
@@ -15287,40 +15294,45 @@ async function streamOnce(client, messages, model, signal) {
|
|
|
15287
15294
|
text += s2;
|
|
15288
15295
|
normalWritten = true;
|
|
15289
15296
|
};
|
|
15297
|
+
let thinkLinePartial = "";
|
|
15298
|
+
let thinkLineCount = 0;
|
|
15299
|
+
const flushThinkLine = (line) => {
|
|
15300
|
+
const chunks = line.match(/.{1,78}/g) ?? [""];
|
|
15301
|
+
for (const c2 of chunks) process.stdout.write(source_default.dim(` \u2502 ${c2}
|
|
15302
|
+
`));
|
|
15303
|
+
thinkLineCount++;
|
|
15304
|
+
};
|
|
15305
|
+
const writeThinkChunk = (s2) => {
|
|
15306
|
+
thinkLinePartial += s2;
|
|
15307
|
+
const parts = thinkLinePartial.split("\n");
|
|
15308
|
+
for (let i2 = 0; i2 < parts.length - 1; i2++) {
|
|
15309
|
+
if (parts[i2] !== "") flushThinkLine(parts[i2]);
|
|
15310
|
+
}
|
|
15311
|
+
thinkLinePartial = parts[parts.length - 1];
|
|
15312
|
+
};
|
|
15290
15313
|
const startThinkBlock = () => {
|
|
15291
15314
|
inThink = true;
|
|
15292
15315
|
thinkBuf = "";
|
|
15293
15316
|
thinkStartMs = Date.now();
|
|
15317
|
+
thinkLineCount = 0;
|
|
15318
|
+
thinkLinePartial = "";
|
|
15294
15319
|
if (!normalWritten) process.stdout.write("\n");
|
|
15295
|
-
process.stdout.write(source_default.dim(
|
|
15296
|
-
|
|
15297
|
-
spinInterval = setInterval(() => {
|
|
15298
|
-
spinIdx = (spinIdx + 1) % SPIN_FRAMES.length;
|
|
15299
|
-
process.stdout.write(`\r${source_default.dim(` ${SPIN_FRAMES[spinIdx]} \u601D\u8003\u4E2D...`)}`);
|
|
15300
|
-
}, 80);
|
|
15320
|
+
process.stdout.write(source_default.dim(` \u256D${"\u2500".repeat(44)}
|
|
15321
|
+
`));
|
|
15301
15322
|
};
|
|
15302
15323
|
const endThinkBlock = () => {
|
|
15303
15324
|
if (spinInterval) {
|
|
15304
15325
|
clearInterval(spinInterval);
|
|
15305
15326
|
spinInterval = null;
|
|
15306
15327
|
}
|
|
15307
|
-
|
|
15328
|
+
if (thinkLinePartial.trim()) flushThinkLine(thinkLinePartial);
|
|
15329
|
+
thinkLinePartial = "";
|
|
15308
15330
|
const elapsed = ((Date.now() - thinkStartMs) / 1e3).toFixed(1);
|
|
15309
|
-
const
|
|
15310
|
-
|
|
15311
|
-
|
|
15312
|
-
const suffix = ` \u2713 ${elapsed}s`;
|
|
15313
|
-
process.stdout.write(source_default.dim(` \u256D${"\u2500".repeat(W2)}
|
|
15314
|
-
`));
|
|
15315
|
-
for (const line of trimmed.split("\n")) {
|
|
15316
|
-
const chunks = line.match(/.{1,78}/g) ?? [""];
|
|
15317
|
-
for (const c2 of chunks) process.stdout.write(source_default.dim(` \u2502 ${c2}
|
|
15318
|
-
`));
|
|
15319
|
-
}
|
|
15320
|
-
process.stdout.write(source_default.dim(` \u2570${"\u2500".repeat(Math.max(0, W2 - suffix.length))}${suffix}
|
|
15331
|
+
const suffix = ` \u2713 ${elapsed}s`;
|
|
15332
|
+
const W2 = 44;
|
|
15333
|
+
process.stdout.write(source_default.dim(` \u2570${"\u2500".repeat(Math.max(0, W2 - suffix.length))}${suffix}
|
|
15321
15334
|
|
|
15322
15335
|
`));
|
|
15323
|
-
}
|
|
15324
15336
|
inThink = false;
|
|
15325
15337
|
thinkBuf = "";
|
|
15326
15338
|
};
|
|
@@ -15350,11 +15362,15 @@ async function streamOnce(client, messages, model, signal) {
|
|
|
15350
15362
|
const closeIdx = pendingBuf.indexOf(THINK_CLOSE);
|
|
15351
15363
|
if (closeIdx === -1) {
|
|
15352
15364
|
const hold = partialTagLen(pendingBuf, THINK_CLOSE);
|
|
15353
|
-
|
|
15365
|
+
const safe2 = pendingBuf.slice(0, pendingBuf.length - hold);
|
|
15366
|
+
thinkBuf += safe2;
|
|
15367
|
+
writeThinkChunk(safe2);
|
|
15354
15368
|
pendingBuf = hold > 0 ? pendingBuf.slice(-hold) : "";
|
|
15355
15369
|
break;
|
|
15356
15370
|
}
|
|
15357
|
-
|
|
15371
|
+
const safe = pendingBuf.slice(0, closeIdx);
|
|
15372
|
+
thinkBuf += safe;
|
|
15373
|
+
writeThinkChunk(safe);
|
|
15358
15374
|
pendingBuf = pendingBuf.slice(closeIdx + THINK_CLOSE.length);
|
|
15359
15375
|
endThinkBlock();
|
|
15360
15376
|
if (!normalWritten) process.stdout.write(source_default.green(`${BRAND} \u203A `));
|
|
@@ -17912,7 +17928,7 @@ function clearCheckpoints(sessionId) {
|
|
|
17912
17928
|
|
|
17913
17929
|
// src/index.ts
|
|
17914
17930
|
var import_fs7 = require("fs");
|
|
17915
|
-
var VERSION2 = "2.8.
|
|
17931
|
+
var VERSION2 = "2.8.6";
|
|
17916
17932
|
var BRAND2 = "bio".toLowerCase();
|
|
17917
17933
|
var SKILLHUB_HUBS = {
|
|
17918
17934
|
bgi: { label: "BGI \u672C\u5730", apiBase: "", backend: "local" },
|
package/dist/mbp.js
CHANGED
|
@@ -15172,13 +15172,20 @@ ${label} `);
|
|
|
15172
15172
|
clearSpinner();
|
|
15173
15173
|
process.stdout.write(`${label}
|
|
15174
15174
|
`);
|
|
15175
|
+
let heartbeatActive = false;
|
|
15175
15176
|
heartbeat = setInterval(() => {
|
|
15176
|
-
if (Date.now() - lastChunkTime >=
|
|
15177
|
-
const totalSecs = ((Date.now() - t0) / 1e3).toFixed(
|
|
15178
|
-
|
|
15179
|
-
|
|
15177
|
+
if (Date.now() - lastChunkTime >= 3e3) {
|
|
15178
|
+
const totalSecs = ((Date.now() - t0) / 1e3).toFixed(1);
|
|
15179
|
+
if (!heartbeatActive) {
|
|
15180
|
+
process.stdout.write("\n");
|
|
15181
|
+
heartbeatActive = true;
|
|
15182
|
+
}
|
|
15183
|
+
process.stdout.write(`\r${source_default.dim(` \u2502 \u23F1 \u8FD0\u884C\u4E2D... ${totalSecs}s`)}\x1B[K`);
|
|
15184
|
+
} else if (heartbeatActive) {
|
|
15185
|
+
process.stdout.write("\r\x1B[K");
|
|
15186
|
+
heartbeatActive = false;
|
|
15180
15187
|
}
|
|
15181
|
-
},
|
|
15188
|
+
}, 100);
|
|
15182
15189
|
}
|
|
15183
15190
|
let i2 = 0;
|
|
15184
15191
|
while (i2 < chunk.length) {
|
|
@@ -15287,40 +15294,45 @@ async function streamOnce(client, messages, model, signal) {
|
|
|
15287
15294
|
text += s2;
|
|
15288
15295
|
normalWritten = true;
|
|
15289
15296
|
};
|
|
15297
|
+
let thinkLinePartial = "";
|
|
15298
|
+
let thinkLineCount = 0;
|
|
15299
|
+
const flushThinkLine = (line) => {
|
|
15300
|
+
const chunks = line.match(/.{1,78}/g) ?? [""];
|
|
15301
|
+
for (const c2 of chunks) process.stdout.write(source_default.dim(` \u2502 ${c2}
|
|
15302
|
+
`));
|
|
15303
|
+
thinkLineCount++;
|
|
15304
|
+
};
|
|
15305
|
+
const writeThinkChunk = (s2) => {
|
|
15306
|
+
thinkLinePartial += s2;
|
|
15307
|
+
const parts = thinkLinePartial.split("\n");
|
|
15308
|
+
for (let i2 = 0; i2 < parts.length - 1; i2++) {
|
|
15309
|
+
if (parts[i2] !== "") flushThinkLine(parts[i2]);
|
|
15310
|
+
}
|
|
15311
|
+
thinkLinePartial = parts[parts.length - 1];
|
|
15312
|
+
};
|
|
15290
15313
|
const startThinkBlock = () => {
|
|
15291
15314
|
inThink = true;
|
|
15292
15315
|
thinkBuf = "";
|
|
15293
15316
|
thinkStartMs = Date.now();
|
|
15317
|
+
thinkLineCount = 0;
|
|
15318
|
+
thinkLinePartial = "";
|
|
15294
15319
|
if (!normalWritten) process.stdout.write("\n");
|
|
15295
|
-
process.stdout.write(source_default.dim(
|
|
15296
|
-
|
|
15297
|
-
spinInterval = setInterval(() => {
|
|
15298
|
-
spinIdx = (spinIdx + 1) % SPIN_FRAMES.length;
|
|
15299
|
-
process.stdout.write(`\r${source_default.dim(` ${SPIN_FRAMES[spinIdx]} \u601D\u8003\u4E2D...`)}`);
|
|
15300
|
-
}, 80);
|
|
15320
|
+
process.stdout.write(source_default.dim(` \u256D${"\u2500".repeat(44)}
|
|
15321
|
+
`));
|
|
15301
15322
|
};
|
|
15302
15323
|
const endThinkBlock = () => {
|
|
15303
15324
|
if (spinInterval) {
|
|
15304
15325
|
clearInterval(spinInterval);
|
|
15305
15326
|
spinInterval = null;
|
|
15306
15327
|
}
|
|
15307
|
-
|
|
15328
|
+
if (thinkLinePartial.trim()) flushThinkLine(thinkLinePartial);
|
|
15329
|
+
thinkLinePartial = "";
|
|
15308
15330
|
const elapsed = ((Date.now() - thinkStartMs) / 1e3).toFixed(1);
|
|
15309
|
-
const
|
|
15310
|
-
|
|
15311
|
-
|
|
15312
|
-
const suffix = ` \u2713 ${elapsed}s`;
|
|
15313
|
-
process.stdout.write(source_default.dim(` \u256D${"\u2500".repeat(W2)}
|
|
15314
|
-
`));
|
|
15315
|
-
for (const line of trimmed.split("\n")) {
|
|
15316
|
-
const chunks = line.match(/.{1,78}/g) ?? [""];
|
|
15317
|
-
for (const c2 of chunks) process.stdout.write(source_default.dim(` \u2502 ${c2}
|
|
15318
|
-
`));
|
|
15319
|
-
}
|
|
15320
|
-
process.stdout.write(source_default.dim(` \u2570${"\u2500".repeat(Math.max(0, W2 - suffix.length))}${suffix}
|
|
15331
|
+
const suffix = ` \u2713 ${elapsed}s`;
|
|
15332
|
+
const W2 = 44;
|
|
15333
|
+
process.stdout.write(source_default.dim(` \u2570${"\u2500".repeat(Math.max(0, W2 - suffix.length))}${suffix}
|
|
15321
15334
|
|
|
15322
15335
|
`));
|
|
15323
|
-
}
|
|
15324
15336
|
inThink = false;
|
|
15325
15337
|
thinkBuf = "";
|
|
15326
15338
|
};
|
|
@@ -15350,11 +15362,15 @@ async function streamOnce(client, messages, model, signal) {
|
|
|
15350
15362
|
const closeIdx = pendingBuf.indexOf(THINK_CLOSE);
|
|
15351
15363
|
if (closeIdx === -1) {
|
|
15352
15364
|
const hold = partialTagLen(pendingBuf, THINK_CLOSE);
|
|
15353
|
-
|
|
15365
|
+
const safe2 = pendingBuf.slice(0, pendingBuf.length - hold);
|
|
15366
|
+
thinkBuf += safe2;
|
|
15367
|
+
writeThinkChunk(safe2);
|
|
15354
15368
|
pendingBuf = hold > 0 ? pendingBuf.slice(-hold) : "";
|
|
15355
15369
|
break;
|
|
15356
15370
|
}
|
|
15357
|
-
|
|
15371
|
+
const safe = pendingBuf.slice(0, closeIdx);
|
|
15372
|
+
thinkBuf += safe;
|
|
15373
|
+
writeThinkChunk(safe);
|
|
15358
15374
|
pendingBuf = pendingBuf.slice(closeIdx + THINK_CLOSE.length);
|
|
15359
15375
|
endThinkBlock();
|
|
15360
15376
|
if (!normalWritten) process.stdout.write(source_default.green(`${BRAND} \u203A `));
|
|
@@ -17912,7 +17928,7 @@ function clearCheckpoints(sessionId) {
|
|
|
17912
17928
|
|
|
17913
17929
|
// src/index.ts
|
|
17914
17930
|
var import_fs7 = require("fs");
|
|
17915
|
-
var VERSION2 = "2.8.
|
|
17931
|
+
var VERSION2 = "2.8.6";
|
|
17916
17932
|
var BRAND2 = "mbp".toLowerCase();
|
|
17917
17933
|
var SKILLHUB_HUBS = {
|
|
17918
17934
|
bgi: { label: "BGI \u672C\u5730", apiBase: "", backend: "local" },
|