@cofy-x/axern-sdk 0.2.0-bootstrap.0
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/README.md +169 -0
- package/dist/client/index.d.ts +63 -0
- package/dist/client/index.js +213 -0
- package/dist/config/index.d.ts +15 -0
- package/dist/config/index.js +65 -0
- package/dist/errors/index.d.ts +46 -0
- package/dist/errors/index.js +123 -0
- package/dist/generated/proto.d.ts +10 -0
- package/dist/generated/proto.js +80 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +13 -0
- package/dist/node/archive.d.ts +9 -0
- package/dist/node/archive.js +41 -0
- package/dist/node/attached_process.d.ts +10 -0
- package/dist/node/attached_process.js +60 -0
- package/dist/node/capabilities.d.ts +8 -0
- package/dist/node/capabilities.js +51 -0
- package/dist/node/client.d.ts +44 -0
- package/dist/node/client.js +96 -0
- package/dist/node/computer_use.d.ts +12 -0
- package/dist/node/computer_use.js +81 -0
- package/dist/node/context.d.ts +22 -0
- package/dist/node/context.js +37 -0
- package/dist/node/exec.d.ts +12 -0
- package/dist/node/exec.js +93 -0
- package/dist/node/files.d.ts +18 -0
- package/dist/node/files.js +101 -0
- package/dist/node/process.d.ts +36 -0
- package/dist/node/process.js +144 -0
- package/dist/node/streams.d.ts +8 -0
- package/dist/node/streams.js +70 -0
- package/dist/proto/axern/common/file/v1/file.proto +31 -0
- package/dist/proto/axern/control/admin/v1/allocation_lifecycle.proto +91 -0
- package/dist/proto/axern/control/admin/v1/audit.proto +53 -0
- package/dist/proto/axern/control/admin/v1/node.proto +49 -0
- package/dist/proto/axern/control/admin/v1/reliability.proto +184 -0
- package/dist/proto/axern/control/admin/v1/service.proto +18 -0
- package/dist/proto/axern/control/admin/v1/storage.proto +81 -0
- package/dist/proto/axern/control/agentprofile/v1/agent_profile.proto +169 -0
- package/dist/proto/axern/control/catalog/v1/catalog.proto +127 -0
- package/dist/proto/axern/control/common/v1/common.proto +171 -0
- package/dist/proto/axern/control/environment/v1/environment.proto +94 -0
- package/dist/proto/axern/control/function/v1/function.proto +130 -0
- package/dist/proto/axern/control/function/v1/function_types.proto +233 -0
- package/dist/proto/axern/control/gateway/v1/gateway.proto +60 -0
- package/dist/proto/axern/control/namespace/v1/namespace.proto +52 -0
- package/dist/proto/axern/control/node/v1/node_control.proto +302 -0
- package/dist/proto/axern/control/quota/v1/quota.proto +113 -0
- package/dist/proto/axern/control/rollout/v1/rollout.proto +344 -0
- package/dist/proto/axern/control/run/v1/run.proto +88 -0
- package/dist/proto/axern/control/secret/v1/secret.proto +75 -0
- package/dist/proto/axern/control/service/v1/service.proto +96 -0
- package/dist/proto/axern/control/service/v1/service_event.proto +47 -0
- package/dist/proto/axern/control/service/v1/service_replica.proto +74 -0
- package/dist/proto/axern/control/service/v1/service_types.proto +155 -0
- package/dist/proto/axern/control/storage/v1/storage.proto +107 -0
- package/dist/proto/axern/control/storage/v1/storage_types.proto +125 -0
- package/dist/proto/axern/control/tunnel/v1/tunnel.proto +195 -0
- package/dist/proto/axern/data/artifact/v1/artifact.proto +19 -0
- package/dist/proto/axern/node/sandbox/v1/node.proto +652 -0
- package/dist/proto/axern/tunnel/v1/tunnel.proto +50 -0
- package/dist/resources.d.ts +13 -0
- package/dist/resources.js +107 -0
- package/dist/sandbox/archive.d.ts +8 -0
- package/dist/sandbox/archive.js +228 -0
- package/dist/sandbox/index.d.ts +86 -0
- package/dist/sandbox/index.js +204 -0
- package/dist/sandbox/lifecycle.d.ts +11 -0
- package/dist/sandbox/lifecycle.js +57 -0
- package/dist/tunnel/connector.d.ts +34 -0
- package/dist/tunnel/connector.js +141 -0
- package/dist/tunnel/control.d.ts +22 -0
- package/dist/tunnel/control.js +91 -0
- package/dist/tunnel/debug.d.ts +6 -0
- package/dist/tunnel/debug.js +19 -0
- package/dist/tunnel/relay.d.ts +17 -0
- package/dist/tunnel/relay.js +41 -0
- package/dist/tunnel/runtime.d.ts +34 -0
- package/dist/tunnel/runtime.js +118 -0
- package/dist/tunnel/session.d.ts +25 -0
- package/dist/tunnel/session.js +95 -0
- package/dist/tunnel/target.d.ts +7 -0
- package/dist/tunnel/target.js +28 -0
- package/dist/tunnel/types.d.ts +25 -0
- package/dist/tunnel/types.js +6 -0
- package/dist/types.d.ts +219 -0
- package/dist/types.js +8 -0
- package/dist/validation.d.ts +10 -0
- package/dist/validation.js +37 -0
- package/dist/version.d.ts +7 -0
- package/dist/version.js +9 -0
- package/package.json +57 -0
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package axern.node.sandbox.v1;
|
|
4
|
+
|
|
5
|
+
import "axern/common/file/v1/file.proto";
|
|
6
|
+
|
|
7
|
+
option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/node/sandbox/v1;nodesandboxv1";
|
|
8
|
+
|
|
9
|
+
// Execution
|
|
10
|
+
|
|
11
|
+
message ExecSpec {
|
|
12
|
+
repeated string argv = 1;
|
|
13
|
+
map<string, string> env = 2;
|
|
14
|
+
string cwd = 3;
|
|
15
|
+
int64 timeout_seconds = 4;
|
|
16
|
+
bool tty = 5;
|
|
17
|
+
string user = 6;
|
|
18
|
+
ManagedProxySpec managed_proxy = 7;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message ManagedProxySpec {
|
|
22
|
+
string provider = 1;
|
|
23
|
+
string upstream_base_url = 2;
|
|
24
|
+
string upstream_bearer_token = 3;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message ManagedProxyReport {
|
|
28
|
+
string provider = 1;
|
|
29
|
+
int32 request_count = 2;
|
|
30
|
+
int32 response_count = 3;
|
|
31
|
+
int32 error_count = 4;
|
|
32
|
+
bytes report_json = 5;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message ExecRequest {
|
|
36
|
+
ExecSpec spec = 3;
|
|
37
|
+
string allocation_id = 4;
|
|
38
|
+
int64 attempt = 5;
|
|
39
|
+
string execution_lease_token = 6;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message ExecResponse {
|
|
43
|
+
int32 exit_code = 1;
|
|
44
|
+
bytes stdout = 2;
|
|
45
|
+
bytes stderr = 3;
|
|
46
|
+
bool stdout_truncated = 4;
|
|
47
|
+
bool stderr_truncated = 5;
|
|
48
|
+
ManagedProxyReport managed_proxy_report = 6;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message ExecStreamOpen {
|
|
52
|
+
ExecSpec spec = 3;
|
|
53
|
+
string allocation_id = 4;
|
|
54
|
+
int64 attempt = 5;
|
|
55
|
+
string execution_lease_token = 6;
|
|
56
|
+
TerminalResize initial_size = 7;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
message TerminalResize {
|
|
60
|
+
uint32 cols = 1;
|
|
61
|
+
uint32 rows = 2;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
message ExecStreamRequest {
|
|
65
|
+
oneof payload {
|
|
66
|
+
ExecStreamOpen open = 1;
|
|
67
|
+
bytes stdin = 2;
|
|
68
|
+
TerminalResize resize = 3;
|
|
69
|
+
bool close_stdin = 4;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message ExecExit {
|
|
74
|
+
int32 exit_code = 1;
|
|
75
|
+
string message = 2;
|
|
76
|
+
ManagedProxyReport managed_proxy_report = 3;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
message ExecStreamResponse {
|
|
80
|
+
oneof payload {
|
|
81
|
+
bytes stdout = 1;
|
|
82
|
+
bytes stderr = 2;
|
|
83
|
+
ExecExit exit = 3;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message ProcessOpen {
|
|
88
|
+
ExecSpec spec = 3;
|
|
89
|
+
string allocation_id = 4;
|
|
90
|
+
int64 attempt = 5;
|
|
91
|
+
string execution_lease_token = 6;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
message ProcessSignal {
|
|
95
|
+
string signal = 1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
message ProcessReady {}
|
|
99
|
+
|
|
100
|
+
message ProcessRequest {
|
|
101
|
+
oneof payload {
|
|
102
|
+
ProcessOpen open = 1;
|
|
103
|
+
bytes stdin = 2;
|
|
104
|
+
TerminalResize resize = 3;
|
|
105
|
+
bool close_stdin = 4;
|
|
106
|
+
ProcessSignal signal = 5;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
message ProcessResponse {
|
|
111
|
+
oneof payload {
|
|
112
|
+
bytes stdout = 1;
|
|
113
|
+
bytes stderr = 2;
|
|
114
|
+
ExecExit exit = 3;
|
|
115
|
+
ProcessReady ready = 4;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
message ImageProcessMount {
|
|
120
|
+
string sandbox_path = 1;
|
|
121
|
+
string target_path = 2;
|
|
122
|
+
bool readonly = 3;
|
|
123
|
+
repeated string options = 4;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
message ImageProcessSpec {
|
|
127
|
+
string image = 1;
|
|
128
|
+
repeated string argv = 2;
|
|
129
|
+
map<string, string> env = 3;
|
|
130
|
+
string cwd = 4;
|
|
131
|
+
int64 timeout_seconds = 5;
|
|
132
|
+
bool tty = 6;
|
|
133
|
+
string user = 7;
|
|
134
|
+
repeated ImageProcessMount mounts = 8;
|
|
135
|
+
ManagedProxySpec managed_proxy = 9;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
message ExecImageRequest {
|
|
139
|
+
ImageProcessSpec spec = 3;
|
|
140
|
+
string allocation_id = 4;
|
|
141
|
+
int64 attempt = 5;
|
|
142
|
+
string execution_lease_token = 6;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
message ExecImageResponse {
|
|
146
|
+
int32 exit_code = 1;
|
|
147
|
+
bytes stdout = 2;
|
|
148
|
+
bytes stderr = 3;
|
|
149
|
+
bool stdout_truncated = 4;
|
|
150
|
+
bool stderr_truncated = 5;
|
|
151
|
+
ManagedProxyReport managed_proxy_report = 6;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
message ProcessImageOpen {
|
|
155
|
+
ImageProcessSpec spec = 3;
|
|
156
|
+
string allocation_id = 4;
|
|
157
|
+
int64 attempt = 5;
|
|
158
|
+
string execution_lease_token = 6;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
message ProcessImageRequest {
|
|
162
|
+
oneof payload {
|
|
163
|
+
ProcessImageOpen open = 1;
|
|
164
|
+
bytes stdin = 2;
|
|
165
|
+
TerminalResize resize = 3;
|
|
166
|
+
bool close_stdin = 4;
|
|
167
|
+
ProcessSignal signal = 5;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
message ProcessImageResponse {
|
|
172
|
+
oneof payload {
|
|
173
|
+
bytes stdout = 1;
|
|
174
|
+
bytes stderr = 2;
|
|
175
|
+
ExecExit exit = 3;
|
|
176
|
+
ProcessReady ready = 4;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Lifecycle
|
|
181
|
+
|
|
182
|
+
enum SandboxProcessState {
|
|
183
|
+
SANDBOX_PROCESS_STATE_UNSPECIFIED = 0;
|
|
184
|
+
SANDBOX_PROCESS_STATE_RUNNING = 1;
|
|
185
|
+
SANDBOX_PROCESS_STATE_EXITED = 2;
|
|
186
|
+
SANDBOX_PROCESS_STATE_UNKNOWN = 3;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
message WaitSandboxRequest {
|
|
190
|
+
string allocation_id = 3;
|
|
191
|
+
int64 attempt = 4;
|
|
192
|
+
string execution_lease_token = 5;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
message WaitSandboxResponse {
|
|
196
|
+
SandboxProcessState state = 1;
|
|
197
|
+
int32 exit_code = 2;
|
|
198
|
+
bool exit_code_known = 3;
|
|
199
|
+
string message = 4;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Capabilities
|
|
203
|
+
|
|
204
|
+
message CapabilityStatusRequest {
|
|
205
|
+
string allocation_id = 1;
|
|
206
|
+
int64 attempt = 2;
|
|
207
|
+
string execution_lease_token = 3;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
message CapabilityDependencyStatus {
|
|
211
|
+
string name = 1;
|
|
212
|
+
bool available = 2;
|
|
213
|
+
string reason = 3;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
message CapabilityProviderStatus {
|
|
217
|
+
string name = 1;
|
|
218
|
+
string state = 2;
|
|
219
|
+
bool available = 3;
|
|
220
|
+
repeated string capabilities = 4;
|
|
221
|
+
string backend = 5;
|
|
222
|
+
string reason = 6;
|
|
223
|
+
repeated CapabilityDependencyStatus dependencies = 7;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
message CapabilityProviderSummary {
|
|
227
|
+
int32 total = 1;
|
|
228
|
+
int32 available = 2;
|
|
229
|
+
int32 degraded = 3;
|
|
230
|
+
int32 unavailable = 4;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
message CapabilityStatusResponse {
|
|
234
|
+
bool ready = 1;
|
|
235
|
+
repeated string capabilities = 2;
|
|
236
|
+
repeated CapabilityProviderStatus providers = 3;
|
|
237
|
+
CapabilityProviderSummary provider_summary = 4;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// HTTP proxying
|
|
241
|
+
|
|
242
|
+
message ProxyHTTPHeader {
|
|
243
|
+
string key = 1;
|
|
244
|
+
string value = 2;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
message ProxyHTTPOpen {
|
|
248
|
+
string allocation_id = 1;
|
|
249
|
+
int64 attempt = 2;
|
|
250
|
+
string execution_lease_token = 3;
|
|
251
|
+
int32 port = 4;
|
|
252
|
+
string method = 5;
|
|
253
|
+
string path = 6;
|
|
254
|
+
string query = 7;
|
|
255
|
+
repeated ProxyHTTPHeader headers = 8;
|
|
256
|
+
bool has_body = 9;
|
|
257
|
+
int64 content_length = 10;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
message ProxyHTTPResponseHead {
|
|
261
|
+
int32 status_code = 1;
|
|
262
|
+
repeated ProxyHTTPHeader headers = 2;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
message ProxyHTTPTrailers {
|
|
266
|
+
repeated ProxyHTTPHeader headers = 1;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
message ProxyHTTPRequest {
|
|
270
|
+
oneof payload {
|
|
271
|
+
ProxyHTTPOpen open = 1;
|
|
272
|
+
bytes body = 2;
|
|
273
|
+
bool close_body = 3;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
message ProxyHTTPResponse {
|
|
278
|
+
oneof payload {
|
|
279
|
+
ProxyHTTPResponseHead head = 1;
|
|
280
|
+
bytes body = 2;
|
|
281
|
+
ProxyHTTPTrailers trailers = 3;
|
|
282
|
+
string error = 4;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Files
|
|
287
|
+
|
|
288
|
+
message StatFileRequest {
|
|
289
|
+
string allocation_id = 1;
|
|
290
|
+
int64 attempt = 2;
|
|
291
|
+
string execution_lease_token = 3;
|
|
292
|
+
string path = 4;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
message StatFileResponse {
|
|
296
|
+
axern.common.file.v1.SandboxFileInfo info = 1;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
message ListDirRequest {
|
|
300
|
+
string allocation_id = 1;
|
|
301
|
+
int64 attempt = 2;
|
|
302
|
+
string execution_lease_token = 3;
|
|
303
|
+
string path = 4;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
message ListDirResponse {
|
|
307
|
+
repeated axern.common.file.v1.SandboxFileInfo entries = 1;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
message ReadFileRequest {
|
|
311
|
+
string allocation_id = 1;
|
|
312
|
+
int64 attempt = 2;
|
|
313
|
+
string execution_lease_token = 3;
|
|
314
|
+
string path = 4;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
message ReadFileResponse {
|
|
318
|
+
bytes data = 1;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
message WriteFileRequest {
|
|
322
|
+
string allocation_id = 1;
|
|
323
|
+
int64 attempt = 2;
|
|
324
|
+
string execution_lease_token = 3;
|
|
325
|
+
string path = 4;
|
|
326
|
+
bytes data = 5;
|
|
327
|
+
bool create_parents = 6;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
message WriteFileResponse {}
|
|
331
|
+
|
|
332
|
+
enum TaskAssetKind {
|
|
333
|
+
TASK_ASSET_KIND_UNSPECIFIED = 0;
|
|
334
|
+
TASK_ASSET_KIND_VERIFIER = 1;
|
|
335
|
+
TASK_ASSET_KIND_ORACLE = 2;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
message MaterializeTaskAssetsRequest {
|
|
339
|
+
string allocation_id = 1;
|
|
340
|
+
int64 attempt = 2;
|
|
341
|
+
string execution_lease_token = 3;
|
|
342
|
+
string source_path = 4;
|
|
343
|
+
string target = 5;
|
|
344
|
+
TaskAssetKind kind = 6;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
message MaterializeTaskAssetsResponse {
|
|
348
|
+
int64 duration_ms = 1;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
message MkdirRequest {
|
|
352
|
+
string allocation_id = 1;
|
|
353
|
+
int64 attempt = 2;
|
|
354
|
+
string execution_lease_token = 3;
|
|
355
|
+
string path = 4;
|
|
356
|
+
bool parents = 5;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
message MkdirResponse {}
|
|
360
|
+
|
|
361
|
+
message RemoveRequest {
|
|
362
|
+
string allocation_id = 1;
|
|
363
|
+
int64 attempt = 2;
|
|
364
|
+
string execution_lease_token = 3;
|
|
365
|
+
string path = 4;
|
|
366
|
+
bool recursive = 5;
|
|
367
|
+
bool force = 6;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
message RemoveResponse {}
|
|
371
|
+
|
|
372
|
+
message ExistsRequest {
|
|
373
|
+
string allocation_id = 1;
|
|
374
|
+
int64 attempt = 2;
|
|
375
|
+
string execution_lease_token = 3;
|
|
376
|
+
string path = 4;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
message ExistsResponse {
|
|
380
|
+
bool exists = 1;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
message CopyRequest {
|
|
384
|
+
string allocation_id = 1;
|
|
385
|
+
int64 attempt = 2;
|
|
386
|
+
string execution_lease_token = 3;
|
|
387
|
+
string src_path = 4;
|
|
388
|
+
string dst_path = 5;
|
|
389
|
+
bool recursive = 6;
|
|
390
|
+
bool overwrite = 7;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
message CopyResponse {}
|
|
394
|
+
|
|
395
|
+
message MoveRequest {
|
|
396
|
+
string allocation_id = 1;
|
|
397
|
+
int64 attempt = 2;
|
|
398
|
+
string execution_lease_token = 3;
|
|
399
|
+
string src_path = 4;
|
|
400
|
+
string dst_path = 5;
|
|
401
|
+
bool overwrite = 6;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
message MoveResponse {}
|
|
405
|
+
|
|
406
|
+
message ChmodRequest {
|
|
407
|
+
string allocation_id = 1;
|
|
408
|
+
int64 attempt = 2;
|
|
409
|
+
string execution_lease_token = 3;
|
|
410
|
+
string path = 4;
|
|
411
|
+
uint32 mode = 5;
|
|
412
|
+
bool recursive = 6;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
message ChmodResponse {}
|
|
416
|
+
|
|
417
|
+
message TouchRequest {
|
|
418
|
+
string allocation_id = 1;
|
|
419
|
+
int64 attempt = 2;
|
|
420
|
+
string execution_lease_token = 3;
|
|
421
|
+
string path = 4;
|
|
422
|
+
bool create = 5;
|
|
423
|
+
int64 mtime_ns = 6;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
message TouchResponse {}
|
|
427
|
+
|
|
428
|
+
message UploadArchiveOpen {
|
|
429
|
+
string allocation_id = 1;
|
|
430
|
+
int64 attempt = 2;
|
|
431
|
+
string execution_lease_token = 3;
|
|
432
|
+
string path = 4;
|
|
433
|
+
axern.common.file.v1.SandboxArchiveFormat format = 5;
|
|
434
|
+
bool create_parents = 6;
|
|
435
|
+
bool overwrite = 7;
|
|
436
|
+
axern.common.file.v1.SandboxArchiveSymlinkPolicy symlink_policy = 8;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
message UploadArchiveRequest {
|
|
440
|
+
oneof payload {
|
|
441
|
+
UploadArchiveOpen open = 1;
|
|
442
|
+
bytes chunk = 2;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
message UploadArchiveResponse {}
|
|
447
|
+
|
|
448
|
+
message DownloadArchiveRequest {
|
|
449
|
+
string allocation_id = 1;
|
|
450
|
+
int64 attempt = 2;
|
|
451
|
+
string execution_lease_token = 3;
|
|
452
|
+
string path = 4;
|
|
453
|
+
axern.common.file.v1.SandboxArchiveFormat format = 5;
|
|
454
|
+
axern.common.file.v1.SandboxArchiveSymlinkPolicy symlink_policy = 6;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
message DownloadArchiveResponse {
|
|
458
|
+
bytes chunk = 1;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// Computer use
|
|
462
|
+
|
|
463
|
+
message ComputerUseStatusRequest {
|
|
464
|
+
string allocation_id = 1;
|
|
465
|
+
int64 attempt = 2;
|
|
466
|
+
string execution_lease_token = 3;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
message ComputerUseStatusResponse {
|
|
470
|
+
bool available = 1;
|
|
471
|
+
string display = 2;
|
|
472
|
+
string backend = 3;
|
|
473
|
+
string reason = 4;
|
|
474
|
+
repeated ComputerUseDependencyStatus dependencies = 5;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
message ComputerUseDependencyStatus {
|
|
478
|
+
string name = 1;
|
|
479
|
+
bool available = 2;
|
|
480
|
+
string reason = 3;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
message ComputerUseRegion {
|
|
484
|
+
int32 x = 1;
|
|
485
|
+
int32 y = 2;
|
|
486
|
+
int32 width = 3;
|
|
487
|
+
int32 height = 4;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
message ComputerUseScreenshotRequest {
|
|
491
|
+
string allocation_id = 1;
|
|
492
|
+
int64 attempt = 2;
|
|
493
|
+
string execution_lease_token = 3;
|
|
494
|
+
bool show_cursor = 4;
|
|
495
|
+
ComputerUseRegion region = 5;
|
|
496
|
+
string format = 6;
|
|
497
|
+
int32 quality = 7;
|
|
498
|
+
double scale = 8;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
message ComputerUseScreenshotResponse {
|
|
502
|
+
bytes data = 1;
|
|
503
|
+
string content_type = 2;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
message ComputerUseDisplayRequest {
|
|
507
|
+
string allocation_id = 1;
|
|
508
|
+
int64 attempt = 2;
|
|
509
|
+
string execution_lease_token = 3;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
message ComputerUseDisplayResponse {
|
|
513
|
+
string display = 1;
|
|
514
|
+
string backend = 2;
|
|
515
|
+
int32 width = 3;
|
|
516
|
+
int32 height = 4;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
message ComputerUseMouseRequest {
|
|
520
|
+
string allocation_id = 1;
|
|
521
|
+
int64 attempt = 2;
|
|
522
|
+
string execution_lease_token = 3;
|
|
523
|
+
string action = 4;
|
|
524
|
+
int32 x = 5;
|
|
525
|
+
int32 y = 6;
|
|
526
|
+
int32 to_x = 7;
|
|
527
|
+
int32 to_y = 8;
|
|
528
|
+
string button = 9;
|
|
529
|
+
string direction = 10;
|
|
530
|
+
int32 amount = 11;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
message ComputerUseMouseResponse {}
|
|
534
|
+
|
|
535
|
+
message ComputerUseKeyboardRequest {
|
|
536
|
+
string allocation_id = 1;
|
|
537
|
+
int64 attempt = 2;
|
|
538
|
+
string execution_lease_token = 3;
|
|
539
|
+
string text = 4;
|
|
540
|
+
string key = 5;
|
|
541
|
+
repeated string keys = 6;
|
|
542
|
+
int32 delay_ms = 7;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
message ComputerUseKeyboardResponse {}
|
|
546
|
+
|
|
547
|
+
// Browser
|
|
548
|
+
|
|
549
|
+
message BrowserStatusRequest {
|
|
550
|
+
string allocation_id = 1;
|
|
551
|
+
int64 attempt = 2;
|
|
552
|
+
string execution_lease_token = 3;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
message BrowserStatusResponse {
|
|
556
|
+
bool available = 1;
|
|
557
|
+
string command = 2;
|
|
558
|
+
bool running = 3;
|
|
559
|
+
int32 pid = 4;
|
|
560
|
+
string url = 5;
|
|
561
|
+
string reason = 6;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
message BrowserOpenRequest {
|
|
565
|
+
string allocation_id = 1;
|
|
566
|
+
int64 attempt = 2;
|
|
567
|
+
string execution_lease_token = 3;
|
|
568
|
+
string url = 4;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
message BrowserCloseRequest {
|
|
572
|
+
string allocation_id = 1;
|
|
573
|
+
int64 attempt = 2;
|
|
574
|
+
string execution_lease_token = 3;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
message BrowserNavigateRequest {
|
|
578
|
+
string allocation_id = 1;
|
|
579
|
+
int64 attempt = 2;
|
|
580
|
+
string execution_lease_token = 3;
|
|
581
|
+
string url = 4;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
message BrowserResizeRequest {
|
|
585
|
+
string allocation_id = 1;
|
|
586
|
+
int64 attempt = 2;
|
|
587
|
+
string execution_lease_token = 3;
|
|
588
|
+
int32 width = 4;
|
|
589
|
+
int32 height = 5;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
message BrowserClickRequest {
|
|
593
|
+
string allocation_id = 1;
|
|
594
|
+
int64 attempt = 2;
|
|
595
|
+
string execution_lease_token = 3;
|
|
596
|
+
int32 x = 4;
|
|
597
|
+
int32 y = 5;
|
|
598
|
+
string button = 6;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
message BrowserTypeRequest {
|
|
602
|
+
string allocation_id = 1;
|
|
603
|
+
int64 attempt = 2;
|
|
604
|
+
string execution_lease_token = 3;
|
|
605
|
+
string text = 4;
|
|
606
|
+
int32 delay_ms = 5;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
message BrowserWaitRequest {
|
|
610
|
+
string allocation_id = 1;
|
|
611
|
+
int64 attempt = 2;
|
|
612
|
+
string execution_lease_token = 3;
|
|
613
|
+
int32 timeout_ms = 4;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
service NodeSandbox {
|
|
617
|
+
rpc Exec(ExecRequest) returns (ExecResponse) {}
|
|
618
|
+
rpc ExecStream(stream ExecStreamRequest) returns (stream ExecStreamResponse) {}
|
|
619
|
+
rpc Process(stream ProcessRequest) returns (stream ProcessResponse) {}
|
|
620
|
+
rpc ExecImage(ExecImageRequest) returns (ExecImageResponse) {}
|
|
621
|
+
rpc ProcessImage(stream ProcessImageRequest) returns (stream ProcessImageResponse) {}
|
|
622
|
+
rpc WaitSandbox(WaitSandboxRequest) returns (WaitSandboxResponse) {}
|
|
623
|
+
rpc CapabilityStatus(CapabilityStatusRequest) returns (CapabilityStatusResponse) {}
|
|
624
|
+
rpc ProxyHTTP(stream ProxyHTTPRequest) returns (stream ProxyHTTPResponse) {}
|
|
625
|
+
rpc StatFile(StatFileRequest) returns (StatFileResponse) {}
|
|
626
|
+
rpc ListDir(ListDirRequest) returns (ListDirResponse) {}
|
|
627
|
+
rpc ReadFile(ReadFileRequest) returns (ReadFileResponse) {}
|
|
628
|
+
rpc WriteFile(WriteFileRequest) returns (WriteFileResponse) {}
|
|
629
|
+
rpc MaterializeTaskAssets(MaterializeTaskAssetsRequest) returns (MaterializeTaskAssetsResponse) {}
|
|
630
|
+
rpc Mkdir(MkdirRequest) returns (MkdirResponse) {}
|
|
631
|
+
rpc Remove(RemoveRequest) returns (RemoveResponse) {}
|
|
632
|
+
rpc Exists(ExistsRequest) returns (ExistsResponse) {}
|
|
633
|
+
rpc Copy(CopyRequest) returns (CopyResponse) {}
|
|
634
|
+
rpc Move(MoveRequest) returns (MoveResponse) {}
|
|
635
|
+
rpc Chmod(ChmodRequest) returns (ChmodResponse) {}
|
|
636
|
+
rpc Touch(TouchRequest) returns (TouchResponse) {}
|
|
637
|
+
rpc UploadArchive(stream UploadArchiveRequest) returns (UploadArchiveResponse) {}
|
|
638
|
+
rpc DownloadArchive(DownloadArchiveRequest) returns (stream DownloadArchiveResponse) {}
|
|
639
|
+
rpc ComputerUseStatus(ComputerUseStatusRequest) returns (ComputerUseStatusResponse) {}
|
|
640
|
+
rpc ComputerUseScreenshot(ComputerUseScreenshotRequest) returns (ComputerUseScreenshotResponse) {}
|
|
641
|
+
rpc ComputerUseDisplay(ComputerUseDisplayRequest) returns (ComputerUseDisplayResponse) {}
|
|
642
|
+
rpc ComputerUseMouse(ComputerUseMouseRequest) returns (ComputerUseMouseResponse) {}
|
|
643
|
+
rpc ComputerUseKeyboard(ComputerUseKeyboardRequest) returns (ComputerUseKeyboardResponse) {}
|
|
644
|
+
rpc BrowserStatus(BrowserStatusRequest) returns (BrowserStatusResponse) {}
|
|
645
|
+
rpc BrowserOpen(BrowserOpenRequest) returns (BrowserStatusResponse) {}
|
|
646
|
+
rpc BrowserClose(BrowserCloseRequest) returns (BrowserStatusResponse) {}
|
|
647
|
+
rpc BrowserNavigate(BrowserNavigateRequest) returns (BrowserStatusResponse) {}
|
|
648
|
+
rpc BrowserResize(BrowserResizeRequest) returns (BrowserStatusResponse) {}
|
|
649
|
+
rpc BrowserClick(BrowserClickRequest) returns (BrowserStatusResponse) {}
|
|
650
|
+
rpc BrowserType(BrowserTypeRequest) returns (BrowserStatusResponse) {}
|
|
651
|
+
rpc BrowserWait(BrowserWaitRequest) returns (BrowserStatusResponse) {}
|
|
652
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package axern.tunnel.v1;
|
|
4
|
+
|
|
5
|
+
option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/tunnel/v1;tunnelv1";
|
|
6
|
+
|
|
7
|
+
import "axern/control/tunnel/v1/tunnel.proto";
|
|
8
|
+
|
|
9
|
+
message PeerOpen {
|
|
10
|
+
string session_id = 1;
|
|
11
|
+
axern.control.tunnel.v1.TunnelPeerKind peer_kind = 2;
|
|
12
|
+
string token = 3;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message StreamOpen {
|
|
16
|
+
uint64 stream_id = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message StreamData {
|
|
20
|
+
uint64 stream_id = 1;
|
|
21
|
+
bytes data = 2;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message StreamClose {
|
|
25
|
+
uint64 stream_id = 1;
|
|
26
|
+
string error = 2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message Ping {
|
|
30
|
+
string id = 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message Pong {
|
|
34
|
+
string id = 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message TunnelFrame {
|
|
38
|
+
oneof payload {
|
|
39
|
+
PeerOpen peer_open = 1;
|
|
40
|
+
StreamOpen stream_open = 2;
|
|
41
|
+
StreamData stream_data = 3;
|
|
42
|
+
StreamClose stream_close = 4;
|
|
43
|
+
Ping ping = 5;
|
|
44
|
+
Pong pong = 6;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
service TunnelRelay {
|
|
49
|
+
rpc ConnectPeer(stream TunnelFrame) returns (stream TunnelFrame) {}
|
|
50
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 cofy-x
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export type ResourceQuantity = string | number;
|
|
7
|
+
export interface ResourceOptions {
|
|
8
|
+
requestCpu?: ResourceQuantity;
|
|
9
|
+
requestMemory?: ResourceQuantity;
|
|
10
|
+
limitCpu?: ResourceQuantity;
|
|
11
|
+
limitMemory?: ResourceQuantity;
|
|
12
|
+
}
|
|
13
|
+
export declare function buildResourceSpec(options: ResourceOptions): Record<string, unknown> | undefined;
|