@blaxel/core 0.2.50 → 0.2.51-dev.217

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.
Files changed (31) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/common/settings.js +2 -2
  3. package/dist/cjs/common/version.js +6 -0
  4. package/dist/cjs/sandbox/client/sdk.gen.js +124 -1
  5. package/dist/cjs/sandbox/filesystem/filesystem.js +81 -1
  6. package/dist/cjs/types/common/version.d.ts +2 -0
  7. package/dist/cjs/types/sandbox/client/sdk.gen.d.ts +36 -1
  8. package/dist/cjs/types/sandbox/client/types.gen.d.ts +319 -4
  9. package/dist/cjs/types/sandbox/filesystem/filesystem.d.ts +5 -2
  10. package/dist/cjs/types/sandbox/filesystem/types.d.ts +20 -0
  11. package/dist/cjs-browser/.tsbuildinfo +1 -1
  12. package/dist/cjs-browser/common/settings.js +2 -2
  13. package/dist/cjs-browser/common/version.js +6 -0
  14. package/dist/cjs-browser/sandbox/client/sdk.gen.js +124 -1
  15. package/dist/cjs-browser/sandbox/filesystem/filesystem.js +81 -1
  16. package/dist/cjs-browser/types/common/version.d.ts +2 -0
  17. package/dist/cjs-browser/types/sandbox/client/sdk.gen.d.ts +36 -1
  18. package/dist/cjs-browser/types/sandbox/client/types.gen.d.ts +319 -4
  19. package/dist/cjs-browser/types/sandbox/filesystem/filesystem.d.ts +5 -2
  20. package/dist/cjs-browser/types/sandbox/filesystem/types.d.ts +20 -0
  21. package/dist/esm/.tsbuildinfo +1 -1
  22. package/dist/esm/common/settings.js +2 -2
  23. package/dist/esm/common/version.js +3 -0
  24. package/dist/esm/sandbox/client/sdk.gen.js +116 -0
  25. package/dist/esm/sandbox/filesystem/filesystem.js +82 -2
  26. package/dist/esm-browser/.tsbuildinfo +1 -1
  27. package/dist/esm-browser/common/settings.js +2 -2
  28. package/dist/esm-browser/common/version.js +3 -0
  29. package/dist/esm-browser/sandbox/client/sdk.gen.js +116 -0
  30. package/dist/esm-browser/sandbox/filesystem/filesystem.js +82 -2
  31. package/package.json +2 -2
@@ -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
  };
@@ -101,11 +136,11 @@ export type ProcessResponse = {
101
136
  completedAt: string;
102
137
  exitCode: number;
103
138
  logs: string;
104
- maxRestarts: number;
139
+ maxRestarts?: number;
105
140
  name: string;
106
141
  pid: string;
107
- restartCount: number;
108
- restartOnFailure: boolean;
142
+ restartCount?: number;
143
+ restartOnFailure?: boolean;
109
144
  startedAt: string;
110
145
  status: 'failed' | 'killed' | 'stopped' | 'running' | 'completed';
111
146
  workingDir: string;
@@ -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,118 @@ 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
+ * Number of context lines to include (default: 0)
374
+ */
375
+ contextLines?: number;
376
+ /**
377
+ * Maximum number of results to return (default: 100)
378
+ */
379
+ maxResults?: number;
380
+ /**
381
+ * File pattern to include (e.g., *.go)
382
+ */
383
+ filePattern?: string;
384
+ /**
385
+ * Comma-separated directory names to skip (default: node_modules,vendor,.git,dist,build,target,__pycache__,.venv,.next,coverage)
386
+ */
387
+ excludeDirs?: string;
388
+ };
389
+ url: '/filesystem-content-search/{path}';
390
+ };
391
+ export type GetFilesystemContentSearchByPathErrors = {
392
+ /**
393
+ * Bad request
394
+ */
395
+ 400: ErrorResponse;
396
+ /**
397
+ * Unprocessable entity
398
+ */
399
+ 422: ErrorResponse;
400
+ /**
401
+ * Internal server error
402
+ */
403
+ 500: ErrorResponse;
404
+ };
405
+ export type GetFilesystemContentSearchByPathError = GetFilesystemContentSearchByPathErrors[keyof GetFilesystemContentSearchByPathErrors];
406
+ export type GetFilesystemContentSearchByPathResponses = {
407
+ /**
408
+ * Content search results
409
+ */
410
+ 200: ContentSearchResponse;
411
+ };
412
+ export type GetFilesystemContentSearchByPathResponse = GetFilesystemContentSearchByPathResponses[keyof GetFilesystemContentSearchByPathResponses];
413
+ export type GetFilesystemFindByPathData = {
414
+ body?: never;
415
+ path: {
416
+ /**
417
+ * Path to search in (e.g., /home/user/projects)
418
+ */
419
+ path: string;
420
+ };
421
+ query?: {
422
+ /**
423
+ * Type of search (file or directory)
424
+ */
425
+ type?: string;
426
+ /**
427
+ * Comma-separated file patterns to include (e.g., *.go,*.js)
428
+ */
429
+ patterns?: string;
430
+ /**
431
+ * Maximum number of results to return (default: 20). If set to 0, all results will be returned.
432
+ */
433
+ maxResults?: number;
434
+ /**
435
+ * 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.
436
+ */
437
+ excludeDirs?: string;
438
+ /**
439
+ * Exclude hidden files and directories (default: true)
440
+ */
441
+ excludeHidden?: boolean;
442
+ };
443
+ url: '/filesystem-find/{path}';
444
+ };
445
+ export type GetFilesystemFindByPathErrors = {
446
+ /**
447
+ * Bad request
448
+ */
449
+ 400: ErrorResponse;
450
+ /**
451
+ * Unprocessable entity
452
+ */
453
+ 422: ErrorResponse;
454
+ /**
455
+ * Internal server error
456
+ */
457
+ 500: ErrorResponse;
458
+ };
459
+ export type GetFilesystemFindByPathError = GetFilesystemFindByPathErrors[keyof GetFilesystemFindByPathErrors];
460
+ export type GetFilesystemFindByPathResponses = {
461
+ /**
462
+ * Find results
463
+ */
464
+ 200: FindResponse;
465
+ };
466
+ export type GetFilesystemFindByPathResponse = GetFilesystemFindByPathResponses[keyof GetFilesystemFindByPathResponses];
315
467
  export type GetFilesystemMultipartData = {
316
468
  body?: never;
317
469
  path?: never;
@@ -509,6 +661,56 @@ export type PostFilesystemMultipartInitiateByPathResponses = {
509
661
  200: MultipartInitiateResponse;
510
662
  };
511
663
  export type PostFilesystemMultipartInitiateByPathResponse = PostFilesystemMultipartInitiateByPathResponses[keyof PostFilesystemMultipartInitiateByPathResponses];
664
+ export type GetFilesystemSearchByPathData = {
665
+ body?: never;
666
+ path: {
667
+ /**
668
+ * Path to search in (e.g., /home/user/projects)
669
+ */
670
+ path: string;
671
+ };
672
+ query?: {
673
+ /**
674
+ * Maximum number of results to return (default: 20)
675
+ */
676
+ maxResults?: number;
677
+ /**
678
+ * Comma-separated file patterns to include (e.g., *.go,*.js)
679
+ */
680
+ patterns?: string;
681
+ /**
682
+ * 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.
683
+ */
684
+ excludeDirs?: string;
685
+ /**
686
+ * Exclude hidden files and directories (default: true)
687
+ */
688
+ excludeHidden?: boolean;
689
+ };
690
+ url: '/filesystem-search/{path}';
691
+ };
692
+ export type GetFilesystemSearchByPathErrors = {
693
+ /**
694
+ * Bad request
695
+ */
696
+ 400: ErrorResponse;
697
+ /**
698
+ * Unprocessable entity
699
+ */
700
+ 422: ErrorResponse;
701
+ /**
702
+ * Internal server error
703
+ */
704
+ 500: ErrorResponse;
705
+ };
706
+ export type GetFilesystemSearchByPathError = GetFilesystemSearchByPathErrors[keyof GetFilesystemSearchByPathErrors];
707
+ export type GetFilesystemSearchByPathResponses = {
708
+ /**
709
+ * Fuzzy search results
710
+ */
711
+ 200: FuzzySearchResponse;
712
+ };
713
+ export type GetFilesystemSearchByPathResponse = GetFilesystemSearchByPathResponses[keyof GetFilesystemSearchByPathResponses];
512
714
  export type DeleteFilesystemByPathData = {
513
715
  body?: never;
514
716
  path: {
@@ -621,6 +823,113 @@ export type PutFilesystemByPathResponses = {
621
823
  200: SuccessResponse;
622
824
  };
623
825
  export type PutFilesystemByPathResponse = PutFilesystemByPathResponses[keyof PutFilesystemByPathResponses];
826
+ export type DeleteFilesystemTreeByPathData = {
827
+ body?: never;
828
+ path: {
829
+ /**
830
+ * Root directory path
831
+ */
832
+ path: string;
833
+ };
834
+ query?: {
835
+ /**
836
+ * Delete directory recursively
837
+ */
838
+ recursive?: boolean;
839
+ };
840
+ url: '/filesystem/tree/{path}';
841
+ };
842
+ export type DeleteFilesystemTreeByPathErrors = {
843
+ /**
844
+ * Bad request
845
+ */
846
+ 400: ErrorResponse;
847
+ /**
848
+ * Unprocessable entity
849
+ */
850
+ 422: ErrorResponse;
851
+ /**
852
+ * Internal server error
853
+ */
854
+ 500: ErrorResponse;
855
+ };
856
+ export type DeleteFilesystemTreeByPathError = DeleteFilesystemTreeByPathErrors[keyof DeleteFilesystemTreeByPathErrors];
857
+ export type DeleteFilesystemTreeByPathResponses = {
858
+ /**
859
+ * Directory deleted successfully
860
+ */
861
+ 200: SuccessResponse;
862
+ };
863
+ export type DeleteFilesystemTreeByPathResponse = DeleteFilesystemTreeByPathResponses[keyof DeleteFilesystemTreeByPathResponses];
864
+ export type GetFilesystemTreeByPathData = {
865
+ body?: never;
866
+ path: {
867
+ /**
868
+ * Root directory path
869
+ */
870
+ path: string;
871
+ };
872
+ query?: never;
873
+ url: '/filesystem/tree/{path}';
874
+ };
875
+ export type GetFilesystemTreeByPathErrors = {
876
+ /**
877
+ * Bad request
878
+ */
879
+ 400: ErrorResponse;
880
+ /**
881
+ * Unprocessable entity
882
+ */
883
+ 422: ErrorResponse;
884
+ /**
885
+ * Internal server error
886
+ */
887
+ 500: ErrorResponse;
888
+ };
889
+ export type GetFilesystemTreeByPathError = GetFilesystemTreeByPathErrors[keyof GetFilesystemTreeByPathErrors];
890
+ export type GetFilesystemTreeByPathResponses = {
891
+ /**
892
+ * Directory tree
893
+ */
894
+ 200: Directory | FileWithContent | (Blob | File);
895
+ };
896
+ export type GetFilesystemTreeByPathResponse = GetFilesystemTreeByPathResponses[keyof GetFilesystemTreeByPathResponses];
897
+ export type PutFilesystemTreeByPathData = {
898
+ /**
899
+ * Map of file paths to content
900
+ */
901
+ body: TreeRequest;
902
+ path: {
903
+ /**
904
+ * Root directory path
905
+ */
906
+ path: string;
907
+ };
908
+ query?: never;
909
+ url: '/filesystem/tree/{path}';
910
+ };
911
+ export type PutFilesystemTreeByPathErrors = {
912
+ /**
913
+ * Bad request
914
+ */
915
+ 400: ErrorResponse;
916
+ /**
917
+ * Unprocessable entity
918
+ */
919
+ 422: ErrorResponse;
920
+ /**
921
+ * Internal server error
922
+ */
923
+ 500: ErrorResponse;
924
+ };
925
+ export type PutFilesystemTreeByPathError = PutFilesystemTreeByPathErrors[keyof PutFilesystemTreeByPathErrors];
926
+ export type PutFilesystemTreeByPathResponses = {
927
+ /**
928
+ * Updated directory tree
929
+ */
930
+ 200: Directory | FileWithContent | (Blob | File);
931
+ };
932
+ export type PutFilesystemTreeByPathResponse = PutFilesystemTreeByPathResponses[keyof PutFilesystemTreeByPathResponses];
624
933
  export type DeleteNetworkProcessByPidMonitorData = {
625
934
  body?: never;
626
935
  path: {
@@ -964,6 +1273,12 @@ export type GetWatchFilesystemByPathResponses = {
964
1273
  200: string;
965
1274
  };
966
1275
  export type GetWatchFilesystemByPathResponse = GetWatchFilesystemByPathResponses[keyof GetWatchFilesystemByPathResponses];
1276
+ export type GetWsData = {
1277
+ body?: never;
1278
+ path?: never;
1279
+ query?: never;
1280
+ url: '/ws';
1281
+ };
967
1282
  export type ClientOptions = {
968
- baseUrl: 'https://run.blaxel.ai/{workspace_id}/sandboxes/{sandbox_id}' | (string & {});
1283
+ baseUrl: 'https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run' | (string & {});
969
1284
  };
@@ -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
+ }