agent-neckbeard 1.1.1 → 1.1.2
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/README.md +19 -0
- package/dist/index.cjs +6 -2
- package/dist/index.js +6 -2
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -123,6 +123,25 @@ Some packages can't be bundled because they spawn child processes or have native
|
|
|
123
123
|
|
|
124
124
|
The `run` function gets a context object with an `executionId`, an `AbortSignal`, environment variables, and a logger.
|
|
125
125
|
|
|
126
|
+
## Testing
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npm test
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Jest drives both the fast local suite and the live E2B smoke suite. The live suite automatically skips when `E2B_API_KEY` is not set:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
E2B_API_KEY=your-key npm run test:e2e
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Optional environment variables:
|
|
139
|
+
|
|
140
|
+
- `NECKBEARD_E2E_TEMPLATE` to override the default `code-interpreter-v1` test template
|
|
141
|
+
- `NECKBEARD_E2E_TIMEOUT_MS` to increase the live test timeout for slower environments
|
|
142
|
+
|
|
143
|
+
The GitHub Actions workflow runs `npm test` on every push and pull request, and runs `npm run test:e2e` with the repository `E2B_API_KEY` secret when it is configured.
|
|
144
|
+
|
|
126
145
|
## License
|
|
127
146
|
|
|
128
147
|
MIT
|
package/dist/index.cjs
CHANGED
|
@@ -260,13 +260,17 @@ async function runSandboxCommand(sandbox, cmd, timeoutMs) {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
function getCallerFile() {
|
|
263
|
+
const internalFiles = /* @__PURE__ */ new Set();
|
|
264
|
+
const currentFile = typeof __filename !== "undefined" ? __filename : (0, import_node_url.fileURLToPath)(import_meta.url);
|
|
265
|
+
internalFiles.add(currentFile);
|
|
263
266
|
const stack = new Error().stack?.split("\n") ?? [];
|
|
264
267
|
for (const line of stack.slice(2)) {
|
|
265
268
|
const match = line.match(/\((.+?):\d+:\d+\)/) || line.match(/at (.+?):\d+:\d+/);
|
|
266
269
|
if (match) {
|
|
267
270
|
let file = match[1];
|
|
268
271
|
if (file.startsWith("file://")) file = (0, import_node_url.fileURLToPath)(file);
|
|
269
|
-
if (
|
|
272
|
+
if (internalFiles.has(file)) continue;
|
|
273
|
+
if (!file.includes("node:") && !file.includes("node_modules/agent-neckbeard") && !file.includes("agent-neckbeard/dist")) return file;
|
|
270
274
|
}
|
|
271
275
|
}
|
|
272
276
|
throw new Error("Could not determine source file");
|
|
@@ -378,7 +382,7 @@ var require = __neckbeard_createRequire(import.meta.url);
|
|
|
378
382
|
plugins: [{
|
|
379
383
|
name: "agent-neckbeard-externals",
|
|
380
384
|
setup(build) {
|
|
381
|
-
build.onResolve({ filter: /^
|
|
385
|
+
build.onResolve({ filter: /^agent-neckbeard$/ }, () => ({
|
|
382
386
|
path: "agent-neckbeard",
|
|
383
387
|
namespace: "agent-shim"
|
|
384
388
|
}));
|
package/dist/index.js
CHANGED
|
@@ -219,13 +219,17 @@ async function runSandboxCommand(sandbox, cmd, timeoutMs) {
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
function getCallerFile() {
|
|
222
|
+
const internalFiles = /* @__PURE__ */ new Set();
|
|
223
|
+
const currentFile = typeof __filename !== "undefined" ? __filename : fileURLToPath(import.meta.url);
|
|
224
|
+
internalFiles.add(currentFile);
|
|
222
225
|
const stack = new Error().stack?.split("\n") ?? [];
|
|
223
226
|
for (const line of stack.slice(2)) {
|
|
224
227
|
const match = line.match(/\((.+?):\d+:\d+\)/) || line.match(/at (.+?):\d+:\d+/);
|
|
225
228
|
if (match) {
|
|
226
229
|
let file = match[1];
|
|
227
230
|
if (file.startsWith("file://")) file = fileURLToPath(file);
|
|
228
|
-
if (
|
|
231
|
+
if (internalFiles.has(file)) continue;
|
|
232
|
+
if (!file.includes("node:") && !file.includes("node_modules/agent-neckbeard") && !file.includes("agent-neckbeard/dist")) return file;
|
|
229
233
|
}
|
|
230
234
|
}
|
|
231
235
|
throw new Error("Could not determine source file");
|
|
@@ -337,7 +341,7 @@ var require = __neckbeard_createRequire(import.meta.url);
|
|
|
337
341
|
plugins: [{
|
|
338
342
|
name: "agent-neckbeard-externals",
|
|
339
343
|
setup(build) {
|
|
340
|
-
build.onResolve({ filter: /^
|
|
344
|
+
build.onResolve({ filter: /^agent-neckbeard$/ }, () => ({
|
|
341
345
|
path: "agent-neckbeard",
|
|
342
346
|
namespace: "agent-shim"
|
|
343
347
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-neckbeard",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Deploy AI agents to E2B sandboxes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -28,7 +28,10 @@
|
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsup",
|
|
30
30
|
"dev": "tsup --watch",
|
|
31
|
-
"
|
|
31
|
+
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --config jest.config.mjs",
|
|
32
|
+
"test:watch": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --config jest.config.mjs --watch",
|
|
33
|
+
"test:e2e": "npm run build && node --experimental-vm-modules ./node_modules/jest/bin/jest.js --config jest.e2e.config.mjs --runInBand",
|
|
34
|
+
"typecheck": "tsc --noEmit -p tsconfig.test.json",
|
|
32
35
|
"prepare": "npm run build"
|
|
33
36
|
},
|
|
34
37
|
"dependencies": {
|
|
@@ -48,8 +51,12 @@
|
|
|
48
51
|
}
|
|
49
52
|
},
|
|
50
53
|
"devDependencies": {
|
|
54
|
+
"@types/jest": "^30.0.0",
|
|
51
55
|
"@types/node": "^22.0.0",
|
|
56
|
+
"dotenv": "^17.3.1",
|
|
52
57
|
"e2b": "^2.2.1",
|
|
58
|
+
"jest": "^30.3.0",
|
|
59
|
+
"ts-jest": "^29.4.6",
|
|
53
60
|
"tsup": "^8.3.0",
|
|
54
61
|
"typescript": "^5.6.0"
|
|
55
62
|
},
|