@tiflis-io/tiflis-code-workstation 0.3.26 → 0.3.28

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 (2) hide show
  1. package/dist/main.js +21 -20
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1610,9 +1610,7 @@ var TunnelClient = class {
1610
1610
  this.handleRegistrationTimeout();
1611
1611
  }
1612
1612
  }, CONNECTION_TIMING.REGISTRATION_TIMEOUT_MS);
1613
- if (this.registrationTimeout.unref) {
1614
- this.registrationTimeout.unref();
1615
- }
1613
+ this.registrationTimeout.unref();
1616
1614
  }
1617
1615
  /**
1618
1616
  * Handles registration timeout.
@@ -1736,9 +1734,7 @@ var TunnelClient = class {
1736
1734
  this.sendToTunnel(ping);
1737
1735
  }
1738
1736
  }, CONNECTION_TIMING.PING_INTERVAL_MS);
1739
- if (this.pingInterval.unref) {
1740
- this.pingInterval.unref();
1741
- }
1737
+ this.pingInterval.unref();
1742
1738
  }
1743
1739
  /**
1744
1740
  * Schedules a reconnection attempt.
@@ -1759,9 +1755,7 @@ var TunnelClient = class {
1759
1755
  this.scheduleReconnect();
1760
1756
  });
1761
1757
  }, delay);
1762
- if (this.reconnectTimeout.unref) {
1763
- this.reconnectTimeout.unref();
1764
- }
1758
+ this.reconnectTimeout.unref();
1765
1759
  }
1766
1760
  /**
1767
1761
  * Flushes buffered messages after reconnection.
@@ -2965,9 +2959,7 @@ var TerminalOutputBatcher = class {
2965
2959
  if (this.timeout === null) {
2966
2960
  const adaptiveInterval = this.outputRate > 1e3 ? this.batchIntervalMs : Math.min(8, this.batchIntervalMs);
2967
2961
  this.timeout = setTimeout(() => this.flush(), adaptiveInterval);
2968
- if (this.timeout.unref) {
2969
- this.timeout.unref();
2970
- }
2962
+ this.timeout.unref();
2971
2963
  }
2972
2964
  }
2973
2965
  /**
@@ -3046,8 +3038,19 @@ var HeadlessAgentExecutor = class extends EventEmitter {
3046
3038
  const aliasEnvVars = this.getAliasEnvVars();
3047
3039
  const shellEnv = getShellEnv();
3048
3040
  const isUnix = platform() !== "win32";
3049
- const spawnCommand = isUnix ? "setsid" : command;
3050
- const spawnArgs = isUnix ? [command, ...args] : args;
3041
+ let spawnCommand;
3042
+ let spawnArgs;
3043
+ if (isUnix) {
3044
+ const quotedArgs = args.map((arg) => {
3045
+ return `'${arg.replace(/'/g, "'\\''")}'`;
3046
+ });
3047
+ const fullCommand = `${command} ${quotedArgs.join(" ")}`;
3048
+ spawnCommand = "sh";
3049
+ spawnArgs = ["-c", fullCommand];
3050
+ } else {
3051
+ spawnCommand = command;
3052
+ spawnArgs = args;
3053
+ }
3051
3054
  this.subprocess = spawn2(spawnCommand, spawnArgs, {
3052
3055
  cwd: this.workingDir,
3053
3056
  env: {
@@ -3064,7 +3067,7 @@ var HeadlessAgentExecutor = class extends EventEmitter {
3064
3067
  detached: true,
3065
3068
  // Create new process group for clean termination
3066
3069
  // Ensure child doesn't interfere with parent's signal handling
3067
- // @ts-ignore - Node.js 16+ option
3070
+ // @ts-expect-error - Node.js 16+ option
3068
3071
  ignoreParentSignals: true
3069
3072
  });
3070
3073
  this.subprocess.stdout?.on("data", (data) => {
@@ -9226,7 +9229,7 @@ async function bootstrap() {
9226
9229
  }
9227
9230
  shutdownInProgress = true;
9228
9231
  logger.info({ signal, count: signalCount }, "Signal received");
9229
- console.log("\nShutting down...");
9232
+ logger.info("Shutting down...");
9230
9233
  shutdown2(signal).catch((error) => {
9231
9234
  logger.error({ error }, "Shutdown error");
9232
9235
  }).finally(() => {
@@ -11377,10 +11380,8 @@ async function bootstrap() {
11377
11380
  };
11378
11381
  registerSignalHandlers(shutdown);
11379
11382
  }
11380
- if (process.stdin && !process.stdin.destroyed) {
11381
- if (process.stdin.isPaused?.()) {
11382
- process.stdin.resume();
11383
- }
11383
+ if (process.stdin.isPaused()) {
11384
+ process.stdin.resume();
11384
11385
  }
11385
11386
  bootstrap().catch((error) => {
11386
11387
  console.error("Failed to bootstrap:", error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiflis-io/tiflis-code-workstation",
3
- "version": "0.3.26",
3
+ "version": "0.3.28",
4
4
  "description": "Workstation server for tiflis-code - manages agent sessions and terminal access",
5
5
  "author": "Roman Barinov <rbarinov@gmail.com>",
6
6
  "license": "FSL-1.1-NC",