@airtop/sdk 1.0.0-alpha2.8 → 1.0.0-alpha2.9
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 +19 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -48
- package/dist/index.d.ts +53 -48
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
@@ -361,51 +361,6 @@ interface AirtopWindowGetInfoResponse extends AirtopWindowCreateResponse {
|
|
361
361
|
data: WindowInfoData;
|
362
362
|
}
|
363
363
|
|
364
|
-
declare class AirtopNodeImpl {
|
365
|
-
/**
|
366
|
-
* The window client
|
367
|
-
*/
|
368
|
-
protected windowClient: AirtopWindowClient;
|
369
|
-
/**
|
370
|
-
* The node handle id to use for all requests
|
371
|
-
*/
|
372
|
-
protected nodeHandleId: string;
|
373
|
-
/**
|
374
|
-
* Constructor
|
375
|
-
* @param client - The window client
|
376
|
-
* @param nodeHandleId - The node handle id to use for all requests
|
377
|
-
*/
|
378
|
-
constructor(client: AirtopWindowClient, nodeHandleId: string);
|
379
|
-
/**
|
380
|
-
* Extract content from the node
|
381
|
-
* @param prompt - The prompt to use for the extraction
|
382
|
-
* @param config - The configuration to use for the extraction
|
383
|
-
* @param requestOptions - The request options to use for the extraction
|
384
|
-
*/
|
385
|
-
extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
386
|
-
/**
|
387
|
-
* Act on the node
|
388
|
-
* @param prompt - The prompt to use for the action
|
389
|
-
* @param config - The configuration to use for the action
|
390
|
-
* @param requestOptions - The request options to use for the action
|
391
|
-
*/
|
392
|
-
act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
393
|
-
/**
|
394
|
-
* Execute an LLM call on the node
|
395
|
-
* @param prompt - The prompt to use for the LLM call
|
396
|
-
* @param config - The configuration to use for the LLM call
|
397
|
-
* @param requestOptions - The request options to use for the LLM call
|
398
|
-
*/
|
399
|
-
llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
400
|
-
/**
|
401
|
-
* Find one element in the node
|
402
|
-
* @param prompt - The prompt to use for the find one
|
403
|
-
* @param config - The configuration to use for the find one
|
404
|
-
* @param requestOptions - The request options to use for the find one
|
405
|
-
*/
|
406
|
-
findOne(prompt: string, config?: WindowFindOneConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode>;
|
407
|
-
}
|
408
|
-
|
409
364
|
/**
|
410
365
|
* Configuration parameters for typing text in a window.
|
411
366
|
* Excludes session ID and text content which are provided separately.
|
@@ -505,10 +460,60 @@ interface WindowFindOneConfig extends Omit<WindowFindOneParams, "sessionId" | "p
|
|
505
460
|
*/
|
506
461
|
interface WindowFindManyConfig extends Omit<WindowFindManyParams, "sessionId" | "prompt" | "jobId"> {
|
507
462
|
}
|
463
|
+
|
508
464
|
/**
|
509
|
-
*
|
465
|
+
* Represents a node in the DOM
|
510
466
|
*/
|
511
|
-
|
467
|
+
declare class AirtopNode {
|
468
|
+
/**
|
469
|
+
* The window client
|
470
|
+
*/
|
471
|
+
protected windowClient: AirtopWindowClient;
|
472
|
+
/**
|
473
|
+
* The node handle id to use for all requests
|
474
|
+
*/
|
475
|
+
protected nodeHandleId: string;
|
476
|
+
/**
|
477
|
+
* Constructor
|
478
|
+
* @param client - The window client
|
479
|
+
* @param nodeHandleId - The node handle id to use for all requests
|
480
|
+
*/
|
481
|
+
constructor(client: AirtopWindowClient, nodeHandleId: string);
|
482
|
+
/**
|
483
|
+
* Extract content from the node
|
484
|
+
* @param prompt - The prompt to use for the extraction
|
485
|
+
* @param config - The configuration to use for the extraction
|
486
|
+
* @param requestOptions - The request options to use for the extraction
|
487
|
+
*/
|
488
|
+
extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
489
|
+
/**
|
490
|
+
* Act on the node
|
491
|
+
* @param prompt - The prompt to use for the action
|
492
|
+
* @param config - The configuration to use for the action
|
493
|
+
* @param requestOptions - The request options to use for the action
|
494
|
+
*/
|
495
|
+
act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
496
|
+
/**
|
497
|
+
* Execute an LLM call on the node
|
498
|
+
* @param prompt - The prompt to use for the LLM call
|
499
|
+
* @param config - The configuration to use for the LLM call
|
500
|
+
* @param requestOptions - The request options to use for the LLM call
|
501
|
+
*/
|
502
|
+
llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
503
|
+
/**
|
504
|
+
* Find one element in the node
|
505
|
+
* @param prompt - The prompt to use for the find one
|
506
|
+
* @param config - The configuration to use for the find one
|
507
|
+
* @param requestOptions - The request options to use for the find one
|
508
|
+
*/
|
509
|
+
findOne(prompt: string, config?: WindowFindOneConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode>;
|
510
|
+
/**
|
511
|
+
* Find many elements in the node
|
512
|
+
* @param prompt - The prompt to use for the find many
|
513
|
+
* @param config - The configuration to use for the find many
|
514
|
+
* @param requestOptions - The request options to use for the find many
|
515
|
+
*/
|
516
|
+
findMany(prompt: string, config?: WindowFindManyConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
|
512
517
|
}
|
513
518
|
|
514
519
|
/**
|
@@ -1118,4 +1123,4 @@ declare class AirtopMocks {
|
|
1118
1123
|
}): AirtopWindow<AirtopWindowGetInfoResponse>;
|
1119
1124
|
}
|
1120
1125
|
|
1121
|
-
export { type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, AirtopMocks,
|
1126
|
+
export { type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, AirtopMocks, AirtopNode, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, AirtopWindow, AirtopWindowClient, type AirtopWindowClientPlugin, type AirtopWindowCreateResponse, type AirtopWindowGetInfoResponse, type AirtopWindowPlugin, AirtopWindowScreenshot, type AirtopWindowScreenshotPlugin, type AirtopWindowScreenshotResponse, type CommonAirtopConfig, type CommonResponse, type CommonWindowResponse, type CreateFileConfig, type CreateSessionConfig, type GetFilesConfig, type GetSessionsConfig, type OutputJsonSchemaConfig, type ScreenshotData, type SessionData, type SessionError, type SessionMetadata, type SessionWarning, type WindowActConfig, type WindowClickConfig, type WindowCreateData, type WindowError, type WindowExtractConfig, type WindowFindManyConfig, type WindowFindOneConfig, type WindowGetConfig, type WindowHoverConfig, type WindowInfoData, type WindowLlmConfig, type WindowLoadUrlConfig, type WindowMetadata, type WindowMonitorConfig, type WindowPageQueryConfig, type WindowPaginatedExtractionConfig, type WindowPromptResponse, type WindowScrapeConfig, type WindowScrapeResponse, type WindowScreenshotConfig, type WindowScrollConfig, type WindowTypeConfig, type WindowWarning, registerAirtopPlugin };
|
package/dist/index.d.ts
CHANGED
@@ -361,51 +361,6 @@ interface AirtopWindowGetInfoResponse extends AirtopWindowCreateResponse {
|
|
361
361
|
data: WindowInfoData;
|
362
362
|
}
|
363
363
|
|
364
|
-
declare class AirtopNodeImpl {
|
365
|
-
/**
|
366
|
-
* The window client
|
367
|
-
*/
|
368
|
-
protected windowClient: AirtopWindowClient;
|
369
|
-
/**
|
370
|
-
* The node handle id to use for all requests
|
371
|
-
*/
|
372
|
-
protected nodeHandleId: string;
|
373
|
-
/**
|
374
|
-
* Constructor
|
375
|
-
* @param client - The window client
|
376
|
-
* @param nodeHandleId - The node handle id to use for all requests
|
377
|
-
*/
|
378
|
-
constructor(client: AirtopWindowClient, nodeHandleId: string);
|
379
|
-
/**
|
380
|
-
* Extract content from the node
|
381
|
-
* @param prompt - The prompt to use for the extraction
|
382
|
-
* @param config - The configuration to use for the extraction
|
383
|
-
* @param requestOptions - The request options to use for the extraction
|
384
|
-
*/
|
385
|
-
extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
386
|
-
/**
|
387
|
-
* Act on the node
|
388
|
-
* @param prompt - The prompt to use for the action
|
389
|
-
* @param config - The configuration to use for the action
|
390
|
-
* @param requestOptions - The request options to use for the action
|
391
|
-
*/
|
392
|
-
act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
393
|
-
/**
|
394
|
-
* Execute an LLM call on the node
|
395
|
-
* @param prompt - The prompt to use for the LLM call
|
396
|
-
* @param config - The configuration to use for the LLM call
|
397
|
-
* @param requestOptions - The request options to use for the LLM call
|
398
|
-
*/
|
399
|
-
llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
400
|
-
/**
|
401
|
-
* Find one element in the node
|
402
|
-
* @param prompt - The prompt to use for the find one
|
403
|
-
* @param config - The configuration to use for the find one
|
404
|
-
* @param requestOptions - The request options to use for the find one
|
405
|
-
*/
|
406
|
-
findOne(prompt: string, config?: WindowFindOneConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode>;
|
407
|
-
}
|
408
|
-
|
409
364
|
/**
|
410
365
|
* Configuration parameters for typing text in a window.
|
411
366
|
* Excludes session ID and text content which are provided separately.
|
@@ -505,10 +460,60 @@ interface WindowFindOneConfig extends Omit<WindowFindOneParams, "sessionId" | "p
|
|
505
460
|
*/
|
506
461
|
interface WindowFindManyConfig extends Omit<WindowFindManyParams, "sessionId" | "prompt" | "jobId"> {
|
507
462
|
}
|
463
|
+
|
508
464
|
/**
|
509
|
-
*
|
465
|
+
* Represents a node in the DOM
|
510
466
|
*/
|
511
|
-
|
467
|
+
declare class AirtopNode {
|
468
|
+
/**
|
469
|
+
* The window client
|
470
|
+
*/
|
471
|
+
protected windowClient: AirtopWindowClient;
|
472
|
+
/**
|
473
|
+
* The node handle id to use for all requests
|
474
|
+
*/
|
475
|
+
protected nodeHandleId: string;
|
476
|
+
/**
|
477
|
+
* Constructor
|
478
|
+
* @param client - The window client
|
479
|
+
* @param nodeHandleId - The node handle id to use for all requests
|
480
|
+
*/
|
481
|
+
constructor(client: AirtopWindowClient, nodeHandleId: string);
|
482
|
+
/**
|
483
|
+
* Extract content from the node
|
484
|
+
* @param prompt - The prompt to use for the extraction
|
485
|
+
* @param config - The configuration to use for the extraction
|
486
|
+
* @param requestOptions - The request options to use for the extraction
|
487
|
+
*/
|
488
|
+
extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
489
|
+
/**
|
490
|
+
* Act on the node
|
491
|
+
* @param prompt - The prompt to use for the action
|
492
|
+
* @param config - The configuration to use for the action
|
493
|
+
* @param requestOptions - The request options to use for the action
|
494
|
+
*/
|
495
|
+
act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
496
|
+
/**
|
497
|
+
* Execute an LLM call on the node
|
498
|
+
* @param prompt - The prompt to use for the LLM call
|
499
|
+
* @param config - The configuration to use for the LLM call
|
500
|
+
* @param requestOptions - The request options to use for the LLM call
|
501
|
+
*/
|
502
|
+
llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
503
|
+
/**
|
504
|
+
* Find one element in the node
|
505
|
+
* @param prompt - The prompt to use for the find one
|
506
|
+
* @param config - The configuration to use for the find one
|
507
|
+
* @param requestOptions - The request options to use for the find one
|
508
|
+
*/
|
509
|
+
findOne(prompt: string, config?: WindowFindOneConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode>;
|
510
|
+
/**
|
511
|
+
* Find many elements in the node
|
512
|
+
* @param prompt - The prompt to use for the find many
|
513
|
+
* @param config - The configuration to use for the find many
|
514
|
+
* @param requestOptions - The request options to use for the find many
|
515
|
+
*/
|
516
|
+
findMany(prompt: string, config?: WindowFindManyConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
|
512
517
|
}
|
513
518
|
|
514
519
|
/**
|
@@ -1118,4 +1123,4 @@ declare class AirtopMocks {
|
|
1118
1123
|
}): AirtopWindow<AirtopWindowGetInfoResponse>;
|
1119
1124
|
}
|
1120
1125
|
|
1121
|
-
export { type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, AirtopMocks,
|
1126
|
+
export { type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, AirtopMocks, AirtopNode, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, AirtopWindow, AirtopWindowClient, type AirtopWindowClientPlugin, type AirtopWindowCreateResponse, type AirtopWindowGetInfoResponse, type AirtopWindowPlugin, AirtopWindowScreenshot, type AirtopWindowScreenshotPlugin, type AirtopWindowScreenshotResponse, type CommonAirtopConfig, type CommonResponse, type CommonWindowResponse, type CreateFileConfig, type CreateSessionConfig, type GetFilesConfig, type GetSessionsConfig, type OutputJsonSchemaConfig, type ScreenshotData, type SessionData, type SessionError, type SessionMetadata, type SessionWarning, type WindowActConfig, type WindowClickConfig, type WindowCreateData, type WindowError, type WindowExtractConfig, type WindowFindManyConfig, type WindowFindOneConfig, type WindowGetConfig, type WindowHoverConfig, type WindowInfoData, type WindowLlmConfig, type WindowLoadUrlConfig, type WindowMetadata, type WindowMonitorConfig, type WindowPageQueryConfig, type WindowPaginatedExtractionConfig, type WindowPromptResponse, type WindowScrapeConfig, type WindowScrapeResponse, type WindowScreenshotConfig, type WindowScrollConfig, type WindowTypeConfig, 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.
|
12
|
+
version: "1.0.0-alpha2.9",
|
13
13
|
type: "module",
|
14
14
|
main: "./dist/index.cjs",
|
15
15
|
module: "./dist/index.js",
|
@@ -269,7 +269,7 @@ async function withRequestCompletionPolling(client, fn, requestOptions) {
|
|
269
269
|
}
|
270
270
|
|
271
271
|
// src/window/AirtopNode.ts
|
272
|
-
var
|
272
|
+
var AirtopNode = class {
|
273
273
|
/**
|
274
274
|
* The window client
|
275
275
|
*/
|
@@ -335,6 +335,19 @@ var AirtopNodeImpl = class {
|
|
335
335
|
};
|
336
336
|
return this.windowClient.findOne(prompt, augmentedConfig, requestOptions);
|
337
337
|
}
|
338
|
+
/**
|
339
|
+
* Find many elements in the node
|
340
|
+
* @param prompt - The prompt to use for the find many
|
341
|
+
* @param config - The configuration to use for the find many
|
342
|
+
* @param requestOptions - The request options to use for the find many
|
343
|
+
*/
|
344
|
+
async findMany(prompt, config, requestOptions = {}) {
|
345
|
+
const augmentedConfig = {
|
346
|
+
...config,
|
347
|
+
nodeHandleId: this.nodeHandleId
|
348
|
+
};
|
349
|
+
return this.windowClient.findMany(prompt, augmentedConfig, requestOptions);
|
350
|
+
}
|
338
351
|
};
|
339
352
|
|
340
353
|
// src/window/AirtopWindowScreenshot.ts
|
@@ -784,7 +797,7 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
784
797
|
)
|
785
798
|
);
|
786
799
|
const nodeHandleId = apiResponse.data.modelResponse;
|
787
|
-
return new
|
800
|
+
return new AirtopNode(this, nodeHandleId);
|
788
801
|
}
|
789
802
|
async findMany(prompt, config, requestOptions = {}) {
|
790
803
|
this.log.withMetadata({ prompt }).info("Executing LLM call");
|
@@ -805,7 +818,7 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
805
818
|
)
|
806
819
|
);
|
807
820
|
const nodeHandleIds = apiResponse.data.modelResponse.split(",");
|
808
|
-
return nodeHandleIds.map((nodeHandleId) => new
|
821
|
+
return nodeHandleIds.map((nodeHandleId) => new AirtopNode(this, nodeHandleId));
|
809
822
|
}
|
810
823
|
};
|
811
824
|
|
@@ -1374,6 +1387,7 @@ export {
|
|
1374
1387
|
AirtopBase,
|
1375
1388
|
AirtopClient,
|
1376
1389
|
AirtopMocks,
|
1390
|
+
AirtopNode,
|
1377
1391
|
AirtopPluginAugmentationType,
|
1378
1392
|
AirtopSession,
|
1379
1393
|
AirtopSessionClient,
|