dsh-codebase-chat 0.25.2 → 0.25.5
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/cli.js +41 -6
- package/dist/cli.js.map +1 -1
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1620,6 +1620,10 @@ function formatHealthReport(r, lang = "fr") {
|
|
|
1620
1620
|
};
|
|
1621
1621
|
const out = [];
|
|
1622
1622
|
out.push(`== ${t2.title} \u2014 ${basename(r.projectPath)} ==`);
|
|
1623
|
+
if (r.analyzedFiles === 0) {
|
|
1624
|
+
out.push(lang === "en" ? "No code files detected in this project \u2014 check the path or your .codebase-chat.json ignore rules." : "Aucun fichier de code d\xE9tect\xE9 dans ce projet \u2014 v\xE9rifie le chemin ou les r\xE8gles ignore de .codebase-chat.json.");
|
|
1625
|
+
return out.join("\n");
|
|
1626
|
+
}
|
|
1623
1627
|
out.push(`${t2.score}: ${r.score}/100 (${r.grade}) \xB7 ${r.analyzedFiles} ${t2.files} \xB7 ${r.importEdges} ${t2.edges}`);
|
|
1624
1628
|
out.push("");
|
|
1625
1629
|
out.push(`\u25CF ${t2.cycles} (${r.cycles.length})`);
|
|
@@ -1691,6 +1695,10 @@ function formatHealthReportMd(r, lang = "fr") {
|
|
|
1691
1695
|
const out = [];
|
|
1692
1696
|
out.push(`## ${GRADE_ICON[r.grade]} ${t2.title} \u2014 \`${basename(r.projectPath)}\``);
|
|
1693
1697
|
out.push("");
|
|
1698
|
+
if (r.analyzedFiles === 0) {
|
|
1699
|
+
out.push(lang === "en" ? "_No code files detected in this project \u2014 check the path or your `.codebase-chat.json` ignore rules._" : "_Aucun fichier de code d\xE9tect\xE9 dans ce projet \u2014 v\xE9rifie le chemin ou les r\xE8gles ignore de `.codebase-chat.json`._");
|
|
1700
|
+
return out.join("\n");
|
|
1701
|
+
}
|
|
1694
1702
|
out.push(`**${t2.score} : ${scoreBar(r.score)} ${r.score}/100 (${r.grade})** \xB7 ${r.analyzedFiles} ${t2.files} \xB7 ${r.importEdges} ${t2.edges}`);
|
|
1695
1703
|
out.push("");
|
|
1696
1704
|
out.push(`### ${t2.cycles} \u2014 ${r.cycles.length}`);
|
|
@@ -2783,7 +2791,7 @@ import { existsSync as existsSync2 } from "fs";
|
|
|
2783
2791
|
import { join as join8 } from "path";
|
|
2784
2792
|
var DEFAULT_MODEL_URI = "hf:Qwen/Qwen2.5-1.5B-Instruct-GGUF:Q4_K_M";
|
|
2785
2793
|
var LOCAL_CONTEXT_SIZE = 8192;
|
|
2786
|
-
var LOCAL_MAX_TOKENS =
|
|
2794
|
+
var LOCAL_MAX_TOKENS = 1536;
|
|
2787
2795
|
function isLocalLlmEnabled() {
|
|
2788
2796
|
return !!(process.env.CODEBASE_LOCAL_LLM || "").trim();
|
|
2789
2797
|
}
|
|
@@ -2834,7 +2842,13 @@ async function callLocalLlm(prompt, lang = "fr") {
|
|
|
2834
2842
|
contextSequence: context.getSequence(),
|
|
2835
2843
|
systemPrompt: lang === "en" ? "You are a senior codebase analyst. Be precise and cite files with [source: path:line]." : "Tu es un analyste codebase senior. Sois precis et cite les fichiers avec [source: chemin:ligne]."
|
|
2836
2844
|
});
|
|
2837
|
-
return await session.prompt(prompt, {
|
|
2845
|
+
return await session.prompt(prompt, {
|
|
2846
|
+
temperature: 0.2,
|
|
2847
|
+
maxTokens: LOCAL_MAX_TOKENS,
|
|
2848
|
+
// Small models degenerate into loops at low temperature — penalize
|
|
2849
|
+
// repeated tokens so the answer moves forward instead of echoing.
|
|
2850
|
+
repeatPenalty: { lastTokens: 128, penalty: 1.2, penalizeNewLine: false }
|
|
2851
|
+
});
|
|
2838
2852
|
} finally {
|
|
2839
2853
|
await context.dispose();
|
|
2840
2854
|
}
|