@intella/sdk 0.0.1 → 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.
- package/dist/agent-manager.d.ts +47 -0
- package/dist/agent-manager.d.ts.map +1 -0
- package/dist/agent-manager.js +90 -0
- package/dist/agent-manager.js.map +1 -0
- package/dist/agents/base-agent.d.ts +41 -0
- package/dist/agents/base-agent.d.ts.map +1 -0
- package/dist/agents/base-agent.js +139 -0
- package/dist/agents/base-agent.js.map +1 -0
- package/dist/agents/claude-agent.d.ts +24 -0
- package/dist/agents/claude-agent.d.ts.map +1 -0
- package/dist/agents/claude-agent.js +65 -0
- package/dist/agents/claude-agent.js.map +1 -0
- package/dist/agents/codex-agent.d.ts +25 -0
- package/dist/agents/codex-agent.d.ts.map +1 -0
- package/dist/agents/codex-agent.js +62 -0
- package/dist/agents/codex-agent.js.map +1 -0
- package/dist/agents/intella-lite-agent.d.ts +21 -0
- package/dist/agents/intella-lite-agent.d.ts.map +1 -0
- package/dist/agents/intella-lite-agent.js +43 -0
- package/dist/agents/intella-lite-agent.js.map +1 -0
- package/dist/agents/opencode-agent.d.ts +20 -0
- package/dist/agents/opencode-agent.d.ts.map +1 -0
- package/dist/agents/opencode-agent.js +36 -0
- package/dist/agents/opencode-agent.js.map +1 -0
- package/dist/filesystem/agentfs-provider.d.ts +42 -0
- package/dist/filesystem/agentfs-provider.d.ts.map +1 -0
- package/dist/filesystem/agentfs-provider.js +308 -0
- package/dist/filesystem/agentfs-provider.js.map +1 -0
- package/dist/filesystem/base-provider.d.ts +55 -0
- package/dist/filesystem/base-provider.d.ts.map +1 -0
- package/dist/filesystem/base-provider.js +44 -0
- package/dist/filesystem/base-provider.js.map +1 -0
- package/dist/filesystem/index.d.ts +4 -0
- package/dist/filesystem/index.d.ts.map +1 -0
- package/{src/filesystem/index.ts → dist/filesystem/index.js} +1 -1
- package/dist/filesystem/index.js.map +1 -0
- package/dist/filesystem/memory-provider.d.ts +44 -0
- package/dist/filesystem/memory-provider.d.ts.map +1 -0
- package/dist/filesystem/memory-provider.js +227 -0
- package/dist/filesystem/memory-provider.js.map +1 -0
- package/dist/filesystem-manager.d.ts +75 -0
- package/dist/filesystem-manager.d.ts.map +1 -0
- package/dist/filesystem-manager.js +164 -0
- package/dist/filesystem-manager.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/{src/index.ts → dist/index.js} +3 -46
- package/dist/index.js.map +1 -0
- package/dist/orchestrator.d.ts +32 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +136 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/sandbox/base-provider.d.ts +106 -0
- package/dist/sandbox/base-provider.d.ts.map +1 -0
- package/dist/sandbox/base-provider.js +73 -0
- package/dist/sandbox/base-provider.js.map +1 -0
- package/dist/sandbox/daytona-provider.d.ts +93 -0
- package/dist/sandbox/daytona-provider.d.ts.map +1 -0
- package/dist/sandbox/daytona-provider.js +378 -0
- package/dist/sandbox/daytona-provider.js.map +1 -0
- package/dist/sandbox/e2b-provider.d.ts +85 -0
- package/dist/sandbox/e2b-provider.d.ts.map +1 -0
- package/dist/sandbox/e2b-provider.js +342 -0
- package/dist/sandbox/e2b-provider.js.map +1 -0
- package/dist/sandbox/modal-provider.d.ts +92 -0
- package/dist/sandbox/modal-provider.d.ts.map +1 -0
- package/dist/sandbox/modal-provider.js +516 -0
- package/dist/sandbox/modal-provider.js.map +1 -0
- package/dist/sandbox-manager.d.ts +59 -0
- package/dist/sandbox-manager.d.ts.map +1 -0
- package/dist/sandbox-manager.js +141 -0
- package/dist/sandbox-manager.js.map +1 -0
- package/dist/sdk.d.ts +173 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/sdk.js +273 -0
- package/dist/sdk.js.map +1 -0
- package/dist/types.d.ts +419 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/code-extractor.d.ts +103 -0
- package/dist/utils/code-extractor.d.ts.map +1 -0
- package/dist/utils/code-extractor.js +133 -0
- package/dist/utils/code-extractor.js.map +1 -0
- package/package.json +6 -1
- package/examples/claude-code/README.md +0 -178
- package/examples/claude-code/advanced-config.ts +0 -55
- package/examples/claude-code/basic-usage.ts +0 -56
- package/examples/claude-code/model-comparison.ts +0 -50
- package/examples/claude-code/orchestration.ts +0 -70
- package/examples/claude-code/streaming.ts +0 -69
- package/examples/claude-code/tsconfig.json +0 -19
- package/examples/code-extractor/README.md +0 -77
- package/examples/code-extractor/example.ts +0 -145
- package/examples/filesystem/basic-usage.ts +0 -84
- package/examples/integrated-task/README.md +0 -68
- package/examples/integrated-task/integrated-usage.ts +0 -193
- package/examples/integrated-task/simple-example.ts +0 -51
- package/examples/integrated-task/tsconfig.json +0 -19
- package/examples/sandbox/basic-usage.ts +0 -173
- package/src/agent-manager.ts +0 -104
- package/src/agents/base-agent.ts +0 -166
- package/src/agents/claude-agent.ts +0 -77
- package/src/agents/codex-agent.ts +0 -72
- package/src/agents/intella-lite-agent.ts +0 -55
- package/src/agents/opencode-agent.ts +0 -45
- package/src/filesystem/agentfs-provider.ts +0 -328
- package/src/filesystem/base-provider.ts +0 -98
- package/src/filesystem/memory-provider.ts +0 -267
- package/src/filesystem-manager.ts +0 -213
- package/src/orchestrator.ts +0 -177
- package/src/sandbox/base-provider.ts +0 -184
- package/src/sandbox/daytona-provider.ts +0 -462
- package/src/sandbox/e2b-provider.ts +0 -419
- package/src/sandbox/modal-provider.ts +0 -597
- package/src/sandbox-manager.ts +0 -175
- package/src/sdk.ts +0 -401
- package/src/types.ts +0 -451
- package/src/utils/code-extractor.ts +0 -194
- package/tsconfig.json +0 -25
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
import { BaseSandboxProvider } from './base-provider.js';
|
|
2
|
+
import { ModalClient } from 'modal';
|
|
3
|
+
/**
|
|
4
|
+
* Modal Sandbox Provider
|
|
5
|
+
* Provides sandbox execution capabilities using Modal
|
|
6
|
+
*/
|
|
7
|
+
export class ModalSandboxProvider extends BaseSandboxProvider {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
super('modal');
|
|
10
|
+
this.client = null;
|
|
11
|
+
this.sandboxInstance = null;
|
|
12
|
+
this.app = null;
|
|
13
|
+
this.image = null;
|
|
14
|
+
if (config) {
|
|
15
|
+
this.config = config;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
getClient() {
|
|
19
|
+
if (!this.client) {
|
|
20
|
+
const tokenId = this.config.apiKey || process.env.MODAL_TOKEN_ID;
|
|
21
|
+
const tokenSecret = process.env.MODAL_TOKEN_SECRET;
|
|
22
|
+
if (tokenId && tokenSecret) {
|
|
23
|
+
this.client = new ModalClient({
|
|
24
|
+
tokenId,
|
|
25
|
+
tokenSecret,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
console.warn('Modal token ID and secret are not set. Using environment variables.');
|
|
30
|
+
try {
|
|
31
|
+
this.client = new ModalClient();
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
throw new Error('Failed to initialize Modal client: ' + (error instanceof Error ? error.message : String(error)));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return this.client;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Initialize/create a Modal sandbox
|
|
42
|
+
*/
|
|
43
|
+
async initializeSandbox(config) {
|
|
44
|
+
if (config) {
|
|
45
|
+
this.config = { ...this.config, ...config };
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
// Dynamic import to handle optional dependency
|
|
49
|
+
// Initialize Modal client
|
|
50
|
+
// ModalClient can be initialized without parameters if MODAL_TOKEN_ID and MODAL_TOKEN_SECRET are in env
|
|
51
|
+
const modalClient = this.getClient();
|
|
52
|
+
// Get or create app
|
|
53
|
+
const appName = this.config.appName || 'intella-sandbox';
|
|
54
|
+
this.app = await modalClient.apps.fromName(appName, {
|
|
55
|
+
createIfMissing: true,
|
|
56
|
+
});
|
|
57
|
+
// Create or get image
|
|
58
|
+
const imageName = this.config.imageName || 'python:3.13-slim';
|
|
59
|
+
if (imageName.includes(':')) {
|
|
60
|
+
// Registry image (e.g., "python:3.13-slim")
|
|
61
|
+
this.image = modalClient.images.fromRegistry(imageName);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
// Try named image first, fallback to registry if not found
|
|
65
|
+
try {
|
|
66
|
+
this.image = modalClient.images.fromId(this.config.fromSandboxId || '');
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
// If named image doesn't exist, try as registry image
|
|
70
|
+
this.image = modalClient.images.fromRegistry(imageName);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Create sandbox with configuration
|
|
74
|
+
const sandboxOptions = {
|
|
75
|
+
timeout: Math.floor((this.config.timeout || 5 * 60 * 1000) / 1000), // Convert to seconds
|
|
76
|
+
};
|
|
77
|
+
if (this.config.env) {
|
|
78
|
+
const secret = await modalClient.secrets.fromObject(this.config.env);
|
|
79
|
+
sandboxOptions.secrets = [secret];
|
|
80
|
+
}
|
|
81
|
+
if (this.config.workdir) {
|
|
82
|
+
sandboxOptions.workdir = this.config.workdir;
|
|
83
|
+
}
|
|
84
|
+
this.sandboxInstance = await modalClient.sandboxes.create(this.app, this.image, sandboxOptions);
|
|
85
|
+
this.sandboxId = this.sandboxInstance.sandboxId || '';
|
|
86
|
+
this.initialized = true;
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
throw new Error(`Failed to initialize Modal sandbox: ${error instanceof Error ? error.message : String(error)}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Connect to an existing Modal sandbox by ID
|
|
94
|
+
*/
|
|
95
|
+
async fromSandbox(sandboxId, config) {
|
|
96
|
+
if (config) {
|
|
97
|
+
this.config = { ...this.config, ...config };
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
// Initialize Modal client
|
|
101
|
+
const modalClient = this.getClient();
|
|
102
|
+
// Get or create app (needed for fromId)
|
|
103
|
+
const appName = this.config.appName || 'intella-sandbox';
|
|
104
|
+
this.app = await modalClient.apps.fromName(appName, {
|
|
105
|
+
createIfMissing: true,
|
|
106
|
+
});
|
|
107
|
+
// Get existing sandbox by ID
|
|
108
|
+
this.sandboxInstance = await modalClient.sandboxes.fromId(sandboxId);
|
|
109
|
+
this.sandboxId = this.sandboxInstance.sandboxId || sandboxId;
|
|
110
|
+
this.initialized = true;
|
|
111
|
+
return this.sandboxInstance;
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
throw new Error(`Failed to connect to Modal sandbox: ${error instanceof Error ? error.message : String(error)}`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Close/cleanup the Modal sandbox
|
|
119
|
+
*/
|
|
120
|
+
async close() {
|
|
121
|
+
if (this.sandboxInstance && this.initialized) {
|
|
122
|
+
try {
|
|
123
|
+
await this.sandboxInstance.terminate();
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
// Ignore errors during cleanup
|
|
127
|
+
console.warn('Error closing Modal sandbox:', error);
|
|
128
|
+
}
|
|
129
|
+
this.sandboxInstance = null;
|
|
130
|
+
this.client = null;
|
|
131
|
+
this.app = null;
|
|
132
|
+
this.image = null;
|
|
133
|
+
this.sandboxId = null;
|
|
134
|
+
this.initialized = false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Execute a command in the Modal sandbox
|
|
139
|
+
*/
|
|
140
|
+
async executeCommand(command, options) {
|
|
141
|
+
this.ensureInitialized();
|
|
142
|
+
const startTime = Date.now();
|
|
143
|
+
try {
|
|
144
|
+
// Parse command string into array
|
|
145
|
+
// Handle quoted arguments properly
|
|
146
|
+
const commandParts = command.match(/(?:[^\s"]+|"[^"]*")+/g) || [command];
|
|
147
|
+
const cmdArray = commandParts.map((part) => part.replace(/^"|"$/g, ''));
|
|
148
|
+
const execOptions = {
|
|
149
|
+
timeout: Math.floor((options?.timeout || this.config.timeout || 3000) / 1000), // Convert to seconds
|
|
150
|
+
};
|
|
151
|
+
// Execute command
|
|
152
|
+
const process = await this.sandboxInstance.exec(cmdArray, execOptions);
|
|
153
|
+
// Read stdout and stderr
|
|
154
|
+
let stdout = '';
|
|
155
|
+
let stderr = '';
|
|
156
|
+
// Read stdout
|
|
157
|
+
try {
|
|
158
|
+
stdout = await process.stdout.readText();
|
|
159
|
+
}
|
|
160
|
+
catch (e) {
|
|
161
|
+
// If readText is not available, try iterating
|
|
162
|
+
if (process.stdout && typeof process.stdout[Symbol.asyncIterator] === 'function') {
|
|
163
|
+
for await (const chunk of process.stdout) {
|
|
164
|
+
stdout += typeof chunk === 'string' ? chunk : [chunk].toString();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// Read stderr
|
|
169
|
+
try {
|
|
170
|
+
stderr = await process.stderr.readText();
|
|
171
|
+
}
|
|
172
|
+
catch (e) {
|
|
173
|
+
// If readText is not available, try iterating
|
|
174
|
+
if (process.stderr && typeof process.stderr[Symbol.asyncIterator] === 'function') {
|
|
175
|
+
for await (const chunk of process.stderr) {
|
|
176
|
+
stderr += typeof chunk === 'string' ? chunk : [chunk].toString();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// Wait for process to complete
|
|
181
|
+
await process.wait();
|
|
182
|
+
const executionTime = Date.now() - startTime;
|
|
183
|
+
return {
|
|
184
|
+
exitCode: process.returncode || 0,
|
|
185
|
+
stdout: stdout || '',
|
|
186
|
+
stderr: stderr || '',
|
|
187
|
+
executionTime,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
const executionTime = Date.now() - startTime;
|
|
192
|
+
return {
|
|
193
|
+
exitCode: 1,
|
|
194
|
+
stdout: '',
|
|
195
|
+
stderr: error instanceof Error ? error.message : String(error),
|
|
196
|
+
executionTime,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Run code (e.g., Python, JavaScript) in the Modal sandbox
|
|
202
|
+
*/
|
|
203
|
+
async runCode(code, options) {
|
|
204
|
+
this.ensureInitialized();
|
|
205
|
+
const startTime = Date.now();
|
|
206
|
+
try {
|
|
207
|
+
// Determine interpreter based on language
|
|
208
|
+
const language = options?.language || 'python';
|
|
209
|
+
const interpreterMap = {
|
|
210
|
+
python: ['python', '-c'],
|
|
211
|
+
javascript: ['node', '-e'],
|
|
212
|
+
typescript: ['ts-node', '-e'],
|
|
213
|
+
bash: ['bash', '-c'],
|
|
214
|
+
sh: ['sh', '-c'],
|
|
215
|
+
};
|
|
216
|
+
const interpreter = interpreterMap[language.toLowerCase()] || ['python', '-c'];
|
|
217
|
+
const execOptions = {
|
|
218
|
+
timeout: (options?.timeout || this.config.timeout || 30000) / 1000, // Convert to seconds
|
|
219
|
+
};
|
|
220
|
+
// Execute code
|
|
221
|
+
const process = await this.sandboxInstance.exec([...interpreter, code], execOptions);
|
|
222
|
+
// Stream stdout/stderr if callbacks provided
|
|
223
|
+
const stdoutChunks = [];
|
|
224
|
+
const stderrChunks = [];
|
|
225
|
+
// Handle stdout
|
|
226
|
+
if (options?.onStdout && process.stdout && typeof process.stdout[Symbol.asyncIterator] === 'function') {
|
|
227
|
+
// Stream mode with callback
|
|
228
|
+
for await (const line of process.stdout) {
|
|
229
|
+
const text = typeof line === 'string' ? line : [line].toString();
|
|
230
|
+
stdoutChunks.push(text);
|
|
231
|
+
options.onStdout(text);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
// Read all at once
|
|
236
|
+
try {
|
|
237
|
+
const stdoutText = await process.stdout.readText();
|
|
238
|
+
const lines = stdoutText.split('\n');
|
|
239
|
+
stdoutChunks.push(...lines);
|
|
240
|
+
}
|
|
241
|
+
catch (e) {
|
|
242
|
+
// Fallback to iteration
|
|
243
|
+
if (process.stdout && typeof process.stdout[Symbol.asyncIterator] === 'function') {
|
|
244
|
+
for await (const line of process.stdout) {
|
|
245
|
+
const text = typeof line === 'string' ? line : [line].toString();
|
|
246
|
+
stdoutChunks.push(text);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
// Handle stderr
|
|
252
|
+
if (options?.onStderr && process.stderr && typeof process.stderr[Symbol.asyncIterator] === 'function') {
|
|
253
|
+
// Stream mode with callback
|
|
254
|
+
for await (const line of process.stderr) {
|
|
255
|
+
const text = typeof line === 'string' ? line : [line].toString();
|
|
256
|
+
stderrChunks.push(text);
|
|
257
|
+
options.onStderr(text);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
// Read all at once
|
|
262
|
+
try {
|
|
263
|
+
const stderrText = await process.stderr.readText();
|
|
264
|
+
const lines = stderrText.split('\n');
|
|
265
|
+
stderrChunks.push(...lines);
|
|
266
|
+
}
|
|
267
|
+
catch (e) {
|
|
268
|
+
// Fallback to iteration
|
|
269
|
+
if (process.stderr && typeof process.stderr[Symbol.asyncIterator] === 'function') {
|
|
270
|
+
for await (const line of process.stderr) {
|
|
271
|
+
const text = typeof line === 'string' ? line : [line].toString();
|
|
272
|
+
stderrChunks.push(text);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
// Wait for process to complete
|
|
278
|
+
await process.wait();
|
|
279
|
+
const stdout = stdoutChunks.join('\n');
|
|
280
|
+
const stderr = stderrChunks.join('\n');
|
|
281
|
+
const executionTime = Date.now() - startTime;
|
|
282
|
+
return {
|
|
283
|
+
text: stdout || undefined,
|
|
284
|
+
results: stdout ? [{ text: stdout }] : [],
|
|
285
|
+
stdout: stdoutChunks,
|
|
286
|
+
stderr: stderrChunks,
|
|
287
|
+
error: process.returncode !== 0
|
|
288
|
+
? {
|
|
289
|
+
name: 'CodeExecutionError',
|
|
290
|
+
value: stderr || 'Code execution failed',
|
|
291
|
+
traceback: stderr || '',
|
|
292
|
+
}
|
|
293
|
+
: undefined,
|
|
294
|
+
executionTime,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
const executionTime = Date.now() - startTime;
|
|
299
|
+
return {
|
|
300
|
+
text: undefined,
|
|
301
|
+
results: [],
|
|
302
|
+
stdout: [],
|
|
303
|
+
stderr: [error instanceof Error ? error.message : String(error)],
|
|
304
|
+
error: {
|
|
305
|
+
name: 'CodeExecutionError',
|
|
306
|
+
value: error instanceof Error ? error.message : String(error),
|
|
307
|
+
traceback: error instanceof Error ? error.stack || '' : '',
|
|
308
|
+
},
|
|
309
|
+
executionTime,
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Upload a file to the Modal sandbox
|
|
315
|
+
* Uses the filesystem API
|
|
316
|
+
*/
|
|
317
|
+
async uploadFile(localPath, remotePath) {
|
|
318
|
+
this.ensureInitialized();
|
|
319
|
+
try {
|
|
320
|
+
const fs = await import('fs/promises');
|
|
321
|
+
const content = await fs.readFile(localPath);
|
|
322
|
+
// Use filesystem API to write file
|
|
323
|
+
const file = await this.sandboxInstance.open(remotePath, 'w');
|
|
324
|
+
await file.write(content);
|
|
325
|
+
file.close();
|
|
326
|
+
}
|
|
327
|
+
catch (error) {
|
|
328
|
+
throw new Error(`Failed to upload file to Modal sandbox: ${error instanceof Error ? error.message : String(error)}`);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Download a file from the Modal sandbox
|
|
333
|
+
* Uses the filesystem API
|
|
334
|
+
*/
|
|
335
|
+
async downloadFile(remotePath, localPath) {
|
|
336
|
+
this.ensureInitialized();
|
|
337
|
+
try {
|
|
338
|
+
// Use filesystem API to read file
|
|
339
|
+
const file = await this.sandboxInstance.open(remotePath, 'r');
|
|
340
|
+
const content = await file.read();
|
|
341
|
+
file.close();
|
|
342
|
+
const fs = await import('fs/promises');
|
|
343
|
+
// Handle Buffer or Uint8Array
|
|
344
|
+
const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content);
|
|
345
|
+
await fs.writeFile(localPath, buffer);
|
|
346
|
+
}
|
|
347
|
+
catch (error) {
|
|
348
|
+
throw new Error(`Failed to download file from Modal sandbox: ${error instanceof Error ? error.message : String(error)}`);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Read a file from the Modal sandbox
|
|
353
|
+
* Uses the filesystem API
|
|
354
|
+
*/
|
|
355
|
+
async readFile(path) {
|
|
356
|
+
this.ensureInitialized();
|
|
357
|
+
try {
|
|
358
|
+
// Use filesystem API to read file
|
|
359
|
+
const file = await this.sandboxInstance.open(path, 'r');
|
|
360
|
+
const content = await file.read();
|
|
361
|
+
file.close();
|
|
362
|
+
return typeof content === 'string' ? content : [content].toString();
|
|
363
|
+
}
|
|
364
|
+
catch (error) {
|
|
365
|
+
throw new Error(`Failed to read file from Modal sandbox: ${error instanceof Error ? error.message : String(error)}`);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Write a file to the Modal sandbox
|
|
370
|
+
* Uses the filesystem API
|
|
371
|
+
*/
|
|
372
|
+
async writeFile(path, content) {
|
|
373
|
+
this.ensureInitialized();
|
|
374
|
+
try {
|
|
375
|
+
// Use filesystem API to write file
|
|
376
|
+
const file = await this.sandboxInstance.open(path, 'w');
|
|
377
|
+
file.write(Buffer.from(content, 'utf-8'));
|
|
378
|
+
file.close();
|
|
379
|
+
}
|
|
380
|
+
catch (error) {
|
|
381
|
+
throw new Error(`Failed to write file to Modal sandbox: ${error instanceof Error ? error.message : String(error)}`);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* List files in a directory
|
|
386
|
+
* Uses exec to run ls command
|
|
387
|
+
*/
|
|
388
|
+
async listFiles(path) {
|
|
389
|
+
this.ensureInitialized();
|
|
390
|
+
try {
|
|
391
|
+
const process = await this.sandboxInstance.exec(['ls', '-1', path], {
|
|
392
|
+
timeoutMs: 5000,
|
|
393
|
+
});
|
|
394
|
+
let output = '';
|
|
395
|
+
try {
|
|
396
|
+
output = await process.stdout.readText();
|
|
397
|
+
}
|
|
398
|
+
catch (e) {
|
|
399
|
+
// Fallback to iteration
|
|
400
|
+
if (process.stdout && typeof process.stdout[Symbol.asyncIterator] === 'function') {
|
|
401
|
+
for await (const chunk of process.stdout) {
|
|
402
|
+
output += typeof chunk === 'string' ? chunk : [chunk].toString();
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
await process.wait();
|
|
407
|
+
// Parse ls output
|
|
408
|
+
return output
|
|
409
|
+
.split('\n')
|
|
410
|
+
.map((line) => line.trim())
|
|
411
|
+
.filter((line) => line.length > 0);
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
throw new Error(`Failed to list files in Modal sandbox: ${error instanceof Error ? error.message : String(error)}`);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Check if a file exists
|
|
419
|
+
*/
|
|
420
|
+
async fileExists(path) {
|
|
421
|
+
this.ensureInitialized();
|
|
422
|
+
try {
|
|
423
|
+
const process = await this.sandboxInstance.exec(['test', '-f', path], {
|
|
424
|
+
timeoutMs: 5000,
|
|
425
|
+
});
|
|
426
|
+
await process.wait();
|
|
427
|
+
return (process.returncode || 0) === 0;
|
|
428
|
+
}
|
|
429
|
+
catch {
|
|
430
|
+
return false;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Delete a file
|
|
435
|
+
* Uses exec to run rm command
|
|
436
|
+
*/
|
|
437
|
+
async deleteFile(path) {
|
|
438
|
+
this.ensureInitialized();
|
|
439
|
+
try {
|
|
440
|
+
const process = await this.sandboxInstance.exec(['rm', path], {
|
|
441
|
+
timeoutMs: 5000,
|
|
442
|
+
});
|
|
443
|
+
await process.wait();
|
|
444
|
+
if ((process.returncode || 0) !== 0) {
|
|
445
|
+
let stderr = '';
|
|
446
|
+
try {
|
|
447
|
+
stderr = await process.stderr.readText();
|
|
448
|
+
}
|
|
449
|
+
catch (e) {
|
|
450
|
+
// Ignore read errors
|
|
451
|
+
}
|
|
452
|
+
throw new Error(`Failed to delete file: ${stderr || 'Unknown error'}`);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
catch (error) {
|
|
456
|
+
throw new Error(`Failed to delete file in Modal sandbox: ${error instanceof Error ? error.message : String(error)}`);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Get sandbox status
|
|
461
|
+
*/
|
|
462
|
+
async getStatus() {
|
|
463
|
+
this.ensureInitialized();
|
|
464
|
+
try {
|
|
465
|
+
// Modal sandboxes don't expose a direct status endpoint
|
|
466
|
+
// We can check if the sandbox instance is available
|
|
467
|
+
return {
|
|
468
|
+
isRunning: this.initialized && this.sandboxInstance !== null,
|
|
469
|
+
sandboxId: this.sandboxId,
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
catch {
|
|
473
|
+
return {
|
|
474
|
+
isRunning: false,
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Get detailed sandbox information
|
|
480
|
+
*/
|
|
481
|
+
async getInfo(sandboxId) {
|
|
482
|
+
if (!sandboxId && this.sandboxInstance) {
|
|
483
|
+
this.ensureInitialized();
|
|
484
|
+
const info = this.sandboxInstance;
|
|
485
|
+
const isRunning = await info.poll();
|
|
486
|
+
return {
|
|
487
|
+
sandboxId: this.sandboxId,
|
|
488
|
+
provider: this.type,
|
|
489
|
+
isRunning: isRunning === null,
|
|
490
|
+
isInitialized: this.initialized,
|
|
491
|
+
createdAt: new Date(),
|
|
492
|
+
metadata: {
|
|
493
|
+
error: isRunning
|
|
494
|
+
},
|
|
495
|
+
info: this.sandboxInstance,
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
else if (sandboxId) {
|
|
499
|
+
const sandbox = await this.client.sandboxes.fromId(sandboxId);
|
|
500
|
+
const isRunning = await sandbox.poll();
|
|
501
|
+
return {
|
|
502
|
+
sandboxId: sandbox.sandboxId,
|
|
503
|
+
provider: this.type,
|
|
504
|
+
isRunning: isRunning === null,
|
|
505
|
+
isInitialized: this.initialized,
|
|
506
|
+
createdAt: new Date(),
|
|
507
|
+
metadata: {},
|
|
508
|
+
info: sandbox,
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
else {
|
|
512
|
+
throw new Error('Sandbox ID or active instance is required to get sandbox info');
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
//# sourceMappingURL=modal-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-provider.js","sourceRoot":"","sources":["../../src/sandbox/modal-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAW,MAAM,OAAO,CAAC;AAE7C;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,mBAAmB;IAM3D,YAAY,MAAsB;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QANP,WAAM,GAAuB,IAAI,CAAC;QACpC,oBAAe,GAAmB,IAAI,CAAC;QACvC,QAAG,GAAe,IAAI,CAAC;QACvB,UAAK,GAAe,IAAI,CAAC;QAI/B,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACvB,CAAC;IACH,CAAC;IAED,SAAS;QACP,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;YACjE,MAAM,WAAW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,0 +1,59 @@
|
|
|
1
|
+
import type { SandboxProviderType, SandboxConfig, ISandboxProvider } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sandbox Manager
|
|
4
|
+
* Manages sandbox provider instances and configurations
|
|
5
|
+
*/
|
|
6
|
+
export declare class SandboxManager {
|
|
7
|
+
private sandboxes;
|
|
8
|
+
private defaultProviderType;
|
|
9
|
+
private activeSandbox;
|
|
10
|
+
constructor(config?: {
|
|
11
|
+
provider?: SandboxProviderType;
|
|
12
|
+
config?: SandboxConfig;
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Register or update a sandbox provider instance
|
|
16
|
+
*/
|
|
17
|
+
registerProvider(type: SandboxProviderType, provider: ISandboxProvider): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get a sandbox provider instance
|
|
20
|
+
*/
|
|
21
|
+
getProvider(type?: SandboxProviderType): ISandboxProvider;
|
|
22
|
+
/**
|
|
23
|
+
* List all available sandbox providers
|
|
24
|
+
*/
|
|
25
|
+
listProviders(): SandboxProviderType[];
|
|
26
|
+
/**
|
|
27
|
+
* Check if a provider is registered
|
|
28
|
+
*/
|
|
29
|
+
hasProvider(type: SandboxProviderType): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Initialize/create a sandbox with the specified provider
|
|
32
|
+
*/
|
|
33
|
+
initializeSandbox(type: SandboxProviderType, config?: SandboxConfig): Promise<ISandboxProvider>;
|
|
34
|
+
/**
|
|
35
|
+
* Get the active sandbox provider
|
|
36
|
+
*/
|
|
37
|
+
getActiveSandbox(): ISandboxProvider | null;
|
|
38
|
+
/**
|
|
39
|
+
* Set the default provider type (does not initialize)
|
|
40
|
+
*/
|
|
41
|
+
setDefaultProvider(type: SandboxProviderType): void;
|
|
42
|
+
/**
|
|
43
|
+
* Get the default provider type
|
|
44
|
+
*/
|
|
45
|
+
getDefaultProviderType(): SandboxProviderType | null;
|
|
46
|
+
/**
|
|
47
|
+
* Close the active sandbox
|
|
48
|
+
*/
|
|
49
|
+
closeActiveSandbox(): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Close all sandboxes
|
|
52
|
+
*/
|
|
53
|
+
closeAll(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Remove a provider (cannot remove if it's the active sandbox)
|
|
56
|
+
*/
|
|
57
|
+
removeProvider(type: SandboxProviderType): void;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=sandbox-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-manager.d.ts","sourceRoot":"","sources":["../src/sandbox-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAKvF;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,SAAS,CAAyD;IAC1E,OAAO,CAAC,mBAAmB,CAAoC;IAC/D,OAAO,CAAC,aAAa,CAAiC;gBAE1C,MAAM,CAAC,EAAE;QACnB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;QAC/B,MAAM,CAAC,EAAE,aAAa,CAAC;KACxB;IAUD;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAS7E;;OAEG;IACH,WAAW,CAAC,IAAI,CAAC,EAAE,mBAAmB,GAAG,gBAAgB;IAkBzD;;OAEG;IACH,aAAa,IAAI,mBAAmB,EAAE;IAItC;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO;IAI/C;;OAEG;IACG,iBAAiB,CACrB,IAAI,EAAE,mBAAmB,EACzB,MAAM,CAAC,EAAE,aAAa,GACrB,OAAO,CAAC,gBAAgB,CAAC;IAmB5B;;OAEG;IACH,gBAAgB,IAAI,gBAAgB,GAAG,IAAI;IAI3C;;OAEG;IACH,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI;IAOn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