sbox-sdk 0.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.
Files changed (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +137 -0
  3. package/dist/adapter/index.d.ts +22 -0
  4. package/dist/adapter/index.d.ts.map +1 -0
  5. package/dist/adapter/index.js +16 -0
  6. package/dist/agent-tools/index.d.ts +13 -0
  7. package/dist/agent-tools/index.d.ts.map +1 -0
  8. package/dist/agent-tools/index.js +9 -0
  9. package/dist/agent-tools/policy.d.ts +48 -0
  10. package/dist/agent-tools/policy.d.ts.map +1 -0
  11. package/dist/agent-tools/policy.js +51 -0
  12. package/dist/agent-tools/registry.d.ts +9 -0
  13. package/dist/agent-tools/registry.d.ts.map +1 -0
  14. package/dist/agent-tools/registry.js +412 -0
  15. package/dist/agent-tools/result.d.ts +32 -0
  16. package/dist/agent-tools/result.d.ts.map +1 -0
  17. package/dist/agent-tools/result.js +14 -0
  18. package/dist/agent-tools/types.d.ts +76 -0
  19. package/dist/agent-tools/types.d.ts.map +1 -0
  20. package/dist/agent-tools/types.js +1 -0
  21. package/dist/ai/index.d.ts +36 -0
  22. package/dist/ai/index.d.ts.map +1 -0
  23. package/dist/ai/index.js +40 -0
  24. package/dist/ai-sdk/index.d.ts +31 -0
  25. package/dist/ai-sdk/index.d.ts.map +1 -0
  26. package/dist/ai-sdk/index.js +80 -0
  27. package/dist/anthropic/index.d.ts +42 -0
  28. package/dist/anthropic/index.d.ts.map +1 -0
  29. package/dist/anthropic/index.js +64 -0
  30. package/dist/aws-lambda/index.d.ts +87 -0
  31. package/dist/aws-lambda/index.d.ts.map +1 -0
  32. package/dist/aws-lambda/index.js +290 -0
  33. package/dist/beam/index.d.ts +92 -0
  34. package/dist/beam/index.d.ts.map +1 -0
  35. package/dist/beam/index.js +222 -0
  36. package/dist/blaxel/index.d.ts +125 -0
  37. package/dist/blaxel/index.d.ts.map +1 -0
  38. package/dist/blaxel/index.js +220 -0
  39. package/dist/cli.d.ts +3 -0
  40. package/dist/cli.d.ts.map +1 -0
  41. package/dist/cli.js +249 -0
  42. package/dist/cloudflare/index.d.ts +64 -0
  43. package/dist/cloudflare/index.d.ts.map +1 -0
  44. package/dist/cloudflare/index.js +259 -0
  45. package/dist/codesandbox/index.d.ts +100 -0
  46. package/dist/codesandbox/index.d.ts.map +1 -0
  47. package/dist/codesandbox/index.js +227 -0
  48. package/dist/conformance/index.d.ts +20 -0
  49. package/dist/conformance/index.d.ts.map +1 -0
  50. package/dist/conformance/index.js +189 -0
  51. package/dist/daytona/index.d.ts +64 -0
  52. package/dist/daytona/index.d.ts.map +1 -0
  53. package/dist/daytona/index.js +258 -0
  54. package/dist/e2b/index.d.ts +63 -0
  55. package/dist/e2b/index.d.ts.map +1 -0
  56. package/dist/e2b/index.js +411 -0
  57. package/dist/fly/index.d.ts +75 -0
  58. package/dist/fly/index.d.ts.map +1 -0
  59. package/dist/fly/index.js +222 -0
  60. package/dist/index.d.ts +21 -0
  61. package/dist/index.d.ts.map +1 -0
  62. package/dist/index.js +16 -0
  63. package/dist/internal/capabilities.d.ts +57 -0
  64. package/dist/internal/capabilities.d.ts.map +1 -0
  65. package/dist/internal/capabilities.js +68 -0
  66. package/dist/internal/client.d.ts +9 -0
  67. package/dist/internal/client.d.ts.map +1 -0
  68. package/dist/internal/client.js +126 -0
  69. package/dist/internal/encoding.d.ts +8 -0
  70. package/dist/internal/encoding.d.ts.map +1 -0
  71. package/dist/internal/encoding.js +20 -0
  72. package/dist/internal/errors.d.ts +45 -0
  73. package/dist/internal/errors.d.ts.map +1 -0
  74. package/dist/internal/errors.js +79 -0
  75. package/dist/internal/exec.d.ts +19 -0
  76. package/dist/internal/exec.d.ts.map +1 -0
  77. package/dist/internal/exec.js +208 -0
  78. package/dist/internal/plugin.d.ts +38 -0
  79. package/dist/internal/plugin.d.ts.map +1 -0
  80. package/dist/internal/plugin.js +1 -0
  81. package/dist/internal/runtime.d.ts +8 -0
  82. package/dist/internal/runtime.d.ts.map +1 -0
  83. package/dist/internal/runtime.js +21 -0
  84. package/dist/internal/sandbox.d.ts +12 -0
  85. package/dist/internal/sandbox.d.ts.map +1 -0
  86. package/dist/internal/sandbox.js +438 -0
  87. package/dist/internal/shell.d.ts +36 -0
  88. package/dist/internal/shell.d.ts.map +1 -0
  89. package/dist/internal/shell.js +88 -0
  90. package/dist/internal/stream.d.ts +15 -0
  91. package/dist/internal/stream.d.ts.map +1 -0
  92. package/dist/internal/stream.js +58 -0
  93. package/dist/internal/types.d.ts +381 -0
  94. package/dist/internal/types.d.ts.map +1 -0
  95. package/dist/internal/types.js +1 -0
  96. package/dist/langchain/index.d.ts +25 -0
  97. package/dist/langchain/index.d.ts.map +1 -0
  98. package/dist/langchain/index.js +61 -0
  99. package/dist/mastra/index.d.ts +43 -0
  100. package/dist/mastra/index.d.ts.map +1 -0
  101. package/dist/mastra/index.js +69 -0
  102. package/dist/memory/index.d.ts +57 -0
  103. package/dist/memory/index.d.ts.map +1 -0
  104. package/dist/memory/index.js +573 -0
  105. package/dist/modal/index.d.ts +67 -0
  106. package/dist/modal/index.d.ts.map +1 -0
  107. package/dist/modal/index.js +223 -0
  108. package/dist/morph/index.d.ts +91 -0
  109. package/dist/morph/index.d.ts.map +1 -0
  110. package/dist/morph/index.js +221 -0
  111. package/dist/northflank/index.d.ts +74 -0
  112. package/dist/northflank/index.d.ts.map +1 -0
  113. package/dist/northflank/index.js +265 -0
  114. package/dist/openai/index.d.ts +25 -0
  115. package/dist/openai/index.d.ts.map +1 -0
  116. package/dist/openai/index.js +71 -0
  117. package/dist/railway/index.d.ts +109 -0
  118. package/dist/railway/index.d.ts.map +1 -0
  119. package/dist/railway/index.js +219 -0
  120. package/dist/runloop/index.d.ts +69 -0
  121. package/dist/runloop/index.d.ts.map +1 -0
  122. package/dist/runloop/index.js +226 -0
  123. package/dist/testing/index.d.ts +44 -0
  124. package/dist/testing/index.d.ts.map +1 -0
  125. package/dist/testing/index.js +61 -0
  126. package/dist/vercel/index.d.ts +63 -0
  127. package/dist/vercel/index.d.ts.map +1 -0
  128. package/dist/vercel/index.js +241 -0
  129. package/package.json +252 -0
  130. package/src/aws-lambda/runner/Dockerfile +15 -0
  131. package/src/aws-lambda/runner/README.md +59 -0
  132. package/src/aws-lambda/runner/server.mjs +91 -0
@@ -0,0 +1,381 @@
1
+ /**
2
+ * The full public type surface: the `Sandbox` the user holds, its namespaced
3
+ * sub-APIs, the `SandboxClient`, and the provider/adapter contract the core
4
+ * calls into. Everything is web-standard (no Node `Buffer`) so the core stays
5
+ * portable across Node / Bun / Deno / Workers.
6
+ */
7
+ import type { Capabilities, CapabilityFlags, CapabilityMap, Gated } from "./capabilities.js";
8
+ import type { SandboxError } from "./errors.js";
9
+ import type { SandboxPlugin } from "./plugin.js";
10
+ export type MaybePromise<T> = T | Promise<T>;
11
+ export type FileBody = string | Uint8Array | ReadableStream<Uint8Array>;
12
+ export type SandboxState = "creating" | "running" | "paused" | "stopped" | "destroyed" | "error" | "unknown";
13
+ export interface SandboxInfo {
14
+ readonly id: string;
15
+ readonly name?: string;
16
+ readonly state: SandboxState;
17
+ readonly provider: string;
18
+ readonly metadata: Readonly<Record<string, string>>;
19
+ readonly createdAt?: Date;
20
+ readonly raw: unknown;
21
+ }
22
+ export interface ResourceSpec {
23
+ vcpus?: number;
24
+ memoryMB?: number;
25
+ diskMB?: number;
26
+ gpu?: string;
27
+ }
28
+ export interface VolumeMount {
29
+ id: string;
30
+ mountPath: string;
31
+ readOnly?: boolean;
32
+ }
33
+ export interface SecretRef {
34
+ name: string;
35
+ envVar?: string;
36
+ }
37
+ export interface SandboxSpec {
38
+ /** Build-time base: image / snapshot / blueprint id, provider-specific. */
39
+ template?: string;
40
+ name?: string;
41
+ metadata?: Record<string, string>;
42
+ env?: Record<string, string>;
43
+ resources?: ResourceSpec;
44
+ ttlMs?: number;
45
+ onIdle?: "pause" | "stop" | "destroy";
46
+ ports?: number[];
47
+ region?: string;
48
+ volumes?: VolumeMount[];
49
+ secrets?: SecretRef[];
50
+ /** Safe-retry key so create() never spawns duplicate VMs across fallback. */
51
+ idempotencyKey?: string;
52
+ signal?: AbortSignal;
53
+ }
54
+ export interface ExecOptions {
55
+ cwd?: string;
56
+ env?: Record<string, string>;
57
+ timeoutMs?: number;
58
+ user?: string;
59
+ stdin?: FileBody;
60
+ signal?: AbortSignal;
61
+ onStdout?: (chunk: string) => void;
62
+ onStderr?: (chunk: string) => void;
63
+ }
64
+ export interface ExecResult {
65
+ readonly stdout: string;
66
+ readonly stderr: string;
67
+ readonly exitCode: number;
68
+ /** true when the exit code was parsed from a `$?` echo rather than native. */
69
+ readonly exitCodeSynthesized?: boolean;
70
+ }
71
+ export type OutputEvent = {
72
+ type: "stdout";
73
+ data: string;
74
+ } | {
75
+ type: "stderr";
76
+ data: string;
77
+ } | {
78
+ type: "exit";
79
+ exitCode: number;
80
+ signal?: string;
81
+ };
82
+ /**
83
+ * Returned by `commands.run()`: BOTH a `Promise<ExecResult>` (await => buffered)
84
+ * AND an `AsyncIterable<OutputEvent>` (for-await => streamed live).
85
+ */
86
+ export interface ExecHandle extends Promise<ExecResult>, AsyncIterable<OutputEvent> {
87
+ readonly pid: Promise<string>;
88
+ readonly stdout: ReadableStream<Uint8Array>;
89
+ readonly stderr: ReadableStream<Uint8Array>;
90
+ kill(signal?: string): Promise<void>;
91
+ writeStdin(data: string | Uint8Array): Promise<void>;
92
+ }
93
+ export interface Process {
94
+ readonly id: string;
95
+ readonly stdout: AsyncIterable<string>;
96
+ readonly stderr: AsyncIterable<string>;
97
+ wait(): Promise<ExecResult>;
98
+ kill(signal?: string): Promise<void>;
99
+ writeStdin(data: string | Uint8Array): Promise<void>;
100
+ }
101
+ export interface ProcessInfo {
102
+ id: string;
103
+ cmd: string;
104
+ }
105
+ export type FileType = "file" | "dir" | "symlink";
106
+ export interface FileInfo {
107
+ path: string;
108
+ type: FileType;
109
+ size: number;
110
+ mtime?: Date;
111
+ }
112
+ export interface DirEntry {
113
+ name: string;
114
+ path: string;
115
+ type: FileType;
116
+ }
117
+ export interface StoredFile {
118
+ path: string;
119
+ text(): Promise<string>;
120
+ bytes(): Promise<Uint8Array>;
121
+ stream(): ReadableStream<Uint8Array>;
122
+ }
123
+ export interface FsEvent {
124
+ type: "create" | "modify" | "delete";
125
+ path: string;
126
+ }
127
+ export interface Watcher {
128
+ close(): Promise<void>;
129
+ }
130
+ export interface Preview {
131
+ url: string;
132
+ port: number;
133
+ token?: string;
134
+ }
135
+ export interface EgressPolicy {
136
+ mode: "allow-all" | "block-all" | "allow-list";
137
+ domains?: string[];
138
+ cidrs?: string[];
139
+ }
140
+ export interface SshCredentials {
141
+ host: string;
142
+ port: number;
143
+ user: string;
144
+ privateKey: string;
145
+ }
146
+ export interface KernelContext {
147
+ readonly id: string;
148
+ language: string;
149
+ }
150
+ export interface RichResult {
151
+ mime: Record<string, string>;
152
+ text?: string;
153
+ }
154
+ export interface CodeExecution {
155
+ results: RichResult[];
156
+ logs: {
157
+ stdout: string[];
158
+ stderr: string[];
159
+ };
160
+ error?: {
161
+ name: string;
162
+ value: string;
163
+ traceback?: string;
164
+ };
165
+ }
166
+ export interface SnapshotRef {
167
+ id: string;
168
+ name?: string;
169
+ provider: string;
170
+ createdAt?: Date;
171
+ raw: unknown;
172
+ }
173
+ export interface CommandsAPI {
174
+ run(cmd: string | string[], opts?: ExecOptions): ExecHandle;
175
+ spawn(cmd: string | string[], opts?: ExecOptions): Promise<Process>;
176
+ connect(processId: string): Promise<Process>;
177
+ kill(processId: string, signal?: string): Promise<void>;
178
+ list(): Promise<ProcessInfo[]>;
179
+ }
180
+ export interface FilesAPI {
181
+ read(path: string): Promise<StoredFile>;
182
+ write(path: string, data: FileBody): Promise<void>;
183
+ list(path: string): Promise<DirEntry[]>;
184
+ mkdir(path: string, opts?: {
185
+ recursive?: boolean;
186
+ }): Promise<void>;
187
+ remove(path: string, opts?: {
188
+ recursive?: boolean;
189
+ }): Promise<void>;
190
+ rename(from: string, to: string): Promise<void>;
191
+ stat(path: string): Promise<FileInfo>;
192
+ exists(path: string): Promise<boolean>;
193
+ upload(path: string, body: FileBody): Promise<void>;
194
+ download(path: string): Promise<StoredFile>;
195
+ watch(path: string, cb: (e: FsEvent) => void, opts?: {
196
+ recursive?: boolean;
197
+ }): Promise<Watcher>;
198
+ }
199
+ export interface CodeAPI {
200
+ runCode(code: string, opts?: {
201
+ context?: KernelContext;
202
+ language?: string;
203
+ onStdout?: (chunk: string) => void;
204
+ onStderr?: (chunk: string) => void;
205
+ }): Promise<CodeExecution>;
206
+ createContext(opts?: {
207
+ language?: string;
208
+ cwd?: string;
209
+ }): Promise<KernelContext>;
210
+ }
211
+ export interface PortsAPI {
212
+ expose(port: number, opts?: {
213
+ private?: boolean;
214
+ }): Promise<Preview>;
215
+ unexpose(port: number): Promise<void>;
216
+ list(): Promise<Preview[]>;
217
+ fetch(port: number, path?: string, init?: RequestInit): Promise<Response>;
218
+ }
219
+ export interface SnapshotsAPI {
220
+ create(opts?: {
221
+ name?: string;
222
+ }): Promise<SnapshotRef>;
223
+ restore(ref: SnapshotRef | string): Promise<void>;
224
+ fork(count?: number): Promise<Sandbox[]>;
225
+ list(): Promise<SnapshotRef[]>;
226
+ delete(ref: SnapshotRef | string): Promise<void>;
227
+ }
228
+ export interface NetworkAPI {
229
+ setEgressPolicy(policy: EgressPolicy): Promise<void>;
230
+ createSsh(): Promise<SshCredentials>;
231
+ }
232
+ export interface Sandbox<Caps extends CapabilityMap = CapabilityMap, Raw = unknown> {
233
+ readonly id: string;
234
+ readonly name?: string;
235
+ readonly provider: string;
236
+ readonly capabilities: Capabilities;
237
+ readonly commands: CommandsAPI;
238
+ readonly files: FilesAPI;
239
+ readonly ports: Gated<Caps["exposePort"], PortsAPI>;
240
+ readonly code: Gated<Caps["codeInterpreter"], CodeAPI>;
241
+ readonly snapshots: Gated<Caps["snapshot"], SnapshotsAPI>;
242
+ readonly network: Gated<Caps["egressControl"], NetworkAPI>;
243
+ getInfo(): Promise<SandboxInfo>;
244
+ setTimeout(ttlMs: number): Promise<void>;
245
+ stop(): Promise<void>;
246
+ pause(): Promise<void>;
247
+ resume(): Promise<void>;
248
+ destroy(): Promise<void>;
249
+ /** Runtime check + type-guard, for dynamically-chosen providers. */
250
+ can<K extends keyof CapabilityMap>(cap: K): this is Sandbox<Caps & Record<K, "native" | "emulated">, Raw>;
251
+ /** Escape hatch: the native provider client, typed via the adapter Raw. */
252
+ raw(): Raw;
253
+ }
254
+ export interface ListFilter {
255
+ metadata?: Record<string, string>;
256
+ state?: SandboxState;
257
+ limit?: number;
258
+ }
259
+ /**
260
+ * Per-`create` overrides handed to plugins (e.g. the AI-provider policy). Opaque
261
+ * to the core router; each plugin reads the keys it understands via
262
+ * `PluginSetupContext.createOptions`.
263
+ */
264
+ export type SandboxCreateOptions = Readonly<Record<string, unknown>>;
265
+ export interface SandboxClient<Caps extends CapabilityMap = CapabilityMap, Raw = unknown, Ext extends object = object> {
266
+ create(spec?: SandboxSpec, options?: SandboxCreateOptions): Promise<Sandbox<Caps, Raw> & Ext>;
267
+ connect(id: string): Promise<Sandbox<Caps, Raw> & Ext>;
268
+ list(filter?: ListFilter): AsyncIterable<SandboxInfo>;
269
+ readonly provider: string;
270
+ readonly capabilities: Capabilities;
271
+ dispose(): Promise<void>;
272
+ }
273
+ export interface RetryPolicy {
274
+ retries?: number;
275
+ delayMs?: (attempt: number, err: unknown) => number;
276
+ shouldRetry?: (err: unknown, attempt: number) => boolean;
277
+ }
278
+ export interface Hooks {
279
+ beforeCreate?(spec: SandboxSpec): void | Promise<void>;
280
+ afterCreate?(info: {
281
+ id: string;
282
+ provider: string;
283
+ }): void | Promise<void>;
284
+ onError?(err: unknown, attempt: number): void | Promise<void>;
285
+ }
286
+ export interface ClientOptions<Caps extends CapabilityMap = CapabilityMap, Raw = unknown> {
287
+ provider?: SandboxProvider<Caps, Raw>;
288
+ fallback?: SandboxProvider[];
289
+ retry?: RetryPolicy;
290
+ hooks?: Hooks;
291
+ fetch?: typeof fetch;
292
+ /** Opt-in lossy emulations (e.g. fork via snapshot+restore). */
293
+ emulate?: (keyof CapabilityMap)[];
294
+ defaultMetadata?: Record<string, string>;
295
+ /** Plugins applied to every sandbox this client builds (incl. forks). */
296
+ plugins?: readonly SandboxPlugin[];
297
+ }
298
+ /** Per-call context threaded into every adapter method. */
299
+ export interface CallContext {
300
+ attempt: number;
301
+ signal?: AbortSignal;
302
+ /** CRITICAL for create(): retries must not duplicate VMs. */
303
+ idempotencyKey?: string;
304
+ /** Injectable transport — the primary unit-test seam. */
305
+ fetch: typeof fetch;
306
+ metadata?: Record<string, string>;
307
+ }
308
+ /** Raw event stream returned by adapter exec; the core wraps it into ExecHandle. */
309
+ export interface DriverExec extends AsyncIterable<OutputEvent> {
310
+ readonly pid: Promise<string>;
311
+ kill(signal?: string): Promise<void>;
312
+ writeStdin?(data: Uint8Array): Promise<void>;
313
+ }
314
+ export interface DriverProcess extends DriverExec {
315
+ readonly id: string;
316
+ }
317
+ /** A live adapter-side handle to ONE sandbox. Required methods = common denominator. */
318
+ export interface DriverHandle<Raw = unknown> {
319
+ readonly id: string;
320
+ readonly name?: string;
321
+ readonly raw: Raw;
322
+ getInfo(ctx: CallContext): MaybePromise<SandboxInfo>;
323
+ destroy(ctx: CallContext): MaybePromise<void>;
324
+ /** MUST NOT throw on non-zero exit; emit `{type:'exit',exitCode}` instead. */
325
+ exec(cmd: string, opts: ExecOptions, ctx: CallContext): DriverExec;
326
+ readFile(path: string, ctx: CallContext): MaybePromise<Uint8Array>;
327
+ writeFile(path: string, data: Uint8Array, ctx: CallContext): MaybePromise<void>;
328
+ setTimeout?(ttlMs: number, ctx: CallContext): MaybePromise<void>;
329
+ stop?(ctx: CallContext): MaybePromise<void>;
330
+ pause?(ctx: CallContext): MaybePromise<void>;
331
+ resume?(ctx: CallContext): MaybePromise<void>;
332
+ spawn?(cmd: string, opts: ExecOptions, ctx: CallContext): MaybePromise<DriverProcess>;
333
+ connectProcess?(processId: string, ctx: CallContext): MaybePromise<DriverProcess>;
334
+ killProcess?(processId: string, signal: string | undefined, ctx: CallContext): MaybePromise<void>;
335
+ listProcesses?(ctx: CallContext): MaybePromise<ProcessInfo[]>;
336
+ listDir?(path: string, ctx: CallContext): MaybePromise<DirEntry[]>;
337
+ mkdir?(path: string, recursive: boolean, ctx: CallContext): MaybePromise<void>;
338
+ remove?(path: string, recursive: boolean, ctx: CallContext): MaybePromise<void>;
339
+ rename?(from: string, to: string, ctx: CallContext): MaybePromise<void>;
340
+ stat?(path: string, ctx: CallContext): MaybePromise<FileInfo>;
341
+ upload?(path: string, data: FileBody, ctx: CallContext): MaybePromise<void>;
342
+ download?(path: string, ctx: CallContext): MaybePromise<ReadableStream<Uint8Array>>;
343
+ watch?(path: string, cb: (e: FsEvent) => void, recursive: boolean, ctx: CallContext): MaybePromise<() => Promise<void>>;
344
+ exposePort?(port: number, opts: {
345
+ private?: boolean;
346
+ }, ctx: CallContext): MaybePromise<Preview>;
347
+ unexposePort?(port: number, ctx: CallContext): MaybePromise<void>;
348
+ listPorts?(ctx: CallContext): MaybePromise<Preview[]>;
349
+ proxyFetch?(port: number, path: string | undefined, init: RequestInit | undefined, ctx: CallContext): MaybePromise<Response>;
350
+ setEgressPolicy?(policy: EgressPolicy, ctx: CallContext): MaybePromise<void>;
351
+ createSsh?(ctx: CallContext): MaybePromise<SshCredentials>;
352
+ runCode?(code: string, opts: {
353
+ context?: KernelContext;
354
+ language?: string;
355
+ onStdout?: (chunk: string) => void;
356
+ onStderr?: (chunk: string) => void;
357
+ }, ctx: CallContext): MaybePromise<CodeExecution>;
358
+ createContext?(opts: {
359
+ language?: string;
360
+ cwd?: string;
361
+ }, ctx: CallContext): MaybePromise<KernelContext>;
362
+ snapshot?(opts: {
363
+ name?: string;
364
+ }, ctx: CallContext): MaybePromise<SnapshotRef>;
365
+ restoreSnapshot?(ref: string, ctx: CallContext): MaybePromise<void>;
366
+ fork?(count: number, ctx: CallContext): MaybePromise<DriverHandle<Raw>[]>;
367
+ listSnapshots?(ctx: CallContext): MaybePromise<SnapshotRef[]>;
368
+ deleteSnapshot?(ref: string, ctx: CallContext): MaybePromise<void>;
369
+ }
370
+ /** THE contract object each provider factory returns. */
371
+ export interface SandboxProvider<Caps extends CapabilityMap = CapabilityMap, Raw = unknown> {
372
+ readonly name: string;
373
+ readonly capabilities: Caps;
374
+ readonly flags: CapabilityFlags;
375
+ readonly mapError?: (err: unknown) => SandboxError | undefined;
376
+ create(spec: SandboxSpec, ctx: CallContext): MaybePromise<DriverHandle<Raw>>;
377
+ connect(id: string, ctx: CallContext): MaybePromise<DriverHandle<Raw>>;
378
+ list?(filter: ListFilter | undefined, ctx: CallContext): AsyncIterable<SandboxInfo>;
379
+ dispose?(): MaybePromise<void>;
380
+ }
381
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/internal/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,aAAa,EACb,KAAK,EACN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7C,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;AAMxE,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,SAAS,GACT,QAAQ,GACR,SAAS,GACT,WAAW,GACX,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC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AAC;CAChC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { StructuredToolInterface } from "@langchain/core/tools";
2
+ import type { FrameworkAdapter, ToolSetOptions, ToolSpec } from "../agent-tools/types.js";
3
+ import type { Sandbox } from "../internal/types.js";
4
+ export type LangChainToolOptions = ToolSetOptions;
5
+ /** Array of LangChain structured tools. */
6
+ export type LangChainToolSet = StructuredToolInterface[];
7
+ /**
8
+ * Build LangChain tools from a live sandbox (capability-gated) or a pre-built
9
+ * `ToolSpec[]`. Pass the result to a LangChain agent or LangGraph `ToolNode`.
10
+ */
11
+ export declare function toLangChainTools(source: Sandbox | ToolSpec[], opts?: LangChainToolOptions): LangChainToolSet;
12
+ /**
13
+ * The LangChain framework adapter for the `ai()` plugin:
14
+ *
15
+ * ```ts
16
+ * import { ai } from "sbox-sdk/ai";
17
+ * import { langchain } from "sbox-sdk/langchain";
18
+ *
19
+ * const client = createSandboxClient({ provider: e2b(), plugins: [ai({ framework: langchain() })] });
20
+ * const sandbox = await client.create();
21
+ * const agent = createReactAgent({ llm, tools: sandbox.tools });
22
+ * ```
23
+ */
24
+ export declare function langchain(): FrameworkAdapter<LangChainToolSet>;
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/langchain/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAIrE,OAAO,KAAK,EACV,gBAAgB,EAEhB,cAAc,EACd,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAElD,2CAA2C;AAC3C,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,EAAE,CAAC;AAazD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,OAAO,GAAG,QAAQ,EAAE,EAC5B,IAAI,GAAE,oBAAyB,GAC9B,gBAAgB,CAkBlB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAK9D"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * `sbox-sdk/langchain` — LangChain (TS) adapter. Projects the provider-neutral
3
+ * sandbox tool registry into `@langchain/core` `tool()` objects, returned as an
4
+ * array for any LangChain agent / LangGraph `ToolNode`.
5
+ *
6
+ * Approval: enforced inside the tool function via the shared `enforcePolicy`
7
+ * (`"deny"` short-circuits; `"ask"` awaits `policy.onApprovalRequest`). For
8
+ * graph-native human-in-the-loop, wrap the call in a LangGraph `interrupt()` —
9
+ * a documented follow-up (kept out of v1 so the only peer is `@langchain/core`).
10
+ *
11
+ * Peer dependency: `@langchain/core` (optional).
12
+ */
13
+ import { tool } from "@langchain/core/tools";
14
+ import { enforcePolicy } from "../agent-tools/policy.js";
15
+ import { createSandboxTools } from "../agent-tools/registry.js";
16
+ function resolve(source, opts) {
17
+ return Array.isArray(source)
18
+ ? { specs: source }
19
+ : { sandbox: source, specs: createSandboxTools(source, opts) };
20
+ }
21
+ /**
22
+ * Build LangChain tools from a live sandbox (capability-gated) or a pre-built
23
+ * `ToolSpec[]`. Pass the result to a LangChain agent or LangGraph `ToolNode`.
24
+ */
25
+ export function toLangChainTools(source, opts = {}) {
26
+ const { specs, sandbox } = resolve(source, opts);
27
+ const { policy } = opts;
28
+ return specs.map((spec) => {
29
+ const run = async (input) => {
30
+ const ctx = { sandbox };
31
+ const denied = await enforcePolicy(spec, input, ctx, policy);
32
+ if (denied !== null) {
33
+ return denied;
34
+ }
35
+ return (await spec.execute(input, ctx)).text;
36
+ };
37
+ return tool(run, {
38
+ description: spec.description,
39
+ name: spec.name,
40
+ schema: spec.inputSchema,
41
+ });
42
+ });
43
+ }
44
+ /**
45
+ * The LangChain framework adapter for the `ai()` plugin:
46
+ *
47
+ * ```ts
48
+ * import { ai } from "sbox-sdk/ai";
49
+ * import { langchain } from "sbox-sdk/langchain";
50
+ *
51
+ * const client = createSandboxClient({ provider: e2b(), plugins: [ai({ framework: langchain() })] });
52
+ * const sandbox = await client.create();
53
+ * const agent = createReactAgent({ llm, tools: sandbox.tools });
54
+ * ```
55
+ */
56
+ export function langchain() {
57
+ return {
58
+ build: (sandbox, opts) => toLangChainTools(sandbox, opts),
59
+ name: "langchain",
60
+ };
61
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * `sbox-sdk/mastra` — Mastra adapter. Projects the provider-neutral sandbox tool
3
+ * registry into Mastra's `createTool()` shape, keyed by tool id so the result
4
+ * drops into `new Agent({ tools })` or `new Mastra({ tools })`.
5
+ *
6
+ * Mastra is built on the AI SDK and also accepts AI SDK tools directly, so the
7
+ * `vercelAI()` plugin's output works in a Mastra agent too; this native adapter
8
+ * additionally gives Mastra-native registration (and a path to `outputSchema` /
9
+ * `suspend()`-based HITL in a follow-up).
10
+ *
11
+ * Approval is enforced inside `execute` via the shared `enforcePolicy` (same as
12
+ * every other adapter): `"deny"` short-circuits, `"ask"` awaits
13
+ * `policy.onApprovalRequest` when configured. Native Mastra `suspend()` HITL is
14
+ * a planned enhancement.
15
+ *
16
+ * Peer dependency: `@mastra/core` (optional).
17
+ */
18
+ import { createTool } from "@mastra/core/tools";
19
+ import type { FrameworkAdapter, ToolSetOptions, ToolSpec } from "../agent-tools/types.js";
20
+ import type { Sandbox } from "../internal/types.js";
21
+ export type MastraToolOptions = ToolSetOptions;
22
+ /** Every spec erases its input schema to `unknown`, so the concrete `Tool`
23
+ * instances share `Tool<unknown, …>` and assign cleanly into this record. */
24
+ export type MastraToolSet = Record<string, ReturnType<typeof createTool>>;
25
+ /**
26
+ * Build Mastra tools from a live sandbox (capability-gated) or a pre-built
27
+ * `ToolSpec[]`. Register the result on an Agent or the Mastra instance.
28
+ */
29
+ export declare function toMastraTools(source: Sandbox | ToolSpec[], opts?: MastraToolOptions): MastraToolSet;
30
+ /**
31
+ * The Mastra framework adapter for the `ai()` plugin:
32
+ *
33
+ * ```ts
34
+ * import { ai } from "sbox-sdk/ai";
35
+ * import { mastra } from "sbox-sdk/mastra";
36
+ *
37
+ * const client = createSandboxClient({ provider: e2b(), plugins: [ai({ framework: mastra() })] });
38
+ * const sandbox = await client.create();
39
+ * const agent = new Agent({ name: "coder", model, tools: sandbox.tools });
40
+ * ```
41
+ */
42
+ export declare function mastra(): FrameworkAdapter<MastraToolSet>;
43
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mastra/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKhD,OAAO,KAAK,EACV,gBAAgB,EAEhB,cAAc,EACd,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAE/C;8EAC8E;AAC9E,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AAa1E;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,OAAO,GAAG,QAAQ,EAAE,EAC5B,IAAI,GAAE,iBAAsB,GAC3B,aAAa,CAqBf;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,IAAI,gBAAgB,CAAC,aAAa,CAAC,CAKxD"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * `sbox-sdk/mastra` — Mastra adapter. Projects the provider-neutral sandbox tool
3
+ * registry into Mastra's `createTool()` shape, keyed by tool id so the result
4
+ * drops into `new Agent({ tools })` or `new Mastra({ tools })`.
5
+ *
6
+ * Mastra is built on the AI SDK and also accepts AI SDK tools directly, so the
7
+ * `vercelAI()` plugin's output works in a Mastra agent too; this native adapter
8
+ * additionally gives Mastra-native registration (and a path to `outputSchema` /
9
+ * `suspend()`-based HITL in a follow-up).
10
+ *
11
+ * Approval is enforced inside `execute` via the shared `enforcePolicy` (same as
12
+ * every other adapter): `"deny"` short-circuits, `"ask"` awaits
13
+ * `policy.onApprovalRequest` when configured. Native Mastra `suspend()` HITL is
14
+ * a planned enhancement.
15
+ *
16
+ * Peer dependency: `@mastra/core` (optional).
17
+ */
18
+ import { createTool } from "@mastra/core/tools";
19
+ import { enforcePolicy } from "../agent-tools/policy.js";
20
+ import { createSandboxTools } from "../agent-tools/registry.js";
21
+ function resolve(source, opts) {
22
+ return Array.isArray(source)
23
+ ? { specs: source }
24
+ : { sandbox: source, specs: createSandboxTools(source, opts) };
25
+ }
26
+ /**
27
+ * Build Mastra tools from a live sandbox (capability-gated) or a pre-built
28
+ * `ToolSpec[]`. Register the result on an Agent or the Mastra instance.
29
+ */
30
+ export function toMastraTools(source, opts = {}) {
31
+ const { specs, sandbox } = resolve(source, opts);
32
+ const { policy } = opts;
33
+ const tools = {};
34
+ for (const spec of specs) {
35
+ tools[spec.name] = createTool({
36
+ description: spec.description,
37
+ execute: async (inputData) => {
38
+ const ctx = { sandbox };
39
+ const denied = await enforcePolicy(spec, inputData, ctx, policy);
40
+ if (denied !== null) {
41
+ return denied;
42
+ }
43
+ const result = await spec.execute(inputData, ctx);
44
+ return result.text;
45
+ },
46
+ id: spec.name,
47
+ inputSchema: spec.inputSchema,
48
+ });
49
+ }
50
+ return tools;
51
+ }
52
+ /**
53
+ * The Mastra framework adapter for the `ai()` plugin:
54
+ *
55
+ * ```ts
56
+ * import { ai } from "sbox-sdk/ai";
57
+ * import { mastra } from "sbox-sdk/mastra";
58
+ *
59
+ * const client = createSandboxClient({ provider: e2b(), plugins: [ai({ framework: mastra() })] });
60
+ * const sandbox = await client.create();
61
+ * const agent = new Agent({ name: "coder", model, tools: sandbox.tools });
62
+ * ```
63
+ */
64
+ export function mastra() {
65
+ return {
66
+ build: (sandbox, opts) => toMastraTools(sandbox, opts),
67
+ name: "mastra",
68
+ };
69
+ }