@bgicli/bgicli 2.8.7 → 2.8.8
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 +43 -44
- package/dist/bio.js +43 -44
- package/dist/mbp.js +43 -44
- package/package.json +1 -1
package/dist/bgi.js
CHANGED
|
@@ -17783,6 +17783,24 @@ var SKILL_ROUTES = [
|
|
|
17783
17783
|
]
|
|
17784
17784
|
}
|
|
17785
17785
|
];
|
|
17786
|
+
function routeSkill(message) {
|
|
17787
|
+
const lower = message.toLowerCase();
|
|
17788
|
+
const scores = /* @__PURE__ */ new Map();
|
|
17789
|
+
for (const route of SKILL_ROUTES) {
|
|
17790
|
+
let score = 0;
|
|
17791
|
+
for (const kw of route.keywords) {
|
|
17792
|
+
if (lower.includes(kw.toLowerCase())) {
|
|
17793
|
+
score += 1 + kw.length * 0.1;
|
|
17794
|
+
}
|
|
17795
|
+
}
|
|
17796
|
+
if (score > 0) scores.set(route.id, { route, score });
|
|
17797
|
+
}
|
|
17798
|
+
const sorted = Array.from(scores.values()).sort((a2, b2) => b2.score - a2.score).slice(0, 5);
|
|
17799
|
+
return {
|
|
17800
|
+
routes: sorted.map((v2) => v2.route),
|
|
17801
|
+
topScore: sorted[0]?.score ?? 0
|
|
17802
|
+
};
|
|
17803
|
+
}
|
|
17786
17804
|
|
|
17787
17805
|
// src/sessions.ts
|
|
17788
17806
|
var import_fs5 = require("fs");
|
|
@@ -17910,7 +17928,7 @@ function clearCheckpoints(sessionId) {
|
|
|
17910
17928
|
|
|
17911
17929
|
// src/index.ts
|
|
17912
17930
|
var import_fs7 = require("fs");
|
|
17913
|
-
var VERSION2 = "2.8.
|
|
17931
|
+
var VERSION2 = "2.8.8";
|
|
17914
17932
|
var BRAND2 = "bgi".toLowerCase();
|
|
17915
17933
|
var SKILLHUB_HUBS = {
|
|
17916
17934
|
bgi: { label: "BGI \u672C\u5730", apiBase: "", backend: "local" },
|
|
@@ -20172,52 +20190,33 @@ async function main() {
|
|
|
20172
20190
|
console.log();
|
|
20173
20191
|
continue;
|
|
20174
20192
|
}
|
|
20175
|
-
{
|
|
20176
|
-
|
|
20177
|
-
|
|
20178
|
-
|
|
20179
|
-
|
|
20180
|
-
|
|
20181
|
-
|
|
20182
|
-
}
|
|
20183
|
-
|
|
20184
|
-
|
|
20185
|
-
|
|
20186
|
-
|
|
20187
|
-
|
|
20188
|
-
|
|
20189
|
-
|
|
20190
|
-
|
|
20191
|
-
|
|
20192
|
-
|
|
20193
|
-
|
|
20194
|
-
|
|
20195
|
-
|
|
20196
|
-
console.log(source_default.bold.yellow("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20197
|
-
const skillChoice = await question(rl, source_default.yellow(" \u6FC0\u6D3B\u6B64\u6280\u80FD\uFF1F[Y/n] \u203A "));
|
|
20198
|
-
const c2 = skillChoice.trim().toLowerCase();
|
|
20199
|
-
if (c2 === "" || c2 === "y") {
|
|
20200
|
-
await injectSkill(newRecs[0].id, history, injectedSkills, rl, true);
|
|
20193
|
+
const { routes: suggestedRoutes, topScore } = routeSkill(trimmed);
|
|
20194
|
+
const newRoutes = suggestedRoutes.filter((r2) => !injectedSkills.has(r2.id));
|
|
20195
|
+
if (newRoutes.length === 1 && topScore >= 8) {
|
|
20196
|
+
await injectSkill(newRoutes[0].id, history, injectedSkills, rl, false);
|
|
20197
|
+
} else if (newRoutes.length >= 1 && topScore >= 2) {
|
|
20198
|
+
const candidates = newRoutes.slice(0, 3);
|
|
20199
|
+
console.log();
|
|
20200
|
+
console.log(source_default.bold.yellow("\u250C\u2500 \u{1F50D} \u68C0\u6D4B\u5230\u76F8\u5173\u6280\u80FD \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20201
|
+
candidates.forEach((r2, i2) => {
|
|
20202
|
+
console.log(`\u2502 ${source_default.bold.cyan(`[${i2 + 1}]`)} ${source_default.cyan(r2.id)}${source_default.dim(" \u2014")} ${r2.name}`);
|
|
20203
|
+
});
|
|
20204
|
+
console.log(source_default.bold.yellow("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20205
|
+
const pickPrompt = candidates.length > 1 ? ` \u6FC0\u6D3B\u54EA\u4E2A\u6280\u80FD\uFF1F\u8F93\u5165\u7F16\u53F7 (\u5982 1 \u6216 1,2)\uFF0C\u56DE\u8F66\u8DF3\u8FC7 \u203A ` : ` \u6FC0\u6D3B\u6B64\u6280\u80FD\uFF1F[Y/n] \u203A `;
|
|
20206
|
+
const skillChoice = await question(rl, source_default.yellow(pickPrompt));
|
|
20207
|
+
const choiceTrimmed = skillChoice.trim().toLowerCase();
|
|
20208
|
+
if (choiceTrimmed !== "" && choiceTrimmed !== "n") {
|
|
20209
|
+
let indices;
|
|
20210
|
+
if (candidates.length === 1) {
|
|
20211
|
+
indices = choiceTrimmed === "y" || choiceTrimmed === "" ? [0] : [];
|
|
20212
|
+
} else {
|
|
20213
|
+
indices = choiceTrimmed.split(",").map((s2) => parseInt(s2.trim(), 10) - 1).filter((i2) => i2 >= 0 && i2 < candidates.length);
|
|
20201
20214
|
}
|
|
20202
|
-
|
|
20203
|
-
|
|
20204
|
-
console.log();
|
|
20205
|
-
console.log(source_default.bold.yellow("\u250C\u2500 \u68C0\u6D4B\u5230\u76F8\u5173\u6280\u80FD \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20206
|
-
newRecs.forEach((r2, i2) => {
|
|
20207
|
-
console.log(`\u2502 ${source_default.bold.cyan(`[${i2 + 1}]`)} ${source_default.cyan(r2.id)}${source_default.dim(" \u2014")} ${r2.name}`);
|
|
20208
|
-
console.log(source_default.dim(`\u2502 ${r2.reason}`));
|
|
20209
|
-
});
|
|
20210
|
-
console.log(source_default.bold.yellow("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20211
|
-
const skillChoice = await question(rl, source_default.yellow(` \u6FC0\u6D3B\u54EA\u4E2A\u6280\u80FD\uFF1F\u8F93\u5165\u7F16\u53F7 (\u5982 1 \u6216 1,2)\uFF0C\u56DE\u8F66\u8DF3\u8FC7 \u203A `));
|
|
20212
|
-
const c2 = skillChoice.trim().toLowerCase();
|
|
20213
|
-
if (c2 !== "" && c2 !== "n") {
|
|
20214
|
-
const indices = c2.split(",").map((s2) => parseInt(s2.trim(), 10) - 1).filter((i2) => i2 >= 0 && i2 < newRecs.length);
|
|
20215
|
-
for (const idx of indices) {
|
|
20216
|
-
await injectSkill(newRecs[idx].id, history, injectedSkills, rl, true);
|
|
20217
|
-
}
|
|
20215
|
+
for (const idx of indices) {
|
|
20216
|
+
await injectSkill(candidates[idx].id, history, injectedSkills, rl, true);
|
|
20218
20217
|
}
|
|
20219
|
-
console.log();
|
|
20220
20218
|
}
|
|
20219
|
+
console.log();
|
|
20221
20220
|
}
|
|
20222
20221
|
const expanded = expandFileRefs(trimmed);
|
|
20223
20222
|
const userContent = thinkMode ? `/think
|
package/dist/bio.js
CHANGED
|
@@ -17783,6 +17783,24 @@ var SKILL_ROUTES = [
|
|
|
17783
17783
|
]
|
|
17784
17784
|
}
|
|
17785
17785
|
];
|
|
17786
|
+
function routeSkill(message) {
|
|
17787
|
+
const lower = message.toLowerCase();
|
|
17788
|
+
const scores = /* @__PURE__ */ new Map();
|
|
17789
|
+
for (const route of SKILL_ROUTES) {
|
|
17790
|
+
let score = 0;
|
|
17791
|
+
for (const kw of route.keywords) {
|
|
17792
|
+
if (lower.includes(kw.toLowerCase())) {
|
|
17793
|
+
score += 1 + kw.length * 0.1;
|
|
17794
|
+
}
|
|
17795
|
+
}
|
|
17796
|
+
if (score > 0) scores.set(route.id, { route, score });
|
|
17797
|
+
}
|
|
17798
|
+
const sorted = Array.from(scores.values()).sort((a2, b2) => b2.score - a2.score).slice(0, 5);
|
|
17799
|
+
return {
|
|
17800
|
+
routes: sorted.map((v2) => v2.route),
|
|
17801
|
+
topScore: sorted[0]?.score ?? 0
|
|
17802
|
+
};
|
|
17803
|
+
}
|
|
17786
17804
|
|
|
17787
17805
|
// src/sessions.ts
|
|
17788
17806
|
var import_fs5 = require("fs");
|
|
@@ -17910,7 +17928,7 @@ function clearCheckpoints(sessionId) {
|
|
|
17910
17928
|
|
|
17911
17929
|
// src/index.ts
|
|
17912
17930
|
var import_fs7 = require("fs");
|
|
17913
|
-
var VERSION2 = "2.8.
|
|
17931
|
+
var VERSION2 = "2.8.8";
|
|
17914
17932
|
var BRAND2 = "bio".toLowerCase();
|
|
17915
17933
|
var SKILLHUB_HUBS = {
|
|
17916
17934
|
bgi: { label: "BGI \u672C\u5730", apiBase: "", backend: "local" },
|
|
@@ -20172,52 +20190,33 @@ async function main() {
|
|
|
20172
20190
|
console.log();
|
|
20173
20191
|
continue;
|
|
20174
20192
|
}
|
|
20175
|
-
{
|
|
20176
|
-
|
|
20177
|
-
|
|
20178
|
-
|
|
20179
|
-
|
|
20180
|
-
|
|
20181
|
-
|
|
20182
|
-
}
|
|
20183
|
-
|
|
20184
|
-
|
|
20185
|
-
|
|
20186
|
-
|
|
20187
|
-
|
|
20188
|
-
|
|
20189
|
-
|
|
20190
|
-
|
|
20191
|
-
|
|
20192
|
-
|
|
20193
|
-
|
|
20194
|
-
|
|
20195
|
-
|
|
20196
|
-
console.log(source_default.bold.yellow("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20197
|
-
const skillChoice = await question(rl, source_default.yellow(" \u6FC0\u6D3B\u6B64\u6280\u80FD\uFF1F[Y/n] \u203A "));
|
|
20198
|
-
const c2 = skillChoice.trim().toLowerCase();
|
|
20199
|
-
if (c2 === "" || c2 === "y") {
|
|
20200
|
-
await injectSkill(newRecs[0].id, history, injectedSkills, rl, true);
|
|
20193
|
+
const { routes: suggestedRoutes, topScore } = routeSkill(trimmed);
|
|
20194
|
+
const newRoutes = suggestedRoutes.filter((r2) => !injectedSkills.has(r2.id));
|
|
20195
|
+
if (newRoutes.length === 1 && topScore >= 8) {
|
|
20196
|
+
await injectSkill(newRoutes[0].id, history, injectedSkills, rl, false);
|
|
20197
|
+
} else if (newRoutes.length >= 1 && topScore >= 2) {
|
|
20198
|
+
const candidates = newRoutes.slice(0, 3);
|
|
20199
|
+
console.log();
|
|
20200
|
+
console.log(source_default.bold.yellow("\u250C\u2500 \u{1F50D} \u68C0\u6D4B\u5230\u76F8\u5173\u6280\u80FD \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20201
|
+
candidates.forEach((r2, i2) => {
|
|
20202
|
+
console.log(`\u2502 ${source_default.bold.cyan(`[${i2 + 1}]`)} ${source_default.cyan(r2.id)}${source_default.dim(" \u2014")} ${r2.name}`);
|
|
20203
|
+
});
|
|
20204
|
+
console.log(source_default.bold.yellow("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20205
|
+
const pickPrompt = candidates.length > 1 ? ` \u6FC0\u6D3B\u54EA\u4E2A\u6280\u80FD\uFF1F\u8F93\u5165\u7F16\u53F7 (\u5982 1 \u6216 1,2)\uFF0C\u56DE\u8F66\u8DF3\u8FC7 \u203A ` : ` \u6FC0\u6D3B\u6B64\u6280\u80FD\uFF1F[Y/n] \u203A `;
|
|
20206
|
+
const skillChoice = await question(rl, source_default.yellow(pickPrompt));
|
|
20207
|
+
const choiceTrimmed = skillChoice.trim().toLowerCase();
|
|
20208
|
+
if (choiceTrimmed !== "" && choiceTrimmed !== "n") {
|
|
20209
|
+
let indices;
|
|
20210
|
+
if (candidates.length === 1) {
|
|
20211
|
+
indices = choiceTrimmed === "y" || choiceTrimmed === "" ? [0] : [];
|
|
20212
|
+
} else {
|
|
20213
|
+
indices = choiceTrimmed.split(",").map((s2) => parseInt(s2.trim(), 10) - 1).filter((i2) => i2 >= 0 && i2 < candidates.length);
|
|
20201
20214
|
}
|
|
20202
|
-
|
|
20203
|
-
|
|
20204
|
-
console.log();
|
|
20205
|
-
console.log(source_default.bold.yellow("\u250C\u2500 \u68C0\u6D4B\u5230\u76F8\u5173\u6280\u80FD \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20206
|
-
newRecs.forEach((r2, i2) => {
|
|
20207
|
-
console.log(`\u2502 ${source_default.bold.cyan(`[${i2 + 1}]`)} ${source_default.cyan(r2.id)}${source_default.dim(" \u2014")} ${r2.name}`);
|
|
20208
|
-
console.log(source_default.dim(`\u2502 ${r2.reason}`));
|
|
20209
|
-
});
|
|
20210
|
-
console.log(source_default.bold.yellow("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20211
|
-
const skillChoice = await question(rl, source_default.yellow(` \u6FC0\u6D3B\u54EA\u4E2A\u6280\u80FD\uFF1F\u8F93\u5165\u7F16\u53F7 (\u5982 1 \u6216 1,2)\uFF0C\u56DE\u8F66\u8DF3\u8FC7 \u203A `));
|
|
20212
|
-
const c2 = skillChoice.trim().toLowerCase();
|
|
20213
|
-
if (c2 !== "" && c2 !== "n") {
|
|
20214
|
-
const indices = c2.split(",").map((s2) => parseInt(s2.trim(), 10) - 1).filter((i2) => i2 >= 0 && i2 < newRecs.length);
|
|
20215
|
-
for (const idx of indices) {
|
|
20216
|
-
await injectSkill(newRecs[idx].id, history, injectedSkills, rl, true);
|
|
20217
|
-
}
|
|
20215
|
+
for (const idx of indices) {
|
|
20216
|
+
await injectSkill(candidates[idx].id, history, injectedSkills, rl, true);
|
|
20218
20217
|
}
|
|
20219
|
-
console.log();
|
|
20220
20218
|
}
|
|
20219
|
+
console.log();
|
|
20221
20220
|
}
|
|
20222
20221
|
const expanded = expandFileRefs(trimmed);
|
|
20223
20222
|
const userContent = thinkMode ? `/think
|
package/dist/mbp.js
CHANGED
|
@@ -17783,6 +17783,24 @@ var SKILL_ROUTES = [
|
|
|
17783
17783
|
]
|
|
17784
17784
|
}
|
|
17785
17785
|
];
|
|
17786
|
+
function routeSkill(message) {
|
|
17787
|
+
const lower = message.toLowerCase();
|
|
17788
|
+
const scores = /* @__PURE__ */ new Map();
|
|
17789
|
+
for (const route of SKILL_ROUTES) {
|
|
17790
|
+
let score = 0;
|
|
17791
|
+
for (const kw of route.keywords) {
|
|
17792
|
+
if (lower.includes(kw.toLowerCase())) {
|
|
17793
|
+
score += 1 + kw.length * 0.1;
|
|
17794
|
+
}
|
|
17795
|
+
}
|
|
17796
|
+
if (score > 0) scores.set(route.id, { route, score });
|
|
17797
|
+
}
|
|
17798
|
+
const sorted = Array.from(scores.values()).sort((a2, b2) => b2.score - a2.score).slice(0, 5);
|
|
17799
|
+
return {
|
|
17800
|
+
routes: sorted.map((v2) => v2.route),
|
|
17801
|
+
topScore: sorted[0]?.score ?? 0
|
|
17802
|
+
};
|
|
17803
|
+
}
|
|
17786
17804
|
|
|
17787
17805
|
// src/sessions.ts
|
|
17788
17806
|
var import_fs5 = require("fs");
|
|
@@ -17910,7 +17928,7 @@ function clearCheckpoints(sessionId) {
|
|
|
17910
17928
|
|
|
17911
17929
|
// src/index.ts
|
|
17912
17930
|
var import_fs7 = require("fs");
|
|
17913
|
-
var VERSION2 = "2.8.
|
|
17931
|
+
var VERSION2 = "2.8.8";
|
|
17914
17932
|
var BRAND2 = "mbp".toLowerCase();
|
|
17915
17933
|
var SKILLHUB_HUBS = {
|
|
17916
17934
|
bgi: { label: "BGI \u672C\u5730", apiBase: "", backend: "local" },
|
|
@@ -20172,52 +20190,33 @@ async function main() {
|
|
|
20172
20190
|
console.log();
|
|
20173
20191
|
continue;
|
|
20174
20192
|
}
|
|
20175
|
-
{
|
|
20176
|
-
|
|
20177
|
-
|
|
20178
|
-
|
|
20179
|
-
|
|
20180
|
-
|
|
20181
|
-
|
|
20182
|
-
}
|
|
20183
|
-
|
|
20184
|
-
|
|
20185
|
-
|
|
20186
|
-
|
|
20187
|
-
|
|
20188
|
-
|
|
20189
|
-
|
|
20190
|
-
|
|
20191
|
-
|
|
20192
|
-
|
|
20193
|
-
|
|
20194
|
-
|
|
20195
|
-
|
|
20196
|
-
console.log(source_default.bold.yellow("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20197
|
-
const skillChoice = await question(rl, source_default.yellow(" \u6FC0\u6D3B\u6B64\u6280\u80FD\uFF1F[Y/n] \u203A "));
|
|
20198
|
-
const c2 = skillChoice.trim().toLowerCase();
|
|
20199
|
-
if (c2 === "" || c2 === "y") {
|
|
20200
|
-
await injectSkill(newRecs[0].id, history, injectedSkills, rl, true);
|
|
20193
|
+
const { routes: suggestedRoutes, topScore } = routeSkill(trimmed);
|
|
20194
|
+
const newRoutes = suggestedRoutes.filter((r2) => !injectedSkills.has(r2.id));
|
|
20195
|
+
if (newRoutes.length === 1 && topScore >= 8) {
|
|
20196
|
+
await injectSkill(newRoutes[0].id, history, injectedSkills, rl, false);
|
|
20197
|
+
} else if (newRoutes.length >= 1 && topScore >= 2) {
|
|
20198
|
+
const candidates = newRoutes.slice(0, 3);
|
|
20199
|
+
console.log();
|
|
20200
|
+
console.log(source_default.bold.yellow("\u250C\u2500 \u{1F50D} \u68C0\u6D4B\u5230\u76F8\u5173\u6280\u80FD \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20201
|
+
candidates.forEach((r2, i2) => {
|
|
20202
|
+
console.log(`\u2502 ${source_default.bold.cyan(`[${i2 + 1}]`)} ${source_default.cyan(r2.id)}${source_default.dim(" \u2014")} ${r2.name}`);
|
|
20203
|
+
});
|
|
20204
|
+
console.log(source_default.bold.yellow("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20205
|
+
const pickPrompt = candidates.length > 1 ? ` \u6FC0\u6D3B\u54EA\u4E2A\u6280\u80FD\uFF1F\u8F93\u5165\u7F16\u53F7 (\u5982 1 \u6216 1,2)\uFF0C\u56DE\u8F66\u8DF3\u8FC7 \u203A ` : ` \u6FC0\u6D3B\u6B64\u6280\u80FD\uFF1F[Y/n] \u203A `;
|
|
20206
|
+
const skillChoice = await question(rl, source_default.yellow(pickPrompt));
|
|
20207
|
+
const choiceTrimmed = skillChoice.trim().toLowerCase();
|
|
20208
|
+
if (choiceTrimmed !== "" && choiceTrimmed !== "n") {
|
|
20209
|
+
let indices;
|
|
20210
|
+
if (candidates.length === 1) {
|
|
20211
|
+
indices = choiceTrimmed === "y" || choiceTrimmed === "" ? [0] : [];
|
|
20212
|
+
} else {
|
|
20213
|
+
indices = choiceTrimmed.split(",").map((s2) => parseInt(s2.trim(), 10) - 1).filter((i2) => i2 >= 0 && i2 < candidates.length);
|
|
20201
20214
|
}
|
|
20202
|
-
|
|
20203
|
-
|
|
20204
|
-
console.log();
|
|
20205
|
-
console.log(source_default.bold.yellow("\u250C\u2500 \u68C0\u6D4B\u5230\u76F8\u5173\u6280\u80FD \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20206
|
-
newRecs.forEach((r2, i2) => {
|
|
20207
|
-
console.log(`\u2502 ${source_default.bold.cyan(`[${i2 + 1}]`)} ${source_default.cyan(r2.id)}${source_default.dim(" \u2014")} ${r2.name}`);
|
|
20208
|
-
console.log(source_default.dim(`\u2502 ${r2.reason}`));
|
|
20209
|
-
});
|
|
20210
|
-
console.log(source_default.bold.yellow("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
20211
|
-
const skillChoice = await question(rl, source_default.yellow(` \u6FC0\u6D3B\u54EA\u4E2A\u6280\u80FD\uFF1F\u8F93\u5165\u7F16\u53F7 (\u5982 1 \u6216 1,2)\uFF0C\u56DE\u8F66\u8DF3\u8FC7 \u203A `));
|
|
20212
|
-
const c2 = skillChoice.trim().toLowerCase();
|
|
20213
|
-
if (c2 !== "" && c2 !== "n") {
|
|
20214
|
-
const indices = c2.split(",").map((s2) => parseInt(s2.trim(), 10) - 1).filter((i2) => i2 >= 0 && i2 < newRecs.length);
|
|
20215
|
-
for (const idx of indices) {
|
|
20216
|
-
await injectSkill(newRecs[idx].id, history, injectedSkills, rl, true);
|
|
20217
|
-
}
|
|
20215
|
+
for (const idx of indices) {
|
|
20216
|
+
await injectSkill(candidates[idx].id, history, injectedSkills, rl, true);
|
|
20218
20217
|
}
|
|
20219
|
-
console.log();
|
|
20220
20218
|
}
|
|
20219
|
+
console.log();
|
|
20221
20220
|
}
|
|
20222
20221
|
const expanded = expandFileRefs(trimmed);
|
|
20223
20222
|
const userContent = thinkMode ? `/think
|