Skip to content

Commit 636b82a

Browse files
committed
fix: change to Beta and use latest agents lib
1 parent 57ffa27 commit 636b82a

File tree

6 files changed

+13
-16
lines changed

6 files changed

+13
-16
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# plugin-agent - PREVIEW
1+
# plugin-agent - Beta
22

3-
### THIS PLUGIN IS A PREVIEW VERSION AND IS NOT MEANT FOR PRODUCTION USAGE UNTIL ANNOUNCED.
3+
### :warning: This plugin is beta. We expect to announce GA availability very soon. :warning:
44

55
[![NPM](https://img.shields.io/npm/v/@salesforce/plugin-agent.svg?label=@salesforce/plugin-agent)](https://www.npmjs.com/package/@salesforce/plugin-agent) [![Downloads/week](https://img.shields.io/npm/dw/@salesforce/plugin-agent.svg)](https://npmjs.org/package/@salesforce/plugin-agent) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/plugin-agent/main/LICENSE.txt)
66

schemas/agent-test-results.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
"type": "number"
9797
},
9898
"result": {
99-
"type": "string",
100-
"enum": ["PASS", "FAILURE"]
99+
"type": ["null", "string"],
100+
"enum": [null, "PASS", "FAILURE"]
101101
},
102102
"metricLabel": {
103103
"type": "string",

schemas/agent-test-resume.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@
131131
"type": "number"
132132
},
133133
"result": {
134-
"type": "string",
135-
"enum": ["PASS", "FAILURE"]
134+
"type": ["null", "string"],
135+
"enum": [null, "PASS", "FAILURE"]
136136
},
137137
"metricLabel": {
138138
"type": "string",

schemas/agent-test-run.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@
131131
"type": "number"
132132
},
133133
"result": {
134-
"type": "string",
135-
"enum": ["PASS", "FAILURE"]
134+
"type": ["null", "string"],
135+
"enum": [null, "PASS", "FAILURE"]
136136
},
137137
"metricLabel": {
138138
"type": "string",

src/commands/agent/create.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { resolve } from 'node:path';
88
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
99
import YAML from 'yaml';
1010
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
11-
import { Lifecycle, Messages } from '@salesforce/core';
11+
import { Lifecycle, Messages, SfProject } from '@salesforce/core';
1212
import { MultiStageOutput } from '@oclif/multi-stage-output';
1313
import { input as inquirerInput } from '@inquirer/prompts';
1414
import { colorize } from '@oclif/core/ux';
@@ -164,7 +164,6 @@ export default class AgentCreate extends SfCommand<AgentCreateResult> {
164164
);
165165

166166
const connection = flags['target-org'].getConnection(flags['api-version']);
167-
const agent = new Agent(connection, this.project!);
168167

169168
const agentConfig: AgentCreateConfig = {
170169
agentType: inputSpec.agentType,
@@ -197,7 +196,7 @@ export default class AgentCreate extends SfCommand<AgentCreateResult> {
197196
agentConfig.agentSettings.tone = validateTone(inputSpec.tone);
198197
}
199198
}
200-
const response = await agent.create(agentConfig);
199+
const response = await Agent.create(connection, this.project as SfProject, agentConfig);
201200
const result: AgentCreateResult = response;
202201

203202
mso.stop();

src/commands/agent/generate/agent-spec.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ export default class AgentCreateSpec extends SfCommand<AgentCreateSpecResult> {
212212
inputSpec?.enrichLogs ??
213213
(flags['full-interview'] ? await promptForFlag(FLAGGABLE_PROMPTS['enrich-logs']) : undefined);
214214
enrichLogs = Boolean(enrichLogs === 'true' || enrichLogs === true);
215-
let tone =
216-
flags.tone ??
215+
let tone: AgentTone =
216+
(flags.tone as AgentTone) ??
217217
inputSpec?.tone ??
218218
(flags['full-interview'] ? await promptForFlag(FLAGGABLE_PROMPTS.tone) : 'casual');
219219
tone = validateTone(tone as AgentTone);
@@ -225,7 +225,6 @@ export default class AgentCreateSpec extends SfCommand<AgentCreateSpecResult> {
225225
this.log();
226226
this.spinner.start('Creating agent spec');
227227

228-
const agent = new Agent(connection, this.project!);
229228
const specConfig: AgentJobSpecCreateConfig = {
230229
agentType: type as AgentType,
231230
companyName,
@@ -247,8 +246,7 @@ export default class AgentCreateSpec extends SfCommand<AgentCreateSpecResult> {
247246
specConfig.maxNumOfTopics = Number(maxNumOfTopics);
248247
}
249248

250-
const specResponse = await agent.createSpec(specConfig);
251-
// @ts-expect-error Need better typing
249+
const specResponse = await Agent.createSpec(connection, specConfig);
252250
const specFileContents = buildSpecFile(specResponse, { agentUser, enrichLogs, tone });
253251

254252
const outputFilePath = writeSpecFile(outputFile, specFileContents);

0 commit comments

Comments
 (0)