@blockrun/runcode 1.6.3 → 1.6.5

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.
@@ -37,7 +37,7 @@ export function statsCommand(options) {
37
37
  console.log(chalk.bold('\n Overview') + chalk.gray(` (${period})\n`));
38
38
  console.log(` Requests: ${chalk.cyan(stats.totalRequests.toLocaleString())}`);
39
39
  console.log(` Total Cost: ${chalk.green('$' + stats.totalCostUsd.toFixed(4))}`);
40
- console.log(` Avg per Request:${chalk.gray(' $' + avgCostPerRequest.toFixed(6))}`);
40
+ console.log(` Avg per Request: ${chalk.gray('$' + avgCostPerRequest.toFixed(6))}`);
41
41
  console.log(` Input Tokens: ${stats.totalInputTokens.toLocaleString()}`);
42
42
  console.log(` Output Tokens: ${stats.totalOutputTokens.toLocaleString()}`);
43
43
  if (stats.totalFallbacks > 0) {
@@ -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: { ...process.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 = '';
@@ -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' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/runcode",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "description": "RunCode — AI coding agent powered by 41+ models. Pay per use with USDC.",
5
5
  "type": "module",
6
6
  "bin": {