agent-neckbeard 1.0.0 → 1.0.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.

Potentially problematic release.


This version of agent-neckbeard might be problematic. Click here for more details.

package/README.md CHANGED
@@ -87,6 +87,7 @@ new Agent({
87
87
  commands?: string[],
88
88
  },
89
89
  files?: [{ url, path }], // pre-download into sandbox
90
+ claudeDir?: string, // upload .claude/ skills directory
90
91
  })
91
92
  ```
92
93
 
@@ -94,6 +95,8 @@ If you already have a sandbox deployed, pass `sandboxId` and skip `deploy()`.
94
95
 
95
96
  The `files` option downloads things into the sandbox before your agent runs—useful for models or config files. Relative paths resolve from `/home/user/`.
96
97
 
98
+ The `claudeDir` option uploads a local `.claude/` directory to the sandbox, enabling Claude Agent SDK skills. Point it at a directory containing `.claude/skills/*/SKILL.md` files.
99
+
97
100
  Some packages can't be bundled because they spawn child processes or have native modules. The Claude Agent SDK is like this. These get automatically marked as external and installed via npm in the sandbox.
98
101
 
99
102
  The `run` function gets a context object with an `executionId`, an `AbortSignal`, environment variables, and a logger.
package/dist/index.cjs ADDED
@@ -0,0 +1,304 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ Agent: () => Agent,
34
+ DEFAULT_DEPENDENCIES: () => DEFAULT_DEPENDENCIES
35
+ });
36
+ module.exports = __toCommonJS(index_exports);
37
+ var import_node_url = require("url");
38
+ var import_node_fs = require("fs");
39
+ var import_node_path = require("path");
40
+ var getEsbuild = () => import("esbuild");
41
+ var getE2b = () => import("e2b");
42
+ var DEFAULT_DEPENDENCIES = {};
43
+ function getCallerFile() {
44
+ const stack = new Error().stack?.split("\n") ?? [];
45
+ for (const line of stack.slice(2)) {
46
+ const match = line.match(/\((.+?):\d+:\d+\)/) || line.match(/at (.+?):\d+:\d+/);
47
+ if (match) {
48
+ let file = match[1];
49
+ if (file.startsWith("file://")) file = (0, import_node_url.fileURLToPath)(file);
50
+ if (!file.includes("node:") && !file.includes("node_modules/agent-neckbeard") && !file.includes("agent-neckbeard/dist")) return file;
51
+ }
52
+ }
53
+ throw new Error("Could not determine source file");
54
+ }
55
+ function readDirectoryRecursively(dirPath) {
56
+ const files = [];
57
+ function walkDir(currentPath) {
58
+ const entries = (0, import_node_fs.readdirSync)(currentPath);
59
+ for (const entry of entries) {
60
+ const fullPath = (0, import_node_path.join)(currentPath, entry);
61
+ const stat = (0, import_node_fs.statSync)(fullPath);
62
+ if (stat.isDirectory()) {
63
+ walkDir(fullPath);
64
+ } else if (stat.isFile()) {
65
+ const relPath = (0, import_node_path.relative)(dirPath, fullPath);
66
+ const isBinary = /\.(png|jpg|jpeg|gif|ico|pdf|zip|tar|gz|bin|exe|dll|so|dylib|wasm)$/i.test(entry);
67
+ if (isBinary) {
68
+ const buffer = (0, import_node_fs.readFileSync)(fullPath);
69
+ const arrayBuffer = buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
70
+ files.push({ relativePath: relPath, content: arrayBuffer });
71
+ } else {
72
+ files.push({ relativePath: relPath, content: (0, import_node_fs.readFileSync)(fullPath, "utf-8") });
73
+ }
74
+ }
75
+ }
76
+ }
77
+ walkDir(dirPath);
78
+ return files;
79
+ }
80
+ var Agent = class {
81
+ id;
82
+ inputSchema;
83
+ outputSchema;
84
+ maxDuration;
85
+ dependencies;
86
+ files;
87
+ claudeDir;
88
+ /** @internal Used by the sandbox runner - must be public for bundled code access */
89
+ _run;
90
+ _sourceFile;
91
+ _sandboxId;
92
+ constructor(config) {
93
+ this.id = config.id;
94
+ this.inputSchema = config.inputSchema;
95
+ this.outputSchema = config.outputSchema;
96
+ this.maxDuration = config.maxDuration ?? 300;
97
+ this._run = config.run;
98
+ this._sourceFile = getCallerFile();
99
+ this._sandboxId = config.sandboxId;
100
+ this.dependencies = config.dependencies ?? DEFAULT_DEPENDENCIES;
101
+ this.files = config.files ?? [];
102
+ this.claudeDir = config.claudeDir;
103
+ }
104
+ get sandboxId() {
105
+ return this._sandboxId;
106
+ }
107
+ async deploy() {
108
+ if (this._sandboxId) return;
109
+ const esbuild = await getEsbuild();
110
+ const { Sandbox } = await getE2b();
111
+ const collectedExternals = /* @__PURE__ */ new Set();
112
+ const mustBeExternal = [
113
+ /^@anthropic-ai\/claude-agent-sdk/
114
+ // Spawns cli.js as child process
115
+ ];
116
+ const result = await esbuild.build({
117
+ entryPoints: [this._sourceFile],
118
+ bundle: true,
119
+ platform: "node",
120
+ target: "node20",
121
+ format: "esm",
122
+ write: false,
123
+ minify: true,
124
+ keepNames: true,
125
+ treeShaking: false,
126
+ // Preserve exports for the sandbox runner to import
127
+ plugins: [{
128
+ name: "agent-neckbeard-externals",
129
+ setup(build) {
130
+ build.onResolve({ filter: /^agent-neckbeard$/ }, () => ({
131
+ path: "agent-neckbeard",
132
+ namespace: "agent-shim"
133
+ }));
134
+ build.onLoad({ filter: /.*/, namespace: "agent-shim" }, () => ({
135
+ contents: `
136
+ export class Agent {
137
+ constructor(config) {
138
+ this.id = config.id;
139
+ this.inputSchema = config.inputSchema;
140
+ this.outputSchema = config.outputSchema;
141
+ this.maxDuration = config.maxDuration ?? 300;
142
+ this._run = config.run;
143
+ }
144
+ }
145
+ `,
146
+ loader: "js"
147
+ }));
148
+ build.onResolve({ filter: /.*/ }, (args) => {
149
+ if (args.path.startsWith(".") || args.path.startsWith("/") || args.path.startsWith("node:")) {
150
+ return null;
151
+ }
152
+ for (const pattern of mustBeExternal) {
153
+ if (pattern.test(args.path)) {
154
+ const match = args.path.match(/^(@[^/]+\/[^/]+|[^/]+)/);
155
+ if (match) {
156
+ collectedExternals.add(match[1]);
157
+ }
158
+ return { external: true };
159
+ }
160
+ }
161
+ return null;
162
+ });
163
+ }
164
+ }]
165
+ });
166
+ const runnerCode = `
167
+ import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
168
+
169
+ mkdirSync('/home/user/input', { recursive: true });
170
+ mkdirSync('/home/user/output', { recursive: true });
171
+
172
+ const { input, executionId } = JSON.parse(readFileSync('/home/user/input/task.json', 'utf-8'));
173
+
174
+ const ctx = {
175
+ executionId,
176
+ signal: AbortSignal.timeout(${this.maxDuration * 1e3}),
177
+ env: process.env,
178
+ logger: {
179
+ debug: (msg, ...args) => console.log('[DEBUG]', msg, ...args),
180
+ info: (msg, ...args) => console.log('[INFO]', msg, ...args),
181
+ warn: (msg, ...args) => console.warn('[WARN]', msg, ...args),
182
+ error: (msg, ...args) => console.error('[ERROR]', msg, ...args),
183
+ },
184
+ };
185
+
186
+ const mod = await import('./agent.mjs');
187
+ const agent = mod.default || Object.values(mod).find(v => v instanceof Object && v.id);
188
+
189
+ try {
190
+ const validated = agent.inputSchema.parse(input);
191
+ const output = await agent._run(validated, ctx);
192
+ const validatedOutput = agent.outputSchema.parse(output);
193
+ writeFileSync('/home/user/output/result.json', JSON.stringify({ success: true, output: validatedOutput }));
194
+ } catch (error) {
195
+ writeFileSync('/home/user/output/result.json', JSON.stringify({ success: false, error: { message: error.message, stack: error.stack } }));
196
+ }
197
+ `;
198
+ const sandbox = await Sandbox.create("base", {
199
+ apiKey: process.env.E2B_API_KEY
200
+ });
201
+ const { apt, commands } = this.dependencies;
202
+ if (apt && apt.length > 0) {
203
+ const aptCmd = `apt-get update && apt-get install -y ${apt.join(" ")}`;
204
+ const aptResult = await sandbox.commands.run(aptCmd, { timeoutMs: 3e5 });
205
+ if (aptResult.exitCode !== 0) {
206
+ throw new Error(`Failed to install apt packages: ${aptResult.stderr}`);
207
+ }
208
+ }
209
+ if (commands && commands.length > 0) {
210
+ for (const cmd of commands) {
211
+ const cmdResult = await sandbox.commands.run(cmd, { timeoutMs: 3e5 });
212
+ if (cmdResult.exitCode !== 0) {
213
+ throw new Error(`Failed to run command "${cmd}": ${cmdResult.stderr}`);
214
+ }
215
+ }
216
+ }
217
+ if (this.files.length > 0) {
218
+ for (const file of this.files) {
219
+ const destPath = file.path.startsWith("/") ? file.path : `/home/user/${file.path}`;
220
+ const parentDir = destPath.substring(0, destPath.lastIndexOf("/"));
221
+ if (parentDir) {
222
+ await sandbox.commands.run(`mkdir -p "${parentDir}"`, { timeoutMs: 3e4 });
223
+ }
224
+ const curlCmd = `curl -fsSL -o "${destPath}" "${file.url}"`;
225
+ const downloadResult = await sandbox.commands.run(curlCmd, { timeoutMs: 3e5 });
226
+ if (downloadResult.exitCode !== 0) {
227
+ throw new Error(`Failed to download file from ${file.url} to ${destPath}: ${downloadResult.stderr}`);
228
+ }
229
+ }
230
+ }
231
+ if (this.claudeDir) {
232
+ const claudeFiles = readDirectoryRecursively(this.claudeDir);
233
+ await sandbox.commands.run("mkdir -p /home/user/.claude", { timeoutMs: 3e4 });
234
+ for (const file of claudeFiles) {
235
+ const destPath = `/home/user/.claude/${file.relativePath}`;
236
+ const parentDir = destPath.substring(0, destPath.lastIndexOf("/"));
237
+ if (parentDir && parentDir !== "/home/user/.claude") {
238
+ await sandbox.commands.run(`mkdir -p "${parentDir}"`, { timeoutMs: 3e4 });
239
+ }
240
+ await sandbox.files.write(destPath, file.content);
241
+ }
242
+ }
243
+ await sandbox.files.write("/home/user/agent.mjs", result.outputFiles[0].text);
244
+ await sandbox.files.write("/home/user/runner.mjs", runnerCode);
245
+ if (collectedExternals.size > 0) {
246
+ const dependencies = {};
247
+ for (const pkg of collectedExternals) {
248
+ dependencies[pkg] = "*";
249
+ }
250
+ const pkgJson = JSON.stringify({
251
+ name: "agent-sandbox",
252
+ type: "module",
253
+ dependencies
254
+ });
255
+ await sandbox.files.write("/home/user/package.json", pkgJson);
256
+ const installResult = await sandbox.commands.run("cd /home/user && npm install", { timeoutMs: 3e5 });
257
+ if (installResult.exitCode !== 0) {
258
+ throw new Error(`Failed to install external packages: ${installResult.stderr}`);
259
+ }
260
+ }
261
+ this._sandboxId = sandbox.sandboxId;
262
+ }
263
+ async run(input) {
264
+ const executionId = `exec_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
265
+ if (!this._sandboxId) {
266
+ return {
267
+ ok: false,
268
+ executionId,
269
+ error: new Error("Agent not deployed. Call agent.deploy() first or pass sandboxId to constructor.")
270
+ };
271
+ }
272
+ try {
273
+ const { Sandbox } = await getE2b();
274
+ const validatedInput = this.inputSchema.parse(input);
275
+ const sandbox = await Sandbox.connect(this._sandboxId, {
276
+ apiKey: process.env.E2B_API_KEY
277
+ });
278
+ await sandbox.files.write("/home/user/input/task.json", JSON.stringify({ input: validatedInput, executionId }));
279
+ const result = await sandbox.commands.run("node /home/user/runner.mjs", {
280
+ timeoutMs: this.maxDuration * 1e3,
281
+ envs: {
282
+ ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY ?? ""
283
+ }
284
+ });
285
+ if (result.exitCode !== 0) {
286
+ return { ok: false, executionId, error: new Error(`Agent failed: ${result.stderr}`) };
287
+ }
288
+ const output = JSON.parse(await sandbox.files.read("/home/user/output/result.json"));
289
+ if (!output.success) {
290
+ const err = new Error(output.error.message);
291
+ err.stack = output.error.stack;
292
+ return { ok: false, executionId, error: err };
293
+ }
294
+ return { ok: true, executionId, output: this.outputSchema.parse(output.output) };
295
+ } catch (err) {
296
+ return { ok: false, executionId, error: err instanceof Error ? err : new Error(String(err)) };
297
+ }
298
+ }
299
+ };
300
+ // Annotate the CommonJS export names for ESM import in node:
301
+ 0 && (module.exports = {
302
+ Agent,
303
+ DEFAULT_DEPENDENCIES
304
+ });
@@ -0,0 +1,98 @@
1
+ /**
2
+ * agent-neckbeard - Deploy AI agents to E2B sandboxes
3
+ */
4
+ interface AgentRunContext {
5
+ executionId: string;
6
+ signal: AbortSignal;
7
+ env: Record<string, string>;
8
+ logger: {
9
+ debug: (message: string, ...args: unknown[]) => void;
10
+ info: (message: string, ...args: unknown[]) => void;
11
+ warn: (message: string, ...args: unknown[]) => void;
12
+ error: (message: string, ...args: unknown[]) => void;
13
+ };
14
+ }
15
+ type AgentRunResult<TOutput> = {
16
+ ok: true;
17
+ executionId: string;
18
+ output: TOutput;
19
+ } | {
20
+ ok: false;
21
+ executionId: string;
22
+ error: Error;
23
+ };
24
+ interface SchemaLike<T> {
25
+ parse: (data: unknown) => T;
26
+ }
27
+ interface OsDependencies {
28
+ /** APT packages to install (e.g., ['curl', 'git']) */
29
+ apt?: string[];
30
+ /** Custom shell commands to run during setup */
31
+ commands?: string[];
32
+ }
33
+ /**
34
+ * Configuration for downloading a file into the sandbox filesystem.
35
+ * Files are downloaded during deploy() before the agent runs.
36
+ */
37
+ interface FileDownload {
38
+ /** URL to download the file from (supports http/https) */
39
+ url: string;
40
+ /**
41
+ * Destination path in the sandbox.
42
+ * Can be absolute (e.g., '/home/user/data/model.bin') or
43
+ * relative to /home/user/ (e.g., 'data/model.bin').
44
+ * Parent directories are created automatically.
45
+ */
46
+ path: string;
47
+ }
48
+ /** Default dependencies - empty by default, specify what you need */
49
+ declare const DEFAULT_DEPENDENCIES: OsDependencies;
50
+ interface AgentConfig<TInput, TOutput> {
51
+ id: string;
52
+ inputSchema: SchemaLike<TInput>;
53
+ outputSchema: SchemaLike<TOutput>;
54
+ run: (input: TInput, ctx: AgentRunContext) => Promise<TOutput>;
55
+ maxDuration?: number;
56
+ sandboxId?: string;
57
+ /** OS-level dependencies to install in the sandbox. Defaults to Claude Code. Set to {} to skip. */
58
+ dependencies?: OsDependencies;
59
+ /**
60
+ * Files to download and initialize in the sandbox filesystem.
61
+ * Downloaded during deploy() before the agent code runs.
62
+ * Useful for pre-loading models, datasets, configuration files, etc.
63
+ */
64
+ files?: FileDownload[];
65
+ /**
66
+ * Local path to a .claude directory containing skills and settings.
67
+ * The directory will be uploaded to /home/user/.claude/ in the sandbox.
68
+ * This enables Claude Agent SDK to access skills defined in SKILL.md files
69
+ * within .claude/skills/ subdirectories.
70
+ *
71
+ * Example: claudeDir: './my-project/.claude'
72
+ *
73
+ * The Claude Agent SDK will discover skills when:
74
+ * - cwd is set to /home/user/ (containing .claude/)
75
+ * - settingSources includes 'project'
76
+ * - allowedTools includes 'Skill'
77
+ */
78
+ claudeDir?: string;
79
+ }
80
+ declare class Agent<TInput, TOutput> {
81
+ readonly id: string;
82
+ readonly inputSchema: SchemaLike<TInput>;
83
+ readonly outputSchema: SchemaLike<TOutput>;
84
+ readonly maxDuration: number;
85
+ readonly dependencies: OsDependencies;
86
+ readonly files: FileDownload[];
87
+ readonly claudeDir?: string;
88
+ /** @internal Used by the sandbox runner - must be public for bundled code access */
89
+ _run: (input: TInput, ctx: AgentRunContext) => Promise<TOutput>;
90
+ private _sourceFile;
91
+ private _sandboxId?;
92
+ constructor(config: AgentConfig<TInput, TOutput>);
93
+ get sandboxId(): string | undefined;
94
+ deploy(): Promise<void>;
95
+ run(input: TInput): Promise<AgentRunResult<TOutput>>;
96
+ }
97
+
98
+ export { Agent, type AgentConfig, type AgentRunContext, type AgentRunResult, DEFAULT_DEPENDENCIES, type FileDownload, type OsDependencies };
package/dist/index.d.ts CHANGED
@@ -62,6 +62,20 @@ interface AgentConfig<TInput, TOutput> {
62
62
  * Useful for pre-loading models, datasets, configuration files, etc.
63
63
  */
64
64
  files?: FileDownload[];
65
+ /**
66
+ * Local path to a .claude directory containing skills and settings.
67
+ * The directory will be uploaded to /home/user/.claude/ in the sandbox.
68
+ * This enables Claude Agent SDK to access skills defined in SKILL.md files
69
+ * within .claude/skills/ subdirectories.
70
+ *
71
+ * Example: claudeDir: './my-project/.claude'
72
+ *
73
+ * The Claude Agent SDK will discover skills when:
74
+ * - cwd is set to /home/user/ (containing .claude/)
75
+ * - settingSources includes 'project'
76
+ * - allowedTools includes 'Skill'
77
+ */
78
+ claudeDir?: string;
65
79
  }
66
80
  declare class Agent<TInput, TOutput> {
67
81
  readonly id: string;
@@ -70,6 +84,7 @@ declare class Agent<TInput, TOutput> {
70
84
  readonly maxDuration: number;
71
85
  readonly dependencies: OsDependencies;
72
86
  readonly files: FileDownload[];
87
+ readonly claudeDir?: string;
73
88
  /** @internal Used by the sandbox runner - must be public for bundled code access */
74
89
  _run: (input: TInput, ctx: AgentRunContext) => Promise<TOutput>;
75
90
  private _sourceFile;
package/dist/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  // src/index.ts
2
2
  import { fileURLToPath } from "url";
3
+ import { readdirSync, readFileSync, statSync } from "fs";
4
+ import { join, relative } from "path";
3
5
  var getEsbuild = () => import("esbuild");
4
6
  var getE2b = () => import("e2b");
5
7
  var DEFAULT_DEPENDENCIES = {};
@@ -15,6 +17,31 @@ function getCallerFile() {
15
17
  }
16
18
  throw new Error("Could not determine source file");
17
19
  }
20
+ function readDirectoryRecursively(dirPath) {
21
+ const files = [];
22
+ function walkDir(currentPath) {
23
+ const entries = readdirSync(currentPath);
24
+ for (const entry of entries) {
25
+ const fullPath = join(currentPath, entry);
26
+ const stat = statSync(fullPath);
27
+ if (stat.isDirectory()) {
28
+ walkDir(fullPath);
29
+ } else if (stat.isFile()) {
30
+ const relPath = relative(dirPath, fullPath);
31
+ const isBinary = /\.(png|jpg|jpeg|gif|ico|pdf|zip|tar|gz|bin|exe|dll|so|dylib|wasm)$/i.test(entry);
32
+ if (isBinary) {
33
+ const buffer = readFileSync(fullPath);
34
+ const arrayBuffer = buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
35
+ files.push({ relativePath: relPath, content: arrayBuffer });
36
+ } else {
37
+ files.push({ relativePath: relPath, content: readFileSync(fullPath, "utf-8") });
38
+ }
39
+ }
40
+ }
41
+ }
42
+ walkDir(dirPath);
43
+ return files;
44
+ }
18
45
  var Agent = class {
19
46
  id;
20
47
  inputSchema;
@@ -22,6 +49,7 @@ var Agent = class {
22
49
  maxDuration;
23
50
  dependencies;
24
51
  files;
52
+ claudeDir;
25
53
  /** @internal Used by the sandbox runner - must be public for bundled code access */
26
54
  _run;
27
55
  _sourceFile;
@@ -36,6 +64,7 @@ var Agent = class {
36
64
  this._sandboxId = config.sandboxId;
37
65
  this.dependencies = config.dependencies ?? DEFAULT_DEPENDENCIES;
38
66
  this.files = config.files ?? [];
67
+ this.claudeDir = config.claudeDir;
39
68
  }
40
69
  get sandboxId() {
41
70
  return this._sandboxId;
@@ -164,6 +193,18 @@ try {
164
193
  }
165
194
  }
166
195
  }
196
+ if (this.claudeDir) {
197
+ const claudeFiles = readDirectoryRecursively(this.claudeDir);
198
+ await sandbox.commands.run("mkdir -p /home/user/.claude", { timeoutMs: 3e4 });
199
+ for (const file of claudeFiles) {
200
+ const destPath = `/home/user/.claude/${file.relativePath}`;
201
+ const parentDir = destPath.substring(0, destPath.lastIndexOf("/"));
202
+ if (parentDir && parentDir !== "/home/user/.claude") {
203
+ await sandbox.commands.run(`mkdir -p "${parentDir}"`, { timeoutMs: 3e4 });
204
+ }
205
+ await sandbox.files.write(destPath, file.content);
206
+ }
207
+ }
167
208
  await sandbox.files.write("/home/user/agent.mjs", result.outputFiles[0].text);
168
209
  await sandbox.files.write("/home/user/runner.mjs", runnerCode);
169
210
  if (collectedExternals.size > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-neckbeard",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Deploy AI agents to E2B sandboxes",
5
5
  "type": "module",
6
6
  "exports": {
@@ -8,11 +8,15 @@
8
8
  "import": {
9
9
  "types": "./dist/index.d.ts",
10
10
  "default": "./dist/index.js"
11
+ },
12
+ "require": {
13
+ "types": "./dist/index.d.cts",
14
+ "default": "./dist/index.cjs"
11
15
  }
12
16
  }
13
17
  },
14
- "main": "./dist/index.js",
15
- "types": "./dist/index.d.ts",
18
+ "main": "./dist/index.cjs",
19
+ "types": "./dist/index.d.cts",
16
20
  "files": [
17
21
  "dist"
18
22
  ],