pty-manager 1.1.0 → 1.1.1

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": "pty-manager",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "PTY session manager with lifecycle management, pluggable adapters, and blocking prompt detection",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -14,10 +14,12 @@
14
14
  },
15
15
  "files": [
16
16
  "dist",
17
+ "scripts",
17
18
  "README.md",
18
19
  "LICENSE"
19
20
  ],
20
21
  "scripts": {
22
+ "postinstall": "node scripts/postinstall.js",
21
23
  "build": "tsup",
22
24
  "dev": "tsup --watch",
23
25
  "test": "vitest",
@@ -0,0 +1,33 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const platform = `${process.platform}-${process.arch}`;
5
+
6
+ // spawn-helper is in node-pty's prebuilds directory
7
+ const possiblePaths = [
8
+ // When installed as dependency (node_modules/pty-manager/node_modules/node-pty)
9
+ path.join(__dirname, '..', 'node_modules', 'node-pty', 'prebuilds', platform, 'spawn-helper'),
10
+ // When in monorepo with hoisted deps
11
+ path.join(__dirname, '..', '..', 'node-pty', 'prebuilds', platform, 'spawn-helper'),
12
+ // When installed at root level
13
+ path.join(__dirname, '..', '..', '..', 'node-pty', 'prebuilds', platform, 'spawn-helper'),
14
+ ];
15
+
16
+ let fixed = false;
17
+ for (const helper of possiblePaths) {
18
+ if (fs.existsSync(helper)) {
19
+ try {
20
+ fs.chmodSync(helper, 0o755);
21
+ console.log(`[pty-manager] Fixed spawn-helper permissions at ${helper}`);
22
+ fixed = true;
23
+ break;
24
+ } catch (err) {
25
+ // May not have permission, continue to next path
26
+ }
27
+ }
28
+ }
29
+
30
+ if (!fixed && process.platform !== 'win32') {
31
+ // Only warn on Unix-like systems where this matters
32
+ console.log(`[pty-manager] spawn-helper not found for ${platform} (this is normal on some setups)`);
33
+ }