Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/commands/agent/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default class AgentPreview extends SfCommand<AgentPreviewResult> {
if (aabName) {
// user specified --authoring-bundle, use the API name directly
selectedAgent = await Agent.init({ connection: conn, project: this.project!, aabName });
selectedAgent.preview.setMockMode(flags['use-live-actions'] ? 'Live Test' : 'Mock');
} else if (apiNameOrId) {
selectedAgent = await Agent.init({ connection: conn, project: this.project!, apiNameOrId });
} else {
Expand Down Expand Up @@ -173,9 +174,7 @@ export const getPreviewChoiceLabel = (agent: PreviewableAgent): string =>
? `${agent.developerName ?? agent.name} (Published)`
: `${agent.name} (Agent Script)`;

export const getPreviewChoices = (
agents: PreviewableAgent[]
): Array<{ name: string; value: PreviewableAgent }> =>
export const getPreviewChoices = (agents: PreviewableAgent[]): Array<{ name: string; value: PreviewableAgent }> =>
sortPreviewableAgents(agents).map((agent) => ({
name: getPreviewChoiceLabel(agent),
value: agent,
Expand Down