rl-rock 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +178 -13
- package/dist/index.d.ts +178 -13
- package/dist/index.js +134 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +134 -41
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -218,10 +218,21 @@ type ChmodRequest = z.infer<typeof ChmodRequestSchema>;
|
|
|
218
218
|
* HTTP layer automatically converts from API snake_case
|
|
219
219
|
*/
|
|
220
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Header-derived fields schema (reusable)
|
|
223
|
+
*/
|
|
224
|
+
declare const HeaderFieldsSchema: {
|
|
225
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
226
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
227
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
228
|
+
};
|
|
221
229
|
/**
|
|
222
230
|
* Base sandbox response
|
|
223
231
|
*/
|
|
224
232
|
declare const SandboxResponseSchema: z.ZodObject<{
|
|
233
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
234
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
235
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
225
236
|
code: z.ZodOptional<z.ZodNativeEnum<typeof Codes>>;
|
|
226
237
|
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
227
238
|
failureReason: z.ZodOptional<z.ZodString>;
|
|
@@ -229,30 +240,48 @@ declare const SandboxResponseSchema: z.ZodObject<{
|
|
|
229
240
|
code?: Codes | undefined;
|
|
230
241
|
exitCode?: number | undefined;
|
|
231
242
|
failureReason?: string | undefined;
|
|
243
|
+
cluster?: string | undefined;
|
|
244
|
+
requestId?: string | undefined;
|
|
245
|
+
eagleeyeTraceid?: string | undefined;
|
|
232
246
|
}, {
|
|
233
247
|
code?: Codes | undefined;
|
|
234
248
|
exitCode?: number | undefined;
|
|
235
249
|
failureReason?: string | undefined;
|
|
250
|
+
cluster?: string | undefined;
|
|
251
|
+
requestId?: string | undefined;
|
|
252
|
+
eagleeyeTraceid?: string | undefined;
|
|
236
253
|
}>;
|
|
237
254
|
type SandboxResponse = z.infer<typeof SandboxResponseSchema>;
|
|
238
255
|
/**
|
|
239
256
|
* Is alive response
|
|
240
257
|
*/
|
|
241
258
|
declare const IsAliveResponseSchema: z.ZodObject<{
|
|
259
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
260
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
261
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
242
262
|
isAlive: z.ZodBoolean;
|
|
243
263
|
message: z.ZodDefault<z.ZodString>;
|
|
244
264
|
}, "strip", z.ZodTypeAny, {
|
|
245
265
|
message: string;
|
|
246
266
|
isAlive: boolean;
|
|
267
|
+
cluster?: string | undefined;
|
|
268
|
+
requestId?: string | undefined;
|
|
269
|
+
eagleeyeTraceid?: string | undefined;
|
|
247
270
|
}, {
|
|
248
271
|
isAlive: boolean;
|
|
249
272
|
message?: string | undefined;
|
|
273
|
+
cluster?: string | undefined;
|
|
274
|
+
requestId?: string | undefined;
|
|
275
|
+
eagleeyeTraceid?: string | undefined;
|
|
250
276
|
}>;
|
|
251
277
|
type IsAliveResponse = z.infer<typeof IsAliveResponseSchema>;
|
|
252
278
|
/**
|
|
253
279
|
* Sandbox status response
|
|
254
280
|
*/
|
|
255
281
|
declare const SandboxStatusResponseSchema: z.ZodObject<{
|
|
282
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
283
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
284
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
256
285
|
sandboxId: z.ZodOptional<z.ZodString>;
|
|
257
286
|
status: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
258
287
|
portMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -271,6 +300,9 @@ declare const SandboxStatusResponseSchema: z.ZodObject<{
|
|
|
271
300
|
}, "strip", z.ZodTypeAny, {
|
|
272
301
|
isAlive: boolean;
|
|
273
302
|
status?: Record<string, unknown> | undefined;
|
|
303
|
+
cluster?: string | undefined;
|
|
304
|
+
requestId?: string | undefined;
|
|
305
|
+
eagleeyeTraceid?: string | undefined;
|
|
274
306
|
sandboxId?: string | undefined;
|
|
275
307
|
portMapping?: Record<string, unknown> | undefined;
|
|
276
308
|
hostName?: string | undefined;
|
|
@@ -286,6 +318,9 @@ declare const SandboxStatusResponseSchema: z.ZodObject<{
|
|
|
286
318
|
state?: unknown;
|
|
287
319
|
}, {
|
|
288
320
|
status?: Record<string, unknown> | undefined;
|
|
321
|
+
cluster?: string | undefined;
|
|
322
|
+
requestId?: string | undefined;
|
|
323
|
+
eagleeyeTraceid?: string | undefined;
|
|
289
324
|
isAlive?: boolean | undefined;
|
|
290
325
|
sandboxId?: string | undefined;
|
|
291
326
|
portMapping?: Record<string, unknown> | undefined;
|
|
@@ -306,6 +341,9 @@ type SandboxStatusResponse = z.infer<typeof SandboxStatusResponseSchema>;
|
|
|
306
341
|
* Command execution response
|
|
307
342
|
*/
|
|
308
343
|
declare const CommandResponseSchema: z.ZodObject<{
|
|
344
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
345
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
346
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
309
347
|
stdout: z.ZodDefault<z.ZodString>;
|
|
310
348
|
stderr: z.ZodDefault<z.ZodString>;
|
|
311
349
|
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
@@ -313,8 +351,14 @@ declare const CommandResponseSchema: z.ZodObject<{
|
|
|
313
351
|
stdout: string;
|
|
314
352
|
stderr: string;
|
|
315
353
|
exitCode?: number | undefined;
|
|
354
|
+
cluster?: string | undefined;
|
|
355
|
+
requestId?: string | undefined;
|
|
356
|
+
eagleeyeTraceid?: string | undefined;
|
|
316
357
|
}, {
|
|
317
358
|
exitCode?: number | undefined;
|
|
359
|
+
cluster?: string | undefined;
|
|
360
|
+
requestId?: string | undefined;
|
|
361
|
+
eagleeyeTraceid?: string | undefined;
|
|
318
362
|
stdout?: string | undefined;
|
|
319
363
|
stderr?: string | undefined;
|
|
320
364
|
}>;
|
|
@@ -323,13 +367,22 @@ type CommandResponse = z.infer<typeof CommandResponseSchema>;
|
|
|
323
367
|
* Write file response
|
|
324
368
|
*/
|
|
325
369
|
declare const WriteFileResponseSchema: z.ZodObject<{
|
|
370
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
371
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
372
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
326
373
|
success: z.ZodDefault<z.ZodBoolean>;
|
|
327
374
|
message: z.ZodDefault<z.ZodString>;
|
|
328
375
|
}, "strip", z.ZodTypeAny, {
|
|
329
376
|
message: string;
|
|
330
377
|
success: boolean;
|
|
378
|
+
cluster?: string | undefined;
|
|
379
|
+
requestId?: string | undefined;
|
|
380
|
+
eagleeyeTraceid?: string | undefined;
|
|
331
381
|
}, {
|
|
332
382
|
message?: string | undefined;
|
|
383
|
+
cluster?: string | undefined;
|
|
384
|
+
requestId?: string | undefined;
|
|
385
|
+
eagleeyeTraceid?: string | undefined;
|
|
333
386
|
success?: boolean | undefined;
|
|
334
387
|
}>;
|
|
335
388
|
type WriteFileResponse = z.infer<typeof WriteFileResponseSchema>;
|
|
@@ -337,26 +390,44 @@ type WriteFileResponse = z.infer<typeof WriteFileResponseSchema>;
|
|
|
337
390
|
* Read file response
|
|
338
391
|
*/
|
|
339
392
|
declare const ReadFileResponseSchema: z.ZodObject<{
|
|
393
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
394
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
395
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
340
396
|
content: z.ZodDefault<z.ZodString>;
|
|
341
397
|
}, "strip", z.ZodTypeAny, {
|
|
342
398
|
content: string;
|
|
399
|
+
cluster?: string | undefined;
|
|
400
|
+
requestId?: string | undefined;
|
|
401
|
+
eagleeyeTraceid?: string | undefined;
|
|
343
402
|
}, {
|
|
344
403
|
content?: string | undefined;
|
|
404
|
+
cluster?: string | undefined;
|
|
405
|
+
requestId?: string | undefined;
|
|
406
|
+
eagleeyeTraceid?: string | undefined;
|
|
345
407
|
}>;
|
|
346
408
|
type ReadFileResponse = z.infer<typeof ReadFileResponseSchema>;
|
|
347
409
|
/**
|
|
348
410
|
* Upload response
|
|
349
411
|
*/
|
|
350
412
|
declare const UploadResponseSchema: z.ZodObject<{
|
|
413
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
414
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
415
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
351
416
|
success: z.ZodDefault<z.ZodBoolean>;
|
|
352
417
|
message: z.ZodDefault<z.ZodString>;
|
|
353
418
|
fileName: z.ZodOptional<z.ZodString>;
|
|
354
419
|
}, "strip", z.ZodTypeAny, {
|
|
355
420
|
message: string;
|
|
356
421
|
success: boolean;
|
|
422
|
+
cluster?: string | undefined;
|
|
423
|
+
requestId?: string | undefined;
|
|
424
|
+
eagleeyeTraceid?: string | undefined;
|
|
357
425
|
fileName?: string | undefined;
|
|
358
426
|
}, {
|
|
359
427
|
message?: string | undefined;
|
|
428
|
+
cluster?: string | undefined;
|
|
429
|
+
requestId?: string | undefined;
|
|
430
|
+
eagleeyeTraceid?: string | undefined;
|
|
360
431
|
success?: boolean | undefined;
|
|
361
432
|
fileName?: string | undefined;
|
|
362
433
|
}>;
|
|
@@ -365,6 +436,9 @@ type UploadResponse = z.infer<typeof UploadResponseSchema>;
|
|
|
365
436
|
* Bash observation (execution result)
|
|
366
437
|
*/
|
|
367
438
|
declare const ObservationSchema: z.ZodObject<{
|
|
439
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
440
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
441
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
368
442
|
output: z.ZodDefault<z.ZodString>;
|
|
369
443
|
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
370
444
|
failureReason: z.ZodDefault<z.ZodString>;
|
|
@@ -374,9 +448,15 @@ declare const ObservationSchema: z.ZodObject<{
|
|
|
374
448
|
output: string;
|
|
375
449
|
expectString: string;
|
|
376
450
|
exitCode?: number | undefined;
|
|
451
|
+
cluster?: string | undefined;
|
|
452
|
+
requestId?: string | undefined;
|
|
453
|
+
eagleeyeTraceid?: string | undefined;
|
|
377
454
|
}, {
|
|
378
455
|
exitCode?: number | undefined;
|
|
379
456
|
failureReason?: string | undefined;
|
|
457
|
+
cluster?: string | undefined;
|
|
458
|
+
requestId?: string | undefined;
|
|
459
|
+
eagleeyeTraceid?: string | undefined;
|
|
380
460
|
output?: string | undefined;
|
|
381
461
|
expectString?: string | undefined;
|
|
382
462
|
}>;
|
|
@@ -385,12 +465,21 @@ type Observation = z.infer<typeof ObservationSchema>;
|
|
|
385
465
|
* Create session response
|
|
386
466
|
*/
|
|
387
467
|
declare const CreateSessionResponseSchema: z.ZodObject<{
|
|
468
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
469
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
470
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
388
471
|
output: z.ZodDefault<z.ZodString>;
|
|
389
472
|
sessionType: z.ZodDefault<z.ZodLiteral<"bash">>;
|
|
390
473
|
}, "strip", z.ZodTypeAny, {
|
|
391
474
|
output: string;
|
|
392
475
|
sessionType: "bash";
|
|
476
|
+
cluster?: string | undefined;
|
|
477
|
+
requestId?: string | undefined;
|
|
478
|
+
eagleeyeTraceid?: string | undefined;
|
|
393
479
|
}, {
|
|
480
|
+
cluster?: string | undefined;
|
|
481
|
+
requestId?: string | undefined;
|
|
482
|
+
eagleeyeTraceid?: string | undefined;
|
|
394
483
|
output?: string | undefined;
|
|
395
484
|
sessionType?: "bash" | undefined;
|
|
396
485
|
}>;
|
|
@@ -399,29 +488,59 @@ type CreateSessionResponse = z.infer<typeof CreateSessionResponseSchema>;
|
|
|
399
488
|
* Close session response
|
|
400
489
|
*/
|
|
401
490
|
declare const CloseSessionResponseSchema: z.ZodObject<{
|
|
491
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
492
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
493
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
402
494
|
sessionType: z.ZodDefault<z.ZodLiteral<"bash">>;
|
|
403
495
|
}, "strip", z.ZodTypeAny, {
|
|
404
496
|
sessionType: "bash";
|
|
497
|
+
cluster?: string | undefined;
|
|
498
|
+
requestId?: string | undefined;
|
|
499
|
+
eagleeyeTraceid?: string | undefined;
|
|
405
500
|
}, {
|
|
501
|
+
cluster?: string | undefined;
|
|
502
|
+
requestId?: string | undefined;
|
|
503
|
+
eagleeyeTraceid?: string | undefined;
|
|
406
504
|
sessionType?: "bash" | undefined;
|
|
407
505
|
}>;
|
|
408
506
|
type CloseSessionResponse = z.infer<typeof CloseSessionResponseSchema>;
|
|
409
507
|
/**
|
|
410
508
|
* Close response
|
|
411
509
|
*/
|
|
412
|
-
declare const CloseResponseSchema: z.ZodObject<{
|
|
510
|
+
declare const CloseResponseSchema: z.ZodObject<{
|
|
511
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
512
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
513
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
514
|
+
}, "strip", z.ZodTypeAny, {
|
|
515
|
+
cluster?: string | undefined;
|
|
516
|
+
requestId?: string | undefined;
|
|
517
|
+
eagleeyeTraceid?: string | undefined;
|
|
518
|
+
}, {
|
|
519
|
+
cluster?: string | undefined;
|
|
520
|
+
requestId?: string | undefined;
|
|
521
|
+
eagleeyeTraceid?: string | undefined;
|
|
522
|
+
}>;
|
|
413
523
|
type CloseResponse = z.infer<typeof CloseResponseSchema>;
|
|
414
524
|
/**
|
|
415
525
|
* Chown response
|
|
416
526
|
*/
|
|
417
527
|
declare const ChownResponseSchema: z.ZodObject<{
|
|
528
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
529
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
530
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
418
531
|
success: z.ZodDefault<z.ZodBoolean>;
|
|
419
532
|
message: z.ZodDefault<z.ZodString>;
|
|
420
533
|
}, "strip", z.ZodTypeAny, {
|
|
421
534
|
message: string;
|
|
422
535
|
success: boolean;
|
|
536
|
+
cluster?: string | undefined;
|
|
537
|
+
requestId?: string | undefined;
|
|
538
|
+
eagleeyeTraceid?: string | undefined;
|
|
423
539
|
}, {
|
|
424
540
|
message?: string | undefined;
|
|
541
|
+
cluster?: string | undefined;
|
|
542
|
+
requestId?: string | undefined;
|
|
543
|
+
eagleeyeTraceid?: string | undefined;
|
|
425
544
|
success?: boolean | undefined;
|
|
426
545
|
}>;
|
|
427
546
|
type ChownResponse = z.infer<typeof ChownResponseSchema>;
|
|
@@ -429,13 +548,22 @@ type ChownResponse = z.infer<typeof ChownResponseSchema>;
|
|
|
429
548
|
* Chmod response
|
|
430
549
|
*/
|
|
431
550
|
declare const ChmodResponseSchema: z.ZodObject<{
|
|
551
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
552
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
553
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
432
554
|
success: z.ZodDefault<z.ZodBoolean>;
|
|
433
555
|
message: z.ZodDefault<z.ZodString>;
|
|
434
556
|
}, "strip", z.ZodTypeAny, {
|
|
435
557
|
message: string;
|
|
436
558
|
success: boolean;
|
|
559
|
+
cluster?: string | undefined;
|
|
560
|
+
requestId?: string | undefined;
|
|
561
|
+
eagleeyeTraceid?: string | undefined;
|
|
437
562
|
}, {
|
|
438
563
|
message?: string | undefined;
|
|
564
|
+
cluster?: string | undefined;
|
|
565
|
+
requestId?: string | undefined;
|
|
566
|
+
eagleeyeTraceid?: string | undefined;
|
|
439
567
|
success?: boolean | undefined;
|
|
440
568
|
}>;
|
|
441
569
|
type ChmodResponse = z.infer<typeof ChmodResponseSchema>;
|
|
@@ -443,13 +571,22 @@ type ChmodResponse = z.infer<typeof ChmodResponseSchema>;
|
|
|
443
571
|
* Execute bash session response
|
|
444
572
|
*/
|
|
445
573
|
declare const ExecuteBashSessionResponseSchema: z.ZodObject<{
|
|
574
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
575
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
576
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
446
577
|
success: z.ZodDefault<z.ZodBoolean>;
|
|
447
578
|
message: z.ZodDefault<z.ZodString>;
|
|
448
579
|
}, "strip", z.ZodTypeAny, {
|
|
449
580
|
message: string;
|
|
450
581
|
success: boolean;
|
|
582
|
+
cluster?: string | undefined;
|
|
583
|
+
requestId?: string | undefined;
|
|
584
|
+
eagleeyeTraceid?: string | undefined;
|
|
451
585
|
}, {
|
|
452
586
|
message?: string | undefined;
|
|
587
|
+
cluster?: string | undefined;
|
|
588
|
+
requestId?: string | undefined;
|
|
589
|
+
eagleeyeTraceid?: string | undefined;
|
|
453
590
|
success?: boolean | undefined;
|
|
454
591
|
}>;
|
|
455
592
|
type ExecuteBashSessionResponse = z.infer<typeof ExecuteBashSessionResponseSchema>;
|
|
@@ -457,13 +594,22 @@ type ExecuteBashSessionResponse = z.infer<typeof ExecuteBashSessionResponseSchem
|
|
|
457
594
|
* OSS setup response
|
|
458
595
|
*/
|
|
459
596
|
declare const OssSetupResponseSchema: z.ZodObject<{
|
|
597
|
+
cluster: z.ZodOptional<z.ZodString>;
|
|
598
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
599
|
+
eagleeyeTraceid: z.ZodOptional<z.ZodString>;
|
|
460
600
|
success: z.ZodDefault<z.ZodBoolean>;
|
|
461
601
|
message: z.ZodDefault<z.ZodString>;
|
|
462
602
|
}, "strip", z.ZodTypeAny, {
|
|
463
603
|
message: string;
|
|
464
604
|
success: boolean;
|
|
605
|
+
cluster?: string | undefined;
|
|
606
|
+
requestId?: string | undefined;
|
|
607
|
+
eagleeyeTraceid?: string | undefined;
|
|
465
608
|
}, {
|
|
466
609
|
message?: string | undefined;
|
|
610
|
+
cluster?: string | undefined;
|
|
611
|
+
requestId?: string | undefined;
|
|
612
|
+
eagleeyeTraceid?: string | undefined;
|
|
467
613
|
success?: boolean | undefined;
|
|
468
614
|
}>;
|
|
469
615
|
type OssSetupResponse = z.infer<typeof OssSetupResponseSchema>;
|
|
@@ -560,13 +706,23 @@ declare class HttpUtils {
|
|
|
560
706
|
* Send POST request
|
|
561
707
|
* Automatically converts request body from camelCase to snake_case
|
|
562
708
|
* Automatically converts response from snake_case to camelCase
|
|
709
|
+
* Returns structured response with headers
|
|
563
710
|
*/
|
|
564
|
-
static post<T = unknown>(url: string, headers: Record<string, string>, data: Record<string, unknown>, readTimeout?: number): Promise<
|
|
711
|
+
static post<T = unknown>(url: string, headers: Record<string, string>, data: Record<string, unknown>, readTimeout?: number): Promise<{
|
|
712
|
+
status: string;
|
|
713
|
+
result: T;
|
|
714
|
+
headers: Record<string, string>;
|
|
715
|
+
}>;
|
|
565
716
|
/**
|
|
566
717
|
* Send GET request
|
|
567
718
|
* Automatically converts response from snake_case to camelCase
|
|
719
|
+
* Returns structured response with headers
|
|
568
720
|
*/
|
|
569
|
-
static get<T = unknown>(url: string, headers: Record<string, string>): Promise<
|
|
721
|
+
static get<T = unknown>(url: string, headers: Record<string, string>): Promise<{
|
|
722
|
+
status: string;
|
|
723
|
+
result: T;
|
|
724
|
+
headers: Record<string, string>;
|
|
725
|
+
}>;
|
|
570
726
|
/**
|
|
571
727
|
* Convert camelCase key to snake_case
|
|
572
728
|
*/
|
|
@@ -575,8 +731,13 @@ declare class HttpUtils {
|
|
|
575
731
|
* Send multipart/form-data request
|
|
576
732
|
* Automatically converts form data keys to snake_case
|
|
577
733
|
* Automatically converts response from snake_case to camelCase
|
|
734
|
+
* Returns structured response with headers
|
|
578
735
|
*/
|
|
579
|
-
static postMultipart<T = unknown>(url: string, headers: Record<string, string>, data?: Record<string, string | number | boolean>, files?: Record<string, File | Buffer | [string, Buffer, string]>): Promise<
|
|
736
|
+
static postMultipart<T = unknown>(url: string, headers: Record<string, string>, data?: Record<string, string | number | boolean>, files?: Record<string, File | Buffer | [string, Buffer, string]>): Promise<{
|
|
737
|
+
status: string;
|
|
738
|
+
result: T;
|
|
739
|
+
headers: Record<string, string>;
|
|
740
|
+
}>;
|
|
580
741
|
/**
|
|
581
742
|
* Guess MIME type from filename
|
|
582
743
|
*/
|
|
@@ -867,6 +1028,7 @@ declare const SandboxConfigSchema: z.ZodObject<{
|
|
|
867
1028
|
cluster: z.ZodDefault<z.ZodString>;
|
|
868
1029
|
namespace: z.ZodOptional<z.ZodString>;
|
|
869
1030
|
}, "strip", z.ZodTypeAny, {
|
|
1031
|
+
cluster: string;
|
|
870
1032
|
image: string;
|
|
871
1033
|
cpus: number;
|
|
872
1034
|
memory: string;
|
|
@@ -874,13 +1036,13 @@ declare const SandboxConfigSchema: z.ZodObject<{
|
|
|
874
1036
|
extraHeaders: Record<string, string>;
|
|
875
1037
|
autoClearSeconds: number;
|
|
876
1038
|
startupTimeout: number;
|
|
877
|
-
cluster: string;
|
|
878
1039
|
userId?: string | undefined;
|
|
879
1040
|
experimentId?: string | undefined;
|
|
880
1041
|
namespace?: string | undefined;
|
|
881
1042
|
xrlAuthorization?: string | undefined;
|
|
882
1043
|
routeKey?: string | undefined;
|
|
883
1044
|
}, {
|
|
1045
|
+
cluster?: string | undefined;
|
|
884
1046
|
image?: string | undefined;
|
|
885
1047
|
userId?: string | undefined;
|
|
886
1048
|
experimentId?: string | undefined;
|
|
@@ -893,7 +1055,6 @@ declare const SandboxConfigSchema: z.ZodObject<{
|
|
|
893
1055
|
autoClearSeconds?: number | undefined;
|
|
894
1056
|
routeKey?: string | undefined;
|
|
895
1057
|
startupTimeout?: number | undefined;
|
|
896
|
-
cluster?: string | undefined;
|
|
897
1058
|
}>;
|
|
898
1059
|
type SandboxConfig = z.infer<typeof SandboxConfigSchema>;
|
|
899
1060
|
/**
|
|
@@ -919,6 +1080,7 @@ declare const SandboxGroupConfigSchema: z.ZodObject<{
|
|
|
919
1080
|
startConcurrency: z.ZodDefault<z.ZodNumber>;
|
|
920
1081
|
startRetryTimes: z.ZodDefault<z.ZodNumber>;
|
|
921
1082
|
}, "strip", z.ZodTypeAny, {
|
|
1083
|
+
cluster: string;
|
|
922
1084
|
image: string;
|
|
923
1085
|
cpus: number;
|
|
924
1086
|
memory: string;
|
|
@@ -926,7 +1088,6 @@ declare const SandboxGroupConfigSchema: z.ZodObject<{
|
|
|
926
1088
|
extraHeaders: Record<string, string>;
|
|
927
1089
|
autoClearSeconds: number;
|
|
928
1090
|
startupTimeout: number;
|
|
929
|
-
cluster: string;
|
|
930
1091
|
size: number;
|
|
931
1092
|
startConcurrency: number;
|
|
932
1093
|
startRetryTimes: number;
|
|
@@ -936,6 +1097,7 @@ declare const SandboxGroupConfigSchema: z.ZodObject<{
|
|
|
936
1097
|
xrlAuthorization?: string | undefined;
|
|
937
1098
|
routeKey?: string | undefined;
|
|
938
1099
|
}, {
|
|
1100
|
+
cluster?: string | undefined;
|
|
939
1101
|
image?: string | undefined;
|
|
940
1102
|
userId?: string | undefined;
|
|
941
1103
|
experimentId?: string | undefined;
|
|
@@ -948,7 +1110,6 @@ declare const SandboxGroupConfigSchema: z.ZodObject<{
|
|
|
948
1110
|
autoClearSeconds?: number | undefined;
|
|
949
1111
|
routeKey?: string | undefined;
|
|
950
1112
|
startupTimeout?: number | undefined;
|
|
951
|
-
cluster?: string | undefined;
|
|
952
1113
|
size?: number | undefined;
|
|
953
1114
|
startConcurrency?: number | undefined;
|
|
954
1115
|
startRetryTimes?: number | undefined;
|
|
@@ -1136,8 +1297,8 @@ declare abstract class AbstractSandbox {
|
|
|
1136
1297
|
abstract isAlive(): Promise<IsAliveResponse>;
|
|
1137
1298
|
abstract createSession(request: CreateBashSessionRequest): Promise<CreateSessionResponse>;
|
|
1138
1299
|
abstract execute(command: Command): Promise<CommandResponse>;
|
|
1139
|
-
abstract
|
|
1140
|
-
abstract
|
|
1300
|
+
abstract readFile(request: ReadFileRequest): Promise<ReadFileResponse>;
|
|
1301
|
+
abstract writeFile(request: WriteFileRequest): Promise<WriteFileResponse>;
|
|
1141
1302
|
abstract upload(request: UploadRequest): Promise<UploadResponse>;
|
|
1142
1303
|
abstract closeSession(request: CloseSessionRequest): Promise<CloseSessionResponse>;
|
|
1143
1304
|
abstract close(): Promise<void>;
|
|
@@ -1172,6 +1333,10 @@ declare class Sandbox extends AbstractSandbox {
|
|
|
1172
1333
|
getConfig(): SandboxConfig;
|
|
1173
1334
|
private buildHeaders;
|
|
1174
1335
|
private addUserDefinedTags;
|
|
1336
|
+
/**
|
|
1337
|
+
* Extract header-derived fields from response headers
|
|
1338
|
+
*/
|
|
1339
|
+
private extractHeaderFields;
|
|
1175
1340
|
start(): Promise<void>;
|
|
1176
1341
|
stop(): Promise<void>;
|
|
1177
1342
|
isAlive(): Promise<IsAliveResponse>;
|
|
@@ -1192,8 +1357,8 @@ declare class Sandbox extends AbstractSandbox {
|
|
|
1192
1357
|
private runInSession;
|
|
1193
1358
|
private arunWithNohup;
|
|
1194
1359
|
private waitForProcessCompletion;
|
|
1195
|
-
|
|
1196
|
-
|
|
1360
|
+
writeFile(request: WriteFileRequest): Promise<WriteFileResponse>;
|
|
1361
|
+
readFile(request: ReadFileRequest): Promise<ReadFileResponse>;
|
|
1197
1362
|
upload(request: UploadRequest): Promise<UploadResponse>;
|
|
1198
1363
|
uploadByPath(sourcePath: string, targetPath: string): Promise<UploadResponse>;
|
|
1199
1364
|
close(): Promise<void>;
|
|
@@ -1325,4 +1490,4 @@ declare class ModelService {
|
|
|
1325
1490
|
*/
|
|
1326
1491
|
declare const VERSION = "1.2.1";
|
|
1327
1492
|
|
|
1328
|
-
export { BadRequestRockError, type BaseConfig, type BashAction, BashActionSchema, type ChmodRequest, ChmodRequestSchema, type ChmodResponse, ChmodResponseSchema, type ChownRequest, ChownRequestSchema, type ChownResponse, ChownResponseSchema, type CloseResponse, CloseResponseSchema, type CloseSessionRequest, CloseSessionRequestSchema, type CloseSessionResponse, CloseSessionResponseSchema, Codes, type Command, type CommandResponse, CommandResponseSchema, CommandRockError, CommandSchema, Constants, type CreateBashSessionRequest, CreateBashSessionRequestSchema, type CreateSessionResponse, CreateSessionResponseSchema, Deploy, EnvHubClient, type EnvHubClientConfig, EnvHubClientConfigSchema, EnvHubError, type ExecuteBashSessionResponse, ExecuteBashSessionResponseSchema, HttpUtils, InternalServerRockError, InvalidParameterRockException, type IsAliveResponse, IsAliveResponseSchema, LinuxFileSystem, LinuxRemoteUser, ModelClient, type ModelClientConfig, ModelService, type ModelServiceConfig, Network, type Observation, ObservationSchema, type OssSetupResponse, OssSetupResponseSchema, PID_PREFIX, PID_SUFFIX, Process, type ReadFileRequest, ReadFileRequestSchema, type ReadFileResponse, ReadFileResponseSchema, ReasonPhrases, type ResetResult, RockEnv, type RockEnvConfig, type RockEnvInfo, RockEnvInfoSchema, RockException, RunMode, type RunModeType$1 as RunModeType, Sandbox, type SandboxConfig, SandboxConfigSchema, SandboxGroup, type SandboxGroupConfig, SandboxGroupConfigSchema, type SandboxResponse, SandboxResponseSchema, type RunModeType as SandboxRunModeType, type SandboxStatusResponse, SandboxStatusResponseSchema, SpeedupType, type StepResult, type UploadRequest, UploadRequestSchema, type UploadResponse, UploadResponseSchema, VERSION, type WriteFileRequest, WriteFileRequestSchema, type WriteFileResponse, WriteFileResponseSchema, arunWithRetry, createRockEnvInfo, createSandboxConfig, createSandboxGroupConfig, deprecated, deprecatedClass, extractNohupPid as extractNohupPidFromSandbox, fromRockException, getEnv, getReasonPhrase, getRequiredEnv, isBrowser, isClientError, isCommandError, isEnvSet, isError, isNode, isServerError, isSuccess, make, raiseForCode, retryAsync, sleep, withRetry, withTimeLogging };
|
|
1493
|
+
export { BadRequestRockError, type BaseConfig, type BashAction, BashActionSchema, type ChmodRequest, ChmodRequestSchema, type ChmodResponse, ChmodResponseSchema, type ChownRequest, ChownRequestSchema, type ChownResponse, ChownResponseSchema, type CloseResponse, CloseResponseSchema, type CloseSessionRequest, CloseSessionRequestSchema, type CloseSessionResponse, CloseSessionResponseSchema, Codes, type Command, type CommandResponse, CommandResponseSchema, CommandRockError, CommandSchema, Constants, type CreateBashSessionRequest, CreateBashSessionRequestSchema, type CreateSessionResponse, CreateSessionResponseSchema, Deploy, EnvHubClient, type EnvHubClientConfig, EnvHubClientConfigSchema, EnvHubError, type ExecuteBashSessionResponse, ExecuteBashSessionResponseSchema, HeaderFieldsSchema, HttpUtils, InternalServerRockError, InvalidParameterRockException, type IsAliveResponse, IsAliveResponseSchema, LinuxFileSystem, LinuxRemoteUser, ModelClient, type ModelClientConfig, ModelService, type ModelServiceConfig, Network, type Observation, ObservationSchema, type OssSetupResponse, OssSetupResponseSchema, PID_PREFIX, PID_SUFFIX, Process, type ReadFileRequest, ReadFileRequestSchema, type ReadFileResponse, ReadFileResponseSchema, ReasonPhrases, type ResetResult, RockEnv, type RockEnvConfig, type RockEnvInfo, RockEnvInfoSchema, RockException, RunMode, type RunModeType$1 as RunModeType, Sandbox, type SandboxConfig, SandboxConfigSchema, SandboxGroup, type SandboxGroupConfig, SandboxGroupConfigSchema, type SandboxResponse, SandboxResponseSchema, type RunModeType as SandboxRunModeType, type SandboxStatusResponse, SandboxStatusResponseSchema, SpeedupType, type StepResult, type UploadRequest, UploadRequestSchema, type UploadResponse, UploadResponseSchema, VERSION, type WriteFileRequest, WriteFileRequestSchema, type WriteFileResponse, WriteFileResponseSchema, arunWithRetry, createRockEnvInfo, createSandboxConfig, createSandboxGroupConfig, deprecated, deprecatedClass, extractNohupPid as extractNohupPidFromSandbox, fromRockException, getEnv, getReasonPhrase, getRequiredEnv, isBrowser, isClientError, isCommandError, isEnvSet, isError, isNode, isServerError, isSuccess, make, raiseForCode, retryAsync, sleep, withRetry, withTimeLogging };
|