@athenaintel/sdk 4.3.2050 → 4.3.2052
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/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +25 -20
- package/dist/cjs/api/errors/ConflictError.d.ts +1 -1
- package/dist/cjs/api/resources/collabAgents/client/Client.d.ts +38 -0
- package/dist/cjs/api/resources/collabAgents/client/Client.js +166 -0
- package/dist/cjs/api/resources/collabAgents/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/collabAgents/client/index.js +17 -0
- package/dist/cjs/api/resources/collabAgents/client/requests/CollabAgentSendMessageRequestIn.d.ts +18 -0
- package/dist/cjs/api/resources/collabAgents/client/requests/CollabAgentSendMessageRequestIn.js +3 -0
- package/dist/cjs/api/resources/collabAgents/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/collabAgents/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/collabAgents/index.d.ts +1 -0
- package/dist/cjs/api/resources/collabAgents/index.js +17 -0
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/types/CollabAgentSendMessageResponseOut.d.ts +13 -0
- package/dist/cjs/api/types/CollabAgentSendMessageResponseOut.js +3 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/errors/ConflictError.d.mts +1 -1
- package/dist/esm/api/resources/collabAgents/client/Client.d.mts +38 -0
- package/dist/esm/api/resources/collabAgents/client/Client.mjs +129 -0
- package/dist/esm/api/resources/collabAgents/client/index.d.mts +1 -0
- package/dist/esm/api/resources/collabAgents/client/index.mjs +1 -0
- package/dist/esm/api/resources/collabAgents/client/requests/CollabAgentSendMessageRequestIn.d.mts +18 -0
- package/dist/esm/api/resources/collabAgents/client/requests/CollabAgentSendMessageRequestIn.mjs +2 -0
- package/dist/esm/api/resources/collabAgents/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/collabAgents/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/collabAgents/index.d.mts +1 -0
- package/dist/esm/api/resources/collabAgents/index.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/types/CollabAgentSendMessageResponseOut.d.mts +13 -0
- package/dist/esm/api/types/CollabAgentSendMessageResponseOut.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +69 -0
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@athenaintel/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "4.3.
|
|
47
|
-
"User-Agent": "@athenaintel/sdk/4.3.
|
|
46
|
+
"X-Fern-SDK-Version": "4.3.2052",
|
|
47
|
+
"User-Agent": "@athenaintel/sdk/4.3.2052",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AgentsClient } from "./api/resources/agents/client/Client.js";
|
|
2
2
|
import { AopClient } from "./api/resources/aop/client/Client.js";
|
|
3
3
|
import { AssetsClient } from "./api/resources/assets/client/Client.js";
|
|
4
|
+
import { CollabAgentsClient } from "./api/resources/collabAgents/client/Client.js";
|
|
4
5
|
import { ComputerClient } from "./api/resources/computer/client/Client.js";
|
|
5
6
|
import { DatabasesClient } from "./api/resources/databases/client/Client.js";
|
|
6
7
|
import { MeetingsClient } from "./api/resources/meetings/client/Client.js";
|
|
@@ -24,6 +25,7 @@ export declare class AthenaIntelligenceClient {
|
|
|
24
25
|
protected _agents: AgentsClient | undefined;
|
|
25
26
|
protected _aop: AopClient | undefined;
|
|
26
27
|
protected _assets: AssetsClient | undefined;
|
|
28
|
+
protected _collabAgents: CollabAgentsClient | undefined;
|
|
27
29
|
protected _computer: ComputerClient | undefined;
|
|
28
30
|
protected _databases: DatabasesClient | undefined;
|
|
29
31
|
protected _users: UsersClient | undefined;
|
|
@@ -38,6 +40,7 @@ export declare class AthenaIntelligenceClient {
|
|
|
38
40
|
get agents(): AgentsClient;
|
|
39
41
|
get aop(): AopClient;
|
|
40
42
|
get assets(): AssetsClient;
|
|
43
|
+
get collabAgents(): CollabAgentsClient;
|
|
41
44
|
get computer(): ComputerClient;
|
|
42
45
|
get databases(): DatabasesClient;
|
|
43
46
|
get users(): UsersClient;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -5,16 +5,17 @@ exports.AthenaIntelligenceClient = void 0;
|
|
|
5
5
|
const Client_js_1 = require("./api/resources/agents/client/Client.js");
|
|
6
6
|
const Client_js_2 = require("./api/resources/aop/client/Client.js");
|
|
7
7
|
const Client_js_3 = require("./api/resources/assets/client/Client.js");
|
|
8
|
-
const Client_js_4 = require("./api/resources/
|
|
9
|
-
const Client_js_5 = require("./api/resources/
|
|
10
|
-
const Client_js_6 = require("./api/resources/
|
|
11
|
-
const Client_js_7 = require("./api/resources/
|
|
12
|
-
const Client_js_8 = require("./api/resources/
|
|
13
|
-
const Client_js_9 = require("./api/resources/
|
|
14
|
-
const Client_js_10 = require("./api/resources/
|
|
15
|
-
const Client_js_11 = require("./api/resources/
|
|
16
|
-
const Client_js_12 = require("./api/resources/
|
|
17
|
-
const Client_js_13 = require("./api/resources/
|
|
8
|
+
const Client_js_4 = require("./api/resources/collabAgents/client/Client.js");
|
|
9
|
+
const Client_js_5 = require("./api/resources/computer/client/Client.js");
|
|
10
|
+
const Client_js_6 = require("./api/resources/databases/client/Client.js");
|
|
11
|
+
const Client_js_7 = require("./api/resources/meetings/client/Client.js");
|
|
12
|
+
const Client_js_8 = require("./api/resources/query/client/Client.js");
|
|
13
|
+
const Client_js_9 = require("./api/resources/semanticModel/client/Client.js");
|
|
14
|
+
const Client_js_10 = require("./api/resources/sessions/client/Client.js");
|
|
15
|
+
const Client_js_11 = require("./api/resources/threads/client/Client.js");
|
|
16
|
+
const Client_js_12 = require("./api/resources/tools/client/Client.js");
|
|
17
|
+
const Client_js_13 = require("./api/resources/users/client/Client.js");
|
|
18
|
+
const Client_js_14 = require("./api/resources/workspaces/client/Client.js");
|
|
18
19
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
19
20
|
class AthenaIntelligenceClient {
|
|
20
21
|
constructor(options) {
|
|
@@ -32,45 +33,49 @@ class AthenaIntelligenceClient {
|
|
|
32
33
|
var _a;
|
|
33
34
|
return ((_a = this._assets) !== null && _a !== void 0 ? _a : (this._assets = new Client_js_3.AssetsClient(this._options)));
|
|
34
35
|
}
|
|
36
|
+
get collabAgents() {
|
|
37
|
+
var _a;
|
|
38
|
+
return ((_a = this._collabAgents) !== null && _a !== void 0 ? _a : (this._collabAgents = new Client_js_4.CollabAgentsClient(this._options)));
|
|
39
|
+
}
|
|
35
40
|
get computer() {
|
|
36
41
|
var _a;
|
|
37
|
-
return ((_a = this._computer) !== null && _a !== void 0 ? _a : (this._computer = new
|
|
42
|
+
return ((_a = this._computer) !== null && _a !== void 0 ? _a : (this._computer = new Client_js_5.ComputerClient(this._options)));
|
|
38
43
|
}
|
|
39
44
|
get databases() {
|
|
40
45
|
var _a;
|
|
41
|
-
return ((_a = this._databases) !== null && _a !== void 0 ? _a : (this._databases = new
|
|
46
|
+
return ((_a = this._databases) !== null && _a !== void 0 ? _a : (this._databases = new Client_js_6.DatabasesClient(this._options)));
|
|
42
47
|
}
|
|
43
48
|
get users() {
|
|
44
49
|
var _a;
|
|
45
|
-
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new
|
|
50
|
+
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_13.UsersClient(this._options)));
|
|
46
51
|
}
|
|
47
52
|
get meetings() {
|
|
48
53
|
var _a;
|
|
49
|
-
return ((_a = this._meetings) !== null && _a !== void 0 ? _a : (this._meetings = new
|
|
54
|
+
return ((_a = this._meetings) !== null && _a !== void 0 ? _a : (this._meetings = new Client_js_7.MeetingsClient(this._options)));
|
|
50
55
|
}
|
|
51
56
|
get query() {
|
|
52
57
|
var _a;
|
|
53
|
-
return ((_a = this._query) !== null && _a !== void 0 ? _a : (this._query = new
|
|
58
|
+
return ((_a = this._query) !== null && _a !== void 0 ? _a : (this._query = new Client_js_8.QueryClient(this._options)));
|
|
54
59
|
}
|
|
55
60
|
get semanticModel() {
|
|
56
61
|
var _a;
|
|
57
|
-
return ((_a = this._semanticModel) !== null && _a !== void 0 ? _a : (this._semanticModel = new
|
|
62
|
+
return ((_a = this._semanticModel) !== null && _a !== void 0 ? _a : (this._semanticModel = new Client_js_9.SemanticModelClient(this._options)));
|
|
58
63
|
}
|
|
59
64
|
get sessions() {
|
|
60
65
|
var _a;
|
|
61
|
-
return ((_a = this._sessions) !== null && _a !== void 0 ? _a : (this._sessions = new
|
|
66
|
+
return ((_a = this._sessions) !== null && _a !== void 0 ? _a : (this._sessions = new Client_js_10.SessionsClient(this._options)));
|
|
62
67
|
}
|
|
63
68
|
get threads() {
|
|
64
69
|
var _a;
|
|
65
|
-
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new
|
|
70
|
+
return ((_a = this._threads) !== null && _a !== void 0 ? _a : (this._threads = new Client_js_11.ThreadsClient(this._options)));
|
|
66
71
|
}
|
|
67
72
|
get tools() {
|
|
68
73
|
var _a;
|
|
69
|
-
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new
|
|
74
|
+
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new Client_js_12.ToolsClient(this._options)));
|
|
70
75
|
}
|
|
71
76
|
get workspaces() {
|
|
72
77
|
var _a;
|
|
73
|
-
return ((_a = this._workspaces) !== null && _a !== void 0 ? _a : (this._workspaces = new
|
|
78
|
+
return ((_a = this._workspaces) !== null && _a !== void 0 ? _a : (this._workspaces = new Client_js_14.WorkspacesClient(this._options)));
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
exports.AthenaIntelligenceClient = AthenaIntelligenceClient;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as core from "../../core/index.js";
|
|
2
2
|
import * as errors from "../../errors/index.js";
|
|
3
3
|
export declare class ConflictError extends errors.AthenaIntelligenceError {
|
|
4
|
-
constructor(body
|
|
4
|
+
constructor(body?: unknown, rawResponse?: core.RawResponse);
|
|
5
5
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../core/index.js";
|
|
4
|
+
import * as AthenaIntelligence from "../../../index.js";
|
|
5
|
+
export declare namespace CollabAgentsClient {
|
|
6
|
+
interface Options extends BaseClientOptions {
|
|
7
|
+
}
|
|
8
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare class CollabAgentsClient {
|
|
12
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<CollabAgentsClient.Options>;
|
|
13
|
+
constructor(options: CollabAgentsClient.Options);
|
|
14
|
+
/**
|
|
15
|
+
* Submit a message to a collab agent through its Programmatic channel. The agent must have the channel explicitly enabled (programmaticEnabled) and must be shared with the caller. With wait=false (default) the submission is queued and the endpoint returns 202 immediately; the resulting session appears in Athena under the caller's account. With wait=true the request long-polls: the connection stays open while the agent runs and the final agent message is returned verbatim in the reply field — size client timeouts for multi-minute runs. Submissions from the same caller with the same clientThreadKey continue one conversation until 24 hours of inactivity.
|
|
16
|
+
*
|
|
17
|
+
* @param {AthenaIntelligence.CollabAgentSendMessageRequestIn} request
|
|
18
|
+
* @param {CollabAgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
|
+
*
|
|
20
|
+
* @throws {@link AthenaIntelligence.ForbiddenError}
|
|
21
|
+
* @throws {@link AthenaIntelligence.NotFoundError}
|
|
22
|
+
* @throws {@link AthenaIntelligence.ConflictError}
|
|
23
|
+
* @throws {@link AthenaIntelligence.UnprocessableEntityError}
|
|
24
|
+
* @throws {@link AthenaIntelligence.InternalServerError}
|
|
25
|
+
* @throws {@link AthenaIntelligence.BadGatewayError}
|
|
26
|
+
* @throws {@link AthenaIntelligence.ServiceUnavailableError}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* await client.collabAgents.sendMessage({
|
|
30
|
+
* asset_id: "asset_id",
|
|
31
|
+
* clientThreadKey: "crm-sync-42",
|
|
32
|
+
* message: "Summarize yesterday's pipeline changes.",
|
|
33
|
+
* wait: true
|
|
34
|
+
* })
|
|
35
|
+
*/
|
|
36
|
+
sendMessage(request: AthenaIntelligence.CollabAgentSendMessageRequestIn, requestOptions?: CollabAgentsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.CollabAgentSendMessageResponseOut>;
|
|
37
|
+
private __sendMessage;
|
|
38
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
+
var t = {};
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
+
t[p] = s[p];
|
|
49
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
+
t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
exports.CollabAgentsClient = void 0;
|
|
58
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
59
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
60
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
61
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
62
|
+
const errors = __importStar(require("../../../../errors/index.js"));
|
|
63
|
+
const AthenaIntelligence = __importStar(require("../../../index.js"));
|
|
64
|
+
class CollabAgentsClient {
|
|
65
|
+
constructor(options) {
|
|
66
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Submit a message to a collab agent through its Programmatic channel. The agent must have the channel explicitly enabled (programmaticEnabled) and must be shared with the caller. With wait=false (default) the submission is queued and the endpoint returns 202 immediately; the resulting session appears in Athena under the caller's account. With wait=true the request long-polls: the connection stays open while the agent runs and the final agent message is returned verbatim in the reply field — size client timeouts for multi-minute runs. Submissions from the same caller with the same clientThreadKey continue one conversation until 24 hours of inactivity.
|
|
70
|
+
*
|
|
71
|
+
* @param {AthenaIntelligence.CollabAgentSendMessageRequestIn} request
|
|
72
|
+
* @param {CollabAgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
|
+
*
|
|
74
|
+
* @throws {@link AthenaIntelligence.ForbiddenError}
|
|
75
|
+
* @throws {@link AthenaIntelligence.NotFoundError}
|
|
76
|
+
* @throws {@link AthenaIntelligence.ConflictError}
|
|
77
|
+
* @throws {@link AthenaIntelligence.UnprocessableEntityError}
|
|
78
|
+
* @throws {@link AthenaIntelligence.InternalServerError}
|
|
79
|
+
* @throws {@link AthenaIntelligence.BadGatewayError}
|
|
80
|
+
* @throws {@link AthenaIntelligence.ServiceUnavailableError}
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* await client.collabAgents.sendMessage({
|
|
84
|
+
* asset_id: "asset_id",
|
|
85
|
+
* clientThreadKey: "crm-sync-42",
|
|
86
|
+
* message: "Summarize yesterday's pipeline changes.",
|
|
87
|
+
* wait: true
|
|
88
|
+
* })
|
|
89
|
+
*/
|
|
90
|
+
sendMessage(request, requestOptions) {
|
|
91
|
+
return core.HttpResponsePromise.fromPromise(this.__sendMessage(request, requestOptions));
|
|
92
|
+
}
|
|
93
|
+
__sendMessage(request, requestOptions) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
96
|
+
const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
|
|
97
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
98
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
99
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
100
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/collab-agents/${core.url.encodePathParam(assetId)}/messages`),
|
|
101
|
+
method: "POST",
|
|
102
|
+
headers: _headers,
|
|
103
|
+
contentType: "application/json",
|
|
104
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
105
|
+
requestType: "json",
|
|
106
|
+
body: _body,
|
|
107
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
108
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
109
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
110
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
111
|
+
logging: this._options.logging,
|
|
112
|
+
});
|
|
113
|
+
if (_response.ok) {
|
|
114
|
+
return {
|
|
115
|
+
data: _response.body,
|
|
116
|
+
rawResponse: _response.rawResponse,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
if (_response.error.reason === "status-code") {
|
|
120
|
+
switch (_response.error.statusCode) {
|
|
121
|
+
case 403:
|
|
122
|
+
throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
123
|
+
case 404:
|
|
124
|
+
throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
|
|
125
|
+
case 409:
|
|
126
|
+
throw new AthenaIntelligence.ConflictError(_response.error.body, _response.rawResponse);
|
|
127
|
+
case 422:
|
|
128
|
+
throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
129
|
+
case 500:
|
|
130
|
+
throw new AthenaIntelligence.InternalServerError(_response.error.body, _response.rawResponse);
|
|
131
|
+
case 502:
|
|
132
|
+
throw new AthenaIntelligence.BadGatewayError(_response.error.body, _response.rawResponse);
|
|
133
|
+
case 503:
|
|
134
|
+
throw new AthenaIntelligence.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
135
|
+
default:
|
|
136
|
+
throw new errors.AthenaIntelligenceError({
|
|
137
|
+
statusCode: _response.error.statusCode,
|
|
138
|
+
body: _response.error.body,
|
|
139
|
+
rawResponse: _response.rawResponse,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
switch (_response.error.reason) {
|
|
144
|
+
case "non-json":
|
|
145
|
+
throw new errors.AthenaIntelligenceError({
|
|
146
|
+
statusCode: _response.error.statusCode,
|
|
147
|
+
body: _response.error.rawBody,
|
|
148
|
+
rawResponse: _response.rawResponse,
|
|
149
|
+
});
|
|
150
|
+
case "body-is-null":
|
|
151
|
+
throw new errors.AthenaIntelligenceError({
|
|
152
|
+
statusCode: _response.error.statusCode,
|
|
153
|
+
rawResponse: _response.rawResponse,
|
|
154
|
+
});
|
|
155
|
+
case "timeout":
|
|
156
|
+
throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/collab-agents/{asset_id}/messages.");
|
|
157
|
+
case "unknown":
|
|
158
|
+
throw new errors.AthenaIntelligenceError({
|
|
159
|
+
message: _response.error.errorMessage,
|
|
160
|
+
rawResponse: _response.rawResponse,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
exports.CollabAgentsClient = CollabAgentsClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
package/dist/cjs/api/resources/collabAgents/client/requests/CollabAgentSendMessageRequestIn.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* asset_id: "asset_id",
|
|
5
|
+
* clientThreadKey: "crm-sync-42",
|
|
6
|
+
* message: "Summarize yesterday's pipeline changes.",
|
|
7
|
+
* wait: true
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface CollabAgentSendMessageRequestIn {
|
|
11
|
+
asset_id: string;
|
|
12
|
+
/** Optional caller-chosen conversation key. Submissions from the same caller with the same key continue one agent session (until 24 hours of inactivity); different keys hold independent conversations. Omitted, all of a caller's submissions to this agent share one 'default' thread. */
|
|
13
|
+
clientThreadKey?: string | null;
|
|
14
|
+
/** The message text to submit to the agent. Delivered verbatim as the user turn of the agent session. */
|
|
15
|
+
message: string;
|
|
16
|
+
/** When false (default), the submission is queued and the endpoint returns 202 immediately. When true, the request long-polls: the connection is held open while the agent runs (typically seconds to a few minutes) and the final reply is returned in the response. */
|
|
17
|
+
wait?: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { CollabAgentSendMessageRequestIn } from "./CollabAgentSendMessageRequestIn.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -4,6 +4,8 @@ export * from "./aop/client/requests/index.js";
|
|
|
4
4
|
export * as aop from "./aop/index.js";
|
|
5
5
|
export * from "./assets/client/requests/index.js";
|
|
6
6
|
export * as assets from "./assets/index.js";
|
|
7
|
+
export * from "./collabAgents/client/requests/index.js";
|
|
8
|
+
export * as collabAgents from "./collabAgents/index.js";
|
|
7
9
|
export * from "./computer/client/requests/index.js";
|
|
8
10
|
export * as computer from "./computer/index.js";
|
|
9
11
|
export * from "./databases/client/requests/index.js";
|
|
@@ -36,13 +36,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.workspaces = exports.users = exports.tools = exports.threads = exports.sessions = exports.semanticModel = exports.query = exports.meetings = exports.databases = exports.computer = exports.assets = exports.aop = exports.agents = void 0;
|
|
39
|
+
exports.workspaces = exports.users = exports.tools = exports.threads = exports.sessions = exports.semanticModel = exports.query = exports.meetings = exports.databases = exports.computer = exports.collabAgents = exports.assets = exports.aop = exports.agents = void 0;
|
|
40
40
|
__exportStar(require("./agents/client/requests/index.js"), exports);
|
|
41
41
|
exports.agents = __importStar(require("./agents/index.js"));
|
|
42
42
|
__exportStar(require("./aop/client/requests/index.js"), exports);
|
|
43
43
|
exports.aop = __importStar(require("./aop/index.js"));
|
|
44
44
|
__exportStar(require("./assets/client/requests/index.js"), exports);
|
|
45
45
|
exports.assets = __importStar(require("./assets/index.js"));
|
|
46
|
+
__exportStar(require("./collabAgents/client/requests/index.js"), exports);
|
|
47
|
+
exports.collabAgents = __importStar(require("./collabAgents/index.js"));
|
|
46
48
|
__exportStar(require("./computer/client/requests/index.js"), exports);
|
|
47
49
|
exports.computer = __importStar(require("./computer/index.js"));
|
|
48
50
|
__exportStar(require("./databases/client/requests/index.js"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response for a programmatic message submission.
|
|
3
|
+
*/
|
|
4
|
+
export interface CollabAgentSendMessageResponseOut {
|
|
5
|
+
/** The agent's final message, verbatim. Null on 202 responses, and null on completed runs where the agent declined to reply (it invoked its dont_respond tool). */
|
|
6
|
+
reply?: string | null;
|
|
7
|
+
/** Asset id of the Athena session that handled the submission. Null on 202 responses (the session is resolved asynchronously). */
|
|
8
|
+
sessionId?: string | null;
|
|
9
|
+
/** 'accepted' when the submission was queued (wait=false, HTTP 202); 'completed' when the agent run finished inline (wait=true, HTTP 200). */
|
|
10
|
+
status: string;
|
|
11
|
+
/** The conversation key this submission was routed under — the clientThreadKey from the request, or 'default'. */
|
|
12
|
+
threadKey: string;
|
|
13
|
+
}
|
|
@@ -22,6 +22,7 @@ export * from "./CellFormat.js";
|
|
|
22
22
|
export * from "./Chunk.js";
|
|
23
23
|
export * from "./ChunkContentItem.js";
|
|
24
24
|
export * from "./ChunkResult.js";
|
|
25
|
+
export * from "./CollabAgentSendMessageResponseOut.js";
|
|
25
26
|
export * from "./ConversationAssetInfo.js";
|
|
26
27
|
export * from "./ConversationMessage.js";
|
|
27
28
|
export * from "./ConversationResult.js";
|
|
@@ -38,6 +38,7 @@ __exportStar(require("./CellFormat.js"), exports);
|
|
|
38
38
|
__exportStar(require("./Chunk.js"), exports);
|
|
39
39
|
__exportStar(require("./ChunkContentItem.js"), exports);
|
|
40
40
|
__exportStar(require("./ChunkResult.js"), exports);
|
|
41
|
+
__exportStar(require("./CollabAgentSendMessageResponseOut.js"), exports);
|
|
41
42
|
__exportStar(require("./ConversationAssetInfo.js"), exports);
|
|
42
43
|
__exportStar(require("./ConversationMessage.js"), exports);
|
|
43
44
|
__exportStar(require("./ConversationResult.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.3.
|
|
1
|
+
export declare const SDK_VERSION = "4.3.2052";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@athenaintel/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "4.3.
|
|
10
|
-
"User-Agent": "@athenaintel/sdk/4.3.
|
|
9
|
+
"X-Fern-SDK-Version": "4.3.2052",
|
|
10
|
+
"User-Agent": "@athenaintel/sdk/4.3.2052",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
|
|
2
2
|
import { AopClient } from "./api/resources/aop/client/Client.mjs";
|
|
3
3
|
import { AssetsClient } from "./api/resources/assets/client/Client.mjs";
|
|
4
|
+
import { CollabAgentsClient } from "./api/resources/collabAgents/client/Client.mjs";
|
|
4
5
|
import { ComputerClient } from "./api/resources/computer/client/Client.mjs";
|
|
5
6
|
import { DatabasesClient } from "./api/resources/databases/client/Client.mjs";
|
|
6
7
|
import { MeetingsClient } from "./api/resources/meetings/client/Client.mjs";
|
|
@@ -24,6 +25,7 @@ export declare class AthenaIntelligenceClient {
|
|
|
24
25
|
protected _agents: AgentsClient | undefined;
|
|
25
26
|
protected _aop: AopClient | undefined;
|
|
26
27
|
protected _assets: AssetsClient | undefined;
|
|
28
|
+
protected _collabAgents: CollabAgentsClient | undefined;
|
|
27
29
|
protected _computer: ComputerClient | undefined;
|
|
28
30
|
protected _databases: DatabasesClient | undefined;
|
|
29
31
|
protected _users: UsersClient | undefined;
|
|
@@ -38,6 +40,7 @@ export declare class AthenaIntelligenceClient {
|
|
|
38
40
|
get agents(): AgentsClient;
|
|
39
41
|
get aop(): AopClient;
|
|
40
42
|
get assets(): AssetsClient;
|
|
43
|
+
get collabAgents(): CollabAgentsClient;
|
|
41
44
|
get computer(): ComputerClient;
|
|
42
45
|
get databases(): DatabasesClient;
|
|
43
46
|
get users(): UsersClient;
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
|
|
3
3
|
import { AopClient } from "./api/resources/aop/client/Client.mjs";
|
|
4
4
|
import { AssetsClient } from "./api/resources/assets/client/Client.mjs";
|
|
5
|
+
import { CollabAgentsClient } from "./api/resources/collabAgents/client/Client.mjs";
|
|
5
6
|
import { ComputerClient } from "./api/resources/computer/client/Client.mjs";
|
|
6
7
|
import { DatabasesClient } from "./api/resources/databases/client/Client.mjs";
|
|
7
8
|
import { MeetingsClient } from "./api/resources/meetings/client/Client.mjs";
|
|
@@ -29,6 +30,10 @@ export class AthenaIntelligenceClient {
|
|
|
29
30
|
var _a;
|
|
30
31
|
return ((_a = this._assets) !== null && _a !== void 0 ? _a : (this._assets = new AssetsClient(this._options)));
|
|
31
32
|
}
|
|
33
|
+
get collabAgents() {
|
|
34
|
+
var _a;
|
|
35
|
+
return ((_a = this._collabAgents) !== null && _a !== void 0 ? _a : (this._collabAgents = new CollabAgentsClient(this._options)));
|
|
36
|
+
}
|
|
32
37
|
get computer() {
|
|
33
38
|
var _a;
|
|
34
39
|
return ((_a = this._computer) !== null && _a !== void 0 ? _a : (this._computer = new ComputerClient(this._options)));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as core from "../../core/index.mjs";
|
|
2
2
|
import * as errors from "../../errors/index.mjs";
|
|
3
3
|
export declare class ConflictError extends errors.AthenaIntelligenceError {
|
|
4
|
-
constructor(body
|
|
4
|
+
constructor(body?: unknown, rawResponse?: core.RawResponse);
|
|
5
5
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as AthenaIntelligence from "../../../index.mjs";
|
|
5
|
+
export declare namespace CollabAgentsClient {
|
|
6
|
+
interface Options extends BaseClientOptions {
|
|
7
|
+
}
|
|
8
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare class CollabAgentsClient {
|
|
12
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<CollabAgentsClient.Options>;
|
|
13
|
+
constructor(options: CollabAgentsClient.Options);
|
|
14
|
+
/**
|
|
15
|
+
* Submit a message to a collab agent through its Programmatic channel. The agent must have the channel explicitly enabled (programmaticEnabled) and must be shared with the caller. With wait=false (default) the submission is queued and the endpoint returns 202 immediately; the resulting session appears in Athena under the caller's account. With wait=true the request long-polls: the connection stays open while the agent runs and the final agent message is returned verbatim in the reply field — size client timeouts for multi-minute runs. Submissions from the same caller with the same clientThreadKey continue one conversation until 24 hours of inactivity.
|
|
16
|
+
*
|
|
17
|
+
* @param {AthenaIntelligence.CollabAgentSendMessageRequestIn} request
|
|
18
|
+
* @param {CollabAgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
|
+
*
|
|
20
|
+
* @throws {@link AthenaIntelligence.ForbiddenError}
|
|
21
|
+
* @throws {@link AthenaIntelligence.NotFoundError}
|
|
22
|
+
* @throws {@link AthenaIntelligence.ConflictError}
|
|
23
|
+
* @throws {@link AthenaIntelligence.UnprocessableEntityError}
|
|
24
|
+
* @throws {@link AthenaIntelligence.InternalServerError}
|
|
25
|
+
* @throws {@link AthenaIntelligence.BadGatewayError}
|
|
26
|
+
* @throws {@link AthenaIntelligence.ServiceUnavailableError}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* await client.collabAgents.sendMessage({
|
|
30
|
+
* asset_id: "asset_id",
|
|
31
|
+
* clientThreadKey: "crm-sync-42",
|
|
32
|
+
* message: "Summarize yesterday's pipeline changes.",
|
|
33
|
+
* wait: true
|
|
34
|
+
* })
|
|
35
|
+
*/
|
|
36
|
+
sendMessage(request: AthenaIntelligence.CollabAgentSendMessageRequestIn, requestOptions?: CollabAgentsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.CollabAgentSendMessageResponseOut>;
|
|
37
|
+
private __sendMessage;
|
|
38
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
24
|
+
import * as core from "../../../../core/index.mjs";
|
|
25
|
+
import * as environments from "../../../../environments.mjs";
|
|
26
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
27
|
+
import * as AthenaIntelligence from "../../../index.mjs";
|
|
28
|
+
export class CollabAgentsClient {
|
|
29
|
+
constructor(options) {
|
|
30
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Submit a message to a collab agent through its Programmatic channel. The agent must have the channel explicitly enabled (programmaticEnabled) and must be shared with the caller. With wait=false (default) the submission is queued and the endpoint returns 202 immediately; the resulting session appears in Athena under the caller's account. With wait=true the request long-polls: the connection stays open while the agent runs and the final agent message is returned verbatim in the reply field — size client timeouts for multi-minute runs. Submissions from the same caller with the same clientThreadKey continue one conversation until 24 hours of inactivity.
|
|
34
|
+
*
|
|
35
|
+
* @param {AthenaIntelligence.CollabAgentSendMessageRequestIn} request
|
|
36
|
+
* @param {CollabAgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
|
+
*
|
|
38
|
+
* @throws {@link AthenaIntelligence.ForbiddenError}
|
|
39
|
+
* @throws {@link AthenaIntelligence.NotFoundError}
|
|
40
|
+
* @throws {@link AthenaIntelligence.ConflictError}
|
|
41
|
+
* @throws {@link AthenaIntelligence.UnprocessableEntityError}
|
|
42
|
+
* @throws {@link AthenaIntelligence.InternalServerError}
|
|
43
|
+
* @throws {@link AthenaIntelligence.BadGatewayError}
|
|
44
|
+
* @throws {@link AthenaIntelligence.ServiceUnavailableError}
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* await client.collabAgents.sendMessage({
|
|
48
|
+
* asset_id: "asset_id",
|
|
49
|
+
* clientThreadKey: "crm-sync-42",
|
|
50
|
+
* message: "Summarize yesterday's pipeline changes.",
|
|
51
|
+
* wait: true
|
|
52
|
+
* })
|
|
53
|
+
*/
|
|
54
|
+
sendMessage(request, requestOptions) {
|
|
55
|
+
return core.HttpResponsePromise.fromPromise(this.__sendMessage(request, requestOptions));
|
|
56
|
+
}
|
|
57
|
+
__sendMessage(request, requestOptions) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
60
|
+
const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
|
|
61
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
62
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
63
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
64
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/collab-agents/${core.url.encodePathParam(assetId)}/messages`),
|
|
65
|
+
method: "POST",
|
|
66
|
+
headers: _headers,
|
|
67
|
+
contentType: "application/json",
|
|
68
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
69
|
+
requestType: "json",
|
|
70
|
+
body: _body,
|
|
71
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
72
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
73
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
74
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
75
|
+
logging: this._options.logging,
|
|
76
|
+
});
|
|
77
|
+
if (_response.ok) {
|
|
78
|
+
return {
|
|
79
|
+
data: _response.body,
|
|
80
|
+
rawResponse: _response.rawResponse,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
if (_response.error.reason === "status-code") {
|
|
84
|
+
switch (_response.error.statusCode) {
|
|
85
|
+
case 403:
|
|
86
|
+
throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
87
|
+
case 404:
|
|
88
|
+
throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
|
|
89
|
+
case 409:
|
|
90
|
+
throw new AthenaIntelligence.ConflictError(_response.error.body, _response.rawResponse);
|
|
91
|
+
case 422:
|
|
92
|
+
throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
93
|
+
case 500:
|
|
94
|
+
throw new AthenaIntelligence.InternalServerError(_response.error.body, _response.rawResponse);
|
|
95
|
+
case 502:
|
|
96
|
+
throw new AthenaIntelligence.BadGatewayError(_response.error.body, _response.rawResponse);
|
|
97
|
+
case 503:
|
|
98
|
+
throw new AthenaIntelligence.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
99
|
+
default:
|
|
100
|
+
throw new errors.AthenaIntelligenceError({
|
|
101
|
+
statusCode: _response.error.statusCode,
|
|
102
|
+
body: _response.error.body,
|
|
103
|
+
rawResponse: _response.rawResponse,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
switch (_response.error.reason) {
|
|
108
|
+
case "non-json":
|
|
109
|
+
throw new errors.AthenaIntelligenceError({
|
|
110
|
+
statusCode: _response.error.statusCode,
|
|
111
|
+
body: _response.error.rawBody,
|
|
112
|
+
rawResponse: _response.rawResponse,
|
|
113
|
+
});
|
|
114
|
+
case "body-is-null":
|
|
115
|
+
throw new errors.AthenaIntelligenceError({
|
|
116
|
+
statusCode: _response.error.statusCode,
|
|
117
|
+
rawResponse: _response.rawResponse,
|
|
118
|
+
});
|
|
119
|
+
case "timeout":
|
|
120
|
+
throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/collab-agents/{asset_id}/messages.");
|
|
121
|
+
case "unknown":
|
|
122
|
+
throw new errors.AthenaIntelligenceError({
|
|
123
|
+
message: _response.error.errorMessage,
|
|
124
|
+
rawResponse: _response.rawResponse,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
package/dist/esm/api/resources/collabAgents/client/requests/CollabAgentSendMessageRequestIn.d.mts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* asset_id: "asset_id",
|
|
5
|
+
* clientThreadKey: "crm-sync-42",
|
|
6
|
+
* message: "Summarize yesterday's pipeline changes.",
|
|
7
|
+
* wait: true
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface CollabAgentSendMessageRequestIn {
|
|
11
|
+
asset_id: string;
|
|
12
|
+
/** Optional caller-chosen conversation key. Submissions from the same caller with the same key continue one agent session (until 24 hours of inactivity); different keys hold independent conversations. Omitted, all of a caller's submissions to this agent share one 'default' thread. */
|
|
13
|
+
clientThreadKey?: string | null;
|
|
14
|
+
/** The message text to submit to the agent. Delivered verbatim as the user turn of the agent session. */
|
|
15
|
+
message: string;
|
|
16
|
+
/** When false (default), the submission is queued and the endpoint returns 202 immediately. When true, the request long-polls: the connection is held open while the agent runs (typically seconds to a few minutes) and the final reply is returned in the response. */
|
|
17
|
+
wait?: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { CollabAgentSendMessageRequestIn } from "./CollabAgentSendMessageRequestIn.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -4,6 +4,8 @@ export * from "./aop/client/requests/index.mjs";
|
|
|
4
4
|
export * as aop from "./aop/index.mjs";
|
|
5
5
|
export * from "./assets/client/requests/index.mjs";
|
|
6
6
|
export * as assets from "./assets/index.mjs";
|
|
7
|
+
export * from "./collabAgents/client/requests/index.mjs";
|
|
8
|
+
export * as collabAgents from "./collabAgents/index.mjs";
|
|
7
9
|
export * from "./computer/client/requests/index.mjs";
|
|
8
10
|
export * as computer from "./computer/index.mjs";
|
|
9
11
|
export * from "./databases/client/requests/index.mjs";
|
|
@@ -4,6 +4,8 @@ export * from "./aop/client/requests/index.mjs";
|
|
|
4
4
|
export * as aop from "./aop/index.mjs";
|
|
5
5
|
export * from "./assets/client/requests/index.mjs";
|
|
6
6
|
export * as assets from "./assets/index.mjs";
|
|
7
|
+
export * from "./collabAgents/client/requests/index.mjs";
|
|
8
|
+
export * as collabAgents from "./collabAgents/index.mjs";
|
|
7
9
|
export * from "./computer/client/requests/index.mjs";
|
|
8
10
|
export * as computer from "./computer/index.mjs";
|
|
9
11
|
export * from "./databases/client/requests/index.mjs";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response for a programmatic message submission.
|
|
3
|
+
*/
|
|
4
|
+
export interface CollabAgentSendMessageResponseOut {
|
|
5
|
+
/** The agent's final message, verbatim. Null on 202 responses, and null on completed runs where the agent declined to reply (it invoked its dont_respond tool). */
|
|
6
|
+
reply?: string | null;
|
|
7
|
+
/** Asset id of the Athena session that handled the submission. Null on 202 responses (the session is resolved asynchronously). */
|
|
8
|
+
sessionId?: string | null;
|
|
9
|
+
/** 'accepted' when the submission was queued (wait=false, HTTP 202); 'completed' when the agent run finished inline (wait=true, HTTP 200). */
|
|
10
|
+
status: string;
|
|
11
|
+
/** The conversation key this submission was routed under — the clientThreadKey from the request, or 'default'. */
|
|
12
|
+
threadKey: string;
|
|
13
|
+
}
|
|
@@ -22,6 +22,7 @@ export * from "./CellFormat.mjs";
|
|
|
22
22
|
export * from "./Chunk.mjs";
|
|
23
23
|
export * from "./ChunkContentItem.mjs";
|
|
24
24
|
export * from "./ChunkResult.mjs";
|
|
25
|
+
export * from "./CollabAgentSendMessageResponseOut.mjs";
|
|
25
26
|
export * from "./ConversationAssetInfo.mjs";
|
|
26
27
|
export * from "./ConversationMessage.mjs";
|
|
27
28
|
export * from "./ConversationResult.mjs";
|
|
@@ -22,6 +22,7 @@ export * from "./CellFormat.mjs";
|
|
|
22
22
|
export * from "./Chunk.mjs";
|
|
23
23
|
export * from "./ChunkContentItem.mjs";
|
|
24
24
|
export * from "./ChunkResult.mjs";
|
|
25
|
+
export * from "./CollabAgentSendMessageResponseOut.mjs";
|
|
25
26
|
export * from "./ConversationAssetInfo.mjs";
|
|
26
27
|
export * from "./ConversationMessage.mjs";
|
|
27
28
|
export * from "./ConversationResult.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.3.
|
|
1
|
+
export declare const SDK_VERSION = "4.3.2052";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.3.
|
|
1
|
+
export const SDK_VERSION = "4.3.2052";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -1226,6 +1226,75 @@ await client.assets.updateWorkspaceAccess({
|
|
|
1226
1226
|
</dl>
|
|
1227
1227
|
|
|
1228
1228
|
|
|
1229
|
+
</dd>
|
|
1230
|
+
</dl>
|
|
1231
|
+
</details>
|
|
1232
|
+
|
|
1233
|
+
## CollabAgents
|
|
1234
|
+
<details><summary><code>client.collabAgents.<a href="/src/api/resources/collabAgents/client/Client.ts">sendMessage</a>({ ...params }) -> AthenaIntelligence.CollabAgentSendMessageResponseOut</code></summary>
|
|
1235
|
+
<dl>
|
|
1236
|
+
<dd>
|
|
1237
|
+
|
|
1238
|
+
#### 📝 Description
|
|
1239
|
+
|
|
1240
|
+
<dl>
|
|
1241
|
+
<dd>
|
|
1242
|
+
|
|
1243
|
+
<dl>
|
|
1244
|
+
<dd>
|
|
1245
|
+
|
|
1246
|
+
Submit a message to a collab agent through its Programmatic channel. The agent must have the channel explicitly enabled (programmaticEnabled) and must be shared with the caller. With wait=false (default) the submission is queued and the endpoint returns 202 immediately; the resulting session appears in Athena under the caller's account. With wait=true the request long-polls: the connection stays open while the agent runs and the final agent message is returned verbatim in the reply field — size client timeouts for multi-minute runs. Submissions from the same caller with the same clientThreadKey continue one conversation until 24 hours of inactivity.
|
|
1247
|
+
</dd>
|
|
1248
|
+
</dl>
|
|
1249
|
+
</dd>
|
|
1250
|
+
</dl>
|
|
1251
|
+
|
|
1252
|
+
#### 🔌 Usage
|
|
1253
|
+
|
|
1254
|
+
<dl>
|
|
1255
|
+
<dd>
|
|
1256
|
+
|
|
1257
|
+
<dl>
|
|
1258
|
+
<dd>
|
|
1259
|
+
|
|
1260
|
+
```typescript
|
|
1261
|
+
await client.collabAgents.sendMessage({
|
|
1262
|
+
asset_id: "asset_id",
|
|
1263
|
+
clientThreadKey: "crm-sync-42",
|
|
1264
|
+
message: "Summarize yesterday's pipeline changes.",
|
|
1265
|
+
wait: true
|
|
1266
|
+
});
|
|
1267
|
+
|
|
1268
|
+
```
|
|
1269
|
+
</dd>
|
|
1270
|
+
</dl>
|
|
1271
|
+
</dd>
|
|
1272
|
+
</dl>
|
|
1273
|
+
|
|
1274
|
+
#### ⚙️ Parameters
|
|
1275
|
+
|
|
1276
|
+
<dl>
|
|
1277
|
+
<dd>
|
|
1278
|
+
|
|
1279
|
+
<dl>
|
|
1280
|
+
<dd>
|
|
1281
|
+
|
|
1282
|
+
**request:** `AthenaIntelligence.CollabAgentSendMessageRequestIn`
|
|
1283
|
+
|
|
1284
|
+
</dd>
|
|
1285
|
+
</dl>
|
|
1286
|
+
|
|
1287
|
+
<dl>
|
|
1288
|
+
<dd>
|
|
1289
|
+
|
|
1290
|
+
**requestOptions:** `CollabAgentsClient.RequestOptions`
|
|
1291
|
+
|
|
1292
|
+
</dd>
|
|
1293
|
+
</dl>
|
|
1294
|
+
</dd>
|
|
1295
|
+
</dl>
|
|
1296
|
+
|
|
1297
|
+
|
|
1229
1298
|
</dd>
|
|
1230
1299
|
</dl>
|
|
1231
1300
|
</details>
|