@bgicli/bgicli 2.3.1 → 2.3.2
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 +10 -8
- 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.
|
|
15913
|
+
var VERSION2 = "2.3.2";
|
|
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" },
|
|
@@ -16051,6 +16051,8 @@ var SESSION_CTX = {
|
|
|
16051
16051
|
createdAt: "",
|
|
16052
16052
|
wdirSnapshot: null
|
|
16053
16053
|
};
|
|
16054
|
+
var dbRegistry = { version: 1, lastScan: null, databases: {} };
|
|
16055
|
+
var systemPrompt = "";
|
|
16054
16056
|
function installBundledData() {
|
|
16055
16057
|
const bundledData = (0, import_path6.join)(__dirname, "..", "data");
|
|
16056
16058
|
if (!(0, import_fs6.existsSync)(bundledData)) return;
|
|
@@ -17580,14 +17582,14 @@ async function main() {
|
|
|
17580
17582
|
}
|
|
17581
17583
|
console.log(source_default.dim(" \u8F93\u5165\u95EE\u9898\u5F00\u59CB\u5BF9\u8BDD /help \u67E5\u770B\u547D\u4EE4 /cat \u6280\u80FD\u5206\u7C7B @\u6587\u4EF6\u8DEF\u5F84 \u5185\u5D4C\u6587\u4EF6"));
|
|
17582
17584
|
console.log();
|
|
17583
|
-
|
|
17584
|
-
if (Object.keys(
|
|
17585
|
+
dbRegistry = loadDbRegistry();
|
|
17586
|
+
if (Object.keys(dbRegistry.databases).length === 0) {
|
|
17585
17587
|
process.stdout.write(source_default.dim(" \u6B63\u5728\u81EA\u52A8\u626B\u63CF\u53C2\u8003\u6570\u636E\u5E93...\n"));
|
|
17586
17588
|
const report = scanForDatabases([]);
|
|
17587
17589
|
if (report.found.length > 0) {
|
|
17588
|
-
for (const entry of report.found)
|
|
17589
|
-
|
|
17590
|
-
saveDbRegistry(
|
|
17590
|
+
for (const entry of report.found) dbRegistry.databases[entry.id] = entry;
|
|
17591
|
+
dbRegistry.lastScan = (/* @__PURE__ */ new Date()).toISOString();
|
|
17592
|
+
saveDbRegistry(dbRegistry);
|
|
17591
17593
|
process.stdout.write(source_default.green(` \u2713 \u53D1\u73B0 ${report.found.length} \u4E2A\u6570\u636E\u5E93\uFF0C\u5DF2\u81EA\u52A8\u6CE8\u518C (/db list \u67E5\u770B)
|
|
17592
17594
|
`));
|
|
17593
17595
|
} else {
|
|
@@ -17595,7 +17597,7 @@ async function main() {
|
|
|
17595
17597
|
}
|
|
17596
17598
|
console.log();
|
|
17597
17599
|
}
|
|
17598
|
-
|
|
17600
|
+
systemPrompt = buildSystemPrompt(buildDbPromptSection(dbRegistry));
|
|
17599
17601
|
let history = [];
|
|
17600
17602
|
let thinkMode = false;
|
|
17601
17603
|
const injectedSkills = /* @__PURE__ */ new Map();
|
|
@@ -17766,7 +17768,7 @@ ${expanded}` : expanded;
|
|
|
17766
17768
|
try {
|
|
17767
17769
|
const currentCfg = loadConfig();
|
|
17768
17770
|
currentAbortController = new AbortController();
|
|
17769
|
-
const reply = await chat(history, currentCfg,
|
|
17771
|
+
const reply = await chat(history, currentCfg, systemPrompt, sessionStats, currentAbortController.signal);
|
|
17770
17772
|
currentAbortController = null;
|
|
17771
17773
|
if (!reply && history[history.length - 1]?.role === "user") {
|
|
17772
17774
|
history.pop();
|