@bgicli/bgicli 2.3.0 → 2.3.1

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 +15 -4
  2. package/package.json +1 -1
package/dist/bgi.js CHANGED
@@ -15910,7 +15910,7 @@ function clearCheckpoints(sessionId) {
15910
15910
 
15911
15911
  // src/index.ts
15912
15912
  var import_fs7 = require("fs");
15913
- var VERSION2 = "2.3.0";
15913
+ var VERSION2 = "2.3.1";
15914
15914
  var SKILLHUB_HUBS = {
15915
15915
  bgi: { label: "BGI\u5185\u7F51", apiBase: "https://clawhub.ai", backend: "clawhub" },
15916
15916
  clawhub: { label: "clawhub.ai", apiBase: "https://clawhub.ai", backend: "clawhub" },
@@ -17553,8 +17553,9 @@ async function main() {
17553
17553
  terminal: true,
17554
17554
  historySize: 100
17555
17555
  });
17556
+ let sigintHandling = false;
17556
17557
  rl.on("close", () => {
17557
- process.exit(0);
17558
+ if (!sigintHandling) process.exit(0);
17558
17559
  });
17559
17560
  await firstRunIfNeeded(rl);
17560
17561
  const cfg = loadConfig();
@@ -17674,18 +17675,28 @@ async function main() {
17674
17675
  console.log(source_default.dim("\n\u518D\u89C1\uFF01"));
17675
17676
  process.exit(0);
17676
17677
  }
17677
- process.on("SIGINT", () => {
17678
+ let lastSigintCall = 0;
17679
+ function handleSigint() {
17678
17680
  const now = Date.now();
17681
+ if (now - lastSigintCall < 200) return;
17682
+ lastSigintCall = now;
17679
17683
  if (now - lastSigintTime < 2e3) {
17684
+ sigintHandling = false;
17680
17685
  exitWithReport().catch(() => process.exit(0));
17681
17686
  } else {
17682
17687
  lastSigintTime = now;
17688
+ sigintHandling = true;
17683
17689
  if (currentAbortController) {
17684
17690
  currentAbortController.abort();
17685
17691
  }
17686
17692
  process.stdout.write(source_default.yellow("\n\n [\u4EFB\u52A1\u5DF2\u4E2D\u65AD] \u518D\u6309\u4E00\u6B21 Ctrl+C \u9000\u51FA\n\n"));
17693
+ setTimeout(() => {
17694
+ sigintHandling = false;
17695
+ }, 500);
17687
17696
  }
17688
- });
17697
+ }
17698
+ rl.on("SIGINT", handleSigint);
17699
+ process.on("SIGINT", handleSigint);
17689
17700
  while (true) {
17690
17701
  let input;
17691
17702
  const thinkIndicator = thinkMode ? source_default.yellow("[\u601D\u8003]") + " " : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgicli/bgicli",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "BGI CLI — Bioinformatics AI terminal for Chinese researchers (百炼/DeepSeek/Kimi/Qwen)",
5
5
  "bin": {
6
6
  "bgi": "dist/bgi.js"