Skip to content

Commit 5256b26

Browse files
committed
fix: markdown blockquote+strikethrough, SIGKILL 5s delay, edit hint threshold, polish (v2.2.2)
1 parent c9bed34 commit 5256b26

File tree

7 files changed

+27
-7
lines changed

7 files changed

+27
-7
lines changed

dist/tools/bash.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async function execute(input, ctx) {
3434
child.kill('SIGKILL');
3535
}
3636
catch { /* already dead */ }
37-
}, 3000);
37+
}, 5000); // Give 5s for graceful shutdown before SIGKILL
3838
}, timeoutMs);
3939
// Handle abort signal
4040
const onAbort = () => {

dist/tools/edit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async function execute(input, ctx) {
2626
if (!content.includes(oldStr)) {
2727
// Find lines containing fragments of old_string for helpful context
2828
const lines = content.split('\n');
29-
const searchTerms = oldStr.split('\n').map(l => l.trim()).filter(l => l.length > 8);
29+
const searchTerms = oldStr.split('\n').map(l => l.trim()).filter(l => l.length > 3);
3030
const matchedLines = [];
3131
if (searchTerms.length > 0) {
3232
for (let i = 0; i < lines.length && matchedLines.length < 5; i++) {

dist/ui/terminal.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,14 @@ class MarkdownRenderer {
9595
if (line.match(/^(\s*)[-*] /)) {
9696
return line.replace(/^(\s*)[-*] /, '$1• ');
9797
}
98-
// Numbered lists — leave as-is
98+
// Numbered lists
99+
if (/^\s*\d+\.\s/.test(line)) {
100+
return this.renderInline(line);
101+
}
102+
// Blockquotes
103+
if (line.startsWith('> ')) {
104+
return chalk.dim('│ ') + chalk.italic(this.renderInline(line.slice(2)));
105+
}
99106
// Tables — leave as-is (chalk doesn't help much)
100107
// Inline formatting
101108
return this.renderInline(line);
@@ -109,6 +116,8 @@ class MarkdownRenderer {
109116
.replace(/\*\*([^*]+)\*\*/g, (_, t) => chalk.bold(t))
110117
// Italic (only single * not preceded/followed by *)
111118
.replace(/(?<!\*)\*([^*]+)\*(?!\*)/g, (_, t) => chalk.italic(t))
119+
// Strikethrough
120+
.replace(/~~([^~]+)~~/g, (_, t) => chalk.strikethrough(t))
112121
// Links
113122
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_, label, url) => chalk.blue.underline(label) + chalk.dim(` (${url})`))
114123
// Restore code markers

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@blockrun/runcode",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"description": "RunCode — AI coding agent powered by 41+ models. Pay per use with USDC.",
55
"type": "module",
66
"bin": {

src/tools/bash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function execute(input: Record<string, unknown>, ctx: ExecutionScope): Pro
4545
child.kill('SIGTERM');
4646
setTimeout(() => {
4747
try { child.kill('SIGKILL'); } catch { /* already dead */ }
48-
}, 3000);
48+
}, 5000); // Give 5s for graceful shutdown before SIGKILL
4949
}, timeoutMs);
5050

5151
// Handle abort signal

src/tools/edit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async function execute(input: Record<string, unknown>, ctx: ExecutionScope): Pro
4242
if (!content.includes(oldStr)) {
4343
// Find lines containing fragments of old_string for helpful context
4444
const lines = content.split('\n');
45-
const searchTerms = oldStr.split('\n').map(l => l.trim()).filter(l => l.length > 8);
45+
const searchTerms = oldStr.split('\n').map(l => l.trim()).filter(l => l.length > 3);
4646
const matchedLines: { num: number; text: string }[] = [];
4747

4848
if (searchTerms.length > 0) {

src/ui/terminal.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,16 @@ class MarkdownRenderer {
108108
return line.replace(/^(\s*)[-*] /, '$1• ');
109109
}
110110

111-
// Numbered lists — leave as-is
111+
// Numbered lists
112+
if (/^\s*\d+\.\s/.test(line)) {
113+
return this.renderInline(line);
114+
}
115+
116+
// Blockquotes
117+
if (line.startsWith('> ')) {
118+
return chalk.dim('│ ') + chalk.italic(this.renderInline(line.slice(2)));
119+
}
120+
112121
// Tables — leave as-is (chalk doesn't help much)
113122

114123
// Inline formatting
@@ -124,6 +133,8 @@ class MarkdownRenderer {
124133
.replace(/\*\*([^*]+)\*\*/g, (_, t) => chalk.bold(t))
125134
// Italic (only single * not preceded/followed by *)
126135
.replace(/(?<!\*)\*([^*]+)\*(?!\*)/g, (_, t) => chalk.italic(t))
136+
// Strikethrough
137+
.replace(/~~([^~]+)~~/g, (_, t) => chalk.strikethrough(t))
127138
// Links
128139
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_, label, url) =>
129140
chalk.blue.underline(label) + chalk.dim(` (${url})`)

0 commit comments

Comments
 (0)