@taj-special/dravix-code 1.3.4 → 1.3.6
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/repl.js +16 -18
- package/package.json +1 -1
package/dist/cli/repl.js
CHANGED
|
@@ -2261,6 +2261,7 @@ Find files by glob pattern.
|
|
|
2261
2261
|
- Multiple edit_file on the same file: order from BOTTOM to TOP (line numbers shift as you edit).
|
|
2262
2262
|
- DO NOT output <write_file> / <edit_file> / <run_command> tags inside markdown code blocks — they must be raw in the response.
|
|
2263
2263
|
- Execute ALL operations in ONE response when possible — do not split work across multiple turns.
|
|
2264
|
+
- ⚠️ CRITICAL: If you write "now I will run/start/execute/install X" — you MUST also include the <run_command> tag. Saying it is NOT enough. Always output the actual tag with the command.
|
|
2264
2265
|
|
|
2265
2266
|
## End-of-turn summary — REQUIRED after every task
|
|
2266
2267
|
|
|
@@ -2351,20 +2352,8 @@ The summary should feel like a natural conversation close — informative, brief
|
|
|
2351
2352
|
if (readFileContinue) {
|
|
2352
2353
|
readFileContinue = false;
|
|
2353
2354
|
readFileTurnCount++;
|
|
2354
|
-
//
|
|
2355
|
-
|
|
2356
|
-
const rawUserMsg = lastUserLine.trim();
|
|
2357
|
-
const msgLines = rawUserMsg.split('\n').map(l => l.trim()).filter(Boolean);
|
|
2358
|
-
let userReminder = '';
|
|
2359
|
-
if (msgLines.length > 0) {
|
|
2360
|
-
const first = msgLines[0].slice(0, 100);
|
|
2361
|
-
const last = msgLines[msgLines.length - 1].slice(0, 150);
|
|
2362
|
-
const display = msgLines.length <= 2 ? msgLines.join(' / ').slice(0, 200) : `${first} [...] ${last}`;
|
|
2363
|
-
userReminder = `The user's request: "${display}". `;
|
|
2364
|
-
}
|
|
2365
|
-
const taskInstruction = userReminder
|
|
2366
|
-
? `The user's exact request was: "${rawUserMsg.slice(0, 300)}"\nNow execute THIS request and ONLY this request — nothing else. Do not invent, add, or change anything the user did not ask for. Use <edit_file> with targeted <find>/<replace> — never use <write_file> on existing files. Use the file content above to find the exact text and apply the change.`
|
|
2367
|
-
: `Execute the user's request using the file content above. Use <edit_file> for existing files, <write_file> only for new files.`;
|
|
2355
|
+
// Keep auto-continue prompt SHORT — large prompts time out DeepSeek reasoning model
|
|
2356
|
+
const taskInstruction = `Continue. All necessary file contents are above in context. Complete the task now — do NOT read more files. Output operations with <edit_file> or <run_command> tags.`;
|
|
2368
2357
|
// Keep using FLASH_MODEL after file reads
|
|
2369
2358
|
if (readFileTurnCount > 5 && !forcedEditMode) {
|
|
2370
2359
|
forcedEditMode = true;
|
|
@@ -2479,11 +2468,13 @@ The summary should feel like a natural conversation close — informative, brief
|
|
|
2479
2468
|
history.splice(1, history.length - 22);
|
|
2480
2469
|
}
|
|
2481
2470
|
// ── Auto-inject mentioned file contents ──────────────────────
|
|
2482
|
-
//
|
|
2471
|
+
// Reduced from 3000 → keeps prompt small enough for DeepSeek reasoning model
|
|
2483
2472
|
const FILE_PATTERN = /[\w\-.\/\\]+\.\w{2,5}/g;
|
|
2484
2473
|
const mentioned = [...new Set(line.match(FILE_PATTERN) ?? [])];
|
|
2485
2474
|
let fileContext = '';
|
|
2486
|
-
const FULL_INJECT_LINES =
|
|
2475
|
+
const FULL_INJECT_LINES = 400;
|
|
2476
|
+
const MAX_INJECT_CHARS = 25000;
|
|
2477
|
+
let injectedChars = 0;
|
|
2487
2478
|
for (const fname of mentioned) {
|
|
2488
2479
|
const fullPath = path.resolve(activeCwd, fname);
|
|
2489
2480
|
if (fs.existsSync(fullPath) && fs.statSync(fullPath).isFile()) {
|
|
@@ -2491,8 +2482,15 @@ The summary should feel like a natural conversation close — informative, brief
|
|
|
2491
2482
|
const content = fs.readFileSync(fullPath, 'utf-8');
|
|
2492
2483
|
const fileLines = content.split('\n');
|
|
2493
2484
|
const lineCount = fileLines.length;
|
|
2494
|
-
if (lineCount <= FULL_INJECT_LINES) {
|
|
2495
|
-
|
|
2485
|
+
if (lineCount <= FULL_INJECT_LINES && injectedChars < MAX_INJECT_CHARS) {
|
|
2486
|
+
const toAdd = `\n\n[File: ${fname} — ${lineCount} lines — FULL]\n` + content;
|
|
2487
|
+
if (injectedChars + toAdd.length > MAX_INJECT_CHARS) {
|
|
2488
|
+
fileContext += `\n\n[File: ${fname} — ${lineCount} lines — skipped (prompt limit)]`;
|
|
2489
|
+
}
|
|
2490
|
+
else {
|
|
2491
|
+
fileContext += toAdd;
|
|
2492
|
+
injectedChars += toAdd.length;
|
|
2493
|
+
}
|
|
2496
2494
|
}
|
|
2497
2495
|
else {
|
|
2498
2496
|
fileContext += `\n\n[File: ${fname} — ${lineCount} lines]\n` +
|