cyberdesk 1.11.0 → 2.1.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 +83 -37
- package/dist/client/sdk.gen.js +165 -38
- package/dist/client/types.gen.d.ts +292 -5
- package/dist/index.d.ts +144 -2
- package/dist/index.js +151 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -161,6 +161,153 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
161
161
|
path: { machine_id: machineId },
|
|
162
162
|
});
|
|
163
163
|
}),
|
|
164
|
+
/**
|
|
165
|
+
* Get all pools that a machine belongs to
|
|
166
|
+
*
|
|
167
|
+
* @param machineId - The ID of the machine
|
|
168
|
+
* @returns List of pools the machine belongs to
|
|
169
|
+
*/
|
|
170
|
+
getPools: (machineId) => __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
return (0, sdk_gen_1.getMachinePoolsV1MachinesMachineIdPoolsGet)({
|
|
172
|
+
client,
|
|
173
|
+
path: { machine_id: machineId },
|
|
174
|
+
});
|
|
175
|
+
}),
|
|
176
|
+
/**
|
|
177
|
+
* Update a machine's pool assignments
|
|
178
|
+
*
|
|
179
|
+
* This replaces all existing pool assignments with the new ones.
|
|
180
|
+
*
|
|
181
|
+
* @param machineId - The ID of the machine
|
|
182
|
+
* @param data - MachinePoolUpdate with pool_ids list
|
|
183
|
+
* @returns Updated machine details
|
|
184
|
+
*/
|
|
185
|
+
updatePools: (machineId, data) => __awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
return (0, sdk_gen_1.updateMachinePoolsV1MachinesMachineIdPoolsPut)({
|
|
187
|
+
client,
|
|
188
|
+
path: { machine_id: machineId },
|
|
189
|
+
body: data,
|
|
190
|
+
});
|
|
191
|
+
}),
|
|
192
|
+
},
|
|
193
|
+
// Pool endpoints
|
|
194
|
+
pools: {
|
|
195
|
+
/**
|
|
196
|
+
* List pools for the organization
|
|
197
|
+
*
|
|
198
|
+
* @param params - Optional query parameters
|
|
199
|
+
* @param params.skip - Number of items to skip (for pagination)
|
|
200
|
+
* @param params.limit - Maximum number of items to return
|
|
201
|
+
* @returns Paginated list of pools
|
|
202
|
+
*/
|
|
203
|
+
list: (params) => __awaiter(this, void 0, void 0, function* () {
|
|
204
|
+
return (0, sdk_gen_1.listPoolsV1PoolsGet)({
|
|
205
|
+
client,
|
|
206
|
+
query: params,
|
|
207
|
+
});
|
|
208
|
+
}),
|
|
209
|
+
/**
|
|
210
|
+
* Create a new pool
|
|
211
|
+
*
|
|
212
|
+
* @param data - Pool configuration
|
|
213
|
+
* @returns Created pool details
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* const pool = await client.pools.create({
|
|
218
|
+
* name: 'Customer A',
|
|
219
|
+
* description: 'All Customer A machines'
|
|
220
|
+
* });
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
create: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
return (0, sdk_gen_1.createPoolV1PoolsPost)({
|
|
225
|
+
client,
|
|
226
|
+
body: data,
|
|
227
|
+
});
|
|
228
|
+
}),
|
|
229
|
+
/**
|
|
230
|
+
* Get a specific pool by ID
|
|
231
|
+
*
|
|
232
|
+
* @param poolId - The ID of the pool
|
|
233
|
+
* @param includeMachines - Whether to include full machine details
|
|
234
|
+
* @returns Pool details, optionally with machine list
|
|
235
|
+
*/
|
|
236
|
+
get: (poolId, includeMachines) => __awaiter(this, void 0, void 0, function* () {
|
|
237
|
+
return (0, sdk_gen_1.getPoolV1PoolsPoolIdGet)({
|
|
238
|
+
client,
|
|
239
|
+
path: { pool_id: poolId },
|
|
240
|
+
query: includeMachines ? { include_machines: includeMachines } : undefined,
|
|
241
|
+
});
|
|
242
|
+
}),
|
|
243
|
+
/**
|
|
244
|
+
* Update a pool's details
|
|
245
|
+
*
|
|
246
|
+
* @param poolId - The ID of the pool to update
|
|
247
|
+
* @param data - Update data (name, description)
|
|
248
|
+
* @returns Updated pool details
|
|
249
|
+
*/
|
|
250
|
+
update: (poolId, data) => __awaiter(this, void 0, void 0, function* () {
|
|
251
|
+
return (0, sdk_gen_1.updatePoolV1PoolsPoolIdPatch)({
|
|
252
|
+
client,
|
|
253
|
+
path: { pool_id: poolId },
|
|
254
|
+
body: data,
|
|
255
|
+
});
|
|
256
|
+
}),
|
|
257
|
+
/**
|
|
258
|
+
* Delete a pool
|
|
259
|
+
*
|
|
260
|
+
* This will not delete the machines in the pool.
|
|
261
|
+
*
|
|
262
|
+
* @param poolId - The ID of the pool to delete
|
|
263
|
+
*/
|
|
264
|
+
delete: (poolId) => __awaiter(this, void 0, void 0, function* () {
|
|
265
|
+
return (0, sdk_gen_1.deletePoolV1PoolsPoolIdDelete)({
|
|
266
|
+
client,
|
|
267
|
+
path: { pool_id: poolId },
|
|
268
|
+
});
|
|
269
|
+
}),
|
|
270
|
+
/**
|
|
271
|
+
* Add machines to a pool
|
|
272
|
+
*
|
|
273
|
+
* @param poolId - The ID of the pool
|
|
274
|
+
* @param data - MachinePoolAssignment with machine_ids list
|
|
275
|
+
* @returns Pool with updated machine list
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```typescript
|
|
279
|
+
* await client.pools.addMachines('pool-id', {
|
|
280
|
+
* machine_ids: ['machine1-id', 'machine2-id']
|
|
281
|
+
* });
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
addMachines: (poolId, data) => __awaiter(this, void 0, void 0, function* () {
|
|
285
|
+
return (0, sdk_gen_1.addMachinesToPoolV1PoolsPoolIdMachinesPost)({
|
|
286
|
+
client,
|
|
287
|
+
path: { pool_id: poolId },
|
|
288
|
+
body: data,
|
|
289
|
+
});
|
|
290
|
+
}),
|
|
291
|
+
/**
|
|
292
|
+
* Remove machines from a pool
|
|
293
|
+
*
|
|
294
|
+
* @param poolId - The ID of the pool
|
|
295
|
+
* @param data - MachinePoolAssignment with machine_ids list
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```typescript
|
|
299
|
+
* await client.pools.removeMachines('pool-id', {
|
|
300
|
+
* machine_ids: ['machine1-id']
|
|
301
|
+
* });
|
|
302
|
+
* ```
|
|
303
|
+
*/
|
|
304
|
+
removeMachines: (poolId, data) => __awaiter(this, void 0, void 0, function* () {
|
|
305
|
+
return (0, sdk_gen_1.removeMachinesFromPoolV1PoolsPoolIdMachinesDelete)({
|
|
306
|
+
client,
|
|
307
|
+
path: { pool_id: poolId },
|
|
308
|
+
body: data,
|
|
309
|
+
});
|
|
310
|
+
}),
|
|
164
311
|
},
|
|
165
312
|
// Workflow endpoints
|
|
166
313
|
workflows: {
|
|
@@ -262,6 +409,7 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
262
409
|
* @param data - Run configuration
|
|
263
410
|
* @param data.workflow_id - The workflow to run
|
|
264
411
|
* @param data.machine_id - Optional machine ID (auto-selected if not provided)
|
|
412
|
+
* @param data.pool_ids - Optional list of pool IDs (machine must be in ALL specified pools)
|
|
265
413
|
* @param data.input_values - Optional input values for workflow variables
|
|
266
414
|
* @param data.file_inputs - Optional files to upload to the machine
|
|
267
415
|
* @returns Created run details
|
|
@@ -270,6 +418,7 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
270
418
|
* ```typescript
|
|
271
419
|
* const run = await client.runs.create({
|
|
272
420
|
* workflow_id: 'workflow-id',
|
|
421
|
+
* pool_ids: ['pool1-id', 'pool2-id'], // Machine must be in both pools
|
|
273
422
|
* input_values: { prompt: 'Hello' },
|
|
274
423
|
* file_inputs: [{
|
|
275
424
|
* filename: 'data.txt',
|
|
@@ -298,6 +447,7 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
298
447
|
* @param data.count - Number of runs to create (1-1000)
|
|
299
448
|
* @param data.workflow_id - The workflow to run
|
|
300
449
|
* @param data.machine_id - Optional machine ID (auto-selected if not provided)
|
|
450
|
+
* @param data.pool_ids - Optional list of pool IDs (machine must be in ALL specified pools)
|
|
301
451
|
* @param data.input_values - Optional input values for workflow variables
|
|
302
452
|
* @param data.file_inputs - Optional files to upload to the machine
|
|
303
453
|
* @returns Details about created runs and any failures
|
|
@@ -307,6 +457,7 @@ function createCyberdeskClient(apiKey, baseUrl) {
|
|
|
307
457
|
* const result = await client.runs.bulkCreate({
|
|
308
458
|
* count: 100,
|
|
309
459
|
* workflow_id: 'workflow-id',
|
|
460
|
+
* pool_ids: ['pool1-id'], // All runs require machines in this pool
|
|
310
461
|
* input_values: { prompt: 'Bulk task' },
|
|
311
462
|
* file_inputs: [{
|
|
312
463
|
* filename: 'data.txt',
|