claude-issue-solver 1.19.2 → 1.19.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/commands/list.js +45 -15
- package/package.json +1 -1
package/dist/commands/list.js
CHANGED
|
@@ -7,26 +7,49 @@ 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 getFirstParagraph(body) {
|
|
11
11
|
if (!body)
|
|
12
12
|
return '';
|
|
13
|
-
// Find first meaningful line (skip markdown headers and empty lines)
|
|
14
13
|
const lines = body.split('\n');
|
|
15
|
-
|
|
14
|
+
const paragraphLines = [];
|
|
15
|
+
let started = false;
|
|
16
16
|
for (const line of lines) {
|
|
17
17
|
const trimmed = line.trim();
|
|
18
|
-
// Skip
|
|
19
|
-
if (
|
|
18
|
+
// Skip markdown headers and horizontal rules
|
|
19
|
+
if (trimmed.startsWith('#') || trimmed.match(/^-{3,}$|^_{3,}$|^\*{3,}$/)) {
|
|
20
20
|
continue;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
// Empty line after we started means end of paragraph
|
|
23
|
+
if (!trimmed && started) {
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
if (trimmed) {
|
|
27
|
+
started = true;
|
|
28
|
+
paragraphLines.push(trimmed);
|
|
29
|
+
}
|
|
24
30
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
return paragraphLines.join(' ');
|
|
32
|
+
}
|
|
33
|
+
function wrapText(text, width, indent) {
|
|
34
|
+
const words = text.split(/\s+/);
|
|
35
|
+
const lines = [];
|
|
36
|
+
let currentLine = '';
|
|
37
|
+
for (const word of words) {
|
|
38
|
+
if (!currentLine) {
|
|
39
|
+
currentLine = word;
|
|
40
|
+
}
|
|
41
|
+
else if (currentLine.length + 1 + word.length <= width) {
|
|
42
|
+
currentLine += ' ' + word;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
lines.push(indent + currentLine);
|
|
46
|
+
currentLine = word;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (currentLine) {
|
|
50
|
+
lines.push(indent + currentLine);
|
|
51
|
+
}
|
|
52
|
+
return lines;
|
|
30
53
|
}
|
|
31
54
|
async function listCommand(options = {}) {
|
|
32
55
|
const projectName = (0, git_1.getProjectName)();
|
|
@@ -44,9 +67,16 @@ async function listCommand(options = {}) {
|
|
|
44
67
|
: '';
|
|
45
68
|
console.log(` ${chalk_1.default.cyan(`#${issue.number}`)}\t${issue.title}${prTag}${labels}`);
|
|
46
69
|
if (options.verbose && issue.body) {
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
|
|
70
|
+
const paragraph = getFirstParagraph(issue.body);
|
|
71
|
+
if (paragraph) {
|
|
72
|
+
const termWidth = process.stdout.columns || 80;
|
|
73
|
+
const indent = ' ';
|
|
74
|
+
const textWidth = termWidth - indent.length - 2;
|
|
75
|
+
const wrappedLines = wrapText(paragraph, textWidth, indent);
|
|
76
|
+
for (const line of wrappedLines) {
|
|
77
|
+
console.log(chalk_1.default.dim(line));
|
|
78
|
+
}
|
|
79
|
+
console.log(); // blank line between issues
|
|
50
80
|
}
|
|
51
81
|
}
|
|
52
82
|
}
|