@airtop/sdk 1.0.0-alpha2.13 → 1.0.0-alpha2.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/index.d.cts CHANGED
@@ -1170,6 +1170,152 @@ interface AirtopPluginRegistration {
1170
1170
  */
1171
1171
  declare function registerAirtopPlugin(plugin: AirtopPluginRegistration): void;
1172
1172
 
1173
+ interface AirtopAgentCreateAgentParams extends Airtop.AgentCreateAgentParams {
1174
+ }
1175
+ interface AirtopAgentGetAgentsParams extends Airtop.AgentGetAgentsParams {
1176
+ }
1177
+ interface AirtopAgentUpdateAgentParams extends Airtop.AgentUpdateAgentParams {
1178
+ }
1179
+ interface AirtopAgentDeleteAgentsParams extends Airtop.AgentDeleteAgentsParams {
1180
+ }
1181
+ interface AirtopAgentDuplicateAgentParams extends Airtop.AgentDuplicateAgentParams {
1182
+ }
1183
+ interface AirtopAgentCreateVersionParams extends Airtop.AgentCreateVersionParams {
1184
+ }
1185
+ interface AirtopAgentGetVersionsParams extends Airtop.AgentGetVersionsParams {
1186
+ }
1187
+ interface AirtopAgentCreateInvocationParams extends Airtop.AgentCreateInvocationParams {
1188
+ }
1189
+ interface AirtopAgentGetInvocationsParams extends Airtop.AgentGetInvocationsParams {
1190
+ }
1191
+ interface AirtopAgentCancelInvocationParams extends Airtop.AgentCancelInvocationParams {
1192
+ }
1193
+ interface AirtopCreateAgentResponse extends Airtop.CreateAgentResponse {
1194
+ }
1195
+ interface AirtopGetAgentResponse extends Airtop.GetAgentResponse {
1196
+ }
1197
+ interface AirtopGetAgentsResponse extends Airtop.GetAgentsResponse {
1198
+ }
1199
+ interface AirtopUpdateAgentResponse extends Airtop.UpdateAgentResponse {
1200
+ }
1201
+ interface AirtopDeleteAgentsResponse extends Airtop.DeleteResponse {
1202
+ }
1203
+ interface AirtopDuplicateAgentResponse extends Airtop.DuplicateAgentResponse {
1204
+ }
1205
+ interface AirtopCreateAgentVersionResponse extends Airtop.CreateAgentVersionResponse {
1206
+ }
1207
+ interface AirtopGetAgentVersionsResponse extends Airtop.GetAgentVersionsResponse {
1208
+ }
1209
+ interface AirtopCreateAgentInvocationResponse extends Airtop.CreateAgentInvocationResponse {
1210
+ }
1211
+ interface AirtopGetAgentInvocationsResponse extends Airtop.GetAgentInvocationsResponse {
1212
+ }
1213
+ interface AirtopAgentResponse extends Airtop.GetAgentResponse {
1214
+ }
1215
+
1216
+ /**
1217
+ * Client for making Agent-specific requests to the Airtop API.
1218
+ */
1219
+ declare class AirtopAgentClient extends AirtopBase {
1220
+ /**
1221
+ * Creates a new instance of the Airtop SDK.
1222
+ * @param config - Configuration options for the Airtop SDK
1223
+ */
1224
+ constructor(config: AirtopConstructorConfig);
1225
+ /**
1226
+ * Creates a new agent.
1227
+ * @param params - Parameters for creating the agent. Corresponds to `AirtopAgentCreateAgentParams`.
1228
+ * @param requestOptions - Request options.
1229
+ * @returns The created agent data, `AirtopCreateAgentResponse`.
1230
+ */
1231
+ createAgent(params: AirtopAgentCreateAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopCreateAgentResponse>;
1232
+ /**
1233
+ * Retrieves a specific agent by its ID.
1234
+ * @param agentId - The ID of the agent to retrieve.
1235
+ * @param requestOptions - Request options.
1236
+ * @returns The agent data, `AirtopGetAgentResponse`.
1237
+ */
1238
+ getAgent(agentId: string, // Renamed to avoid conflict with class member
1239
+ requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentResponse>;
1240
+ /**
1241
+ * Lists agents.
1242
+ * @param params - Optional parameters for listing agents (e.g., pagination). Corresponds to `AirtopAgentGetAgentsParams`.
1243
+ * @param requestOptions - Request options.
1244
+ * @returns A list of agents, `AirtopGetAgentsResponse`.
1245
+ */
1246
+ listAgents(params?: AirtopAgentGetAgentsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentsResponse>;
1247
+ /**
1248
+ * Updates an existing agent.
1249
+ * @param agentId - The ID of the agent to update.
1250
+ * @param params - The new data for the agent. Corresponds to `AirtopAgentUpdateAgentParams`.
1251
+ * @param requestOptions - Request options.
1252
+ * @returns The updated agent data, `AirtopUpdateAgentResponse`.
1253
+ */
1254
+ updateAgent(agentId: string, // Renamed to avoid conflict with class member
1255
+ params: AirtopAgentUpdateAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopUpdateAgentResponse>;
1256
+ /**
1257
+ * Deletes one or more agents.
1258
+ * @param params - Parameters for deleting agents. Corresponds to `AirtopAgentDeleteAgentsParams`.
1259
+ * @param requestOptions - Request options.
1260
+ * @returns A response confirming the deletion, `AirtopDeleteAgentsResponse`.
1261
+ */
1262
+ deleteAgents(params: AirtopAgentDeleteAgentsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopDeleteAgentsResponse>;
1263
+ /**
1264
+ * Duplicates an agent.
1265
+ * @param agentId - The ID of the agent to duplicate.
1266
+ * @param params - Parameters for duplicating the agent (e.g., new name). Corresponds to `AirtopAgentDuplicateAgentParams`.
1267
+ * @param requestOptions - Request options.
1268
+ * @returns The duplicated agent data, `AirtopDuplicateAgentResponse`.
1269
+ */
1270
+ duplicateAgent(agentId: string, // Renamed to avoid conflict with class member
1271
+ params: AirtopAgentDuplicateAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopDuplicateAgentResponse>;
1272
+ /**
1273
+ * Creates a new version for an agent.
1274
+ * @param agentId - The ID of the agent for which to create a version.
1275
+ * @param params - Parameters for creating the agent version. Corresponds to `AirtopAgentCreateVersionParams`.
1276
+ * @param requestOptions - Request options.
1277
+ * @returns The created agent version data, `AirtopCreateAgentVersionResponse`.
1278
+ */
1279
+ createAgentVersion(agentId: string, // Renamed
1280
+ params: AirtopAgentCreateVersionParams, requestOptions?: AirtopRequestOptions): Promise<AirtopCreateAgentVersionResponse>;
1281
+ /**
1282
+ * Lists versions of an agent.
1283
+ * @param agentId - The ID of the agent whose versions to list.
1284
+ * @param params - Optional parameters for listing agent versions. Corresponds to `AirtopAgentGetVersionsParams`.
1285
+ * @param requestOptions - Request options.
1286
+ * @returns A list of agent versions, `AirtopGetAgentVersionsResponse`.
1287
+ */
1288
+ listAgentVersions(agentId: string, // Renamed
1289
+ params?: AirtopAgentGetVersionsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentVersionsResponse>;
1290
+ /**
1291
+ * Creates an invocation for an agent.
1292
+ * @param agentId - The ID of the agent for which to create an invocation.
1293
+ * @param params - Parameters for creating the agent invocation. Corresponds to `AirtopAgentCreateInvocationParams`.
1294
+ * @param requestOptions - Request options.
1295
+ * @returns The created agent invocation data, `AirtopCreateAgentInvocationResponse`.
1296
+ */
1297
+ createAgentInvocation(agentId: string, // Renamed
1298
+ params: AirtopAgentCreateInvocationParams, requestOptions?: AirtopRequestOptions): Promise<AirtopCreateAgentInvocationResponse>;
1299
+ /**
1300
+ * Lists invocations of an agent.
1301
+ * @param agentIds - The ID of the agent whose invocations to list.
1302
+ * @param params - Optional parameters for listing agent invocations. Corresponds to `AirtopAgentGetInvocationsParams`.
1303
+ * @param requestOptions - Request options.
1304
+ * @returns A list of agent invocations, `AirtopGetAgentInvocationsResponse`.
1305
+ */
1306
+ listAgentInvocations(agentIds: string, // Renamed
1307
+ params?: AirtopAgentGetInvocationsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentInvocationsResponse>;
1308
+ /**
1309
+ * Cancels a specific invocation of an agent.
1310
+ * @param agentId - The ID of the agent.
1311
+ * @param invocationId - The ID of the invocation to cancel.
1312
+ * @param paramsBody - Optional body parameters for cancelling the invocation. Corresponds to `AirtopAgentCancelInvocationParams`.
1313
+ * @param requestOptions - Request options.
1314
+ * @returns A promise that resolves when the operation is complete.
1315
+ */
1316
+ cancelAgentInvocation(agentId: string, invocationId: string, paramsBody?: AirtopAgentCancelInvocationParams, requestOptions?: AirtopRequestOptions): Promise<void>;
1317
+ }
1318
+
1173
1319
  /**
1174
1320
  * Provides utility methods for creating mock instances of Airtop classes.
1175
1321
  * @hideconstructor
@@ -1196,4 +1342,4 @@ declare class AirtopMocks {
1196
1342
  }): AirtopWindow<AirtopWindowGetInfoResponse>;
1197
1343
  }
1198
1344
 
1199
- export { type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, AirtopError, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, AirtopMocks, AirtopNode, type AirtopNodeApiResponseData, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, AirtopWindow, AirtopWindowClient, type AirtopWindowClientPlugin, type AirtopWindowCreateResponse, type AirtopWindowGetInfoResponse, type AirtopWindowPlugin, AirtopWindowScreenshot, type AirtopWindowScreenshotPlugin, type AirtopWindowScreenshotResponse, type CommonAirtopConfig, type CommonResponse, type CommonWindowResponse, type CreateFileConfig, type CreateSessionConfig, type GetFilesConfig, type GetSessionsConfig, type OutputJsonSchemaConfig, type ScreenshotData, type SessionData, type SessionError, type SessionMetadata, type SessionWarning, type WindowActConfig, type WindowClickConfig, type WindowCreateData, type WindowError, type WindowExtractConfig, type WindowFindManyConfig, type WindowFindOneConfig, type WindowGetConfig, type WindowHoverConfig, type WindowInfoData, type WindowLlmConfig, type WindowLoadUrlConfig, type WindowMetadata, type WindowMonitorConfig, type WindowNavigateConfig, WindowNavigateDirection, type WindowPageQueryConfig, type WindowPaginatedExtractionConfig, type WindowPromptResponse, type WindowScrapeConfig, type WindowScrapeResponse, type WindowScreenshotConfig, type WindowScrollConfig, type WindowTypeConfig, type WindowWaitForPageConfig, type WindowWarning, registerAirtopPlugin };
1345
+ export { type AirtopAgentCancelInvocationParams, AirtopAgentClient, type AirtopAgentCreateAgentParams, type AirtopAgentCreateInvocationParams, type AirtopAgentCreateVersionParams, type AirtopAgentDeleteAgentsParams, type AirtopAgentDuplicateAgentParams, type AirtopAgentGetAgentsParams, type AirtopAgentGetInvocationsParams, type AirtopAgentGetVersionsParams, type AirtopAgentResponse, type AirtopAgentUpdateAgentParams, type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopCreateAgentInvocationResponse, type AirtopCreateAgentResponse, type AirtopCreateAgentVersionResponse, type AirtopDeleteAgentsResponse, type AirtopDuplicateAgentResponse, AirtopError, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, type AirtopGetAgentInvocationsResponse, type AirtopGetAgentResponse, type AirtopGetAgentVersionsResponse, type AirtopGetAgentsResponse, AirtopMocks, AirtopNode, type AirtopNodeApiResponseData, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, type AirtopUpdateAgentResponse, AirtopWindow, AirtopWindowClient, type AirtopWindowClientPlugin, type AirtopWindowCreateResponse, type AirtopWindowGetInfoResponse, type AirtopWindowPlugin, AirtopWindowScreenshot, type AirtopWindowScreenshotPlugin, type AirtopWindowScreenshotResponse, type CommonAirtopConfig, type CommonResponse, type CommonWindowResponse, type CreateFileConfig, type CreateSessionConfig, type GetFilesConfig, type GetSessionsConfig, type OutputJsonSchemaConfig, type ScreenshotData, type SessionData, type SessionError, type SessionMetadata, type SessionWarning, type WindowActConfig, type WindowClickConfig, type WindowCreateData, type WindowError, type WindowExtractConfig, type WindowFindManyConfig, type WindowFindOneConfig, type WindowGetConfig, type WindowHoverConfig, type WindowInfoData, type WindowLlmConfig, type WindowLoadUrlConfig, type WindowMetadata, type WindowMonitorConfig, type WindowNavigateConfig, WindowNavigateDirection, type WindowPageQueryConfig, type WindowPaginatedExtractionConfig, type WindowPromptResponse, type WindowScrapeConfig, type WindowScrapeResponse, type WindowScreenshotConfig, type WindowScrollConfig, type WindowTypeConfig, type WindowWaitForPageConfig, type WindowWarning, registerAirtopPlugin };
package/dist/index.d.ts CHANGED
@@ -1170,6 +1170,152 @@ interface AirtopPluginRegistration {
1170
1170
  */
1171
1171
  declare function registerAirtopPlugin(plugin: AirtopPluginRegistration): void;
1172
1172
 
1173
+ interface AirtopAgentCreateAgentParams extends Airtop.AgentCreateAgentParams {
1174
+ }
1175
+ interface AirtopAgentGetAgentsParams extends Airtop.AgentGetAgentsParams {
1176
+ }
1177
+ interface AirtopAgentUpdateAgentParams extends Airtop.AgentUpdateAgentParams {
1178
+ }
1179
+ interface AirtopAgentDeleteAgentsParams extends Airtop.AgentDeleteAgentsParams {
1180
+ }
1181
+ interface AirtopAgentDuplicateAgentParams extends Airtop.AgentDuplicateAgentParams {
1182
+ }
1183
+ interface AirtopAgentCreateVersionParams extends Airtop.AgentCreateVersionParams {
1184
+ }
1185
+ interface AirtopAgentGetVersionsParams extends Airtop.AgentGetVersionsParams {
1186
+ }
1187
+ interface AirtopAgentCreateInvocationParams extends Airtop.AgentCreateInvocationParams {
1188
+ }
1189
+ interface AirtopAgentGetInvocationsParams extends Airtop.AgentGetInvocationsParams {
1190
+ }
1191
+ interface AirtopAgentCancelInvocationParams extends Airtop.AgentCancelInvocationParams {
1192
+ }
1193
+ interface AirtopCreateAgentResponse extends Airtop.CreateAgentResponse {
1194
+ }
1195
+ interface AirtopGetAgentResponse extends Airtop.GetAgentResponse {
1196
+ }
1197
+ interface AirtopGetAgentsResponse extends Airtop.GetAgentsResponse {
1198
+ }
1199
+ interface AirtopUpdateAgentResponse extends Airtop.UpdateAgentResponse {
1200
+ }
1201
+ interface AirtopDeleteAgentsResponse extends Airtop.DeleteResponse {
1202
+ }
1203
+ interface AirtopDuplicateAgentResponse extends Airtop.DuplicateAgentResponse {
1204
+ }
1205
+ interface AirtopCreateAgentVersionResponse extends Airtop.CreateAgentVersionResponse {
1206
+ }
1207
+ interface AirtopGetAgentVersionsResponse extends Airtop.GetAgentVersionsResponse {
1208
+ }
1209
+ interface AirtopCreateAgentInvocationResponse extends Airtop.CreateAgentInvocationResponse {
1210
+ }
1211
+ interface AirtopGetAgentInvocationsResponse extends Airtop.GetAgentInvocationsResponse {
1212
+ }
1213
+ interface AirtopAgentResponse extends Airtop.GetAgentResponse {
1214
+ }
1215
+
1216
+ /**
1217
+ * Client for making Agent-specific requests to the Airtop API.
1218
+ */
1219
+ declare class AirtopAgentClient extends AirtopBase {
1220
+ /**
1221
+ * Creates a new instance of the Airtop SDK.
1222
+ * @param config - Configuration options for the Airtop SDK
1223
+ */
1224
+ constructor(config: AirtopConstructorConfig);
1225
+ /**
1226
+ * Creates a new agent.
1227
+ * @param params - Parameters for creating the agent. Corresponds to `AirtopAgentCreateAgentParams`.
1228
+ * @param requestOptions - Request options.
1229
+ * @returns The created agent data, `AirtopCreateAgentResponse`.
1230
+ */
1231
+ createAgent(params: AirtopAgentCreateAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopCreateAgentResponse>;
1232
+ /**
1233
+ * Retrieves a specific agent by its ID.
1234
+ * @param agentId - The ID of the agent to retrieve.
1235
+ * @param requestOptions - Request options.
1236
+ * @returns The agent data, `AirtopGetAgentResponse`.
1237
+ */
1238
+ getAgent(agentId: string, // Renamed to avoid conflict with class member
1239
+ requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentResponse>;
1240
+ /**
1241
+ * Lists agents.
1242
+ * @param params - Optional parameters for listing agents (e.g., pagination). Corresponds to `AirtopAgentGetAgentsParams`.
1243
+ * @param requestOptions - Request options.
1244
+ * @returns A list of agents, `AirtopGetAgentsResponse`.
1245
+ */
1246
+ listAgents(params?: AirtopAgentGetAgentsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentsResponse>;
1247
+ /**
1248
+ * Updates an existing agent.
1249
+ * @param agentId - The ID of the agent to update.
1250
+ * @param params - The new data for the agent. Corresponds to `AirtopAgentUpdateAgentParams`.
1251
+ * @param requestOptions - Request options.
1252
+ * @returns The updated agent data, `AirtopUpdateAgentResponse`.
1253
+ */
1254
+ updateAgent(agentId: string, // Renamed to avoid conflict with class member
1255
+ params: AirtopAgentUpdateAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopUpdateAgentResponse>;
1256
+ /**
1257
+ * Deletes one or more agents.
1258
+ * @param params - Parameters for deleting agents. Corresponds to `AirtopAgentDeleteAgentsParams`.
1259
+ * @param requestOptions - Request options.
1260
+ * @returns A response confirming the deletion, `AirtopDeleteAgentsResponse`.
1261
+ */
1262
+ deleteAgents(params: AirtopAgentDeleteAgentsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopDeleteAgentsResponse>;
1263
+ /**
1264
+ * Duplicates an agent.
1265
+ * @param agentId - The ID of the agent to duplicate.
1266
+ * @param params - Parameters for duplicating the agent (e.g., new name). Corresponds to `AirtopAgentDuplicateAgentParams`.
1267
+ * @param requestOptions - Request options.
1268
+ * @returns The duplicated agent data, `AirtopDuplicateAgentResponse`.
1269
+ */
1270
+ duplicateAgent(agentId: string, // Renamed to avoid conflict with class member
1271
+ params: AirtopAgentDuplicateAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopDuplicateAgentResponse>;
1272
+ /**
1273
+ * Creates a new version for an agent.
1274
+ * @param agentId - The ID of the agent for which to create a version.
1275
+ * @param params - Parameters for creating the agent version. Corresponds to `AirtopAgentCreateVersionParams`.
1276
+ * @param requestOptions - Request options.
1277
+ * @returns The created agent version data, `AirtopCreateAgentVersionResponse`.
1278
+ */
1279
+ createAgentVersion(agentId: string, // Renamed
1280
+ params: AirtopAgentCreateVersionParams, requestOptions?: AirtopRequestOptions): Promise<AirtopCreateAgentVersionResponse>;
1281
+ /**
1282
+ * Lists versions of an agent.
1283
+ * @param agentId - The ID of the agent whose versions to list.
1284
+ * @param params - Optional parameters for listing agent versions. Corresponds to `AirtopAgentGetVersionsParams`.
1285
+ * @param requestOptions - Request options.
1286
+ * @returns A list of agent versions, `AirtopGetAgentVersionsResponse`.
1287
+ */
1288
+ listAgentVersions(agentId: string, // Renamed
1289
+ params?: AirtopAgentGetVersionsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentVersionsResponse>;
1290
+ /**
1291
+ * Creates an invocation for an agent.
1292
+ * @param agentId - The ID of the agent for which to create an invocation.
1293
+ * @param params - Parameters for creating the agent invocation. Corresponds to `AirtopAgentCreateInvocationParams`.
1294
+ * @param requestOptions - Request options.
1295
+ * @returns The created agent invocation data, `AirtopCreateAgentInvocationResponse`.
1296
+ */
1297
+ createAgentInvocation(agentId: string, // Renamed
1298
+ params: AirtopAgentCreateInvocationParams, requestOptions?: AirtopRequestOptions): Promise<AirtopCreateAgentInvocationResponse>;
1299
+ /**
1300
+ * Lists invocations of an agent.
1301
+ * @param agentIds - The ID of the agent whose invocations to list.
1302
+ * @param params - Optional parameters for listing agent invocations. Corresponds to `AirtopAgentGetInvocationsParams`.
1303
+ * @param requestOptions - Request options.
1304
+ * @returns A list of agent invocations, `AirtopGetAgentInvocationsResponse`.
1305
+ */
1306
+ listAgentInvocations(agentIds: string, // Renamed
1307
+ params?: AirtopAgentGetInvocationsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentInvocationsResponse>;
1308
+ /**
1309
+ * Cancels a specific invocation of an agent.
1310
+ * @param agentId - The ID of the agent.
1311
+ * @param invocationId - The ID of the invocation to cancel.
1312
+ * @param paramsBody - Optional body parameters for cancelling the invocation. Corresponds to `AirtopAgentCancelInvocationParams`.
1313
+ * @param requestOptions - Request options.
1314
+ * @returns A promise that resolves when the operation is complete.
1315
+ */
1316
+ cancelAgentInvocation(agentId: string, invocationId: string, paramsBody?: AirtopAgentCancelInvocationParams, requestOptions?: AirtopRequestOptions): Promise<void>;
1317
+ }
1318
+
1173
1319
  /**
1174
1320
  * Provides utility methods for creating mock instances of Airtop classes.
1175
1321
  * @hideconstructor
@@ -1196,4 +1342,4 @@ declare class AirtopMocks {
1196
1342
  }): AirtopWindow<AirtopWindowGetInfoResponse>;
1197
1343
  }
1198
1344
 
1199
- export { type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, AirtopError, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, AirtopMocks, AirtopNode, type AirtopNodeApiResponseData, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, AirtopWindow, AirtopWindowClient, type AirtopWindowClientPlugin, type AirtopWindowCreateResponse, type AirtopWindowGetInfoResponse, type AirtopWindowPlugin, AirtopWindowScreenshot, type AirtopWindowScreenshotPlugin, type AirtopWindowScreenshotResponse, type CommonAirtopConfig, type CommonResponse, type CommonWindowResponse, type CreateFileConfig, type CreateSessionConfig, type GetFilesConfig, type GetSessionsConfig, type OutputJsonSchemaConfig, type ScreenshotData, type SessionData, type SessionError, type SessionMetadata, type SessionWarning, type WindowActConfig, type WindowClickConfig, type WindowCreateData, type WindowError, type WindowExtractConfig, type WindowFindManyConfig, type WindowFindOneConfig, type WindowGetConfig, type WindowHoverConfig, type WindowInfoData, type WindowLlmConfig, type WindowLoadUrlConfig, type WindowMetadata, type WindowMonitorConfig, type WindowNavigateConfig, WindowNavigateDirection, type WindowPageQueryConfig, type WindowPaginatedExtractionConfig, type WindowPromptResponse, type WindowScrapeConfig, type WindowScrapeResponse, type WindowScreenshotConfig, type WindowScrollConfig, type WindowTypeConfig, type WindowWaitForPageConfig, type WindowWarning, registerAirtopPlugin };
1345
+ export { type AirtopAgentCancelInvocationParams, AirtopAgentClient, type AirtopAgentCreateAgentParams, type AirtopAgentCreateInvocationParams, type AirtopAgentCreateVersionParams, type AirtopAgentDeleteAgentsParams, type AirtopAgentDuplicateAgentParams, type AirtopAgentGetAgentsParams, type AirtopAgentGetInvocationsParams, type AirtopAgentGetVersionsParams, type AirtopAgentResponse, type AirtopAgentUpdateAgentParams, type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopCreateAgentInvocationResponse, type AirtopCreateAgentResponse, type AirtopCreateAgentVersionResponse, type AirtopDeleteAgentsResponse, type AirtopDuplicateAgentResponse, AirtopError, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, type AirtopGetAgentInvocationsResponse, type AirtopGetAgentResponse, type AirtopGetAgentVersionsResponse, type AirtopGetAgentsResponse, AirtopMocks, AirtopNode, type AirtopNodeApiResponseData, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, type AirtopUpdateAgentResponse, AirtopWindow, AirtopWindowClient, type AirtopWindowClientPlugin, type AirtopWindowCreateResponse, type AirtopWindowGetInfoResponse, type AirtopWindowPlugin, AirtopWindowScreenshot, type AirtopWindowScreenshotPlugin, type AirtopWindowScreenshotResponse, type CommonAirtopConfig, type CommonResponse, type CommonWindowResponse, type CreateFileConfig, type CreateSessionConfig, type GetFilesConfig, type GetSessionsConfig, type OutputJsonSchemaConfig, type ScreenshotData, type SessionData, type SessionError, type SessionMetadata, type SessionWarning, type WindowActConfig, type WindowClickConfig, type WindowCreateData, type WindowError, type WindowExtractConfig, type WindowFindManyConfig, type WindowFindOneConfig, type WindowGetConfig, type WindowHoverConfig, type WindowInfoData, type WindowLlmConfig, type WindowLoadUrlConfig, type WindowMetadata, type WindowMonitorConfig, type WindowNavigateConfig, WindowNavigateDirection, type WindowPageQueryConfig, type WindowPaginatedExtractionConfig, type WindowPromptResponse, type WindowScrapeConfig, type WindowScrapeResponse, type WindowScreenshotConfig, type WindowScrollConfig, type WindowTypeConfig, type WindowWaitForPageConfig, type WindowWarning, registerAirtopPlugin };
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var require_package = __commonJS({
9
9
  module.exports = {
10
10
  name: "@airtop/sdk",
11
11
  description: "Airtop SDK for TypeScript",
12
- version: "1.0.0-alpha2.13",
12
+ version: "1.0.0-alpha2.14",
13
13
  type: "module",
14
14
  main: "./dist/index.cjs",
15
15
  module: "./dist/index.js",
@@ -47,7 +47,7 @@ var require_package = __commonJS({
47
47
  },
48
48
  dependencies: {
49
49
  "@airtop/json-schema-adapter": "workspace:*",
50
- "@airtop/core": "0.1.0-alpha.28",
50
+ "@airtop/core": "0.1.0-alpha.29",
51
51
  "date-fns": "4.1.0",
52
52
  loglayer: "6.3.3",
53
53
  "serialize-error": "12.0.0",
@@ -1448,8 +1448,191 @@ function registerAirtopPlugin(plugin) {
1448
1448
  }
1449
1449
  }
1450
1450
 
1451
- // src/AirtopMocks.ts
1451
+ // src/agent/AirtopAgentClient.ts
1452
+ import { version as version2 } from "node:process";
1452
1453
  import { Airtop as AirtopCore2 } from "@airtop/core";
1454
+ import { minutesToMilliseconds as minutesToMilliseconds2 } from "date-fns";
1455
+ import { ConsoleTransport as ConsoleTransport2 } from "loglayer";
1456
+ import { LogLayer as LogLayer2 } from "loglayer";
1457
+ import { serializeError as serializeError2 } from "serialize-error";
1458
+ var AirtopAgentClient = class extends AirtopBase {
1459
+ /**
1460
+ * Creates a new instance of the Airtop SDK.
1461
+ * @param config - Configuration options for the Airtop SDK
1462
+ */
1463
+ constructor(config) {
1464
+ super({
1465
+ logLevel: config?.logLevel,
1466
+ client: new AirtopCore2({
1467
+ maxRetries: 0,
1468
+ timeout: minutesToMilliseconds2(1),
1469
+ apiKey: config.apiKey,
1470
+ baseURL: config?.airtopUrl,
1471
+ logLevel: config?.logLevel || "off",
1472
+ defaultHeaders: {
1473
+ "x-airtop-sdk-source": "typescript",
1474
+ "x-airtop-sdk-version": version2
1475
+ }
1476
+ }),
1477
+ log: config?.logger || new LogLayer2({
1478
+ errorSerializer: serializeError2,
1479
+ transport: new ConsoleTransport2({
1480
+ logger: console,
1481
+ messageField: "message",
1482
+ enabled: config.logLevel !== "off",
1483
+ level: config.logLevel === "off" ? "error" : config.logLevel || "error"
1484
+ }),
1485
+ contextFieldName: "context",
1486
+ metadataFieldName: "metadata"
1487
+ }),
1488
+ outputSchemaAdapter: config.outputSchemaAdapter,
1489
+ jobId: config.jobId
1490
+ });
1491
+ this.log.withPrefix("[Airtop SDK]");
1492
+ this.client.logLevel = config.logLevel;
1493
+ this.client.logger = {
1494
+ debug: (message, ...rest) => {
1495
+ processLogMessage(this.log, "debug", message, rest);
1496
+ },
1497
+ error: (message, ...rest) => {
1498
+ processLogMessage(this.log, "error", message, rest);
1499
+ },
1500
+ info: (message, ...rest) => {
1501
+ processLogMessage(this.log, "info", message, rest);
1502
+ },
1503
+ warn: (message, ...rest) => {
1504
+ processLogMessage(this.log, "warn", message, rest);
1505
+ }
1506
+ };
1507
+ }
1508
+ /**
1509
+ * Creates a new agent.
1510
+ * @param params - Parameters for creating the agent. Corresponds to `AirtopAgentCreateAgentParams`.
1511
+ * @param requestOptions - Request options.
1512
+ * @returns The created agent data, `AirtopCreateAgentResponse`.
1513
+ */
1514
+ async createAgent(params, requestOptions = {}) {
1515
+ this.log.info("Creating agent");
1516
+ return this.client.agents.createAgent(params, this.resolveRequestOptions(requestOptions));
1517
+ }
1518
+ /**
1519
+ * Retrieves a specific agent by its ID.
1520
+ * @param agentId - The ID of the agent to retrieve.
1521
+ * @param requestOptions - Request options.
1522
+ * @returns The agent data, `AirtopGetAgentResponse`.
1523
+ */
1524
+ async getAgent(agentId, requestOptions = {}) {
1525
+ this.log.withMetadata({ agentId }).info("Retrieving agent");
1526
+ return this.client.agents.getAgent(agentId, this.resolveRequestOptions(requestOptions));
1527
+ }
1528
+ /**
1529
+ * Lists agents.
1530
+ * @param params - Optional parameters for listing agents (e.g., pagination). Corresponds to `AirtopAgentGetAgentsParams`.
1531
+ * @param requestOptions - Request options.
1532
+ * @returns A list of agents, `AirtopGetAgentsResponse`.
1533
+ */
1534
+ async listAgents(params, requestOptions = {}) {
1535
+ this.log.info("Listing agents");
1536
+ return this.client.agents.getAgents(params, this.resolveRequestOptions(requestOptions));
1537
+ }
1538
+ /**
1539
+ * Updates an existing agent.
1540
+ * @param agentId - The ID of the agent to update.
1541
+ * @param params - The new data for the agent. Corresponds to `AirtopAgentUpdateAgentParams`.
1542
+ * @param requestOptions - Request options.
1543
+ * @returns The updated agent data, `AirtopUpdateAgentResponse`.
1544
+ */
1545
+ async updateAgent(agentId, params, requestOptions = {}) {
1546
+ this.log.withMetadata({ agentId }).info("Updating agent");
1547
+ return this.client.agents.updateAgent(agentId, params, this.resolveRequestOptions(requestOptions));
1548
+ }
1549
+ /**
1550
+ * Deletes one or more agents.
1551
+ * @param params - Parameters for deleting agents. Corresponds to `AirtopAgentDeleteAgentsParams`.
1552
+ * @param requestOptions - Request options.
1553
+ * @returns A response confirming the deletion, `AirtopDeleteAgentsResponse`.
1554
+ */
1555
+ async deleteAgents(params, requestOptions = {}) {
1556
+ this.log.info("Deleting agent(s)");
1557
+ return this.client.agents.deleteAgents(params, this.resolveRequestOptions(requestOptions));
1558
+ }
1559
+ /**
1560
+ * Duplicates an agent.
1561
+ * @param agentId - The ID of the agent to duplicate.
1562
+ * @param params - Parameters for duplicating the agent (e.g., new name). Corresponds to `AirtopAgentDuplicateAgentParams`.
1563
+ * @param requestOptions - Request options.
1564
+ * @returns The duplicated agent data, `AirtopDuplicateAgentResponse`.
1565
+ */
1566
+ async duplicateAgent(agentId, params, requestOptions = {}) {
1567
+ this.log.withMetadata({ agentId }).info("Duplicating agent");
1568
+ return this.client.agents.duplicateAgent(agentId, params, this.resolveRequestOptions(requestOptions));
1569
+ }
1570
+ /**
1571
+ * Creates a new version for an agent.
1572
+ * @param agentId - The ID of the agent for which to create a version.
1573
+ * @param params - Parameters for creating the agent version. Corresponds to `AirtopAgentCreateVersionParams`.
1574
+ * @param requestOptions - Request options.
1575
+ * @returns The created agent version data, `AirtopCreateAgentVersionResponse`.
1576
+ */
1577
+ async createAgentVersion(agentId, params, requestOptions = {}) {
1578
+ this.log.withMetadata({ agentId }).info("Creating agent version");
1579
+ return this.client.agents.createVersion(agentId, params, this.resolveRequestOptions(requestOptions));
1580
+ }
1581
+ /**
1582
+ * Lists versions of an agent.
1583
+ * @param agentId - The ID of the agent whose versions to list.
1584
+ * @param params - Optional parameters for listing agent versions. Corresponds to `AirtopAgentGetVersionsParams`.
1585
+ * @param requestOptions - Request options.
1586
+ * @returns A list of agent versions, `AirtopGetAgentVersionsResponse`.
1587
+ */
1588
+ async listAgentVersions(agentId, params, requestOptions = {}) {
1589
+ this.log.withMetadata({ agentId }).info("Listing agent versions");
1590
+ return this.client.agents.getVersions(agentId, params, this.resolveRequestOptions(requestOptions));
1591
+ }
1592
+ /**
1593
+ * Creates an invocation for an agent.
1594
+ * @param agentId - The ID of the agent for which to create an invocation.
1595
+ * @param params - Parameters for creating the agent invocation. Corresponds to `AirtopAgentCreateInvocationParams`.
1596
+ * @param requestOptions - Request options.
1597
+ * @returns The created agent invocation data, `AirtopCreateAgentInvocationResponse`.
1598
+ */
1599
+ async createAgentInvocation(agentId, params, requestOptions = {}) {
1600
+ this.log.withMetadata({ agentId }).info("Creating agent invocation");
1601
+ return this.client.agents.createInvocation(agentId, params, this.resolveRequestOptions(requestOptions));
1602
+ }
1603
+ /**
1604
+ * Lists invocations of an agent.
1605
+ * @param agentIds - The ID of the agent whose invocations to list.
1606
+ * @param params - Optional parameters for listing agent invocations. Corresponds to `AirtopAgentGetInvocationsParams`.
1607
+ * @param requestOptions - Request options.
1608
+ * @returns A list of agent invocations, `AirtopGetAgentInvocationsResponse`.
1609
+ */
1610
+ async listAgentInvocations(agentIds, params, requestOptions = {}) {
1611
+ this.log.withMetadata({ agentId: agentIds }).info("Listing agent invocations");
1612
+ return this.client.agents.getInvocations(agentIds, params, this.resolveRequestOptions(requestOptions));
1613
+ }
1614
+ /**
1615
+ * Cancels a specific invocation of an agent.
1616
+ * @param agentId - The ID of the agent.
1617
+ * @param invocationId - The ID of the invocation to cancel.
1618
+ * @param paramsBody - Optional body parameters for cancelling the invocation. Corresponds to `AirtopAgentCancelInvocationParams`.
1619
+ * @param requestOptions - Request options.
1620
+ * @returns A promise that resolves when the operation is complete.
1621
+ */
1622
+ async cancelAgentInvocation(agentId, invocationId, paramsBody, requestOptions = {}) {
1623
+ this.log.withMetadata({ agentId, invocationId }).info("Cancelling agent invocation");
1624
+ const resolvedOptions = this.resolveRequestOptions(requestOptions);
1625
+ const finalOptions = { ...resolvedOptions };
1626
+ const params = { id: agentId, ...paramsBody };
1627
+ if (paramsBody) {
1628
+ finalOptions.body = paramsBody;
1629
+ }
1630
+ await this.client.agents.cancelInvocation(invocationId, params, finalOptions);
1631
+ }
1632
+ };
1633
+
1634
+ // src/AirtopMocks.ts
1635
+ import { Airtop as AirtopCore3 } from "@airtop/core";
1453
1636
  import { MockLogLayer } from "loglayer";
1454
1637
  import { v4 as uuidv4 } from "uuid";
1455
1638
  function createNoOpClient(client) {
@@ -1472,7 +1655,7 @@ function createNoOpClient(client) {
1472
1655
  });
1473
1656
  }
1474
1657
  function generateCommonAirtopConfigMock() {
1475
- const client = new AirtopCore2({
1658
+ const client = new AirtopCore3({
1476
1659
  apiKey: "test-api-key"
1477
1660
  });
1478
1661
  return {
@@ -1539,6 +1722,7 @@ var AirtopMocks = class {
1539
1722
  }
1540
1723
  };
1541
1724
  export {
1725
+ AirtopAgentClient,
1542
1726
  AirtopBase,
1543
1727
  AirtopClient,
1544
1728
  AirtopError,