agent-web-os 0.1.13 → 0.1.15

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);
@@ -61327,6 +61339,11 @@ exports.LRUCache = LRUCache;
61327
61339
  }
61328
61340
  };
61329
61341
  walkNodeModules(nodeModulesDir);
61342
+ if (patchCount === 0) {
61343
+ console.warn(`[agent-web-os] lru-cache patch: no lru-cache found in ${nodeModulesDir}`);
61344
+ } else {
61345
+ console.log(`[agent-web-os] lru-cache patch: patched ${patchCount} installation(s) in ${nodeModulesDir}`);
61346
+ }
61330
61347
  }
61331
61348
  async registerGlobalBinCommands(packageName) {
61332
61349
  if (!this.binCommandRegistrar) return;
@@ -62037,7 +62054,10 @@ ${packages.map(([name, version4]) => `+-- ${name}@${version4}`).join("\n")}
62037
62054
  const runtime = new Runtime(this.vfs, {
62038
62055
  cwd,
62039
62056
  env: runtimeEnv,
62040
- onStdout: (chunk) => appendChunk(stdoutChunks, chunk),
62057
+ onStdout: (chunk) => {
62058
+ appendChunk(stdoutChunks, chunk);
62059
+ this.stdoutWriter?.(chunk);
62060
+ },
62041
62061
  onStderr: (chunk) => appendChunk(stderrChunks, chunk),
62042
62062
  onConsole: (method, consoleArgs) => {
62043
62063
  const formatted = consoleArgs.map((value) => {
@@ -62060,9 +62080,22 @@ ${packages.map(([name, version4]) => `+-- ${name}@${version4}`).join("\n")}
62060
62080
  return;
62061
62081
  }
62062
62082
  appendChunk(stdoutChunks, chunk);
62083
+ this.stdoutWriter?.(chunk);
62063
62084
  }
62064
62085
  });
62065
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;
62066
62099
  const originalExit = process4.exit;
62067
62100
  let exitCalled = false;
62068
62101
  let exitCode = 0;
@@ -62120,7 +62153,8 @@ ${packages.map(([name, version4]) => `+-- ${name}@${version4}`).join("\n")}
62120
62153
  runtime.runFile(invocation.scriptPath);
62121
62154
  }
62122
62155
  syncExecution = false;
62123
- 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([
62124
62158
  exitPromise,
62125
62159
  new Promise((resolve5) => {
62126
62160
  setTimeout(() => resolve5(null), 0);
@@ -62160,6 +62194,7 @@ ${packages.map(([name, version4]) => `+-- ${name}@${version4}`).join("\n")}
62160
62194
  exitCode: 1
62161
62195
  };
62162
62196
  } finally {
62197
+ this._stdinHandler = null;
62163
62198
  if (canListenForUnhandledRejection) {
62164
62199
  globalThis.removeEventListener("unhandledrejection", rejectionHandler);
62165
62200
  }
@@ -62318,7 +62353,8 @@ var DEFAULT_BASH_SHELL_ENV = {
62318
62353
  LANG: "C.UTF-8",
62319
62354
  LC_ALL: "C.UTF-8",
62320
62355
  PYTHONIOENCODING: "utf-8",
62321
- PYTHONUTF8: "1"
62356
+ PYTHONUTF8: "1",
62357
+ PI_OFFLINE: "1"
62322
62358
  };
62323
62359
  var DEFAULT_BASH_COMMAND_TIMEOUT_MS = 5 * 60 * 1e3;
62324
62360
  var DEFAULT_BASH_OUTPUT_LIMIT = 1e4;
@@ -62353,6 +62389,10 @@ function createBrowserBashSession(options2 = {}) {
62353
62389
  const env = options2.env ?? { ...DEFAULT_BASH_SHELL_ENV };
62354
62390
  const fs = new ObservableInMemoryFs(options2.fsOptions);
62355
62391
  fs.mkdirSync(rootPath, { recursive: true });
62392
+ const piBinDir = "/home/user/.pi/agent/bin";
62393
+ fs.mkdirSync(piBinDir, { recursive: true });
62394
+ fs.writeFileSync(`${piBinDir}/rg`, '#!/bin/sh\nrg "$@"\n');
62395
+ fs.writeFileSync(`${piBinDir}/fd`, '#!/bin/sh\nfd "$@"\n');
62356
62396
  const almostNodeSession = createAlmostNodeSession(fs);
62357
62397
  const bash = new Ju({
62358
62398
  cwd: rootPath,
@@ -62448,7 +62488,8 @@ async function executeBrowserBash(session, command, options2 = {}) {
62448
62488
  }
62449
62489
 
62450
62490
  // src/index.ts
62451
- var AGENT_WEB_OS_VERSION = "0.1.13";
62491
+ var AGENT_WEB_OS_VERSION = "0.1.15";
62492
+ console.log(`[agent-web-os] v${AGENT_WEB_OS_VERSION}`);
62452
62493
  var getServerBridge2 = getServerBridge;
62453
62494
  var resetServerBridge2 = resetServerBridge;
62454
62495
  /*! Bundled license information: