Skip to content

Commit c2f291b

Browse files
Merge branch 'wr/nga' of github.com:salesforcecli/plugin-agent into wr/nga
2 parents a973750 + 176de8c commit c2f291b

File tree

11 files changed

+294
-301
lines changed

11 files changed

+294
-301
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## [1.24.13](https://github.com/salesforcecli/plugin-agent/compare/1.24.12...1.24.13) (2025-09-22)
2+
3+
### Bug Fixes
4+
5+
- **deps:** bump @oclif/multi-stage-output from 0.8.20 to 0.8.22 ([d584ce9](https://github.com/salesforcecli/plugin-agent/commit/d584ce94680afe2689e4011155f508040970759d))
6+
7+
## [1.24.12](https://github.com/salesforcecli/plugin-agent/compare/1.24.11...1.24.12) (2025-09-21)
8+
9+
### Bug Fixes
10+
11+
- **deps:** bump @oclif/core from 4.5.2 to 4.5.4 ([0e45558](https://github.com/salesforcecli/plugin-agent/commit/0e455580f9b8755cf5e76d236aa7955a87780f60))
12+
13+
## [1.24.11](https://github.com/salesforcecli/plugin-agent/compare/1.24.10...1.24.11) (2025-09-21)
14+
15+
### Bug Fixes
16+
17+
- **deps:** bump @inquirer/core from 10.1.15 to 10.2.2 ([c7fb6c1](https://github.com/salesforcecli/plugin-agent/commit/c7fb6c101d61e651d41c5c35933920ccdc72e4e1))
18+
19+
## [1.24.10](https://github.com/salesforcecli/plugin-agent/compare/1.24.9...1.24.10) (2025-09-14)
20+
21+
### Bug Fixes
22+
23+
- **deps:** bump @inquirer/prompts from 7.8.3 to 7.8.4 ([a6891a0](https://github.com/salesforcecli/plugin-agent/commit/a6891a008720549ea5d1efd12ae5272e1341d352))
24+
125
## [1.24.9](https://github.com/salesforcecli/plugin-agent/compare/1.24.8...1.24.9) (2025-09-09)
226

327
### Bug Fixes

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ EXAMPLES
109109
$ sf agent activate --api-name Resort_Manager --target-org my-org
110110
```
111111

112-
_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.9/src/commands/agent/activate.ts)_
112+
_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.13/src/commands/agent/activate.ts)_
113113

114114
## `sf agent create`
115115

@@ -171,7 +171,7 @@ EXAMPLES
171171
$ sf agent create --name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
172172
```
173173

174-
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.9/src/commands/agent/create.ts)_
174+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.13/src/commands/agent/create.ts)_
175175

176176
## `sf agent deactivate`
177177

@@ -211,7 +211,7 @@ EXAMPLES
211211
$ sf agent deactivate --api-name Resort_Manager --target-org my-org
212212
```
213213

214-
_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.9/src/commands/agent/deactivate.ts)_
214+
_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.13/src/commands/agent/deactivate.ts)_
215215

216216
## `sf agent generate agent-spec`
217217

@@ -316,7 +316,7 @@ EXAMPLES
316316
$ sf agent generate agent-spec --tone formal --agent-user [email protected]
317317
```
318318

319-
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.9/src/commands/agent/generate/agent-spec.ts)_
319+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.13/src/commands/agent/generate/agent-spec.ts)_
320320

321321
## `sf agent generate template`
322322

@@ -364,7 +364,7 @@ EXAMPLES
364364
force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
365365
```
366366

367-
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.9/src/commands/agent/generate/template.ts)_
367+
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.13/src/commands/agent/generate/template.ts)_
368368

369369
## `sf agent generate test-spec`
370370

@@ -425,7 +425,7 @@ EXAMPLES
425425
force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
426426
```
427427

428-
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.9/src/commands/agent/generate/test-spec.ts)_
428+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.13/src/commands/agent/generate/test-spec.ts)_
429429

430430
## `sf agent preview`
431431

@@ -489,7 +489,7 @@ EXAMPLES
489489
transcripts/my-preview
490490
```
491491

492-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.9/src/commands/agent/preview.ts)_
492+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.13/src/commands/agent/preview.ts)_
493493

494494
## `sf agent test create`
495495

@@ -544,7 +544,7 @@ EXAMPLES
544544
$ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
545545
```
546546

547-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.9/src/commands/agent/test/create.ts)_
547+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.13/src/commands/agent/test/create.ts)_
548548

549549
## `sf agent test list`
550550

@@ -579,7 +579,7 @@ EXAMPLES
579579
$ sf agent test list --target-org my-org
580580
```
581581

582-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.9/src/commands/agent/test/list.ts)_
582+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.13/src/commands/agent/test/list.ts)_
583583

584584
## `sf agent test results`
585585

@@ -645,7 +645,7 @@ FLAG DESCRIPTIONS
645645
expression when using custom evaluations.
646646
```
647647

648-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.9/src/commands/agent/test/results.ts)_
648+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.13/src/commands/agent/test/results.ts)_
649649

650650
## `sf agent test resume`
651651

@@ -718,7 +718,7 @@ FLAG DESCRIPTIONS
718718
expression when using custom evaluations.
719719
```
720720

721-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.9/src/commands/agent/test/resume.ts)_
721+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.13/src/commands/agent/test/resume.ts)_
722722

723723
## `sf agent test run`
724724

@@ -792,6 +792,6 @@ FLAG DESCRIPTIONS
792792
expression when using custom evaluations.
793793
```
794794

795-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.9/src/commands/agent/test/run.ts)_
795+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.24.13/src/commands/agent/test/run.ts)_
796796

797797
<!-- commandsstop -->

command-snapshot.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@
6767
"flags": ["flags-dir", "force-overwrite", "from-definition", "output-file"],
6868
"plugin": "@salesforce/plugin-agent"
6969
},
70+
{
71+
"alias": [],
72+
"command": "agent:preview",
73+
"flagAliases": [],
74+
"flagChars": ["c", "d", "n", "o", "x"],
75+
"flags": ["apex-debug", "api-name", "api-version", "client-app", "flags-dir", "output-dir", "target-org"],
76+
"plugin": "@salesforce/plugin-agent"
77+
},
7078
{
7179
"alias": [],
7280
"command": "agent:publish:authoring-bundle",

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "@salesforce/plugin-agent",
33
"description": "Commands to interact with Salesforce agents",
4-
"version": "1.24.9",
4+
"version": "1.24.13",
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {
8-
"@inquirer/core": "^10.1.6",
9-
"@inquirer/prompts": "^7.8.3",
8+
"@inquirer/core": "^10.2.2",
9+
"@inquirer/prompts": "^7.8.6",
1010
"@oclif/core": "^4",
11-
"@oclif/multi-stage-output": "^0.8.20",
12-
"@salesforce/agents": "^0.17.8",
13-
"@salesforce/core": "^8.18.5",
11+
"@oclif/multi-stage-output": "^0.8.23",
12+
"@salesforce/agents": "^0.17.10",
13+
"@salesforce/core": "^8.23.1",
1414
"@salesforce/kit": "^3.2.3",
1515
"@salesforce/sf-plugins-core": "^12.2.4",
1616
"@salesforce/source-deploy-retrieve": "^12.22.1",
@@ -26,7 +26,7 @@
2626
"devDependencies": {
2727
"@oclif/plugin-command-snapshot": "^5.2.19",
2828
"@oclif/test": "^4.1.0",
29-
"@salesforce/cli-plugins-testkit": "^5.3.35",
29+
"@salesforce/cli-plugins-testkit": "^5.3.41",
3030
"@salesforce/dev-scripts": "^10.2.12",
3131
"@salesforce/plugin-command-reference": "^3.1.67",
3232
"@types/inquirer": "^9.0.9",

schemas/agent-publish-authoring-bundle.json

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$ref": "#/definitions/AgentPublishAuthoringBundleResult",
4+
"definitions": {
5+
"AgentPublishAuthoringBundleResult": {
6+
"type": "object",
7+
"properties": {
8+
"success": {
9+
"type": "boolean"
10+
},
11+
"botDeveloperName": {
12+
"type": "string"
13+
},
14+
"errors": {
15+
"type": "array",
16+
"items": {
17+
"type": "string"
18+
}
19+
}
20+
},
21+
"required": ["success"],
22+
"additionalProperties": false
23+
}
24+
}
25+
}

schemas/agent-validate-authoring-bundle.json

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$ref": "#/definitions/AgentValidateAuthoringBundleResult",
4+
"definitions": {
5+
"AgentValidateAuthoringBundleResult": {
6+
"type": "object",
7+
"properties": {
8+
"success": {
9+
"type": "boolean"
10+
},
11+
"errors": {
12+
"type": "array",
13+
"items": {
14+
"type": "string"
15+
}
16+
}
17+
},
18+
"required": ["success"],
19+
"additionalProperties": false
20+
}
21+
}
22+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ export async function getPluginsAndFunctions(
349349
.filter((f) => 'genAiCustomizedPlugin' in f)
350350
.map(
351351
({ genAiCustomizedPlugin }) =>
352-
genAiCustomizedPlugin.genAiFunctions.find((plugin) => plugin.functionName !== '')!.functionName
352+
genAiCustomizedPlugin.genAiFunctions?.find((plugin) => plugin.functionName !== '')!.functionName
353353
);
354354

355355
genAiPlugins = ensureArray(parsedPlannerBundle.GenAiPlannerBundle.genAiPlugins).reduce(

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

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ describe('AgentGenerateTestSpec Helper Methods', () => {
2323
describe('getPluginsAndFunctions', () => {
2424
const $$ = sinon.createSandbox();
2525

26+
afterEach(() => {
27+
$$.restore();
28+
});
2629
it('should getPluginsAndFunctions for a name and CS', async () => {
2730
const name = 'myAgent';
2831
const cs = new ComponentSet([
@@ -101,6 +104,67 @@ describe('AgentGenerateTestSpec Helper Methods', () => {
101104
},
102105
});
103106
});
107+
108+
it('should not fail when theres no actions', async () => {
109+
const name = 'myAgent';
110+
const cs = new ComponentSet([
111+
{ fullName: name, type: { name: 'Bot', id: 'bot', directoryName: 'bot' } },
112+
{
113+
fullName: 'myGenAiPlannerBundle',
114+
type: { name: 'GenAiPlannerBundle', id: 'genaiplannerbundle', directoryName: 'genaiplannerbundle' },
115+
},
116+
]);
117+
118+
$$.stub(cs, 'getComponentFilenamesByNameAndType')
119+
.onFirstCall()
120+
.returns(['myBot.bot-meta.xml'])
121+
.onSecondCall()
122+
.rejects() // genAiPlanner attempt
123+
.onThirdCall()
124+
.returns(['myGenAiPlannerBundle.genAiPlannerBundle-meta.xml']);
125+
126+
$$.stub(fs.promises, 'readFile')
127+
.onFirstCall()
128+
.resolves(
129+
`<?xml version="1.0" encoding="UTF-8"?>
130+
<BotVersion xmlns="http://soap.sforce.com/2006/04/metadata">
131+
<conversationDefinitionPlanners>
132+
<genAiPlannerName>App_Dev_Agent</genAiPlannerName>
133+
</conversationDefinitionPlanners>
134+
</BotVersion>
135+
`
136+
)
137+
.onSecondCall()
138+
.rejects() // genAiPlanner attempt
139+
.onThirdCall()
140+
.resolves(
141+
`<?xml version="1.0" encoding="UTF-8"?>
142+
<GenAiPlannerBundle xmlns="http://soap.sforce.com/2006/04/metadata">
143+
<genAiPlugins>
144+
<genAiCustomizedPlugin>
145+
<canEscalate>false</canEscalate>
146+
<description>System level instructions for config.</description>
147+
<genAiPluginInstructions>
148+
<description>...</description>
149+
<developerName>instruction_0_1756241650786</developerName>
150+
<language xsi:nil="true"/>
151+
<masterLabel>instruction_0_1756241650786</masterLabel>
152+
</genAiPluginInstructions>
153+
<language>en_US</language>
154+
<masterLabel>B2C Global Instructions</masterLabel>
155+
<name>B2CGlobalInstructions1</name>
156+
<pluginType>Topic</pluginType>
157+
<scope>Define system-level instructions, including hardcoded values.</scope>
158+
</genAiCustomizedPlugin>
159+
<genAiPluginName>COMMERCE_SHOPPER_COPILOT_B2C__B2CGlobalInstructions</genAiPluginName>
160+
</genAiPlugins>
161+
</GenAiPlannerBundle>
162+
`
163+
);
164+
165+
const result = await getPluginsAndFunctions(name, cs);
166+
expect(result.genAiFunctions).to.deep.equal([undefined]);
167+
});
104168
});
105169

106170
describe('ensureYamlExtension utility', () => {

0 commit comments

Comments
 (0)