@cloudcli-ai/cloudcli 1.28.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.
Files changed (163) hide show
  1. package/LICENSE +718 -0
  2. package/README.de.md +239 -0
  3. package/README.ja.md +231 -0
  4. package/README.ko.md +230 -0
  5. package/README.md +242 -0
  6. package/README.ru.md +239 -0
  7. package/README.zh-CN.md +230 -0
  8. package/dist/api-docs.html +879 -0
  9. package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  10. package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  11. package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  12. package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  13. package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  14. package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  15. package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  16. package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  17. package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  18. package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  19. package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  20. package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  21. package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  22. package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  23. package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  24. package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  25. package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  26. package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  27. package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  28. package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  29. package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  30. package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  31. package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  32. package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  33. package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  34. package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  35. package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  36. package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  37. package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  38. package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  39. package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  40. package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  41. package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  42. package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  43. package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  44. package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  45. package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  46. package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  47. package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  48. package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  49. package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  50. package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  51. package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  52. package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  53. package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  54. package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  55. package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  56. package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  57. package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  58. package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  59. package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  60. package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  61. package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  62. package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  63. package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  64. package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  65. package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  66. package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  67. package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  68. package/dist/assets/index-B1XAhG_4.css +32 -0
  69. package/dist/assets/index-BWQPmiP5.js +1275 -0
  70. package/dist/assets/vendor-codemirror-C8f1vU1x.js +41 -0
  71. package/dist/assets/vendor-react-CdSTmIF1.js +59 -0
  72. package/dist/assets/vendor-xterm-CJZjLICi.js +66 -0
  73. package/dist/clear-cache.html +85 -0
  74. package/dist/convert-icons.md +53 -0
  75. package/dist/favicon.png +0 -0
  76. package/dist/favicon.svg +9 -0
  77. package/dist/generate-icons.js +49 -0
  78. package/dist/icons/claude-ai-icon.svg +1 -0
  79. package/dist/icons/codex-white.svg +3 -0
  80. package/dist/icons/codex.svg +3 -0
  81. package/dist/icons/cursor-white.svg +12 -0
  82. package/dist/icons/cursor.svg +1 -0
  83. package/dist/icons/gemini-ai-icon.svg +1 -0
  84. package/dist/icons/icon-128x128.png +0 -0
  85. package/dist/icons/icon-128x128.svg +12 -0
  86. package/dist/icons/icon-144x144.png +0 -0
  87. package/dist/icons/icon-144x144.svg +12 -0
  88. package/dist/icons/icon-152x152.png +0 -0
  89. package/dist/icons/icon-152x152.svg +12 -0
  90. package/dist/icons/icon-192x192.png +0 -0
  91. package/dist/icons/icon-192x192.svg +12 -0
  92. package/dist/icons/icon-384x384.png +0 -0
  93. package/dist/icons/icon-384x384.svg +12 -0
  94. package/dist/icons/icon-512x512.png +0 -0
  95. package/dist/icons/icon-512x512.svg +12 -0
  96. package/dist/icons/icon-72x72.png +0 -0
  97. package/dist/icons/icon-72x72.svg +12 -0
  98. package/dist/icons/icon-96x96.png +0 -0
  99. package/dist/icons/icon-96x96.svg +12 -0
  100. package/dist/icons/icon-template.svg +12 -0
  101. package/dist/index.html +52 -0
  102. package/dist/logo-128.png +0 -0
  103. package/dist/logo-256.png +0 -0
  104. package/dist/logo-32.png +0 -0
  105. package/dist/logo-512.png +0 -0
  106. package/dist/logo-64.png +0 -0
  107. package/dist/logo.svg +17 -0
  108. package/dist/manifest.json +61 -0
  109. package/dist/screenshots/cli-selection.png +0 -0
  110. package/dist/screenshots/desktop-main.png +0 -0
  111. package/dist/screenshots/mobile-chat.png +0 -0
  112. package/dist/screenshots/tools-modal.png +0 -0
  113. package/dist/sw.js +124 -0
  114. package/package.json +153 -0
  115. package/scripts/fix-node-pty.js +67 -0
  116. package/server/claude-sdk.js +817 -0
  117. package/server/cli.js +330 -0
  118. package/server/constants/config.js +5 -0
  119. package/server/cursor-cli.js +335 -0
  120. package/server/database/db.js +630 -0
  121. package/server/database/init.sql +99 -0
  122. package/server/gemini-cli.js +453 -0
  123. package/server/gemini-response-handler.js +79 -0
  124. package/server/index.js +2577 -0
  125. package/server/load-env.js +29 -0
  126. package/server/middleware/auth.js +132 -0
  127. package/server/openai-codex.js +418 -0
  128. package/server/projects.js +2561 -0
  129. package/server/providers/claude/adapter.js +278 -0
  130. package/server/providers/codex/adapter.js +248 -0
  131. package/server/providers/cursor/adapter.js +353 -0
  132. package/server/providers/gemini/adapter.js +186 -0
  133. package/server/providers/registry.js +44 -0
  134. package/server/providers/types.js +119 -0
  135. package/server/providers/utils.js +29 -0
  136. package/server/routes/agent.js +1245 -0
  137. package/server/routes/auth.js +135 -0
  138. package/server/routes/cli-auth.js +434 -0
  139. package/server/routes/codex.js +329 -0
  140. package/server/routes/commands.js +601 -0
  141. package/server/routes/cursor.js +798 -0
  142. package/server/routes/gemini.js +24 -0
  143. package/server/routes/git.js +1488 -0
  144. package/server/routes/mcp-utils.js +48 -0
  145. package/server/routes/mcp.js +552 -0
  146. package/server/routes/messages.js +61 -0
  147. package/server/routes/plugins.js +307 -0
  148. package/server/routes/projects.js +548 -0
  149. package/server/routes/settings.js +276 -0
  150. package/server/routes/taskmaster.js +1963 -0
  151. package/server/routes/user.js +123 -0
  152. package/server/services/notification-orchestrator.js +227 -0
  153. package/server/services/vapid-keys.js +35 -0
  154. package/server/sessionManager.js +226 -0
  155. package/server/utils/commandParser.js +303 -0
  156. package/server/utils/frontmatter.js +18 -0
  157. package/server/utils/gitConfig.js +34 -0
  158. package/server/utils/mcp-detector.js +198 -0
  159. package/server/utils/plugin-loader.js +457 -0
  160. package/server/utils/plugin-process-manager.js +184 -0
  161. package/server/utils/taskmaster-websocket.js +129 -0
  162. package/shared/modelConstants.js +92 -0
  163. package/shared/networkHosts.js +22 -0
package/dist/sw.js ADDED
@@ -0,0 +1,124 @@
1
+ // Service Worker for Claude Code UI PWA
2
+ // Cache only manifest (needed for PWA install). HTML and JS are never pre-cached
3
+ // so a rebuild + refresh always picks up the latest assets.
4
+ const CACHE_NAME = 'claude-ui-v2';
5
+ const urlsToCache = [
6
+ '/manifest.json'
7
+ ];
8
+
9
+ // Install event
10
+ self.addEventListener('install', event => {
11
+ event.waitUntil(
12
+ caches.open(CACHE_NAME)
13
+ .then(cache => cache.addAll(urlsToCache))
14
+ );
15
+ self.skipWaiting();
16
+ });
17
+
18
+ // Fetch event — network-first for everything except hashed assets
19
+ self.addEventListener('fetch', event => {
20
+ const url = event.request.url;
21
+
22
+ // Never intercept API requests or WebSocket upgrades
23
+ if (url.includes('/api/') || url.includes('/ws')) {
24
+ return;
25
+ }
26
+
27
+ // Navigation requests (HTML) — always go to network, no caching
28
+ if (event.request.mode === 'navigate') {
29
+ event.respondWith(
30
+ fetch(event.request).catch(() => caches.match('/manifest.json').then(() =>
31
+ new Response('<h1>Offline</h1><p>Please check your connection.</p>', {
32
+ headers: { 'Content-Type': 'text/html' }
33
+ })
34
+ ))
35
+ );
36
+ return;
37
+ }
38
+
39
+ // Hashed assets (JS/CSS in /assets/) — cache-first since filenames change per build
40
+ if (url.includes('/assets/')) {
41
+ event.respondWith(
42
+ caches.match(event.request).then(cached => {
43
+ if (cached) return cached;
44
+ return fetch(event.request).then(response => {
45
+ const clone = response.clone();
46
+ caches.open(CACHE_NAME).then(cache => cache.put(event.request, clone));
47
+ return response;
48
+ });
49
+ })
50
+ );
51
+ return;
52
+ }
53
+
54
+ // Everything else — network-first
55
+ event.respondWith(
56
+ fetch(event.request).catch(() => caches.match(event.request))
57
+ );
58
+ });
59
+
60
+ // Activate event — purge old caches
61
+ self.addEventListener('activate', event => {
62
+ event.waitUntil(
63
+ caches.keys().then(cacheNames =>
64
+ Promise.all(
65
+ cacheNames
66
+ .filter(name => name !== CACHE_NAME)
67
+ .map(name => caches.delete(name))
68
+ )
69
+ )
70
+ );
71
+ self.clients.claim();
72
+ });
73
+
74
+ // Push notification event
75
+ self.addEventListener('push', event => {
76
+ if (!event.data) return;
77
+
78
+ let payload;
79
+ try {
80
+ payload = event.data.json();
81
+ } catch {
82
+ payload = { title: 'Claude Code UI', body: event.data.text() };
83
+ }
84
+
85
+ const options = {
86
+ body: payload.body || '',
87
+ icon: '/logo-256.png',
88
+ badge: '/logo-128.png',
89
+ data: payload.data || {},
90
+ tag: payload.data?.tag || `${payload.data?.sessionId || 'global'}:${payload.data?.code || 'default'}`,
91
+ renotify: true
92
+ };
93
+
94
+ event.waitUntil(
95
+ self.registration.showNotification(payload.title || 'Claude Code UI', options)
96
+ );
97
+ });
98
+
99
+ // Notification click event
100
+ self.addEventListener('notificationclick', event => {
101
+ event.notification.close();
102
+
103
+ const sessionId = event.notification.data?.sessionId;
104
+ const provider = event.notification.data?.provider || null;
105
+ const urlPath = sessionId ? `/session/${sessionId}` : '/';
106
+
107
+ event.waitUntil(
108
+ self.clients.matchAll({ type: 'window', includeUncontrolled: true }).then(async clientList => {
109
+ for (const client of clientList) {
110
+ if (client.url.includes(self.location.origin)) {
111
+ await client.focus();
112
+ client.postMessage({
113
+ type: 'notification:navigate',
114
+ sessionId: sessionId || null,
115
+ provider,
116
+ urlPath
117
+ });
118
+ return;
119
+ }
120
+ }
121
+ return self.clients.openWindow(urlPath);
122
+ })
123
+ );
124
+ });
package/package.json ADDED
@@ -0,0 +1,153 @@
1
+ {
2
+ "name": "@cloudcli-ai/cloudcli",
3
+ "version": "1.28.0",
4
+ "description": "A web-based UI for Claude Code CLI",
5
+ "type": "module",
6
+ "main": "server/index.js",
7
+ "bin": {
8
+ "cloudcli": "server/cli.js"
9
+ },
10
+ "files": [
11
+ "server/",
12
+ "shared/",
13
+ "dist/",
14
+ "scripts/",
15
+ "README.md"
16
+ ],
17
+ "homepage": "https://cloudcli.ai",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/siteboon/claudecodeui.git"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/siteboon/claudecodeui/issues"
24
+ },
25
+ "scripts": {
26
+ "dev": "concurrently --kill-others \"npm run server\" \"npm run client\"",
27
+ "server": "node server/index.js",
28
+ "client": "vite",
29
+ "build": "vite build",
30
+ "preview": "vite preview",
31
+ "typecheck": "tsc --noEmit -p tsconfig.json",
32
+ "lint": "eslint src/",
33
+ "lint:fix": "eslint src/ --fix",
34
+ "start": "npm run build && npm run server",
35
+ "release": "./release.sh",
36
+ "prepublishOnly": "npm run build",
37
+ "postinstall": "node scripts/fix-node-pty.js",
38
+ "prepare": "husky"
39
+ },
40
+ "keywords": [
41
+ "claude code",
42
+ "claude-code",
43
+ "claude-code-ui",
44
+ "cloudcli",
45
+ "codex",
46
+ "gemini",
47
+ "gemini-cli",
48
+ "cursor",
49
+ "cursor-cli",
50
+ "anthropic",
51
+ "openai",
52
+ "google",
53
+ "coding-agent",
54
+ "web-ui",
55
+ "ui",
56
+ "mobile IDE"
57
+ ],
58
+ "author": "CloudCLI UI Contributors",
59
+ "license": "AGPL-3.0-or-later",
60
+ "dependencies": {
61
+ "@anthropic-ai/claude-agent-sdk": "^0.2.59",
62
+ "@codemirror/lang-css": "^6.3.1",
63
+ "@codemirror/lang-html": "^6.4.9",
64
+ "@codemirror/lang-javascript": "^6.2.4",
65
+ "@codemirror/lang-json": "^6.0.1",
66
+ "@codemirror/lang-markdown": "^6.3.3",
67
+ "@codemirror/lang-python": "^6.2.1",
68
+ "@codemirror/merge": "^6.11.1",
69
+ "@codemirror/theme-one-dark": "^6.1.2",
70
+ "@iarna/toml": "^2.2.5",
71
+ "@octokit/rest": "^22.0.0",
72
+ "@openai/codex-sdk": "^0.101.0",
73
+ "@replit/codemirror-minimap": "^0.5.2",
74
+ "@tailwindcss/typography": "^0.5.16",
75
+ "@uiw/react-codemirror": "^4.23.13",
76
+ "@xterm/addon-clipboard": "^0.1.0",
77
+ "@xterm/addon-fit": "^0.10.0",
78
+ "@xterm/addon-web-links": "^0.11.0",
79
+ "@xterm/addon-webgl": "^0.18.0",
80
+ "@xterm/xterm": "^5.5.0",
81
+ "bcrypt": "^6.0.0",
82
+ "better-sqlite3": "^12.6.2",
83
+ "chokidar": "^4.0.3",
84
+ "class-variance-authority": "^0.7.1",
85
+ "clsx": "^2.1.1",
86
+ "cors": "^2.8.5",
87
+ "cross-spawn": "^7.0.3",
88
+ "express": "^4.18.2",
89
+ "fuse.js": "^7.0.0",
90
+ "gray-matter": "^4.0.3",
91
+ "i18next": "^25.7.4",
92
+ "i18next-browser-languagedetector": "^8.2.0",
93
+ "jsonwebtoken": "^9.0.2",
94
+ "jszip": "^3.10.1",
95
+ "katex": "^0.16.25",
96
+ "lucide-react": "^0.515.0",
97
+ "mime-types": "^3.0.1",
98
+ "multer": "^2.0.1",
99
+ "node-fetch": "^2.7.0",
100
+ "node-pty": "^1.1.0-beta34",
101
+ "react": "^18.2.0",
102
+ "react-dom": "^18.2.0",
103
+ "react-dropzone": "^14.2.3",
104
+ "react-error-boundary": "^4.1.2",
105
+ "react-i18next": "^16.5.3",
106
+ "react-markdown": "^10.1.0",
107
+ "react-router-dom": "^6.8.1",
108
+ "react-syntax-highlighter": "^15.6.1",
109
+ "rehype-katex": "^7.0.1",
110
+ "rehype-raw": "^7.0.0",
111
+ "remark-gfm": "^4.0.0",
112
+ "remark-math": "^6.0.0",
113
+ "sqlite": "^5.1.1",
114
+ "sqlite3": "^5.1.7",
115
+ "tailwind-merge": "^3.3.1",
116
+ "web-push": "^3.6.7",
117
+ "ws": "^8.14.2"
118
+ },
119
+ "devDependencies": {
120
+ "@commitlint/cli": "^20.4.3",
121
+ "@commitlint/config-conventional": "^20.4.3",
122
+ "@eslint/js": "^9.39.3",
123
+ "@release-it/conventional-changelog": "^10.0.5",
124
+ "@types/node": "^22.19.7",
125
+ "@types/react": "^18.2.43",
126
+ "@types/react-dom": "^18.2.17",
127
+ "@vitejs/plugin-react": "^4.6.0",
128
+ "auto-changelog": "^2.5.0",
129
+ "autoprefixer": "^10.4.16",
130
+ "concurrently": "^8.2.2",
131
+ "eslint": "^9.39.3",
132
+ "eslint-plugin-import-x": "^4.16.1",
133
+ "eslint-plugin-react": "^7.37.5",
134
+ "eslint-plugin-react-hooks": "^7.0.1",
135
+ "eslint-plugin-react-refresh": "^0.5.2",
136
+ "eslint-plugin-tailwindcss": "^3.18.2",
137
+ "eslint-plugin-unused-imports": "^4.4.1",
138
+ "globals": "^17.4.0",
139
+ "husky": "^9.1.7",
140
+ "lint-staged": "^16.3.2",
141
+ "node-gyp": "^10.0.0",
142
+ "postcss": "^8.4.32",
143
+ "release-it": "^19.0.5",
144
+ "sharp": "^0.34.2",
145
+ "tailwindcss": "^3.4.0",
146
+ "typescript": "^5.9.3",
147
+ "typescript-eslint": "^8.56.1",
148
+ "vite": "^7.0.4"
149
+ },
150
+ "lint-staged": {
151
+ "src/**/*.{ts,tsx,js,jsx}": "eslint"
152
+ }
153
+ }
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Fix node-pty spawn-helper permissions on macOS
4
+ *
5
+ * This script fixes a known issue with node-pty where the spawn-helper
6
+ * binary is shipped without execute permissions, causing "posix_spawnp failed" errors.
7
+ *
8
+ * @see https://github.com/microsoft/node-pty/issues/850
9
+ * @module scripts/fix-node-pty
10
+ */
11
+
12
+ import { promises as fs } from 'fs';
13
+ import path from 'path';
14
+ import { fileURLToPath } from 'url';
15
+
16
+ const __filename = fileURLToPath(import.meta.url);
17
+ const __dirname = path.dirname(__filename);
18
+
19
+ /**
20
+ * Fixes the spawn-helper binary permissions for node-pty on macOS.
21
+ *
22
+ * The node-pty package ships the spawn-helper binary without execute permissions
23
+ * (644 instead of 755), which causes "posix_spawnp failed" errors when trying
24
+ * to spawn terminal processes.
25
+ *
26
+ * This function:
27
+ * 1. Checks if running on macOS (darwin)
28
+ * 2. Locates spawn-helper binaries for both arm64 and x64 architectures
29
+ * 3. Sets execute permissions (755) on each binary found
30
+ *
31
+ * @async
32
+ * @function fixSpawnHelper
33
+ * @returns {Promise<void>} Resolves when permissions are fixed or skipped
34
+ * @example
35
+ * // Run as postinstall script
36
+ * await fixSpawnHelper();
37
+ */
38
+ async function fixSpawnHelper() {
39
+ const nodeModulesPath = path.join(__dirname, '..', 'node_modules', 'node-pty', 'prebuilds');
40
+
41
+ // Only run on macOS
42
+ if (process.platform !== 'darwin') {
43
+ return;
44
+ }
45
+
46
+ const darwinDirs = ['darwin-arm64', 'darwin-x64'];
47
+
48
+ for (const dir of darwinDirs) {
49
+ const spawnHelperPath = path.join(nodeModulesPath, dir, 'spawn-helper');
50
+
51
+ try {
52
+ // Check if file exists
53
+ await fs.access(spawnHelperPath);
54
+
55
+ // Make it executable (755)
56
+ await fs.chmod(spawnHelperPath, 0o755);
57
+ console.log(`[postinstall] Fixed permissions for ${spawnHelperPath}`);
58
+ } catch (err) {
59
+ // File doesn't exist or other error - ignore
60
+ if (err.code !== 'ENOENT') {
61
+ console.warn(`[postinstall] Warning: Could not fix ${spawnHelperPath}: ${err.message}`);
62
+ }
63
+ }
64
+ }
65
+ }
66
+
67
+ fixSpawnHelper().catch(console.error);