@bgicli/bgicli 2.3.3 → 2.3.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.
Files changed (2) hide show
  1. package/dist/bgi.js +28 -3
  2. package/package.json +1 -1
package/dist/bgi.js CHANGED
@@ -15941,7 +15941,7 @@ function clearCheckpoints(sessionId) {
15941
15941
 
15942
15942
  // src/index.ts
15943
15943
  var import_fs7 = require("fs");
15944
- var VERSION2 = "2.3.3";
15944
+ var VERSION2 = "2.3.4";
15945
15945
  var SKILLHUB_HUBS = {
15946
15946
  bgi: { label: "BGI\u5185\u7F51", apiBase: "https://clawhub.ai", backend: "clawhub" },
15947
15947
  clawhub: { label: "clawhub.ai", apiBase: "https://clawhub.ai", backend: "clawhub" },
@@ -17694,17 +17694,42 @@ async function main() {
17694
17694
  async function exitWithReport() {
17695
17695
  if (exiting) return;
17696
17696
  exiting = true;
17697
+ rl.removeAllListeners("SIGINT");
17698
+ process.removeAllListeners("SIGINT");
17697
17699
  const runtime = formatDuration(Date.now() - sessionStartTime);
17698
17700
  console.log("\n" + source_default.bold.cyan("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 \u4F1A\u8BDD\u62A5\u544A \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"));
17699
17701
  console.log(` \u8FD0\u884C\u65F6\u95F4: ${source_default.white(runtime)}`);
17700
17702
  console.log(` \u6D88\u8017 Token: ${source_default.yellow("\u8F93\u5165")} ${source_default.bold(String(sessionStats.inputTokens))} | ${source_default.green("\u8F93\u51FA")} ${source_default.bold(String(sessionStats.outputTokens))}`);
17701
17703
  console.log(` \u6267\u884C\u547D\u4EE4: ${source_default.green("\u2713 " + sessionStats.successCmds + " \u6210\u529F")} ${sessionStats.failCmds > 0 ? source_default.yellow("\u2717 " + sessionStats.failCmds + " \u5931\u8D25") : source_default.dim("\u2717 0 \u5931\u8D25")}`);
17702
17704
  console.log(source_default.bold.cyan("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"));
17705
+ rl.removeAllListeners("close");
17706
+ rl.close();
17707
+ let ans = "n";
17703
17708
  try {
17704
- const ans = await question(rl, source_default.cyan("\n \u662F\u5426\u4FDD\u5B58\u672C\u6B21\u4F1A\u8BDD\u8BB0\u5FC6\uFF1F[y/N] "));
17705
- if (ans.trim().toLowerCase() === "y") saveSessionMemory();
17709
+ const exitRl = (0, import_readline.createInterface)({ input: process.stdin, output: process.stdout });
17710
+ exitRl.on("SIGINT", () => {
17711
+ exitRl.close();
17712
+ process.exit(0);
17713
+ });
17714
+ process.once("SIGINT", () => {
17715
+ exitRl.close();
17716
+ process.exit(0);
17717
+ });
17718
+ ans = await Promise.race([
17719
+ new Promise((res) => {
17720
+ exitRl.question(source_default.cyan("\n \u662F\u5426\u4FDD\u5B58\u672C\u6B21\u4F1A\u8BDD\u8BB0\u5FC6\uFF1F[y/N] "), (a2) => {
17721
+ exitRl.close();
17722
+ res(a2.trim().toLowerCase());
17723
+ });
17724
+ }),
17725
+ new Promise((res) => setTimeout(() => {
17726
+ exitRl.close();
17727
+ res("n");
17728
+ }, 15e3))
17729
+ ]);
17706
17730
  } catch {
17707
17731
  }
17732
+ if (ans === "y") saveSessionMemory();
17708
17733
  console.log(source_default.dim("\n\u518D\u89C1\uFF01"));
17709
17734
  process.exit(0);
17710
17735
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgicli/bgicli",
3
- "version": "2.3.3",
3
+ "version": "2.3.4",
4
4
  "description": "BGI CLI — Bioinformatics AI terminal for Chinese researchers (百炼/DeepSeek/Kimi/Qwen)",
5
5
  "bin": {
6
6
  "bgi": "dist/bgi.js"