@salesforce/plugin-agent 1.32.15 → 1.32.16

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
@@ -126,7 +126,7 @@ EXAMPLES
126
126
  $ sf agent activate --api-name Resort_Manager --version 2 --target-org my-org
127
127
  ```
128
128
 
129
- _See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/activate.ts)_
129
+ _See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/activate.ts)_
130
130
 
131
131
  ## `sf agent create`
132
132
 
@@ -193,7 +193,7 @@ EXAMPLES
193
193
  $ sf agent create --name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
194
194
  ```
195
195
 
196
- _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/create.ts)_
196
+ _See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/create.ts)_
197
197
 
198
198
  ## `sf agent deactivate`
199
199
 
@@ -234,7 +234,7 @@ EXAMPLES
234
234
  $ sf agent deactivate --api-name Resort_Manager --target-org my-org
235
235
  ```
236
236
 
237
- _See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/deactivate.ts)_
237
+ _See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/deactivate.ts)_
238
238
 
239
239
  ## `sf agent generate agent-spec`
240
240
 
@@ -341,7 +341,7 @@ EXAMPLES
341
341
  $ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
342
342
  ```
343
343
 
344
- _See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/generate/agent-spec.ts)_
344
+ _See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/generate/agent-spec.ts)_
345
345
 
346
346
  ## `sf agent generate authoring-bundle`
347
347
 
@@ -418,7 +418,7 @@ EXAMPLES
418
418
  other-package-dir/main/default --target-org my-dev-org
419
419
  ```
420
420
 
421
- _See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/generate/authoring-bundle.ts)_
421
+ _See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/generate/authoring-bundle.ts)_
422
422
 
423
423
  ## `sf agent generate template`
424
424
 
@@ -480,7 +480,7 @@ EXAMPLES
480
480
  my-package --source-org my-scratch-org
481
481
  ```
482
482
 
483
- _See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/generate/template.ts)_
483
+ _See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/generate/template.ts)_
484
484
 
485
485
  ## `sf agent generate test-spec`
486
486
 
@@ -545,7 +545,7 @@ EXAMPLES
545
545
  force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
546
546
  ```
547
547
 
548
- _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/generate/test-spec.ts)_
548
+ _See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/generate/test-spec.ts)_
549
549
 
550
550
  ## `sf agent preview`
551
551
 
@@ -618,7 +618,7 @@ EXAMPLES
618
618
  $ sf agent preview --use-live-actions --apex-debug --output-dir transcripts/my-preview
619
619
  ```
620
620
 
621
- _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/preview.ts)_
621
+ _See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/preview.ts)_
622
622
 
623
623
  ## `sf agent preview end`
624
624
 
@@ -673,7 +673,7 @@ EXAMPLES
673
673
  $ sf agent preview end --authoring-bundle My_Local_Agent
674
674
  ```
675
675
 
676
- _See code: [src/commands/agent/preview/end.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/preview/end.ts)_
676
+ _See code: [src/commands/agent/preview/end.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/preview/end.ts)_
677
677
 
678
678
  ## `sf agent preview send`
679
679
 
@@ -731,7 +731,7 @@ EXAMPLES
731
731
  $ sf agent preview send --utterance "what can you help me with?" --authoring-bundle My_Local_Agent
732
732
  ```
733
733
 
734
- _See code: [src/commands/agent/preview/send.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/preview/send.ts)_
734
+ _See code: [src/commands/agent/preview/send.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/preview/send.ts)_
735
735
 
736
736
  ## `sf agent preview sessions`
737
737
 
@@ -764,7 +764,7 @@ EXAMPLES
764
764
  $ sf agent preview sessions
765
765
  ```
766
766
 
767
- _See code: [src/commands/agent/preview/sessions.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/preview/sessions.ts)_
767
+ _See code: [src/commands/agent/preview/sessions.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/preview/sessions.ts)_
768
768
 
769
769
  ## `sf agent preview start`
770
770
 
@@ -773,7 +773,7 @@ Start a programmatic agent preview session.
773
773
  ```
774
774
  USAGE
775
775
  $ sf agent preview start -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>]
776
- [--authoring-bundle <value>] [--use-live-actions]
776
+ [--authoring-bundle <value>] [--use-live-actions | --simulate-actions]
777
777
 
778
778
  FLAGS
779
779
  -n, --api-name=<value> API name of the activated published agent you want to preview.
@@ -782,8 +782,10 @@ FLAGS
782
782
  --api-version=<value> Override the api version used for api requests made by this command
783
783
  --authoring-bundle=<value> API name of the authoring bundle metadata component that contains the agent's Agent
784
784
  Script file.
785
- --use-live-actions Use real actions in the org; if not specified, preview uses AI to simulate (mock)
786
- actions.
785
+ --simulate-actions Use AI to simulate action execution instead of calling real actions. Required with
786
+ --authoring-bundle.
787
+ --use-live-actions Execute real actions in the org (Apex classes, flows, etc.). Required with
788
+ --authoring-bundle.
787
789
 
788
790
  GLOBAL FLAGS
789
791
  --flags-dir=<value> Import flag values from a directory.
@@ -802,26 +804,32 @@ DESCRIPTION
802
804
  under the "aiAuthoringBundles" metadata directory. Similarly, the published agent's API name is the same as its
803
805
  directory name under the "Bots" metadata directory.
804
806
 
805
- When starting a preview session using the authoring bundle, which contains the agent's Agent Script file, the preview
806
- uses mocked actions by default. Specify --use-live-actions for live mode, which uses the real Apex classes, flows,
807
- etc, in the org for the actions.
807
+ When starting a preview session with --authoring-bundle, you must explicitly specify the execution mode using one of
808
+ these flags:
809
+
810
+ - --use-live-actions: Executes real Apex classes, flows, and other actions in the org. This surfaces compile and
811
+ validation errors during preview.
812
+ - --simulate-actions: Uses AI to simulate action execution without calling real implementations.
813
+
814
+ Published agents (--api-name) always use live actions. The mode flags are optional and have no effect for published
815
+ agents.
808
816
 
809
817
  EXAMPLES
810
- Start a programmatic agent preview session by specifying an authoring bundle; uses mocked actions by default. Use
811
- the org with alias "my-dev-org":
818
+ Start a programmatic agent preview session by specifying an authoring bundle; use simulated actions. Use the org
819
+ with alias "my-dev-org":
812
820
 
813
- $ sf agent preview start --authoring-bundle My_Agent_Bundle --target-org my-dev-org
821
+ $ sf agent preview start --authoring-bundle My_Agent_Bundle --target-org my-dev-org --simulate-actions
814
822
 
815
823
  Similar to previous example but use live actions and the default org:
816
824
 
817
825
  $ sf agent preview start --authoring-bundle My_Agent_Bundle --use-live-actions
818
826
 
819
- Start a preview session with an activated published agent:
827
+ Start a preview session with an activated published agent (always uses live actions):
820
828
 
821
829
  $ sf agent preview start --api-name My_Published_Agent
822
830
  ```
823
831
 
824
- _See code: [src/commands/agent/preview/start.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/preview/start.ts)_
832
+ _See code: [src/commands/agent/preview/start.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/preview/start.ts)_
825
833
 
826
834
  ## `sf agent publish authoring-bundle`
827
835
 
@@ -870,7 +878,7 @@ EXAMPLES
870
878
  $ sf agent publish authoring-bundle --api-name MyAuthoringbundle --target-org my-dev-org
871
879
  ```
872
880
 
873
- _See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/publish/authoring-bundle.ts)_
881
+ _See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/publish/authoring-bundle.ts)_
874
882
 
875
883
  ## `sf agent test create`
876
884
 
@@ -925,7 +933,7 @@ EXAMPLES
925
933
  $ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
926
934
  ```
927
935
 
928
- _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/test/create.ts)_
936
+ _See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/test/create.ts)_
929
937
 
930
938
  ## `sf agent test list`
931
939
 
@@ -960,7 +968,7 @@ EXAMPLES
960
968
  $ sf agent test list --target-org my-org
961
969
  ```
962
970
 
963
- _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/test/list.ts)_
971
+ _See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/test/list.ts)_
964
972
 
965
973
  ## `sf agent test results`
966
974
 
@@ -1026,7 +1034,7 @@ FLAG DESCRIPTIONS
1026
1034
  expression when using custom evaluations.
1027
1035
  ```
1028
1036
 
1029
- _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/test/results.ts)_
1037
+ _See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/test/results.ts)_
1030
1038
 
1031
1039
  ## `sf agent test resume`
1032
1040
 
@@ -1099,7 +1107,7 @@ FLAG DESCRIPTIONS
1099
1107
  expression when using custom evaluations.
1100
1108
  ```
1101
1109
 
1102
- _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/test/resume.ts)_
1110
+ _See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/test/resume.ts)_
1103
1111
 
1104
1112
  ## `sf agent test run`
1105
1113
 
@@ -1173,7 +1181,7 @@ FLAG DESCRIPTIONS
1173
1181
  expression when using custom evaluations.
1174
1182
  ```
1175
1183
 
1176
- _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/test/run.ts)_
1184
+ _See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/test/run.ts)_
1177
1185
 
1178
1186
  ## `sf agent validate authoring-bundle`
1179
1187
 
@@ -1220,6 +1228,6 @@ EXAMPLES
1220
1228
  $ sf agent validate authoring-bundle --api-name MyAuthoringBundle --target-org my-dev-org
1221
1229
  ```
1222
1230
 
1223
- _See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.15/src/commands/agent/validate/authoring-bundle.ts)_
1231
+ _See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.16/src/commands/agent/validate/authoring-bundle.ts)_
1224
1232
 
1225
1233
  <!-- commandsstop -->
@@ -15,6 +15,7 @@ export default class AgentPreviewStart extends SfCommand<AgentPreviewStartResult
15
15
  'api-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
16
  'authoring-bundle': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
17
  'use-live-actions': import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
+ 'simulate-actions': import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
19
  };
19
20
  run(): Promise<AgentPreviewStartResult>;
20
21
  }
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Flags, SfCommand, toHelpSection } from '@salesforce/sf-plugins-core';
17
- import { Lifecycle, Messages, SfError, EnvironmentVariable } from '@salesforce/core';
17
+ import { EnvironmentVariable, Lifecycle, Messages, SfError } from '@salesforce/core';
18
18
  import { Agent, ProductionAgent, ScriptAgent } from '@salesforce/agents';
19
19
  import { createCache } from '../../../previewSessionStore.js';
20
20
  import { COMPILATION_API_EXIT_CODES } from '../../../common.js';
@@ -47,13 +47,23 @@ export default class AgentPreviewStart extends SfCommand {
47
47
  }),
48
48
  'use-live-actions': Flags.boolean({
49
49
  summary: messages.getMessage('flags.use-live-actions.summary'),
50
- default: false,
50
+ exclusive: ['simulate-actions'],
51
+ }),
52
+ 'simulate-actions': Flags.boolean({
53
+ summary: messages.getMessage('flags.simulate-actions.summary'),
54
+ exclusive: ['use-live-actions'],
51
55
  }),
52
56
  };
53
57
  async run() {
54
58
  const { flags } = await this.parse(AgentPreviewStart);
59
+ // Validate: authoring-bundle requires exactly one mode flag
60
+ // (mutual exclusion of mode flags handled by 'exclusive' in flag definitions)
61
+ if (flags['authoring-bundle'] && !flags['use-live-actions'] && !flags['simulate-actions']) {
62
+ throw new SfError('When using --authoring-bundle, you must specify either --use-live-actions or --simulate-actions.', 'MissingModeFlag');
63
+ }
55
64
  const conn = flags['target-org'].getConnection(flags['api-version']);
56
65
  const useLiveActions = flags['use-live-actions'];
66
+ const simulateActions = flags['simulate-actions'];
57
67
  const agentIdentifier = flags['authoring-bundle'] ?? flags['api-name'];
58
68
  // Track telemetry for agent initialization
59
69
  let agent;
@@ -87,11 +97,14 @@ export default class AgentPreviewStart extends SfCommand {
87
97
  await Lifecycle.getInstance().emitTelemetry({ eventName: 'agent_preview_start_agent_init_failed' });
88
98
  throw wrapped;
89
99
  }
100
+ // Set mode for authoring bundles based on which flag was specified
101
+ // (mutual exclusion enforced by flag definitions - can't have both)
90
102
  if (agent instanceof ScriptAgent) {
91
- agent.preview.setMockMode(useLiveActions ? 'Live Test' : 'Mock');
103
+ agent.preview.setMockMode(simulateActions ? 'Mock' : 'Live Test');
92
104
  }
93
- if (useLiveActions && agent instanceof ProductionAgent) {
94
- void Lifecycle.getInstance().emitWarning('Published agents always use real actions; --use-live-actions has no effect for published agents.');
105
+ // Warn if mode flags are used with published agents (they have no effect)
106
+ if (agent instanceof ProductionAgent && (useLiveActions || simulateActions)) {
107
+ void Lifecycle.getInstance().emitWarning('Published agents always use real actions; --use-live-actions and --simulate-actions have no effect for published agents.');
95
108
  }
96
109
  // Track telemetry for preview start
97
110
  let session;
@@ -1 +1 @@
1
- {"version":3,"file":"start.js","sourceRoot":"","sources":["../../../../src/commands/agent/preview/start.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAEhE,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CA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SAAS,CAAC,WAAW,EAAE,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,4BAA4B,EAAE,CAAC,CAAC;YACzF,MAAM,IAAI,OAAO,CACf,QAAQ,CAAC,UAAU,CAAC,0BAA0B,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAClE,oBAAoB,EACpB,CAAC,OAAO,CAAC,OAAO,CAAC,EACjB,CAAC,EACD,OAAO,CACR,CAAC;QACJ,CAAC;QAED,MAAM,WAAW,GAAG,KAAK,CAAC,kBAAkB,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;QACnE,MAAM,WAAW,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;QAE1C,MAAM,SAAS,CAAC,WAAW,EAAE,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,6BAA6B,EAAE,CAAC,CAAC;QAC1F,MAAM,MAAM,GAA4B,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;QACzE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACvE,OAAO,MAAM,CAAC;IAChB,CAAC"}
@@ -8,7 +8,12 @@ This command outputs a session ID that you then use with the "agent preview send
8
8
 
9
9
  Identify the agent you want to start previewing with either the --authoring-bundle flag to specify a local authoring bundle's API name or --api-name to specify an activated published agent's API name. To find either API name, navigate to your package directory in your DX project. The API name of an authoring bundle is the same as its directory name under the "aiAuthoringBundles" metadata directory. Similarly, the published agent's API name is the same as its directory name under the "Bots" metadata directory.
10
10
 
11
- When starting a preview session using the authoring bundle, which contains the agent's Agent Script file, the preview uses mocked actions by default. Specify --use-live-actions for live mode, which uses the real Apex classes, flows, etc, in the org for the actions.
11
+ When starting a preview session with --authoring-bundle, you must explicitly specify the execution mode using one of these flags:
12
+
13
+ - --use-live-actions: Executes real Apex classes, flows, and other actions in the org. This surfaces compile and validation errors during preview.
14
+ - --simulate-actions: Uses AI to simulate action execution without calling real implementations.
15
+
16
+ Published agents (--api-name) always use live actions. The mode flags are optional and have no effect for published agents.
12
17
 
13
18
  # flags.api-name.summary
14
19
 
@@ -20,7 +25,11 @@ API name of the authoring bundle metadata component that contains the agent's Ag
20
25
 
21
26
  # flags.use-live-actions.summary
22
27
 
23
- Use real actions in the org; if not specified, preview uses AI to simulate (mock) actions.
28
+ Execute real actions in the org (Apex classes, flows, etc.). Required with --authoring-bundle.
29
+
30
+ # flags.simulate-actions.summary
31
+
32
+ Use AI to simulate action execution instead of calling real actions. Required with --authoring-bundle.
24
33
 
25
34
  # output.sessionId
26
35
 
@@ -40,14 +49,14 @@ Failed to start preview session: %s
40
49
 
41
50
  # examples
42
51
 
43
- - Start a programmatic agent preview session by specifying an authoring bundle; uses mocked actions by default. Use the org with alias "my-dev-org":
52
+ - Start a programmatic agent preview session by specifying an authoring bundle; use simulated actions. Use the org with alias "my-dev-org":
44
53
 
45
- <%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --target-org my-dev-org
54
+ <%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --target-org my-dev-org --simulate-actions
46
55
 
47
56
  - Similar to previous example but use live actions and the default org:
48
57
 
49
58
  <%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --use-live-actions
50
59
 
51
- - Start a preview session with an activated published agent:
60
+ - Start a preview session with an activated published agent (always uses live actions):
52
61
 
53
62
  <%= config.bin %> <%= command.id %> --api-name My_Published_Agent
@@ -1189,11 +1189,11 @@
1189
1189
  "agent:preview:start": {
1190
1190
  "aliases": [],
1191
1191
  "args": {},
1192
- "description": "This command outputs a session ID that you then use with the \"agent preview send\" command to send an utterance to the agent. Use the \"agent preview sessions\" command to list all active sessions and the \"agent preview end\" command to end a specific session.\n\nIdentify the agent you want to start previewing with either the --authoring-bundle flag to specify a local authoring bundle's API name or --api-name to specify an activated published agent's API name. To find either API name, navigate to your package directory in your DX project. The API name of an authoring bundle is the same as its directory name under the \"aiAuthoringBundles\" metadata directory. Similarly, the published agent's API name is the same as its directory name under the \"Bots\" metadata directory.\n\nWhen starting a preview session using the authoring bundle, which contains the agent's Agent Script file, the preview uses mocked actions by default. Specify --use-live-actions for live mode, which uses the real Apex classes, flows, etc, in the org for the actions.",
1192
+ "description": "This command outputs a session ID that you then use with the \"agent preview send\" command to send an utterance to the agent. Use the \"agent preview sessions\" command to list all active sessions and the \"agent preview end\" command to end a specific session.\n\nIdentify the agent you want to start previewing with either the --authoring-bundle flag to specify a local authoring bundle's API name or --api-name to specify an activated published agent's API name. To find either API name, navigate to your package directory in your DX project. The API name of an authoring bundle is the same as its directory name under the \"aiAuthoringBundles\" metadata directory. Similarly, the published agent's API name is the same as its directory name under the \"Bots\" metadata directory.\n\nWhen starting a preview session with --authoring-bundle, you must explicitly specify the execution mode using one of these flags:\n\n- --use-live-actions: Executes real Apex classes, flows, and other actions in the org. This surfaces compile and validation errors during preview.\n- --simulate-actions: Uses AI to simulate action execution without calling real implementations.\n\nPublished agents (--api-name) always use live actions. The mode flags are optional and have no effect for published agents.",
1193
1193
  "examples": [
1194
- "Start a programmatic agent preview session by specifying an authoring bundle; uses mocked actions by default. Use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --target-org my-dev-org",
1194
+ "Start a programmatic agent preview session by specifying an authoring bundle; use simulated actions. Use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --target-org my-dev-org --simulate-actions",
1195
1195
  "Similar to previous example but use live actions and the default org:\n<%= config.bin %> <%= command.id %> --authoring-bundle My_Agent_Bundle --use-live-actions",
1196
- "Start a preview session with an activated published agent:\n<%= config.bin %> <%= command.id %> --api-name My_Published_Agent"
1196
+ "Start a preview session with an activated published agent (always uses live actions):\n<%= config.bin %> <%= command.id %> --api-name My_Published_Agent"
1197
1197
  ],
1198
1198
  "flags": {
1199
1199
  "json": {
@@ -1244,8 +1244,20 @@
1244
1244
  "type": "option"
1245
1245
  },
1246
1246
  "use-live-actions": {
1247
+ "exclusive": [
1248
+ "simulate-actions"
1249
+ ],
1247
1250
  "name": "use-live-actions",
1248
- "summary": "Use real actions in the org; if not specified, preview uses AI to simulate (mock) actions.",
1251
+ "summary": "Execute real actions in the org (Apex classes, flows, etc.). Required with --authoring-bundle.",
1252
+ "allowNo": false,
1253
+ "type": "boolean"
1254
+ },
1255
+ "simulate-actions": {
1256
+ "exclusive": [
1257
+ "use-live-actions"
1258
+ ],
1259
+ "name": "simulate-actions",
1260
+ "summary": "Use AI to simulate action execution instead of calling real actions. Required with --authoring-bundle.",
1249
1261
  "allowNo": false,
1250
1262
  "type": "boolean"
1251
1263
  }
@@ -2328,5 +2340,5 @@
2328
2340
  ]
2329
2341
  }
2330
2342
  },
2331
- "version": "1.32.15"
2343
+ "version": "1.32.16"
2332
2344
  }
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.32.15",
4
+ "version": "1.32.16",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "enableO11y": true,
@@ -240,7 +240,7 @@
240
240
  "exports": "./lib/index.js",
241
241
  "type": "module",
242
242
  "sfdx": {
243
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.32.15.crt",
244
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.32.15.sig"
243
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.32.16.crt",
244
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.32.16.sig"
245
245
  }
246
246
  }