@bgicli/bgicli 2.8.5 → 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 CHANGED
@@ -15294,40 +15294,45 @@ async function streamOnce(client, messages, model, signal) {
15294
15294
  text += s2;
15295
15295
  normalWritten = true;
15296
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
+ };
15297
15313
  const startThinkBlock = () => {
15298
15314
  inThink = true;
15299
15315
  thinkBuf = "";
15300
15316
  thinkStartMs = Date.now();
15317
+ thinkLineCount = 0;
15318
+ thinkLinePartial = "";
15301
15319
  if (!normalWritten) process.stdout.write("\n");
15302
- process.stdout.write(source_default.dim(" \u280B \u601D\u8003\u4E2D..."));
15303
- spinIdx = 0;
15304
- spinInterval = setInterval(() => {
15305
- spinIdx = (spinIdx + 1) % SPIN_FRAMES.length;
15306
- process.stdout.write(`\r${source_default.dim(` ${SPIN_FRAMES[spinIdx]} \u601D\u8003\u4E2D...`)}`);
15307
- }, 80);
15320
+ process.stdout.write(source_default.dim(` \u256D${"\u2500".repeat(44)}
15321
+ `));
15308
15322
  };
15309
15323
  const endThinkBlock = () => {
15310
15324
  if (spinInterval) {
15311
15325
  clearInterval(spinInterval);
15312
15326
  spinInterval = null;
15313
15327
  }
15314
- process.stdout.write("\r\x1B[K");
15328
+ if (thinkLinePartial.trim()) flushThinkLine(thinkLinePartial);
15329
+ thinkLinePartial = "";
15315
15330
  const elapsed = ((Date.now() - thinkStartMs) / 1e3).toFixed(1);
15316
- const trimmed = thinkBuf.trim();
15317
- if (trimmed) {
15318
- const W2 = 44;
15319
- const suffix = ` \u2713 ${elapsed}s`;
15320
- process.stdout.write(source_default.dim(` \u256D${"\u2500".repeat(W2)}
15321
- `));
15322
- for (const line of trimmed.split("\n")) {
15323
- const chunks = line.match(/.{1,78}/g) ?? [""];
15324
- for (const c2 of chunks) process.stdout.write(source_default.dim(` \u2502 ${c2}
15325
- `));
15326
- }
15327
- 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}
15328
15334
 
15329
15335
  `));
15330
- }
15331
15336
  inThink = false;
15332
15337
  thinkBuf = "";
15333
15338
  };
@@ -15357,11 +15362,15 @@ async function streamOnce(client, messages, model, signal) {
15357
15362
  const closeIdx = pendingBuf.indexOf(THINK_CLOSE);
15358
15363
  if (closeIdx === -1) {
15359
15364
  const hold = partialTagLen(pendingBuf, THINK_CLOSE);
15360
- thinkBuf += pendingBuf.slice(0, pendingBuf.length - hold);
15365
+ const safe2 = pendingBuf.slice(0, pendingBuf.length - hold);
15366
+ thinkBuf += safe2;
15367
+ writeThinkChunk(safe2);
15361
15368
  pendingBuf = hold > 0 ? pendingBuf.slice(-hold) : "";
15362
15369
  break;
15363
15370
  }
15364
- thinkBuf += pendingBuf.slice(0, closeIdx);
15371
+ const safe = pendingBuf.slice(0, closeIdx);
15372
+ thinkBuf += safe;
15373
+ writeThinkChunk(safe);
15365
15374
  pendingBuf = pendingBuf.slice(closeIdx + THINK_CLOSE.length);
15366
15375
  endThinkBlock();
15367
15376
  if (!normalWritten) process.stdout.write(source_default.green(`${BRAND} \u203A `));
@@ -17919,7 +17928,7 @@ function clearCheckpoints(sessionId) {
17919
17928
 
17920
17929
  // src/index.ts
17921
17930
  var import_fs7 = require("fs");
17922
- var VERSION2 = "2.8.5";
17931
+ var VERSION2 = "2.8.6";
17923
17932
  var BRAND2 = "bgi".toLowerCase();
17924
17933
  var SKILLHUB_HUBS = {
17925
17934
  bgi: { label: "BGI \u672C\u5730", apiBase: "", backend: "local" },
package/dist/bio.js CHANGED
@@ -15294,40 +15294,45 @@ async function streamOnce(client, messages, model, signal) {
15294
15294
  text += s2;
15295
15295
  normalWritten = true;
15296
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
+ };
15297
15313
  const startThinkBlock = () => {
15298
15314
  inThink = true;
15299
15315
  thinkBuf = "";
15300
15316
  thinkStartMs = Date.now();
15317
+ thinkLineCount = 0;
15318
+ thinkLinePartial = "";
15301
15319
  if (!normalWritten) process.stdout.write("\n");
15302
- process.stdout.write(source_default.dim(" \u280B \u601D\u8003\u4E2D..."));
15303
- spinIdx = 0;
15304
- spinInterval = setInterval(() => {
15305
- spinIdx = (spinIdx + 1) % SPIN_FRAMES.length;
15306
- process.stdout.write(`\r${source_default.dim(` ${SPIN_FRAMES[spinIdx]} \u601D\u8003\u4E2D...`)}`);
15307
- }, 80);
15320
+ process.stdout.write(source_default.dim(` \u256D${"\u2500".repeat(44)}
15321
+ `));
15308
15322
  };
15309
15323
  const endThinkBlock = () => {
15310
15324
  if (spinInterval) {
15311
15325
  clearInterval(spinInterval);
15312
15326
  spinInterval = null;
15313
15327
  }
15314
- process.stdout.write("\r\x1B[K");
15328
+ if (thinkLinePartial.trim()) flushThinkLine(thinkLinePartial);
15329
+ thinkLinePartial = "";
15315
15330
  const elapsed = ((Date.now() - thinkStartMs) / 1e3).toFixed(1);
15316
- const trimmed = thinkBuf.trim();
15317
- if (trimmed) {
15318
- const W2 = 44;
15319
- const suffix = ` \u2713 ${elapsed}s`;
15320
- process.stdout.write(source_default.dim(` \u256D${"\u2500".repeat(W2)}
15321
- `));
15322
- for (const line of trimmed.split("\n")) {
15323
- const chunks = line.match(/.{1,78}/g) ?? [""];
15324
- for (const c2 of chunks) process.stdout.write(source_default.dim(` \u2502 ${c2}
15325
- `));
15326
- }
15327
- 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}
15328
15334
 
15329
15335
  `));
15330
- }
15331
15336
  inThink = false;
15332
15337
  thinkBuf = "";
15333
15338
  };
@@ -15357,11 +15362,15 @@ async function streamOnce(client, messages, model, signal) {
15357
15362
  const closeIdx = pendingBuf.indexOf(THINK_CLOSE);
15358
15363
  if (closeIdx === -1) {
15359
15364
  const hold = partialTagLen(pendingBuf, THINK_CLOSE);
15360
- thinkBuf += pendingBuf.slice(0, pendingBuf.length - hold);
15365
+ const safe2 = pendingBuf.slice(0, pendingBuf.length - hold);
15366
+ thinkBuf += safe2;
15367
+ writeThinkChunk(safe2);
15361
15368
  pendingBuf = hold > 0 ? pendingBuf.slice(-hold) : "";
15362
15369
  break;
15363
15370
  }
15364
- thinkBuf += pendingBuf.slice(0, closeIdx);
15371
+ const safe = pendingBuf.slice(0, closeIdx);
15372
+ thinkBuf += safe;
15373
+ writeThinkChunk(safe);
15365
15374
  pendingBuf = pendingBuf.slice(closeIdx + THINK_CLOSE.length);
15366
15375
  endThinkBlock();
15367
15376
  if (!normalWritten) process.stdout.write(source_default.green(`${BRAND} \u203A `));
@@ -17919,7 +17928,7 @@ function clearCheckpoints(sessionId) {
17919
17928
 
17920
17929
  // src/index.ts
17921
17930
  var import_fs7 = require("fs");
17922
- var VERSION2 = "2.8.5";
17931
+ var VERSION2 = "2.8.6";
17923
17932
  var BRAND2 = "bio".toLowerCase();
17924
17933
  var SKILLHUB_HUBS = {
17925
17934
  bgi: { label: "BGI \u672C\u5730", apiBase: "", backend: "local" },
package/dist/mbp.js CHANGED
@@ -15294,40 +15294,45 @@ async function streamOnce(client, messages, model, signal) {
15294
15294
  text += s2;
15295
15295
  normalWritten = true;
15296
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
+ };
15297
15313
  const startThinkBlock = () => {
15298
15314
  inThink = true;
15299
15315
  thinkBuf = "";
15300
15316
  thinkStartMs = Date.now();
15317
+ thinkLineCount = 0;
15318
+ thinkLinePartial = "";
15301
15319
  if (!normalWritten) process.stdout.write("\n");
15302
- process.stdout.write(source_default.dim(" \u280B \u601D\u8003\u4E2D..."));
15303
- spinIdx = 0;
15304
- spinInterval = setInterval(() => {
15305
- spinIdx = (spinIdx + 1) % SPIN_FRAMES.length;
15306
- process.stdout.write(`\r${source_default.dim(` ${SPIN_FRAMES[spinIdx]} \u601D\u8003\u4E2D...`)}`);
15307
- }, 80);
15320
+ process.stdout.write(source_default.dim(` \u256D${"\u2500".repeat(44)}
15321
+ `));
15308
15322
  };
15309
15323
  const endThinkBlock = () => {
15310
15324
  if (spinInterval) {
15311
15325
  clearInterval(spinInterval);
15312
15326
  spinInterval = null;
15313
15327
  }
15314
- process.stdout.write("\r\x1B[K");
15328
+ if (thinkLinePartial.trim()) flushThinkLine(thinkLinePartial);
15329
+ thinkLinePartial = "";
15315
15330
  const elapsed = ((Date.now() - thinkStartMs) / 1e3).toFixed(1);
15316
- const trimmed = thinkBuf.trim();
15317
- if (trimmed) {
15318
- const W2 = 44;
15319
- const suffix = ` \u2713 ${elapsed}s`;
15320
- process.stdout.write(source_default.dim(` \u256D${"\u2500".repeat(W2)}
15321
- `));
15322
- for (const line of trimmed.split("\n")) {
15323
- const chunks = line.match(/.{1,78}/g) ?? [""];
15324
- for (const c2 of chunks) process.stdout.write(source_default.dim(` \u2502 ${c2}
15325
- `));
15326
- }
15327
- 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}
15328
15334
 
15329
15335
  `));
15330
- }
15331
15336
  inThink = false;
15332
15337
  thinkBuf = "";
15333
15338
  };
@@ -15357,11 +15362,15 @@ async function streamOnce(client, messages, model, signal) {
15357
15362
  const closeIdx = pendingBuf.indexOf(THINK_CLOSE);
15358
15363
  if (closeIdx === -1) {
15359
15364
  const hold = partialTagLen(pendingBuf, THINK_CLOSE);
15360
- thinkBuf += pendingBuf.slice(0, pendingBuf.length - hold);
15365
+ const safe2 = pendingBuf.slice(0, pendingBuf.length - hold);
15366
+ thinkBuf += safe2;
15367
+ writeThinkChunk(safe2);
15361
15368
  pendingBuf = hold > 0 ? pendingBuf.slice(-hold) : "";
15362
15369
  break;
15363
15370
  }
15364
- thinkBuf += pendingBuf.slice(0, closeIdx);
15371
+ const safe = pendingBuf.slice(0, closeIdx);
15372
+ thinkBuf += safe;
15373
+ writeThinkChunk(safe);
15365
15374
  pendingBuf = pendingBuf.slice(closeIdx + THINK_CLOSE.length);
15366
15375
  endThinkBlock();
15367
15376
  if (!normalWritten) process.stdout.write(source_default.green(`${BRAND} \u203A `));
@@ -17919,7 +17928,7 @@ function clearCheckpoints(sessionId) {
17919
17928
 
17920
17929
  // src/index.ts
17921
17930
  var import_fs7 = require("fs");
17922
- var VERSION2 = "2.8.5";
17931
+ var VERSION2 = "2.8.6";
17923
17932
  var BRAND2 = "mbp".toLowerCase();
17924
17933
  var SKILLHUB_HUBS = {
17925
17934
  bgi: { label: "BGI \u672C\u5730", apiBase: "", backend: "local" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgicli/bgicli",
3
- "version": "2.8.5",
3
+ "version": "2.8.6",
4
4
  "description": "BGI CLI — Bioinformatics AI terminal for Chinese researchers (百炼/DeepSeek/Kimi/Qwen)",
5
5
  "bin": {
6
6
  "bgi": "dist/bgi.js",