@airtop/sdk 1.0.0-alpha2.2 → 1.0.0-alpha2.20

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
@@ -4,14 +4,17 @@ import { AirtopJsonSchemaAdapter } from '@airtop/json-schema-adapter';
4
4
  export { AirtopJsonSchemaAdapter } from '@airtop/json-schema-adapter';
5
5
  import { ILogLayer } from 'loglayer';
6
6
  export { ILogLayer } from 'loglayer';
7
+ import * as _airtop_core_resources_shared_js from '@airtop/core/resources/shared.js';
8
+ import { Issue, SessionConfigV1, GetFileResponse, FilesResponse, ListAutomationsOutput, AutomationData, ServicePromptActionResponseEnvelope, ExternalSessionWithConnectionInfo, EnvelopeDefaultMeta, ExtractActionResponseEnvelope, ActActionResponseEnvelope, LlmActionResponseEnvelope, NodeHandle, WaitForPageActionResponseEnvelope, NavigateActionResponseEnvelope, FindOneActionResponseEnvelope, FindManyActionResponseEnvelope, AIPromptResponse as AIPromptResponse$1, WindowIDDataResponse, OperationOutcomeResponse } from '@airtop/core/resources/shared.js';
9
+ export { AIResponseEnvelope, ActActionResponseData, AgentInvocationData, AgentVersionData, AirtopPagination, AsyncConfig, AsyncSessionAIResponseEnvelope, BrowserWaitNavigationConfig, ClickConfig, ClientProvidedResponseMetadata, CreateFileData, EnvelopeDefaultMeta, ExternalSessionAIResponseMetadata, ExternalSessionAIResponseMetadataUsage, ExternalSessionConfig, ExternalSessionWithConnectionInfo, ExtractActionResponseData, FindManyActionResponseData, FindOneActionResponseData, GetFileData, IntervalMonitorConfig, Issue, LlmActionResponseData, MicroInteractionConfig, MonitorConfig, NavigateActionResponseData, OperationOutcome, OperationOutcomeResponse, PageQueryConfig, PageQueryExperimentalConfig, PaginatedExtractionConfig, ScrapeResponseContent, ScrapeResponseEnvelope, ScrapeResponseOutput, ScreenshotConfig, ScreenshotMetadata, ScreenshotRequestConfig, ScreenshotScrollPosition, ScreenshotViewportDimensions, ScrollByConfig, ScrollToEdgeConfig, ServicePromptActionResponseData, SummaryExperimentalConfig, VisualAnalysisConfig, WaitForPageActionResponseData, WindowIDData, WindowIDDataResponse, WindowInfo, WindowResponse } from '@airtop/core/resources/shared.js';
7
10
  import * as _airtop_core_resources_shared_mjs from '@airtop/core/resources/shared.mjs';
8
11
  import { AutomationUpdateDescriptionParams } from '@airtop/core/resources/automations.js';
9
- import { SessionListParams, ProfileOutput, FileListParams, FilesResponse, FileCreateFileParams, WindowIDData, EnvelopeDefaultMeta as EnvelopeDefaultMeta$1, Issue as Issue$1, WindowInfo, WindowGetParams, AIPromptResponse, ScrapeResponse } from '@airtop/core/resources/index.js';
10
- import * as _airtop_core_resources_shared_js from '@airtop/core/resources/shared.js';
11
- import { SessionConfigV1, GetFileResponse, ListAutomationsOutput, AutomationData, ExternalSessionWithConnectionInfo, EnvelopeDefaultMeta, Issue, AIPromptResponse as AIPromptResponse$1, WindowIDDataResponse, OperationOutcomeResponse } from '@airtop/core/resources/shared.js';
12
- export { AIResponseEnvelope, AirtopPagination, ExternalSessionAIResponseMetadata, ExternalSessionWithConnectionInfo, Issue, OperationOutcomeResponse, WindowIDDataResponse } from '@airtop/core/resources/shared.js';
12
+ import { SessionListParams, ProfileOutput, FileListParams, FileCreateFileParams, WindowIDData, EnvelopeDefaultMeta as EnvelopeDefaultMeta$1, Issue as Issue$1, WindowInfo, WindowGetParams, AIPromptResponse, ScrapeResponse } from '@airtop/core/resources/index.js';
13
+ export { AIPromptResponse, ScrapeResponse } from '@airtop/core/resources/index.js';
13
14
  import * as _airtop_core_resources_sessions_mjs from '@airtop/core/resources/sessions.mjs';
14
- import { WindowClickParams, WindowHoverParams, WindowLoadURLParams, WindowMonitorParams, WindowScrapeParams, WindowScreenshotParams, WindowScrollParams, WindowTypeParams } from '@airtop/core/resources/windows.js';
15
+ import { WindowClickParams, WindowHoverParams, WindowLoadURLParams, WindowMonitorParams, WindowScrapeParams, WindowScreenshotParams, WindowScrollParams, WindowTypeParams, WindowExtractParams, WindowActParams, WindowLlmParams, WindowFindOneParams, WindowFindManyParams, WindowWaitForPageParams, WindowNavigateParams, WindowFillFormParams } from '@airtop/core/resources/windows.js';
16
+ export { WindowActParams, WindowClickParams, WindowExtractParams, WindowFillFormParams, WindowFindManyParams, WindowFindOneParams, WindowGetParams, WindowHoverParams, WindowLlmParams, WindowLoadURLParams, WindowMonitorParams, WindowNavigateParams, WindowPageQueryParams, WindowPaginatedExtractionParams, WindowScrapeParams, WindowScreenshotParams, WindowScrollParams, WindowTypeParams, WindowWaitForPageParams } from '@airtop/core/resources/windows.js';
17
+ export { DeepOmit } from 'deep-utility-types';
15
18
 
16
19
  /**
17
20
  * Shared configuration between Airtop classes.
@@ -36,6 +39,19 @@ interface CommonAirtopConfig {
36
39
  * Used for customizing output schema handling.
37
40
  */
38
41
  outputSchemaAdapter?: AirtopJsonSchemaAdapter;
42
+ /**
43
+ * The automation job ID to use for the request.
44
+ */
45
+ jobId?: string;
46
+ /**
47
+ * Logger instance for publishing agent events.
48
+ * Used to send event data to external systems during automation execution.
49
+ */
50
+ agentEventPublisher?: ILogLayer;
51
+ /**
52
+ * The default timeout in seconds for API requests.
53
+ */
54
+ defaultTimeoutInSeconds?: number;
39
55
  }
40
56
  /**
41
57
  * Configuration for defining the JSON schema output.
@@ -75,6 +91,15 @@ interface CommonResponse {
75
91
  warnings?: unknown;
76
92
  errors?: unknown;
77
93
  }
94
+ /**
95
+ * Custom error class that implements the Issue interface.
96
+ * Extends the native Error class to provide a more structured error handling mechanism.
97
+ */
98
+ declare class AirtopError extends Error {
99
+ issues: Issue[];
100
+ metadata?: Record<string, unknown>;
101
+ constructor(issues: Issue[], metadata?: Record<string, unknown>);
102
+ }
78
103
 
79
104
  /**
80
105
  * Base class for Airtop SDK implementation
@@ -97,11 +122,38 @@ declare class AirtopBase {
97
122
  * @internal
98
123
  **/
99
124
  protected outputJsonAdapter: AirtopJsonSchemaAdapter;
125
+ /**
126
+ * The job id for the ongoing automation
127
+ * @internal
128
+ */
129
+ protected jobId?: string;
130
+ /**
131
+ * Instance for sending agent events
132
+ * @internal
133
+ */
134
+ protected agentEventPublisher?: ILogLayer;
135
+ /**
136
+ * The default timeout in seconds for API requests.
137
+ * @internal
138
+ */
139
+ protected defaultTimeoutInSeconds: number;
100
140
  /**
101
141
  * Creates a new instance of AirtopBase
102
142
  * @param config - Configuration options for the SDK
103
143
  */
104
144
  constructor(config: CommonAirtopConfig);
145
+ /**
146
+ * Sets the publisher for sending agent events. Internal use only.
147
+ * @internal
148
+ */
149
+ _setAgentEventPublisher(logger: ILogLayer): void;
150
+ /**
151
+ * Sends a payload to the agent with the specified event name.
152
+ * @param eventName The name of the event
153
+ * @param payload The payload to send to the agent
154
+ * @internal
155
+ */
156
+ protected _sendAgentPayload(eventName: string, payload: any): void;
105
157
  /**
106
158
  * Returns the API key used by the SDK
107
159
  * @returns API key string
@@ -180,6 +232,20 @@ interface AirtopConstructorConfig {
180
232
  * Used to customize how response data is structured.
181
233
  */
182
234
  outputSchemaAdapter?: AirtopJsonSchemaAdapter;
235
+ /**
236
+ * The job ID to use for the ongoing automation.
237
+ */
238
+ jobId?: string;
239
+ /**
240
+ * Logger instance for publishing agent events.
241
+ * Used to send event data to external systems during automation execution.
242
+ */
243
+ agentEventPublisher?: ILogLayer;
244
+ /**
245
+ * The default timeout in seconds for API requests.
246
+ * Defaults to 5 minutes if not specified.
247
+ */
248
+ defaultTimeoutInSeconds?: number;
183
249
  }
184
250
  /**
185
251
  * Configuration options for creating a new session.
@@ -206,8 +272,6 @@ interface GetFilesConfig extends Omit<FileListParams, "sessionIds"> {
206
272
  }
207
273
  interface AirtopFileResponse extends GetFileResponse {
208
274
  }
209
- interface AirtopFilesListResponse extends FilesResponse {
210
- }
211
275
  interface AirtopAutomationUpdateDescriptionConfig extends AutomationUpdateDescriptionParams {
212
276
  }
213
277
  interface AirtopAutomationData extends AutomationData {
@@ -216,6 +280,10 @@ interface AirtopAutomationListResponse extends ListAutomationsOutput {
216
280
  }
217
281
  interface AirtopProfile extends ProfileOutput {
218
282
  }
283
+ interface AirtopFileListParams extends FileListParams {
284
+ }
285
+ interface AirtopFilesResponse extends FilesResponse {
286
+ }
219
287
 
220
288
  /**
221
289
  * The session data containing connection and state information.
@@ -273,6 +341,11 @@ interface AirtopSessionResponse {
273
341
  */
274
342
  interface CreateFileConfig extends Omit<FileCreateFileParams, "sessionId" | "fileName"> {
275
343
  }
344
+ /**
345
+ * Response from a session service call.
346
+ */
347
+ interface SessionServiceResponse extends ServicePromptActionResponseEnvelope {
348
+ }
276
349
 
277
350
  /**
278
351
  * Common data found in a window API call response.
@@ -380,7 +453,7 @@ interface WindowLoadUrlConfig extends Omit<WindowLoadURLParams, "sessionId" | "u
380
453
  * Configuration parameters for monitoring window events.
381
454
  * Excludes session ID which is provided by the parent session.
382
455
  */
383
- interface WindowMonitorConfig extends Omit<WindowMonitorParams, "sessionId"> {
456
+ interface WindowMonitorConfig extends Omit<WindowMonitorParams, "sessionId" | "condition"> {
384
457
  }
385
458
  /**
386
459
  * Configuration parameters for performing a natural language query on page content.
@@ -420,6 +493,167 @@ interface WindowPromptResponse extends AIPromptResponse {
420
493
  */
421
494
  interface WindowScrapeResponse extends ScrapeResponse {
422
495
  }
496
+ /**
497
+ * Configuration parameters for extracting content from a window.
498
+ */
499
+ interface WindowExtractConfig extends Omit<WindowExtractParams, "sessionId" | "prompt" | "jobId"> {
500
+ }
501
+ /**
502
+ * Extract window response.
503
+ */
504
+ interface WindowExtractResponse extends ExtractActionResponseEnvelope {
505
+ }
506
+ /**
507
+ * Configuration parameters for acting on content in a window.
508
+ */
509
+ interface WindowActConfig extends Omit<WindowActParams, "sessionId" | "prompt" | "jobId"> {
510
+ }
511
+ /**
512
+ * Act window response.
513
+ */
514
+ interface WindowActResponse extends ActActionResponseEnvelope {
515
+ }
516
+ /**
517
+ * Configuration parameters for executing an LLM call in a window.
518
+ */
519
+ interface WindowLlmConfig extends Omit<WindowLlmParams, "sessionId" | "jobId" | "prompt" | "includeWebContext" | "outputSchema"> {
520
+ outputSchema?: string | object;
521
+ }
522
+ /**
523
+ * LLM window response.
524
+ */
525
+ interface WindowLlmResponse extends LlmActionResponseEnvelope {
526
+ }
527
+ /**
528
+ * Configuration parameters for finding one element in a window.
529
+ */
530
+ interface WindowFindOneConfig extends Omit<WindowFindOneParams, "sessionId" | "prompt" | "jobId"> {
531
+ }
532
+ /**
533
+ * Find one window response.
534
+ */
535
+ interface WindowFindOneResponse extends FindOneActionResponseEnvelope {
536
+ }
537
+ /**
538
+ * Configuration parameters for finding multiple elements in a window.
539
+ */
540
+ interface WindowFindManyConfig extends Omit<WindowFindManyParams, "sessionId" | "prompt" | "jobId"> {
541
+ }
542
+ /**
543
+ * Find many window response.
544
+ */
545
+ interface WindowFindManyResponse extends FindManyActionResponseEnvelope {
546
+ }
547
+ /**
548
+ * Configuration parameters for waiting for a page to load in a window.
549
+ */
550
+ interface WindowWaitForPageConfig extends Omit<WindowWaitForPageParams, "sessionId"> {
551
+ }
552
+ /**
553
+ * Wait for page window response.
554
+ */
555
+ interface WindowWaitForPageResponse extends WaitForPageActionResponseEnvelope {
556
+ }
557
+ /**
558
+ * Configuration parameters for navigating browser history in a window.
559
+ */
560
+ interface WindowNavigateConfig extends Omit<WindowNavigateParams, "sessionId"> {
561
+ }
562
+ /**
563
+ * Navigate window response.
564
+ */
565
+ interface WindowNavigateResponse extends NavigateActionResponseEnvelope {
566
+ }
567
+ /**
568
+ * The direction to navigate in browser history.
569
+ */
570
+ declare enum WindowNavigateDirection {
571
+ BACK = "backward",
572
+ FORWARD = "forward"
573
+ }
574
+ /**
575
+ * Data object representing a node returned from the Airtop API.
576
+ */
577
+ interface AirtopNodeApiResponseData extends NodeHandle {
578
+ }
579
+ /**
580
+ * Configuration parameters for filling a form in a window.
581
+ */
582
+ interface WindowFillFormConfig extends Omit<WindowFillFormParams, "sessionId" | "parameters"> {
583
+ }
584
+
585
+ /**
586
+ * Represents a node in the DOM
587
+ */
588
+ declare class AirtopNode {
589
+ /**
590
+ * The window client
591
+ */
592
+ protected windowClient: AirtopWindowClient;
593
+ /**
594
+ * The node handle id to use for all requests
595
+ */
596
+ nodeHandleId: string;
597
+ /**
598
+ * The xpath selector of the node
599
+ */
600
+ selector: string;
601
+ /**
602
+ * Constructor
603
+ * @param client - The window client
604
+ * @param nodeData - The node data to use for all requests
605
+ */
606
+ constructor(client: AirtopWindowClient, nodeData: AirtopNodeApiResponseData);
607
+ /**
608
+ * Extract content from the node
609
+ * @param prompt - The prompt to use for the extraction
610
+ * @param config - The configuration to use for the extraction
611
+ * @param requestOptions - The request options to use for the extraction
612
+ */
613
+ extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowExtractResponse>;
614
+ /**
615
+ * Act on the node
616
+ * @param prompt - The prompt to use for the action
617
+ * @param config - The configuration to use for the action
618
+ * @param requestOptions - The request options to use for the action
619
+ */
620
+ act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowActResponse>;
621
+ /**
622
+ * Execute an LLM call on the node
623
+ * @param prompt - The prompt to use for the LLM call
624
+ * @param config - The configuration to use for the LLM call
625
+ * @param requestOptions - The request options to use for the LLM call
626
+ */
627
+ llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
628
+ /**
629
+ * Find one element in the node
630
+ * @param prompt - The prompt to use for the find one
631
+ * @param config - The configuration to use for the find one
632
+ * @param requestOptions - The request options to use for the find one
633
+ */
634
+ findOne(prompt: string, config?: WindowFindOneConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode>;
635
+ /**
636
+ * Find one element in the node
637
+ * @param prompt - The prompt to use for the find one
638
+ * @param config - The configuration to use for the find one
639
+ * @param requestOptions - The request options to use for the find one
640
+ */
641
+ findOneOptional(prompt: string, config?: WindowFindOneConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode>;
642
+ /**
643
+ * Find many elements in the node
644
+ * @param prompt - The prompt to use for the find many
645
+ * @param config - The configuration to use for the find many
646
+ * @param requestOptions - The request options to use for the find many
647
+ */
648
+ findMany(prompt: string, config?: WindowFindManyConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
649
+ /**
650
+ * Find many elements in the node
651
+ * @param prompt - The prompt to use for the find many
652
+ * @param config - The configuration to use for the find many
653
+ * @param requestOptions - The request options to use for the find many
654
+ */
655
+ findManyOptional(prompt: string, config?: WindowFindManyConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
656
+ }
423
657
 
424
658
  /**
425
659
  * Response object for a screenshot operation.
@@ -465,7 +699,7 @@ declare class AirtopWindowScreenshot {
465
699
  };
466
700
  }
467
701
 
468
- /**
702
+ /**, waitForRequestCompletion
469
703
  * Client for making window-specific requests to the Airtop API.
470
704
  */
471
705
  declare class AirtopWindowClient extends AirtopBase {
@@ -582,7 +816,19 @@ declare class AirtopWindowClient extends AirtopBase {
582
816
  * @param requestOptions - Request options
583
817
  * @returns Promise resolving when the text has been typed
584
818
  */
585
- type(text: string, config?: WindowTypeConfig, requestOptions?: AirtopRequestOptions): Promise<_airtop_core_resources_shared_mjs.AIPromptResponse>;
819
+ type(text: string, config?: WindowTypeConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
820
+ extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowExtractResponse>;
821
+ act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowActResponse>;
822
+ llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
823
+ private findOnePrivate;
824
+ findOne(prompt: string, config?: Omit<WindowFindOneConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode>;
825
+ findOneOptional(prompt: string, config?: Omit<WindowFindOneConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode | null>;
826
+ private findManyPrivate;
827
+ findMany(prompt: string, config?: Omit<WindowFindManyConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
828
+ findManyOptional(prompt: string, config?: Omit<WindowFindManyConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
829
+ waitForPage(config?: WindowWaitForPageConfig, requestOptions?: AirtopRequestOptions): Promise<WindowWaitForPageResponse>;
830
+ navigate(direction: WindowNavigateDirection, config?: WindowNavigateConfig, requestOptions?: AirtopRequestOptions): Promise<WindowNavigateResponse>;
831
+ fillForm(formData: string | object, config?: WindowFillFormConfig, requestOptions?: AirtopRequestOptions): Promise<AIPromptResponse>;
586
832
  }
587
833
 
588
834
  /**
@@ -644,6 +890,7 @@ declare class AirtopSessionClient extends AirtopBase {
644
890
  * Returns the browser session ID.
645
891
  */
646
892
  getSessionId(): string;
893
+ listWindows(requestOptions?: AirtopRequestOptions): Promise<_airtop_core_resources_shared_mjs.WindowsResponse>;
647
894
  /**
648
895
  * Gets the state of the session using the attached session id.
649
896
  * @param requestOptions - Request options
@@ -686,6 +933,14 @@ declare class AirtopSessionClient extends AirtopBase {
686
933
  * @param requestOptions - Request options
687
934
  */
688
935
  createFile(fileName: string, config?: CreateFileConfig, requestOptions?: AirtopRequestOptions): _airtop_core.APIPromise<_airtop_core_resources_shared_mjs.CreateFileResponse>;
936
+ llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
937
+ /**
938
+ * Calls the service endpoint.
939
+ * @param prompt - The prompt to send to the service, describing the actions to take
940
+ * @param service - The service to call, if not provided, the service will be inferred from the prompt
941
+ * @param requestOptions - Request options
942
+ */
943
+ service(prompt: string, service?: string, requestOptions?: AirtopRequestOptions): Promise<SessionServiceResponse>;
689
944
  }
690
945
 
691
946
  /**
@@ -798,20 +1053,18 @@ declare class AirtopClient extends AirtopBase {
798
1053
  * @param requestOptions
799
1054
  */
800
1055
  getFile(fileId: string, requestOptions?: AirtopRequestOptions): Promise<AirtopFileResponse>;
801
- /**
802
- * Lists files filtered by session IDs.
803
- * @param sessionIds - Array of session IDs to retrieve files for
804
- * @param config - Configuration options for the request
805
- * @param requestOptions - Request options
806
- * @returns Object containing pagination info and array of AirtopSession instances
807
- */
808
- listFiles(sessionIds: string[], config?: GetFilesConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopFilesListResponse>;
809
1056
  /**
810
1057
  * Removes a file by ID.
811
1058
  * @param fileId - ID of the file to remove
812
1059
  * @param requestOptions - Request options
813
1060
  */
814
1061
  removeFile(fileId: string, requestOptions?: AirtopRequestOptions): Promise<void>;
1062
+ /**
1063
+ * List files
1064
+ * @param query
1065
+ * @param requestOptions
1066
+ */
1067
+ listFiles(query: AirtopFileListParams, requestOptions?: AirtopRequestOptions): Promise<AirtopFilesResponse>;
815
1068
  /**
816
1069
  * List all automations
817
1070
  * @param requestOptions - Request options
@@ -831,6 +1084,178 @@ declare class AirtopClient extends AirtopBase {
831
1084
  removeAutomation(automationID: string, requestOptions?: AirtopRequestOptions): _airtop_core.APIPromise<unknown>;
832
1085
  }
833
1086
 
1087
+ /**
1088
+ * Provides utility methods for creating mock instances of Airtop classes.
1089
+ * @hideconstructor
1090
+ */
1091
+ declare class AirtopMocks {
1092
+ /**
1093
+ * Creates an AirtopBase instance (the class used as the base for other Airtop classes) with a mock client and logger.
1094
+ */
1095
+ static getAirtopBaseMock(config?: Partial<CommonAirtopConfig>): AirtopBase;
1096
+ /**
1097
+ * Creates an Airtop instance with a mock client and data.
1098
+ */
1099
+ static getAirtopClientMock(config?: Partial<AirtopConstructorConfig>): AirtopClient;
1100
+ /**
1101
+ * Creates an AirtopSession instance with a mock client and data.
1102
+ */
1103
+ static getAirtopSessionMock(responseData?: Partial<AirtopSessionResponse>): AirtopSession;
1104
+ /**
1105
+ * Creates an AirtopWindow instance with a mock client and data.
1106
+ */
1107
+ static getAirtopWindowMock({ sessionId, windowData, }?: {
1108
+ sessionId?: string;
1109
+ windowData?: AirtopWindowGetInfoResponse;
1110
+ }): AirtopWindow<AirtopWindowGetInfoResponse>;
1111
+ }
1112
+
1113
+ interface AirtopAgentCreateAgentParams extends Airtop.AgentCreateAgentParams {
1114
+ }
1115
+ interface AirtopAgentGetAgentsParams extends Airtop.AgentGetAgentsParams {
1116
+ }
1117
+ interface AirtopAgentUpdateAgentParams extends Airtop.AgentUpdateAgentParams {
1118
+ }
1119
+ interface AirtopAgentDeleteAgentsParams extends Airtop.AgentDeleteAgentsParams {
1120
+ }
1121
+ interface AirtopAgentDuplicateAgentParams extends Airtop.AgentDuplicateAgentParams {
1122
+ }
1123
+ interface AirtopAgentCreateVersionParams extends Airtop.AgentCreateVersionParams {
1124
+ }
1125
+ interface AirtopAgentGetVersionsParams extends Airtop.AgentGetVersionsParams {
1126
+ }
1127
+ interface AirtopAgentCreateInvocationParams extends Airtop.AgentCreateInvocationParams {
1128
+ }
1129
+ interface AirtopAgentGetInvocationsParams extends Airtop.AgentGetInvocationsParams {
1130
+ }
1131
+ interface AirtopAgentCancelInvocationParams extends Airtop.AgentCancelInvocationParams {
1132
+ }
1133
+ interface AirtopCreateAgentResponse extends Airtop.CreateAgentResponse {
1134
+ }
1135
+ interface AirtopGetAgentResponse extends Airtop.GetAgentResponse {
1136
+ }
1137
+ interface AirtopGetAgentsResponse extends Airtop.GetAgentsResponse {
1138
+ }
1139
+ interface AirtopUpdateAgentResponse extends Airtop.UpdateAgentResponse {
1140
+ }
1141
+ interface AirtopDeleteAgentsResponse extends Airtop.DeleteResponse {
1142
+ }
1143
+ interface AirtopDuplicateAgentResponse extends Airtop.DuplicateAgentResponse {
1144
+ }
1145
+ interface AirtopCreateAgentVersionResponse extends Airtop.CreateAgentVersionResponse {
1146
+ }
1147
+ interface AirtopGetAgentVersionsResponse extends Airtop.GetAgentVersionsResponse {
1148
+ }
1149
+ interface AirtopCreateAgentInvocationResponse extends Airtop.CreateAgentInvocationResponse {
1150
+ }
1151
+ interface AirtopGetAgentInvocationsResponse extends Airtop.GetAgentInvocationsResponse {
1152
+ }
1153
+ interface AirtopAgentResponse extends Airtop.GetAgentResponse {
1154
+ }
1155
+
1156
+ /**
1157
+ * Client for making Agent-specific requests to the Airtop API.
1158
+ */
1159
+ declare class AirtopAgentClient extends AirtopBase {
1160
+ /**
1161
+ * Creates a new instance of the Airtop SDK.
1162
+ * @param config - Configuration options for the Airtop SDK
1163
+ */
1164
+ constructor(config: AirtopConstructorConfig);
1165
+ /**
1166
+ * Creates a new agent.
1167
+ * @param params - Parameters for creating the agent. Corresponds to `AirtopAgentCreateAgentParams`.
1168
+ * @param requestOptions - Request options.
1169
+ * @returns The created agent data, `AirtopCreateAgentResponse`.
1170
+ */
1171
+ createAgent(params: AirtopAgentCreateAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopCreateAgentResponse>;
1172
+ /**
1173
+ * Retrieves a specific agent by its ID.
1174
+ * @param agentId - The ID of the agent to retrieve.
1175
+ * @param requestOptions - Request options.
1176
+ * @returns The agent data, `AirtopGetAgentResponse`.
1177
+ */
1178
+ getAgent(agentId: string, // Renamed to avoid conflict with class member
1179
+ requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentResponse>;
1180
+ /**
1181
+ * Lists agents.
1182
+ * @param params - Optional parameters for listing agents (e.g., pagination). Corresponds to `AirtopAgentGetAgentsParams`.
1183
+ * @param requestOptions - Request options.
1184
+ * @returns A list of agents, `AirtopGetAgentsResponse`.
1185
+ */
1186
+ listAgents(params?: AirtopAgentGetAgentsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentsResponse>;
1187
+ /**
1188
+ * Updates an existing agent.
1189
+ * @param agentId - The ID of the agent to update.
1190
+ * @param params - The new data for the agent. Corresponds to `AirtopAgentUpdateAgentParams`.
1191
+ * @param requestOptions - Request options.
1192
+ * @returns The updated agent data, `AirtopUpdateAgentResponse`.
1193
+ */
1194
+ updateAgent(agentId: string, // Renamed to avoid conflict with class member
1195
+ params: AirtopAgentUpdateAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopUpdateAgentResponse>;
1196
+ /**
1197
+ * Deletes one or more agents.
1198
+ * @param params - Parameters for deleting agents. Corresponds to `AirtopAgentDeleteAgentsParams`.
1199
+ * @param requestOptions - Request options.
1200
+ * @returns A response confirming the deletion, `AirtopDeleteAgentsResponse`.
1201
+ */
1202
+ deleteAgents(params: AirtopAgentDeleteAgentsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopDeleteAgentsResponse>;
1203
+ /**
1204
+ * Duplicates an agent.
1205
+ * @param agentId - The ID of the agent to duplicate.
1206
+ * @param params - Parameters for duplicating the agent (e.g., new name). Corresponds to `AirtopAgentDuplicateAgentParams`.
1207
+ * @param requestOptions - Request options.
1208
+ * @returns The duplicated agent data, `AirtopDuplicateAgentResponse`.
1209
+ */
1210
+ duplicateAgent(agentId: string, // Renamed to avoid conflict with class member
1211
+ params: AirtopAgentDuplicateAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopDuplicateAgentResponse>;
1212
+ /**
1213
+ * Creates a new version for an agent.
1214
+ * @param agentId - The ID of the agent for which to create a version.
1215
+ * @param params - Parameters for creating the agent version. Corresponds to `AirtopAgentCreateVersionParams`.
1216
+ * @param requestOptions - Request options.
1217
+ * @returns The created agent version data, `AirtopCreateAgentVersionResponse`.
1218
+ */
1219
+ createAgentVersion(agentId: string, // Renamed
1220
+ params: AirtopAgentCreateVersionParams, requestOptions?: AirtopRequestOptions): Promise<AirtopCreateAgentVersionResponse>;
1221
+ /**
1222
+ * Lists versions of an agent.
1223
+ * @param agentId - The ID of the agent whose versions to list.
1224
+ * @param params - Optional parameters for listing agent versions. Corresponds to `AirtopAgentGetVersionsParams`.
1225
+ * @param requestOptions - Request options.
1226
+ * @returns A list of agent versions, `AirtopGetAgentVersionsResponse`.
1227
+ */
1228
+ listAgentVersions(agentId: string, // Renamed
1229
+ params?: AirtopAgentGetVersionsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentVersionsResponse>;
1230
+ /**
1231
+ * Creates an invocation for an agent.
1232
+ * @param agentId - The ID of the agent for which to create an invocation.
1233
+ * @param params - Parameters for creating the agent invocation. Corresponds to `AirtopAgentCreateInvocationParams`.
1234
+ * @param requestOptions - Request options.
1235
+ * @returns The created agent invocation data, `AirtopCreateAgentInvocationResponse`.
1236
+ */
1237
+ createAgentInvocation(agentId: string, // Renamed
1238
+ params: AirtopAgentCreateInvocationParams, requestOptions?: AirtopRequestOptions): Promise<AirtopCreateAgentInvocationResponse>;
1239
+ /**
1240
+ * Lists invocations of an agent.
1241
+ * @param agentIds - The ID of the agent whose invocations to list.
1242
+ * @param params - Optional parameters for listing agent invocations. Corresponds to `AirtopAgentGetInvocationsParams`.
1243
+ * @param requestOptions - Request options.
1244
+ * @returns A list of agent invocations, `AirtopGetAgentInvocationsResponse`.
1245
+ */
1246
+ listAgentInvocations(agentIds: string, // Renamed
1247
+ params?: AirtopAgentGetInvocationsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentInvocationsResponse>;
1248
+ /**
1249
+ * Cancels a specific invocation of an agent.
1250
+ * @param agentId - The ID of the agent.
1251
+ * @param invocationId - The ID of the invocation to cancel.
1252
+ * @param paramsBody - Optional body parameters for cancelling the invocation. Corresponds to `AirtopAgentCancelInvocationParams`.
1253
+ * @param requestOptions - Request options.
1254
+ * @returns A promise that resolves when the operation is complete.
1255
+ */
1256
+ cancelAgentInvocation(agentId: string, invocationId: string, paramsBody?: AirtopAgentCancelInvocationParams, requestOptions?: AirtopRequestOptions): Promise<void>;
1257
+ }
1258
+
834
1259
  /**
835
1260
  * Enumeration of available plugin augmentation types.
836
1261
  * Determines which part of the SDK a plugin can extend.
@@ -999,30 +1424,4 @@ interface AirtopPluginRegistration {
999
1424
  */
1000
1425
  declare function registerAirtopPlugin(plugin: AirtopPluginRegistration): void;
1001
1426
 
1002
- /**
1003
- * Provides utility methods for creating mock instances of Airtop classes.
1004
- * @hideconstructor
1005
- */
1006
- declare class AirtopMocks {
1007
- /**
1008
- * Creates an AirtopBase instance (the class used as the base for other Airtop classes) with a mock client and logger.
1009
- */
1010
- static getAirtopBaseMock(config?: Partial<CommonAirtopConfig>): AirtopBase;
1011
- /**
1012
- * Creates an Airtop instance with a mock client and data.
1013
- */
1014
- static getAirtopClientMock(config?: Partial<AirtopConstructorConfig>): AirtopClient;
1015
- /**
1016
- * Creates an AirtopSession instance with a mock client and data.
1017
- */
1018
- static getAirtopSessionMock(responseData?: Partial<AirtopSessionResponse>): AirtopSession;
1019
- /**
1020
- * Creates an AirtopWindow instance with a mock client and data.
1021
- */
1022
- static getAirtopWindowMock({ sessionId, windowData, }?: {
1023
- sessionId?: string;
1024
- windowData?: AirtopWindowGetInfoResponse;
1025
- }): AirtopWindow<AirtopWindowGetInfoResponse>;
1026
- }
1027
-
1028
- export { type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopFileResponse, type AirtopFilesListResponse, AirtopMocks, 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 WindowClickConfig, type WindowCreateData, type WindowError, type WindowGetConfig, type WindowHoverConfig, type WindowInfoData, type WindowLoadUrlConfig, type WindowMetadata, type WindowMonitorConfig, type WindowPageQueryConfig, type WindowPaginatedExtractionConfig, type WindowPromptResponse, type WindowScrapeConfig, type WindowScrapeResponse, type WindowScreenshotConfig, type WindowScrollConfig, type WindowTypeConfig, type WindowWarning, registerAirtopPlugin };
1427
+ 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 SessionServiceResponse, type SessionWarning, type WindowActConfig, type WindowActResponse, type WindowClickConfig, type WindowCreateData, type WindowError, type WindowExtractConfig, type WindowExtractResponse, type WindowFillFormConfig, type WindowFindManyConfig, type WindowFindManyResponse, type WindowFindOneConfig, type WindowFindOneResponse, type WindowGetConfig, type WindowHoverConfig, type WindowInfoData, type WindowLlmConfig, type WindowLlmResponse, type WindowLoadUrlConfig, type WindowMetadata, type WindowMonitorConfig, type WindowNavigateConfig, WindowNavigateDirection, type WindowNavigateResponse, type WindowPageQueryConfig, type WindowPaginatedExtractionConfig, type WindowPromptResponse, type WindowScrapeConfig, type WindowScrapeResponse, type WindowScreenshotConfig, type WindowScrollConfig, type WindowTypeConfig, type WindowWaitForPageConfig, type WindowWaitForPageResponse, type WindowWarning, registerAirtopPlugin };