@airtop/sdk 1.0.0-alpha2.17 → 1.0.0-alpha2.19
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.cjs +242 -134
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -8
- package/dist/index.d.ts +47 -8
- package/dist/index.js +232 -124
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
@@ -5,13 +5,16 @@ export { AirtopJsonSchemaAdapter } from '@airtop/json-schema-adapter';
|
|
5
5
|
import { ILogLayer } from 'loglayer';
|
6
6
|
export { ILogLayer } from 'loglayer';
|
7
7
|
import * as _airtop_core_resources_shared_js from '@airtop/core/resources/shared.js';
|
8
|
-
import { Issue, SessionConfigV1, GetFileResponse, FilesResponse, ListAutomationsOutput, AutomationData, 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, AirtopPagination, ExternalSessionAIResponseMetadata, ExternalSessionWithConnectionInfo, Issue, OperationOutcomeResponse, WindowIDDataResponse } 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';
|
10
10
|
import * as _airtop_core_resources_shared_mjs from '@airtop/core/resources/shared.mjs';
|
11
11
|
import { AutomationUpdateDescriptionParams } from '@airtop/core/resources/automations.js';
|
12
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, WindowExtractParams, WindowActParams, WindowLlmParams, WindowFindOneParams, WindowFindManyParams, WindowWaitForPageParams, WindowNavigateParams } 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.
|
@@ -45,6 +48,10 @@ interface CommonAirtopConfig {
|
|
45
48
|
* Used to send event data to external systems during automation execution.
|
46
49
|
*/
|
47
50
|
agentEventPublisher?: ILogLayer;
|
51
|
+
/**
|
52
|
+
* The default timeout in seconds for API requests.
|
53
|
+
*/
|
54
|
+
defaultTimeoutInSeconds?: number;
|
48
55
|
}
|
49
56
|
/**
|
50
57
|
* Configuration for defining the JSON schema output.
|
@@ -90,7 +97,8 @@ interface CommonResponse {
|
|
90
97
|
*/
|
91
98
|
declare class AirtopError extends Error {
|
92
99
|
issues: Issue[];
|
93
|
-
|
100
|
+
metadata?: Record<string, unknown>;
|
101
|
+
constructor(issues: Issue[], metadata?: Record<string, unknown>);
|
94
102
|
}
|
95
103
|
|
96
104
|
/**
|
@@ -124,6 +132,11 @@ declare class AirtopBase {
|
|
124
132
|
* @internal
|
125
133
|
*/
|
126
134
|
protected agentEventPublisher?: ILogLayer;
|
135
|
+
/**
|
136
|
+
* The default timeout in seconds for API requests.
|
137
|
+
* @internal
|
138
|
+
*/
|
139
|
+
protected defaultTimeoutInSeconds: number;
|
127
140
|
/**
|
128
141
|
* Creates a new instance of AirtopBase
|
129
142
|
* @param config - Configuration options for the SDK
|
@@ -228,6 +241,11 @@ interface AirtopConstructorConfig {
|
|
228
241
|
* Used to send event data to external systems during automation execution.
|
229
242
|
*/
|
230
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;
|
231
249
|
}
|
232
250
|
/**
|
233
251
|
* Configuration options for creating a new session.
|
@@ -323,6 +341,11 @@ interface AirtopSessionResponse {
|
|
323
341
|
*/
|
324
342
|
interface CreateFileConfig extends Omit<FileCreateFileParams, "sessionId" | "fileName"> {
|
325
343
|
}
|
344
|
+
/**
|
345
|
+
* Response from a session service call.
|
346
|
+
*/
|
347
|
+
interface SessionServiceResponse extends ServicePromptActionResponseEnvelope {
|
348
|
+
}
|
326
349
|
|
327
350
|
/**
|
328
351
|
* Common data found in a window API call response.
|
@@ -430,7 +453,7 @@ interface WindowLoadUrlConfig extends Omit<WindowLoadURLParams, "sessionId" | "u
|
|
430
453
|
* Configuration parameters for monitoring window events.
|
431
454
|
* Excludes session ID which is provided by the parent session.
|
432
455
|
*/
|
433
|
-
interface WindowMonitorConfig extends Omit<WindowMonitorParams, "sessionId"> {
|
456
|
+
interface WindowMonitorConfig extends Omit<WindowMonitorParams, "sessionId" | "condition"> {
|
434
457
|
}
|
435
458
|
/**
|
436
459
|
* Configuration parameters for performing a natural language query on page content.
|
@@ -493,7 +516,8 @@ interface WindowActResponse extends ActActionResponseEnvelope {
|
|
493
516
|
/**
|
494
517
|
* Configuration parameters for executing an LLM call in a window.
|
495
518
|
*/
|
496
|
-
interface WindowLlmConfig extends Omit<WindowLlmParams, "sessionId" | "prompt"> {
|
519
|
+
interface WindowLlmConfig extends Omit<WindowLlmParams, "sessionId" | "jobId" | "prompt" | "includeWebContext" | "outputSchema"> {
|
520
|
+
outputSchema?: string | object;
|
497
521
|
}
|
498
522
|
/**
|
499
523
|
* LLM window response.
|
@@ -552,6 +576,11 @@ declare enum WindowNavigateDirection {
|
|
552
576
|
*/
|
553
577
|
interface AirtopNodeApiResponseData extends NodeHandle {
|
554
578
|
}
|
579
|
+
/**
|
580
|
+
* Configuration parameters for filling a form in a window.
|
581
|
+
*/
|
582
|
+
interface WindowFillFormConfig extends Omit<WindowFillFormParams, "sessionId" | "parameters"> {
|
583
|
+
}
|
555
584
|
|
556
585
|
/**
|
557
586
|
* Represents a node in the DOM
|
@@ -787,7 +816,7 @@ declare class AirtopWindowClient extends AirtopBase {
|
|
787
816
|
* @param requestOptions - Request options
|
788
817
|
* @returns Promise resolving when the text has been typed
|
789
818
|
*/
|
790
|
-
type(text: string, config?: WindowTypeConfig, requestOptions?: AirtopRequestOptions): Promise<
|
819
|
+
type(text: string, config?: WindowTypeConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
791
820
|
extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowExtractResponse>;
|
792
821
|
act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowActResponse>;
|
793
822
|
llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
|
@@ -799,6 +828,7 @@ declare class AirtopWindowClient extends AirtopBase {
|
|
799
828
|
findManyOptional(prompt: string, config?: Omit<WindowFindManyConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
|
800
829
|
waitForPage(config?: WindowWaitForPageConfig, requestOptions?: AirtopRequestOptions): Promise<WindowWaitForPageResponse>;
|
801
830
|
navigate(direction: WindowNavigateDirection, config?: WindowNavigateConfig, requestOptions?: AirtopRequestOptions): Promise<WindowNavigateResponse>;
|
831
|
+
fillForm(formData: string | object, config?: WindowFillFormConfig, requestOptions?: AirtopRequestOptions): Promise<AIPromptResponse>;
|
802
832
|
}
|
803
833
|
|
804
834
|
/**
|
@@ -860,6 +890,7 @@ declare class AirtopSessionClient extends AirtopBase {
|
|
860
890
|
* Returns the browser session ID.
|
861
891
|
*/
|
862
892
|
getSessionId(): string;
|
893
|
+
listWindows(requestOptions?: AirtopRequestOptions): Promise<_airtop_core_resources_shared_mjs.WindowsResponse>;
|
863
894
|
/**
|
864
895
|
* Gets the state of the session using the attached session id.
|
865
896
|
* @param requestOptions - Request options
|
@@ -902,6 +933,14 @@ declare class AirtopSessionClient extends AirtopBase {
|
|
902
933
|
* @param requestOptions - Request options
|
903
934
|
*/
|
904
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>;
|
905
944
|
}
|
906
945
|
|
907
946
|
/**
|
@@ -1385,4 +1424,4 @@ declare class AirtopMocks {
|
|
1385
1424
|
}): AirtopWindow<AirtopWindowGetInfoResponse>;
|
1386
1425
|
}
|
1387
1426
|
|
1388
|
-
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 WindowActResponse, type WindowClickConfig, type WindowCreateData, type WindowError, type WindowExtractConfig, type WindowExtractResponse, 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 };
|
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 };
|
package/dist/index.d.ts
CHANGED
@@ -5,13 +5,16 @@ export { AirtopJsonSchemaAdapter } from '@airtop/json-schema-adapter';
|
|
5
5
|
import { ILogLayer } from 'loglayer';
|
6
6
|
export { ILogLayer } from 'loglayer';
|
7
7
|
import * as _airtop_core_resources_shared_js from '@airtop/core/resources/shared.js';
|
8
|
-
import { Issue, SessionConfigV1, GetFileResponse, FilesResponse, ListAutomationsOutput, AutomationData, 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, AirtopPagination, ExternalSessionAIResponseMetadata, ExternalSessionWithConnectionInfo, Issue, OperationOutcomeResponse, WindowIDDataResponse } 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';
|
10
10
|
import * as _airtop_core_resources_shared_mjs from '@airtop/core/resources/shared.mjs';
|
11
11
|
import { AutomationUpdateDescriptionParams } from '@airtop/core/resources/automations.js';
|
12
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, WindowExtractParams, WindowActParams, WindowLlmParams, WindowFindOneParams, WindowFindManyParams, WindowWaitForPageParams, WindowNavigateParams } 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.
|
@@ -45,6 +48,10 @@ interface CommonAirtopConfig {
|
|
45
48
|
* Used to send event data to external systems during automation execution.
|
46
49
|
*/
|
47
50
|
agentEventPublisher?: ILogLayer;
|
51
|
+
/**
|
52
|
+
* The default timeout in seconds for API requests.
|
53
|
+
*/
|
54
|
+
defaultTimeoutInSeconds?: number;
|
48
55
|
}
|
49
56
|
/**
|
50
57
|
* Configuration for defining the JSON schema output.
|
@@ -90,7 +97,8 @@ interface CommonResponse {
|
|
90
97
|
*/
|
91
98
|
declare class AirtopError extends Error {
|
92
99
|
issues: Issue[];
|
93
|
-
|
100
|
+
metadata?: Record<string, unknown>;
|
101
|
+
constructor(issues: Issue[], metadata?: Record<string, unknown>);
|
94
102
|
}
|
95
103
|
|
96
104
|
/**
|
@@ -124,6 +132,11 @@ declare class AirtopBase {
|
|
124
132
|
* @internal
|
125
133
|
*/
|
126
134
|
protected agentEventPublisher?: ILogLayer;
|
135
|
+
/**
|
136
|
+
* The default timeout in seconds for API requests.
|
137
|
+
* @internal
|
138
|
+
*/
|
139
|
+
protected defaultTimeoutInSeconds: number;
|
127
140
|
/**
|
128
141
|
* Creates a new instance of AirtopBase
|
129
142
|
* @param config - Configuration options for the SDK
|
@@ -228,6 +241,11 @@ interface AirtopConstructorConfig {
|
|
228
241
|
* Used to send event data to external systems during automation execution.
|
229
242
|
*/
|
230
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;
|
231
249
|
}
|
232
250
|
/**
|
233
251
|
* Configuration options for creating a new session.
|
@@ -323,6 +341,11 @@ interface AirtopSessionResponse {
|
|
323
341
|
*/
|
324
342
|
interface CreateFileConfig extends Omit<FileCreateFileParams, "sessionId" | "fileName"> {
|
325
343
|
}
|
344
|
+
/**
|
345
|
+
* Response from a session service call.
|
346
|
+
*/
|
347
|
+
interface SessionServiceResponse extends ServicePromptActionResponseEnvelope {
|
348
|
+
}
|
326
349
|
|
327
350
|
/**
|
328
351
|
* Common data found in a window API call response.
|
@@ -430,7 +453,7 @@ interface WindowLoadUrlConfig extends Omit<WindowLoadURLParams, "sessionId" | "u
|
|
430
453
|
* Configuration parameters for monitoring window events.
|
431
454
|
* Excludes session ID which is provided by the parent session.
|
432
455
|
*/
|
433
|
-
interface WindowMonitorConfig extends Omit<WindowMonitorParams, "sessionId"> {
|
456
|
+
interface WindowMonitorConfig extends Omit<WindowMonitorParams, "sessionId" | "condition"> {
|
434
457
|
}
|
435
458
|
/**
|
436
459
|
* Configuration parameters for performing a natural language query on page content.
|
@@ -493,7 +516,8 @@ interface WindowActResponse extends ActActionResponseEnvelope {
|
|
493
516
|
/**
|
494
517
|
* Configuration parameters for executing an LLM call in a window.
|
495
518
|
*/
|
496
|
-
interface WindowLlmConfig extends Omit<WindowLlmParams, "sessionId" | "prompt"> {
|
519
|
+
interface WindowLlmConfig extends Omit<WindowLlmParams, "sessionId" | "jobId" | "prompt" | "includeWebContext" | "outputSchema"> {
|
520
|
+
outputSchema?: string | object;
|
497
521
|
}
|
498
522
|
/**
|
499
523
|
* LLM window response.
|
@@ -552,6 +576,11 @@ declare enum WindowNavigateDirection {
|
|
552
576
|
*/
|
553
577
|
interface AirtopNodeApiResponseData extends NodeHandle {
|
554
578
|
}
|
579
|
+
/**
|
580
|
+
* Configuration parameters for filling a form in a window.
|
581
|
+
*/
|
582
|
+
interface WindowFillFormConfig extends Omit<WindowFillFormParams, "sessionId" | "parameters"> {
|
583
|
+
}
|
555
584
|
|
556
585
|
/**
|
557
586
|
* Represents a node in the DOM
|
@@ -787,7 +816,7 @@ declare class AirtopWindowClient extends AirtopBase {
|
|
787
816
|
* @param requestOptions - Request options
|
788
817
|
* @returns Promise resolving when the text has been typed
|
789
818
|
*/
|
790
|
-
type(text: string, config?: WindowTypeConfig, requestOptions?: AirtopRequestOptions): Promise<
|
819
|
+
type(text: string, config?: WindowTypeConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
791
820
|
extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowExtractResponse>;
|
792
821
|
act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowActResponse>;
|
793
822
|
llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
|
@@ -799,6 +828,7 @@ declare class AirtopWindowClient extends AirtopBase {
|
|
799
828
|
findManyOptional(prompt: string, config?: Omit<WindowFindManyConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
|
800
829
|
waitForPage(config?: WindowWaitForPageConfig, requestOptions?: AirtopRequestOptions): Promise<WindowWaitForPageResponse>;
|
801
830
|
navigate(direction: WindowNavigateDirection, config?: WindowNavigateConfig, requestOptions?: AirtopRequestOptions): Promise<WindowNavigateResponse>;
|
831
|
+
fillForm(formData: string | object, config?: WindowFillFormConfig, requestOptions?: AirtopRequestOptions): Promise<AIPromptResponse>;
|
802
832
|
}
|
803
833
|
|
804
834
|
/**
|
@@ -860,6 +890,7 @@ declare class AirtopSessionClient extends AirtopBase {
|
|
860
890
|
* Returns the browser session ID.
|
861
891
|
*/
|
862
892
|
getSessionId(): string;
|
893
|
+
listWindows(requestOptions?: AirtopRequestOptions): Promise<_airtop_core_resources_shared_mjs.WindowsResponse>;
|
863
894
|
/**
|
864
895
|
* Gets the state of the session using the attached session id.
|
865
896
|
* @param requestOptions - Request options
|
@@ -902,6 +933,14 @@ declare class AirtopSessionClient extends AirtopBase {
|
|
902
933
|
* @param requestOptions - Request options
|
903
934
|
*/
|
904
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>;
|
905
944
|
}
|
906
945
|
|
907
946
|
/**
|
@@ -1385,4 +1424,4 @@ declare class AirtopMocks {
|
|
1385
1424
|
}): AirtopWindow<AirtopWindowGetInfoResponse>;
|
1386
1425
|
}
|
1387
1426
|
|
1388
|
-
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 WindowActResponse, type WindowClickConfig, type WindowCreateData, type WindowError, type WindowExtractConfig, type WindowExtractResponse, 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 };
|
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 };
|