dsh-codebase-chat 0.25.1 → 0.25.3

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 CHANGED
@@ -2533,7 +2533,7 @@ import { existsSync as existsSync2 } from "fs";
2533
2533
  import { join as join8 } from "path";
2534
2534
  var DEFAULT_MODEL_URI = "hf:Qwen/Qwen2.5-1.5B-Instruct-GGUF:Q4_K_M";
2535
2535
  var LOCAL_CONTEXT_SIZE = 8192;
2536
- var LOCAL_MAX_TOKENS = 1024;
2536
+ var LOCAL_MAX_TOKENS = 1536;
2537
2537
  function isLocalLlmEnabled() {
2538
2538
  return !!(process.env.CODEBASE_LOCAL_LLM || "").trim();
2539
2539
  }
@@ -2768,6 +2768,7 @@ async function main() {
2768
2768
  console.error(lang === "en" ? `--prompt ${mode} needs a query: add --ask/--search/--file (or --focus)` : `--prompt ${mode} n\xE9cessite une requ\xEAte : ajoute --ask/--search/--file (ou --focus)`);
2769
2769
  exit(1);
2770
2770
  }
2771
+ const useLocal = values.local || isLocalLlmEnabled();
2771
2772
  const result = await buildContext({
2772
2773
  project: values.project,
2773
2774
  query,
@@ -2775,7 +2776,8 @@ async function main() {
2775
2776
  filePath: values.file,
2776
2777
  lang,
2777
2778
  embed: values.embed,
2778
- diff: values.diff
2779
+ diff: values.diff,
2780
+ maxTokens: useLocal ? 3500 : void 0
2779
2781
  });
2780
2782
  let staticSection = "";
2781
2783
  if ((/* @__PURE__ */ new Set(["intelligence", "report", "audit", "tasks", "ceo"])).has(mode)) {
@@ -2791,7 +2793,11 @@ ${formatHealthReport(report, lang)}`;
2791
2793
  const projectName = basename3(result.absProject);
2792
2794
  let prompt;
2793
2795
  try {
2794
- prompt = buildToolPrompt(tool, {
2796
+ prompt = useLocal ? `${result.context}${staticSection}
2797
+
2798
+ ${lang === "en" ? `Answer based only on the codebase context above (${mode} mode). Structure your answer in short sections with bullet points, and cite each fact as [source: path:line].${query ? ` Question: ${query}` : ""}` : `R\xE9ponds en t'appuyant uniquement sur le contexte du codebase ci-dessus (mode ${mode}). Structure ta r\xE9ponse en sections courtes avec des puces, et cite chaque fait avec [source: fichier:ligne].${query ? ` Question : ${query}` : ""}`}
2799
+
2800
+ ${lang === "en" ? "Answer" : "R\xE9ponse"} :` : buildToolPrompt(tool, {
2795
2801
  context: `${result.context}${staticSection}`,
2796
2802
  projectName,
2797
2803
  lang,