This repository was archived by the owner on May 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 161
Expand file tree
/
Copy pathopenapi.yaml
More file actions
363 lines (362 loc) · 9.89 KB
/
Copy pathopenapi.yaml
File metadata and controls
363 lines (362 loc) · 9.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
openapi: 3.0.0
info:
title: App API
version: "1.0.0"
description: >
This API provides endpoints for file uploads/downloads, browser actions, terminal interactions, text editor actions,
sandbox initialization, health checks, and project zipping & uploading. The `/terminal` endpoint is a WebSocket
endpoint for real-time terminal interactions.
servers:
- url: http://localhost:8330
paths:
/file/upload_to_s3:
post:
summary: Upload File to S3
description: >
Upload a file to S3. If the file size exceeds a predefined threshold, returns information to perform a multipart upload.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
file_path:
type: string
presigned_url:
type: string
required:
- file_path
- presigned_url
responses:
'200':
description: Successful file upload or multipart upload info returned.
'404':
description: File not found.
'500':
description: Upload failed.
/file/multipart_upload_to_s3:
post:
summary: Multipart Upload to S3
description: Upload file parts using presigned URLs for multipart uploads.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MultipartUploadRequest'
responses:
'200':
description: All parts uploaded successfully.
'206':
description: Partial success with some parts failed.
'400':
description: Bad Request.
'500':
description: Server error.
/file:
get:
summary: Download File
description: Download a file from the specified path.
parameters:
- in: query
name: path
required: true
schema:
type: string
description: The file path to download.
responses:
'200':
description: File returned.
'404':
description: File not found.
'500':
description: Error serving file.
/request-download-attachments:
post:
summary: Batch Download Attachments
description: >
Batch download files from the specified URLs and optionally save them to a subfolder.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DownloadRequest'
responses:
'200':
description: Batch download completed.
'500':
description: Error during download.
/browser/status:
get:
summary: Browser Status
description: Get the current status of the browser manager.
responses:
'200':
description: Browser status returned.
/browser/action:
post:
summary: Browser Action
description: Execute a browser action (e.g., navigation, interaction).
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BrowserActionRequest'
responses:
'200':
description: Browser action executed.
/text_editor:
post:
summary: Text Editor Action
description: Perform a text editor action such as opening or updating a file.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TextEditorAction'
responses:
'200':
description: Text editor action result.
'500':
description: Error performing action.
/init-sandbox:
post:
summary: Initialize Sandbox Environment
description: >
Initialize the sandbox by writing provided secrets to the user's .secrets directory.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
secrets:
type: object
additionalProperties:
type: string
required:
- secrets
responses:
'200':
description: Sandbox initialized.
'500':
description: Error processing secrets.
/healthz:
get:
summary: Health Check
description: Health check endpoint.
responses:
'200':
description: Service is healthy.
/zip-and-upload:
post:
summary: Zip and Upload Directory
description: >
Zip a directory (excluding specified folders) and upload the resulting archive to S3.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ZipAndUploadRequest'
responses:
'200':
description: Project processed and uploaded.
'500':
description: Error during processing.
/terminal/{terminal_id}/reset:
post:
summary: Reset Terminal
description: Reset a specific terminal identified by terminal_id.
parameters:
- in: path
name: terminal_id
required: true
schema:
type: string
description: The terminal identifier.
responses:
'200':
description: Terminal reset successfully.
'500':
description: Error resetting terminal.
/terminal/reset-all:
post:
summary: Reset All Terminals
description: Reset all active terminals.
responses:
'200':
description: All terminals reset successfully.
'500':
description: Error resetting terminals.
/terminal/{terminal_id}/view:
get:
summary: View Terminal History
description: >
View the terminal history. Use the query parameter `full` to toggle between full history and only the latest output.
parameters:
- in: path
name: terminal_id
required: true
schema:
type: string
description: The terminal identifier.
- in: query
name: full
required: false
schema:
type: boolean
default: true
description: If true, returns full history; otherwise, returns only the last output.
responses:
'200':
description: Terminal history returned.
'500':
description: Error viewing history.
/terminal/{terminal_id}/kill:
post:
summary: Kill Terminal Process
description: Kill the current process running in the specified terminal.
parameters:
- in: path
name: terminal_id
required: true
schema:
type: string
description: The terminal identifier.
responses:
'200':
description: Terminal process killed.
'500':
description: Error killing process.
/terminal/{terminal_id}/write:
post:
summary: Write to Terminal
description: >
Write input to a terminal process (optionally simulating an "enter" key press).
parameters:
- in: path
name: terminal_id
required: true
schema:
type: string
description: The terminal identifier.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TerminalWriteApiRequest'
responses:
'200':
description: Terminal write successful.
'500':
description: Error writing to terminal.
/terminal:
get:
summary: Terminal WebSocket Endpoint
description: >
Establish a WebSocket connection for real-time terminal interactions.
**Note:** This is a WebSocket endpoint and not accessible via standard HTTP requests.
responses:
'101':
description: Switching Protocols (WebSocket handshake successful).
components:
schemas:
MultipartUploadRequest:
type: object
properties:
file_path:
type: string
presigned_urls:
type: array
items:
type: object
properties:
part_number:
type: integer
url:
type: string
required:
- part_number
- url
part_size:
type: integer
required:
- file_path
- presigned_urls
- part_size
DownloadItem:
type: object
properties:
url:
type: string
filename:
type: string
required:
- url
- filename
DownloadRequest:
type: object
properties:
files:
type: array
items:
$ref: '#/components/schemas/DownloadItem'
folder:
type: string
required:
- files
BrowserActionRequest:
type: object
properties:
action:
type: string
url:
type: string
required:
- action
- url
TextEditorAction:
type: object
properties:
action:
type: string
file_path:
type: string
content:
type: string
required:
- action
- file_path
TerminalWriteApiRequest:
type: object
properties:
text:
type: string
enter:
type: boolean
required:
- text
ZipAndUploadRequest:
type: object
properties:
directory:
type: string
upload_url:
type: string
project_type:
type: string
enum:
- frontend
- backend
- nextjs
required:
- directory
- upload_url
- project_type