@salesforce/agents 0.11.0 → 0.12.0

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/agent.d.ts CHANGED
@@ -1,17 +1,11 @@
1
1
  import { Connection, SfProject } from '@salesforce/core';
2
- import { type SfAgent, type AgentCreateConfig, type AgentCreateConfigV2, type AgentCreateResponse, type AgentCreateResponseV2, type AgentJobSpec, type AgentJobSpecV2, type AgentJobSpecCreateConfig, type AgentJobSpecCreateConfigV2 } from './types.js';
2
+ import { type AgentCreateConfig, type AgentCreateResponse, type AgentJobSpec, type AgentJobSpecCreateConfig } from './types.js';
3
3
  /**
4
4
  * Events emitted during Agent.create() for consumers to listen to and keep track of progress
5
5
  *
6
- * @type {{DeployingMetadata: string, CreatingLocally: string, CreatingRemotely: string, RetrievingMetadata: string}}
6
+ * @type {{Creating: string, Previewing: string, Retrieving: string}}
7
7
  */
8
8
  export declare const AgentCreateLifecycleStages: {
9
- CreatingLocally: string;
10
- DeployingMetadata: string;
11
- CreatingRemotely: string;
12
- RetrievingMetadata: string;
13
- };
14
- export declare const AgentCreateLifecycleStagesV2: {
15
9
  Creating: string;
16
10
  Previewing: string;
17
11
  Retrieving: string;
@@ -19,7 +13,7 @@ export declare const AgentCreateLifecycleStagesV2: {
19
13
  /**
20
14
  * Class for creating Agents and agent specs.
21
15
  */
22
- export declare class Agent implements SfAgent {
16
+ export declare class Agent {
23
17
  private project;
24
18
  private logger;
25
19
  private maybeMock;
@@ -31,40 +25,20 @@ export declare class Agent implements SfAgent {
31
25
  * @param {SfProject} project
32
26
  */
33
27
  constructor(connection: Connection, project: SfProject);
34
- /**
35
- * From an AgentCreateConfig, deploy the required metadata, call the connect/attach-agent-topics endpoint, and then retrieve
36
- * the newly updated metadata back to the local project
37
- *
38
- * @deprecated Use the V2 APIs.
39
- *
40
- * @param {AgentCreateConfig} config
41
- * @returns {Promise<AgentCreateResponse>}
42
- */
43
- create(config: AgentCreateConfig): Promise<AgentCreateResponse>;
44
28
  /**
45
29
  * Creates an agent from a configuration, optionally saving the agent in an org.
46
30
  *
47
31
  * @param config a configuration for creating or previewing an agent
48
32
  * @returns the agent definition
49
33
  */
50
- createV2(config: AgentCreateConfigV2): Promise<AgentCreateResponseV2>;
34
+ create(config: AgentCreateConfig): Promise<AgentCreateResponse>;
51
35
  /**
52
36
  * Create an agent spec from provided data.
53
37
  *
54
- * @deprecated Use the V2 APIs.
55
- *
56
38
  * @param config The configuration used to generate an agent spec.
57
39
  */
58
40
  createSpec(config: AgentJobSpecCreateConfig): Promise<AgentJobSpec>;
59
- /**
60
- * Create an agent spec from provided data.
61
- *
62
- * @param config The configuration used to generate an agent spec.
63
- */
64
- createSpecV2(config: AgentJobSpecCreateConfigV2): Promise<AgentJobSpecV2>;
65
41
  private verifyAgentSpecConfig;
66
- private buildAgentJobSpecUrl;
67
- private createMetadata;
68
42
  }
69
43
  /**
70
44
  * Generate an API name from an agent name. Matches what the UI does.
package/lib/agent.js CHANGED
@@ -5,14 +5,9 @@
5
5
  * Licensed under the BSD 3-Clause license.
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
8
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.generateAgentApiName = exports.Agent = exports.AgentCreateLifecycleStagesV2 = exports.AgentCreateLifecycleStages = void 0;
9
+ exports.generateAgentApiName = exports.Agent = exports.AgentCreateLifecycleStages = void 0;
13
10
  const node_util_1 = require("node:util");
14
- const node_path_1 = __importDefault(require("node:path"));
15
- const node_fs_1 = __importDefault(require("node:fs"));
16
11
  const core_1 = require("@salesforce/core");
17
12
  const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
18
13
  const kit_1 = require("@salesforce/kit");
@@ -22,15 +17,9 @@ const messages = core_1.Messages.loadMessages('@salesforce/agents', 'agents');
22
17
  /**
23
18
  * Events emitted during Agent.create() for consumers to listen to and keep track of progress
24
19
  *
25
- * @type {{DeployingMetadata: string, CreatingLocally: string, CreatingRemotely: string, RetrievingMetadata: string}}
20
+ * @type {{Creating: string, Previewing: string, Retrieving: string}}
26
21
  */
27
22
  exports.AgentCreateLifecycleStages = {
28
- CreatingLocally: 'creatinglocally',
29
- DeployingMetadata: 'deployingmetadata',
30
- CreatingRemotely: 'creatingremotely',
31
- RetrievingMetadata: 'retrievingmetadata',
32
- };
33
- exports.AgentCreateLifecycleStagesV2 = {
34
23
  Creating: 'creatingAgent',
35
24
  Previewing: 'previewingAgent',
36
25
  Retrieving: 'retrievingAgent',
@@ -55,85 +44,32 @@ class Agent {
55
44
  this.maybeMock = new maybe_mock_1.MaybeMock(connection);
56
45
  this.connection = connection;
57
46
  }
58
- /**
59
- * From an AgentCreateConfig, deploy the required metadata, call the connect/attach-agent-topics endpoint, and then retrieve
60
- * the newly updated metadata back to the local project
61
- *
62
- * @deprecated Use the V2 APIs.
63
- *
64
- * @param {AgentCreateConfig} config
65
- * @returns {Promise<AgentCreateResponse>}
66
- */
67
- async create(config) {
68
- this.logger.debug(`Creating Agent using config: ${(0, node_util_1.inspect)(config)} in project: ${this.project.getPath()}`);
69
- await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStages.CreatingLocally, {});
70
- const sourcepaths = await this.createMetadata(config);
71
- await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStages.DeployingMetadata, {});
72
- const cs = await source_deploy_retrieve_1.ComponentSetBuilder.build({ sourcepath: sourcepaths });
73
- const deploy = await cs.deploy({ usernameOrConnection: this.connection });
74
- const result = await deploy.pollStatus({ timeout: kit_1.Duration.minutes(10_000), frequency: kit_1.Duration.seconds(1) });
75
- if (!result.response.success) {
76
- throw new core_1.SfError(result.response.errorMessage ?? `Unable to deploy ${result.response.id}`);
77
- }
78
- await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStages.CreatingRemotely, {});
79
- const plannerId = (await this.connection.singleRecordQuery(`SELECT Id
80
- FROM GenAiPlanner
81
- WHERE MasterLabel = 'MasterLabel for ${config.name}'`, { tooling: true })).Id;
82
- const url = `${this.connection.instanceUrl}/services/data/v${this.connection.getApiVersion()}/connect/attach-agent-topics`;
83
- const body = {
84
- plannerId,
85
- agentJobSpecs: config.jobSpec,
86
- companyDescription: config.companyDescription,
87
- role: config.role,
88
- companyName: config.companyName,
89
- agentType: config.type,
90
- };
91
- const response = await this.maybeMock.request('POST', url, body);
92
- await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStages.RetrievingMetadata, {});
93
- const genAiPluginNames = (await this.connection.tooling.query(`SELECT DeveloperName FROM GenAiPluginDefinition WHERE DeveloperName LIKE 'p_${plannerId}%'`)).records;
94
- // more MD types were created in the org, than were in the project when we started
95
- genAiPluginNames.map((r) => cs.add({ fullName: r.DeveloperName, type: 'GenAiPlugin' }));
96
- const retrieve = await cs.retrieve({
97
- usernameOrConnection: this.connection,
98
- merge: true,
99
- format: 'source',
100
- output: this.project.getDefaultPackage().path ?? 'force-app',
101
- });
102
- const retrieveResult = await retrieve.pollStatus({
103
- frequency: kit_1.Duration.seconds(1),
104
- timeout: kit_1.Duration.minutes(10_000),
105
- });
106
- if (!retrieveResult.response.success) {
107
- throw new core_1.SfError(`Unable to retrieve ${retrieveResult.response.id}`);
108
- }
109
- return response;
110
- }
111
47
  /**
112
48
  * Creates an agent from a configuration, optionally saving the agent in an org.
113
49
  *
114
50
  * @param config a configuration for creating or previewing an agent
115
51
  * @returns the agent definition
116
52
  */
117
- async createV2(config) {
53
+ async create(config) {
118
54
  const url = '/connect/ai-assist/create-agent';
119
55
  // When previewing agent creation just return the response.
120
56
  if (!config.saveAgent) {
121
57
  this.logger.debug(`Previewing agent creation using config: ${(0, node_util_1.inspect)(config)} in project: ${this.project.getPath()}`);
122
- await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStagesV2.Previewing, {});
58
+ await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStages.Previewing, {});
123
59
  return this.maybeMock.request('POST', url, config);
124
60
  }
125
61
  if (!config.agentSettings?.agentName) {
126
62
  throw messages.createError('missingAgentName');
127
63
  }
128
64
  this.logger.debug(`Creating agent using config: ${(0, node_util_1.inspect)(config)} in project: ${this.project.getPath()}`);
129
- await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStagesV2.Creating, {});
65
+ await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStages.Creating, {});
130
66
  if (!config.agentSettings.agentApiName) {
131
67
  config.agentSettings.agentApiName = (0, exports.generateAgentApiName)(config.agentSettings?.agentName);
132
68
  }
133
69
  const response = await this.maybeMock.request('POST', url, config);
134
70
  // When saving agent creation we need to retrieve the created metadata.
135
71
  if (response.isSuccess) {
136
- await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStagesV2.Retrieving, {});
72
+ await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStages.Retrieving, {});
137
73
  const defaultPackagePath = this.project.getDefaultPackage().path ?? 'force-app';
138
74
  try {
139
75
  const cs = await source_deploy_retrieve_1.ComponentSetBuilder.build({
@@ -181,30 +117,9 @@ class Agent {
181
117
  /**
182
118
  * Create an agent spec from provided data.
183
119
  *
184
- * @deprecated Use the V2 APIs.
185
- *
186
120
  * @param config The configuration used to generate an agent spec.
187
121
  */
188
122
  async createSpec(config) {
189
- let agentSpec;
190
- const response = await this.maybeMock.request('GET', this.buildAgentJobSpecUrl(config));
191
- if (response.isSuccess && response.jobSpecs) {
192
- agentSpec = response.jobSpecs;
193
- }
194
- else {
195
- throw core_1.SfError.create({
196
- name: 'AgentJobSpecCreateError',
197
- message: response.errorMessage ?? 'unknown',
198
- });
199
- }
200
- return agentSpec;
201
- }
202
- /**
203
- * Create an agent spec from provided data.
204
- *
205
- * @param config The configuration used to generate an agent spec.
206
- */
207
- async createSpecV2(config) {
208
123
  this.verifyAgentSpecConfig(config);
209
124
  const url = '/connect/ai-assist/draft-agent-topics';
210
125
  const body = {
@@ -247,269 +162,6 @@ class Agent {
247
162
  throw messages.createError('invalidAgentSpecConfig');
248
163
  }
249
164
  }
250
- // eslint-disable-next-line class-methods-use-this
251
- buildAgentJobSpecUrl(config) {
252
- const { type, role, companyName, companyDescription, companyWebsite } = config;
253
- const encodedType = `agentType=${encodeURIComponent(type)}`;
254
- const encodedRole = `role=${encodeURIComponent(role)}`;
255
- const encodedCompanyName = `companyName=${encodeURIComponent(companyName)}`;
256
- const encodedCompanyDescription = `companyDescription=${encodeURIComponent(companyDescription)}`;
257
- const encodedCompanyWebsite = companyWebsite ? `&companyWebsite=${companyWebsite}` : '';
258
- return `/connect/agent-job-spec?${encodedType}&${encodedRole}&${encodedCompanyName}&${encodedCompanyDescription}${encodedCompanyWebsite}`;
259
- }
260
- async createMetadata(config) {
261
- const genAiSourceDirPath = node_path_1.default.join(this.project.getPath(), 'force-app', 'main', 'default', 'genAiPlanners');
262
- const botDirPath = node_path_1.default.join(this.project.getPath(), 'force-app', 'main', 'default', 'bots', config.name);
263
- const genAiSourcePath = node_path_1.default.join(genAiSourceDirPath, `${config.name}.genAiPlanner-meta.xml`);
264
- const botSourcePath = node_path_1.default.join(botDirPath, `${config.name}.bot-meta.xml`);
265
- const botVersionSourcePath = node_path_1.default.join(botDirPath, 'v1.botVersion-meta.xml');
266
- // TODO: will this need to be user specified? Something to update for V2 APIs
267
- const botUser = (await this.connection.singleRecordQuery("SELECT Username FROM User Where Profile.name='Einstein Agent User' LIMIT 1")).Username;
268
- this.logger.debug(`Creating Agent using config: ${(0, node_util_1.inspect)(config)} in project: ${this.project.getPath()}`);
269
- await Promise.all([
270
- node_fs_1.default.promises.mkdir(genAiSourceDirPath, { recursive: true }),
271
- node_fs_1.default.promises.mkdir(botDirPath, { recursive: true }),
272
- ]);
273
- // the dirs must exist before we write the files
274
- await Promise.all([
275
- node_fs_1.default.promises.writeFile(genAiSourcePath, `<?xml version="1.0" encoding="UTF-8"?>
276
- <GenAiPlanner xmlns="http://soap.sforce.com/2006/04/metadata">
277
- <description>description for ${config.name}</description>
278
- <masterLabel>MasterLabel for ${config.name}</masterLabel>
279
- <plannerType>AiCopilot__ReAct</plannerType>
280
- </GenAiPlanner>
281
- `),
282
- node_fs_1.default.promises.writeFile(botSourcePath, `<?xml version="1.0" encoding="UTF-8"?>
283
- <Bot xmlns="http://soap.sforce.com/2006/04/metadata">
284
- <botMlDomain>
285
- <label>${config.name}</label>
286
- <name>${config.name}</name>
287
- </botMlDomain>
288
- <botUser>${botUser}</botUser>
289
- <contextVariables>
290
- <contextVariableMappings>
291
- <SObjectType>MessagingSession</SObjectType>
292
- <fieldName>MessagingSession.MessagingEndUserId</fieldName>
293
- <messageType>Facebook</messageType>
294
- </contextVariableMappings>
295
- <contextVariableMappings>
296
- <SObjectType>MessagingSession</SObjectType>
297
- <fieldName>MessagingSession.MessagingEndUserId</fieldName>
298
- <messageType>EmbeddedMessaging</messageType>
299
- </contextVariableMappings>
300
- <contextVariableMappings>
301
- <SObjectType>MessagingSession</SObjectType>
302
- <fieldName>MessagingSession.MessagingEndUserId</fieldName>
303
- <messageType>AppleBusinessChat</messageType>
304
- </contextVariableMappings>
305
- <contextVariableMappings>
306
- <SObjectType>MessagingSession</SObjectType>
307
- <fieldName>MessagingSession.MessagingEndUserId</fieldName>
308
- <messageType>WhatsApp</messageType>
309
- </contextVariableMappings>
310
- <contextVariableMappings>
311
- <SObjectType>MessagingSession</SObjectType>
312
- <fieldName>MessagingSession.MessagingEndUserId</fieldName>
313
- <messageType>Text</messageType>
314
- </contextVariableMappings>
315
- <contextVariableMappings>
316
- <SObjectType>MessagingSession</SObjectType>
317
- <fieldName>MessagingSession.MessagingEndUserId</fieldName>
318
- <messageType>Line</messageType>
319
- </contextVariableMappings>
320
- <dataType>Id</dataType>
321
- <developerName>EndUserId</developerName>
322
- <label>End User Id</label>
323
- </contextVariables>
324
- <contextVariables>
325
- <contextVariableMappings>
326
- <SObjectType>MessagingSession</SObjectType>
327
- <fieldName>MessagingSession.Id</fieldName>
328
- <messageType>Line</messageType>
329
- </contextVariableMappings>
330
- <contextVariableMappings>
331
- <SObjectType>MessagingSession</SObjectType>
332
- <fieldName>MessagingSession.Id</fieldName>
333
- <messageType>EmbeddedMessaging</messageType>
334
- </contextVariableMappings>
335
- <contextVariableMappings>
336
- <SObjectType>MessagingSession</SObjectType>
337
- <fieldName>MessagingSession.Id</fieldName>
338
- <messageType>AppleBusinessChat</messageType>
339
- </contextVariableMappings>
340
- <contextVariableMappings>
341
- <SObjectType>MessagingSession</SObjectType>
342
- <fieldName>MessagingSession.Id</fieldName>
343
- <messageType>WhatsApp</messageType>
344
- </contextVariableMappings>
345
- <contextVariableMappings>
346
- <SObjectType>MessagingSession</SObjectType>
347
- <fieldName>MessagingSession.Id</fieldName>
348
- <messageType>Text</messageType>
349
- </contextVariableMappings>
350
- <contextVariableMappings>
351
- <SObjectType>MessagingSession</SObjectType>
352
- <fieldName>MessagingSession.Id</fieldName>
353
- <messageType>Facebook</messageType>
354
- </contextVariableMappings>
355
- <dataType>Id</dataType>
356
- <developerName>RoutableId</developerName>
357
- <label>Routable Id</label>
358
- </contextVariables>
359
- <contextVariables>
360
- <contextVariableMappings>
361
- <SObjectType>MessagingSession</SObjectType>
362
- <fieldName>MessagingSession.EndUserLanguage</fieldName>
363
- <messageType>Line</messageType>
364
- </contextVariableMappings>
365
- <contextVariableMappings>
366
- <SObjectType>MessagingSession</SObjectType>
367
- <fieldName>MessagingSession.EndUserLanguage</fieldName>
368
- <messageType>EmbeddedMessaging</messageType>
369
- </contextVariableMappings>
370
- <contextVariableMappings>
371
- <SObjectType>MessagingSession</SObjectType>
372
- <fieldName>MessagingSession.EndUserLanguage</fieldName>
373
- <messageType>AppleBusinessChat</messageType>
374
- </contextVariableMappings>
375
- <contextVariableMappings>
376
- <SObjectType>MessagingSession</SObjectType>
377
- <fieldName>MessagingSession.EndUserLanguage</fieldName>
378
- <messageType>WhatsApp</messageType>
379
- </contextVariableMappings>
380
- <contextVariableMappings>
381
- <SObjectType>MessagingSession</SObjectType>
382
- <fieldName>MessagingSession.EndUserLanguage</fieldName>
383
- <messageType>Text</messageType>
384
- </contextVariableMappings>
385
- <contextVariableMappings>
386
- <SObjectType>MessagingSession</SObjectType>
387
- <fieldName>MessagingSession.EndUserLanguage</fieldName>
388
- <messageType>Facebook</messageType>
389
- </contextVariableMappings>
390
- <dataType>Text</dataType>
391
- <developerName>EndUserLanguage</developerName>
392
- <label>End User Language</label>
393
- </contextVariables>
394
- <contextVariables>
395
- <contextVariableMappings>
396
- <SObjectType>MessagingEndUser</SObjectType>
397
- <fieldName>MessagingEndUser.ContactId</fieldName>
398
- <messageType>Line</messageType>
399
- </contextVariableMappings>
400
- <contextVariableMappings>
401
- <SObjectType>MessagingEndUser</SObjectType>
402
- <fieldName>MessagingEndUser.ContactId</fieldName>
403
- <messageType>EmbeddedMessaging</messageType>
404
- </contextVariableMappings>
405
- <contextVariableMappings>
406
- <SObjectType>MessagingEndUser</SObjectType>
407
- <fieldName>MessagingEndUser.ContactId</fieldName>
408
- <messageType>AppleBusinessChat</messageType>
409
- </contextVariableMappings>
410
- <contextVariableMappings>
411
- <SObjectType>MessagingEndUser</SObjectType>
412
- <fieldName>MessagingEndUser.ContactId</fieldName>
413
- <messageType>WhatsApp</messageType>
414
- </contextVariableMappings>
415
- <contextVariableMappings>
416
- <SObjectType>MessagingEndUser</SObjectType>
417
- <fieldName>MessagingEndUser.ContactId</fieldName>
418
- <messageType>Text</messageType>
419
- </contextVariableMappings>
420
- <contextVariableMappings>
421
- <SObjectType>MessagingEndUser</SObjectType>
422
- <fieldName>MessagingEndUser.ContactId</fieldName>
423
- <messageType>Facebook</messageType>
424
- </contextVariableMappings>
425
- <dataType>Id</dataType>
426
- <developerName>ContactId</developerName>
427
- <label>Contact Id</label>
428
- </contextVariables>
429
- <description>${config.companyDescription}</description>
430
- <label>${config.name}</label>
431
- <logPrivateConversationData>false</logPrivateConversationData>
432
- <richContentEnabled>true</richContentEnabled>
433
- <sessionTimeout>480</sessionTimeout>
434
- <type>ExternalCopilot</type>
435
- </Bot>
436
- `),
437
- node_fs_1.default.promises.writeFile(botVersionSourcePath, `<?xml version="1.0" encoding="UTF-8"?>
438
- <BotVersion xmlns="http://soap.sforce.com/2006/04/metadata">
439
- <fullName>v1</fullName>
440
- <articleAnswersGPTEnabled>false</articleAnswersGPTEnabled>
441
- <botDialogs>
442
- <botSteps>
443
- <botMessages>
444
- <message>Hi, I&apos;m an AI assistant. How can I help you?</message>
445
- <messageIdentifier>bfafa206-133e-44e0-8560-c47c45715124</messageIdentifier>
446
- </botMessages>
447
- <stepIdentifier>f85fa042-f009-4722-ba6a-6f743ebd44e8</stepIdentifier>
448
- <type>Message</type>
449
- </botSteps>
450
- <botSteps>
451
- <stepIdentifier>cc7b5414-18df-43aa-b97a-c5d2682eee62</stepIdentifier>
452
- <type>Wait</type>
453
- </botSteps>
454
- <developerName>Welcome</developerName>
455
- <isPlaceholderDialog>false</isPlaceholderDialog>
456
- <label>Hi! I&apos;m your helpful bot.</label>
457
- <showInFooterMenu>false</showInFooterMenu>
458
- </botDialogs>
459
- <botDialogs>
460
- <botSteps>
461
- <botMessages>
462
- <message>Sorry, it looks like something has gone wrong.</message>
463
- <messageIdentifier>41556708-3dda-4bc7-9444-fb9d3972a47f</messageIdentifier>
464
- </botMessages>
465
- <stepIdentifier>76ef6e29-6a3e-42fb-a325-606736f36268</stepIdentifier>
466
- <type>Message</type>
467
- </botSteps>
468
- <botSteps>
469
- <stepIdentifier>c2964b65-3c22-4cfb-9974-1a91820011e0</stepIdentifier>
470
- <type>Wait</type>
471
- </botSteps>
472
- <developerName>Error_Handling</developerName>
473
- <isPlaceholderDialog>false</isPlaceholderDialog>
474
- <label>Unfortunately, a system error occurred. Let us start again.</label>
475
- <showInFooterMenu>false</showInFooterMenu>
476
- </botDialogs>
477
- <botDialogs>
478
- <botSteps>
479
- <botMessages>
480
- <message>One moment while I connect you to the next available service representative.</message>
481
- <messageIdentifier>ddf568e3-4805-4529-a71d-4601ec9b5e16</messageIdentifier>
482
- </botMessages>
483
- <stepIdentifier>fc998b13-39e8-4142-aa14-80b5c80934dc</stepIdentifier>
484
- <type>Message</type>
485
- </botSteps>
486
- <botSteps>
487
- <conversationSystemMessage>
488
- <type>Transfer</type>
489
- </conversationSystemMessage>
490
- <stepIdentifier>e9a1f351-66fc-4a2e-8871-905ea08bdfa5</stepIdentifier>
491
- <type>SystemMessage</type>
492
- </botSteps>
493
- <developerName>Transfer_To_Agent</developerName>
494
- <isPlaceholderDialog>false</isPlaceholderDialog>
495
- <label>Transfer To Agent</label>
496
- <showInFooterMenu>false</showInFooterMenu>
497
- </botDialogs>
498
- <citationsEnabled>false</citationsEnabled>
499
- <conversationDefinitionPlanners>
500
- <genAiPlannerName>${config.name}</genAiPlannerName>
501
- </conversationDefinitionPlanners>
502
- <entryDialog>Welcome</entryDialog>
503
- <intentDisambiguationEnabled>false</intentDisambiguationEnabled>
504
- <intentV3Enabled>false</intentV3Enabled>
505
- <knowledgeFallbackEnabled>false</knowledgeFallbackEnabled>
506
- <smallTalkEnabled>false</smallTalkEnabled>
507
- <toneType>Casual</toneType>
508
- </BotVersion>
509
- `),
510
- ]);
511
- return [genAiSourcePath, botSourcePath, botVersionSourcePath];
512
- }
513
165
  }
514
166
  exports.Agent = Agent;
515
167
  /**
package/lib/agent.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,yCAAoC;AACpC,0DAA6B;AAC7B,sDAAyB;AACzB,2CAA+F;AAC/F,+EAAyE;AACzE,yCAA2C;AAgB3C,6CAAyC;AAEzC,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAA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gentCreateConfig, type AgentCreateConfigV2, type AgentCreateResponse, type AgentCreateResponseV2, type AgentJobSpec, type AgentJobSpecV2, type AgentJobSpecCreateConfig, type AgentJobSpecCreateConfigV2, type AgentJobSpecCreateResponse, type DraftAgentTopics, type DraftAgentTopicsBody, type DraftAgentTopicsResponse, SfAgent, } from './types';
2
- export { Agent, AgentCreateLifecycleStages, AgentCreateLifecycleStagesV2, generateAgentApiName } from './agent';
1
+ export { type AgentCreateConfig, type AgentCreateResponse, type AgentJobSpec, type AgentJobSpecCreateConfig, type AgentTone, type AgentType, type DraftAgentTopics, type DraftAgentTopicsBody, type DraftAgentTopicsResponse, } from './types';
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';
package/lib/index.js CHANGED
@@ -6,11 +6,10 @@
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.AgentCreateLifecycleStagesV2 = exports.AgentCreateLifecycleStages = exports.Agent = void 0;
9
+ 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; } });
13
- Object.defineProperty(exports, "AgentCreateLifecycleStagesV2", { enumerable: true, get: function () { return agent_1.AgentCreateLifecycleStagesV2; } });
14
13
  Object.defineProperty(exports, "generateAgentApiName", { enumerable: true, get: function () { return agent_1.generateAgentApiName; } });
15
14
  var agentTester_1 = require("./agentTester");
16
15
  Object.defineProperty(exports, "AgentTester", { enumerable: true, get: function () { return agentTester_1.AgentTester; } });
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAiBH,iCAAgH;AAAvG,8FAAA,KAAK,OAAA;AAAE,mHAAA,0BAA0B,OAAA;AAAE,qHAAA,4BAA4B,OAAA;AAAE,6GAAA,oBAAoB,OAAA;AAC9F,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"}
package/lib/types.d.ts CHANGED
@@ -2,46 +2,20 @@
2
2
  * An agent job spec is a list of job titles and descriptions
3
3
  * to be performed by the agent.
4
4
  */
5
- export type AgentJobSpec = [
6
- {
7
- jobTitle: string;
8
- jobDescription: string;
9
- }
10
- ];
11
- export type AgentJobSpecV2 = AgentJobSpecCreateConfigV2 & {
5
+ export type AgentJobSpec = AgentJobSpecCreateConfig & {
12
6
  topics: DraftAgentTopics;
13
7
  };
14
- /**
15
- * The body POST'd to /services/data/{api-version}/connect/attach-agent-topics
16
- */
17
- export type AttachAgentTopicsBody = {
18
- plannerId: string;
19
- role: string;
20
- companyName: string;
21
- companyDescription: string;
22
- agentType: string;
23
- agentJobSpecs: AgentJobSpec;
24
- };
8
+ export type AgentType = 'customer' | 'internal';
9
+ export type AgentTone = 'casual' | 'formal' | 'neutral';
25
10
  /**
26
11
  * The parameters used to generate an agent spec.
27
12
  */
28
13
  export type AgentJobSpecCreateConfig = {
29
- name: string;
30
- type: 'customer' | 'internal';
31
- role: string;
32
- companyName: string;
33
- companyDescription: string;
34
- companyWebsite?: string;
35
- };
36
- /**
37
- * The parameters used to generate an agent spec V2.
38
- */
39
- export type AgentJobSpecCreateConfigV2 = {
40
14
  /**
41
15
  * Internal type is copilots; used by customers' employees.
42
16
  * Customer type is agents; used by customers' customers.
43
17
  */
44
- agentType: 'customer' | 'internal';
18
+ agentType: AgentType;
45
19
  role: string;
46
20
  companyName: string;
47
21
  companyDescription: string;
@@ -60,15 +34,7 @@ export type AgentJobSpecCreateConfigV2 = {
60
34
  */
61
35
  groundingContext?: string;
62
36
  };
63
- /**
64
- * The parameters used to generate an agent in an org.
65
- *
66
- * NOTE: This is likely to change with planned serverside APIs.
67
- */
68
- export type AgentCreateConfig = AgentJobSpecCreateConfig & {
69
- jobSpec: AgentJobSpec;
70
- };
71
- export type AgentCreateConfigV2 = DraftAgentTopicsBody & {
37
+ export type AgentCreateConfig = DraftAgentTopicsBody & {
72
38
  generationInfo: {
73
39
  defaultInfo: {
74
40
  /**
@@ -122,7 +88,7 @@ export type AgentCreateConfigV2 = DraftAgentTopicsBody & {
122
88
  *
123
89
  * Default: casual
124
90
  */
125
- tone?: 'casual' | 'formal' | 'neutral';
91
+ tone?: AgentTone;
126
92
  /**
127
93
  * The language your agent uses in conversations. Agent currently
128
94
  * supports English only.
@@ -136,7 +102,7 @@ export type AgentCreateConfigV2 = DraftAgentTopicsBody & {
136
102
  * The request body to send to the `draft-agent-topics` API.
137
103
  */
138
104
  export type DraftAgentTopicsBody = {
139
- agentType: 'customer' | 'internal';
105
+ agentType: AgentType;
140
106
  generationInfo: {
141
107
  defaultInfo: {
142
108
  role: string;
@@ -153,31 +119,9 @@ export type DraftAgentTopicsBody = {
153
119
  maxNumOfTopics?: number;
154
120
  };
155
121
  };
156
- /**
157
- * An interface for working with Agents.
158
- */
159
- export type SfAgent = {
160
- create(config: AgentCreateConfig): Promise<AgentCreateResponse>;
161
- createSpec(config: AgentJobSpecCreateConfig): Promise<AgentJobSpec>;
162
- };
163
- /**
164
- * The response from the `agent-job-spec` API.
165
- */
166
- export type AgentJobSpecCreateResponse = {
167
- isSuccess: boolean;
168
- errorMessage?: string;
169
- jobSpecs?: AgentJobSpec;
170
- };
171
- /**
172
- * The response from the `attach-agent-topics` API.
173
- */
174
122
  export type AgentCreateResponse = {
175
123
  isSuccess: boolean;
176
124
  errorMessage?: string;
177
- };
178
- export type AgentCreateResponseV2 = {
179
- isSuccess: boolean;
180
- errorMessage?: string;
181
125
  /**
182
126
  * If the agent was created with saveAgent=true, these are the
183
127
  * IDs that make up an agent; Bot, BotVersion, and GenAiPlanner metadata.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/agents",
3
3
  "description": "Client side APIs for working with Salesforce agents",
4
- "version": "0.11.0",
4
+ "version": "0.12.0",
5
5
  "license": "BSD-3-Clause",
6
6
  "author": "Salesforce",
7
7
  "main": "lib/index",