cyberdesk 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/sdk.gen.d.ts +13 -1
- package/dist/client/sdk.gen.js +23 -2
- package/dist/client/types.gen.d.ts +53 -1
- package/dist/index.d.ts +42 -2
- package/dist/index.js +42 -0
- package/package.json +1 -1
package/dist/client/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
|
|
2
|
-
import type { HealthCheckV1HealthGetData, DatabaseHealthCheckV1HealthDbGetData, ListMachinesV1MachinesGetData, CreateMachineV1MachinesPostData, DeleteMachineV1MachinesMachineIdDeleteData, GetMachineV1MachinesMachineIdGetData, UpdateMachineV1MachinesMachineIdPatchData, ListWorkflowsV1WorkflowsGetData, CreateWorkflowV1WorkflowsPostData, DeleteWorkflowV1WorkflowsWorkflowIdDeleteData, GetWorkflowV1WorkflowsWorkflowIdGetData, UpdateWorkflowV1WorkflowsWorkflowIdPatchData, GetWorkflowVersionsV1WorkflowsWorkflowIdVersionsGetData, ListRunsV1RunsGetData, CreateRunV1RunsPostData, DeleteRunV1RunsRunIdDeleteData, GetRunV1RunsRunIdGetData, UpdateRunV1RunsRunIdPatchData, ListRunAttachmentsV1RunAttachmentsGetData, CreateRunAttachmentV1RunAttachmentsPostData, DeleteRunAttachmentV1RunAttachmentsAttachmentIdDeleteData, GetRunAttachmentV1RunAttachmentsAttachmentIdGetData, UpdateRunAttachmentV1RunAttachmentsAttachmentIdPutData, GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetData, DownloadRunAttachmentV1RunAttachmentsAttachmentIdDownloadGetData, ListConnectionsV1ConnectionsGetData, CreateConnectionV1ConnectionsPostData, DeleteConnectionV1ConnectionsConnectionIdDeleteData, GetConnectionV1ConnectionsConnectionIdGetData, UpdateConnectionV1ConnectionsConnectionIdPatchData, ListRequestLogsV1RequestLogsGetData, CreateRequestLogV1RequestLogsPostData, DeleteRequestLogV1RequestLogsLogIdDeleteData, GetRequestLogV1RequestLogsLogIdGetData, UpdateRequestLogV1RequestLogsLogIdPatchData, ListTrajectoriesV1TrajectoriesGetData, CreateTrajectoryV1TrajectoriesPostData, DeleteTrajectoryV1TrajectoriesTrajectoryIdDeleteData, GetTrajectoryV1TrajectoriesTrajectoryIdGetData, UpdateTrajectoryV1TrajectoriesTrajectoryIdPatchData, GetLatestTrajectoryForWorkflowV1WorkflowsWorkflowIdLatestTrajectoryGetData, GetScreenshotV1ComputerMachineIdDisplayScreenshotGetData, GetDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGetData, KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostData, KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostData, GetMousePositionV1ComputerMachineIdInputMousePositionGetData, MouseMoveV1ComputerMachineIdInputMouseMovePostData, MouseClickV1ComputerMachineIdInputMouseClickPostData, FsListV1ComputerMachineIdFsListGetData, FsReadV1ComputerMachineIdFsReadGetData, FsWriteV1ComputerMachineIdFsWritePostData, PowershellExecV1ComputerMachineIdShellPowershellExecPostData, PowershellSessionV1ComputerMachineIdShellPowershellSessionPostData, DummyTestEndpointV1TestPostData, RootGetData } from './types.gen';
|
|
2
|
+
import type { HealthCheckV1HealthGetData, DatabaseHealthCheckV1HealthDbGetData, ListMachinesV1MachinesGetData, CreateMachineV1MachinesPostData, DeleteMachineV1MachinesMachineIdDeleteData, GetMachineV1MachinesMachineIdGetData, UpdateMachineV1MachinesMachineIdPatchData, ListWorkflowsV1WorkflowsGetData, CreateWorkflowV1WorkflowsPostData, DeleteWorkflowV1WorkflowsWorkflowIdDeleteData, GetWorkflowV1WorkflowsWorkflowIdGetData, UpdateWorkflowV1WorkflowsWorkflowIdPatchData, GetWorkflowVersionsV1WorkflowsWorkflowIdVersionsGetData, ListRunsV1RunsGetData, CreateRunV1RunsPostData, DeleteRunV1RunsRunIdDeleteData, GetRunV1RunsRunIdGetData, UpdateRunV1RunsRunIdPatchData, BulkCreateRunsV1RunsBulkPostData, ListRunAttachmentsV1RunAttachmentsGetData, CreateRunAttachmentV1RunAttachmentsPostData, DeleteRunAttachmentV1RunAttachmentsAttachmentIdDeleteData, GetRunAttachmentV1RunAttachmentsAttachmentIdGetData, UpdateRunAttachmentV1RunAttachmentsAttachmentIdPutData, GetRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGetData, DownloadRunAttachmentV1RunAttachmentsAttachmentIdDownloadGetData, ListConnectionsV1ConnectionsGetData, CreateConnectionV1ConnectionsPostData, DeleteConnectionV1ConnectionsConnectionIdDeleteData, GetConnectionV1ConnectionsConnectionIdGetData, UpdateConnectionV1ConnectionsConnectionIdPatchData, ListRequestLogsV1RequestLogsGetData, CreateRequestLogV1RequestLogsPostData, DeleteRequestLogV1RequestLogsLogIdDeleteData, GetRequestLogV1RequestLogsLogIdGetData, UpdateRequestLogV1RequestLogsLogIdPatchData, ListTrajectoriesV1TrajectoriesGetData, CreateTrajectoryV1TrajectoriesPostData, DeleteTrajectoryV1TrajectoriesTrajectoryIdDeleteData, GetTrajectoryV1TrajectoriesTrajectoryIdGetData, UpdateTrajectoryV1TrajectoriesTrajectoryIdPatchData, GetLatestTrajectoryForWorkflowV1WorkflowsWorkflowIdLatestTrajectoryGetData, GetScreenshotV1ComputerMachineIdDisplayScreenshotGetData, GetDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGetData, KeyboardTypeV1ComputerMachineIdInputKeyboardTypePostData, KeyboardKeyV1ComputerMachineIdInputKeyboardKeyPostData, GetMousePositionV1ComputerMachineIdInputMousePositionGetData, MouseMoveV1ComputerMachineIdInputMouseMovePostData, MouseClickV1ComputerMachineIdInputMouseClickPostData, FsListV1ComputerMachineIdFsListGetData, FsReadV1ComputerMachineIdFsReadGetData, FsWriteV1ComputerMachineIdFsWritePostData, PowershellExecV1ComputerMachineIdShellPowershellExecPostData, PowershellSessionV1ComputerMachineIdShellPowershellSessionPostData, DummyTestEndpointV1TestPostData, RootGetData } 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
|
|
@@ -157,6 +157,18 @@ export declare const getRunV1RunsRunIdGet: <ThrowOnError extends boolean = false
|
|
|
157
157
|
* The run must belong to the authenticated user.
|
|
158
158
|
*/
|
|
159
159
|
export declare const updateRunV1RunsRunIdPatch: <ThrowOnError extends boolean = false>(options: Options<UpdateRunV1RunsRunIdPatchData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").RunResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
|
|
160
|
+
/**
|
|
161
|
+
* Bulk Create Runs
|
|
162
|
+
* Create multiple runs with the same configuration.
|
|
163
|
+
*
|
|
164
|
+
* This endpoint creates multiple runs efficiently:
|
|
165
|
+
* - All runs are created in a single database transaction
|
|
166
|
+
* - Temporal workflows are started asynchronously
|
|
167
|
+
* - Returns immediately with created run details
|
|
168
|
+
*
|
|
169
|
+
* Maximum 1000 runs can be created in a single request.
|
|
170
|
+
*/
|
|
171
|
+
export declare const bulkCreateRunsV1RunsBulkPost: <ThrowOnError extends boolean = false>(options: Options<BulkCreateRunsV1RunsBulkPostData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").RunBulkCreateResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
|
|
160
172
|
/**
|
|
161
173
|
* List Run Attachments
|
|
162
174
|
* List all run attachments for the authenticated user.
|
package/dist/client/sdk.gen.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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.
|
|
5
|
-
exports.rootGet = exports.dummyTestEndpointV1TestPost = exports.powershellSessionV1ComputerMachineIdShellPowershellSessionPost = exports.powershellExecV1ComputerMachineIdShellPowershellExecPost = exports.fsWriteV1ComputerMachineIdFsWritePost = void 0;
|
|
4
|
+
exports.fsListV1ComputerMachineIdFsListGet = exports.mouseClickV1ComputerMachineIdInputMouseClickPost = exports.mouseMoveV1ComputerMachineIdInputMouseMovePost = exports.getMousePositionV1ComputerMachineIdInputMousePositionGet = exports.keyboardKeyV1ComputerMachineIdInputKeyboardKeyPost = exports.keyboardTypeV1ComputerMachineIdInputKeyboardTypePost = exports.getDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGet = exports.getScreenshotV1ComputerMachineIdDisplayScreenshotGet = exports.getLatestTrajectoryForWorkflowV1WorkflowsWorkflowIdLatestTrajectoryGet = exports.updateTrajectoryV1TrajectoriesTrajectoryIdPatch = exports.getTrajectoryV1TrajectoriesTrajectoryIdGet = exports.deleteTrajectoryV1TrajectoriesTrajectoryIdDelete = exports.createTrajectoryV1TrajectoriesPost = exports.listTrajectoriesV1TrajectoriesGet = exports.updateRequestLogV1RequestLogsLogIdPatch = exports.getRequestLogV1RequestLogsLogIdGet = exports.deleteRequestLogV1RequestLogsLogIdDelete = exports.createRequestLogV1RequestLogsPost = exports.listRequestLogsV1RequestLogsGet = exports.updateConnectionV1ConnectionsConnectionIdPatch = exports.getConnectionV1ConnectionsConnectionIdGet = exports.deleteConnectionV1ConnectionsConnectionIdDelete = exports.createConnectionV1ConnectionsPost = exports.listConnectionsV1ConnectionsGet = exports.downloadRunAttachmentV1RunAttachmentsAttachmentIdDownloadGet = exports.getRunAttachmentDownloadUrlV1RunAttachmentsAttachmentIdDownloadUrlGet = exports.updateRunAttachmentV1RunAttachmentsAttachmentIdPut = exports.getRunAttachmentV1RunAttachmentsAttachmentIdGet = exports.deleteRunAttachmentV1RunAttachmentsAttachmentIdDelete = exports.createRunAttachmentV1RunAttachmentsPost = exports.listRunAttachmentsV1RunAttachmentsGet = exports.bulkCreateRunsV1RunsBulkPost = exports.updateRunV1RunsRunIdPatch = exports.getRunV1RunsRunIdGet = exports.deleteRunV1RunsRunIdDelete = exports.createRunV1RunsPost = exports.listRunsV1RunsGet = exports.getWorkflowVersionsV1WorkflowsWorkflowIdVersionsGet = exports.updateWorkflowV1WorkflowsWorkflowIdPatch = exports.getWorkflowV1WorkflowsWorkflowIdGet = exports.deleteWorkflowV1WorkflowsWorkflowIdDelete = exports.createWorkflowV1WorkflowsPost = exports.listWorkflowsV1WorkflowsGet = exports.updateMachineV1MachinesMachineIdPatch = exports.getMachineV1MachinesMachineIdGet = exports.deleteMachineV1MachinesMachineIdDelete = exports.createMachineV1MachinesPost = exports.listMachinesV1MachinesGet = exports.databaseHealthCheckV1HealthDbGet = exports.healthCheckV1HealthGet = void 0;
|
|
5
|
+
exports.rootGet = exports.dummyTestEndpointV1TestPost = exports.powershellSessionV1ComputerMachineIdShellPowershellSessionPost = exports.powershellExecV1ComputerMachineIdShellPowershellExecPost = exports.fsWriteV1ComputerMachineIdFsWritePost = exports.fsReadV1ComputerMachineIdFsReadGet = void 0;
|
|
6
6
|
const client_gen_1 = require("./client.gen");
|
|
7
7
|
/**
|
|
8
8
|
* Health Check
|
|
@@ -294,6 +294,27 @@ const updateRunV1RunsRunIdPatch = (options) => {
|
|
|
294
294
|
], url: '/v1/runs/{run_id}' }, options), { headers: Object.assign({ 'Content-Type': 'application/json' }, options === null || options === void 0 ? void 0 : options.headers) }));
|
|
295
295
|
};
|
|
296
296
|
exports.updateRunV1RunsRunIdPatch = updateRunV1RunsRunIdPatch;
|
|
297
|
+
/**
|
|
298
|
+
* Bulk Create Runs
|
|
299
|
+
* Create multiple runs with the same configuration.
|
|
300
|
+
*
|
|
301
|
+
* This endpoint creates multiple runs efficiently:
|
|
302
|
+
* - All runs are created in a single database transaction
|
|
303
|
+
* - Temporal workflows are started asynchronously
|
|
304
|
+
* - Returns immediately with created run details
|
|
305
|
+
*
|
|
306
|
+
* Maximum 1000 runs can be created in a single request.
|
|
307
|
+
*/
|
|
308
|
+
const bulkCreateRunsV1RunsBulkPost = (options) => {
|
|
309
|
+
var _a;
|
|
310
|
+
return ((_a = options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).post(Object.assign(Object.assign({ security: [
|
|
311
|
+
{
|
|
312
|
+
scheme: 'bearer',
|
|
313
|
+
type: 'http'
|
|
314
|
+
}
|
|
315
|
+
], url: '/v1/runs/bulk' }, options), { headers: Object.assign({ 'Content-Type': 'application/json' }, options === null || options === void 0 ? void 0 : options.headers) }));
|
|
316
|
+
};
|
|
317
|
+
exports.bulkCreateRunsV1RunsBulkPost = bulkCreateRunsV1RunsBulkPost;
|
|
297
318
|
/**
|
|
298
319
|
* List Run Attachments
|
|
299
320
|
* List all run attachments for the authenticated user.
|
|
@@ -292,6 +292,38 @@ export type RunAttachmentResponse = {
|
|
|
292
292
|
export type RunAttachmentUpdate = {
|
|
293
293
|
expires_at?: string | null;
|
|
294
294
|
};
|
|
295
|
+
/**
|
|
296
|
+
* Schema for bulk creating runs
|
|
297
|
+
*/
|
|
298
|
+
export type RunBulkCreate = {
|
|
299
|
+
workflow_id: string;
|
|
300
|
+
/**
|
|
301
|
+
* Machine ID. If not provided, an available machine will be automatically selected.
|
|
302
|
+
*/
|
|
303
|
+
machine_id?: string | null;
|
|
304
|
+
/**
|
|
305
|
+
* Input values for workflow variables
|
|
306
|
+
*/
|
|
307
|
+
input_values?: {
|
|
308
|
+
[key: string]: unknown;
|
|
309
|
+
} | null;
|
|
310
|
+
/**
|
|
311
|
+
* Files to upload to the machine
|
|
312
|
+
*/
|
|
313
|
+
file_inputs?: Array<FileInput> | null;
|
|
314
|
+
/**
|
|
315
|
+
* Number of runs to create (max 1000)
|
|
316
|
+
*/
|
|
317
|
+
count: number;
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Response for bulk run creation
|
|
321
|
+
*/
|
|
322
|
+
export type RunBulkCreateResponse = {
|
|
323
|
+
created_runs: Array<RunResponse>;
|
|
324
|
+
failed_count?: number;
|
|
325
|
+
errors?: Array<string>;
|
|
326
|
+
};
|
|
295
327
|
/**
|
|
296
328
|
* Schema for creating a run
|
|
297
329
|
*/
|
|
@@ -862,6 +894,26 @@ export type UpdateRunV1RunsRunIdPatchResponses = {
|
|
|
862
894
|
200: RunResponse;
|
|
863
895
|
};
|
|
864
896
|
export type UpdateRunV1RunsRunIdPatchResponse = UpdateRunV1RunsRunIdPatchResponses[keyof UpdateRunV1RunsRunIdPatchResponses];
|
|
897
|
+
export type BulkCreateRunsV1RunsBulkPostData = {
|
|
898
|
+
body: RunBulkCreate;
|
|
899
|
+
path?: never;
|
|
900
|
+
query?: never;
|
|
901
|
+
url: '/v1/runs/bulk';
|
|
902
|
+
};
|
|
903
|
+
export type BulkCreateRunsV1RunsBulkPostErrors = {
|
|
904
|
+
/**
|
|
905
|
+
* Validation Error
|
|
906
|
+
*/
|
|
907
|
+
422: HttpValidationError;
|
|
908
|
+
};
|
|
909
|
+
export type BulkCreateRunsV1RunsBulkPostError = BulkCreateRunsV1RunsBulkPostErrors[keyof BulkCreateRunsV1RunsBulkPostErrors];
|
|
910
|
+
export type BulkCreateRunsV1RunsBulkPostResponses = {
|
|
911
|
+
/**
|
|
912
|
+
* Successful Response
|
|
913
|
+
*/
|
|
914
|
+
201: RunBulkCreateResponse;
|
|
915
|
+
};
|
|
916
|
+
export type BulkCreateRunsV1RunsBulkPostResponse = BulkCreateRunsV1RunsBulkPostResponses[keyof BulkCreateRunsV1RunsBulkPostResponses];
|
|
865
917
|
export type ListRunAttachmentsV1RunAttachmentsGetData = {
|
|
866
918
|
body?: never;
|
|
867
919
|
path?: never;
|
|
@@ -1705,5 +1757,5 @@ export type RootGetResponses = {
|
|
|
1705
1757
|
200: unknown;
|
|
1706
1758
|
};
|
|
1707
1759
|
export type ClientOptions = {
|
|
1708
|
-
baseUrl: 'https://api.cyberdesk.io' | (string & {});
|
|
1760
|
+
baseUrl: 'https://api.cyberdesk.io' | 'https://cyberdesk-api-dev.fly.dev' | (string & {});
|
|
1709
1761
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* });
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
import { type MachineResponse, type WorkflowResponse, type RunResponse, type ConnectionResponse, type TrajectoryResponse, type PaginatedResponseMachineResponse, type PaginatedResponseWorkflowResponse, type PaginatedResponseRunResponse, type PaginatedResponseConnectionResponse, type PaginatedResponseTrajectoryResponse, type MachineStatus, type RunStatus, type ConnectionStatus, type MachineCreate, type WorkflowCreate, type RunCreate, type FileInput, type ConnectionCreate, type TrajectoryCreate, type MachineUpdate, type WorkflowUpdate, type RunUpdate, type TrajectoryUpdate, type RunAttachmentCreate, type RunAttachmentUpdate, type RunAttachmentResponse, type RunAttachmentDownloadUrlResponse, type AttachmentType, type PaginatedResponseRunAttachmentResponse } from './client/types.gen';
|
|
28
|
+
import { type MachineResponse, type WorkflowResponse, type RunResponse, type ConnectionResponse, type TrajectoryResponse, type PaginatedResponseMachineResponse, type PaginatedResponseWorkflowResponse, type PaginatedResponseRunResponse, type PaginatedResponseConnectionResponse, type PaginatedResponseTrajectoryResponse, type MachineStatus, type RunStatus, type ConnectionStatus, type MachineCreate, type WorkflowCreate, type RunCreate, type RunBulkCreate, type RunBulkCreateResponse, type FileInput, type ConnectionCreate, type TrajectoryCreate, type MachineUpdate, type WorkflowUpdate, type RunUpdate, type TrajectoryUpdate, type RunAttachmentCreate, type RunAttachmentUpdate, type RunAttachmentResponse, type RunAttachmentDownloadUrlResponse, type AttachmentType, type PaginatedResponseRunAttachmentResponse } from './client/types.gen';
|
|
29
29
|
export * from './client/types.gen';
|
|
30
30
|
export * from './client/sdk.gen';
|
|
31
31
|
export * from './client/client.gen';
|
|
@@ -230,6 +230,46 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
230
230
|
data?: RunResponse;
|
|
231
231
|
error?: any;
|
|
232
232
|
}>;
|
|
233
|
+
/**
|
|
234
|
+
* Create multiple runs with the same configuration
|
|
235
|
+
*
|
|
236
|
+
* This method efficiently creates multiple runs in bulk:
|
|
237
|
+
* - All runs are created in a single database transaction
|
|
238
|
+
* - Temporal workflows are started asynchronously
|
|
239
|
+
* - Returns immediately with created run details
|
|
240
|
+
*
|
|
241
|
+
* @param data - Bulk run configuration
|
|
242
|
+
* @param data.count - Number of runs to create (1-1000)
|
|
243
|
+
* @param data.workflow_id - The workflow to run
|
|
244
|
+
* @param data.machine_id - Optional machine ID (auto-selected if not provided)
|
|
245
|
+
* @param data.input_values - Optional input values for workflow variables
|
|
246
|
+
* @param data.file_inputs - Optional files to upload to the machine
|
|
247
|
+
* @returns Details about created runs and any failures
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```typescript
|
|
251
|
+
* const result = await client.runs.bulkCreate({
|
|
252
|
+
* count: 100,
|
|
253
|
+
* workflow_id: 'workflow-id',
|
|
254
|
+
* input_values: { prompt: 'Bulk task' },
|
|
255
|
+
* file_inputs: [{
|
|
256
|
+
* filename: 'data.txt',
|
|
257
|
+
* content: 'base64-encoded-content',
|
|
258
|
+
* target_path: '~/CyberdeskTransfers/',
|
|
259
|
+
* cleanup_imports_after_run: true
|
|
260
|
+
* }]
|
|
261
|
+
* });
|
|
262
|
+
*
|
|
263
|
+
* if (result.data) {
|
|
264
|
+
* console.log(`Created ${result.data.created_runs.length} runs`);
|
|
265
|
+
* console.log(`Failed: ${result.data.failed_count}`);
|
|
266
|
+
* }
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
bulkCreate: (data: RunBulkCreate) => Promise<{
|
|
270
|
+
data?: RunBulkCreateResponse;
|
|
271
|
+
error?: any;
|
|
272
|
+
}>;
|
|
233
273
|
/**
|
|
234
274
|
* Get a specific run by ID
|
|
235
275
|
*
|
|
@@ -494,4 +534,4 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string):
|
|
|
494
534
|
}>;
|
|
495
535
|
};
|
|
496
536
|
};
|
|
497
|
-
export type { MachineResponse, WorkflowResponse, RunResponse, ConnectionResponse, TrajectoryResponse, RunAttachmentResponse, RunAttachmentDownloadUrlResponse, FileInput, AttachmentType, PaginatedResponseMachineResponse, PaginatedResponseWorkflowResponse, PaginatedResponseRunResponse, PaginatedResponseConnectionResponse, PaginatedResponseTrajectoryResponse, PaginatedResponseRunAttachmentResponse, };
|
|
537
|
+
export type { MachineResponse, WorkflowResponse, RunResponse, RunBulkCreate, RunBulkCreateResponse, ConnectionResponse, TrajectoryResponse, RunAttachmentResponse, RunAttachmentDownloadUrlResponse, FileInput, AttachmentType, PaginatedResponseMachineResponse, PaginatedResponseWorkflowResponse, PaginatedResponseRunResponse, PaginatedResponseConnectionResponse, PaginatedResponseTrajectoryResponse, PaginatedResponseRunAttachmentResponse, };
|
package/dist/index.js
CHANGED
|
@@ -286,6 +286,48 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
286
286
|
body: data,
|
|
287
287
|
});
|
|
288
288
|
}),
|
|
289
|
+
/**
|
|
290
|
+
* Create multiple runs with the same configuration
|
|
291
|
+
*
|
|
292
|
+
* This method efficiently creates multiple runs in bulk:
|
|
293
|
+
* - All runs are created in a single database transaction
|
|
294
|
+
* - Temporal workflows are started asynchronously
|
|
295
|
+
* - Returns immediately with created run details
|
|
296
|
+
*
|
|
297
|
+
* @param data - Bulk run configuration
|
|
298
|
+
* @param data.count - Number of runs to create (1-1000)
|
|
299
|
+
* @param data.workflow_id - The workflow to run
|
|
300
|
+
* @param data.machine_id - Optional machine ID (auto-selected if not provided)
|
|
301
|
+
* @param data.input_values - Optional input values for workflow variables
|
|
302
|
+
* @param data.file_inputs - Optional files to upload to the machine
|
|
303
|
+
* @returns Details about created runs and any failures
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* ```typescript
|
|
307
|
+
* const result = await client.runs.bulkCreate({
|
|
308
|
+
* count: 100,
|
|
309
|
+
* workflow_id: 'workflow-id',
|
|
310
|
+
* input_values: { prompt: 'Bulk task' },
|
|
311
|
+
* file_inputs: [{
|
|
312
|
+
* filename: 'data.txt',
|
|
313
|
+
* content: 'base64-encoded-content',
|
|
314
|
+
* target_path: '~/CyberdeskTransfers/',
|
|
315
|
+
* cleanup_imports_after_run: true
|
|
316
|
+
* }]
|
|
317
|
+
* });
|
|
318
|
+
*
|
|
319
|
+
* if (result.data) {
|
|
320
|
+
* console.log(`Created ${result.data.created_runs.length} runs`);
|
|
321
|
+
* console.log(`Failed: ${result.data.failed_count}`);
|
|
322
|
+
* }
|
|
323
|
+
* ```
|
|
324
|
+
*/
|
|
325
|
+
bulkCreate: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
326
|
+
return (0, sdk_gen_1.bulkCreateRunsV1RunsBulkPost)({
|
|
327
|
+
client,
|
|
328
|
+
body: data,
|
|
329
|
+
});
|
|
330
|
+
}),
|
|
289
331
|
/**
|
|
290
332
|
* Get a specific run by ID
|
|
291
333
|
*
|