@phenx-inc/ctlsurf 0.17.1 → 0.17.2

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.
@@ -241,10 +241,34 @@ const mode = detectMode(args)
241
241
  checkApiKey(mode).catch(() => {}).then(() => launch(mode))
242
242
 
243
243
  function launch(launchMode) {
244
+ ensurePtyHelperExecutable()
244
245
  if (launchMode === 'desktop') runDesktop()
245
246
  else runTerminal()
246
247
  }
247
248
 
249
+ // node-pty runs spawn-helper from whichever native dir it loaded (build/Release,
250
+ // else prebuilds/<platform>-<arch>). The prebuilt copy ships without the execute
251
+ // bit, so when our postinstall didn't compile build/Release (install scripts
252
+ // blocked, or no Xcode CLT) every spawn fails with "posix_spawnp failed".
253
+ function ensurePtyHelperExecutable() {
254
+ const ptyDir = path.join(ROOT, 'node_modules', 'node-pty')
255
+ const dirs = [path.join(ptyDir, 'build', 'Release')]
256
+ try {
257
+ for (const d of fs.readdirSync(path.join(ptyDir, 'prebuilds'))) {
258
+ if (d.startsWith(`${process.platform}-`)) dirs.push(path.join(ptyDir, 'prebuilds', d))
259
+ }
260
+ } catch { /* no prebuilds */ }
261
+
262
+ for (const dir of dirs) {
263
+ const helper = path.join(dir, 'spawn-helper')
264
+ try {
265
+ if ((fs.statSync(helper).mode & 0o111) === 0) fs.chmodSync(helper, 0o755)
266
+ } catch (err) {
267
+ if (err.code !== 'ENOENT') console.error(`${D}[ctlsurf] could not make ${helper} executable: ${err.message}${R}`)
268
+ }
269
+ }
270
+ }
271
+
248
272
  function runDesktop() {
249
273
  let electronPath
250
274
  try {
@@ -17314,7 +17314,7 @@ var require_package = __commonJS({
17314
17314
  "package.json"(exports, module) {
17315
17315
  module.exports = {
17316
17316
  name: "@phenx-inc/ctlsurf",
17317
- version: "0.17.1",
17317
+ version: "0.17.2",
17318
17318
  description: "Agent-agnostic terminal and desktop app for ctlsurf \u2014 run Claude Code, Codex, or any coding agent with live session logging and remote control",
17319
17319
  main: "out/main/index.js",
17320
17320
  bin: {