agent-web-os 0.1.12 → 0.1.14

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.
package/dist/index.cjs CHANGED
@@ -60708,6 +60708,9 @@ var AlmostNodeSession = class {
60708
60708
  binCommandRegistrar;
60709
60709
  batchFileLoader;
60710
60710
  stdoutWriter;
60711
+ _stdinHandler = null;
60712
+ _terminalColumns = 80;
60713
+ _terminalRows = 24;
60711
60714
  viteServer;
60712
60715
  vitePort = null;
60713
60716
  vitePreviewUrl = null;
@@ -60727,6 +60730,15 @@ var AlmostNodeSession = class {
60727
60730
  setStdoutWriter(writer) {
60728
60731
  this.stdoutWriter = writer;
60729
60732
  }
60733
+ /** Send data to the stdin of the currently running interactive process. */
60734
+ writeStdin(data2) {
60735
+ this._stdinHandler?.(data2);
60736
+ }
60737
+ /** Update terminal dimensions (used for process.stdout.columns/rows). */
60738
+ setTerminalSize(columns, rows) {
60739
+ this._terminalColumns = columns;
60740
+ this._terminalRows = rows;
60741
+ }
60730
60742
  setVitePreviewListener(listener) {
60731
60743
  this.vitePreviewListener = listener;
60732
60744
  listener?.(this.vitePreviewUrl);
@@ -62042,7 +62054,10 @@ ${packages.map(([name, version4]) => `+-- ${name}@${version4}`).join("\n")}
62042
62054
  const runtime = new Runtime(this.vfs, {
62043
62055
  cwd,
62044
62056
  env: runtimeEnv,
62045
- onStdout: (chunk) => appendChunk(stdoutChunks, chunk),
62057
+ onStdout: (chunk) => {
62058
+ appendChunk(stdoutChunks, chunk);
62059
+ this.stdoutWriter?.(chunk);
62060
+ },
62046
62061
  onStderr: (chunk) => appendChunk(stderrChunks, chunk),
62047
62062
  onConsole: (method, consoleArgs) => {
62048
62063
  const formatted = consoleArgs.map((value) => {
@@ -62065,9 +62080,22 @@ ${packages.map(([name, version4]) => `+-- ${name}@${version4}`).join("\n")}
62065
62080
  return;
62066
62081
  }
62067
62082
  appendChunk(stdoutChunks, chunk);
62083
+ this.stdoutWriter?.(chunk);
62068
62084
  }
62069
62085
  });
62070
62086
  const process4 = runtime.getProcess();
62087
+ process4.stdout.isTTY = true;
62088
+ process4.stderr.isTTY = true;
62089
+ if (process4.stdin) {
62090
+ process4.stdin.isTTY = true;
62091
+ }
62092
+ const stdoutAny = process4.stdout;
62093
+ stdoutAny.columns = this._terminalColumns;
62094
+ stdoutAny.rows = this._terminalRows;
62095
+ stdoutAny.getWindowSize = () => [this._terminalColumns, this._terminalRows];
62096
+ this._stdinHandler = process4.stdin ? (data2) => {
62097
+ process4.stdin.emit("data", data2);
62098
+ } : null;
62071
62099
  const originalExit = process4.exit;
62072
62100
  let exitCalled = false;
62073
62101
  let exitCode = 0;
@@ -62125,7 +62153,8 @@ ${packages.map(([name, version4]) => `+-- ${name}@${version4}`).join("\n")}
62125
62153
  runtime.runFile(invocation.scriptPath);
62126
62154
  }
62127
62155
  syncExecution = false;
62128
- const asyncExitCode = await Promise.race([
62156
+ const isInteractive = process4.stdin && (process4.stdin.listenerCount("data") > 0 || process4.stdin.listenerCount("keypress") > 0);
62157
+ const asyncExitCode = isInteractive ? await exitPromise : await Promise.race([
62129
62158
  exitPromise,
62130
62159
  new Promise((resolve5) => {
62131
62160
  setTimeout(() => resolve5(null), 0);
@@ -62165,6 +62194,7 @@ ${packages.map(([name, version4]) => `+-- ${name}@${version4}`).join("\n")}
62165
62194
  exitCode: 1
62166
62195
  };
62167
62196
  } finally {
62197
+ this._stdinHandler = null;
62168
62198
  if (canListenForUnhandledRejection) {
62169
62199
  globalThis.removeEventListener("unhandledrejection", rejectionHandler);
62170
62200
  }
@@ -62453,7 +62483,7 @@ async function executeBrowserBash(session, command, options2 = {}) {
62453
62483
  }
62454
62484
 
62455
62485
  // src/index.ts
62456
- var AGENT_WEB_OS_VERSION = "0.1.12";
62486
+ var AGENT_WEB_OS_VERSION = "0.1.14";
62457
62487
  console.log(`[agent-web-os] v${AGENT_WEB_OS_VERSION}`);
62458
62488
  var getServerBridge2 = getServerBridge;
62459
62489
  var resetServerBridge2 = resetServerBridge;