@blockrun/runcode 1.7.0 → 1.7.1
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/loop.js +21 -0
- package/package.json +1 -1
package/dist/agent/loop.js
CHANGED
|
@@ -422,6 +422,27 @@ export async function interactiveSession(config, getUserInput, onEvent, onAbortR
|
|
|
422
422
|
if (input === '/optimize') {
|
|
423
423
|
input = 'Analyze the codebase for performance issues. Check for: unnecessary re-renders, N+1 queries, missing indexes, unoptimized loops, large bundle sizes, and memory leaks. Provide specific recommendations.';
|
|
424
424
|
}
|
|
425
|
+
// Handle /security — security audit
|
|
426
|
+
if (input === '/security') {
|
|
427
|
+
input = 'Audit the codebase for security issues. Check for: SQL injection, XSS, command injection, hardcoded secrets, insecure dependencies, OWASP top 10 vulnerabilities. Report findings with severity.';
|
|
428
|
+
}
|
|
429
|
+
// Handle /lint — code quality
|
|
430
|
+
if (input === '/lint') {
|
|
431
|
+
input = 'Check for code quality issues: unused imports, inconsistent naming, missing type annotations, long functions, duplicated code. Suggest improvements.';
|
|
432
|
+
}
|
|
433
|
+
// Handle /doc <target> — generate documentation
|
|
434
|
+
if (input.startsWith('/doc ')) {
|
|
435
|
+
const target = input.slice(5).trim();
|
|
436
|
+
input = `Generate documentation for ${target}. Include: purpose, API/interface description, usage examples, and important notes.`;
|
|
437
|
+
}
|
|
438
|
+
// Handle /migrate — migration helper
|
|
439
|
+
if (input === '/migrate') {
|
|
440
|
+
input = 'Check for pending database migrations, outdated dependencies, or breaking changes that need addressing. List required migration steps.';
|
|
441
|
+
}
|
|
442
|
+
// Handle /clean — cleanup dead code
|
|
443
|
+
if (input === '/clean') {
|
|
444
|
+
input = 'Find and remove dead code: unused imports, unreachable code, commented-out blocks, unused variables and functions. Show what would be removed before making changes.';
|
|
445
|
+
}
|
|
425
446
|
// Handle /status — show git status
|
|
426
447
|
if (input === '/status') {
|
|
427
448
|
try {
|