agent-web-os 0.1.11 → 0.1.13

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.d.cts CHANGED
@@ -251,7 +251,7 @@ declare function createBrowserBashSession(options?: BrowserBashSessionOptions):
251
251
  /** Execute a bash command and return a ToolResult */
252
252
  declare function executeBrowserBash(session: BrowserBashSession, command: string, options?: ExecuteBrowserBashOptions): Promise<ToolResult>;
253
253
 
254
- declare const AGENT_WEB_OS_VERSION = "0.1.11";
254
+ declare const AGENT_WEB_OS_VERSION = "0.1.13";
255
255
 
256
256
  type ServerBridge = {
257
257
  initServiceWorker(): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -251,7 +251,7 @@ declare function createBrowserBashSession(options?: BrowserBashSessionOptions):
251
251
  /** Execute a bash command and return a ToolResult */
252
252
  declare function executeBrowserBash(session: BrowserBashSession, command: string, options?: ExecuteBrowserBashOptions): Promise<ToolResult>;
253
253
 
254
- declare const AGENT_WEB_OS_VERSION = "0.1.11";
254
+ declare const AGENT_WEB_OS_VERSION = "0.1.13";
255
255
 
256
256
  type ServerBridge = {
257
257
  initServiceWorker(): Promise<void>;
package/dist/index.js CHANGED
@@ -55445,33 +55445,65 @@ exports.LRUCache = LRUCache;
55445
55445
  const patchDir = (lruDir) => {
55446
55446
  const cjsPaths = [
55447
55447
  normalizePath(posixPath.join(lruDir, "dist", "commonjs", "index.min.js")),
55448
- normalizePath(posixPath.join(lruDir, "dist", "commonjs", "index.js"))
55448
+ normalizePath(posixPath.join(lruDir, "dist", "commonjs", "index.js")),
55449
+ // Also try the package root index (lru-cache v7 style)
55450
+ normalizePath(posixPath.join(lruDir, "index.js"))
55449
55451
  ];
55452
+ let patched = false;
55450
55453
  for (const p of cjsPaths) {
55451
55454
  if (this._vfs.existsSync(p)) {
55452
55455
  this._vfs.writeFileSync(p, lruCacheShim);
55456
+ patched = true;
55453
55457
  }
55454
55458
  }
55459
+ if (!patched) {
55460
+ const pkgPath = normalizePath(posixPath.join(lruDir, "package.json"));
55461
+ if (this._vfs.existsSync(pkgPath)) {
55462
+ try {
55463
+ const pkg = JSON.parse(this._vfs.readFileSync(pkgPath, "utf8"));
55464
+ const mainField = pkg.main || pkg.exports?.["."]?.require?.default || pkg.exports?.["."]?.require;
55465
+ if (mainField && typeof mainField === "string") {
55466
+ const mainPath = normalizePath(posixPath.join(lruDir, mainField));
55467
+ if (this._vfs.existsSync(mainPath)) {
55468
+ this._vfs.writeFileSync(mainPath, lruCacheShim);
55469
+ patched = true;
55470
+ }
55471
+ }
55472
+ } catch {
55473
+ }
55474
+ }
55475
+ }
55476
+ return patched;
55455
55477
  };
55478
+ let patchCount = 0;
55456
55479
  const walkNodeModules = (nmDir) => {
55457
55480
  if (!this._vfs.existsSync(nmDir)) return;
55458
- for (const entry of this._vfs.readdirSync(nmDir)) {
55481
+ let entries;
55482
+ try {
55483
+ entries = this._vfs.readdirSync(nmDir);
55484
+ } catch {
55485
+ return;
55486
+ }
55487
+ for (const entry of entries) {
55459
55488
  if (entry === "lru-cache") {
55460
- patchDir(normalizePath(posixPath.join(nmDir, "lru-cache")));
55461
- }
55462
- const nestedNm = normalizePath(posixPath.join(nmDir, entry, "node_modules"));
55463
- if (this._vfs.existsSync(nestedNm)) {
55464
- walkNodeModules(nestedNm);
55489
+ const lruDir = normalizePath(posixPath.join(nmDir, "lru-cache"));
55490
+ if (patchDir(lruDir)) patchCount++;
55465
55491
  }
55466
55492
  if (entry.startsWith("@")) {
55467
55493
  const scopeDir = normalizePath(posixPath.join(nmDir, entry));
55468
- if (this._vfs.existsSync(scopeDir)) {
55494
+ try {
55469
55495
  for (const scopedEntry of this._vfs.readdirSync(scopeDir)) {
55470
- const nestedNm2 = normalizePath(posixPath.join(scopeDir, scopedEntry, "node_modules"));
55471
- if (this._vfs.existsSync(nestedNm2)) {
55472
- walkNodeModules(nestedNm2);
55496
+ const nestedNm = normalizePath(posixPath.join(scopeDir, scopedEntry, "node_modules"));
55497
+ if (this._vfs.existsSync(nestedNm)) {
55498
+ walkNodeModules(nestedNm);
55473
55499
  }
55474
55500
  }
55501
+ } catch {
55502
+ }
55503
+ } else {
55504
+ const nestedNm = normalizePath(posixPath.join(nmDir, entry, "node_modules"));
55505
+ if (this._vfs.existsSync(nestedNm)) {
55506
+ walkNodeModules(nestedNm);
55475
55507
  }
55476
55508
  }
55477
55509
  }
@@ -56598,8 +56630,7 @@ async function executeBrowserBash(session, command, options2 = {}) {
56598
56630
  }
56599
56631
 
56600
56632
  // src/index.ts
56601
- var AGENT_WEB_OS_VERSION = "0.1.11";
56602
- console.log(`[agent-web-os] v${AGENT_WEB_OS_VERSION}`);
56633
+ var AGENT_WEB_OS_VERSION = "0.1.13";
56603
56634
  var getServerBridge2 = getServerBridge;
56604
56635
  var resetServerBridge2 = resetServerBridge;
56605
56636
  export {