@phenx-inc/ctlsurf 0.17.0 → 0.17.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.
@@ -190,11 +190,14 @@ if (subcommand === 'doctor') {
190
190
  console.log(` ${D}Run: ctlsurf setup${R}`)
191
191
  }
192
192
 
193
- // Desktop
194
- try {
195
- require.resolve('electron')
193
+ // Desktop — check the binary actually resolves, not just that the package
194
+ // exists (a half-extracted electron still passes require.resolve)
195
+ if (electronResolves()) {
196
196
  console.log(` ${G}✓${R} Electron ${D}(desktop mode available)${R}`)
197
- } catch {
197
+ } else if (fs.existsSync(path.join(ROOT, 'node_modules', 'electron'))) {
198
+ console.log(` ${Y}✗${R} Electron ${D}(installed but binary incomplete — desktop mode unavailable)${R}`)
199
+ console.log(` ${D}Repair: cd ${ROOT} && node scripts/extract-electron.js${R}`)
200
+ } else {
198
201
  console.log(` ${D}-${R} Electron ${D}(not installed — desktop mode unavailable)${R}`)
199
202
  console.log(` ${D}Install: cd ${ROOT} && npm install${R}`)
200
203
  }
@@ -297,13 +300,43 @@ function installElectron() {
297
300
  cwd: ROOT,
298
301
  stdio: ['ignore', 'ignore', 'inherit']
299
302
  })
300
- console.log(` ${G}✓${R} Electron installed.\n`)
301
- return true
302
303
  } catch (err) {
303
304
  console.error(`\n${Y}!${R} Electron install failed: ${err.message}`)
304
305
  console.error(` Try manually: cd ${ROOT} && npm install electron\n`)
305
306
  return false
306
307
  }
308
+
309
+ // electron's postinstall can exit 0 with a half-extracted binary (its
310
+ // extract-zip stalls on Node >= 26), and npm won't re-run it for a package
311
+ // that's already present — so unzip it ourselves with the system tool.
312
+ if (!electronResolves()) {
313
+ console.log(` ${D}Electron binary incomplete — extracting with system unzip...${R}`)
314
+ try {
315
+ execFileSync(process.execPath, [path.join(ROOT, 'scripts', 'extract-electron.js')], {
316
+ stdio: ['ignore', 'ignore', 'inherit']
317
+ })
318
+ } catch (err) {
319
+ console.error(`\n${Y}!${R} Electron extract failed: ${err.message}`)
320
+ console.error(` Try manually: cd ${ROOT} && node scripts/extract-electron.js\n`)
321
+ return false
322
+ }
323
+ if (!electronResolves()) {
324
+ console.error(`\n${Y}!${R} Electron binary still missing after extract.\n`)
325
+ return false
326
+ }
327
+ }
328
+
329
+ console.log(` ${G}✓${R} Electron installed.\n`)
330
+ return true
331
+ }
332
+
333
+ function electronResolves() {
334
+ try {
335
+ delete require.cache[require.resolve('electron')]
336
+ return fs.existsSync(require('electron'))
337
+ } catch {
338
+ return false
339
+ }
307
340
  }
308
341
 
309
342
  function runTerminal() {
@@ -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.0",
17317
+ version: "0.17.1",
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: {