@blockrun/runcode 1.6.2 → 1.6.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/agent/context.js +14 -1
- package/dist/tools/bash.js +5 -1
- package/dist/tools/grep.js +8 -0
- package/package.json +1 -1
package/dist/agent/context.js
CHANGED
|
@@ -35,10 +35,23 @@ You have access to tools for reading, writing, editing files, running shell comm
|
|
|
35
35
|
- Use Bash for builds, tests, git operations, and system commands.
|
|
36
36
|
- Use WebSearch + WebFetch together to research topics.
|
|
37
37
|
|
|
38
|
+
# Safety
|
|
39
|
+
- Never write to system paths (/etc, /usr, ~/.ssh, ~/.aws).
|
|
40
|
+
- Avoid destructive git operations (force push, reset --hard) unless explicitly asked.
|
|
41
|
+
- Don't commit secrets, credentials, or .env files.
|
|
42
|
+
- When unsure about a destructive action, use AskUser to confirm.
|
|
43
|
+
|
|
38
44
|
# Communication
|
|
39
45
|
- Be concise. Lead with the answer or action.
|
|
40
46
|
- Show what you changed and why.
|
|
41
|
-
- When blocked, explain what you tried and ask for guidance
|
|
47
|
+
- When blocked, explain what you tried and ask for guidance.
|
|
48
|
+
- Use AskUser when you need clarification before proceeding with ambiguous requests.
|
|
49
|
+
|
|
50
|
+
# Slash Commands Available
|
|
51
|
+
The user can type these shortcuts: /commit, /review, /test, /fix, /debug, /explain <file>,
|
|
52
|
+
/search <query>, /find <pattern>, /refactor <desc>, /init, /todo, /deps, /diff, /status,
|
|
53
|
+
/log, /branch, /stash, /plan, /execute, /compact, /retry, /sessions, /resume, /tasks,
|
|
54
|
+
/context, /doctor, /model, /cost, /clear, /help, /exit.`;
|
|
42
55
|
/**
|
|
43
56
|
* Build the full system instructions array for a session.
|
|
44
57
|
*/
|
package/dist/tools/bash.js
CHANGED
|
@@ -14,7 +14,11 @@ async function execute(input, ctx) {
|
|
|
14
14
|
const shell = process.env.SHELL || '/bin/bash';
|
|
15
15
|
const child = spawn(shell, ['-c', command], {
|
|
16
16
|
cwd: ctx.workingDir,
|
|
17
|
-
env: {
|
|
17
|
+
env: {
|
|
18
|
+
...process.env,
|
|
19
|
+
RUNCODE: '1', // Let scripts detect they're running inside runcode
|
|
20
|
+
RUNCODE_WORKDIR: ctx.workingDir,
|
|
21
|
+
},
|
|
18
22
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
19
23
|
});
|
|
20
24
|
let stdout = '';
|
package/dist/tools/grep.js
CHANGED
|
@@ -49,6 +49,12 @@ function runRipgrep(opts, searchPath, mode, limit) {
|
|
|
49
49
|
if (opts.context && opts.context > 0) {
|
|
50
50
|
args.push(`-C${opts.context}`);
|
|
51
51
|
}
|
|
52
|
+
else {
|
|
53
|
+
if (opts.before_context && opts.before_context > 0)
|
|
54
|
+
args.push(`-B${opts.before_context}`);
|
|
55
|
+
if (opts.after_context && opts.after_context > 0)
|
|
56
|
+
args.push(`-A${opts.after_context}`);
|
|
57
|
+
}
|
|
52
58
|
break;
|
|
53
59
|
}
|
|
54
60
|
if (opts.case_insensitive)
|
|
@@ -142,6 +148,8 @@ export const grepCapability = {
|
|
|
142
148
|
description: 'Output mode: "content" (matching lines), "files_with_matches" (file paths), "count" (match counts). Default: files_with_matches',
|
|
143
149
|
},
|
|
144
150
|
context: { type: 'number', description: 'Lines of context around each match (content mode only)' },
|
|
151
|
+
before_context: { type: 'number', description: 'Lines before each match (-B, content mode)' },
|
|
152
|
+
after_context: { type: 'number', description: 'Lines after each match (-A, content mode)' },
|
|
145
153
|
case_insensitive: { type: 'boolean', description: 'Case-insensitive search' },
|
|
146
154
|
head_limit: { type: 'number', description: 'Max results to return. Default: 250' },
|
|
147
155
|
multiline: { type: 'boolean', description: 'Enable multiline mode (patterns span lines). Default: false' },
|