agent-neckbeard 1.0.8 → 1.0.10
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.
Potentially problematic release.
This version of agent-neckbeard might be problematic. Click here for more details.
- package/dist/index.cjs +8 -2
- package/dist/index.js +16 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -348,7 +348,13 @@ try {
|
|
|
348
348
|
if (collectedExternals.size > 0) {
|
|
349
349
|
const dependencies = {};
|
|
350
350
|
for (const pkg of collectedExternals) {
|
|
351
|
-
|
|
351
|
+
try {
|
|
352
|
+
const pkgJsonPath = require.resolve(`${pkg}/package.json`, { paths: [(0, import_node_path.dirname)(this._sourceFile)] });
|
|
353
|
+
const pkgJson2 = JSON.parse((0, import_node_fs.readFileSync)(pkgJsonPath, "utf-8"));
|
|
354
|
+
dependencies[pkg] = pkgJson2.version;
|
|
355
|
+
} catch {
|
|
356
|
+
dependencies[pkg] = "*";
|
|
357
|
+
}
|
|
352
358
|
}
|
|
353
359
|
const pkgJson = JSON.stringify({
|
|
354
360
|
name: "agent-sandbox",
|
|
@@ -356,7 +362,7 @@ try {
|
|
|
356
362
|
dependencies
|
|
357
363
|
});
|
|
358
364
|
await sandbox.files.write(SANDBOX_PATHS.packageJson, pkgJson);
|
|
359
|
-
const installResult = await sandbox.commands.run(`cd ${SANDBOX_HOME} && npm install`, { timeoutMs: SANDBOX_COMMAND_TIMEOUT_MS });
|
|
365
|
+
const installResult = await sandbox.commands.run(`cd ${SANDBOX_HOME} && npm install --ignore-optional`, { timeoutMs: SANDBOX_COMMAND_TIMEOUT_MS });
|
|
360
366
|
if (installResult.exitCode !== 0) {
|
|
361
367
|
throw new DeploymentError(`Failed to install external packages: ${installResult.stderr}`);
|
|
362
368
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
1
8
|
// src/index.ts
|
|
2
9
|
import { fileURLToPath } from "url";
|
|
3
10
|
import { readdirSync, readFileSync, statSync } from "fs";
|
|
4
|
-
import { join, relative } from "path";
|
|
11
|
+
import { join, relative, dirname } from "path";
|
|
5
12
|
var getEsbuild = () => import("esbuild");
|
|
6
13
|
var getE2b = () => import("e2b");
|
|
7
14
|
var DEFAULT_MAX_DURATION = 300;
|
|
@@ -308,7 +315,13 @@ try {
|
|
|
308
315
|
if (collectedExternals.size > 0) {
|
|
309
316
|
const dependencies = {};
|
|
310
317
|
for (const pkg of collectedExternals) {
|
|
311
|
-
|
|
318
|
+
try {
|
|
319
|
+
const pkgJsonPath = __require.resolve(`${pkg}/package.json`, { paths: [dirname(this._sourceFile)] });
|
|
320
|
+
const pkgJson2 = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
|
|
321
|
+
dependencies[pkg] = pkgJson2.version;
|
|
322
|
+
} catch {
|
|
323
|
+
dependencies[pkg] = "*";
|
|
324
|
+
}
|
|
312
325
|
}
|
|
313
326
|
const pkgJson = JSON.stringify({
|
|
314
327
|
name: "agent-sandbox",
|
|
@@ -316,7 +329,7 @@ try {
|
|
|
316
329
|
dependencies
|
|
317
330
|
});
|
|
318
331
|
await sandbox.files.write(SANDBOX_PATHS.packageJson, pkgJson);
|
|
319
|
-
const installResult = await sandbox.commands.run(`cd ${SANDBOX_HOME} && npm install`, { timeoutMs: SANDBOX_COMMAND_TIMEOUT_MS });
|
|
332
|
+
const installResult = await sandbox.commands.run(`cd ${SANDBOX_HOME} && npm install --ignore-optional`, { timeoutMs: SANDBOX_COMMAND_TIMEOUT_MS });
|
|
320
333
|
if (installResult.exitCode !== 0) {
|
|
321
334
|
throw new DeploymentError(`Failed to install external packages: ${installResult.stderr}`);
|
|
322
335
|
}
|