agent-web-os 0.3.0-beta.0 → 0.3.0

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
@@ -75252,8 +75252,7 @@ console.error(${JSON.stringify(message)});`;
75252
75252
  // src/almostnode-session.ts
75253
75253
  var almostnode_session_exports = {};
75254
75254
  __export(almostnode_session_exports, {
75255
- AlmostNodeSession: () => AlmostNodeSession,
75256
- createAlmostNodeSession: () => createAlmostNodeSession
75255
+ AlmostNodeSession: () => AlmostNodeSession
75257
75256
  });
75258
75257
  function stripDotSlash(p) {
75259
75258
  return p.startsWith("./") ? p.slice(2) : p;
@@ -75450,9 +75449,6 @@ function removeVirtualPath(vfs2, targetPath) {
75450
75449
  }
75451
75450
  vfs2.rmdirSync(normalizedPath);
75452
75451
  }
75453
- function createAlmostNodeSession(fs2) {
75454
- return new AlmostNodeSession(fs2);
75455
- }
75456
75452
  var ALMOSTNODE_INTERNAL_ROOT, ALMOSTNODE_NODE_VERSION, ALMOSTNODE_NPM_VERSION, NODE_EXEC_PATH, GLOBAL_NODE_MODULES_ROOT, DEFAULT_PATH, NPM_USAGE, STATIC_MIME_TYPES, ESBUILD_WASM_VERSION2, AlmostNodeVirtualFs, AlmostNodeSession;
75457
75453
  var init_almostnode_session = __esm({
75458
75454
  "src/almostnode-session.ts"() {
@@ -77352,8 +77348,7 @@ ${transformed}`;
77352
77348
  // src/pyodide-session.ts
77353
77349
  var pyodide_session_exports = {};
77354
77350
  __export(pyodide_session_exports, {
77355
- PyodideSession: () => PyodideSession,
77356
- createPyodideSession: () => createPyodideSession
77351
+ PyodideSession: () => PyodideSession
77357
77352
  });
77358
77353
  async function syncToEmscriptenFS(srcFs, emFs, srcPath, emPath) {
77359
77354
  try {
@@ -77435,9 +77430,6 @@ function parsePythonArgs(args) {
77435
77430
  }
77436
77431
  return { kind: "run-file", filePath: first };
77437
77432
  }
77438
- function createPyodideSession(fs2) {
77439
- return new PyodideSession(fs2);
77440
- }
77441
77433
  var PYODIDE_VERSION, PYODIDE_CDN_URL, PYTHON_VERSION, PIP_USAGE, PyodideSession;
77442
77434
  var init_pyodide_session = __esm({
77443
77435
  "src/pyodide-session.ts"() {
@@ -77484,16 +77476,6 @@ var init_pyodide_session = __esm({
77484
77476
  })();
77485
77477
  await this.initPromise;
77486
77478
  }
77487
- async syncWorkspaceToEmscriptenFS(cwd) {
77488
- if (!this.pyodide) return;
77489
- const workspaceRoot = this.getWorkspaceRoot(cwd);
77490
- await syncToEmscriptenFS(this.fs, this.pyodide.FS, workspaceRoot, workspaceRoot);
77491
- }
77492
- async syncWorkspaceFromEmscriptenFS(cwd) {
77493
- if (!this.pyodide) return;
77494
- const workspaceRoot = this.getWorkspaceRoot(cwd);
77495
- await syncFromEmscriptenFS(this.pyodide.FS, this.fs, workspaceRoot, workspaceRoot);
77496
- }
77497
77479
  getWorkspaceRoot(cwd) {
77498
77480
  const parts = cwd.split("/").filter(Boolean);
77499
77481
  return parts.length > 0 ? `/${parts[0]}` : "/workspace";
@@ -77520,7 +77502,8 @@ var init_pyodide_session = __esm({
77520
77502
  }
77521
77503
  await this.ensureInitialized();
77522
77504
  const pyodide = this.pyodide;
77523
- this.syncWorkspaceToEmscriptenFS(cwd);
77505
+ const workspaceRoot = this.getWorkspaceRoot(cwd);
77506
+ await syncToEmscriptenFS(this.fs, pyodide.FS, workspaceRoot, workspaceRoot);
77524
77507
  let stdout = "";
77525
77508
  let stderr = "";
77526
77509
  pyodide.setStdout({
@@ -77563,7 +77546,7 @@ os.chdir(${JSON.stringify(cwd)})
77563
77546
  }
77564
77547
  });
77565
77548
  await pyodide.runPythonAsync(code3);
77566
- this.syncWorkspaceFromEmscriptenFS(cwd);
77549
+ await syncFromEmscriptenFS(pyodide.FS, this.fs, workspaceRoot, workspaceRoot);
77567
77550
  return { stdout, stderr, exitCode: 0 };
77568
77551
  } catch (error) {
77569
77552
  const errorMsg = error instanceof Error ? error.message : String(error);
@@ -78542,8 +78525,8 @@ function createBrowserBashSession(options2 = {}) {
78542
78525
  async function getAlmostNodeSession() {
78543
78526
  if (almostNodeSession) return almostNodeSession;
78544
78527
  if (almostNodeSessionPromise) return almostNodeSessionPromise;
78545
- almostNodeSessionPromise = Promise.resolve().then(() => (init_almostnode_session(), almostnode_session_exports)).then(({ createAlmostNodeSession: createAlmostNodeSession2 }) => {
78546
- almostNodeSession = createAlmostNodeSession2(fs2);
78528
+ almostNodeSessionPromise = Promise.resolve().then(() => (init_almostnode_session(), almostnode_session_exports)).then((mod) => {
78529
+ almostNodeSession = new mod.AlmostNodeSession(fs2);
78547
78530
  almostNodeSession.setBinCommandRegistrar((name2, handler) => {
78548
78531
  bash.registerCommand(Dx(name2, handler));
78549
78532
  });
@@ -78555,8 +78538,8 @@ function createBrowserBashSession(options2 = {}) {
78555
78538
  async function getPyodideSession() {
78556
78539
  if (pyodideSession) return pyodideSession;
78557
78540
  if (pyodideSessionPromise) return pyodideSessionPromise;
78558
- pyodideSessionPromise = Promise.resolve().then(() => (init_pyodide_session(), pyodide_session_exports)).then(({ createPyodideSession: createPyodideSession2 }) => {
78559
- pyodideSession = createPyodideSession2(fs2);
78541
+ pyodideSessionPromise = Promise.resolve().then(() => (init_pyodide_session(), pyodide_session_exports)).then((mod) => {
78542
+ pyodideSession = new mod.PyodideSession(fs2);
78560
78543
  if (currentStdoutWriter) pyodideSession.setStdoutWriter(currentStdoutWriter);
78561
78544
  return pyodideSession;
78562
78545
  });
@@ -78667,7 +78650,7 @@ async function executeBrowserBash(session, command, options2 = {}) {
78667
78650
  // src/index.ts
78668
78651
  init_browser();
78669
78652
  init_dist2();
78670
- var AGENT_WEB_OS_VERSION = "0.3.0-beta.0";
78653
+ var AGENT_WEB_OS_VERSION = "0.3.0";
78671
78654
  console.log(`[agent-web-os] v${AGENT_WEB_OS_VERSION}`);
78672
78655
  var getServerBridge2 = getServerBridge;
78673
78656
  var resetServerBridge2 = resetServerBridge;