claude-issue-solver 1.19.2 → 1.19.4
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/commands/list.js +48 -16
- package/package.json +1 -1
package/dist/commands/list.js
CHANGED
|
@@ -7,26 +7,55 @@ exports.listCommand = listCommand;
|
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const github_1 = require("../utils/github");
|
|
9
9
|
const git_1 = require("../utils/git");
|
|
10
|
-
function
|
|
10
|
+
function formatBody(body, indent, termWidth) {
|
|
11
11
|
if (!body)
|
|
12
|
-
return
|
|
13
|
-
// Find first meaningful line (skip markdown headers and empty lines)
|
|
12
|
+
return [];
|
|
14
13
|
const lines = body.split('\n');
|
|
15
|
-
|
|
14
|
+
const output = [];
|
|
15
|
+
const textWidth = termWidth - indent.length - 2;
|
|
16
16
|
for (const line of lines) {
|
|
17
17
|
const trimmed = line.trim();
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
if (!trimmed) {
|
|
19
|
+
// Preserve blank lines
|
|
20
|
+
output.push('');
|
|
20
21
|
continue;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
// Handle markdown headers - make them stand out
|
|
24
|
+
if (trimmed.startsWith('#')) {
|
|
25
|
+
const headerText = trimmed.replace(/^#+\s*/, '');
|
|
26
|
+
output.push(indent + headerText);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
// Handle list items
|
|
30
|
+
if (trimmed.match(/^[-*]\s/) || trimmed.match(/^\d+\.\s/)) {
|
|
31
|
+
output.push(indent + ' ' + trimmed);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
// Word wrap regular text
|
|
35
|
+
if (trimmed.length <= textWidth) {
|
|
36
|
+
output.push(indent + trimmed);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const words = trimmed.split(/\s+/);
|
|
40
|
+
let currentLine = '';
|
|
41
|
+
for (const word of words) {
|
|
42
|
+
if (!currentLine) {
|
|
43
|
+
currentLine = word;
|
|
44
|
+
}
|
|
45
|
+
else if (currentLine.length + 1 + word.length <= textWidth) {
|
|
46
|
+
currentLine += ' ' + word;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
output.push(indent + currentLine);
|
|
50
|
+
currentLine = word;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (currentLine) {
|
|
54
|
+
output.push(indent + currentLine);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
24
57
|
}
|
|
25
|
-
|
|
26
|
-
return '';
|
|
27
|
-
if (firstLine.length <= maxLength)
|
|
28
|
-
return firstLine;
|
|
29
|
-
return firstLine.substring(0, maxLength - 3) + '...';
|
|
58
|
+
return output;
|
|
30
59
|
}
|
|
31
60
|
async function listCommand(options = {}) {
|
|
32
61
|
const projectName = (0, git_1.getProjectName)();
|
|
@@ -44,10 +73,13 @@ async function listCommand(options = {}) {
|
|
|
44
73
|
: '';
|
|
45
74
|
console.log(` ${chalk_1.default.cyan(`#${issue.number}`)}\t${issue.title}${prTag}${labels}`);
|
|
46
75
|
if (options.verbose && issue.body) {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
76
|
+
const termWidth = process.stdout.columns || 80;
|
|
77
|
+
const indent = ' ';
|
|
78
|
+
const formattedLines = formatBody(issue.body, indent, termWidth);
|
|
79
|
+
for (const line of formattedLines) {
|
|
80
|
+
console.log(chalk_1.default.dim(line));
|
|
50
81
|
}
|
|
82
|
+
console.log(); // blank line between issues
|
|
51
83
|
}
|
|
52
84
|
}
|
|
53
85
|
console.log();
|