agent-neckbeard 1.1.12 → 1.1.14

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.d.cts CHANGED
@@ -93,6 +93,16 @@ interface NeckbeardNextConfigOptions {
93
93
  * relative to the app root unless `outputFileTracingRoot` is also set.
94
94
  */
95
95
  sourceFiles: string[];
96
+ /**
97
+ * Also include files that the source entries import.
98
+ *
99
+ * Neckbeard rebundles `sourceFile` during `deploy()`. Framework server
100
+ * artifacts therefore need the source entry plus the files and package entry
101
+ * metadata that esbuild will need to resolve its import graph at runtime.
102
+ *
103
+ * @default true
104
+ */
105
+ traceSourceDependencies?: boolean;
96
106
  /**
97
107
  * Route glob or globs whose server traces should include `sourceFiles`.
98
108
  *
@@ -279,6 +289,67 @@ type SandboxConfig = E2BSandboxConfig | DaytonaSandboxConfig;
279
289
  * Mode is discriminated at runtime by the presence of `server` vs `run`.
280
290
  */
281
291
  type AgentConfig<TInput, TOutput, TFrame = unknown> = RunAgentConfig<TInput, TOutput> | ServerAgentConfig<TInput, TFrame>;
292
+ type SandboxFileContent = string | ArrayBuffer | Uint8Array | Buffer;
293
+ interface SandboxCommandOptions {
294
+ cwd?: string;
295
+ envs?: Record<string, string>;
296
+ timeoutMs: number;
297
+ onStdout?: (data: string) => void;
298
+ onStderr?: (data: string) => void;
299
+ }
300
+ /**
301
+ * Result from running a sandbox command with captured output.
302
+ */
303
+ interface SandboxCommandResult {
304
+ exitCode: number;
305
+ stdout: string;
306
+ stderr: string;
307
+ }
308
+ type SandboxClientCreateOptions = {
309
+ provider: 'e2b';
310
+ template?: string;
311
+ apiKey?: string;
312
+ envs?: Record<string, string | undefined>;
313
+ timeoutMs?: number;
314
+ requestTimeoutMs?: number;
315
+ allowPublicTraffic?: boolean;
316
+ } | {
317
+ provider: 'daytona';
318
+ template?: string;
319
+ apiKey?: string;
320
+ envs?: Record<string, string | undefined>;
321
+ createTimeoutSec?: number;
322
+ autoDeleteInterval?: number;
323
+ };
324
+ type SandboxClientConnectOptions = {
325
+ provider: 'e2b';
326
+ sandboxId: string;
327
+ apiKey?: string;
328
+ timeoutMs?: number;
329
+ requestTimeoutMs?: number;
330
+ } | {
331
+ provider: 'daytona';
332
+ sandboxId: string;
333
+ apiKey?: string;
334
+ createTimeoutSec?: number;
335
+ };
336
+ declare class SandboxClient {
337
+ private readonly handle;
338
+ private constructor();
339
+ static create(options: SandboxClientCreateOptions): Promise<SandboxClient>;
340
+ static connect(options: SandboxClientConnectOptions): Promise<SandboxClient>;
341
+ get id(): string;
342
+ get provider(): SandboxProvider;
343
+ get paths(): AgentSandboxContext;
344
+ makeDir(path: string): Promise<void>;
345
+ writeFile(path: string, content: SandboxFileContent): Promise<void>;
346
+ readFile(path: string): Promise<string>;
347
+ readFileBytes(path: string): Promise<Uint8Array>;
348
+ runCommand(command: string, options: SandboxCommandOptions): Promise<SandboxCommandResult>;
349
+ setTimeout(timeoutMs: number): Promise<void>;
350
+ kill(): Promise<void>;
351
+ destroy(): Promise<void>;
352
+ }
282
353
  type AgentMode = 'run' | 'stream';
283
354
  declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
284
355
  readonly sandbox: SandboxConfig;
@@ -392,4 +463,4 @@ declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
392
463
  }): AsyncGenerator<TFrame>;
393
464
  }
394
465
 
395
- export { Agent, type AgentConfig, type AgentMode, type AgentRunContext, type AgentRunResult, type AgentSandboxContext, type BuildOptions, ConfigurationError, DEFAULT_DEPENDENCIES, type DaytonaSandboxConfig, DeploymentError, type E2BSandboxConfig, ExecutionError, type FileDownload, NeckbeardError, type NeckbeardNextConfigOptions, type OsDependencies, type ResolveAgentSourceFileOptions, type RunAgentConfig, type SandboxConfig, type SandboxProvider, type ServerAgentConfig, ValidationError, resolveAgentSourceFile, withNeckbeardNextConfig };
466
+ export { Agent, type AgentConfig, type AgentMode, type AgentRunContext, type AgentRunResult, type AgentSandboxContext, type BuildOptions, ConfigurationError, DEFAULT_DEPENDENCIES, type DaytonaSandboxConfig, DeploymentError, type E2BSandboxConfig, ExecutionError, type FileDownload, NeckbeardError, type NeckbeardNextConfigOptions, type OsDependencies, type ResolveAgentSourceFileOptions, type RunAgentConfig, SandboxClient, type SandboxClientConnectOptions, type SandboxClientCreateOptions, type SandboxCommandOptions, type SandboxCommandResult, type SandboxConfig, type SandboxFileContent, type SandboxProvider, type ServerAgentConfig, ValidationError, resolveAgentSourceFile, withNeckbeardNextConfig };
package/dist/index.d.ts CHANGED
@@ -93,6 +93,16 @@ interface NeckbeardNextConfigOptions {
93
93
  * relative to the app root unless `outputFileTracingRoot` is also set.
94
94
  */
95
95
  sourceFiles: string[];
96
+ /**
97
+ * Also include files that the source entries import.
98
+ *
99
+ * Neckbeard rebundles `sourceFile` during `deploy()`. Framework server
100
+ * artifacts therefore need the source entry plus the files and package entry
101
+ * metadata that esbuild will need to resolve its import graph at runtime.
102
+ *
103
+ * @default true
104
+ */
105
+ traceSourceDependencies?: boolean;
96
106
  /**
97
107
  * Route glob or globs whose server traces should include `sourceFiles`.
98
108
  *
@@ -279,6 +289,67 @@ type SandboxConfig = E2BSandboxConfig | DaytonaSandboxConfig;
279
289
  * Mode is discriminated at runtime by the presence of `server` vs `run`.
280
290
  */
281
291
  type AgentConfig<TInput, TOutput, TFrame = unknown> = RunAgentConfig<TInput, TOutput> | ServerAgentConfig<TInput, TFrame>;
292
+ type SandboxFileContent = string | ArrayBuffer | Uint8Array | Buffer;
293
+ interface SandboxCommandOptions {
294
+ cwd?: string;
295
+ envs?: Record<string, string>;
296
+ timeoutMs: number;
297
+ onStdout?: (data: string) => void;
298
+ onStderr?: (data: string) => void;
299
+ }
300
+ /**
301
+ * Result from running a sandbox command with captured output.
302
+ */
303
+ interface SandboxCommandResult {
304
+ exitCode: number;
305
+ stdout: string;
306
+ stderr: string;
307
+ }
308
+ type SandboxClientCreateOptions = {
309
+ provider: 'e2b';
310
+ template?: string;
311
+ apiKey?: string;
312
+ envs?: Record<string, string | undefined>;
313
+ timeoutMs?: number;
314
+ requestTimeoutMs?: number;
315
+ allowPublicTraffic?: boolean;
316
+ } | {
317
+ provider: 'daytona';
318
+ template?: string;
319
+ apiKey?: string;
320
+ envs?: Record<string, string | undefined>;
321
+ createTimeoutSec?: number;
322
+ autoDeleteInterval?: number;
323
+ };
324
+ type SandboxClientConnectOptions = {
325
+ provider: 'e2b';
326
+ sandboxId: string;
327
+ apiKey?: string;
328
+ timeoutMs?: number;
329
+ requestTimeoutMs?: number;
330
+ } | {
331
+ provider: 'daytona';
332
+ sandboxId: string;
333
+ apiKey?: string;
334
+ createTimeoutSec?: number;
335
+ };
336
+ declare class SandboxClient {
337
+ private readonly handle;
338
+ private constructor();
339
+ static create(options: SandboxClientCreateOptions): Promise<SandboxClient>;
340
+ static connect(options: SandboxClientConnectOptions): Promise<SandboxClient>;
341
+ get id(): string;
342
+ get provider(): SandboxProvider;
343
+ get paths(): AgentSandboxContext;
344
+ makeDir(path: string): Promise<void>;
345
+ writeFile(path: string, content: SandboxFileContent): Promise<void>;
346
+ readFile(path: string): Promise<string>;
347
+ readFileBytes(path: string): Promise<Uint8Array>;
348
+ runCommand(command: string, options: SandboxCommandOptions): Promise<SandboxCommandResult>;
349
+ setTimeout(timeoutMs: number): Promise<void>;
350
+ kill(): Promise<void>;
351
+ destroy(): Promise<void>;
352
+ }
282
353
  type AgentMode = 'run' | 'stream';
283
354
  declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
284
355
  readonly sandbox: SandboxConfig;
@@ -392,4 +463,4 @@ declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
392
463
  }): AsyncGenerator<TFrame>;
393
464
  }
394
465
 
395
- export { Agent, type AgentConfig, type AgentMode, type AgentRunContext, type AgentRunResult, type AgentSandboxContext, type BuildOptions, ConfigurationError, DEFAULT_DEPENDENCIES, type DaytonaSandboxConfig, DeploymentError, type E2BSandboxConfig, ExecutionError, type FileDownload, NeckbeardError, type NeckbeardNextConfigOptions, type OsDependencies, type ResolveAgentSourceFileOptions, type RunAgentConfig, type SandboxConfig, type SandboxProvider, type ServerAgentConfig, ValidationError, resolveAgentSourceFile, withNeckbeardNextConfig };
466
+ export { Agent, type AgentConfig, type AgentMode, type AgentRunContext, type AgentRunResult, type AgentSandboxContext, type BuildOptions, ConfigurationError, DEFAULT_DEPENDENCIES, type DaytonaSandboxConfig, DeploymentError, type E2BSandboxConfig, ExecutionError, type FileDownload, NeckbeardError, type NeckbeardNextConfigOptions, type OsDependencies, type ResolveAgentSourceFileOptions, type RunAgentConfig, SandboxClient, type SandboxClientConnectOptions, type SandboxClientCreateOptions, type SandboxCommandOptions, type SandboxCommandResult, type SandboxConfig, type SandboxFileContent, type SandboxProvider, type ServerAgentConfig, ValidationError, resolveAgentSourceFile, withNeckbeardNextConfig };