@salesforce/agents 0.12.8 → 0.12.10
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/lib/agentPreview.d.ts +70 -0
- package/lib/agentPreview.js +85 -0
- package/lib/agentPreview.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/maybe-mock.d.ts +6 -2
- package/lib/maybe-mock.js +24 -5
- package/lib/maybe-mock.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Connection } from '@salesforce/core';
|
|
2
|
+
type ApiStatus = {
|
|
3
|
+
status: 'UP' | 'DOWN';
|
|
4
|
+
};
|
|
5
|
+
type Href = {
|
|
6
|
+
href: string;
|
|
7
|
+
};
|
|
8
|
+
export type AgentPreviewError = {
|
|
9
|
+
status: number;
|
|
10
|
+
path: string;
|
|
11
|
+
requestId: string;
|
|
12
|
+
error: string;
|
|
13
|
+
message: string;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
};
|
|
16
|
+
export type AgentPreviewMessageLinks = {
|
|
17
|
+
self: Href | null;
|
|
18
|
+
messages: Href | null;
|
|
19
|
+
session: Href | null;
|
|
20
|
+
end: Href | null;
|
|
21
|
+
};
|
|
22
|
+
export type MessageType = 'Inform' | 'TextChunk' | 'ProgressIndicator' | 'Inquire' | 'Confirm' | 'Failure' | 'Escalate' | 'SessionEnded' | 'EndOfTurn' | 'Error';
|
|
23
|
+
export type AgentPreviewMessage = {
|
|
24
|
+
type: MessageType;
|
|
25
|
+
id: string;
|
|
26
|
+
feedbackId: string;
|
|
27
|
+
planId: string;
|
|
28
|
+
isContentSafe: boolean;
|
|
29
|
+
message: string;
|
|
30
|
+
result: {
|
|
31
|
+
type: string;
|
|
32
|
+
property: string;
|
|
33
|
+
value: any;
|
|
34
|
+
};
|
|
35
|
+
citedReferences: {
|
|
36
|
+
type: string;
|
|
37
|
+
value: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export type AgentPreviewStartResponse = {
|
|
41
|
+
sessionId: string;
|
|
42
|
+
_links: AgentPreviewMessageLinks;
|
|
43
|
+
messages: AgentPreviewMessage[];
|
|
44
|
+
};
|
|
45
|
+
export type AgentPreviewSendResponse = {
|
|
46
|
+
messages: AgentPreviewMessage[];
|
|
47
|
+
_links: AgentPreviewMessageLinks;
|
|
48
|
+
};
|
|
49
|
+
export type AgentPreviewEndMessage = {
|
|
50
|
+
type: string;
|
|
51
|
+
id: string;
|
|
52
|
+
reason: string;
|
|
53
|
+
feedbackId: string;
|
|
54
|
+
};
|
|
55
|
+
export type AgentPreviewEndResponse = {
|
|
56
|
+
messages: AgentPreviewEndMessage[];
|
|
57
|
+
_links: AgentPreviewMessageLinks;
|
|
58
|
+
};
|
|
59
|
+
type EndReason = 'UserRequest' | 'Transfer' | 'Expiration' | 'Error' | 'Other';
|
|
60
|
+
export declare class AgentPreview {
|
|
61
|
+
private apiBase;
|
|
62
|
+
private instanceUrl;
|
|
63
|
+
private maybeMock;
|
|
64
|
+
constructor(connection: Connection);
|
|
65
|
+
start(botId: string): Promise<AgentPreviewStartResponse>;
|
|
66
|
+
send(sessionId: string, message: string): Promise<AgentPreviewSendResponse>;
|
|
67
|
+
end(sessionId: string, reason: EndReason): Promise<AgentPreviewEndResponse>;
|
|
68
|
+
status(): Promise<ApiStatus>;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024, salesforce.com, inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AgentPreview = void 0;
|
|
10
|
+
const node_crypto_1 = require("node:crypto");
|
|
11
|
+
const core_1 = require("@salesforce/core");
|
|
12
|
+
const maybe_mock_1 = require("./maybe-mock");
|
|
13
|
+
class AgentPreview {
|
|
14
|
+
apiBase;
|
|
15
|
+
instanceUrl;
|
|
16
|
+
maybeMock;
|
|
17
|
+
constructor(connection) {
|
|
18
|
+
this.apiBase = 'https://api.salesforce.com/einstein/ai-agent/v1';
|
|
19
|
+
this.instanceUrl = connection.instanceUrl;
|
|
20
|
+
this.maybeMock = new maybe_mock_1.MaybeMock(connection);
|
|
21
|
+
}
|
|
22
|
+
async start(botId) {
|
|
23
|
+
const url = `${this.apiBase}/agents/${botId}/sessions`;
|
|
24
|
+
const body = {
|
|
25
|
+
externalSessionKey: (0, node_crypto_1.randomUUID)(),
|
|
26
|
+
instanceConfig: {
|
|
27
|
+
endpoint: this.instanceUrl,
|
|
28
|
+
},
|
|
29
|
+
streamingCapabilities: {
|
|
30
|
+
chunkTypes: ['Text'],
|
|
31
|
+
},
|
|
32
|
+
bypassUser: true,
|
|
33
|
+
};
|
|
34
|
+
try {
|
|
35
|
+
return await this.maybeMock.request('POST', url, body);
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
throw core_1.SfError.wrap(err);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async send(sessionId, message) {
|
|
42
|
+
const url = `${this.apiBase}/sessions/${sessionId}/messages`;
|
|
43
|
+
const body = {
|
|
44
|
+
message: {
|
|
45
|
+
// https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-examples.html#send-synchronous-messages
|
|
46
|
+
// > A number that you provide to represent the sequence ID. Increase this number for each subsequent message in this session.
|
|
47
|
+
sequenceId: Date.now(),
|
|
48
|
+
type: 'Text',
|
|
49
|
+
text: message,
|
|
50
|
+
},
|
|
51
|
+
variables: [],
|
|
52
|
+
};
|
|
53
|
+
try {
|
|
54
|
+
return await this.maybeMock.request('POST', url, body);
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
throw core_1.SfError.wrap(err);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async end(sessionId, reason) {
|
|
61
|
+
const url = `${this.apiBase}/sessions/${sessionId}`;
|
|
62
|
+
try {
|
|
63
|
+
// https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-examples.html#end-session
|
|
64
|
+
return await this.maybeMock.request('DELETE', url, undefined, {
|
|
65
|
+
'x-session-end-reason': reason,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
throw core_1.SfError.wrap(err);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Get the status of the Agent API (UP | DOWN)
|
|
73
|
+
async status() {
|
|
74
|
+
const base = 'https://test.api.salesforce.com';
|
|
75
|
+
const url = `${base}/einstein/ai-agent/v1/status`;
|
|
76
|
+
try {
|
|
77
|
+
return await this.maybeMock.request('GET', url);
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
throw core_1.SfError.wrap(err);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.AgentPreview = AgentPreview;
|
|
85
|
+
//# sourceMappingURL=agentPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentPreview.js","sourceRoot":"","sources":["../src/agentPreview.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6CAAyC;AACzC,2CAA2C;AAE3C,6CAAyC;AAgFzC,MAAa,YAAY;IACf,OAAO,CAAS;IAChB,WAAW,CAAS;IACpB,SAAS,CAAY;IAE7B,YAAmB,UAAsB;QACvC,IAAI,CAAC,OAAO,GAAG,iDAAiD,CAAC;QACjE,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QAC1C,IAAI,CAAC,SAAS,GAAG,IAAI,sBAAS,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,KAAa;Q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;YACH,iGAAiG;YACjG,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAA0B,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE;gBACrF,sBAAsB,EAAE,MAAM;aAC/B,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,cAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,8CAA8C;IACvC,KAAK,CAAC,MAAM;QACjB,MAAM,IAAI,GAAG,iCAAiC,CAAC;QAC/C,MAAM,GAAG,GAAG,GAAG,IAAI,8BAA8B,CAAC;QAElD,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAY,KAAK,EAAE,GAAG,CAAC,CAAC;QAC7D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,cAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;CACF;AA5ED,oCA4EC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { type AgentCreateConfig, type AgentCreateResponse, type AgentJobSpec, type AgentJobSpecCreateConfig, type AgentTone, type AgentType, type DraftAgentTopics, type DraftAgentTopicsBody, type DraftAgentTopicsResponse, } from './types';
|
|
2
2
|
export { Agent, AgentCreateLifecycleStages, generateAgentApiName } from './agent';
|
|
3
3
|
export { AgentTester, AgentTestCreateLifecycleStages, convertTestResultsToFormat, writeTestSpec, generateTestSpecFromAiEvalDefinition, humanFriendlyName, type AvailableDefinition, type AgentTestResultsResponse, type AgentTestStartResponse, type AgentTestStatusResponse, type TestCaseResult, type TestStatus, } from './agentTester';
|
|
4
|
+
export { AgentPreview, type AgentPreviewMessageLinks, type AgentPreviewMessage, type AgentPreviewStartResponse, type AgentPreviewSendResponse, type AgentPreviewEndResponse, } from './agentPreview';
|
package/lib/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.humanFriendlyName = exports.generateTestSpecFromAiEvalDefinition = exports.writeTestSpec = exports.convertTestResultsToFormat = exports.AgentTestCreateLifecycleStages = exports.AgentTester = exports.generateAgentApiName = exports.AgentCreateLifecycleStages = exports.Agent = void 0;
|
|
9
|
+
exports.AgentPreview = exports.humanFriendlyName = exports.generateTestSpecFromAiEvalDefinition = exports.writeTestSpec = exports.convertTestResultsToFormat = exports.AgentTestCreateLifecycleStages = exports.AgentTester = exports.generateAgentApiName = exports.AgentCreateLifecycleStages = exports.Agent = void 0;
|
|
10
10
|
var agent_1 = require("./agent");
|
|
11
11
|
Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return agent_1.Agent; } });
|
|
12
12
|
Object.defineProperty(exports, "AgentCreateLifecycleStages", { enumerable: true, get: function () { return agent_1.AgentCreateLifecycleStages; } });
|
|
@@ -18,4 +18,6 @@ Object.defineProperty(exports, "convertTestResultsToFormat", { enumerable: true,
|
|
|
18
18
|
Object.defineProperty(exports, "writeTestSpec", { enumerable: true, get: function () { return agentTester_1.writeTestSpec; } });
|
|
19
19
|
Object.defineProperty(exports, "generateTestSpecFromAiEvalDefinition", { enumerable: true, get: function () { return agentTester_1.generateTestSpecFromAiEvalDefinition; } });
|
|
20
20
|
Object.defineProperty(exports, "humanFriendlyName", { enumerable: true, get: function () { return agentTester_1.humanFriendlyName; } });
|
|
21
|
+
var agentPreview_1 = require("./agentPreview");
|
|
22
|
+
Object.defineProperty(exports, "AgentPreview", { enumerable: true, get: function () { return agentPreview_1.AgentPreview; } });
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAaH,iCAAkF;AAAzE,8FAAA,KAAK,OAAA;AAAE,mHAAA,0BAA0B,OAAA;AAAE,6GAAA,oBAAoB,OAAA;AAChE,6CAauB;AAZrB,0GAAA,WAAW,OAAA;AACX,6HAAA,8BAA8B,OAAA;AAC9B,yHAAA,0BAA0B,OAAA;AAC1B,4GAAA,aAAa,OAAA;AACb,mIAAA,oCAAoC,OAAA;AACpC,gHAAA,iBAAiB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAaH,iCAAkF;AAAzE,8FAAA,KAAK,OAAA;AAAE,mHAAA,0BAA0B,OAAA;AAAE,6GAAA,oBAAoB,OAAA;AAChE,6CAauB;AAZrB,0GAAA,WAAW,OAAA;AACX,6HAAA,8BAA8B,OAAA;AAC9B,yHAAA,0BAA0B,OAAA;AAC1B,4GAAA,aAAa,OAAA;AACb,mIAAA,oCAAoC,OAAA;AACpC,gHAAA,iBAAiB,OAAA;AAQnB,+CAOwB;AANtB,4GAAA,YAAY,OAAA"}
|
package/lib/maybe-mock.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Connection } from '@salesforce/core';
|
|
2
2
|
import nock from 'nock';
|
|
3
|
+
type HttpHeaders = {
|
|
4
|
+
[name: string]: string;
|
|
5
|
+
};
|
|
3
6
|
/**
|
|
4
7
|
* A class to act as an in-between the library's request, and the orgs response
|
|
5
8
|
*
|
|
@@ -17,10 +20,11 @@ export declare class MaybeMock {
|
|
|
17
20
|
* Will either use mocked responses, or the real server response, as the library/APIs become more feature complete,
|
|
18
21
|
* there will be fewer mocks and more real responses
|
|
19
22
|
*
|
|
20
|
-
* @param {"GET" | "POST"} method
|
|
23
|
+
* @param {"GET" | "POST" | "DELETE"} method
|
|
21
24
|
* @param {string} url
|
|
22
25
|
* @param {nock.RequestBodyMatcher} body
|
|
23
26
|
* @returns {Promise<T>}
|
|
24
27
|
*/
|
|
25
|
-
request<T extends nock.Body>(method: 'GET' | 'POST', url: string, body?: nock.RequestBodyMatcher): Promise<T>;
|
|
28
|
+
request<T extends nock.Body>(method: 'GET' | 'POST' | 'DELETE', url: string, body?: nock.RequestBodyMatcher, headers?: HttpHeaders): Promise<T>;
|
|
26
29
|
}
|
|
30
|
+
export {};
|
package/lib/maybe-mock.js
CHANGED
|
@@ -72,7 +72,7 @@ async function readDirectory(path) {
|
|
|
72
72
|
return (await Promise.all(promises)).filter((r) => !!r);
|
|
73
73
|
}
|
|
74
74
|
async function readResponses(mockDir, url, logger) {
|
|
75
|
-
const mockResponseName = url.replace(/\//g, '_').replace(/^_/, '').split('?')[0];
|
|
75
|
+
const mockResponseName = url.replace(/\//g, '_').replace(/:/g, '_').replace(/^_/, '').split('?')[0];
|
|
76
76
|
const mockResponsePath = (0, node_path_1.join)(mockDir, mockResponseName);
|
|
77
77
|
// Try all possibilities for the mock response file
|
|
78
78
|
const responses = (await Promise.all([
|
|
@@ -126,27 +126,39 @@ class MaybeMock {
|
|
|
126
126
|
* Will either use mocked responses, or the real server response, as the library/APIs become more feature complete,
|
|
127
127
|
* there will be fewer mocks and more real responses
|
|
128
128
|
*
|
|
129
|
-
* @param {"GET" | "POST"} method
|
|
129
|
+
* @param {"GET" | "POST" | "DELETE"} method
|
|
130
130
|
* @param {string} url
|
|
131
131
|
* @param {nock.RequestBodyMatcher} body
|
|
132
132
|
* @returns {Promise<T>}
|
|
133
133
|
*/
|
|
134
|
-
async request(method, url, body = {}) {
|
|
134
|
+
async request(method, url, body = {}, headers = {}) {
|
|
135
135
|
if (this.mockDir) {
|
|
136
136
|
this.logger.debug(`Mocking ${method} request to ${url} using ${this.mockDir}`);
|
|
137
137
|
const responses = await readResponses(this.mockDir, url, this.logger);
|
|
138
138
|
const baseUrl = this.connection.baseUrl();
|
|
139
139
|
const scope = this.scopes.get(baseUrl) ?? (0, nock_1.default)(baseUrl);
|
|
140
|
+
// Look up status code to determine if it's successful or not
|
|
141
|
+
// Be have to assert this is a number because AgentTester has a status that is non-numeric
|
|
142
|
+
const getCode = (response) => typeof response === 'object' && 'status' in response && typeof response.status === 'number'
|
|
143
|
+
? response.status
|
|
144
|
+
: 200;
|
|
145
|
+
// This is a hack to work with SFAP endpoints
|
|
146
|
+
url = url.replace('https://api.salesforce.com', '');
|
|
140
147
|
this.scopes.set(baseUrl, scope);
|
|
141
148
|
switch (method) {
|
|
142
149
|
case 'GET':
|
|
143
150
|
for (const response of responses) {
|
|
144
|
-
scope.get(url).reply(
|
|
151
|
+
scope.get(url).reply(getCode(response), response);
|
|
145
152
|
}
|
|
146
153
|
break;
|
|
147
154
|
case 'POST':
|
|
148
155
|
for (const response of responses) {
|
|
149
|
-
scope.post(url, body).reply(
|
|
156
|
+
scope.post(url, body).reply(getCode(response), response);
|
|
157
|
+
}
|
|
158
|
+
break;
|
|
159
|
+
case 'DELETE':
|
|
160
|
+
for (const response of responses) {
|
|
161
|
+
scope.delete(url).reply(getCode(response), response);
|
|
150
162
|
}
|
|
151
163
|
break;
|
|
152
164
|
}
|
|
@@ -163,6 +175,13 @@ class MaybeMock {
|
|
|
163
175
|
});
|
|
164
176
|
}
|
|
165
177
|
return this.connection.requestPost(url, body, { retry: { maxRetries: 3 } });
|
|
178
|
+
case 'DELETE':
|
|
179
|
+
// We use .request() rather than .requestDelete() so that we can pass in the headers
|
|
180
|
+
return this.connection.request({
|
|
181
|
+
method: 'DELETE',
|
|
182
|
+
url,
|
|
183
|
+
headers,
|
|
184
|
+
}, { retry: { maxRetries: 3 } });
|
|
166
185
|
}
|
|
167
186
|
}
|
|
168
187
|
}
|
package/lib/maybe-mock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-mock.js","sourceRoot":"","sources":["../src/maybe-mock.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,yCAA0C;AAC1C,qCAA+C;AAC/C,+CAAqD;AACrD,2CAA+D;AA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