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.cjs CHANGED
@@ -61263,33 +61263,65 @@ exports.LRUCache = LRUCache;
61263
61263
  const patchDir = (lruDir) => {
61264
61264
  const cjsPaths = [
61265
61265
  normalizePath(posixPath.join(lruDir, "dist", "commonjs", "index.min.js")),
61266
- normalizePath(posixPath.join(lruDir, "dist", "commonjs", "index.js"))
61266
+ normalizePath(posixPath.join(lruDir, "dist", "commonjs", "index.js")),
61267
+ // Also try the package root index (lru-cache v7 style)
61268
+ normalizePath(posixPath.join(lruDir, "index.js"))
61267
61269
  ];
61270
+ let patched = false;
61268
61271
  for (const p of cjsPaths) {
61269
61272
  if (this._vfs.existsSync(p)) {
61270
61273
  this._vfs.writeFileSync(p, lruCacheShim);
61274
+ patched = true;
61271
61275
  }
61272
61276
  }
61277
+ if (!patched) {
61278
+ const pkgPath = normalizePath(posixPath.join(lruDir, "package.json"));
61279
+ if (this._vfs.existsSync(pkgPath)) {
61280
+ try {
61281
+ const pkg = JSON.parse(this._vfs.readFileSync(pkgPath, "utf8"));
61282
+ const mainField = pkg.main || pkg.exports?.["."]?.require?.default || pkg.exports?.["."]?.require;
61283
+ if (mainField && typeof mainField === "string") {
61284
+ const mainPath = normalizePath(posixPath.join(lruDir, mainField));
61285
+ if (this._vfs.existsSync(mainPath)) {
61286
+ this._vfs.writeFileSync(mainPath, lruCacheShim);
61287
+ patched = true;
61288
+ }
61289
+ }
61290
+ } catch {
61291
+ }
61292
+ }
61293
+ }
61294
+ return patched;
61273
61295
  };
61296
+ let patchCount = 0;
61274
61297
  const walkNodeModules = (nmDir) => {
61275
61298
  if (!this._vfs.existsSync(nmDir)) return;
61276
- for (const entry of this._vfs.readdirSync(nmDir)) {
61299
+ let entries;
61300
+ try {
61301
+ entries = this._vfs.readdirSync(nmDir);
61302
+ } catch {
61303
+ return;
61304
+ }
61305
+ for (const entry of entries) {
61277
61306
  if (entry === "lru-cache") {
61278
- patchDir(normalizePath(posixPath.join(nmDir, "lru-cache")));
61279
- }
61280
- const nestedNm = normalizePath(posixPath.join(nmDir, entry, "node_modules"));
61281
- if (this._vfs.existsSync(nestedNm)) {
61282
- walkNodeModules(nestedNm);
61307
+ const lruDir = normalizePath(posixPath.join(nmDir, "lru-cache"));
61308
+ if (patchDir(lruDir)) patchCount++;
61283
61309
  }
61284
61310
  if (entry.startsWith("@")) {
61285
61311
  const scopeDir = normalizePath(posixPath.join(nmDir, entry));
61286
- if (this._vfs.existsSync(scopeDir)) {
61312
+ try {
61287
61313
  for (const scopedEntry of this._vfs.readdirSync(scopeDir)) {
61288
- const nestedNm2 = normalizePath(posixPath.join(scopeDir, scopedEntry, "node_modules"));
61289
- if (this._vfs.existsSync(nestedNm2)) {
61290
- walkNodeModules(nestedNm2);
61314
+ const nestedNm = normalizePath(posixPath.join(scopeDir, scopedEntry, "node_modules"));
61315
+ if (this._vfs.existsSync(nestedNm)) {
61316
+ walkNodeModules(nestedNm);
61291
61317
  }
61292
61318
  }
61319
+ } catch {
61320
+ }
61321
+ } else {
61322
+ const nestedNm = normalizePath(posixPath.join(nmDir, entry, "node_modules"));
61323
+ if (this._vfs.existsSync(nestedNm)) {
61324
+ walkNodeModules(nestedNm);
61293
61325
  }
61294
61326
  }
61295
61327
  }
@@ -62416,8 +62448,7 @@ async function executeBrowserBash(session, command, options2 = {}) {
62416
62448
  }
62417
62449
 
62418
62450
  // src/index.ts
62419
- var AGENT_WEB_OS_VERSION = "0.1.11";
62420
- console.log(`[agent-web-os] v${AGENT_WEB_OS_VERSION}`);
62451
+ var AGENT_WEB_OS_VERSION = "0.1.13";
62421
62452
  var getServerBridge2 = getServerBridge;
62422
62453
  var resetServerBridge2 = resetServerBridge;
62423
62454
  /*! Bundled license information: