agent-web-os 0.1.11 → 0.1.12
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 +49 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +49 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -61263,38 +61263,75 @@ 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
61312
|
+
try {
|
|
61287
61313
|
for (const scopedEntry of this._vfs.readdirSync(scopeDir)) {
|
|
61288
|
-
const
|
|
61289
|
-
if (this._vfs.existsSync(
|
|
61290
|
-
walkNodeModules(
|
|
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
|
}
|
|
61296
61328
|
};
|
|
61297
61329
|
walkNodeModules(nodeModulesDir);
|
|
61330
|
+
if (patchCount === 0) {
|
|
61331
|
+
console.warn(`[agent-web-os] lru-cache patch: no lru-cache found in ${nodeModulesDir}`);
|
|
61332
|
+
} else {
|
|
61333
|
+
console.log(`[agent-web-os] lru-cache patch: patched ${patchCount} installation(s) in ${nodeModulesDir}`);
|
|
61334
|
+
}
|
|
61298
61335
|
}
|
|
61299
61336
|
async registerGlobalBinCommands(packageName) {
|
|
61300
61337
|
if (!this.binCommandRegistrar) return;
|
|
@@ -62416,7 +62453,7 @@ async function executeBrowserBash(session, command, options2 = {}) {
|
|
|
62416
62453
|
}
|
|
62417
62454
|
|
|
62418
62455
|
// src/index.ts
|
|
62419
|
-
var AGENT_WEB_OS_VERSION = "0.1.
|
|
62456
|
+
var AGENT_WEB_OS_VERSION = "0.1.12";
|
|
62420
62457
|
console.log(`[agent-web-os] v${AGENT_WEB_OS_VERSION}`);
|
|
62421
62458
|
var getServerBridge2 = getServerBridge;
|
|
62422
62459
|
var resetServerBridge2 = resetServerBridge;
|