Skip to content

Commit fecb66c

Browse files
fix: deprecate 'org open authoring-bundle' expand 'org open agent'
1 parent 33e319c commit fecb66c

5 files changed

Lines changed: 427 additions & 6 deletions

File tree

command-snapshot.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,18 @@
150150
"command": "org:open:agent",
151151
"flagAliases": ["urlonly"],
152152
"flagChars": ["b", "n", "o", "r"],
153-
"flags": ["api-name", "api-version", "browser", "flags-dir", "json", "private", "target-org", "url-only"],
153+
"flags": [
154+
"api-name",
155+
"api-version",
156+
"authoring-bundle",
157+
"browser",
158+
"flags-dir",
159+
"json",
160+
"private",
161+
"target-org",
162+
"url-only",
163+
"version"
164+
],
154165
"plugin": "@salesforce/plugin-org"
155166
},
156167
{

messages/open.agent.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ Open an agent in your org's Agent Builder UI in a browser.
44

55
# description
66

7-
Use the --api-name flag to open an agent using its API name in the Agent Builder UI of your org. To find the agent's API name, go to Setup in your org and navigate to the agent's details page.
7+
Use the --api-name flag to open an agent using its API name in the Agent Builder UI of your org. To find the agent's API
8+
name, go to Setup in your org and navigate to the agent's details page.
9+
10+
Alternatively, use the --authoring-bundle flag to open an agent in Agentforce Builder. Optionally include --version to
11+
open a specific version of the agent. You'll specify the api name of the authoring bundle.
812

913
To generate the URL but not launch it in your browser, specify --url-only.
1014

11-
To open Agent Builder in a specific browser, use the --browser flag. Supported browsers are "chrome", "edge", and "firefox". If you don't specify --browser, the org opens in your default browser.
15+
To open Agent Builder in a specific browser, use the --browser flag. Supported browsers are "chrome", "edge", and "
16+
firefox". If you don't specify --browser, the org opens in your default browser.
1217

1318
# examples
1419

@@ -24,6 +29,14 @@ To open Agent Builder in a specific browser, use the --browser flag. Supported b
2429

2530
$ <%= config.bin %> <%= command.id %> --target-org MyTestOrg1 --browser firefox --api-name Coral_Cloud_Agent
2631

32+
- Open an agent in Agentforce Builder using its authoring bundle name:
33+
34+
$ <%= config.bin %> <%= command.id %> --authoring-bundle MyAgent
35+
36+
- Open a specific version of an agent in Agentforce Builder:
37+
38+
$ <%= config.bin %> <%= command.id %> --authoring-bundle MyAgent --version 1
39+
2740
# flags.api-name.summary
2841

2942
API name, also known as developer name, of the agent you want to open in the org's Agent Builder UI.
@@ -39,3 +52,21 @@ Browser where the org opens.
3952
# flags.url-only.summary
4053

4154
Display navigation URL, but don’t launch browser.
55+
56+
# flags.authoring-bundle.summary
57+
58+
API name of the agent to open in Agentforce Builder.
59+
60+
# flags.authoring-bundle.description
61+
62+
The API name of the agent to open directly in Agentforce Builder. Optionally specify --version to open a specific
63+
version.
64+
65+
# flags.version.summary
66+
67+
Version number of the agent to open in Agentforce Builder.
68+
69+
# flags.version.description
70+
71+
The version number of the agent to open directly in Agentforce Builder. Can only be used with the --authoring-bundle
72+
flag.

src/commands/org/open/agent.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class OrgOpenAgent extends OrgOpenCommandBase<OrgOpenOutput> {
3434
'api-name': Flags.string({
3535
char: 'n',
3636
summary: messages.getMessage('flags.api-name.summary'),
37-
required: true,
37+
exactlyOne: ['api-name', 'authoring-bundle'],
3838
}),
3939
private: Flags.boolean({
4040
summary: messages.getMessage('flags.private.summary'),
@@ -52,16 +52,39 @@ export class OrgOpenAgent extends OrgOpenCommandBase<OrgOpenOutput> {
5252
aliases: ['urlonly'],
5353
deprecateAliases: true,
5454
}),
55+
'authoring-bundle': Flags.string({
56+
summary: messages.getMessage('flags.authoring-bundle.summary'),
57+
description: messages.getMessage('flags.authoring-bundle.description'),
58+
exactlyOne: ['api-name', 'authoring-bundle'],
59+
}),
60+
version: Flags.string({
61+
summary: messages.getMessage('flags.version.summary'),
62+
description: messages.getMessage('flags.version.description'),
63+
dependsOn: ['authoring-bundle'],
64+
}),
5565
};
5666

5767
public async run(): Promise<OrgOpenOutput> {
5868
const { flags } = await this.parse(OrgOpenAgent);
5969
this.org = flags['target-org'];
6070
this.connection = this.org.getConnection(flags['api-version']);
6171

62-
const agentBuilderRedirect = await buildRetUrl(this.connection, flags['api-name']);
72+
let path: string;
73+
if (flags['api-name']) {
74+
path = await buildRetUrl(this.connection, flags['api-name']);
75+
} else {
76+
// authoring-bundle is provided
77+
const queryParams = new URLSearchParams({
78+
// flags.authoring-bundle guaranteed by OCLIF definition
79+
projectName: flags['authoring-bundle']!,
80+
});
81+
if (flags.version) {
82+
queryParams.set('projectVersionNumber', flags.version);
83+
}
84+
path = `AgentAuthoring/agentAuthoringBuilder.app#/project?${queryParams.toString()}`;
85+
}
6386

64-
return this.openOrgUI(flags, await this.org.getFrontDoorUrl(agentBuilderRedirect));
87+
return this.openOrgUI(flags, await this.org.getFrontDoorUrl(path));
6588
}
6689
}
6790

src/commands/org/open/authoring-bundle.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export class OrgOpenAuthoringBundle extends OrgOpenCommandBase<OrgOpenOutput> {
2626
public static readonly summary = messages.getMessage('summary');
2727
public static readonly description = messages.getMessage('description');
2828
public static readonly examples = messages.getMessages('examples');
29+
public static readonly state = 'deprecated';
30+
public static readonly deprecationOptions = { to: 'org open agent --authoring-bundle' };
2931

3032
public static readonly flags = {
3133
...OrgOpenCommandBase.flags,

0 commit comments

Comments
 (0)