@airtop/sdk 1.0.0-alpha2.23 → 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 +33 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -16
- package/dist/index.d.ts +30 -16
- package/dist/index.js +33 -19
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
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.39",
|
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.
|
@@ -1709,9 +1723,9 @@ var AirtopAgentClient = class extends AirtopBase {
|
|
1709
1723
|
* @param requestOptions - Request options.
|
1710
1724
|
* @returns The agent data.
|
1711
1725
|
*/
|
1712
|
-
async getAgent(agentId, requestOptions = {}) {
|
1726
|
+
async getAgent(agentId, params = {}, requestOptions = {}) {
|
1713
1727
|
this.log.withMetadata({ agentId }).info("Retrieving agent");
|
1714
|
-
return this.client.agents.getAgent(agentId, this.resolveRequestOptions(requestOptions));
|
1728
|
+
return this.client.agents.getAgent(agentId, params, this.resolveRequestOptions(requestOptions));
|
1715
1729
|
}
|
1716
1730
|
/**
|
1717
1731
|
* Lists agents.
|
@@ -1731,16 +1745,16 @@ 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.
|
1738
1752
|
* @param agentId - The ID of the agent to publish.
|
1739
1753
|
* @returns The published version data
|
1740
1754
|
*/
|
1741
|
-
async publishNewAgentVersion(agentId) {
|
1755
|
+
async publishNewAgentVersion(agentId, params = {}, requestOptions = {}) {
|
1742
1756
|
this.log.withMetadata({ agentId }).info("Publishing new version of agent");
|
1743
|
-
return this.client.agents.publishAgent(agentId, this.resolveRequestOptions());
|
1757
|
+
return this.client.agents.publishAgent(agentId, params, this.resolveRequestOptions(requestOptions));
|
1744
1758
|
}
|
1745
1759
|
/**
|
1746
1760
|
* Retrieves the data for a specific version of an agent.
|