@blaxel/core 0.2.53 → 0.2.54-preview.14
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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/common/settings.js +2 -2
- package/dist/cjs/sandbox/client/sdk.gen.js +107 -1
- package/dist/cjs/sandbox/filesystem/filesystem.js +81 -1
- package/dist/cjs/sandbox/process/process.js +18 -7
- package/dist/cjs/types/sandbox/client/sdk.gen.d.ts +31 -1
- package/dist/cjs/types/sandbox/client/types.gen.d.ts +305 -0
- package/dist/cjs/types/sandbox/filesystem/filesystem.d.ts +5 -2
- package/dist/cjs/types/sandbox/filesystem/types.d.ts +20 -0
- package/dist/cjs/types/sandbox/process/process.d.ts +2 -1
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/common/settings.js +2 -2
- package/dist/cjs-browser/sandbox/client/sdk.gen.js +107 -1
- package/dist/cjs-browser/sandbox/filesystem/filesystem.js +81 -1
- package/dist/cjs-browser/sandbox/process/process.js +18 -7
- package/dist/cjs-browser/types/sandbox/client/sdk.gen.d.ts +31 -1
- package/dist/cjs-browser/types/sandbox/client/types.gen.d.ts +305 -0
- package/dist/cjs-browser/types/sandbox/filesystem/filesystem.d.ts +5 -2
- package/dist/cjs-browser/types/sandbox/filesystem/types.d.ts +20 -0
- package/dist/cjs-browser/types/sandbox/process/process.d.ts +2 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/common/settings.js +2 -2
- package/dist/esm/sandbox/client/sdk.gen.js +100 -0
- package/dist/esm/sandbox/filesystem/filesystem.js +82 -2
- package/dist/esm/sandbox/process/process.js +18 -7
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/common/settings.js +2 -2
- package/dist/esm-browser/sandbox/client/sdk.gen.js +100 -0
- package/dist/esm-browser/sandbox/filesystem/filesystem.js +82 -2
- package/dist/esm-browser/sandbox/process/process.js +18 -7
- package/package.json +1 -1
|
@@ -10,6 +10,18 @@ export type ApplyEditResponse = {
|
|
|
10
10
|
success?: boolean;
|
|
11
11
|
updatedContent?: string;
|
|
12
12
|
};
|
|
13
|
+
export type ContentSearchMatch = {
|
|
14
|
+
column?: number;
|
|
15
|
+
context?: string;
|
|
16
|
+
line?: number;
|
|
17
|
+
path?: string;
|
|
18
|
+
text?: string;
|
|
19
|
+
};
|
|
20
|
+
export type ContentSearchResponse = {
|
|
21
|
+
matches?: Array<ContentSearchMatch>;
|
|
22
|
+
query?: string;
|
|
23
|
+
total?: number;
|
|
24
|
+
};
|
|
13
25
|
export type Directory = {
|
|
14
26
|
files: Array<File>;
|
|
15
27
|
name: string;
|
|
@@ -46,6 +58,29 @@ export type FileWithContent = {
|
|
|
46
58
|
permissions: string;
|
|
47
59
|
size: number;
|
|
48
60
|
};
|
|
61
|
+
export type FindMatch = {
|
|
62
|
+
path?: string;
|
|
63
|
+
/**
|
|
64
|
+
* "file" or "directory"
|
|
65
|
+
*/
|
|
66
|
+
type?: string;
|
|
67
|
+
};
|
|
68
|
+
export type FindResponse = {
|
|
69
|
+
matches?: Array<FindMatch>;
|
|
70
|
+
total?: number;
|
|
71
|
+
};
|
|
72
|
+
export type FuzzySearchMatch = {
|
|
73
|
+
path?: string;
|
|
74
|
+
score?: number;
|
|
75
|
+
/**
|
|
76
|
+
* "file" or "directory"
|
|
77
|
+
*/
|
|
78
|
+
type?: string;
|
|
79
|
+
};
|
|
80
|
+
export type FuzzySearchResponse = {
|
|
81
|
+
matches?: Array<FuzzySearchMatch>;
|
|
82
|
+
total?: number;
|
|
83
|
+
};
|
|
49
84
|
export type MultipartCompleteRequest = {
|
|
50
85
|
parts?: Array<MultipartPartInfo>;
|
|
51
86
|
};
|
|
@@ -128,6 +163,11 @@ export type SuccessResponse = {
|
|
|
128
163
|
message: string;
|
|
129
164
|
path?: string;
|
|
130
165
|
};
|
|
166
|
+
export type TreeRequest = {
|
|
167
|
+
files?: {
|
|
168
|
+
[key: string]: string;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
131
171
|
export type WelcomeResponse = {
|
|
132
172
|
description?: string;
|
|
133
173
|
documentation?: string;
|
|
@@ -312,6 +352,114 @@ export type GetCodegenRerankingByPathResponses = {
|
|
|
312
352
|
200: RerankingResponse;
|
|
313
353
|
};
|
|
314
354
|
export type GetCodegenRerankingByPathResponse = GetCodegenRerankingByPathResponses[keyof GetCodegenRerankingByPathResponses];
|
|
355
|
+
export type GetFilesystemContentSearchByPathData = {
|
|
356
|
+
body?: never;
|
|
357
|
+
path: {
|
|
358
|
+
/**
|
|
359
|
+
* Directory path to search in
|
|
360
|
+
*/
|
|
361
|
+
path: string;
|
|
362
|
+
};
|
|
363
|
+
query: {
|
|
364
|
+
/**
|
|
365
|
+
* Text to search for
|
|
366
|
+
*/
|
|
367
|
+
query: string;
|
|
368
|
+
/**
|
|
369
|
+
* Case sensitive search (default: false)
|
|
370
|
+
*/
|
|
371
|
+
caseSensitive?: boolean;
|
|
372
|
+
/**
|
|
373
|
+
* Maximum number of results to return (default: 100)
|
|
374
|
+
*/
|
|
375
|
+
maxResults?: number;
|
|
376
|
+
/**
|
|
377
|
+
* File pattern to include (e.g., *.go)
|
|
378
|
+
*/
|
|
379
|
+
filePattern?: string;
|
|
380
|
+
/**
|
|
381
|
+
* Comma-separated directory names to skip (default: node_modules,vendor,.git,dist,build,target,__pycache__,.venv,.next,coverage)
|
|
382
|
+
*/
|
|
383
|
+
excludeDirs?: string;
|
|
384
|
+
};
|
|
385
|
+
url: '/filesystem-content-search/{path}';
|
|
386
|
+
};
|
|
387
|
+
export type GetFilesystemContentSearchByPathErrors = {
|
|
388
|
+
/**
|
|
389
|
+
* Bad request
|
|
390
|
+
*/
|
|
391
|
+
400: ErrorResponse;
|
|
392
|
+
/**
|
|
393
|
+
* Unprocessable entity
|
|
394
|
+
*/
|
|
395
|
+
422: ErrorResponse;
|
|
396
|
+
/**
|
|
397
|
+
* Internal server error
|
|
398
|
+
*/
|
|
399
|
+
500: ErrorResponse;
|
|
400
|
+
};
|
|
401
|
+
export type GetFilesystemContentSearchByPathError = GetFilesystemContentSearchByPathErrors[keyof GetFilesystemContentSearchByPathErrors];
|
|
402
|
+
export type GetFilesystemContentSearchByPathResponses = {
|
|
403
|
+
/**
|
|
404
|
+
* Content search results
|
|
405
|
+
*/
|
|
406
|
+
200: ContentSearchResponse;
|
|
407
|
+
};
|
|
408
|
+
export type GetFilesystemContentSearchByPathResponse = GetFilesystemContentSearchByPathResponses[keyof GetFilesystemContentSearchByPathResponses];
|
|
409
|
+
export type GetFilesystemFindByPathData = {
|
|
410
|
+
body?: never;
|
|
411
|
+
path: {
|
|
412
|
+
/**
|
|
413
|
+
* Path to search in (e.g., /home/user/projects)
|
|
414
|
+
*/
|
|
415
|
+
path: string;
|
|
416
|
+
};
|
|
417
|
+
query?: {
|
|
418
|
+
/**
|
|
419
|
+
* Type of search (file or directory)
|
|
420
|
+
*/
|
|
421
|
+
type?: string;
|
|
422
|
+
/**
|
|
423
|
+
* Comma-separated file patterns to include (e.g., *.go,*.js)
|
|
424
|
+
*/
|
|
425
|
+
patterns?: string;
|
|
426
|
+
/**
|
|
427
|
+
* Maximum number of results to return (default: 20). If set to 0, all results will be returned.
|
|
428
|
+
*/
|
|
429
|
+
maxResults?: number;
|
|
430
|
+
/**
|
|
431
|
+
* Comma-separated directory names to skip (default: node_modules,vendor,.git,dist,build,target,__pycache__,.venv,.next,coverage). Use empty string to skip no directories.
|
|
432
|
+
*/
|
|
433
|
+
excludeDirs?: string;
|
|
434
|
+
/**
|
|
435
|
+
* Exclude hidden files and directories (default: true)
|
|
436
|
+
*/
|
|
437
|
+
excludeHidden?: boolean;
|
|
438
|
+
};
|
|
439
|
+
url: '/filesystem-find/{path}';
|
|
440
|
+
};
|
|
441
|
+
export type GetFilesystemFindByPathErrors = {
|
|
442
|
+
/**
|
|
443
|
+
* Bad request
|
|
444
|
+
*/
|
|
445
|
+
400: ErrorResponse;
|
|
446
|
+
/**
|
|
447
|
+
* Unprocessable entity
|
|
448
|
+
*/
|
|
449
|
+
422: ErrorResponse;
|
|
450
|
+
/**
|
|
451
|
+
* Internal server error
|
|
452
|
+
*/
|
|
453
|
+
500: ErrorResponse;
|
|
454
|
+
};
|
|
455
|
+
export type GetFilesystemFindByPathError = GetFilesystemFindByPathErrors[keyof GetFilesystemFindByPathErrors];
|
|
456
|
+
export type GetFilesystemFindByPathResponses = {
|
|
457
|
+
/**
|
|
458
|
+
* Find results
|
|
459
|
+
*/
|
|
460
|
+
200: FindResponse;
|
|
461
|
+
};
|
|
462
|
+
export type GetFilesystemFindByPathResponse = GetFilesystemFindByPathResponses[keyof GetFilesystemFindByPathResponses];
|
|
315
463
|
export type GetFilesystemMultipartData = {
|
|
316
464
|
body?: never;
|
|
317
465
|
path?: never;
|
|
@@ -509,6 +657,56 @@ export type PostFilesystemMultipartInitiateByPathResponses = {
|
|
|
509
657
|
200: MultipartInitiateResponse;
|
|
510
658
|
};
|
|
511
659
|
export type PostFilesystemMultipartInitiateByPathResponse = PostFilesystemMultipartInitiateByPathResponses[keyof PostFilesystemMultipartInitiateByPathResponses];
|
|
660
|
+
export type GetFilesystemSearchByPathData = {
|
|
661
|
+
body?: never;
|
|
662
|
+
path: {
|
|
663
|
+
/**
|
|
664
|
+
* Path to search in (e.g., /home/user/projects)
|
|
665
|
+
*/
|
|
666
|
+
path: string;
|
|
667
|
+
};
|
|
668
|
+
query?: {
|
|
669
|
+
/**
|
|
670
|
+
* Maximum number of results to return (default: 20)
|
|
671
|
+
*/
|
|
672
|
+
maxResults?: number;
|
|
673
|
+
/**
|
|
674
|
+
* Comma-separated file patterns to include (e.g., *.go,*.js)
|
|
675
|
+
*/
|
|
676
|
+
patterns?: string;
|
|
677
|
+
/**
|
|
678
|
+
* Comma-separated directory names to skip (default: node_modules,vendor,.git,dist,build,target,__pycache__,.venv,.next,coverage). Use empty string to skip no directories.
|
|
679
|
+
*/
|
|
680
|
+
excludeDirs?: string;
|
|
681
|
+
/**
|
|
682
|
+
* Exclude hidden files and directories (default: true)
|
|
683
|
+
*/
|
|
684
|
+
excludeHidden?: boolean;
|
|
685
|
+
};
|
|
686
|
+
url: '/filesystem-search/{path}';
|
|
687
|
+
};
|
|
688
|
+
export type GetFilesystemSearchByPathErrors = {
|
|
689
|
+
/**
|
|
690
|
+
* Bad request
|
|
691
|
+
*/
|
|
692
|
+
400: ErrorResponse;
|
|
693
|
+
/**
|
|
694
|
+
* Unprocessable entity
|
|
695
|
+
*/
|
|
696
|
+
422: ErrorResponse;
|
|
697
|
+
/**
|
|
698
|
+
* Internal server error
|
|
699
|
+
*/
|
|
700
|
+
500: ErrorResponse;
|
|
701
|
+
};
|
|
702
|
+
export type GetFilesystemSearchByPathError = GetFilesystemSearchByPathErrors[keyof GetFilesystemSearchByPathErrors];
|
|
703
|
+
export type GetFilesystemSearchByPathResponses = {
|
|
704
|
+
/**
|
|
705
|
+
* Fuzzy search results
|
|
706
|
+
*/
|
|
707
|
+
200: FuzzySearchResponse;
|
|
708
|
+
};
|
|
709
|
+
export type GetFilesystemSearchByPathResponse = GetFilesystemSearchByPathResponses[keyof GetFilesystemSearchByPathResponses];
|
|
512
710
|
export type DeleteFilesystemByPathData = {
|
|
513
711
|
body?: never;
|
|
514
712
|
path: {
|
|
@@ -621,6 +819,113 @@ export type PutFilesystemByPathResponses = {
|
|
|
621
819
|
200: SuccessResponse;
|
|
622
820
|
};
|
|
623
821
|
export type PutFilesystemByPathResponse = PutFilesystemByPathResponses[keyof PutFilesystemByPathResponses];
|
|
822
|
+
export type DeleteFilesystemTreeByPathData = {
|
|
823
|
+
body?: never;
|
|
824
|
+
path: {
|
|
825
|
+
/**
|
|
826
|
+
* Root directory path
|
|
827
|
+
*/
|
|
828
|
+
path: string;
|
|
829
|
+
};
|
|
830
|
+
query?: {
|
|
831
|
+
/**
|
|
832
|
+
* Delete directory recursively
|
|
833
|
+
*/
|
|
834
|
+
recursive?: boolean;
|
|
835
|
+
};
|
|
836
|
+
url: '/filesystem/tree/{path}';
|
|
837
|
+
};
|
|
838
|
+
export type DeleteFilesystemTreeByPathErrors = {
|
|
839
|
+
/**
|
|
840
|
+
* Bad request
|
|
841
|
+
*/
|
|
842
|
+
400: ErrorResponse;
|
|
843
|
+
/**
|
|
844
|
+
* Unprocessable entity
|
|
845
|
+
*/
|
|
846
|
+
422: ErrorResponse;
|
|
847
|
+
/**
|
|
848
|
+
* Internal server error
|
|
849
|
+
*/
|
|
850
|
+
500: ErrorResponse;
|
|
851
|
+
};
|
|
852
|
+
export type DeleteFilesystemTreeByPathError = DeleteFilesystemTreeByPathErrors[keyof DeleteFilesystemTreeByPathErrors];
|
|
853
|
+
export type DeleteFilesystemTreeByPathResponses = {
|
|
854
|
+
/**
|
|
855
|
+
* Directory deleted successfully
|
|
856
|
+
*/
|
|
857
|
+
200: SuccessResponse;
|
|
858
|
+
};
|
|
859
|
+
export type DeleteFilesystemTreeByPathResponse = DeleteFilesystemTreeByPathResponses[keyof DeleteFilesystemTreeByPathResponses];
|
|
860
|
+
export type GetFilesystemTreeByPathData = {
|
|
861
|
+
body?: never;
|
|
862
|
+
path: {
|
|
863
|
+
/**
|
|
864
|
+
* Root directory path
|
|
865
|
+
*/
|
|
866
|
+
path: string;
|
|
867
|
+
};
|
|
868
|
+
query?: never;
|
|
869
|
+
url: '/filesystem/tree/{path}';
|
|
870
|
+
};
|
|
871
|
+
export type GetFilesystemTreeByPathErrors = {
|
|
872
|
+
/**
|
|
873
|
+
* Bad request
|
|
874
|
+
*/
|
|
875
|
+
400: ErrorResponse;
|
|
876
|
+
/**
|
|
877
|
+
* Unprocessable entity
|
|
878
|
+
*/
|
|
879
|
+
422: ErrorResponse;
|
|
880
|
+
/**
|
|
881
|
+
* Internal server error
|
|
882
|
+
*/
|
|
883
|
+
500: ErrorResponse;
|
|
884
|
+
};
|
|
885
|
+
export type GetFilesystemTreeByPathError = GetFilesystemTreeByPathErrors[keyof GetFilesystemTreeByPathErrors];
|
|
886
|
+
export type GetFilesystemTreeByPathResponses = {
|
|
887
|
+
/**
|
|
888
|
+
* Directory tree
|
|
889
|
+
*/
|
|
890
|
+
200: Directory | FileWithContent | (Blob | File);
|
|
891
|
+
};
|
|
892
|
+
export type GetFilesystemTreeByPathResponse = GetFilesystemTreeByPathResponses[keyof GetFilesystemTreeByPathResponses];
|
|
893
|
+
export type PutFilesystemTreeByPathData = {
|
|
894
|
+
/**
|
|
895
|
+
* Map of file paths to content
|
|
896
|
+
*/
|
|
897
|
+
body: TreeRequest;
|
|
898
|
+
path: {
|
|
899
|
+
/**
|
|
900
|
+
* Root directory path
|
|
901
|
+
*/
|
|
902
|
+
path: string;
|
|
903
|
+
};
|
|
904
|
+
query?: never;
|
|
905
|
+
url: '/filesystem/tree/{path}';
|
|
906
|
+
};
|
|
907
|
+
export type PutFilesystemTreeByPathErrors = {
|
|
908
|
+
/**
|
|
909
|
+
* Bad request
|
|
910
|
+
*/
|
|
911
|
+
400: ErrorResponse;
|
|
912
|
+
/**
|
|
913
|
+
* Unprocessable entity
|
|
914
|
+
*/
|
|
915
|
+
422: ErrorResponse;
|
|
916
|
+
/**
|
|
917
|
+
* Internal server error
|
|
918
|
+
*/
|
|
919
|
+
500: ErrorResponse;
|
|
920
|
+
};
|
|
921
|
+
export type PutFilesystemTreeByPathError = PutFilesystemTreeByPathErrors[keyof PutFilesystemTreeByPathErrors];
|
|
922
|
+
export type PutFilesystemTreeByPathResponses = {
|
|
923
|
+
/**
|
|
924
|
+
* Updated directory tree
|
|
925
|
+
*/
|
|
926
|
+
200: Directory | FileWithContent | (Blob | File);
|
|
927
|
+
};
|
|
928
|
+
export type PutFilesystemTreeByPathResponse = PutFilesystemTreeByPathResponses[keyof PutFilesystemTreeByPathResponses];
|
|
624
929
|
export type DeleteNetworkProcessByPidMonitorData = {
|
|
625
930
|
body?: never;
|
|
626
931
|
path: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Sandbox } from "../../client/types.gen.js";
|
|
2
2
|
import { SandboxAction } from "../action.js";
|
|
3
|
-
import { Directory, SuccessResponse } from "../client/index.js";
|
|
3
|
+
import { ContentSearchResponse, Directory, FindResponse, FuzzySearchResponse, SuccessResponse } from "../client/index.js";
|
|
4
4
|
import { SandboxProcess } from "../process/index.js";
|
|
5
|
-
import { CopyResponse, SandboxFilesystemFile, WatchEvent } from "./types.js";
|
|
5
|
+
import { CopyResponse, FilesystemFindOptions, FilesystemGrepOptions, FilesystemSearchOptions, SandboxFilesystemFile, WatchEvent } from "./types.js";
|
|
6
6
|
export declare class SandboxFileSystem extends SandboxAction {
|
|
7
7
|
private process;
|
|
8
8
|
constructor(sandbox: Sandbox, process: SandboxProcess);
|
|
@@ -17,6 +17,9 @@ export declare class SandboxFileSystem extends SandboxAction {
|
|
|
17
17
|
}): Promise<void>;
|
|
18
18
|
rm(path: string, recursive?: boolean): Promise<SuccessResponse>;
|
|
19
19
|
ls(path: string): Promise<Directory>;
|
|
20
|
+
search(query: string, path?: string, options?: FilesystemSearchOptions): Promise<FuzzySearchResponse>;
|
|
21
|
+
find(path: string, options?: FilesystemFindOptions): Promise<FindResponse>;
|
|
22
|
+
grep(query: string, path?: string, options?: FilesystemGrepOptions): Promise<ContentSearchResponse>;
|
|
20
23
|
cp(source: string, destination: string, { maxWait }?: {
|
|
21
24
|
maxWait?: number;
|
|
22
25
|
}): Promise<CopyResponse>;
|
|
@@ -13,3 +13,23 @@ export type SandboxFilesystemFile = {
|
|
|
13
13
|
path: string;
|
|
14
14
|
content: string;
|
|
15
15
|
};
|
|
16
|
+
export interface FilesystemSearchOptions {
|
|
17
|
+
maxResults?: number;
|
|
18
|
+
patterns?: string[];
|
|
19
|
+
excludeDirs?: string[];
|
|
20
|
+
excludeHidden?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface FilesystemFindOptions {
|
|
23
|
+
type?: 'file' | 'directory';
|
|
24
|
+
patterns?: string[];
|
|
25
|
+
maxResults?: number;
|
|
26
|
+
excludeDirs?: string[];
|
|
27
|
+
excludeHidden?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface FilesystemGrepOptions {
|
|
30
|
+
caseSensitive?: boolean;
|
|
31
|
+
contextLines?: number;
|
|
32
|
+
maxResults?: number;
|
|
33
|
+
filePattern?: string;
|
|
34
|
+
excludeDirs?: string[];
|
|
35
|
+
}
|
|
@@ -4,10 +4,11 @@ import { DeleteProcessByIdentifierKillResponse, DeleteProcessByIdentifierRespons
|
|
|
4
4
|
import { ProcessRequestWithLog, ProcessResponseWithLog } from "../types.js";
|
|
5
5
|
export declare class SandboxProcess extends SandboxAction {
|
|
6
6
|
constructor(sandbox: Sandbox);
|
|
7
|
-
streamLogs(identifier: string, options
|
|
7
|
+
streamLogs(identifier: string, options?: {
|
|
8
8
|
onLog?: (log: string) => void;
|
|
9
9
|
onStdout?: (stdout: string) => void;
|
|
10
10
|
onStderr?: (stderr: string) => void;
|
|
11
|
+
onError?: (error: Error) => void;
|
|
11
12
|
}): {
|
|
12
13
|
close: () => void;
|
|
13
14
|
};
|