claude-issue-solver 1.19.3 → 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.
@@ -7,49 +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 getFirstParagraph(body) {
10
+ function formatBody(body, indent, termWidth) {
11
11
  if (!body)
12
- return '';
12
+ return [];
13
13
  const lines = body.split('\n');
14
- const paragraphLines = [];
15
- let started = false;
14
+ const output = [];
15
+ const textWidth = termWidth - indent.length - 2;
16
16
  for (const line of lines) {
17
17
  const trimmed = line.trim();
18
- // Skip markdown headers and horizontal rules
19
- if (trimmed.startsWith('#') || trimmed.match(/^-{3,}$|^_{3,}$|^\*{3,}$/)) {
18
+ if (!trimmed) {
19
+ // Preserve blank lines
20
+ output.push('');
20
21
  continue;
21
22
  }
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);
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;
29
28
  }
30
- }
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;
29
+ // Handle list items
30
+ if (trimmed.match(/^[-*]\s/) || trimmed.match(/^\d+\.\s/)) {
31
+ output.push(indent + ' ' + trimmed);
32
+ continue;
40
33
  }
41
- else if (currentLine.length + 1 + word.length <= width) {
42
- currentLine += ' ' + word;
34
+ // Word wrap regular text
35
+ if (trimmed.length <= textWidth) {
36
+ output.push(indent + trimmed);
43
37
  }
44
38
  else {
45
- lines.push(indent + currentLine);
46
- currentLine = word;
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
+ }
47
56
  }
48
57
  }
49
- if (currentLine) {
50
- lines.push(indent + currentLine);
51
- }
52
- return lines;
58
+ return output;
53
59
  }
54
60
  async function listCommand(options = {}) {
55
61
  const projectName = (0, git_1.getProjectName)();
@@ -67,17 +73,13 @@ async function listCommand(options = {}) {
67
73
  : '';
68
74
  console.log(` ${chalk_1.default.cyan(`#${issue.number}`)}\t${issue.title}${prTag}${labels}`);
69
75
  if (options.verbose && issue.body) {
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
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));
80
81
  }
82
+ console.log(); // blank line between issues
81
83
  }
82
84
  }
83
85
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-issue-solver",
3
- "version": "1.19.3",
3
+ "version": "1.19.4",
4
4
  "description": "Automatically solve GitHub issues using Claude Code",
5
5
  "main": "dist/index.js",
6
6
  "bin": {