@airtop/sdk 1.0.0-alpha2.15 → 1.0.0-alpha2.17

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
@@ -5,7 +5,7 @@ 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, AIPromptResponse as AIPromptResponse$1, WindowIDDataResponse, OperationOutcomeResponse } 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
9
  export { AIResponseEnvelope, AirtopPagination, ExternalSessionAIResponseMetadata, ExternalSessionWithConnectionInfo, Issue, OperationOutcomeResponse, WindowIDDataResponse } 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';
@@ -475,36 +475,71 @@ interface WindowScrapeResponse extends ScrapeResponse {
475
475
  */
476
476
  interface WindowExtractConfig extends Omit<WindowExtractParams, "sessionId" | "prompt" | "jobId"> {
477
477
  }
478
+ /**
479
+ * Extract window response.
480
+ */
481
+ interface WindowExtractResponse extends ExtractActionResponseEnvelope {
482
+ }
478
483
  /**
479
484
  * Configuration parameters for acting on content in a window.
480
485
  */
481
486
  interface WindowActConfig extends Omit<WindowActParams, "sessionId" | "prompt" | "jobId"> {
482
487
  }
488
+ /**
489
+ * Act window response.
490
+ */
491
+ interface WindowActResponse extends ActActionResponseEnvelope {
492
+ }
483
493
  /**
484
494
  * Configuration parameters for executing an LLM call in a window.
485
495
  */
486
496
  interface WindowLlmConfig extends Omit<WindowLlmParams, "sessionId" | "prompt"> {
487
497
  }
498
+ /**
499
+ * LLM window response.
500
+ */
501
+ interface WindowLlmResponse extends LlmActionResponseEnvelope {
502
+ }
488
503
  /**
489
504
  * Configuration parameters for finding one element in a window.
490
505
  */
491
506
  interface WindowFindOneConfig extends Omit<WindowFindOneParams, "sessionId" | "prompt" | "jobId"> {
492
507
  }
508
+ /**
509
+ * Find one window response.
510
+ */
511
+ interface WindowFindOneResponse extends FindOneActionResponseEnvelope {
512
+ }
493
513
  /**
494
514
  * Configuration parameters for finding multiple elements in a window.
495
515
  */
496
516
  interface WindowFindManyConfig extends Omit<WindowFindManyParams, "sessionId" | "prompt" | "jobId"> {
497
517
  }
518
+ /**
519
+ * Find many window response.
520
+ */
521
+ interface WindowFindManyResponse extends FindManyActionResponseEnvelope {
522
+ }
498
523
  /**
499
524
  * Configuration parameters for waiting for a page to load in a window.
500
525
  */
501
526
  interface WindowWaitForPageConfig extends Omit<WindowWaitForPageParams, "sessionId"> {
502
527
  }
528
+ /**
529
+ * Wait for page window response.
530
+ */
531
+ interface WindowWaitForPageResponse extends WaitForPageActionResponseEnvelope {
532
+ }
503
533
  /**
504
534
  * Configuration parameters for navigating browser history in a window.
505
535
  */
506
536
  interface WindowNavigateConfig extends Omit<WindowNavigateParams, "sessionId"> {
507
537
  }
538
+ /**
539
+ * Navigate window response.
540
+ */
541
+ interface WindowNavigateResponse extends NavigateActionResponseEnvelope {
542
+ }
508
543
  /**
509
544
  * The direction to navigate in browser history.
510
545
  */
@@ -515,9 +550,7 @@ declare enum WindowNavigateDirection {
515
550
  /**
516
551
  * Data object representing a node returned from the Airtop API.
517
552
  */
518
- interface AirtopNodeApiResponseData {
519
- id: string;
520
- xpath: string;
553
+ interface AirtopNodeApiResponseData extends NodeHandle {
521
554
  }
522
555
 
523
556
  /**
@@ -548,21 +581,21 @@ declare class AirtopNode {
548
581
  * @param config - The configuration to use for the extraction
549
582
  * @param requestOptions - The request options to use for the extraction
550
583
  */
551
- extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
584
+ extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowExtractResponse>;
552
585
  /**
553
586
  * Act on the node
554
587
  * @param prompt - The prompt to use for the action
555
588
  * @param config - The configuration to use for the action
556
589
  * @param requestOptions - The request options to use for the action
557
590
  */
558
- act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
591
+ act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowActResponse>;
559
592
  /**
560
593
  * Execute an LLM call on the node
561
594
  * @param prompt - The prompt to use for the LLM call
562
595
  * @param config - The configuration to use for the LLM call
563
596
  * @param requestOptions - The request options to use for the LLM call
564
597
  */
565
- llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
598
+ llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
566
599
  /**
567
600
  * Find one element in the node
568
601
  * @param prompt - The prompt to use for the find one
@@ -755,17 +788,17 @@ declare class AirtopWindowClient extends AirtopBase {
755
788
  * @returns Promise resolving when the text has been typed
756
789
  */
757
790
  type(text: string, config?: WindowTypeConfig, requestOptions?: AirtopRequestOptions): Promise<_airtop_core_resources_shared_mjs.AIPromptResponse>;
758
- extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
759
- act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
760
- llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
791
+ extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowExtractResponse>;
792
+ act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowActResponse>;
793
+ llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
761
794
  private findOnePrivate;
762
795
  findOne(prompt: string, config?: Omit<WindowFindOneConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode>;
763
796
  findOneOptional(prompt: string, config?: Omit<WindowFindOneConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode | null>;
764
797
  private findManyPrivate;
765
798
  findMany(prompt: string, config?: Omit<WindowFindManyConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
766
799
  findManyOptional(prompt: string, config?: Omit<WindowFindManyConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
767
- waitForPage(config?: WindowWaitForPageConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
768
- navigate(direction: WindowNavigateDirection, config?: WindowNavigateConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
800
+ waitForPage(config?: WindowWaitForPageConfig, requestOptions?: AirtopRequestOptions): Promise<WindowWaitForPageResponse>;
801
+ navigate(direction: WindowNavigateDirection, config?: WindowNavigateConfig, requestOptions?: AirtopRequestOptions): Promise<WindowNavigateResponse>;
769
802
  }
770
803
 
771
804
  /**
@@ -1352,4 +1385,4 @@ declare class AirtopMocks {
1352
1385
  }): AirtopWindow<AirtopWindowGetInfoResponse>;
1353
1386
  }
1354
1387
 
1355
- export { type AirtopAgentCancelInvocationParams, AirtopAgentClient, type AirtopAgentCreateAgentParams, type AirtopAgentCreateInvocationParams, type AirtopAgentCreateVersionParams, type AirtopAgentDeleteAgentsParams, type AirtopAgentDuplicateAgentParams, type AirtopAgentGetAgentsParams, type AirtopAgentGetInvocationsParams, type AirtopAgentGetVersionsParams, type AirtopAgentResponse, type AirtopAgentUpdateAgentParams, type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopCreateAgentInvocationResponse, type AirtopCreateAgentResponse, type AirtopCreateAgentVersionResponse, type AirtopDeleteAgentsResponse, type AirtopDuplicateAgentResponse, AirtopError, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, type AirtopGetAgentInvocationsResponse, type AirtopGetAgentResponse, type AirtopGetAgentVersionsResponse, type AirtopGetAgentsResponse, AirtopMocks, AirtopNode, type AirtopNodeApiResponseData, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, type AirtopUpdateAgentResponse, AirtopWindow, AirtopWindowClient, type AirtopWindowClientPlugin, type AirtopWindowCreateResponse, type AirtopWindowGetInfoResponse, type AirtopWindowPlugin, AirtopWindowScreenshot, type AirtopWindowScreenshotPlugin, type AirtopWindowScreenshotResponse, type CommonAirtopConfig, type CommonResponse, type CommonWindowResponse, type CreateFileConfig, type CreateSessionConfig, type GetFilesConfig, type GetSessionsConfig, type OutputJsonSchemaConfig, type ScreenshotData, type SessionData, type SessionError, type SessionMetadata, type SessionWarning, type WindowActConfig, type WindowClickConfig, type WindowCreateData, type WindowError, type WindowExtractConfig, type WindowFindManyConfig, type WindowFindOneConfig, type WindowGetConfig, type WindowHoverConfig, type WindowInfoData, type WindowLlmConfig, type WindowLoadUrlConfig, type WindowMetadata, type WindowMonitorConfig, type WindowNavigateConfig, WindowNavigateDirection, type WindowPageQueryConfig, type WindowPaginatedExtractionConfig, type WindowPromptResponse, type WindowScrapeConfig, type WindowScrapeResponse, type WindowScreenshotConfig, type WindowScrollConfig, type WindowTypeConfig, type WindowWaitForPageConfig, type WindowWarning, registerAirtopPlugin };
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 };
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ 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, AIPromptResponse as AIPromptResponse$1, WindowIDDataResponse, OperationOutcomeResponse } 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
9
  export { AIResponseEnvelope, AirtopPagination, ExternalSessionAIResponseMetadata, ExternalSessionWithConnectionInfo, Issue, OperationOutcomeResponse, WindowIDDataResponse } 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';
@@ -475,36 +475,71 @@ interface WindowScrapeResponse extends ScrapeResponse {
475
475
  */
476
476
  interface WindowExtractConfig extends Omit<WindowExtractParams, "sessionId" | "prompt" | "jobId"> {
477
477
  }
478
+ /**
479
+ * Extract window response.
480
+ */
481
+ interface WindowExtractResponse extends ExtractActionResponseEnvelope {
482
+ }
478
483
  /**
479
484
  * Configuration parameters for acting on content in a window.
480
485
  */
481
486
  interface WindowActConfig extends Omit<WindowActParams, "sessionId" | "prompt" | "jobId"> {
482
487
  }
488
+ /**
489
+ * Act window response.
490
+ */
491
+ interface WindowActResponse extends ActActionResponseEnvelope {
492
+ }
483
493
  /**
484
494
  * Configuration parameters for executing an LLM call in a window.
485
495
  */
486
496
  interface WindowLlmConfig extends Omit<WindowLlmParams, "sessionId" | "prompt"> {
487
497
  }
498
+ /**
499
+ * LLM window response.
500
+ */
501
+ interface WindowLlmResponse extends LlmActionResponseEnvelope {
502
+ }
488
503
  /**
489
504
  * Configuration parameters for finding one element in a window.
490
505
  */
491
506
  interface WindowFindOneConfig extends Omit<WindowFindOneParams, "sessionId" | "prompt" | "jobId"> {
492
507
  }
508
+ /**
509
+ * Find one window response.
510
+ */
511
+ interface WindowFindOneResponse extends FindOneActionResponseEnvelope {
512
+ }
493
513
  /**
494
514
  * Configuration parameters for finding multiple elements in a window.
495
515
  */
496
516
  interface WindowFindManyConfig extends Omit<WindowFindManyParams, "sessionId" | "prompt" | "jobId"> {
497
517
  }
518
+ /**
519
+ * Find many window response.
520
+ */
521
+ interface WindowFindManyResponse extends FindManyActionResponseEnvelope {
522
+ }
498
523
  /**
499
524
  * Configuration parameters for waiting for a page to load in a window.
500
525
  */
501
526
  interface WindowWaitForPageConfig extends Omit<WindowWaitForPageParams, "sessionId"> {
502
527
  }
528
+ /**
529
+ * Wait for page window response.
530
+ */
531
+ interface WindowWaitForPageResponse extends WaitForPageActionResponseEnvelope {
532
+ }
503
533
  /**
504
534
  * Configuration parameters for navigating browser history in a window.
505
535
  */
506
536
  interface WindowNavigateConfig extends Omit<WindowNavigateParams, "sessionId"> {
507
537
  }
538
+ /**
539
+ * Navigate window response.
540
+ */
541
+ interface WindowNavigateResponse extends NavigateActionResponseEnvelope {
542
+ }
508
543
  /**
509
544
  * The direction to navigate in browser history.
510
545
  */
@@ -515,9 +550,7 @@ declare enum WindowNavigateDirection {
515
550
  /**
516
551
  * Data object representing a node returned from the Airtop API.
517
552
  */
518
- interface AirtopNodeApiResponseData {
519
- id: string;
520
- xpath: string;
553
+ interface AirtopNodeApiResponseData extends NodeHandle {
521
554
  }
522
555
 
523
556
  /**
@@ -548,21 +581,21 @@ declare class AirtopNode {
548
581
  * @param config - The configuration to use for the extraction
549
582
  * @param requestOptions - The request options to use for the extraction
550
583
  */
551
- extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
584
+ extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowExtractResponse>;
552
585
  /**
553
586
  * Act on the node
554
587
  * @param prompt - The prompt to use for the action
555
588
  * @param config - The configuration to use for the action
556
589
  * @param requestOptions - The request options to use for the action
557
590
  */
558
- act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
591
+ act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowActResponse>;
559
592
  /**
560
593
  * Execute an LLM call on the node
561
594
  * @param prompt - The prompt to use for the LLM call
562
595
  * @param config - The configuration to use for the LLM call
563
596
  * @param requestOptions - The request options to use for the LLM call
564
597
  */
565
- llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
598
+ llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
566
599
  /**
567
600
  * Find one element in the node
568
601
  * @param prompt - The prompt to use for the find one
@@ -755,17 +788,17 @@ declare class AirtopWindowClient extends AirtopBase {
755
788
  * @returns Promise resolving when the text has been typed
756
789
  */
757
790
  type(text: string, config?: WindowTypeConfig, requestOptions?: AirtopRequestOptions): Promise<_airtop_core_resources_shared_mjs.AIPromptResponse>;
758
- extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
759
- act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
760
- llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
791
+ extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowExtractResponse>;
792
+ act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowActResponse>;
793
+ llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
761
794
  private findOnePrivate;
762
795
  findOne(prompt: string, config?: Omit<WindowFindOneConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode>;
763
796
  findOneOptional(prompt: string, config?: Omit<WindowFindOneConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode | null>;
764
797
  private findManyPrivate;
765
798
  findMany(prompt: string, config?: Omit<WindowFindManyConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
766
799
  findManyOptional(prompt: string, config?: Omit<WindowFindManyConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
767
- waitForPage(config?: WindowWaitForPageConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
768
- navigate(direction: WindowNavigateDirection, config?: WindowNavigateConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
800
+ waitForPage(config?: WindowWaitForPageConfig, requestOptions?: AirtopRequestOptions): Promise<WindowWaitForPageResponse>;
801
+ navigate(direction: WindowNavigateDirection, config?: WindowNavigateConfig, requestOptions?: AirtopRequestOptions): Promise<WindowNavigateResponse>;
769
802
  }
770
803
 
771
804
  /**
@@ -1352,4 +1385,4 @@ declare class AirtopMocks {
1352
1385
  }): AirtopWindow<AirtopWindowGetInfoResponse>;
1353
1386
  }
1354
1387
 
1355
- export { type AirtopAgentCancelInvocationParams, AirtopAgentClient, type AirtopAgentCreateAgentParams, type AirtopAgentCreateInvocationParams, type AirtopAgentCreateVersionParams, type AirtopAgentDeleteAgentsParams, type AirtopAgentDuplicateAgentParams, type AirtopAgentGetAgentsParams, type AirtopAgentGetInvocationsParams, type AirtopAgentGetVersionsParams, type AirtopAgentResponse, type AirtopAgentUpdateAgentParams, type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopCreateAgentInvocationResponse, type AirtopCreateAgentResponse, type AirtopCreateAgentVersionResponse, type AirtopDeleteAgentsResponse, type AirtopDuplicateAgentResponse, AirtopError, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, type AirtopGetAgentInvocationsResponse, type AirtopGetAgentResponse, type AirtopGetAgentVersionsResponse, type AirtopGetAgentsResponse, AirtopMocks, AirtopNode, type AirtopNodeApiResponseData, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, type AirtopUpdateAgentResponse, AirtopWindow, AirtopWindowClient, type AirtopWindowClientPlugin, type AirtopWindowCreateResponse, type AirtopWindowGetInfoResponse, type AirtopWindowPlugin, AirtopWindowScreenshot, type AirtopWindowScreenshotPlugin, type AirtopWindowScreenshotResponse, type CommonAirtopConfig, type CommonResponse, type CommonWindowResponse, type CreateFileConfig, type CreateSessionConfig, type GetFilesConfig, type GetSessionsConfig, type OutputJsonSchemaConfig, type ScreenshotData, type SessionData, type SessionError, type SessionMetadata, type SessionWarning, type WindowActConfig, type WindowClickConfig, type WindowCreateData, type WindowError, type WindowExtractConfig, type WindowFindManyConfig, type WindowFindOneConfig, type WindowGetConfig, type WindowHoverConfig, type WindowInfoData, type WindowLlmConfig, type WindowLoadUrlConfig, type WindowMetadata, type WindowMonitorConfig, type WindowNavigateConfig, WindowNavigateDirection, type WindowPageQueryConfig, type WindowPaginatedExtractionConfig, type WindowPromptResponse, type WindowScrapeConfig, type WindowScrapeResponse, type WindowScreenshotConfig, type WindowScrollConfig, type WindowTypeConfig, type WindowWaitForPageConfig, type WindowWarning, registerAirtopPlugin };
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 };
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var require_package = __commonJS({
9
9
  module.exports = {
10
10
  name: "@airtop/sdk",
11
11
  description: "Airtop SDK for TypeScript",
12
- version: "1.0.0-alpha2.15",
12
+ version: "1.0.0-alpha2.17",
13
13
  type: "module",
14
14
  main: "./dist/index.cjs",
15
15
  module: "./dist/index.js",
@@ -47,7 +47,7 @@ var require_package = __commonJS({
47
47
  },
48
48
  dependencies: {
49
49
  "@airtop/json-schema-adapter": "workspace:*",
50
- "@airtop/core": "0.1.0-alpha.29",
50
+ "@airtop/core": "0.1.0-alpha.30",
51
51
  "date-fns": "4.1.0",
52
52
  loglayer: "6.3.3",
53
53
  "serialize-error": "12.0.0",
@@ -290,7 +290,7 @@ async function waitForRequestCompletion(client, requestId, requestOptions) {
290
290
  const startTime = Date.now();
291
291
  const timeoutMs = secondsToMilliseconds2(requestOptions?.timeoutInSeconds || DEFAULT_TIMEOUT_SECONDS);
292
292
  while (Date.now() - startTime < timeoutMs) {
293
- const apiResponse = await client.requests.getRequestStatus(requestId, requestOptions);
293
+ const apiResponse = await client.requests.getRequestStatusV2(requestId, requestOptions);
294
294
  if (apiResponse.status === "completed") {
295
295
  return apiResponse.response;
296
296
  }
@@ -302,8 +302,15 @@ async function waitForRequestCompletion(client, requestId, requestOptions) {
302
302
  throw new Error("Waiting for request timed out");
303
303
  }
304
304
  async function withRequestCompletionPolling(client, fn, requestOptions) {
305
- const response = await fn();
306
- return waitForRequestCompletion(client, response.requestId, requestOptions);
305
+ try {
306
+ const response = await fn();
307
+ return waitForRequestCompletion(client, response.requestId, requestOptions);
308
+ } catch (thrownError) {
309
+ if (thrownError.error?.errors) {
310
+ throw new AirtopError(thrownError.error.errors);
311
+ }
312
+ throw thrownError;
313
+ }
307
314
  }
308
315
 
309
316
  // src/window/AirtopNode.ts
@@ -521,8 +528,7 @@ var AirtopWindowClient = class extends AirtopBase {
521
528
  this.client.windows.get(
522
529
  this.windowId,
523
530
  {
524
- sessionId: this.sessionId,
525
- ...config
531
+ sessionId: this.sessionId
526
532
  },
527
533
  this.resolveRequestOptions()
528
534
  ).then((results) => {
@@ -852,6 +858,7 @@ var AirtopWindowClient = class extends AirtopBase {
852
858
  {
853
859
  prompt,
854
860
  sessionId: this.sessionId,
861
+ jobId: this.jobId,
855
862
  ...config || {}
856
863
  },
857
864
  {
@@ -883,16 +890,12 @@ var AirtopWindowClient = class extends AirtopBase {
883
890
  throw new AirtopError(apiResponse.errors);
884
891
  }
885
892
  try {
886
- if (!apiResponse.data.modelResponse) {
887
- return null;
888
- }
889
- const nodeData = JSON.parse(apiResponse.data.modelResponse);
890
- if (Object.keys(nodeData).length === 0) {
893
+ if (!apiResponse.data.nodeHandle) {
891
894
  return null;
892
895
  }
893
- return new AirtopNode(this, nodeData);
896
+ return new AirtopNode(this, apiResponse.data.nodeHandle);
894
897
  } catch (error) {
895
- this.log.withMetadata({ nodeDataStr: apiResponse.data.modelResponse }).withError(error).error("Error parsing node data");
898
+ this.log.withMetadata({ nodeDataStr: apiResponse.data.nodeHandle }).withError(error).error("Error parsing node data");
896
899
  throw error;
897
900
  }
898
901
  }
@@ -925,21 +928,8 @@ var AirtopWindowClient = class extends AirtopBase {
925
928
  if (apiResponse.errors.length > 0) {
926
929
  throw new AirtopError(apiResponse.errors);
927
930
  }
928
- const nodeHandles = apiResponse.data.modelResponse.split("___DELIM___");
929
- return nodeHandles.map((nodeDataStr) => {
930
- try {
931
- if (!nodeDataStr) {
932
- return null;
933
- }
934
- const nodeData = JSON.parse(nodeDataStr);
935
- if (Object.keys(nodeData).length === 0) {
936
- return null;
937
- }
938
- return new AirtopNode(this, nodeData);
939
- } catch (error) {
940
- this.log.withMetadata({ nodeDataStr }).withError(error).error("Error parsing node data");
941
- }
942
- }).filter((node) => !!node);
931
+ const nodeHandleData = apiResponse.data.nodeHandles;
932
+ return nodeHandleData.map((nodeHandle) => new AirtopNode(this, nodeHandle));
943
933
  }
944
934
  async findMany(prompt, config, requestOptions = {}) {
945
935
  const configOverride = { ...config, optional: false };
@@ -956,6 +946,7 @@ var AirtopWindowClient = class extends AirtopBase {
956
946
  this.getWindowId(),
957
947
  {
958
948
  sessionId: this.sessionId,
949
+ jobId: this.jobId,
959
950
  ...config || {}
960
951
  },
961
952
  {
@@ -973,6 +964,7 @@ var AirtopWindowClient = class extends AirtopBase {
973
964
  {
974
965
  direction,
975
966
  sessionId: this.sessionId,
967
+ jobId: this.jobId,
976
968
  ...config || {}
977
969
  },
978
970
  {