@nexagent-cli/cli 0.5.1 → 0.7.0
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/README.md +5 -5
- package/dist/bin/amarax.d.ts +3 -0
- package/dist/bin/amarax.d.ts.map +1 -0
- package/dist/bin/amarax.js +7 -0
- package/dist/bin/amarax.js.map +1 -0
- package/dist/bin/sophie.d.ts +3 -0
- package/dist/bin/sophie.d.ts.map +1 -0
- package/dist/bin/sophie.js +7 -0
- package/dist/bin/sophie.js.map +1 -0
- package/dist/commands/amarax.d.ts +10 -0
- package/dist/commands/amarax.d.ts.map +1 -0
- package/dist/commands/amarax.js +143 -0
- package/dist/commands/amarax.js.map +1 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +22 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/sophie.d.ts +11 -0
- package/dist/commands/sophie.d.ts.map +1 -0
- package/dist/commands/sophie.js +140 -0
- package/dist/commands/sophie.js.map +1 -0
- package/dist/db/audit-log.d.ts +23 -0
- package/dist/db/audit-log.d.ts.map +1 -0
- package/dist/db/audit-log.js +29 -0
- package/dist/db/audit-log.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +175 -249
- package/dist/index.js.map +1 -1
- package/dist/profiles/aiko.d.ts +3 -0
- package/dist/profiles/aiko.d.ts.map +1 -0
- package/dist/profiles/aiko.js +25 -0
- package/dist/profiles/aiko.js.map +1 -0
- package/dist/profiles/amarax.d.ts +3 -0
- package/dist/profiles/amarax.d.ts.map +1 -0
- package/dist/profiles/amarax.js +31 -0
- package/dist/profiles/amarax.js.map +1 -0
- package/dist/profiles/nexagent.d.ts +3 -0
- package/dist/profiles/nexagent.d.ts.map +1 -0
- package/dist/profiles/nexagent.js +36 -0
- package/dist/profiles/nexagent.js.map +1 -0
- package/dist/profiles/registry.d.ts +13 -0
- package/dist/profiles/registry.d.ts.map +1 -0
- package/dist/profiles/registry.js +51 -0
- package/dist/profiles/registry.js.map +1 -0
- package/dist/profiles/sophie.d.ts +3 -0
- package/dist/profiles/sophie.d.ts.map +1 -0
- package/dist/profiles/sophie.js +31 -0
- package/dist/profiles/sophie.js.map +1 -0
- package/dist/profiles/types.d.ts +50 -0
- package/dist/profiles/types.d.ts.map +1 -0
- package/dist/profiles/types.js +5 -0
- package/dist/profiles/types.js.map +1 -0
- package/dist/runtime/dispatch.d.ts +24 -0
- package/dist/runtime/dispatch.d.ts.map +1 -0
- package/dist/runtime/dispatch.js +49 -0
- package/dist/runtime/dispatch.js.map +1 -0
- package/dist/safety/command-profile.d.ts +22 -0
- package/dist/safety/command-profile.d.ts.map +1 -0
- package/dist/safety/command-profile.js +138 -0
- package/dist/safety/command-profile.js.map +1 -0
- package/dist/tools/shell-exec.d.ts +2 -0
- package/dist/tools/shell-exec.d.ts.map +1 -1
- package/dist/tools/shell-exec.js +129 -45
- package/dist/tools/shell-exec.js.map +1 -1
- package/package.json +7 -5
package/dist/tools/shell-exec.js
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
// ============================================================
|
|
2
2
|
// Tool: shell_exec — Execute shell commands in the workspace
|
|
3
|
-
//
|
|
3
|
+
// v0.6.0: Process tree termination, command profiles, audit logging
|
|
4
4
|
// ============================================================
|
|
5
|
-
import { spawn } from 'node:child_process';
|
|
5
|
+
import { spawn, exec } from 'node:child_process';
|
|
6
6
|
import { resolve } from 'node:path';
|
|
7
|
+
import { promisify } from 'node:util';
|
|
7
8
|
import { generateId, GLOBAL_SHELL_BLOCKLIST } from '@nexagent-cli/shared';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
stmt.run(generateId(), sessionId, 'shell_exec', action, JSON.stringify(details), status, Date.now());
|
|
15
|
-
}
|
|
16
|
-
catch {
|
|
17
|
-
// Audit logging is best-effort; never fail the tool execution
|
|
18
|
-
}
|
|
19
|
-
}
|
|
9
|
+
import { writeAuditLog } from '../db/audit-log.js';
|
|
10
|
+
import { loadProjectPolicy, resolveProfile, checkCommand } from '../safety/command-profile.js';
|
|
11
|
+
const execAsync = promisify(exec);
|
|
12
|
+
const SIGKILL_DELAY_MS = 5_000;
|
|
13
|
+
const ABSOLUTE_MAX_TIMEOUT = 120_000;
|
|
14
|
+
const ABSOLUTE_MAX_OUTPUT = 50_000;
|
|
20
15
|
export class ShellExecTool {
|
|
21
16
|
name = 'shell_exec';
|
|
22
|
-
version = '1.
|
|
23
|
-
description = 'Execute a shell command in the workspace directory. Output is captured and returned. Long-running commands time out after timeout_ms. Dangerous commands are blocked by safety checks.';
|
|
17
|
+
version = '1.1.0';
|
|
18
|
+
description = 'Execute a shell command in the workspace directory. Output is captured and returned. Long-running commands time out after timeout_ms. Dangerous commands are blocked by safety checks. Command profiles restrict which commands are allowed per project.';
|
|
24
19
|
enabled = true;
|
|
25
20
|
cacheable = false;
|
|
26
21
|
riskLevel = 'high';
|
|
@@ -48,57 +43,107 @@ export class ShellExecTool {
|
|
|
48
43
|
required: ['command'],
|
|
49
44
|
};
|
|
50
45
|
async execute(args, ctx) {
|
|
51
|
-
const { command, cwd: relCwd = '.', timeout_ms:
|
|
52
|
-
|
|
46
|
+
const { command, cwd: relCwd = '.', timeout_ms: userTimeout = 30_000, env: extraEnv = {}, } = args;
|
|
47
|
+
const executionId = generateId();
|
|
48
|
+
const start = Date.now();
|
|
49
|
+
const absCwd = resolve(ctx.workspaceDir, relCwd);
|
|
50
|
+
// ── 1. Load command profile ────────────────────────────────
|
|
51
|
+
const projectPolicy = await loadProjectPolicy(ctx.workspaceDir);
|
|
52
|
+
const profile = resolveProfile(undefined, projectPolicy);
|
|
53
|
+
const profileCheck = checkCommand(command, profile);
|
|
54
|
+
if (!profileCheck.allowed) {
|
|
55
|
+
writeAuditLog(ctx.db, {
|
|
56
|
+
sessionId: ctx.sessionId,
|
|
57
|
+
toolName: this.name,
|
|
58
|
+
action: 'blocked_by_profile',
|
|
59
|
+
details: { command: command.slice(0, 2000), reason: profileCheck.reason, profile: profile.name },
|
|
60
|
+
status: 'blocked',
|
|
61
|
+
});
|
|
62
|
+
throw new Error(profileCheck.reason);
|
|
63
|
+
}
|
|
64
|
+
// ── 2. Belt-and-suspenders blocklist (also in Safety Gate) ─
|
|
53
65
|
for (const blocked of GLOBAL_SHELL_BLOCKLIST) {
|
|
54
66
|
if (command.toLowerCase().includes(blocked.toLowerCase())) {
|
|
67
|
+
writeAuditLog(ctx.db, {
|
|
68
|
+
sessionId: ctx.sessionId,
|
|
69
|
+
toolName: this.name,
|
|
70
|
+
action: 'blocked_by_global_blocklist',
|
|
71
|
+
details: { command: command.slice(0, 2000), matched: blocked },
|
|
72
|
+
status: 'blocked',
|
|
73
|
+
});
|
|
55
74
|
throw new Error(`Command blocked by global blocklist: "${blocked}"`);
|
|
56
75
|
}
|
|
57
76
|
}
|
|
77
|
+
// ── 3. Apply profile limits ────────────────────────────────
|
|
78
|
+
const effectiveTimeout = Math.min(userTimeout, profileCheck.effectiveTimeout, ABSOLUTE_MAX_TIMEOUT);
|
|
79
|
+
const effectiveMaxOutput = Math.min(profileCheck.effectiveMaxOutput, ABSOLUTE_MAX_OUTPUT);
|
|
80
|
+
// ── 4. Dry run ─────────────────────────────────────────────
|
|
58
81
|
if (ctx.dryRun) {
|
|
59
82
|
return {
|
|
60
83
|
success: true,
|
|
61
84
|
output: `[DRY RUN] Would execute: ${command}`,
|
|
62
|
-
data: { dryRun: true, command },
|
|
63
|
-
executionId
|
|
85
|
+
data: { dryRun: true, command, profile: profile.name },
|
|
86
|
+
executionId,
|
|
64
87
|
durationMs: 0,
|
|
65
88
|
};
|
|
66
89
|
}
|
|
67
|
-
|
|
68
|
-
const executionId = generateId();
|
|
69
|
-
const start = Date.now();
|
|
70
|
-
const effectiveTout = Math.min(timeout, 120_000);
|
|
90
|
+
// ── 5. Execute with process tree control ───────────────────
|
|
71
91
|
const { shell, shellFlag } = this.detectShell();
|
|
72
92
|
return new Promise((resolve_p, reject) => {
|
|
93
|
+
// Unix: detached=true creates new process group for tree killing
|
|
94
|
+
// Windows: we use taskkill /T instead
|
|
95
|
+
const isUnix = process.platform !== 'win32';
|
|
73
96
|
const proc = spawn(shell, [shellFlag, command], {
|
|
74
97
|
cwd: absCwd,
|
|
75
98
|
env: { ...process.env, ...extraEnv },
|
|
76
99
|
stdio: 'pipe',
|
|
100
|
+
detached: isUnix, // new process group on Unix
|
|
77
101
|
});
|
|
78
102
|
let stdout = '';
|
|
79
103
|
let stderr = '';
|
|
104
|
+
let killed = false;
|
|
80
105
|
proc.stdout?.on('data', (d) => { stdout += d.toString(); });
|
|
81
106
|
proc.stderr?.on('data', (d) => { stderr += d.toString(); });
|
|
107
|
+
// ── Timeout handler with escalation ──────────────────────
|
|
82
108
|
const timer = setTimeout(() => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
109
|
+
killed = true;
|
|
110
|
+
this.killProcessTree(proc.pid, 'SIGTERM');
|
|
111
|
+
// Escalation: SIGTERM → wait → SIGKILL
|
|
112
|
+
const killTimer = setTimeout(() => {
|
|
113
|
+
this.killProcessTree(proc.pid, 'SIGKILL');
|
|
114
|
+
}, SIGKILL_DELAY_MS);
|
|
115
|
+
// Clean up escalation timer if process exits gracefully after SIGTERM
|
|
116
|
+
proc.on('close', () => clearTimeout(killTimer));
|
|
117
|
+
}, effectiveTimeout);
|
|
118
|
+
proc.on('close', (code, signal) => {
|
|
87
119
|
clearTimeout(timer);
|
|
88
120
|
const durationMs = Date.now() - start;
|
|
89
121
|
const combined = [stdout, stderr].filter(Boolean).join('\n--- stderr ---\n');
|
|
90
|
-
const truncated = combined.length >
|
|
91
|
-
? combined.slice(0,
|
|
122
|
+
const truncated = combined.length > effectiveMaxOutput
|
|
123
|
+
? combined.slice(0, effectiveMaxOutput) + '\n[...output truncated...]'
|
|
92
124
|
: combined;
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
125
|
+
const wasKilledByUs = killed && (signal === 'SIGTERM' || signal === 'SIGKILL');
|
|
126
|
+
const success = code === 0 && !wasKilledByUs;
|
|
127
|
+
const status = wasKilledByUs ? 'failed' : success ? 'success' : 'failed';
|
|
128
|
+
writeAuditLog(ctx.db, {
|
|
129
|
+
sessionId: ctx.sessionId,
|
|
130
|
+
toolName: this.name,
|
|
131
|
+
action: wasKilledByUs ? 'timeout_killed' : 'execute',
|
|
132
|
+
details: {
|
|
133
|
+
command: command.slice(0, 2000),
|
|
134
|
+
cwd: absCwd,
|
|
135
|
+
exitCode: code,
|
|
136
|
+
signal,
|
|
137
|
+
durationMs,
|
|
138
|
+
outputLength: combined.length,
|
|
139
|
+
profile: profile.name,
|
|
140
|
+
},
|
|
141
|
+
status,
|
|
142
|
+
});
|
|
143
|
+
if (wasKilledByUs) {
|
|
144
|
+
reject(new Error(`Command timed out after ${effectiveTimeout}ms (killed with ${signal}): ${command}`));
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
102
147
|
if (code !== 0 && !stderr) {
|
|
103
148
|
reject(new Error(`Command exited with code ${code}: ${truncated}`));
|
|
104
149
|
return;
|
|
@@ -106,18 +151,25 @@ export class ShellExecTool {
|
|
|
106
151
|
resolve_p({
|
|
107
152
|
success,
|
|
108
153
|
output: truncated || `(no output, exit code ${code})`,
|
|
109
|
-
data: { exitCode: code, stdout, stderr, command, durationMs },
|
|
154
|
+
data: { exitCode: code, stdout, stderr, command, durationMs, profile: profile.name },
|
|
110
155
|
executionId,
|
|
111
156
|
durationMs,
|
|
112
157
|
});
|
|
113
158
|
});
|
|
114
159
|
proc.on('error', (err) => {
|
|
115
160
|
clearTimeout(timer);
|
|
116
|
-
writeAuditLog(ctx.db,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
161
|
+
writeAuditLog(ctx.db, {
|
|
162
|
+
sessionId: ctx.sessionId,
|
|
163
|
+
toolName: this.name,
|
|
164
|
+
action: 'spawn_error',
|
|
165
|
+
details: {
|
|
166
|
+
command: command.slice(0, 2000),
|
|
167
|
+
cwd: absCwd,
|
|
168
|
+
error: err.message,
|
|
169
|
+
profile: profile.name,
|
|
170
|
+
},
|
|
171
|
+
status: 'error',
|
|
172
|
+
});
|
|
121
173
|
reject(new Error(`Failed to spawn process: ${err.message}`));
|
|
122
174
|
});
|
|
123
175
|
});
|
|
@@ -126,6 +178,7 @@ export class ShellExecTool {
|
|
|
126
178
|
const { command } = args;
|
|
127
179
|
return `Would execute shell command: "${command}"`;
|
|
128
180
|
}
|
|
181
|
+
// ── Helpers ─────────────────────────────────────────────────
|
|
129
182
|
detectShell() {
|
|
130
183
|
if (process.platform === 'win32') {
|
|
131
184
|
// Prefer PowerShell 7, fall back to cmd
|
|
@@ -135,5 +188,36 @@ export class ShellExecTool {
|
|
|
135
188
|
}
|
|
136
189
|
return { shell: process.env['SHELL'] ?? '/bin/sh', shellFlag: '-c' };
|
|
137
190
|
}
|
|
191
|
+
/** Kill a process and its children. Platform-aware. */
|
|
192
|
+
killProcessTree(pid, signal) {
|
|
193
|
+
if (!pid)
|
|
194
|
+
return;
|
|
195
|
+
if (process.platform === 'win32') {
|
|
196
|
+
// Windows: taskkill /T kills the entire tree
|
|
197
|
+
const forceFlag = signal === 'SIGKILL' ? '/F' : '';
|
|
198
|
+
exec(`taskkill ${forceFlag} /T /PID ${pid}`, (err) => {
|
|
199
|
+
if (err && !err.message.includes('not found')) {
|
|
200
|
+
// Fallback: just kill the direct PID
|
|
201
|
+
try {
|
|
202
|
+
process.kill(pid, signal);
|
|
203
|
+
}
|
|
204
|
+
catch { /* ignore */ }
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
// Unix: kill the process group (negative PID)
|
|
210
|
+
try {
|
|
211
|
+
process.kill(-pid, signal);
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
// Fallback: kill direct PID
|
|
215
|
+
try {
|
|
216
|
+
process.kill(pid, signal);
|
|
217
|
+
}
|
|
218
|
+
catch { /* ignore */ }
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
138
222
|
}
|
|
139
223
|
//# sourceMappingURL=shell-exec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-exec.js","sourceRoot":"","sources":["../../src/tools/shell-exec.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,6DAA6D;AAC7D,
|
|
1
|
+
{"version":3,"file":"shell-exec.js","sourceRoot":"","sources":["../../src/tools/shell-exec.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,6DAA6D;AAC7D,oEAAoE;AACpE,+DAA+D;AAE/D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE/F,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,oBAAoB,GAAG,OAAO,CAAC;AACrC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEnC,MAAM,OAAO,aAAa;IACxB,IAAI,GAAU,YAAY,CAAC;IAC3B,OAAO,GAAO,OAAO,CAAC;IACtB,WAAW,GAAG,0PAA0P,CAAC;IACzQ,OAAO,GAAO,IAAI,CAAC;IACnB,SAAS,GAAK,KAAK,CAAC;IACpB,SAAS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IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,IAAI,CAAC,YAAY,SAAS,YAAY,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE;gBACnD,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;oBAC9C,qCAAqC;oBACrC,IAAI,CAAC;wBAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;oBAAC,CAAC;oBAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;gBAC3D,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,8CAA8C;YAC9C,IAAI,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YAC7B,CAAC;YAAC,MAAM,CAAC;gBACP,4BAA4B;gBAC5B,IAAI,CAAC;oBAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;gBAAC,CAAC;gBAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexagent-cli/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "NexAgent — locally-runnable AI agent CLI with file editing, tools, and beautiful TUI",
|
|
5
5
|
"bin": {
|
|
6
|
-
"nexagent": "./dist/index.js"
|
|
6
|
+
"nexagent": "./dist/index.js",
|
|
7
|
+
"sophie": "./dist/bin/sophie.js",
|
|
8
|
+
"amarax": "./dist/bin/amarax.js"
|
|
7
9
|
},
|
|
8
10
|
"main": "./dist/index.js",
|
|
9
11
|
"types": "./dist/index.d.ts",
|
|
@@ -34,13 +36,13 @@
|
|
|
34
36
|
"@anthropic-ai/sdk": "^0.29.0",
|
|
35
37
|
"@google/generative-ai": "^0.19.0",
|
|
36
38
|
"@inquirer/prompts": "^5.0.0",
|
|
37
|
-
"@nexagent-cli/shared": "0.
|
|
39
|
+
"@nexagent-cli/shared": "^0.7.0",
|
|
38
40
|
"better-sqlite3": "^11.0.0",
|
|
39
41
|
"boxen": "^8.0.0",
|
|
40
42
|
"chalk": "^5.3.0",
|
|
41
43
|
"commander": "^12.1.0",
|
|
42
44
|
"cors": "^2.8.5",
|
|
43
|
-
"diff": "^
|
|
45
|
+
"diff": "^8.0.3",
|
|
44
46
|
"dotenv": "^16.4.5",
|
|
45
47
|
"express": "^4.21.0",
|
|
46
48
|
"figures": "^6.1.0",
|
|
@@ -69,7 +71,7 @@
|
|
|
69
71
|
"@types/react": "^18.3.0",
|
|
70
72
|
"tsx": "^4.15.0",
|
|
71
73
|
"typescript": "^5.5.0",
|
|
72
|
-
"vitest": "^
|
|
74
|
+
"vitest": "^4.1.8"
|
|
73
75
|
},
|
|
74
76
|
"engines": {
|
|
75
77
|
"node": ">=22.0.0"
|