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

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