@airtop/sdk 1.0.0-alpha2.24 → 1.0.0-alpha2.25
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 +29 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +29 -15
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
@@ -12,7 +12,7 @@ import { SessionListParams, ProfileOutput, FileListParams, FileCreateFileParams,
|
|
12
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
14
|
import * as _airtop_core_resources_js from '@airtop/core/resources.js';
|
15
|
-
import { ConnectedServicesActionResponseEnvelope } from '@airtop/core/resources.js';
|
15
|
+
import { ServicePromptParameters, ConnectedServicesActionResponseEnvelope } from '@airtop/core/resources.js';
|
16
16
|
import { WindowClickParams, WindowHoverParams, WindowLoadURLParams, WindowMonitorParams, WindowPageQueryParams, WindowPaginatedExtractionParams, WindowScrapeParams, WindowScreenshotParams, WindowScrollParams, WindowTypeParams, WindowExtractParams, WindowActParams, WindowLlmParams, WindowFindOneParams, WindowFindManyParams, WindowWaitForPageParams, WindowNavigateParams, WindowFillFormParams } from '@airtop/core/resources/windows.js';
|
17
17
|
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';
|
18
18
|
import { DeepOmit } from 'deep-utility-types';
|
@@ -941,12 +941,19 @@ declare class AirtopSessionClient extends AirtopBase {
|
|
941
941
|
createFile(fileName: string, config?: CreateFileConfig, requestOptions?: AirtopRequestOptions): _airtop_core.APIPromise<_airtop_core_resources_shared_mjs.CreateFileResponse>;
|
942
942
|
llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
|
943
943
|
/**
|
944
|
-
* Calls the service endpoint.
|
945
|
-
* @param prompt -
|
946
|
-
* @param service - The service
|
944
|
+
* Calls the service endpoint with a string prompt.
|
945
|
+
* @param prompt - Natural language description of the task to perform with third-party services (e.g., "read data from Google Sheets", "create a HubSpot lead", "update this document")
|
946
|
+
* @param service - The service id or array of service ids that will be leveraged to achieve the intent of the prompt
|
947
947
|
* @param requestOptions - Request options
|
948
|
+
* @deprecated Use `service(args: ServicePromptParameters, requestOptions?: AirtopRequestOptions)` instead
|
948
949
|
*/
|
949
950
|
service(prompt: string, service?: string, requestOptions?: AirtopRequestOptions): Promise<SessionServiceResponse>;
|
951
|
+
/**
|
952
|
+
* Calls the service endpoint with ServicePromptParameters.
|
953
|
+
* @param parameters - The service parameters object
|
954
|
+
* @param requestOptions - Request options
|
955
|
+
*/
|
956
|
+
service(parameters: ServicePromptParameters, requestOptions?: AirtopRequestOptions): Promise<SessionServiceResponse>;
|
950
957
|
/**
|
951
958
|
* Retrieves the list of connected services available for the current session.
|
952
959
|
* @param requestOptions - Request options
|
package/dist/index.d.ts
CHANGED
@@ -12,7 +12,7 @@ import { SessionListParams, ProfileOutput, FileListParams, FileCreateFileParams,
|
|
12
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
14
|
import * as _airtop_core_resources_js from '@airtop/core/resources.js';
|
15
|
-
import { ConnectedServicesActionResponseEnvelope } from '@airtop/core/resources.js';
|
15
|
+
import { ServicePromptParameters, ConnectedServicesActionResponseEnvelope } from '@airtop/core/resources.js';
|
16
16
|
import { WindowClickParams, WindowHoverParams, WindowLoadURLParams, WindowMonitorParams, WindowPageQueryParams, WindowPaginatedExtractionParams, WindowScrapeParams, WindowScreenshotParams, WindowScrollParams, WindowTypeParams, WindowExtractParams, WindowActParams, WindowLlmParams, WindowFindOneParams, WindowFindManyParams, WindowWaitForPageParams, WindowNavigateParams, WindowFillFormParams } from '@airtop/core/resources/windows.js';
|
17
17
|
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';
|
18
18
|
import { DeepOmit } from 'deep-utility-types';
|
@@ -941,12 +941,19 @@ declare class AirtopSessionClient extends AirtopBase {
|
|
941
941
|
createFile(fileName: string, config?: CreateFileConfig, requestOptions?: AirtopRequestOptions): _airtop_core.APIPromise<_airtop_core_resources_shared_mjs.CreateFileResponse>;
|
942
942
|
llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
|
943
943
|
/**
|
944
|
-
* Calls the service endpoint.
|
945
|
-
* @param prompt -
|
946
|
-
* @param service - The service
|
944
|
+
* Calls the service endpoint with a string prompt.
|
945
|
+
* @param prompt - Natural language description of the task to perform with third-party services (e.g., "read data from Google Sheets", "create a HubSpot lead", "update this document")
|
946
|
+
* @param service - The service id or array of service ids that will be leveraged to achieve the intent of the prompt
|
947
947
|
* @param requestOptions - Request options
|
948
|
+
* @deprecated Use `service(args: ServicePromptParameters, requestOptions?: AirtopRequestOptions)` instead
|
948
949
|
*/
|
949
950
|
service(prompt: string, service?: string, requestOptions?: AirtopRequestOptions): Promise<SessionServiceResponse>;
|
951
|
+
/**
|
952
|
+
* Calls the service endpoint with ServicePromptParameters.
|
953
|
+
* @param parameters - The service parameters object
|
954
|
+
* @param requestOptions - Request options
|
955
|
+
*/
|
956
|
+
service(parameters: ServicePromptParameters, requestOptions?: AirtopRequestOptions): Promise<SessionServiceResponse>;
|
950
957
|
/**
|
951
958
|
* Retrieves the list of connected services available for the current session.
|
952
959
|
* @param requestOptions - Request options
|
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.25",
|
13
13
|
type: "module",
|
14
14
|
main: "./dist/index.cjs",
|
15
15
|
module: "./dist/index.js",
|
@@ -47,8 +47,8 @@ var require_package = __commonJS({
|
|
47
47
|
"verify-types": "tsc --noEmit && tsc --noEmit --project tsconfig.e2e.json"
|
48
48
|
},
|
49
49
|
dependencies: {
|
50
|
+
"@airtop/core": "0.1.0-alpha.41",
|
50
51
|
"@airtop/json-schema-adapter": "workspace:*",
|
51
|
-
"@airtop/core": "0.1.0-alpha.40",
|
52
52
|
"date-fns": "4.1.0",
|
53
53
|
loglayer: "6.6.0",
|
54
54
|
"serialize-error": "12.0.0",
|
@@ -1261,18 +1261,32 @@ var AirtopSessionClient = class extends AirtopBase {
|
|
1261
1261
|
);
|
1262
1262
|
}
|
1263
1263
|
/**
|
1264
|
-
*
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1264
|
+
* Implementation for the overloaded service method.
|
1265
|
+
*/
|
1266
|
+
async service(promptOrArgs, serviceOrRequestOptions, requestOptions = {}) {
|
1267
|
+
if (typeof promptOrArgs === "string") {
|
1268
|
+
const prompt = promptOrArgs;
|
1269
|
+
const service = typeof serviceOrRequestOptions === "string" ? serviceOrRequestOptions : void 0;
|
1270
|
+
const options = typeof serviceOrRequestOptions === "object" ? serviceOrRequestOptions : requestOptions;
|
1271
|
+
this.log.withMetadata({ prompt }).info("Service");
|
1272
|
+
const parameters = { prompt, services: service };
|
1273
|
+
const body = { parameters };
|
1274
|
+
return withRequestCompletionPolling(
|
1275
|
+
this.client,
|
1276
|
+
() => this.client.sessions.service(this.sessionId, body),
|
1277
|
+
options
|
1278
|
+
);
|
1279
|
+
} else {
|
1280
|
+
const parameters = promptOrArgs;
|
1281
|
+
const options = serviceOrRequestOptions || {};
|
1282
|
+
this.log.withMetadata({ parameters }).info("Service");
|
1283
|
+
const body = { parameters };
|
1284
|
+
return withRequestCompletionPolling(
|
1285
|
+
this.client,
|
1286
|
+
() => this.client.sessions.service(this.sessionId, body),
|
1287
|
+
options
|
1288
|
+
);
|
1289
|
+
}
|
1276
1290
|
}
|
1277
1291
|
/**
|
1278
1292
|
* Retrieves the list of connected services available for the current session.
|
@@ -1731,7 +1745,7 @@ var AirtopAgentClient = class extends AirtopBase {
|
|
1731
1745
|
*/
|
1732
1746
|
async createNewAgentDraftVersion(agentId, requestOptions = {}) {
|
1733
1747
|
this.log.withMetadata({ agentId }).info("Creating new draft version of agent");
|
1734
|
-
return this.client.agents.createAgentDraft(agentId, this.resolveRequestOptions(requestOptions));
|
1748
|
+
return this.client.agents.createAgentDraft(agentId, {}, this.resolveRequestOptions(requestOptions));
|
1735
1749
|
}
|
1736
1750
|
/**
|
1737
1751
|
* Publishes a new version of an agent from the current draft.
|