nstantpage-agent 0.5.5 → 0.5.6

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.
@@ -24,7 +24,7 @@ import { getConfig, getProjectConfig, setProjectConfig, clearProjectConfig, getD
24
24
  import { TunnelClient } from '../tunnel.js';
25
25
  import { LocalServer } from '../localServer.js';
26
26
  import { PackageInstaller } from '../packageInstaller.js';
27
- const VERSION = '0.5.5';
27
+ const VERSION = '0.5.6';
28
28
  /**
29
29
  * Resolve the backend API base URL.
30
30
  * - If --backend is passed, use it
@@ -407,15 +407,22 @@ export class LocalServer {
407
407
  let ptyProcess = null;
408
408
  // Prefer node-pty for real PTY (interactive shell, echo, prompt, resize)
409
409
  if (ptyModule) {
410
- ptyProcess = ptyModule.spawn(shellCmd, [], {
411
- name: 'xterm-256color',
412
- cols,
413
- rows,
414
- cwd: this.options.projectDir,
415
- env: shellEnv,
416
- });
410
+ try {
411
+ ptyProcess = ptyModule.spawn(shellCmd, [], {
412
+ name: 'xterm-256color',
413
+ cols,
414
+ rows,
415
+ cwd: this.options.projectDir,
416
+ env: shellEnv,
417
+ });
418
+ }
419
+ catch (ptyErr) {
420
+ console.warn(` [Terminal] node-pty spawn failed: ${ptyErr.message} — falling back to script`);
421
+ ptyProcess = null;
422
+ // Fall through to script/spawn fallbacks below
423
+ }
417
424
  }
418
- else if (process.platform === 'darwin') {
425
+ if (!ptyProcess && !shell && process.platform === 'darwin') {
419
426
  // macOS fallback: use 'script' to allocate a PTY
420
427
  shell = spawn('script', ['-q', '/dev/null', shellCmd], {
421
428
  cwd: this.options.projectDir,
@@ -423,7 +430,7 @@ export class LocalServer {
423
430
  stdio: ['pipe', 'pipe', 'pipe'],
424
431
  });
425
432
  }
426
- else if (process.platform === 'linux') {
433
+ else if (!ptyProcess && !shell && process.platform === 'linux') {
427
434
  // Linux fallback: 'script' with -c flag
428
435
  shell = spawn('script', ['-qc', shellCmd, '/dev/null'], {
429
436
  cwd: this.options.projectDir,
@@ -431,7 +438,7 @@ export class LocalServer {
431
438
  stdio: ['pipe', 'pipe', 'pipe'],
432
439
  });
433
440
  }
434
- else {
441
+ else if (!ptyProcess && !shell) {
435
442
  // Windows / other: raw spawn (limited interactivity)
436
443
  shell = spawn(shellCmd, [], {
437
444
  cwd: this.options.projectDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nstantpage-agent",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "Local development agent for nstantpage.com — run your projects locally, preview in the cloud. Replaces cloud containers for faster builds.",
5
5
  "type": "module",
6
6
  "bin": {