Skip to content

Commit 7f477e7

Browse files
committed
Merge branch 'nga' into er/add-mso-step-to-publish-aab-command
2 parents a4993ef + 81d3604 commit 7f477e7

File tree

6 files changed

+64
-32
lines changed

6 files changed

+64
-32
lines changed

messages/agent.generate.authoring-bundle.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ This command requires an org because it uses it to access an LLM for generating
1818

1919
Path to the agent spec YAML file; if not specified, the command provides a list that you can choose from.
2020

21+
# flags.spec.prompt
22+
23+
Path to the agent spec YAML file
24+
2125
# flags.output-dir.summary
2226

2327
Directory where the authoring bundle files are generated.
@@ -26,6 +30,10 @@ Directory where the authoring bundle files are generated.
2630

2731
Name (label) of the authoring bundle; if not specified, you're prompted for the name.
2832

33+
# flags.name.prompt
34+
35+
Name (label) of the authoring bundle
36+
2937
# flags.api-name.summary
3038

3139
API name of the new authoring bundle; if not specified, the API name is derived from the authoring bundle name (label); the API name can't exist in the org.

messages/agent.publish.authoring-bundle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Publish an authoring bundle to your org, which results in a new agent or a new v
66

77
An authoring bundle is a metadata type (named aiAuthoringBundle) that provides the blueprint for an agent. The metadata type contains two files: the standard metatada XML file and an Agent Script file (extension ".agent") that fully describes the agent using the Agent Script language.
88

9-
When you publish an authoring bundle to your org, a number of things happen. First, this command validates that the Agent Script file successfully compiles. If there are compilation errors, the command exits and you must fix the Agent Script file to continue. Once the Agent Script file compiles, then the authoring bundle metadata component is deployed to the org. All associated agent metadata components, such as the Bot, BotVersion, and GenAiXXX components, are either created or updated in the org. Finally, all the new or changed metadata components associated with the new agent are retrieved back to your local DX project.
9+
When you publish an authoring bundle to your org, a number of things happen. First, this command validates that the Agent Script file successfully compiles. If there are compilation errors, the command exits and you must fix the Agent Script file to continue. Once the Agent Script file compiles, then it's published to the org, which in turn creates new associated metadata (Bot, BotVersion, GenAiX), or new versions of the metadata if the agent already exists. The new or updated metadata is retrieved back to your DX project, and then the authoring bundle metadata (AiAuthoringBundle) is deployed to your org.
1010

1111
This command uses the API name of the authoring bundle.
1212

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"@inquirer/prompts": "^7.8.6",
1010
"@oclif/core": "^4",
1111
"@oclif/multi-stage-output": "^0.8.23",
12-
"@salesforce/agents": "0.18.3-nga.8",
12+
"@salesforce/agents": "0.19.3",
1313
"@salesforce/core": "^8.23.1",
1414
"@salesforce/kit": "^3.2.3",
1515
"@salesforce/sf-plugins-core": "^12.2.4",
@@ -78,12 +78,19 @@
7878
"external": true,
7979
"subtopics": {
8080
"test": {
81+
"description": "Commands to test agents.",
82+
"external": true
83+
},
84+
"publish": {
85+
"description": "Command to publish agents to an org.",
8186
"external": true
8287
},
8388
"generate": {
89+
"description": "Commands to generate agent artifacts, such as the agent spec YAML file, authoring bundle, and test spec file.",
8490
"external": true
8591
},
86-
"create": {
92+
"validate": {
93+
"description": "Command to validate an Agent Script file.",
8794
"external": true
8895
}
8996
}

schemas/agent-generate-agent__spec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
"AgentType": {
7171
"type": "string",
72-
"enum": ["customer", "internal"]
72+
"enum": ["customer", "internal", "AGENT"]
7373
}
7474
}
7575
}

src/commands/agent/generate/authoring-bundle.ts

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import { join, resolve } from 'node:path';
18-
import { mkdirSync, writeFileSync, readFileSync, existsSync } from 'node:fs';
18+
import { readFileSync, existsSync } from 'node:fs';
1919
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
2020
import { generateApiName, Messages, SfError } from '@salesforce/core';
2121
import { Agent, AgentJobSpec } from '@salesforce/agents';
@@ -64,6 +64,7 @@ export default class AgentGenerateAuthoringBundle extends SfCommand<AgentGenerat
6464
private static readonly FLAGGABLE_PROMPTS = {
6565
name: {
6666
message: messages.getMessage('flags.name.summary'),
67+
promptMessage: messages.getMessage('flags.name.prompt'),
6768
validate: (d: string): boolean | string =>
6869
d.trim().length > 0 || 'Name cannot be empty or contain only whitespace',
6970
required: true,
@@ -87,6 +88,7 @@ export default class AgentGenerateAuthoringBundle extends SfCommand<AgentGenerat
8788
},
8889
spec: {
8990
message: messages.getMessage('flags.spec.summary'),
91+
promptMessage: messages.getMessage('flags.spec.prompt'),
9092
validate: (d: string): boolean | string => {
9193
const specPath = resolve(d);
9294
if (!existsSync(specPath)) {
@@ -135,22 +137,12 @@ export default class AgentGenerateAuthoringBundle extends SfCommand<AgentGenerat
135137
// Write Agent file
136138
const conn = targetOrg.getConnection(flags['api-version']);
137139
const specContents = YAML.parse(readFileSync(spec, 'utf8')) as AgentJobSpec;
138-
const agent = await Agent.createAgentScript(conn, { ...specContents, ...{ name, developerName: bundleApiName } });
139-
// Create output directory if it doesn't exist
140-
mkdirSync(targetOutputDir, { recursive: true });
141-
writeFileSync(agentPath, agent);
142-
143-
// Write meta.xml file
144-
const metaXml = `<?xml version="1.0" encoding="UTF-8"?>
145-
<aiAuthoringBundle>
146-
<Label>${specContents.role}</Label>
147-
<BundleType>${specContents.agentType}</BundleType>
148-
<VersionTag>Spring2026</VersionTag>
149-
<VersionDescription>Initial release for ${bundleApiName}</VersionDescription>
150-
<SourceBundleVersion></SourceBundleVersion>
151-
<Target></Target>
152-
</aiAuthoringBundle>`;
153-
writeFileSync(metaXmlPath, metaXml);
140+
await Agent.createAuthoringBundle({
141+
connection: conn,
142+
agentSpec: { ...specContents, ...{ name, developerName: bundleApiName } },
143+
project: this.project!,
144+
bundleApiName,
145+
});
154146

155147
this.logSuccess(`Successfully generated ${bundleApiName} Authoring Bundle`);
156148

yarn.lock

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,18 +1595,18 @@
15951595
resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8"
15961596
integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==
15971597

1598-
"@salesforce/agents@0.18.3-nga.8":
1599-
version "0.18.3-nga.8"
1600-
resolved "https://registry.yarnpkg.com/@salesforce/agents/-/agents-0.18.3-nga.8.tgz#f5aceafa449c175c50ab63b2ae1bec2fbe29c314"
1601-
integrity sha512-hi0LQdiuVKhHIHugqtexX0/GtRPCk6BMY4PxqOox8ZVqiOgPU6+/MUgB6Lt8T+rDUaJ0tx05g1SDq08eWWr3aQ==
1598+
"@salesforce/agents@0.19.3":
1599+
version "0.19.3"
1600+
resolved "https://registry.yarnpkg.com/@salesforce/agents/-/agents-0.19.3.tgz#adf3edc5f340d57e34bbf368d851729d18267661"
1601+
integrity sha512-PA4Bh6pbzWTEFxowl3aHDpNLgulNTWqztvkJxJbgbbnIg/N6tl3ZL1FbIw0C1bLEvZCJpgeCNsXgsE20c5Tkuw==
16021602
dependencies:
1603-
"@salesforce/core" "^8.23.4"
1603+
"@salesforce/core" "^8.23.5"
16041604
"@salesforce/kit" "^3.2.4"
1605-
"@salesforce/source-deploy-retrieve" "^12.25.0"
1605+
"@salesforce/source-deploy-retrieve" "^12.30.0"
16061606
"@salesforce/types" "^1.5.0"
1607-
fast-xml-parser "^5.2.5"
1607+
fast-xml-parser "^5.3.2"
16081608
nock "^13.5.6"
1609-
yaml "^2.8.1"
1609+
yaml "^2.8.2"
16101610

16111611
"@salesforce/cli-plugins-testkit@^5.3.41":
16121612
version "5.3.41"
@@ -1649,6 +1649,31 @@
16491649
semver "^7.7.3"
16501650
ts-retry-promise "^0.8.1"
16511651

1652+
"@salesforce/core@^8.23.5":
1653+
version "8.23.6"
1654+
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.23.6.tgz#caa73369b3fe80df9e8212c58491c4490f9d326d"
1655+
integrity sha512-NPPp9vfOUtVCojrk8NRq+c6O4cil7i0Tz/BBh6+4tNbJTEk1scZdzkTUGGQ6ZSImesUyLiIsEo0Afc/UobtRnw==
1656+
dependencies:
1657+
"@jsforce/jsforce-node" "^3.10.10"
1658+
"@salesforce/kit" "^3.2.4"
1659+
"@salesforce/schemas" "^1.10.3"
1660+
"@salesforce/ts-types" "^2.0.12"
1661+
ajv "^8.17.1"
1662+
change-case "^4.1.2"
1663+
fast-levenshtein "^3.0.0"
1664+
faye "^1.4.1"
1665+
form-data "^4.0.4"
1666+
js2xmlparser "^4.0.1"
1667+
jsonwebtoken "9.0.2"
1668+
jszip "3.10.1"
1669+
memfs "^4.30.1"
1670+
pino "^9.7.0"
1671+
pino-abstract-transport "^1.2.0"
1672+
pino-pretty "^11.3.0"
1673+
proper-lockfile "^4.1.2"
1674+
semver "^7.7.3"
1675+
ts-retry-promise "^0.8.1"
1676+
16521677
"@salesforce/dev-config@^4.3.1":
16531678
version "4.3.2"
16541679
resolved "https://registry.yarnpkg.com/@salesforce/dev-config/-/dev-config-4.3.2.tgz#10047e2b8d289c93f157ab4243a1b1de57f2d6a2"
@@ -1751,7 +1776,7 @@
17511776
cli-progress "^3.12.0"
17521777
terminal-link "^3.0.0"
17531778

1754-
"@salesforce/source-deploy-retrieve@^12.25.0":
1779+
"@salesforce/source-deploy-retrieve@^12.25.0", "@salesforce/source-deploy-retrieve@^12.30.0":
17551780
version "12.30.0"
17561781
resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-12.30.0.tgz#cae4e00b5f9f301f28d9224997f63bfa5a7ede1b"
17571782
integrity sha512-elfNE4NRw2JNRsYoS/e9Gi2KdaFg7c2JVdRY6ZT20vpxV3z81SvvbYhauiKOYkVvsP3Y+FBEzWiG6AwdF0fSWA==
@@ -4594,7 +4619,7 @@ fast-xml-parser@^4.5.1, fast-xml-parser@^4.5.3:
45944619
dependencies:
45954620
strnum "^1.1.1"
45964621

4597-
fast-xml-parser@^5.2.5:
4622+
fast-xml-parser@^5.3.2:
45984623
version "5.3.2"
45994624
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-5.3.2.tgz#78a51945fbf7312e1ff6726cb173f515b4ea11d8"
46004625
integrity sha512-n8v8b6p4Z1sMgqRmqLJm3awW4NX7NkaKPfb3uJIBTSH7Pdvufi3PQ3/lJLQrvxcMYl7JI2jnDO90siPEpD8JBA==
@@ -9072,7 +9097,7 @@ yallist@^4.0.0:
90729097
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
90739098
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
90749099

9075-
yaml@^2.5.1, yaml@^2.8.1:
9100+
yaml@^2.5.1, yaml@^2.8.1, yaml@^2.8.2:
90769101
version "2.8.2"
90779102
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.2.tgz#5694f25eca0ce9c3e7a9d9e00ce0ddabbd9e35c5"
90789103
integrity sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==

0 commit comments

Comments
 (0)