@salesforce/plugin-agent 1.27.2 → 1.27.4-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -112,7 +112,7 @@ EXAMPLES
112
112
  $ sf agent activate --api-name Resort_Manager --target-org my-org
113
113
  ```
114
114
 
115
- _See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/activate.ts)_
115
+ _See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/activate.ts)_
116
116
 
117
117
  ## `sf agent create`
118
118
 
@@ -179,7 +179,7 @@ EXAMPLES
179
179
  $ sf agent create --name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
180
180
  ```
181
181
 
182
- _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/create.ts)_
182
+ _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/create.ts)_
183
183
 
184
184
  ## `sf agent deactivate`
185
185
 
@@ -219,7 +219,7 @@ EXAMPLES
219
219
  $ sf agent deactivate --api-name Resort_Manager --target-org my-org
220
220
  ```
221
221
 
222
- _See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/deactivate.ts)_
222
+ _See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/deactivate.ts)_
223
223
 
224
224
  ## `sf agent generate agent-spec`
225
225
 
@@ -326,7 +326,7 @@ EXAMPLES
326
326
  $ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
327
327
  ```
328
328
 
329
- _See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/generate/agent-spec.ts)_
329
+ _See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/generate/agent-spec.ts)_
330
330
 
331
331
  ## `sf agent generate authoring-bundle`
332
332
 
@@ -392,7 +392,7 @@ EXAMPLES
392
392
  other-package-dir/main/default --target-org my-dev-org
393
393
  ```
394
394
 
395
- _See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/generate/authoring-bundle.ts)_
395
+ _See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/generate/authoring-bundle.ts)_
396
396
 
397
397
  ## `sf agent generate template`
398
398
 
@@ -440,7 +440,7 @@ EXAMPLES
440
440
  force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
441
441
  ```
442
442
 
443
- _See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/generate/template.ts)_
443
+ _See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/generate/template.ts)_
444
444
 
445
445
  ## `sf agent generate test-spec`
446
446
 
@@ -501,7 +501,7 @@ EXAMPLES
501
501
  force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
502
502
  ```
503
503
 
504
- _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/generate/test-spec.ts)_
504
+ _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/generate/test-spec.ts)_
505
505
 
506
506
  ## `sf agent preview`
507
507
 
@@ -509,8 +509,8 @@ Interact with an agent to preview how it responds to your statements, questions,
509
509
 
510
510
  ```
511
511
  USAGE
512
- $ sf agent preview -o <value> [--flags-dir <value>] [--api-version <value>] [-n <value>] [--authoring-bundle
513
- <value>] [-d <value>] [-x] [--use-live-actions]
512
+ $ sf agent preview -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>]
513
+ [--authoring-bundle <value>] [-d <value>] [-x] [--use-live-actions] [--utterance <value>] [--session-id <value>]
514
514
 
515
515
  FLAGS
516
516
  -d, --output-dir=<value> Directory where conversation transcripts are saved.
@@ -521,11 +521,16 @@ FLAGS
521
521
  --api-version=<value> Override the api version used for api requests made by this command
522
522
  --authoring-bundle=<value> API name of the authoring bundle metadata component that contains the agent's Agent
523
523
  Script file.
524
+ --session-id=<value> Session ID of an in-progress preview session; use with --utterance to send a message
525
+ to that session and return the response without starting the interactive preview.
524
526
  --use-live-actions Use real actions in the org; if not specified, preview uses AI to simulate (mock)
525
527
  actions.
528
+ --utterance=<value> Message to send to the agent; creates a new session, returns the response, and exits
529
+ without starting the interactive preview.
526
530
 
527
531
  GLOBAL FLAGS
528
532
  --flags-dir=<value> Import flag values from a directory.
533
+ --json Format output as json.
529
534
 
530
535
  DESCRIPTION
531
536
  Interact with an agent to preview how it responds to your statements, questions, and commands (utterances).
@@ -572,9 +577,20 @@ EXAMPLES
572
577
  "./transcripts/my-preview" directory, enable the Apex debug logs, and use your default org:
573
578
 
574
579
  $ sf agent preview --use-live-actions --apex-debug --output-dir transcripts/my-preview
580
+
581
+ Send a message to the agent and print the response without starting the interactive preview (requires --api-name or
582
+ --authoring-bundle):
583
+
584
+ $ sf agent preview --authoring-bundle My_Agent_Bundle --utterance "What can you help me with?" --target-org \
585
+ my-dev-org
586
+
587
+ Send a follow-up message to an existing preview session:
588
+
589
+ $ sf agent preview --authoring-bundle My_Agent_Bundle --session-id <session-id> --utterance "Tell me more" \
590
+ --target-org my-dev-org
575
591
  ```
576
592
 
577
- _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/preview.ts)_
593
+ _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/preview.ts)_
578
594
 
579
595
  ## `sf agent publish authoring-bundle`
580
596
 
@@ -623,7 +639,7 @@ EXAMPLES
623
639
  $ sf agent publish authoring-bundle --api-name MyAuthoringbundle --target-org my-dev-org
624
640
  ```
625
641
 
626
- _See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/publish/authoring-bundle.ts)_
642
+ _See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/publish/authoring-bundle.ts)_
627
643
 
628
644
  ## `sf agent test create`
629
645
 
@@ -678,7 +694,7 @@ EXAMPLES
678
694
  $ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
679
695
  ```
680
696
 
681
- _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/test/create.ts)_
697
+ _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/test/create.ts)_
682
698
 
683
699
  ## `sf agent test list`
684
700
 
@@ -713,7 +729,7 @@ EXAMPLES
713
729
  $ sf agent test list --target-org my-org
714
730
  ```
715
731
 
716
- _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/test/list.ts)_
732
+ _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/test/list.ts)_
717
733
 
718
734
  ## `sf agent test results`
719
735
 
@@ -779,7 +795,7 @@ FLAG DESCRIPTIONS
779
795
  expression when using custom evaluations.
780
796
  ```
781
797
 
782
- _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/test/results.ts)_
798
+ _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/test/results.ts)_
783
799
 
784
800
  ## `sf agent test resume`
785
801
 
@@ -852,7 +868,7 @@ FLAG DESCRIPTIONS
852
868
  expression when using custom evaluations.
853
869
  ```
854
870
 
855
- _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/test/resume.ts)_
871
+ _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/test/resume.ts)_
856
872
 
857
873
  ## `sf agent test run`
858
874
 
@@ -926,7 +942,7 @@ FLAG DESCRIPTIONS
926
942
  expression when using custom evaluations.
927
943
  ```
928
944
 
929
- _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/test/run.ts)_
945
+ _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/test/run.ts)_
930
946
 
931
947
  ## `sf agent validate authoring-bundle`
932
948
 
@@ -973,6 +989,6 @@ EXAMPLES
973
989
  $ sf agent validate authoring-bundle --api-name MyAuthoringBundle --target-org my-dev-org
974
990
  ```
975
991
 
976
- _See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.2/src/commands/agent/validate/authoring-bundle.ts)_
992
+ _See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.27.4-preview.0/src/commands/agent/validate/authoring-bundle.ts)_
977
993
 
978
994
  <!-- commandsstop -->
@@ -1 +1 @@
1
- {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/commands/agent/generate/template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MA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viewResult = void;
13
+ export type AgentPreviewResult = {
14
+ sessionId: string;
15
+ response: string;
16
+ };
14
17
  export default class AgentPreview extends SfCommand<AgentPreviewResult> {
15
18
  static readonly summary: string;
16
19
  static readonly description: string;
17
20
  static readonly examples: string[];
18
- static readonly enableJsonFlag = false;
21
+ static readonly enableJsonFlag = true;
19
22
  static readonly requiresProject = true;
20
23
  static readonly flags: {
21
24
  'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
@@ -25,6 +28,8 @@ export default class AgentPreview extends SfCommand<AgentPreviewResult> {
25
28
  'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
26
29
  'apex-debug': import("@oclif/core/interfaces").BooleanFlag<boolean>;
27
30
  'use-live-actions': import("@oclif/core/interfaces").BooleanFlag<boolean>;
31
+ utterance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
32
+ 'session-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
28
33
  };
29
34
  run(): Promise<AgentPreviewResult>;
30
35
  }
@@ -29,7 +29,7 @@ export default class AgentPreview extends SfCommand {
29
29
  static summary = messages.getMessage('summary');
30
30
  static description = messages.getMessage('description');
31
31
  static examples = messages.getMessages('examples');
32
- static enableJsonFlag = false;
32
+ static enableJsonFlag = true;
33
33
  static requiresProject = true;
34
34
  static flags = {
35
35
  'target-org': Flags.requiredOrg(),
@@ -53,14 +53,27 @@ export default class AgentPreview extends SfCommand {
53
53
  summary: messages.getMessage('flags.use-live-actions.summary'),
54
54
  default: false,
55
55
  }),
56
+ utterance: Flags.string({
57
+ summary: messages.getMessage('flags.utterance.summary'),
58
+ }),
59
+ 'session-id': Flags.string({
60
+ summary: messages.getMessage('flags.session-id.summary'),
61
+ }),
56
62
  };
63
+ // eslint-disable-next-line complexity
57
64
  async run() {
58
65
  // STAGES OF PREVIEW
59
66
  // get user's agent selection either from flags, or interaction
60
67
  // if .agent selected, use the AgentSimulate class to preview
61
68
  // if published agent, use AgentPreview for preview
62
69
  const { flags } = await this.parse(AgentPreview);
63
- const { 'api-name': apiNameOrId, 'use-live-actions': useLiveActions, 'authoring-bundle': aabName } = flags;
70
+ const { 'api-name': apiNameOrId, 'use-live-actions': useLiveActions, 'authoring-bundle': aabName, utterance, 'session-id': sessionId, } = flags;
71
+ if (sessionId && !utterance) {
72
+ throw new SfError(messages.getMessage('error.sessionIdRequiresUtterance'), 'SessionIdRequiresUtterance');
73
+ }
74
+ if (utterance && !aabName && !apiNameOrId) {
75
+ throw new SfError(messages.getMessage('error.utteranceRequiresAgent'), 'UtteranceRequiresAgent');
76
+ }
64
77
  const conn = flags['target-org'].getConnection(flags['api-version']);
65
78
  let selectedAgent;
66
79
  if (aabName) {
@@ -105,6 +118,28 @@ export default class AgentPreview extends SfCommand {
105
118
  // Otherwise, let user decide when exiting
106
119
  const outputDir = flags['output-dir'] ? resolve(flags['output-dir']) : undefined;
107
120
  selectedAgent.preview.setApexDebugging(flags['apex-debug']);
121
+ if (utterance) {
122
+ // Non-interactive: send message and return response
123
+ if (sessionId) {
124
+ // @ts-expect-error - access protected member here
125
+ selectedAgent.sessionId = sessionId;
126
+ const response = await selectedAgent.preview.send(utterance);
127
+ const responseMessage = response.messages[0]?.message ?? '';
128
+ if (!this.jsonEnabled()) {
129
+ this.log(responseMessage);
130
+ }
131
+ return { sessionId, response: responseMessage };
132
+ }
133
+ // New session: start, send, end
134
+ const session = await selectedAgent.preview.start();
135
+ const response = await selectedAgent.preview.send(utterance);
136
+ const responseMessage = response.messages[0]?.message ?? '';
137
+ if (!this.jsonEnabled()) {
138
+ this.log(messages.getMessage('output.sessionId', [session.sessionId]));
139
+ this.log(responseMessage);
140
+ }
141
+ return { sessionId: session.sessionId, response: responseMessage };
142
+ }
108
143
  const instance = render(React.createElement(AgentPreviewReact, {
109
144
  agent: selectedAgent.preview,
110
145
  name: selectedAgent.name ?? '',
@@ -112,6 +147,8 @@ export default class AgentPreview extends SfCommand {
112
147
  isLocalAgent: selectedAgent instanceof ScriptAgent,
113
148
  }), { exitOnCtrlC: false });
114
149
  await instance.waitUntilExit();
150
+ // Interactive mode: return empty result for --json (non-interactive --utterance returns sessionId/response)
151
+ return { sessionId: '', response: '' };
115
152
  }
116
153
  }
117
154
  export const agentIsUnsupported = (devName) => UNSUPPORTED_AGENTS.includes(devName);
@@ -1 +1 @@
1
- {"version":3,"file":"preview.js","sourceRoot":"","sources":["../../../src/commands/agent/preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAoB,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACxG,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,eAAe,CAAC,CAAC;AAYpF,sGAAsG;AACtG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,wBAAwB,CAAC,CAAC;AAG7D,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,SAA6B;IAC9D,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CA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,CAAC,KAAgB,EAAW,EAAE;AAC3D,qGAAqG;AACrG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC;AAEpF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAgB,EAAW,EAAE;IACzD,yCAAyC;IACzC,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,OAAO,CAAC,SAAS,KAAK,CAAC,aAAa,eAAe,CAAC,CAAC;IACjE,CAAC;IACD,qCAAqC;IACrC,IAAI,kBAAkB,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,OAAO,CAAC,SAAS,KAAK,CAAC,aAAa,oBAAoB,EAAE,0BAA0B,EAAE;YAC9F,yGAAyG;SAC1G,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
@@ -39,6 +39,26 @@ Use real actions in the org; if not specified, preview uses AI to simulate (mock
39
39
 
40
40
  Enable Apex debug logging during the agent preview conversation.
41
41
 
42
+ # flags.utterance.summary
43
+
44
+ Message to send to the agent; creates a new session, returns the response, and exits without starting the interactive preview.
45
+
46
+ # flags.session-id.summary
47
+
48
+ Session ID of an in-progress preview session; use with --utterance to send a message to that session and return the response without starting the interactive preview.
49
+
50
+ # error.sessionIdRequiresUtterance
51
+
52
+ When using --session-id, you must also specify --utterance.
53
+
54
+ # error.utteranceRequiresAgent
55
+
56
+ When using --utterance, specify the agent with --api-name or --authoring-bundle.
57
+
58
+ # output.sessionId
59
+
60
+ Session ID: %s
61
+
42
62
  # examples
43
63
 
44
64
  - Preview an agent by choosing from the list of available local Agent Script or published agents. If previewing a local Agent Script agent, use simulated mode. Use the org with alias "my-dev-org".
@@ -48,3 +68,11 @@ Enable Apex debug logging during the agent preview conversation.
48
68
  - Preview an agent in live mode by choosing from a list of authoring bundles. Save the conversation transcripts to the "./transcripts/my-preview" directory, enable the Apex debug logs, and use your default org:
49
69
 
50
70
  <%= config.bin %> <%= command.id %> --use-live-actions --apex-debug --output-dir transcripts/my-preview
71
+
72
+ - Send a message to the agent and print the response without starting the interactive preview (requires --api-name or --authoring-bundle):
73
+
74
+ <%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --utterance "What can you help me with?" --target-org my-dev-org
75
+
76
+ - Send a follow-up message to an existing preview session:
77
+
78
+ <%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --session-id <session-id> --utterance "Tell me more" --target-org my-dev-org
@@ -251,9 +251,18 @@
251
251
  "description": "Use this command to have a natural language conversation with an agent, either while you code its local Agent Script file or when it's published to an org. Previewing an agent acts like an initial test to make sure it responds to your utterances as you expect. For example, you can test that the agent uses a particular topic when asked a question, and then whether it invokes the correct action associated with that topic. This command is the CLI-equivalent of the Preview panel in your org's Agentforce Builder UI.\n\nRun without flags, this command provides a list of agents to preview, divided into two categories: \"Agent Script\", which are agents that have a local authoring bundle in your DX project, or \"Published\", which are agents that are published and activated in your org. Authoring bundles contain an agent's Agent Script file. You then choose the agent you want to preview from the list. Or you can use the --authoring-bundle flag to specify a local authoring bundle's API name or --api-name to specify an activated published agent.\n\nWhen previewing an agent from its Agent Script file, you can use these two modes:\n\n- Simulated mode (Default): Uses only the Agent Script file to converse, and it simulates (mocks) all the actions. Use this mode if none of the Apex classes, flows, or prompt templates that implement your actions are available yet. The LLM uses the information about topics in the Agent Script file to simulate what the action does or how it responds.\n- Live mode: Uses the actual Apex classes, flows, and prompt templates in your development org in the agent preview. If you've changed the Apex classe, flows, or prompt templates in your local DX project, then you must deploy them to your development org if you want to use them in your live preview.\n\nYou can use the Apex Replay Debugger to debug your Apex classes when using live mode for Agent Script files and for activated published agents; specify the --apex-debug flag.\n\nOnce connected to your agent, the preview interface is simple: in the \"Start typing...\" prompt, enter a statement, question, or command; when you're done, enter Return. Your utterance is posted on the right along with a timestamp. The agent then responds on the left. To exit the conversation, hit ESC or Control+C.\n\nWhen the session concludes, the command asks if you want to save the API responses and chat transcripts. By default, the files are saved to the \"./temp/agent-preview\" directory. Specify a new default directory with the --output-dir flag.",
252
252
  "examples": [
253
253
  "Preview an agent by choosing from the list of available local Agent Script or published agents. If previewing a local Agent Script agent, use simulated mode. Use the org with alias \"my-dev-org\".\n<%= config.bin %> <%= command.id %> --target-org my-dev-org",
254
- "Preview an agent in live mode by choosing from a list of authoring bundles. Save the conversation transcripts to the \"./transcripts/my-preview\" directory, enable the Apex debug logs, and use your default org:\n<%= config.bin %> <%= command.id %> --use-live-actions --apex-debug --output-dir transcripts/my-preview"
254
+ "Preview an agent in live mode by choosing from a list of authoring bundles. Save the conversation transcripts to the \"./transcripts/my-preview\" directory, enable the Apex debug logs, and use your default org:\n<%= config.bin %> <%= command.id %> --use-live-actions --apex-debug --output-dir transcripts/my-preview",
255
+ "Send a message to the agent and print the response without starting the interactive preview (requires --api-name or --authoring-bundle):\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --utterance \"What can you help me with?\" --target-org my-dev-org",
256
+ "Send a follow-up message to an existing preview session:\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --session-id <session-id> --utterance \"Tell me more\" --target-org my-dev-org"
255
257
  ],
256
258
  "flags": {
259
+ "json": {
260
+ "description": "Format output as json.",
261
+ "helpGroup": "GLOBAL",
262
+ "name": "json",
263
+ "allowNo": false,
264
+ "type": "boolean"
265
+ },
257
266
  "flags-dir": {
258
267
  "helpGroup": "GLOBAL",
259
268
  "name": "flags-dir",
@@ -314,6 +323,20 @@
314
323
  "summary": "Use real actions in the org; if not specified, preview uses AI to simulate (mock) actions.",
315
324
  "allowNo": false,
316
325
  "type": "boolean"
326
+ },
327
+ "utterance": {
328
+ "name": "utterance",
329
+ "summary": "Message to send to the agent; creates a new session, returns the response, and exits without starting the interactive preview.",
330
+ "hasDynamicHelp": false,
331
+ "multiple": false,
332
+ "type": "option"
333
+ },
334
+ "session-id": {
335
+ "name": "session-id",
336
+ "summary": "Session ID of an in-progress preview session; use with --utterance to send a message to that session and return the response without starting the interactive preview.",
337
+ "hasDynamicHelp": false,
338
+ "multiple": false,
339
+ "type": "option"
317
340
  }
318
341
  },
319
342
  "hasDynamicHelp": true,
@@ -324,7 +347,7 @@
324
347
  "pluginType": "core",
325
348
  "strict": true,
326
349
  "summary": "Interact with an agent to preview how it responds to your statements, questions, and commands (utterances).",
327
- "enableJsonFlag": false,
350
+ "enableJsonFlag": true,
328
351
  "requiresProject": true,
329
352
  "isESM": true,
330
353
  "relativePath": [
@@ -794,96 +817,6 @@
794
817
  "test-spec:generate:agent"
795
818
  ]
796
819
  },
797
- "agent:publish:authoring-bundle": {
798
- "aliases": [],
799
- "args": {},
800
- "description": "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.\n\nWhen 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; specify the --skip-retrieve flag to skip this step. Finally, the authoring bundle metadata (AiAuthoringBundle) is deployed to your org.\n\nThis command uses the API name of the authoring bundle.",
801
- "examples": [
802
- "Publish an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
803
- "Publish an authoring bundle with API name MyAuthoringBundle to the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringbundle --target-org my-dev-org"
804
- ],
805
- "flags": {
806
- "json": {
807
- "description": "Format output as json.",
808
- "helpGroup": "GLOBAL",
809
- "name": "json",
810
- "allowNo": false,
811
- "type": "boolean"
812
- },
813
- "flags-dir": {
814
- "helpGroup": "GLOBAL",
815
- "name": "flags-dir",
816
- "summary": "Import flag values from a directory.",
817
- "hasDynamicHelp": false,
818
- "multiple": false,
819
- "type": "option"
820
- },
821
- "target-org": {
822
- "char": "o",
823
- "name": "target-org",
824
- "noCacheDefault": true,
825
- "required": true,
826
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
827
- "hasDynamicHelp": true,
828
- "multiple": false,
829
- "type": "option"
830
- },
831
- "api-version": {
832
- "description": "Override the api version used for api requests made by this command",
833
- "name": "api-version",
834
- "hasDynamicHelp": false,
835
- "multiple": false,
836
- "type": "option"
837
- },
838
- "api-name": {
839
- "char": "n",
840
- "name": "api-name",
841
- "summary": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
842
- "hasDynamicHelp": false,
843
- "multiple": false,
844
- "type": "option"
845
- },
846
- "skip-retrieve": {
847
- "name": "skip-retrieve",
848
- "summary": "Don't retrieve the metadata associated with the agent to your DX project.",
849
- "allowNo": false,
850
- "type": "boolean"
851
- }
852
- },
853
- "hasDynamicHelp": true,
854
- "hiddenAliases": [],
855
- "id": "agent:publish:authoring-bundle",
856
- "pluginAlias": "@salesforce/plugin-agent",
857
- "pluginName": "@salesforce/plugin-agent",
858
- "pluginType": "core",
859
- "strict": true,
860
- "summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
861
- "enableJsonFlag": true,
862
- "requiresProject": true,
863
- "FLAGGABLE_PROMPTS": {
864
- "api-name": {
865
- "message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
866
- "promptMessage": "API name of the authoring bundle to publish"
867
- }
868
- },
869
- "isESM": true,
870
- "relativePath": [
871
- "lib",
872
- "commands",
873
- "agent",
874
- "publish",
875
- "authoring-bundle.js"
876
- ],
877
- "aliasPermutations": [],
878
- "permutations": [
879
- "agent:publish:authoring-bundle",
880
- "publish:agent:authoring-bundle",
881
- "publish:authoring-bundle:agent",
882
- "agent:authoring-bundle:publish",
883
- "authoring-bundle:agent:publish",
884
- "authoring-bundle:publish:agent"
885
- ]
886
- },
887
820
  "agent:test:create": {
888
821
  "aliases": [],
889
822
  "args": {},
@@ -1481,7 +1414,97 @@
1481
1414
  "authoring-bundle:agent:validate",
1482
1415
  "authoring-bundle:validate:agent"
1483
1416
  ]
1417
+ },
1418
+ "agent:publish:authoring-bundle": {
1419
+ "aliases": [],
1420
+ "args": {},
1421
+ "description": "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.\n\nWhen 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; specify the --skip-retrieve flag to skip this step. Finally, the authoring bundle metadata (AiAuthoringBundle) is deployed to your org.\n\nThis command uses the API name of the authoring bundle.",
1422
+ "examples": [
1423
+ "Publish an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
1424
+ "Publish an authoring bundle with API name MyAuthoringBundle to the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringbundle --target-org my-dev-org"
1425
+ ],
1426
+ "flags": {
1427
+ "json": {
1428
+ "description": "Format output as json.",
1429
+ "helpGroup": "GLOBAL",
1430
+ "name": "json",
1431
+ "allowNo": false,
1432
+ "type": "boolean"
1433
+ },
1434
+ "flags-dir": {
1435
+ "helpGroup": "GLOBAL",
1436
+ "name": "flags-dir",
1437
+ "summary": "Import flag values from a directory.",
1438
+ "hasDynamicHelp": false,
1439
+ "multiple": false,
1440
+ "type": "option"
1441
+ },
1442
+ "target-org": {
1443
+ "char": "o",
1444
+ "name": "target-org",
1445
+ "noCacheDefault": true,
1446
+ "required": true,
1447
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
1448
+ "hasDynamicHelp": true,
1449
+ "multiple": false,
1450
+ "type": "option"
1451
+ },
1452
+ "api-version": {
1453
+ "description": "Override the api version used for api requests made by this command",
1454
+ "name": "api-version",
1455
+ "hasDynamicHelp": false,
1456
+ "multiple": false,
1457
+ "type": "option"
1458
+ },
1459
+ "api-name": {
1460
+ "char": "n",
1461
+ "name": "api-name",
1462
+ "summary": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
1463
+ "hasDynamicHelp": false,
1464
+ "multiple": false,
1465
+ "type": "option"
1466
+ },
1467
+ "skip-retrieve": {
1468
+ "name": "skip-retrieve",
1469
+ "summary": "Don't retrieve the metadata associated with the agent to your DX project.",
1470
+ "allowNo": false,
1471
+ "type": "boolean"
1472
+ }
1473
+ },
1474
+ "hasDynamicHelp": true,
1475
+ "hiddenAliases": [],
1476
+ "id": "agent:publish:authoring-bundle",
1477
+ "pluginAlias": "@salesforce/plugin-agent",
1478
+ "pluginName": "@salesforce/plugin-agent",
1479
+ "pluginType": "core",
1480
+ "strict": true,
1481
+ "summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
1482
+ "enableJsonFlag": true,
1483
+ "requiresProject": true,
1484
+ "FLAGGABLE_PROMPTS": {
1485
+ "api-name": {
1486
+ "message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
1487
+ "promptMessage": "API name of the authoring bundle to publish"
1488
+ }
1489
+ },
1490
+ "isESM": true,
1491
+ "relativePath": [
1492
+ "lib",
1493
+ "commands",
1494
+ "agent",
1495
+ "publish",
1496
+ "authoring-bundle.js"
1497
+ ],
1498
+ "aliasPermutations": [],
1499
+ "permutations": [
1500
+ "agent:publish:authoring-bundle",
1501
+ "publish:agent:authoring-bundle",
1502
+ "publish:authoring-bundle:agent",
1503
+ "agent:authoring-bundle:publish",
1504
+ "authoring-bundle:agent:publish",
1505
+ "authoring-bundle:publish:agent"
1506
+ ]
1484
1507
  }
1485
1508
  },
1486
- "version": "1.27.2"
1509
+ "version": "1.27.4-preview.0"
1487
1510
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-agent",
3
3
  "description": "Commands to interact with Salesforce agents",
4
- "version": "1.27.2",
4
+ "version": "1.27.4-preview.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
@@ -9,20 +9,20 @@
9
9
  "@inquirer/prompts": "^7.10.1",
10
10
  "@oclif/core": "^4",
11
11
  "@oclif/multi-stage-output": "^0.8.29",
12
- "@salesforce/agents": "^0.22.0",
12
+ "@salesforce/agents": "^0.22.2",
13
13
  "@salesforce/core": "^8.24.3",
14
- "@salesforce/kit": "^3.2.3",
14
+ "@salesforce/kit": "^3.2.4",
15
15
  "@salesforce/sf-plugins-core": "^12.2.6",
16
16
  "@salesforce/source-deploy-retrieve": "^12.31.10",
17
17
  "@salesforce/types": "^1.5.0",
18
18
  "ansis": "^3.3.2",
19
- "fast-xml-parser": "^4.5.1",
19
+ "fast-xml-parser": "^5.3.4",
20
20
  "glob": "^11.0.3",
21
21
  "ink": "5.0.1",
22
22
  "ink-text-input": "^6.0.0",
23
23
  "inquirer-autocomplete-standalone": "^0.8.1",
24
24
  "react": "^18.3.1",
25
- "yaml": "^2.8.1"
25
+ "yaml": "^2.8.2"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@oclif/plugin-command-snapshot": "^5.3.8",
@@ -237,7 +237,7 @@
237
237
  "exports": "./lib/index.js",
238
238
  "type": "module",
239
239
  "sfdx": {
240
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.27.2.crt",
241
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.27.2.sig"
240
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.27.4-preview.0.crt",
241
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.27.4-preview.0.sig"
242
242
  }
243
243
  }
@@ -3,7 +3,17 @@
3
3
  "$ref": "#/definitions/AgentPreviewResult",
4
4
  "definitions": {
5
5
  "AgentPreviewResult": {
6
- "type": "null"
6
+ "type": "object",
7
+ "properties": {
8
+ "sessionId": {
9
+ "type": "string"
10
+ },
11
+ "response": {
12
+ "type": "string"
13
+ }
14
+ },
15
+ "required": ["sessionId", "response"],
16
+ "additionalProperties": false
7
17
  }
8
18
  }
9
19
  }