colana 1.0.0-beta.70 → 1.0.0-beta.71

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": "colana",
3
- "version": "1.0.0-beta.70",
3
+ "version": "1.0.0-beta.71",
4
4
  "description": "Agent-First. Multiplied. Multi-agent command center for AI coding agents.",
5
5
  "type": "module",
6
6
  "main": "server/index.js",
@@ -17,9 +17,36 @@ const R = _color ? '\x1b[0m' : ''; // Reset
17
17
 
18
18
  const prefix = `[${B}co${O}:${B}lana${R}]`;
19
19
 
20
+ const path = require('path');
21
+
20
22
  try {
21
23
  require('node-pty');
22
24
  console.log(`${prefix} ${G}✓${R} node-pty loaded successfully — PTY mode available`);
25
+
26
+ // On macOS, node-pty's spawn-helper binary (used internally by posix_spawn
27
+ // to set up the PTY controlling terminal) ships in prebuilds but npm extracts
28
+ // it without execute permission (0644). posix_spawn then fails with EACCES on
29
+ // every PTY spawn — including /bin/sh. Fix permissions here so PTY works.
30
+ if (process.platform === 'darwin') {
31
+ const fs = require('fs');
32
+ const ptyRoot = path.dirname(require.resolve('node-pty/package.json'));
33
+ const helperLocations = [
34
+ path.join(ptyRoot, 'build', 'Release', 'spawn-helper'),
35
+ path.join(ptyRoot, 'prebuilds', 'darwin-arm64', 'spawn-helper'),
36
+ path.join(ptyRoot, 'prebuilds', 'darwin-x64', 'spawn-helper'),
37
+ ];
38
+ for (const loc of helperLocations) {
39
+ if (fs.existsSync(loc)) {
40
+ try {
41
+ const stat = fs.statSync(loc);
42
+ if (!(stat.mode & 0o111)) {
43
+ fs.chmodSync(loc, 0o755);
44
+ console.log(`${prefix} ${G}✓${R} Fixed spawn-helper permissions: ${path.basename(path.dirname(loc))}`);
45
+ }
46
+ } catch { /* best-effort — runtime fix in pty-manager.js will catch it */ }
47
+ }
48
+ }
49
+ }
23
50
  } catch (err) {
24
51
  console.warn(`${prefix} ${Y}⚠${R} node-pty could not load — PTY mode will be unavailable`);
25
52
  console.warn(`${prefix} ${D}Terminal sessions will not work until this is resolved.${R}`);
@@ -29,6 +29,29 @@ import { trackEvent } from './analytics.js';
29
29
  import { addNotification as persistNotification } from './personal-chat-store.js';
30
30
  import { shouldAutoIsolate, createWorktree } from './worktree-manager.js';
31
31
  import { syncAuthProfilesFromEnv, getOrCreateGatewayToken, ensureGatewayAuthToken, getOpenClawConfig, syncGatewayTokenToEnv, getOpenClawAuthToken } from './openclaw-config.js';
32
+ import { createRequire } from 'module';
33
+
34
+ // macOS spawn-helper permission fix — npm extracts node-pty prebuilt binaries
35
+ // without execute permissions, causing posix_spawn to fail with EACCES on every
36
+ // PTY spawn (including /bin/sh). Fix once at module load so all subsequent
37
+ // PTY spawns work. This is a safety net for users who installed before the
38
+ // postinstall.cjs fix was added.
39
+ if (process.platform === 'darwin') {
40
+ try {
41
+ const _require = createRequire(import.meta.url);
42
+ const ptyRoot = path.dirname(_require.resolve('node-pty/package.json'));
43
+ for (const sub of ['build/Release', 'prebuilds/darwin-arm64', 'prebuilds/darwin-x64']) {
44
+ const helper = path.join(ptyRoot, sub, 'spawn-helper');
45
+ try {
46
+ const st = fs.statSync(helper);
47
+ if (!(st.mode & 0o111)) {
48
+ fs.chmodSync(helper, 0o755);
49
+ console.warn(`[pty-manager] Fixed spawn-helper permissions in ${sub}`);
50
+ }
51
+ } catch { /* file doesn't exist in this location — expected */ }
52
+ }
53
+ } catch { /* node-pty not installed — handled elsewhere */ }
54
+ }
32
55
 
33
56
  // Provider-specific regex patterns for detecting session IDs from PTY output
34
57
  const SESSION_ID_PATTERNS = {