nothumanallowed 14.4.13 → 14.4.15
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "14.4.
|
|
3
|
+
"version": "14.4.15",
|
|
4
4
|
"description": "NotHumanAllowed — 38 AI agents, 80 tools, Studio (visual agentic workflows). Email, calendar, browser automation, screen capture, canvas, cron/heartbeat, Alexandria E2E messaging, GitHub, Notion, Slack, voice chat, free AI (Liara), 28 languages. Zero-dependency CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/constants.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url';
|
|
|
5
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = path.dirname(__filename);
|
|
7
7
|
|
|
8
|
-
export const VERSION = '14.4.
|
|
8
|
+
export const VERSION = '14.4.15';
|
|
9
9
|
export const BASE_URL = 'https://nothumanallowed.com/cli';
|
|
10
10
|
export const API_BASE = 'https://nothumanallowed.com/api/v1';
|
|
11
11
|
|
package/src/server/ws.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import fs from 'fs';
|
|
|
8
8
|
import path from 'path';
|
|
9
9
|
import os from 'os';
|
|
10
10
|
import { fileURLToPath } from 'url';
|
|
11
|
-
import {
|
|
11
|
+
import { execFile } from 'child_process';
|
|
12
12
|
import { NHA_DIR } from '../constants.mjs';
|
|
13
13
|
|
|
14
14
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -115,32 +115,23 @@ export function setupWebSocket(server) {
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
// Execute command
|
|
119
|
-
const
|
|
120
|
-
const
|
|
118
|
+
// Execute command — fully isolated from parent process stdio
|
|
119
|
+
const shell = process.platform === 'win32' ? 'cmd.exe' : '/bin/sh';
|
|
120
|
+
const shellArg = process.platform === 'win32' ? '/c' : '-c';
|
|
121
|
+
const child = execFile(shell, [shellArg, cmd], {
|
|
121
122
|
cwd: currentCwd,
|
|
122
123
|
timeout: 30_000,
|
|
123
|
-
env: { ...process.env, TERM: '
|
|
124
|
+
env: { ...process.env, TERM: 'dumb', NODE_ENV: 'development' },
|
|
124
125
|
maxBuffer: 1024 * 1024,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
send(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
send(`\x1b[31m${d.toString().replace(/\n/g, '\r\n')}\x1b[0m`);
|
|
132
|
-
});
|
|
133
|
-
child.on('exit', (code) => {
|
|
134
|
-
if (code !== 0 && code !== null) {
|
|
135
|
-
send(`\x1b[90m[exit code: ${code}]\x1b[0m\r\n`);
|
|
136
|
-
}
|
|
126
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
127
|
+
}, (err, stdout, stderr) => {
|
|
128
|
+
if (stdout) send(stdout.replace(/\n/g, '\r\n'));
|
|
129
|
+
if (stderr) send(`\x1b[31m${stderr.replace(/\n/g, '\r\n')}\x1b[0m`);
|
|
130
|
+
if (err && err.killed) send(`\x1b[31m[timeout]\x1b[0m\r\n`);
|
|
131
|
+
else if (err && !stdout && !stderr) send(`\x1b[31m${err.message}\x1b[0m\r\n`);
|
|
137
132
|
send(`\x1b[90m${currentCwd}\x1b[0m\r\n`);
|
|
138
133
|
send(`\x1b[36m$ \x1b[0m`);
|
|
139
134
|
});
|
|
140
|
-
child.on('error', (err) => {
|
|
141
|
-
send(`\x1b[31m${err.message}\x1b[0m\r\n`);
|
|
142
|
-
send(`\x1b[36m$ \x1b[0m`);
|
|
143
|
-
});
|
|
144
135
|
} else if (char === '\x7f' || char === '\b') {
|
|
145
136
|
// Backspace
|
|
146
137
|
if (cmdBuffer.length > 0) {
|