@vibe80/vibe80 0.1.8 → 0.2.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/package.json +4 -2
- package/server/package.json +3 -1
- package/server/src/index.js +16 -2
- package/server/src/routes/sessions.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibe80/vibe80",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"server",
|
|
@@ -37,10 +37,12 @@
|
|
|
37
37
|
"express-rate-limit": "^7.4.0",
|
|
38
38
|
"jsonwebtoken": "^9.0.3",
|
|
39
39
|
"multer": "^1.4.5-lts.1",
|
|
40
|
-
"node-pty": "^1.0.0",
|
|
41
40
|
"redis": "^4.7.1",
|
|
42
41
|
"sqlite3": "^5.1.7",
|
|
43
42
|
"ws": "^8.17.1"
|
|
44
43
|
},
|
|
44
|
+
"optionalDependencies": {
|
|
45
|
+
"node-pty": "^1.0.0"
|
|
46
|
+
},
|
|
45
47
|
"license": "Apache-2.0"
|
|
46
48
|
}
|
package/server/package.json
CHANGED
|
@@ -16,11 +16,13 @@
|
|
|
16
16
|
"express-rate-limit": "^7.4.0",
|
|
17
17
|
"jsonwebtoken": "^9.0.3",
|
|
18
18
|
"multer": "^1.4.5-lts.1",
|
|
19
|
-
"node-pty": "^1.0.0",
|
|
20
19
|
"redis": "^4.7.1",
|
|
21
20
|
"sqlite3": "^5.1.7",
|
|
22
21
|
"ws": "^8.17.1"
|
|
23
22
|
},
|
|
23
|
+
"optionalDependencies": {
|
|
24
|
+
"node-pty": "^1.0.0"
|
|
25
|
+
},
|
|
24
26
|
"devDependencies": {
|
|
25
27
|
"@vitest/coverage-v8": "^4.0.18",
|
|
26
28
|
"supertest": "^7.2.2",
|
package/server/src/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import path from "path";
|
|
|
4
4
|
import fs from "fs";
|
|
5
5
|
import { fileURLToPath } from "url";
|
|
6
6
|
import { WebSocketServer } from "ws";
|
|
7
|
-
import * as pty from "node-pty";
|
|
8
7
|
import rateLimit from "express-rate-limit";
|
|
9
8
|
import storage from "./storage/index.js";
|
|
10
9
|
import {
|
|
@@ -102,9 +101,23 @@ if (trustProxySetting !== undefined) {
|
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
|
-
const
|
|
104
|
+
const terminalRequested = !/^(0|false|no|off)$/i.test(
|
|
106
105
|
process.env.TERMINAL_ENABLED || ""
|
|
107
106
|
);
|
|
107
|
+
let pty = null;
|
|
108
|
+
let terminalAvailable = false;
|
|
109
|
+
if (terminalRequested) {
|
|
110
|
+
try {
|
|
111
|
+
const ptyModule = await import("node-pty");
|
|
112
|
+
pty = ptyModule;
|
|
113
|
+
terminalAvailable = true;
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.warn(
|
|
116
|
+
`[warn] Terminal disabled: node-pty is unavailable (${error?.message || error}).`
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const terminalEnabled = terminalRequested && terminalAvailable;
|
|
108
121
|
const allowRunSlashCommand = !/^(0|false|no|off)$/i.test(
|
|
109
122
|
process.env.ALLOW_RUN_SLASH_COMMAND || ""
|
|
110
123
|
);
|
|
@@ -205,6 +218,7 @@ const routeDeps = {
|
|
|
205
218
|
attachClaudeEventsForWorktree,
|
|
206
219
|
deploymentMode,
|
|
207
220
|
debugApiWsLog,
|
|
221
|
+
terminalEnabled,
|
|
208
222
|
};
|
|
209
223
|
|
|
210
224
|
app.use("/api/v1", healthRoutes({
|
|
@@ -33,7 +33,6 @@ import {
|
|
|
33
33
|
clearWorktreeMessages,
|
|
34
34
|
} from "../worktreeManager.js";
|
|
35
35
|
|
|
36
|
-
const terminalEnabled = /^(1|true|yes|on)$/i.test(process.env.TERMINAL_ENABLED || "1");
|
|
37
36
|
const instanceHostname = process.env.HOSTNAME || os.hostname();
|
|
38
37
|
|
|
39
38
|
export default function sessionRoutes(deps) {
|
|
@@ -43,6 +42,7 @@ export default function sessionRoutes(deps) {
|
|
|
43
42
|
attachClaudeEvents,
|
|
44
43
|
getActiveClient,
|
|
45
44
|
deploymentMode,
|
|
45
|
+
terminalEnabled,
|
|
46
46
|
} = deps;
|
|
47
47
|
|
|
48
48
|
const router = Router();
|