@blaxel/core 0.2.54-preview.13 → 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/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-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/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/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-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/package.json +1 -1
|
@@ -9,8 +9,8 @@ const index_js_1 = require("../authentication/index.js");
|
|
|
9
9
|
const env_js_1 = require("../common/env.js");
|
|
10
10
|
const node_js_1 = require("../common/node.js");
|
|
11
11
|
// Build info - these placeholders are replaced at build time by build:replace-imports
|
|
12
|
-
const BUILD_VERSION = "0.2.54-preview.
|
|
13
|
-
const BUILD_COMMIT = "
|
|
12
|
+
const BUILD_VERSION = "0.2.54-preview.14";
|
|
13
|
+
const BUILD_COMMIT = "36d148e9b7f9dd2134c772d954c8297b3c958ec3";
|
|
14
14
|
const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
|
|
15
15
|
// Cache for config.yaml tracking value
|
|
16
16
|
let configTrackingValue = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getWatchFilesystemByPath = exports.getProcessByIdentifierLogsStream = exports.getProcessByIdentifierLogs = exports.deleteProcessByIdentifierKill = exports.getProcessByIdentifier = exports.deleteProcessByIdentifier = exports.postProcess = exports.getProcess = exports.getNetworkProcessByPidPorts = exports.postNetworkProcessByPidMonitor = exports.deleteNetworkProcessByPidMonitor = exports.putFilesystemByPath = exports.getFilesystemByPath = exports.deleteFilesystemByPath = exports.postFilesystemMultipartInitiateByPath = exports.getFilesystemMultipartByUploadIdParts = exports.putFilesystemMultipartByUploadIdPart = exports.postFilesystemMultipartByUploadIdComplete = exports.deleteFilesystemMultipartByUploadIdAbort = exports.getFilesystemMultipart = exports.getCodegenRerankingByPath = exports.putCodegenFastapplyByPath = exports.put = exports.post = exports.patch = exports.options = exports.get = exports.delete_ = void 0;
|
|
4
|
+
exports.getWatchFilesystemByPath = exports.getProcessByIdentifierLogsStream = exports.getProcessByIdentifierLogs = exports.deleteProcessByIdentifierKill = exports.getProcessByIdentifier = exports.deleteProcessByIdentifier = exports.postProcess = exports.getProcess = exports.getNetworkProcessByPidPorts = exports.postNetworkProcessByPidMonitor = exports.deleteNetworkProcessByPidMonitor = exports.putFilesystemTreeByPath = exports.getFilesystemTreeByPath = exports.deleteFilesystemTreeByPath = exports.putFilesystemByPath = exports.getFilesystemByPath = exports.deleteFilesystemByPath = exports.getFilesystemSearchByPath = exports.postFilesystemMultipartInitiateByPath = exports.getFilesystemMultipartByUploadIdParts = exports.putFilesystemMultipartByUploadIdPart = exports.postFilesystemMultipartByUploadIdComplete = exports.deleteFilesystemMultipartByUploadIdAbort = exports.getFilesystemMultipart = exports.getFilesystemFindByPath = exports.getFilesystemContentSearchByPath = exports.getCodegenRerankingByPath = exports.putCodegenFastapplyByPath = exports.put = exports.post = exports.patch = exports.options = exports.get = exports.delete_ = void 0;
|
|
5
5
|
const client_fetch_1 = require("@hey-api/client-fetch");
|
|
6
6
|
const client_gen_1 = require("./client.gen");
|
|
7
7
|
/**
|
|
@@ -175,6 +175,40 @@ const getCodegenRerankingByPath = (options) => {
|
|
|
175
175
|
});
|
|
176
176
|
};
|
|
177
177
|
exports.getCodegenRerankingByPath = getCodegenRerankingByPath;
|
|
178
|
+
/**
|
|
179
|
+
* Search for text content in files
|
|
180
|
+
* Searches for text content inside files using ripgrep. Returns matching lines with context.
|
|
181
|
+
*/
|
|
182
|
+
const getFilesystemContentSearchByPath = (options) => {
|
|
183
|
+
return (options.client ?? client_gen_1.client).get({
|
|
184
|
+
security: [
|
|
185
|
+
{
|
|
186
|
+
scheme: 'bearer',
|
|
187
|
+
type: 'http'
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
url: '/filesystem-content-search/{path}',
|
|
191
|
+
...options
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
exports.getFilesystemContentSearchByPath = getFilesystemContentSearchByPath;
|
|
195
|
+
/**
|
|
196
|
+
* Find files and directories
|
|
197
|
+
* Finds files and directories using the find command.
|
|
198
|
+
*/
|
|
199
|
+
const getFilesystemFindByPath = (options) => {
|
|
200
|
+
return (options.client ?? client_gen_1.client).get({
|
|
201
|
+
security: [
|
|
202
|
+
{
|
|
203
|
+
scheme: 'bearer',
|
|
204
|
+
type: 'http'
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
url: '/filesystem-find/{path}',
|
|
208
|
+
...options
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
exports.getFilesystemFindByPath = getFilesystemFindByPath;
|
|
178
212
|
/**
|
|
179
213
|
* List multipart uploads
|
|
180
214
|
* List all active multipart uploads
|
|
@@ -290,6 +324,23 @@ const postFilesystemMultipartInitiateByPath = (options) => {
|
|
|
290
324
|
});
|
|
291
325
|
};
|
|
292
326
|
exports.postFilesystemMultipartInitiateByPath = postFilesystemMultipartInitiateByPath;
|
|
327
|
+
/**
|
|
328
|
+
* Fuzzy search for files and directories
|
|
329
|
+
* Performs fuzzy search on filesystem paths using fuzzy matching algorithm. Optimized alternative to find and grep commands.
|
|
330
|
+
*/
|
|
331
|
+
const getFilesystemSearchByPath = (options) => {
|
|
332
|
+
return (options.client ?? client_gen_1.client).get({
|
|
333
|
+
security: [
|
|
334
|
+
{
|
|
335
|
+
scheme: 'bearer',
|
|
336
|
+
type: 'http'
|
|
337
|
+
}
|
|
338
|
+
],
|
|
339
|
+
url: '/filesystem-search/{path}',
|
|
340
|
+
...options
|
|
341
|
+
});
|
|
342
|
+
};
|
|
343
|
+
exports.getFilesystemSearchByPath = getFilesystemSearchByPath;
|
|
293
344
|
/**
|
|
294
345
|
* Delete file or directory
|
|
295
346
|
* Delete a file or directory
|
|
@@ -345,6 +396,61 @@ const putFilesystemByPath = (options) => {
|
|
|
345
396
|
});
|
|
346
397
|
};
|
|
347
398
|
exports.putFilesystemByPath = putFilesystemByPath;
|
|
399
|
+
/**
|
|
400
|
+
* Delete directory tree
|
|
401
|
+
* Delete a directory tree recursively
|
|
402
|
+
*/
|
|
403
|
+
const deleteFilesystemTreeByPath = (options) => {
|
|
404
|
+
return (options.client ?? client_gen_1.client).delete({
|
|
405
|
+
security: [
|
|
406
|
+
{
|
|
407
|
+
scheme: 'bearer',
|
|
408
|
+
type: 'http'
|
|
409
|
+
}
|
|
410
|
+
],
|
|
411
|
+
url: '/filesystem/tree/{path}',
|
|
412
|
+
...options
|
|
413
|
+
});
|
|
414
|
+
};
|
|
415
|
+
exports.deleteFilesystemTreeByPath = deleteFilesystemTreeByPath;
|
|
416
|
+
/**
|
|
417
|
+
* Get directory tree
|
|
418
|
+
* Get a recursive directory tree structure starting from the specified path
|
|
419
|
+
*/
|
|
420
|
+
const getFilesystemTreeByPath = (options) => {
|
|
421
|
+
return (options.client ?? client_gen_1.client).get({
|
|
422
|
+
security: [
|
|
423
|
+
{
|
|
424
|
+
scheme: 'bearer',
|
|
425
|
+
type: 'http'
|
|
426
|
+
}
|
|
427
|
+
],
|
|
428
|
+
url: '/filesystem/tree/{path}',
|
|
429
|
+
...options
|
|
430
|
+
});
|
|
431
|
+
};
|
|
432
|
+
exports.getFilesystemTreeByPath = getFilesystemTreeByPath;
|
|
433
|
+
/**
|
|
434
|
+
* Create or update directory tree
|
|
435
|
+
* Create or update multiple files within a directory tree structure
|
|
436
|
+
*/
|
|
437
|
+
const putFilesystemTreeByPath = (options) => {
|
|
438
|
+
return (options.client ?? client_gen_1.client).put({
|
|
439
|
+
security: [
|
|
440
|
+
{
|
|
441
|
+
scheme: 'bearer',
|
|
442
|
+
type: 'http'
|
|
443
|
+
}
|
|
444
|
+
],
|
|
445
|
+
url: '/filesystem/tree/{path}',
|
|
446
|
+
...options,
|
|
447
|
+
headers: {
|
|
448
|
+
'Content-Type': 'application/json',
|
|
449
|
+
...options?.headers
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
};
|
|
453
|
+
exports.putFilesystemTreeByPath = putFilesystemTreeByPath;
|
|
348
454
|
/**
|
|
349
455
|
* Stop monitoring ports for a process
|
|
350
456
|
* Stop monitoring for new ports opened by a process
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SandboxFileSystem = void 0;
|
|
4
|
-
const settings_js_1 = require("../../common/settings.js");
|
|
5
4
|
const node_js_1 = require("../../common/node.js");
|
|
5
|
+
const settings_js_1 = require("../../common/settings.js");
|
|
6
6
|
const action_js_1 = require("../action.js");
|
|
7
7
|
const index_js_1 = require("../client/index.js");
|
|
8
8
|
// Multipart upload constants
|
|
@@ -199,6 +199,86 @@ class SandboxFileSystem extends action_js_1.SandboxAction {
|
|
|
199
199
|
}
|
|
200
200
|
return data;
|
|
201
201
|
}
|
|
202
|
+
async search(query, path = "/", options) {
|
|
203
|
+
const formattedPath = this.formatPath(path);
|
|
204
|
+
const queryParams = {};
|
|
205
|
+
if (options?.maxResults !== undefined) {
|
|
206
|
+
queryParams.maxResults = options.maxResults;
|
|
207
|
+
}
|
|
208
|
+
if (options?.patterns && options.patterns.length > 0) {
|
|
209
|
+
queryParams.patterns = options.patterns.join(',');
|
|
210
|
+
}
|
|
211
|
+
if (options?.excludeDirs && options.excludeDirs.length > 0) {
|
|
212
|
+
queryParams.excludeDirs = options.excludeDirs.join(',');
|
|
213
|
+
}
|
|
214
|
+
if (options?.excludeHidden !== undefined) {
|
|
215
|
+
queryParams.excludeHidden = options.excludeHidden;
|
|
216
|
+
}
|
|
217
|
+
const result = await (0, index_js_1.getFilesystemSearchByPath)({
|
|
218
|
+
path: { path: formattedPath },
|
|
219
|
+
query: queryParams,
|
|
220
|
+
baseUrl: this.url,
|
|
221
|
+
client: this.client,
|
|
222
|
+
});
|
|
223
|
+
this.handleResponseError(result.response, result.data, result.error);
|
|
224
|
+
return result.data;
|
|
225
|
+
}
|
|
226
|
+
async find(path, options) {
|
|
227
|
+
const formattedPath = this.formatPath(path);
|
|
228
|
+
const queryParams = {};
|
|
229
|
+
if (options?.type) {
|
|
230
|
+
queryParams.type = options.type;
|
|
231
|
+
}
|
|
232
|
+
if (options?.patterns && options.patterns.length > 0) {
|
|
233
|
+
queryParams.patterns = options.patterns.join(',');
|
|
234
|
+
}
|
|
235
|
+
if (options?.maxResults !== undefined) {
|
|
236
|
+
queryParams.maxResults = options.maxResults;
|
|
237
|
+
}
|
|
238
|
+
if (options?.excludeDirs && options.excludeDirs.length > 0) {
|
|
239
|
+
queryParams.excludeDirs = options.excludeDirs.join(',');
|
|
240
|
+
}
|
|
241
|
+
if (options?.excludeHidden !== undefined) {
|
|
242
|
+
queryParams.excludeHidden = options.excludeHidden;
|
|
243
|
+
}
|
|
244
|
+
const result = await (0, index_js_1.getFilesystemFindByPath)({
|
|
245
|
+
path: { path: formattedPath },
|
|
246
|
+
query: queryParams,
|
|
247
|
+
baseUrl: this.url,
|
|
248
|
+
client: this.client,
|
|
249
|
+
});
|
|
250
|
+
this.handleResponseError(result.response, result.data, result.error);
|
|
251
|
+
return result.data;
|
|
252
|
+
}
|
|
253
|
+
async grep(query, path = "/", options) {
|
|
254
|
+
const formattedPath = this.formatPath(path);
|
|
255
|
+
const queryParams = {
|
|
256
|
+
query,
|
|
257
|
+
};
|
|
258
|
+
if (options?.caseSensitive !== undefined) {
|
|
259
|
+
queryParams.caseSensitive = options.caseSensitive;
|
|
260
|
+
}
|
|
261
|
+
if (options?.contextLines !== undefined) {
|
|
262
|
+
queryParams.contextLines = options.contextLines;
|
|
263
|
+
}
|
|
264
|
+
if (options?.maxResults !== undefined) {
|
|
265
|
+
queryParams.maxResults = options.maxResults;
|
|
266
|
+
}
|
|
267
|
+
if (options?.filePattern) {
|
|
268
|
+
queryParams.filePattern = options.filePattern;
|
|
269
|
+
}
|
|
270
|
+
if (options?.excludeDirs && options.excludeDirs.length > 0) {
|
|
271
|
+
queryParams.excludeDirs = options.excludeDirs.join(',');
|
|
272
|
+
}
|
|
273
|
+
const result = await (0, index_js_1.getFilesystemContentSearchByPath)({
|
|
274
|
+
path: { path: formattedPath },
|
|
275
|
+
query: queryParams,
|
|
276
|
+
baseUrl: this.url,
|
|
277
|
+
client: this.client,
|
|
278
|
+
});
|
|
279
|
+
this.handleResponseError(result.response, result.data, result.error);
|
|
280
|
+
return result.data;
|
|
281
|
+
}
|
|
202
282
|
async cp(source, destination, { maxWait = 180000 } = {}) {
|
|
203
283
|
let process = await this.process.exec({
|
|
204
284
|
command: `cp -r ${source} ${destination}`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Options as ClientOptions, type TDataShape, type Client } from '@hey-api/client-fetch';
|
|
2
|
-
import type { DeleteData, GetData, OptionsData, PatchData, PostData, PutData, PutCodegenFastapplyByPathData, GetCodegenRerankingByPathData, GetFilesystemMultipartData, DeleteFilesystemMultipartByUploadIdAbortData, PostFilesystemMultipartByUploadIdCompleteData, PutFilesystemMultipartByUploadIdPartData, GetFilesystemMultipartByUploadIdPartsData, PostFilesystemMultipartInitiateByPathData, DeleteFilesystemByPathData, GetFilesystemByPathData, PutFilesystemByPathData, DeleteNetworkProcessByPidMonitorData, PostNetworkProcessByPidMonitorData, GetNetworkProcessByPidPortsData, GetProcessData, PostProcessData, DeleteProcessByIdentifierData, GetProcessByIdentifierData, DeleteProcessByIdentifierKillData, GetProcessByIdentifierLogsData, GetProcessByIdentifierLogsStreamData, GetWatchFilesystemByPathData } from './types.gen';
|
|
2
|
+
import type { DeleteData, GetData, OptionsData, PatchData, PostData, PutData, PutCodegenFastapplyByPathData, GetCodegenRerankingByPathData, GetFilesystemContentSearchByPathData, GetFilesystemFindByPathData, GetFilesystemMultipartData, DeleteFilesystemMultipartByUploadIdAbortData, PostFilesystemMultipartByUploadIdCompleteData, PutFilesystemMultipartByUploadIdPartData, GetFilesystemMultipartByUploadIdPartsData, PostFilesystemMultipartInitiateByPathData, GetFilesystemSearchByPathData, DeleteFilesystemByPathData, GetFilesystemByPathData, PutFilesystemByPathData, DeleteFilesystemTreeByPathData, GetFilesystemTreeByPathData, PutFilesystemTreeByPathData, DeleteNetworkProcessByPidMonitorData, PostNetworkProcessByPidMonitorData, GetNetworkProcessByPidPortsData, GetProcessData, PostProcessData, DeleteProcessByIdentifierData, GetProcessByIdentifierData, DeleteProcessByIdentifierKillData, GetProcessByIdentifierLogsData, GetProcessByIdentifierLogsStreamData, GetWatchFilesystemByPathData } from './types.gen';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -84,6 +84,16 @@ export declare const putCodegenFastapplyByPath: <ThrowOnError extends boolean =
|
|
|
84
84
|
* The response will be a list of file paths and contents ordered from most relevant to least relevant.
|
|
85
85
|
*/
|
|
86
86
|
export declare const getCodegenRerankingByPath: <ThrowOnError extends boolean = false>(options: Options<GetCodegenRerankingByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").RerankingResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
87
|
+
/**
|
|
88
|
+
* Search for text content in files
|
|
89
|
+
* Searches for text content inside files using ripgrep. Returns matching lines with context.
|
|
90
|
+
*/
|
|
91
|
+
export declare const getFilesystemContentSearchByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemContentSearchByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ContentSearchResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
92
|
+
/**
|
|
93
|
+
* Find files and directories
|
|
94
|
+
* Finds files and directories using the find command.
|
|
95
|
+
*/
|
|
96
|
+
export declare const getFilesystemFindByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemFindByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").FindResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
87
97
|
/**
|
|
88
98
|
* List multipart uploads
|
|
89
99
|
* List all active multipart uploads
|
|
@@ -114,6 +124,11 @@ export declare const getFilesystemMultipartByUploadIdParts: <ThrowOnError extend
|
|
|
114
124
|
* Initiate a multipart upload session for a file
|
|
115
125
|
*/
|
|
116
126
|
export declare const postFilesystemMultipartInitiateByPath: <ThrowOnError extends boolean = false>(options: Options<PostFilesystemMultipartInitiateByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").MultipartInitiateResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
127
|
+
/**
|
|
128
|
+
* Fuzzy search for files and directories
|
|
129
|
+
* Performs fuzzy search on filesystem paths using fuzzy matching algorithm. Optimized alternative to find and grep commands.
|
|
130
|
+
*/
|
|
131
|
+
export declare const getFilesystemSearchByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemSearchByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").FuzzySearchResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
117
132
|
/**
|
|
118
133
|
* Delete file or directory
|
|
119
134
|
* Delete a file or directory
|
|
@@ -129,6 +144,21 @@ export declare const getFilesystemByPath: <ThrowOnError extends boolean = false>
|
|
|
129
144
|
* Create or update a file or directory
|
|
130
145
|
*/
|
|
131
146
|
export declare const putFilesystemByPath: <ThrowOnError extends boolean = false>(options: Options<PutFilesystemByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").SuccessResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
147
|
+
/**
|
|
148
|
+
* Delete directory tree
|
|
149
|
+
* Delete a directory tree recursively
|
|
150
|
+
*/
|
|
151
|
+
export declare const deleteFilesystemTreeByPath: <ThrowOnError extends boolean = false>(options: Options<DeleteFilesystemTreeByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").SuccessResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
152
|
+
/**
|
|
153
|
+
* Get directory tree
|
|
154
|
+
* Get a recursive directory tree structure starting from the specified path
|
|
155
|
+
*/
|
|
156
|
+
export declare const getFilesystemTreeByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemTreeByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").File | import("./types.gen").Directory | import("./types.gen").FileWithContent | Blob, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
157
|
+
/**
|
|
158
|
+
* Create or update directory tree
|
|
159
|
+
* Create or update multiple files within a directory tree structure
|
|
160
|
+
*/
|
|
161
|
+
export declare const putFilesystemTreeByPath: <ThrowOnError extends boolean = false>(options: Options<PutFilesystemTreeByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").File | import("./types.gen").Directory | import("./types.gen").FileWithContent | Blob, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
132
162
|
/**
|
|
133
163
|
* Stop monitoring ports for a process
|
|
134
164
|
* Stop monitoring for new ports opened by a process
|
|
@@ -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>;
|