cyberdesk 2.2.12 → 2.2.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/client/sdk.gen.d.ts +13 -1
- package/dist/client/sdk.gen.js +22 -1
- package/dist/client/types.gen.d.ts +52 -0
- package/dist/index.d.ts +55 -2
- package/dist/index.js +50 -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, GetMachinePoolsV1MachinesMachineIdPoolsGetData, UpdateMachinePoolsV1MachinesMachineIdPoolsPutData, ListPoolsV1PoolsGetData, CreatePoolV1PoolsPostData, DeletePoolV1PoolsPoolIdDeleteData, GetPoolV1PoolsPoolIdGetData, UpdatePoolV1PoolsPoolIdPatchData, RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteData, AddMachinesToPoolV1PoolsPoolIdMachinesPostData, ListWorkflowsV1WorkflowsGetData, CreateWorkflowV1WorkflowsPostData, DeleteWorkflowV1WorkflowsWorkflowIdDeleteData, GetWorkflowV1WorkflowsWorkflowIdGetData, UpdateWorkflowV1WorkflowsWorkflowIdPatchData, GetWorkflowVersionsV1WorkflowsWorkflowIdVersionsGetData, ListModelConfigurationsV1ModelConfigurationsGetData, CreateModelConfigurationV1ModelConfigurationsPostData, DeleteModelConfigurationV1ModelConfigurationsModelConfigurationIdDeleteData, GetModelConfigurationV1ModelConfigurationsModelConfigurationIdGetData, UpdateModelConfigurationV1ModelConfigurationsModelConfigurationIdPatchData, ListRunsV1RunsGetData, CreateRunV1RunsPostData, DeleteRunV1RunsRunIdDeleteData, GetRunV1RunsRunIdGetData, UpdateRunV1RunsRunIdPatchData, CreateRunChainV1RunsChainPostData, BulkCreateRunsV1RunsBulkPostData, RetryRunV1RunsRunIdRetryPostData, 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, CopyToClipboardV1ComputerMachineIdCopyToClipboardPostData, GetMousePositionV1ComputerMachineIdInputMousePositionGetData, MouseMoveV1ComputerMachineIdInputMouseMovePostData, MouseClickV1ComputerMachineIdInputMouseClickPostData, MouseScrollV1ComputerMachineIdInputMouseScrollPostData, MouseDragV1ComputerMachineIdInputMouseDragPostData, FsListV1ComputerMachineIdFsListGetData, FsReadV1ComputerMachineIdFsReadGetData, FsWriteV1ComputerMachineIdFsWritePostData, PowershellExecV1ComputerMachineIdShellPowershellExecPostData, PowershellSessionV1ComputerMachineIdShellPowershellSessionPostData, DbPingInternalDebugDbPingGetData, RootGetData, HealthLiveHealthLiveGetData, HealthReadyHealthReadyGetData, HealthHealthGetData, HealthDbHealthDbGetData } from './types.gen';
|
|
2
|
+
import type { HealthCheckV1HealthGetData, DatabaseHealthCheckV1HealthDbGetData, ListMachinesV1MachinesGetData, CreateMachineV1MachinesPostData, DeleteMachineV1MachinesMachineIdDeleteData, GetMachineV1MachinesMachineIdGetData, UpdateMachineV1MachinesMachineIdPatchData, GetMachinePoolsV1MachinesMachineIdPoolsGetData, UpdateMachinePoolsV1MachinesMachineIdPoolsPutData, ListPoolsV1PoolsGetData, CreatePoolV1PoolsPostData, DeletePoolV1PoolsPoolIdDeleteData, GetPoolV1PoolsPoolIdGetData, UpdatePoolV1PoolsPoolIdPatchData, RemoveMachinesFromPoolV1PoolsPoolIdMachinesDeleteData, AddMachinesToPoolV1PoolsPoolIdMachinesPostData, ListWorkflowsV1WorkflowsGetData, CreateWorkflowV1WorkflowsPostData, DeleteWorkflowV1WorkflowsWorkflowIdDeleteData, GetWorkflowV1WorkflowsWorkflowIdGetData, UpdateWorkflowV1WorkflowsWorkflowIdPatchData, GetWorkflowVersionsV1WorkflowsWorkflowIdVersionsGetData, ListModelConfigurationsV1ModelConfigurationsGetData, CreateModelConfigurationV1ModelConfigurationsPostData, DeleteModelConfigurationV1ModelConfigurationsModelConfigurationIdDeleteData, GetModelConfigurationV1ModelConfigurationsModelConfigurationIdGetData, UpdateModelConfigurationV1ModelConfigurationsModelConfigurationIdPatchData, ListRunsV1RunsGetData, CreateRunV1RunsPostData, DeleteRunV1RunsRunIdDeleteData, GetRunV1RunsRunIdGetData, UpdateRunV1RunsRunIdPatchData, CreateRunChainV1RunsChainPostData, BulkCreateRunsV1RunsBulkPostData, RetryRunV1RunsRunIdRetryPostData, 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, CopyToClipboardV1ComputerMachineIdCopyToClipboardPostData, GetMousePositionV1ComputerMachineIdInputMousePositionGetData, MouseMoveV1ComputerMachineIdInputMouseMovePostData, MouseClickV1ComputerMachineIdInputMouseClickPostData, MouseScrollV1ComputerMachineIdInputMouseScrollPostData, MouseDragV1ComputerMachineIdInputMouseDragPostData, FsListV1ComputerMachineIdFsListGetData, FsReadV1ComputerMachineIdFsReadGetData, FsWriteV1ComputerMachineIdFsWritePostData, PowershellExecV1ComputerMachineIdShellPowershellExecPostData, PowershellSessionV1ComputerMachineIdShellPowershellSessionPostData, GetUsageAggregateV1UsageAggregateGetData, DbPingInternalDebugDbPingGetData, RootGetData, HealthLiveHealthLiveGetData, HealthReadyHealthReadyGetData, HealthHealthGetData, HealthDbHealthDbGetData } 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
|
|
@@ -525,6 +525,18 @@ export declare const powershellExecV1ComputerMachineIdShellPowershellExecPost: <
|
|
|
525
525
|
export declare const powershellSessionV1ComputerMachineIdShellPowershellSessionPost: <ThrowOnError extends boolean = false>(options: Options<PowershellSessionV1ComputerMachineIdShellPowershellSessionPostData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
526
526
|
[key: string]: unknown;
|
|
527
527
|
}, import("./types.gen").HttpValidationError, ThrowOnError>;
|
|
528
|
+
/**
|
|
529
|
+
* Get Usage Aggregate
|
|
530
|
+
* Aggregate usage (agentic and cached steps) for a given date range.
|
|
531
|
+
*
|
|
532
|
+
* Two modes are supported:
|
|
533
|
+
* - **simulated** (default): Uses total_agentic_steps and total_cached_steps from usage_metadata,
|
|
534
|
+
* but excludes runs where billing_outcome is 'infra_failure' (these would have been free).
|
|
535
|
+
* Use this for customers not yet on Stripe billing.
|
|
536
|
+
* - **billed**: Uses total_agentic_steps_billed and total_cached_steps_billed.
|
|
537
|
+
* Use this for customers on active Stripe billing.
|
|
538
|
+
*/
|
|
539
|
+
export declare const getUsageAggregateV1UsageAggregateGet: <ThrowOnError extends boolean = false>(options: Options<GetUsageAggregateV1UsageAggregateGetData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").UsageAggregateResponse, import("./types.gen").HttpValidationError, ThrowOnError>;
|
|
528
540
|
/**
|
|
529
541
|
* Db Ping
|
|
530
542
|
* Execute a lightweight `SELECT 1` to validate DB connectivity and expose pool stats.
|
package/dist/client/sdk.gen.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
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.retryRunV1RunsRunIdRetryPost = exports.bulkCreateRunsV1RunsBulkPost = exports.createRunChainV1RunsChainPost = exports.updateRunV1RunsRunIdPatch = exports.getRunV1RunsRunIdGet = exports.deleteRunV1RunsRunIdDelete = exports.createRunV1RunsPost = exports.listRunsV1RunsGet = exports.updateModelConfigurationV1ModelConfigurationsModelConfigurationIdPatch = exports.getModelConfigurationV1ModelConfigurationsModelConfigurationIdGet = exports.deleteModelConfigurationV1ModelConfigurationsModelConfigurationIdDelete = exports.createModelConfigurationV1ModelConfigurationsPost = exports.listModelConfigurationsV1ModelConfigurationsGet = exports.getWorkflowVersionsV1WorkflowsWorkflowIdVersionsGet = exports.updateWorkflowV1WorkflowsWorkflowIdPatch = exports.getWorkflowV1WorkflowsWorkflowIdGet = exports.deleteWorkflowV1WorkflowsWorkflowIdDelete = exports.createWorkflowV1WorkflowsPost = exports.listWorkflowsV1WorkflowsGet = exports.addMachinesToPoolV1PoolsPoolIdMachinesPost = exports.removeMachinesFromPoolV1PoolsPoolIdMachinesDelete = exports.updatePoolV1PoolsPoolIdPatch = exports.getPoolV1PoolsPoolIdGet = exports.deletePoolV1PoolsPoolIdDelete = exports.createPoolV1PoolsPost = exports.listPoolsV1PoolsGet = exports.updateMachinePoolsV1MachinesMachineIdPoolsPut = exports.getMachinePoolsV1MachinesMachineIdPoolsGet = exports.updateMachineV1MachinesMachineIdPatch = exports.getMachineV1MachinesMachineIdGet = exports.deleteMachineV1MachinesMachineIdDelete = exports.createMachineV1MachinesPost = exports.listMachinesV1MachinesGet = exports.databaseHealthCheckV1HealthDbGet = exports.healthCheckV1HealthGet = void 0;
|
|
5
|
-
exports.healthDbHealthDbGet = exports.healthHealthGet = exports.healthReadyHealthReadyGet = exports.healthLiveHealthLiveGet = exports.rootGet = exports.dbPingInternalDebugDbPingGet = exports.powershellSessionV1ComputerMachineIdShellPowershellSessionPost = exports.powershellExecV1ComputerMachineIdShellPowershellExecPost = exports.fsWriteV1ComputerMachineIdFsWritePost = exports.fsReadV1ComputerMachineIdFsReadGet = exports.fsListV1ComputerMachineIdFsListGet = exports.mouseDragV1ComputerMachineIdInputMouseDragPost = exports.mouseScrollV1ComputerMachineIdInputMouseScrollPost = exports.mouseClickV1ComputerMachineIdInputMouseClickPost = exports.mouseMoveV1ComputerMachineIdInputMouseMovePost = exports.getMousePositionV1ComputerMachineIdInputMousePositionGet = exports.copyToClipboardV1ComputerMachineIdCopyToClipboardPost = exports.keyboardKeyV1ComputerMachineIdInputKeyboardKeyPost = exports.keyboardTypeV1ComputerMachineIdInputKeyboardTypePost = exports.getDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGet = exports.getScreenshotV1ComputerMachineIdDisplayScreenshotGet = exports.getLatestTrajectoryForWorkflowV1WorkflowsWorkflowIdLatestTrajectoryGet = exports.updateTrajectoryV1TrajectoriesTrajectoryIdPatch = exports.getTrajectoryV1TrajectoriesTrajectoryIdGet = exports.deleteTrajectoryV1TrajectoriesTrajectoryIdDelete = exports.createTrajectoryV1TrajectoriesPost = exports.listTrajectoriesV1TrajectoriesGet = exports.updateRequestLogV1RequestLogsLogIdPatch = exports.getRequestLogV1RequestLogsLogIdGet = void 0;
|
|
5
|
+
exports.healthDbHealthDbGet = exports.healthHealthGet = exports.healthReadyHealthReadyGet = exports.healthLiveHealthLiveGet = exports.rootGet = exports.dbPingInternalDebugDbPingGet = exports.getUsageAggregateV1UsageAggregateGet = exports.powershellSessionV1ComputerMachineIdShellPowershellSessionPost = exports.powershellExecV1ComputerMachineIdShellPowershellExecPost = exports.fsWriteV1ComputerMachineIdFsWritePost = exports.fsReadV1ComputerMachineIdFsReadGet = exports.fsListV1ComputerMachineIdFsListGet = exports.mouseDragV1ComputerMachineIdInputMouseDragPost = exports.mouseScrollV1ComputerMachineIdInputMouseScrollPost = exports.mouseClickV1ComputerMachineIdInputMouseClickPost = exports.mouseMoveV1ComputerMachineIdInputMouseMovePost = exports.getMousePositionV1ComputerMachineIdInputMousePositionGet = exports.copyToClipboardV1ComputerMachineIdCopyToClipboardPost = exports.keyboardKeyV1ComputerMachineIdInputKeyboardKeyPost = exports.keyboardTypeV1ComputerMachineIdInputKeyboardTypePost = exports.getDisplayDimensionsV1ComputerMachineIdDisplayDimensionsGet = exports.getScreenshotV1ComputerMachineIdDisplayScreenshotGet = exports.getLatestTrajectoryForWorkflowV1WorkflowsWorkflowIdLatestTrajectoryGet = exports.updateTrajectoryV1TrajectoriesTrajectoryIdPatch = exports.getTrajectoryV1TrajectoriesTrajectoryIdGet = exports.deleteTrajectoryV1TrajectoriesTrajectoryIdDelete = exports.createTrajectoryV1TrajectoriesPost = exports.listTrajectoriesV1TrajectoriesGet = exports.updateRequestLogV1RequestLogsLogIdPatch = exports.getRequestLogV1RequestLogsLogIdGet = void 0;
|
|
6
6
|
const client_gen_1 = require("./client.gen");
|
|
7
7
|
/**
|
|
8
8
|
* Health Check
|
|
@@ -1147,6 +1147,27 @@ const powershellSessionV1ComputerMachineIdShellPowershellSessionPost = (options)
|
|
|
1147
1147
|
], url: '/v1/computer/{machine_id}/shell/powershell/session' }, options), { headers: Object.assign({ 'Content-Type': 'application/json' }, options === null || options === void 0 ? void 0 : options.headers) }));
|
|
1148
1148
|
};
|
|
1149
1149
|
exports.powershellSessionV1ComputerMachineIdShellPowershellSessionPost = powershellSessionV1ComputerMachineIdShellPowershellSessionPost;
|
|
1150
|
+
/**
|
|
1151
|
+
* Get Usage Aggregate
|
|
1152
|
+
* Aggregate usage (agentic and cached steps) for a given date range.
|
|
1153
|
+
*
|
|
1154
|
+
* Two modes are supported:
|
|
1155
|
+
* - **simulated** (default): Uses total_agentic_steps and total_cached_steps from usage_metadata,
|
|
1156
|
+
* but excludes runs where billing_outcome is 'infra_failure' (these would have been free).
|
|
1157
|
+
* Use this for customers not yet on Stripe billing.
|
|
1158
|
+
* - **billed**: Uses total_agentic_steps_billed and total_cached_steps_billed.
|
|
1159
|
+
* Use this for customers on active Stripe billing.
|
|
1160
|
+
*/
|
|
1161
|
+
const getUsageAggregateV1UsageAggregateGet = (options) => {
|
|
1162
|
+
var _a;
|
|
1163
|
+
return ((_a = options.client) !== null && _a !== void 0 ? _a : client_gen_1.client).get(Object.assign({ security: [
|
|
1164
|
+
{
|
|
1165
|
+
scheme: 'bearer',
|
|
1166
|
+
type: 'http'
|
|
1167
|
+
}
|
|
1168
|
+
], url: '/v1/usage/aggregate' }, options));
|
|
1169
|
+
};
|
|
1170
|
+
exports.getUsageAggregateV1UsageAggregateGet = getUsageAggregateV1UsageAggregateGet;
|
|
1150
1171
|
/**
|
|
1151
1172
|
* Db Ping
|
|
1152
1173
|
* Execute a lightweight `SELECT 1` to validate DB connectivity and expose pool stats.
|
|
@@ -310,6 +310,10 @@ export type MouseClickRequest = {
|
|
|
310
310
|
* None = full click, True = mouse down, False = mouse up
|
|
311
311
|
*/
|
|
312
312
|
down?: boolean | null;
|
|
313
|
+
/**
|
|
314
|
+
* Number of clicks (1=single, 2=double, 3=triple)
|
|
315
|
+
*/
|
|
316
|
+
clicks?: number;
|
|
313
317
|
};
|
|
314
318
|
export type MouseDragRequest = {
|
|
315
319
|
to_x: number;
|
|
@@ -868,6 +872,21 @@ export type TrajectoryUpdate = {
|
|
|
868
872
|
*/
|
|
869
873
|
is_approved?: boolean | null;
|
|
870
874
|
};
|
|
875
|
+
/**
|
|
876
|
+
* Response schema for usage aggregation.
|
|
877
|
+
*/
|
|
878
|
+
export type UsageAggregateResponse = {
|
|
879
|
+
total_agentic_steps: number;
|
|
880
|
+
total_cached_steps: number;
|
|
881
|
+
period_start: string;
|
|
882
|
+
period_end: string;
|
|
883
|
+
mode: UsageMode;
|
|
884
|
+
runs_counted: number;
|
|
885
|
+
};
|
|
886
|
+
/**
|
|
887
|
+
* Mode for counting usage steps.
|
|
888
|
+
*/
|
|
889
|
+
export type UsageMode = 'simulated' | 'billed';
|
|
871
890
|
export type ValidationError = {
|
|
872
891
|
loc: Array<string | number>;
|
|
873
892
|
msg: string;
|
|
@@ -2960,6 +2979,39 @@ export type PowershellSessionV1ComputerMachineIdShellPowershellSessionPostRespon
|
|
|
2960
2979
|
};
|
|
2961
2980
|
};
|
|
2962
2981
|
export type PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponse = PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponses[keyof PowershellSessionV1ComputerMachineIdShellPowershellSessionPostResponses];
|
|
2982
|
+
export type GetUsageAggregateV1UsageAggregateGetData = {
|
|
2983
|
+
body?: never;
|
|
2984
|
+
path?: never;
|
|
2985
|
+
query: {
|
|
2986
|
+
/**
|
|
2987
|
+
* Start of period (inclusive, ISO format)
|
|
2988
|
+
*/
|
|
2989
|
+
from_date: string;
|
|
2990
|
+
/**
|
|
2991
|
+
* End of period (exclusive, ISO format)
|
|
2992
|
+
*/
|
|
2993
|
+
to_date: string;
|
|
2994
|
+
/**
|
|
2995
|
+
* Usage counting mode: 'simulated' or 'billed'
|
|
2996
|
+
*/
|
|
2997
|
+
mode?: UsageMode;
|
|
2998
|
+
};
|
|
2999
|
+
url: '/v1/usage/aggregate';
|
|
3000
|
+
};
|
|
3001
|
+
export type GetUsageAggregateV1UsageAggregateGetErrors = {
|
|
3002
|
+
/**
|
|
3003
|
+
* Validation Error
|
|
3004
|
+
*/
|
|
3005
|
+
422: HttpValidationError;
|
|
3006
|
+
};
|
|
3007
|
+
export type GetUsageAggregateV1UsageAggregateGetError = GetUsageAggregateV1UsageAggregateGetErrors[keyof GetUsageAggregateV1UsageAggregateGetErrors];
|
|
3008
|
+
export type GetUsageAggregateV1UsageAggregateGetResponses = {
|
|
3009
|
+
/**
|
|
3010
|
+
* Successful Response
|
|
3011
|
+
*/
|
|
3012
|
+
200: UsageAggregateResponse;
|
|
3013
|
+
};
|
|
3014
|
+
export type GetUsageAggregateV1UsageAggregateGetResponse = GetUsageAggregateV1UsageAggregateGetResponses[keyof GetUsageAggregateV1UsageAggregateGetResponses];
|
|
2963
3015
|
export type DbPingInternalDebugDbPingGetData = {
|
|
2964
3016
|
body?: never;
|
|
2965
3017
|
path?: never;
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* });
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
import { type MachineResponse, type MachinePoolUpdate, type PoolResponse, type PoolCreate, type PoolUpdate, type PoolWithMachines, type MachinePoolAssignment, type WorkflowResponse, type RunResponse, type ConnectionResponse, type TrajectoryResponse, type PaginatedResponseMachineResponse, type PaginatedResponsePoolResponse, 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 WorkflowChainCreate, type WorkflowChainResponse, 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, type RunRetry, type RunField, type ModelConfigurationCreate, type ModelConfigurationUpdate, type ModelConfigurationResponse } from './client/types.gen';
|
|
28
|
+
import { type MachineResponse, type MachinePoolUpdate, type PoolResponse, type PoolCreate, type PoolUpdate, type PoolWithMachines, type MachinePoolAssignment, type WorkflowResponse, type RunResponse, type ConnectionResponse, type TrajectoryResponse, type PaginatedResponseMachineResponse, type PaginatedResponsePoolResponse, 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 WorkflowChainCreate, type WorkflowChainResponse, 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, type RunRetry, type RunField, type ModelConfigurationCreate, type ModelConfigurationUpdate, type ModelConfigurationResponse, type UsageAggregateResponse, type UsageMode } 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';
|
|
@@ -1190,5 +1190,58 @@ export declare function createCyberdeskClient(apiKey: string, baseUrl?: string,
|
|
|
1190
1190
|
response: Response;
|
|
1191
1191
|
}>;
|
|
1192
1192
|
};
|
|
1193
|
+
usage: {
|
|
1194
|
+
/**
|
|
1195
|
+
* Aggregate usage (agentic and cached steps) for a given date range.
|
|
1196
|
+
*
|
|
1197
|
+
* Two modes are supported:
|
|
1198
|
+
* - **simulated** (default): Uses total_agentic_steps and total_cached_steps from usage_metadata,
|
|
1199
|
+
* but excludes runs where billing_outcome is 'infra_failure' (these would have been free).
|
|
1200
|
+
* Use this for customers not yet on Stripe billing.
|
|
1201
|
+
* - **billed**: Uses total_agentic_steps_billed and total_cached_steps_billed.
|
|
1202
|
+
* Use this for customers on active Stripe billing.
|
|
1203
|
+
*
|
|
1204
|
+
* @param params - Query parameters
|
|
1205
|
+
* @param params.from_date - Start of period (inclusive, ISO string or Date)
|
|
1206
|
+
* @param params.to_date - End of period (inclusive, ISO string or Date)
|
|
1207
|
+
* @param params.mode - Usage counting mode ('simulated' or 'billed'). Defaults to 'simulated'.
|
|
1208
|
+
* @returns UsageAggregateResponse containing:
|
|
1209
|
+
* - total_agentic_steps: Total agentic steps in the period
|
|
1210
|
+
* - total_cached_steps: Total cached steps in the period
|
|
1211
|
+
* - period_start: Start of the queried period
|
|
1212
|
+
* - period_end: End of the queried period
|
|
1213
|
+
* - mode: The mode used for counting
|
|
1214
|
+
* - runs_counted: Number of runs included in the aggregation
|
|
1215
|
+
*
|
|
1216
|
+
* @example
|
|
1217
|
+
* ```typescript
|
|
1218
|
+
* const { data } = await client.usage.aggregate({
|
|
1219
|
+
* from_date: '2024-01-01T00:00:00Z',
|
|
1220
|
+
* to_date: '2024-01-31T23:59:59Z',
|
|
1221
|
+
* mode: 'simulated'
|
|
1222
|
+
* });
|
|
1223
|
+
*
|
|
1224
|
+
* if (data) {
|
|
1225
|
+
* console.log(`Agentic steps: ${data.total_agentic_steps}`);
|
|
1226
|
+
* console.log(`Cached steps: ${data.total_cached_steps}`);
|
|
1227
|
+
* console.log(`Runs counted: ${data.runs_counted}`);
|
|
1228
|
+
* }
|
|
1229
|
+
* ```
|
|
1230
|
+
*/
|
|
1231
|
+
aggregate: (params: {
|
|
1232
|
+
from_date: string | Date;
|
|
1233
|
+
to_date: string | Date;
|
|
1234
|
+
mode?: UsageMode;
|
|
1235
|
+
}) => Promise<({
|
|
1236
|
+
data: undefined;
|
|
1237
|
+
error: import("./client/types.gen").HttpValidationError;
|
|
1238
|
+
} | {
|
|
1239
|
+
data: UsageAggregateResponse;
|
|
1240
|
+
error: undefined;
|
|
1241
|
+
}) & {
|
|
1242
|
+
request: Request;
|
|
1243
|
+
response: Response;
|
|
1244
|
+
}>;
|
|
1245
|
+
};
|
|
1193
1246
|
};
|
|
1194
|
-
export type { MachineResponse, MachinePoolUpdate, PoolResponse, PoolCreate, PoolUpdate, PoolWithMachines, MachinePoolAssignment, WorkflowResponse, RunResponse, RunBulkCreate, RunBulkCreateResponse, ConnectionResponse, TrajectoryResponse, RunAttachmentResponse, RunAttachmentDownloadUrlResponse, FileInput, AttachmentType, PaginatedResponseMachineResponse, PaginatedResponsePoolResponse, PaginatedResponseWorkflowResponse, PaginatedResponseRunResponse, PaginatedResponseConnectionResponse, PaginatedResponseTrajectoryResponse, PaginatedResponseRunAttachmentResponse, ModelConfigurationCreate, ModelConfigurationUpdate, ModelConfigurationResponse, };
|
|
1247
|
+
export type { MachineResponse, MachinePoolUpdate, PoolResponse, PoolCreate, PoolUpdate, PoolWithMachines, MachinePoolAssignment, WorkflowResponse, RunResponse, RunBulkCreate, RunBulkCreateResponse, ConnectionResponse, TrajectoryResponse, RunAttachmentResponse, RunAttachmentDownloadUrlResponse, FileInput, AttachmentType, PaginatedResponseMachineResponse, PaginatedResponsePoolResponse, PaginatedResponseWorkflowResponse, PaginatedResponseRunResponse, PaginatedResponseConnectionResponse, PaginatedResponseTrajectoryResponse, PaginatedResponseRunAttachmentResponse, ModelConfigurationCreate, ModelConfigurationUpdate, ModelConfigurationResponse, UsageAggregateResponse, UsageMode, };
|
package/dist/index.js
CHANGED
|
@@ -1168,5 +1168,55 @@ function createCyberdeskClient(apiKey, baseUrl, options) {
|
|
|
1168
1168
|
});
|
|
1169
1169
|
}),
|
|
1170
1170
|
},
|
|
1171
|
+
// Usage endpoints
|
|
1172
|
+
usage: {
|
|
1173
|
+
/**
|
|
1174
|
+
* Aggregate usage (agentic and cached steps) for a given date range.
|
|
1175
|
+
*
|
|
1176
|
+
* Two modes are supported:
|
|
1177
|
+
* - **simulated** (default): Uses total_agentic_steps and total_cached_steps from usage_metadata,
|
|
1178
|
+
* but excludes runs where billing_outcome is 'infra_failure' (these would have been free).
|
|
1179
|
+
* Use this for customers not yet on Stripe billing.
|
|
1180
|
+
* - **billed**: Uses total_agentic_steps_billed and total_cached_steps_billed.
|
|
1181
|
+
* Use this for customers on active Stripe billing.
|
|
1182
|
+
*
|
|
1183
|
+
* @param params - Query parameters
|
|
1184
|
+
* @param params.from_date - Start of period (inclusive, ISO string or Date)
|
|
1185
|
+
* @param params.to_date - End of period (inclusive, ISO string or Date)
|
|
1186
|
+
* @param params.mode - Usage counting mode ('simulated' or 'billed'). Defaults to 'simulated'.
|
|
1187
|
+
* @returns UsageAggregateResponse containing:
|
|
1188
|
+
* - total_agentic_steps: Total agentic steps in the period
|
|
1189
|
+
* - total_cached_steps: Total cached steps in the period
|
|
1190
|
+
* - period_start: Start of the queried period
|
|
1191
|
+
* - period_end: End of the queried period
|
|
1192
|
+
* - mode: The mode used for counting
|
|
1193
|
+
* - runs_counted: Number of runs included in the aggregation
|
|
1194
|
+
*
|
|
1195
|
+
* @example
|
|
1196
|
+
* ```typescript
|
|
1197
|
+
* const { data } = await client.usage.aggregate({
|
|
1198
|
+
* from_date: '2024-01-01T00:00:00Z',
|
|
1199
|
+
* to_date: '2024-01-31T23:59:59Z',
|
|
1200
|
+
* mode: 'simulated'
|
|
1201
|
+
* });
|
|
1202
|
+
*
|
|
1203
|
+
* if (data) {
|
|
1204
|
+
* console.log(`Agentic steps: ${data.total_agentic_steps}`);
|
|
1205
|
+
* console.log(`Cached steps: ${data.total_cached_steps}`);
|
|
1206
|
+
* console.log(`Runs counted: ${data.runs_counted}`);
|
|
1207
|
+
* }
|
|
1208
|
+
* ```
|
|
1209
|
+
*/
|
|
1210
|
+
aggregate: (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1211
|
+
return (0, sdk_gen_1.getUsageAggregateV1UsageAggregateGet)({
|
|
1212
|
+
client,
|
|
1213
|
+
query: {
|
|
1214
|
+
from_date: toIsoUtc(params.from_date),
|
|
1215
|
+
to_date: toIsoUtc(params.to_date),
|
|
1216
|
+
mode: params.mode,
|
|
1217
|
+
},
|
|
1218
|
+
});
|
|
1219
|
+
}),
|
|
1220
|
+
},
|
|
1171
1221
|
};
|
|
1172
1222
|
}
|