winter-super-cli 2026.5.22 → 2026.5.24
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/package.json +1 -1
- package/rules/default.md +1 -0
- package/src/cli/repl.js +37 -7
package/package.json
CHANGED
package/rules/default.md
CHANGED
|
@@ -80,6 +80,7 @@ Check for these files in order:
|
|
|
80
80
|
|
|
81
81
|
### Tool Guidelines
|
|
82
82
|
- Call tools proactively - don't just describe, DO
|
|
83
|
+
- CHỦ ĐỘNG TÌM KIẾM: Khi người dùng yêu cầu sửa đổi hoặc thêm tính năng mà không chỉ định file cụ thể, AI PHẢI TỰ DÙNG các công cụ như `list_dir` hoặc `grep_search` để tìm kiếm file liên quan trong dự án. TUYỆT ĐỐI KHÔNG ĐƯỢC hỏi xin code hoặc xin đường dẫn file từ người dùng nếu có thể tự tìm thấy!
|
|
83
84
|
- Prefer Read over describing code
|
|
84
85
|
- Use Edit for small changes, Write for new files
|
|
85
86
|
- Verify changes after execution
|
package/src/cli/repl.js
CHANGED
|
@@ -1422,17 +1422,25 @@ ${colors.reset}
|
|
|
1422
1422
|
const maxLen = BOX_WIDTH - 8;
|
|
1423
1423
|
const lines = summary.split('\n');
|
|
1424
1424
|
for (const line of lines) {
|
|
1425
|
-
|
|
1426
|
-
|
|
1425
|
+
// Loại bỏ mã màu ANSI để tính toán độ dài và cắt dòng chuẩn xác
|
|
1426
|
+
const cleanLine = line.replace(/\x1b\[[0-9;]*m/g, '');
|
|
1427
|
+
|
|
1428
|
+
if (cleanLine.length <= maxLen) {
|
|
1429
|
+
const padLen = BOX_WIDTH - 7 - cleanLine.length;
|
|
1430
|
+
const padding = ' '.repeat(Math.max(0, padLen));
|
|
1431
|
+
console.log(`${colors.magenta}│${colors.reset} ${statusIcon} ${colors.dim}${cleanLine}${colors.reset}${padding}${colors.magenta}│${colors.reset}`);
|
|
1427
1432
|
} else {
|
|
1428
1433
|
// Word wrap
|
|
1429
|
-
let remaining =
|
|
1434
|
+
let remaining = cleanLine;
|
|
1430
1435
|
let first = true;
|
|
1431
1436
|
while (remaining.length > 0) {
|
|
1432
1437
|
const chunk = remaining.substring(0, maxLen);
|
|
1433
1438
|
remaining = remaining.substring(maxLen);
|
|
1434
1439
|
const prefix = first ? statusIcon : ' ';
|
|
1435
|
-
|
|
1440
|
+
|
|
1441
|
+
const padLen = BOX_WIDTH - 7 - chunk.length;
|
|
1442
|
+
const padding = ' '.repeat(Math.max(0, padLen));
|
|
1443
|
+
console.log(`${colors.magenta}│${colors.reset} ${prefix} ${colors.dim}${chunk}${colors.reset}${padding}${colors.magenta}│${colors.reset}`);
|
|
1436
1444
|
first = false;
|
|
1437
1445
|
}
|
|
1438
1446
|
}
|
|
@@ -1676,19 +1684,41 @@ ${colors.reset}
|
|
|
1676
1684
|
|
|
1677
1685
|
if (this.slashMenu.printedLines) {
|
|
1678
1686
|
readline.moveCursor(process.stdout, 0, -this.slashMenu.printedLines);
|
|
1679
|
-
readline.clearScreenDown(process.stdout);
|
|
1680
1687
|
}
|
|
1681
1688
|
|
|
1682
1689
|
process.stdout.write('\n');
|
|
1690
|
+
readline.clearLine(process.stdout, 1);
|
|
1683
1691
|
process.stdout.write(`${colors.dim}Commands${colors.reset}\n`);
|
|
1684
|
-
|
|
1692
|
+
|
|
1693
|
+
const maxDisplay = 5;
|
|
1694
|
+
const displayedMatches = matches.slice(0, maxDisplay);
|
|
1695
|
+
|
|
1696
|
+
displayedMatches.forEach((item, index) => {
|
|
1697
|
+
readline.clearLine(process.stdout, 1);
|
|
1685
1698
|
const usage = item.usage ? ` ${colors.dim}${item.usage}${colors.reset}` : '';
|
|
1686
1699
|
const pointer = index === this.slashMenu.selected ? `${colors.green}>${colors.reset}` : ' ';
|
|
1687
1700
|
process.stdout.write(`${pointer} ${colors.cyan}${item.cmd}${colors.reset} ${colors.dim}${item.desc}${colors.reset}${usage}\n`);
|
|
1688
1701
|
});
|
|
1702
|
+
|
|
1703
|
+
if (matches.length > maxDisplay) {
|
|
1704
|
+
readline.clearLine(process.stdout, 1);
|
|
1705
|
+
process.stdout.write(` ${colors.dim}... và ${matches.length - maxDisplay} lệnh khác (gõ tiếp để lọc)${colors.reset}\n`);
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
readline.clearLine(process.stdout, 1);
|
|
1689
1709
|
process.stdout.write(`${colors.dim}↑/↓ chọn · Enter/Tab dùng · Esc đóng${colors.reset}\n`);
|
|
1690
1710
|
|
|
1691
|
-
|
|
1711
|
+
// Xóa các dòng thừa nếu số lượng dòng mới ít hơn số lượng dòng cũ
|
|
1712
|
+
const currentLines = Math.min(matches.length, maxDisplay) + 3 + (matches.length > maxDisplay ? 1 : 0);
|
|
1713
|
+
if (this.slashMenu.printedLines > currentLines) {
|
|
1714
|
+
for (let i = 0; i < this.slashMenu.printedLines - currentLines; i++) {
|
|
1715
|
+
readline.clearLine(process.stdout, 1);
|
|
1716
|
+
process.stdout.write('\n');
|
|
1717
|
+
}
|
|
1718
|
+
readline.moveCursor(process.stdout, 0, -(this.slashMenu.printedLines - currentLines));
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
this.slashMenu.printedLines = currentLines;
|
|
1692
1722
|
this.rl.prompt(true);
|
|
1693
1723
|
}
|
|
1694
1724
|
|