akemon 0.2.26 → 0.2.27

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.
@@ -197,6 +197,10 @@ export function connectRelay(options) {
197
197
  case "terminal_start":
198
198
  if (!options.enableTerminal) {
199
199
  console.log("[terminal] Disabled. Use --terminal to enable.");
200
+ ws.send(JSON.stringify({
201
+ type: "terminal_exit",
202
+ error: "Terminal disabled on this agent. Restart with --terminal flag to enable.",
203
+ }));
200
204
  break;
201
205
  }
202
206
  startPTY(ws, msg.cols || 80, msg.rows || 24);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akemon",
3
- "version": "0.2.26",
3
+ "version": "0.2.27",
4
4
  "description": "Agent work marketplace — train your agent, let it work for others",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -22,12 +22,14 @@
22
22
  },
23
23
  "files": [
24
24
  "dist",
25
+ "scripts",
25
26
  "README.md"
26
27
  ],
27
28
  "scripts": {
28
29
  "build": "tsc && cp src/live.html dist/live.html",
29
30
  "dev": "tsc --watch",
30
31
  "start": "node dist/cli.js",
32
+ "postinstall": "node scripts/fix-node-pty.cjs",
31
33
  "prepublishOnly": "npm run build",
32
34
  "test": "tsc -p tsconfig.test.json && node --test test-dist/*.test.js"
33
35
  },
@@ -0,0 +1,19 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+
4
+ // node-pty ships prebuilt `spawn-helper` binaries per platform. Some
5
+ // npm/tar/filesystem combinations strip the execute bit during install, which
6
+ // causes `posix_spawnp failed` at runtime. Restore +x for every prebuild.
7
+ try {
8
+ const prebuildsDir = path.join(__dirname, "..", "node_modules", "node-pty", "prebuilds");
9
+ if (!fs.existsSync(prebuildsDir)) process.exit(0);
10
+
11
+ for (const platformDir of fs.readdirSync(prebuildsDir)) {
12
+ const helper = path.join(prebuildsDir, platformDir, "spawn-helper");
13
+ if (fs.existsSync(helper)) {
14
+ fs.chmodSync(helper, 0o755);
15
+ }
16
+ }
17
+ } catch (e) {
18
+ console.error("[akemon] fix-node-pty:", e.message);
19
+ }