@salesforce/plugin-agent 1.33.0 → 1.34.1
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 +20 -20
- package/lib/commands/agent/preview/sessions.d.ts +3 -0
- package/lib/commands/agent/preview/sessions.js +9 -3
- package/lib/commands/agent/preview/sessions.js.map +1 -1
- package/lib/commands/agent/preview/start.js +7 -1
- package/lib/commands/agent/preview/start.js.map +1 -1
- package/lib/commands/agent/publish/authoring-bundle.d.ts +1 -0
- package/lib/commands/agent/publish/authoring-bundle.js +5 -1
- package/lib/commands/agent/publish/authoring-bundle.js.map +1 -1
- package/lib/previewSessionStore.d.ts +1 -45
- package/lib/previewSessionStore.js +1 -137
- package/lib/previewSessionStore.js.map +1 -1
- package/messages/agent.preview.sessions.md +10 -2
- package/oclif.manifest.json +15 -2
- package/package.json +5 -5
- package/schemas/agent-preview-sessions.json +10 -0
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.
|
|
129
|
+
_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/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.
|
|
196
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/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.
|
|
237
|
+
_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/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.
|
|
344
|
+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/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.
|
|
421
|
+
_See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/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.
|
|
483
|
+
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/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.
|
|
548
|
+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/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.
|
|
621
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/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.
|
|
676
|
+
_See code: [src/commands/agent/preview/end.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/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.
|
|
734
|
+
_See code: [src/commands/agent/preview/send.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/src/commands/agent/preview/send.ts)_
|
|
735
735
|
|
|
736
736
|
## `sf agent preview sessions`
|
|
737
737
|
|
|
@@ -753,7 +753,7 @@ DESCRIPTION
|
|
|
753
753
|
"agent preview end" commands with the --session-id flag.
|
|
754
754
|
|
|
755
755
|
Programmatic agent preview sessions can be started for both published activated agents and by using an agent's local
|
|
756
|
-
authoring bundle, which contains its Agent Script file.
|
|
756
|
+
authoring bundle, which contains its Agent Script file. In this command's output table, the Agent column contains
|
|
757
757
|
either the API name of the authoring bundle or the published agent, whichever was used when starting the session. In
|
|
758
758
|
the table, if the same API name has multiple rows with different session IDs, then it means that you previously
|
|
759
759
|
started multiple preview sessions with the associated agent.
|
|
@@ -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.
|
|
767
|
+
_See code: [src/commands/agent/preview/sessions.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/src/commands/agent/preview/sessions.ts)_
|
|
768
768
|
|
|
769
769
|
## `sf agent preview start`
|
|
770
770
|
|
|
@@ -829,7 +829,7 @@ EXAMPLES
|
|
|
829
829
|
$ sf agent preview start --api-name My_Published_Agent
|
|
830
830
|
```
|
|
831
831
|
|
|
832
|
-
_See code: [src/commands/agent/preview/start.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
832
|
+
_See code: [src/commands/agent/preview/start.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/src/commands/agent/preview/start.ts)_
|
|
833
833
|
|
|
834
834
|
## `sf agent publish authoring-bundle`
|
|
835
835
|
|
|
@@ -878,7 +878,7 @@ EXAMPLES
|
|
|
878
878
|
$ sf agent publish authoring-bundle --api-name MyAuthoringbundle --target-org my-dev-org
|
|
879
879
|
```
|
|
880
880
|
|
|
881
|
-
_See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
881
|
+
_See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/src/commands/agent/publish/authoring-bundle.ts)_
|
|
882
882
|
|
|
883
883
|
## `sf agent test create`
|
|
884
884
|
|
|
@@ -933,7 +933,7 @@ EXAMPLES
|
|
|
933
933
|
$ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
|
|
934
934
|
```
|
|
935
935
|
|
|
936
|
-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
936
|
+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/src/commands/agent/test/create.ts)_
|
|
937
937
|
|
|
938
938
|
## `sf agent test list`
|
|
939
939
|
|
|
@@ -968,7 +968,7 @@ EXAMPLES
|
|
|
968
968
|
$ sf agent test list --target-org my-org
|
|
969
969
|
```
|
|
970
970
|
|
|
971
|
-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
971
|
+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/src/commands/agent/test/list.ts)_
|
|
972
972
|
|
|
973
973
|
## `sf agent test results`
|
|
974
974
|
|
|
@@ -1034,7 +1034,7 @@ FLAG DESCRIPTIONS
|
|
|
1034
1034
|
expression when using custom evaluations.
|
|
1035
1035
|
```
|
|
1036
1036
|
|
|
1037
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
1037
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/src/commands/agent/test/results.ts)_
|
|
1038
1038
|
|
|
1039
1039
|
## `sf agent test resume`
|
|
1040
1040
|
|
|
@@ -1107,7 +1107,7 @@ FLAG DESCRIPTIONS
|
|
|
1107
1107
|
expression when using custom evaluations.
|
|
1108
1108
|
```
|
|
1109
1109
|
|
|
1110
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
1110
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/src/commands/agent/test/resume.ts)_
|
|
1111
1111
|
|
|
1112
1112
|
## `sf agent test run`
|
|
1113
1113
|
|
|
@@ -1181,7 +1181,7 @@ FLAG DESCRIPTIONS
|
|
|
1181
1181
|
expression when using custom evaluations.
|
|
1182
1182
|
```
|
|
1183
1183
|
|
|
1184
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
1184
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/src/commands/agent/test/run.ts)_
|
|
1185
1185
|
|
|
1186
1186
|
## `sf agent validate authoring-bundle`
|
|
1187
1187
|
|
|
@@ -1228,6 +1228,6 @@ EXAMPLES
|
|
|
1228
1228
|
$ sf agent validate authoring-bundle --api-name MyAuthoringBundle --target-org my-dev-org
|
|
1229
1229
|
```
|
|
1230
1230
|
|
|
1231
|
-
_See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.
|
|
1231
|
+
_See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.34.1/src/commands/agent/validate/authoring-bundle.ts)_
|
|
1232
1232
|
|
|
1233
1233
|
<!-- commandsstop -->
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { SessionType } from '../../../previewSessionStore.js';
|
|
2
3
|
export type AgentPreviewSessionsResult = Array<{
|
|
3
4
|
agentId: string;
|
|
4
5
|
displayName?: string;
|
|
5
6
|
sessionId: string;
|
|
7
|
+
timestamp?: string;
|
|
8
|
+
sessionType?: SessionType;
|
|
6
9
|
}>;
|
|
7
10
|
export default class AgentPreviewSessions extends SfCommand<AgentPreviewSessionsResult> {
|
|
8
11
|
static readonly summary: string;
|
|
@@ -29,9 +29,9 @@ export default class AgentPreviewSessions extends SfCommand {
|
|
|
29
29
|
async run() {
|
|
30
30
|
const entries = await listCachedSessions(this.project);
|
|
31
31
|
const rows = [];
|
|
32
|
-
for (const { agentId, displayName,
|
|
33
|
-
for (const sessionId of
|
|
34
|
-
rows.push({ agentId, displayName, sessionId });
|
|
32
|
+
for (const { agentId, displayName, sessions } of entries) {
|
|
33
|
+
for (const { sessionId, timestamp, sessionType } of sessions) {
|
|
34
|
+
rows.push({ agentId, displayName, sessionId, timestamp, sessionType });
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
if (rows.length === 0) {
|
|
@@ -43,15 +43,21 @@ export default class AgentPreviewSessions extends SfCommand {
|
|
|
43
43
|
}
|
|
44
44
|
const agentColumnHeader = messages.getMessage('output.tableHeader.agent');
|
|
45
45
|
const sessionIdHeader = messages.getMessage('output.tableHeader.sessionId');
|
|
46
|
+
const timestampHeader = messages.getMessage('output.tableHeader.timestamp');
|
|
47
|
+
const sessionTypeHeader = messages.getMessage('output.tableHeader.sessionType');
|
|
46
48
|
const tableData = rows.map((r) => ({
|
|
47
49
|
agent: r.displayName ?? r.agentId,
|
|
48
50
|
sessionId: r.sessionId,
|
|
51
|
+
timestamp: r.timestamp ?? '',
|
|
52
|
+
sessionType: r.sessionType ?? '',
|
|
49
53
|
}));
|
|
50
54
|
this.table({
|
|
51
55
|
data: tableData,
|
|
52
56
|
columns: [
|
|
53
57
|
{ key: 'agent', name: agentColumnHeader },
|
|
54
58
|
{ key: 'sessionId', name: sessionIdHeader },
|
|
59
|
+
{ key: 'timestamp', name: timestampHeader },
|
|
60
|
+
{ key: 'sessionType', name: sessionTypeHeader },
|
|
55
61
|
],
|
|
56
62
|
});
|
|
57
63
|
return rows;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../../src/commands/agent/preview/sessions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../../src/commands/agent/preview/sessions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAe,MAAM,iCAAiC,CAAC;AAElF,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,wBAAwB,CAAC,CAAC;AAU7F,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,SAAqC;IAC9E,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,eAAe,GAAG,IAAI,CAAC;IAEvC,MAAM,CAAU,UAAU,GAAG,aAAa,CAAC,aAAa,EAAE;QAC/D,eAAe,EAAE,qEAAqE;KACvF,CAAC,CAAC;IAEI,KAAK,CAAC,GAAG;QACd,MAAM,OAAO,GAAG,MAAM,kBAA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AI,CAAC,KAAK,CAAC;YACT,IAAI,EAAE,SAAS;YACf,OAAO,EAAE;gBACP,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE;gBACzC,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,EAAE;gBAC3C,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,EAAE;gBAC3C,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,iBAAiB,EAAE;aAChD;SACF,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC"}
|
|
@@ -117,11 +117,17 @@ export default class AgentPreviewStart extends SfCommand {
|
|
|
117
117
|
throw new SfError(messages.getMessage('error.previewStartFailed', [wrapped.message]), 'PreviewStartFailed', [wrapped.message], 4, wrapped);
|
|
118
118
|
}
|
|
119
119
|
const displayName = flags['authoring-bundle'] ?? flags['api-name'];
|
|
120
|
-
|
|
120
|
+
const sessionType = resolveSessionType(agent, simulateActions);
|
|
121
|
+
await createCache(agent, { displayName, sessionType });
|
|
121
122
|
await Lifecycle.getInstance().emitTelemetry({ eventName: 'agent_preview_start_success' });
|
|
122
123
|
const result = { sessionId: session.sessionId, agentApiName: agentIdentifier };
|
|
123
124
|
this.log(messages.getMessage('output.sessionId', [session.sessionId]));
|
|
124
125
|
return result;
|
|
125
126
|
}
|
|
126
127
|
}
|
|
128
|
+
function resolveSessionType(agent, simulateActions) {
|
|
129
|
+
if (agent instanceof ProductionAgent)
|
|
130
|
+
return 'published';
|
|
131
|
+
return simulateActions ? 'simulated' : 'live';
|
|
132
|
+
}
|
|
127
133
|
//# sourceMappingURL=start.js.map
|
|
@@ -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,6BAA6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SAAS,kBAAkB,CAAC,KAAoC,EAAE,eAAoC;IACpG,IAAI,KAAK,YAAY,eAAe;QAAE,OAAO,WAAW,CAAC;IACzD,OAAO,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;AAChD,CAAC"}
|
|
@@ -9,6 +9,7 @@ export default class AgentPublishAuthoringBundle extends SfCommand<AgentPublishA
|
|
|
9
9
|
static readonly description: string;
|
|
10
10
|
static readonly examples: string[];
|
|
11
11
|
static readonly requiresProject = true;
|
|
12
|
+
static readonly errorCodes: import("@oclif/core").HelpSection;
|
|
12
13
|
static readonly flags: {
|
|
13
14
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { EOL } from 'node:os';
|
|
17
|
-
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
17
|
+
import { SfCommand, Flags, toHelpSection } from '@salesforce/sf-plugins-core';
|
|
18
18
|
import { MultiStageOutput } from '@oclif/multi-stage-output';
|
|
19
19
|
import { Messages, Lifecycle, SfError } from '@salesforce/core';
|
|
20
20
|
import { Agent } from '@salesforce/agents';
|
|
@@ -29,6 +29,10 @@ export default class AgentPublishAuthoringBundle extends SfCommand {
|
|
|
29
29
|
static description = messages.getMessage('description');
|
|
30
30
|
static examples = messages.getMessages('examples');
|
|
31
31
|
static requiresProject = true;
|
|
32
|
+
static errorCodes = toHelpSection('ERROR CODES', {
|
|
33
|
+
'Succeeded (0)': 'Agent published successfully without errors.',
|
|
34
|
+
'Failed (1)': 'Compilation errors found in the Agent Script file.',
|
|
35
|
+
});
|
|
32
36
|
static flags = {
|
|
33
37
|
'target-org': Flags.requiredOrg(),
|
|
34
38
|
'api-version': Flags.orgApiVersion(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-bundle.js","sourceRoot":"","sources":["../../../../src/commands/agent/publish/authoring-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"authoring-bundle.js","sourceRoot":"","sources":["../../../../src/commands/agent/publish/authoring-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAA6C,MAAM,oCAAoC,CAAC;AAC9G,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAmB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAEhE,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,gCAAgC,CAAC,CAAC;AAQrG,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,SAA4C;IAC5F,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WA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gent, ScriptAgent } from '@salesforce/agents';
|
|
3
|
-
export type SessionMeta = {
|
|
4
|
-
displayName?: string;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Save a marker so send/end can validate that the session was started for this agent.
|
|
8
|
-
* Caller must have started the session (agent has sessionId set). Uses agent.getHistoryDir() for the path.
|
|
9
|
-
* Pass displayName (authoring bundle name or production agent API name) so "agent preview sessions" can show it.
|
|
10
|
-
*/
|
|
11
|
-
export declare function createCache(agent: ScriptAgent | ProductionAgent, options?: {
|
|
12
|
-
displayName?: string;
|
|
13
|
-
}): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* Validate that the session was started for this agent (marker file exists in agent's history dir for current sessionId).
|
|
16
|
-
* Caller must set sessionId on the agent (agent.setSessionId) before calling.
|
|
17
|
-
* Throws SfError if the session marker is not found.
|
|
18
|
-
*/
|
|
19
|
-
export declare function validatePreviewSession(agent: ScriptAgent | ProductionAgent): Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Remove the session marker so this session is no longer considered "active" for send/end without --session-id.
|
|
22
|
-
* Call after ending the session. Caller must set sessionId on the agent before calling.
|
|
23
|
-
*/
|
|
24
|
-
export declare function removeCache(agent: ScriptAgent | ProductionAgent): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* List session IDs that have a cache marker (started via "agent preview start") for this agent.
|
|
27
|
-
* Uses project path and agent's storage ID to find .sfdx/agents/<agentId>/sessions/<sessionId>/session-meta.json.
|
|
28
|
-
*/
|
|
29
|
-
export declare function getCachedSessionIds(project: SfProject, agent: ScriptAgent | ProductionAgent): Promise<string[]>;
|
|
30
|
-
/**
|
|
31
|
-
* Return the single "current" session ID when safe: exactly one cached session for this agent.
|
|
32
|
-
* Returns undefined when there are zero or multiple sessions (caller should require --session-id).
|
|
33
|
-
*/
|
|
34
|
-
export declare function getCurrentSessionId(project: SfProject, agent: ScriptAgent | ProductionAgent): Promise<string | undefined>;
|
|
35
|
-
export type CachedSessionEntry = {
|
|
36
|
-
agentId: string;
|
|
37
|
-
displayName?: string;
|
|
38
|
-
sessionIds: string[];
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* List all cached preview sessions in the project, grouped by agent ID.
|
|
42
|
-
* displayName (when present in session-meta.json) is the authoring bundle name or production agent API name for display.
|
|
43
|
-
* Use this to show users which sessions exist so they can end or clean up.
|
|
44
|
-
*/
|
|
45
|
-
export declare function listCachedSessions(project: SfProject): Promise<CachedSessionEntry[]>;
|
|
1
|
+
export { createPreviewSessionCache as createCache, validatePreviewSession, removePreviewSessionCache as removeCache, getCachedPreviewSessionIds as getCachedSessionIds, getCurrentPreviewSessionId as getCurrentSessionId, listCachedPreviewSessions as listCachedSessions, type SessionType, type PreviewSessionMeta, type CachedPreviewSessionInfo, type CachedPreviewSessionEntry, } from '@salesforce/agents';
|
|
@@ -13,141 +13,5 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
import { join } from 'node:path';
|
|
18
|
-
import { SfError } from '@salesforce/core';
|
|
19
|
-
const SESSION_META_FILE = 'session-meta.json';
|
|
20
|
-
/**
|
|
21
|
-
* Save a marker so send/end can validate that the session was started for this agent.
|
|
22
|
-
* Caller must have started the session (agent has sessionId set). Uses agent.getHistoryDir() for the path.
|
|
23
|
-
* Pass displayName (authoring bundle name or production agent API name) so "agent preview sessions" can show it.
|
|
24
|
-
*/
|
|
25
|
-
export async function createCache(agent, options) {
|
|
26
|
-
const historyDir = await agent.getHistoryDir();
|
|
27
|
-
const metaPath = join(historyDir, SESSION_META_FILE);
|
|
28
|
-
const meta = { displayName: options?.displayName };
|
|
29
|
-
await writeFile(metaPath, JSON.stringify(meta), 'utf-8');
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Validate that the session was started for this agent (marker file exists in agent's history dir for current sessionId).
|
|
33
|
-
* Caller must set sessionId on the agent (agent.setSessionId) before calling.
|
|
34
|
-
* Throws SfError if the session marker is not found.
|
|
35
|
-
*/
|
|
36
|
-
export async function validatePreviewSession(agent) {
|
|
37
|
-
const historyDir = await agent.getHistoryDir();
|
|
38
|
-
const metaPath = join(historyDir, SESSION_META_FILE);
|
|
39
|
-
try {
|
|
40
|
-
await readFile(metaPath, 'utf-8');
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
throw new SfError('No preview session found for this session ID. Run "sf agent preview start" first.', 'PreviewSessionNotFound');
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Remove the session marker so this session is no longer considered "active" for send/end without --session-id.
|
|
48
|
-
* Call after ending the session. Caller must set sessionId on the agent before calling.
|
|
49
|
-
*/
|
|
50
|
-
export async function removeCache(agent) {
|
|
51
|
-
const historyDir = await agent.getHistoryDir();
|
|
52
|
-
const metaPath = join(historyDir, SESSION_META_FILE);
|
|
53
|
-
try {
|
|
54
|
-
await unlink(metaPath);
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
// already removed or never created
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* List session IDs that have a cache marker (started via "agent preview start") for this agent.
|
|
62
|
-
* Uses project path and agent's storage ID to find .sfdx/agents/<agentId>/sessions/<sessionId>/session-meta.json.
|
|
63
|
-
*/
|
|
64
|
-
export async function getCachedSessionIds(project, agent) {
|
|
65
|
-
const agentId = agent.getAgentIdForStorage();
|
|
66
|
-
const base = join(project.getPath(), '.sfdx');
|
|
67
|
-
const sessionsDir = join(base, 'agents', agentId, 'sessions');
|
|
68
|
-
const sessionIds = [];
|
|
69
|
-
try {
|
|
70
|
-
const entries = await readdir(sessionsDir, { withFileTypes: true });
|
|
71
|
-
const dirs = entries.filter((e) => e.isDirectory()).map((e) => e.name);
|
|
72
|
-
const hasMarker = await Promise.all(dirs.map(async (name) => {
|
|
73
|
-
try {
|
|
74
|
-
await readFile(join(sessionsDir, name, SESSION_META_FILE), 'utf-8');
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
}));
|
|
81
|
-
dirs.forEach((name, i) => {
|
|
82
|
-
if (hasMarker[i])
|
|
83
|
-
sessionIds.push(name);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
catch {
|
|
87
|
-
// sessions dir missing or unreadable
|
|
88
|
-
}
|
|
89
|
-
return sessionIds;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Return the single "current" session ID when safe: exactly one cached session for this agent.
|
|
93
|
-
* Returns undefined when there are zero or multiple sessions (caller should require --session-id).
|
|
94
|
-
*/
|
|
95
|
-
export async function getCurrentSessionId(project, agent) {
|
|
96
|
-
const ids = await getCachedSessionIds(project, agent);
|
|
97
|
-
return ids.length === 1 ? ids[0] : undefined;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* List all cached preview sessions in the project, grouped by agent ID.
|
|
101
|
-
* displayName (when present in session-meta.json) is the authoring bundle name or production agent API name for display.
|
|
102
|
-
* Use this to show users which sessions exist so they can end or clean up.
|
|
103
|
-
*/
|
|
104
|
-
export async function listCachedSessions(project) {
|
|
105
|
-
const base = join(project.getPath(), '.sfdx', 'agents');
|
|
106
|
-
const result = [];
|
|
107
|
-
try {
|
|
108
|
-
const agentDirs = await readdir(base, { withFileTypes: true });
|
|
109
|
-
const entries = await Promise.all(agentDirs
|
|
110
|
-
.filter((ent) => ent.isDirectory())
|
|
111
|
-
.map(async (ent) => {
|
|
112
|
-
const agentId = ent.name;
|
|
113
|
-
const sessionsDir = join(base, agentId, 'sessions');
|
|
114
|
-
let sessionIds = [];
|
|
115
|
-
let displayName;
|
|
116
|
-
try {
|
|
117
|
-
const sessionDirs = await readdir(sessionsDir, { withFileTypes: true });
|
|
118
|
-
const withMarker = await Promise.all(sessionDirs
|
|
119
|
-
.filter((s) => s.isDirectory())
|
|
120
|
-
.map(async (s) => {
|
|
121
|
-
try {
|
|
122
|
-
await readFile(join(sessionsDir, s.name, SESSION_META_FILE), 'utf-8');
|
|
123
|
-
return s.name;
|
|
124
|
-
}
|
|
125
|
-
catch {
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
}));
|
|
129
|
-
sessionIds = withMarker.filter((id) => id !== null);
|
|
130
|
-
if (sessionIds.length > 0) {
|
|
131
|
-
try {
|
|
132
|
-
const raw = await readFile(join(sessionsDir, sessionIds[0], SESSION_META_FILE), 'utf-8');
|
|
133
|
-
const meta = JSON.parse(raw);
|
|
134
|
-
displayName = meta.displayName;
|
|
135
|
-
}
|
|
136
|
-
catch {
|
|
137
|
-
// ignore
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
catch {
|
|
142
|
-
// no sessions dir or unreadable
|
|
143
|
-
}
|
|
144
|
-
return { agentId, displayName, sessionIds };
|
|
145
|
-
}));
|
|
146
|
-
result.push(...entries.filter((e) => e.sessionIds.length > 0));
|
|
147
|
-
}
|
|
148
|
-
catch {
|
|
149
|
-
// no agents dir or unreadable
|
|
150
|
-
}
|
|
151
|
-
return result;
|
|
152
|
-
}
|
|
16
|
+
export { createPreviewSessionCache as createCache, validatePreviewSession, removePreviewSessionCache as removeCache, getCachedPreviewSessionIds as getCachedSessionIds, getCurrentPreviewSessionId as getCurrentSessionId, listCachedPreviewSessions as listCachedSessions, } from '@salesforce/agents';
|
|
153
17
|
//# sourceMappingURL=previewSessionStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"previewSessionStore.js","sourceRoot":"","sources":["../src/previewSessionStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"previewSessionStore.js","sourceRoot":"","sources":["../src/previewSessionStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,yBAAyB,IAAI,WAAW,EACxC,sBAAsB,EACtB,yBAAyB,IAAI,WAAW,EACxC,0BAA0B,IAAI,mBAAmB,EACjD,0BAA0B,IAAI,mBAAmB,EACjD,yBAAyB,IAAI,kBAAkB,GAKhD,MAAM,oBAAoB,CAAC"}
|
|
@@ -6,7 +6,7 @@ List all known programmatic agent preview sessions.
|
|
|
6
6
|
|
|
7
7
|
This command lists the agent preview sessions that were started with the "agent preview start" command and are still in the local cache. Use this command to discover specific session IDs that you can pass to the "agent preview send" or "agent preview end" commands with the --session-id flag.
|
|
8
8
|
|
|
9
|
-
Programmatic agent preview sessions can be started for both published activated agents and by using an agent's local authoring bundle, which contains its Agent Script file.
|
|
9
|
+
Programmatic agent preview sessions can be started for both published activated agents and by using an agent's local authoring bundle, which contains its Agent Script file. In this command's output table, the Agent column contains either the API name of the authoring bundle or the published agent, whichever was used when starting the session. In the table, if the same API name has multiple rows with different session IDs, then it means that you previously started multiple preview sessions with the associated agent.
|
|
10
10
|
|
|
11
11
|
# output.empty
|
|
12
12
|
|
|
@@ -20,8 +20,16 @@ Agent (authoring bundle or API name)
|
|
|
20
20
|
|
|
21
21
|
Session ID
|
|
22
22
|
|
|
23
|
+
# output.tableHeader.timestamp
|
|
24
|
+
|
|
25
|
+
Started At
|
|
26
|
+
|
|
27
|
+
# output.tableHeader.sessionType
|
|
28
|
+
|
|
29
|
+
Session Type
|
|
30
|
+
|
|
23
31
|
# examples
|
|
24
32
|
|
|
25
33
|
- List all cached agent preview sessions:
|
|
26
34
|
|
|
27
|
-
|
|
35
|
+
<%= config.bin %> <%= command.id %>
|
package/oclif.manifest.json
CHANGED
|
@@ -1128,7 +1128,7 @@
|
|
|
1128
1128
|
"agent:preview:sessions": {
|
|
1129
1129
|
"aliases": [],
|
|
1130
1130
|
"args": {},
|
|
1131
|
-
"description": "This command lists the agent preview sessions that were started with the \"agent preview start\" command and are still in the local cache. Use this command to discover specific session IDs that you can pass to the \"agent preview send\" or \"agent preview end\" commands with the --session-id flag.\n\nProgrammatic agent preview sessions can be started for both published activated agents and by using an agent's local authoring bundle, which contains its Agent Script file.
|
|
1131
|
+
"description": "This command lists the agent preview sessions that were started with the \"agent preview start\" command and are still in the local cache. Use this command to discover specific session IDs that you can pass to the \"agent preview send\" or \"agent preview end\" commands with the --session-id flag.\n\nProgrammatic agent preview sessions can be started for both published activated agents and by using an agent's local authoring bundle, which contains its Agent Script file. In this command's output table, the Agent column contains either the API name of the authoring bundle or the published agent, whichever was used when starting the session. In the table, if the same API name has multiple rows with different session IDs, then it means that you previously started multiple preview sessions with the associated agent.",
|
|
1132
1132
|
"examples": [
|
|
1133
1133
|
"List all cached agent preview sessions:\n<%= config.bin %> <%= command.id %>"
|
|
1134
1134
|
],
|
|
@@ -1390,6 +1390,19 @@
|
|
|
1390
1390
|
"summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
|
|
1391
1391
|
"enableJsonFlag": true,
|
|
1392
1392
|
"requiresProject": true,
|
|
1393
|
+
"errorCodes": {
|
|
1394
|
+
"header": "ERROR CODES",
|
|
1395
|
+
"body": [
|
|
1396
|
+
{
|
|
1397
|
+
"name": "Succeeded (0)",
|
|
1398
|
+
"description": "Agent published successfully without errors."
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
"name": "Failed (1)",
|
|
1402
|
+
"description": "Compilation errors found in the Agent Script file."
|
|
1403
|
+
}
|
|
1404
|
+
]
|
|
1405
|
+
},
|
|
1393
1406
|
"FLAGGABLE_PROMPTS": {
|
|
1394
1407
|
"api-name": {
|
|
1395
1408
|
"message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
|
|
@@ -2340,5 +2353,5 @@
|
|
|
2340
2353
|
]
|
|
2341
2354
|
}
|
|
2342
2355
|
},
|
|
2343
|
-
"version": "1.
|
|
2356
|
+
"version": "1.34.1"
|
|
2344
2357
|
}
|
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.
|
|
4
|
+
"version": "1.34.1",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"enableO11y": true,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@inquirer/prompts": "^7.10.1",
|
|
13
13
|
"@oclif/core": "^4",
|
|
14
14
|
"@oclif/multi-stage-output": "^0.8.36",
|
|
15
|
-
"@salesforce/agents": "^1.
|
|
15
|
+
"@salesforce/agents": "^1.2.0",
|
|
16
16
|
"@salesforce/core": "^8.28.3",
|
|
17
17
|
"@salesforce/kit": "^3.2.6",
|
|
18
18
|
"@salesforce/sf-plugins-core": "^12.2.6",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"ink-text-input": "^6.0.0",
|
|
26
26
|
"inquirer-autocomplete-standalone": "^0.8.1",
|
|
27
27
|
"react": "^18.3.1",
|
|
28
|
-
"yaml": "^2.8.
|
|
28
|
+
"yaml": "^2.8.4"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@oclif/plugin-command-snapshot": "^5.3.13",
|
|
@@ -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.
|
|
244
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.
|
|
243
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.34.1.crt",
|
|
244
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.34.1.sig"
|
|
245
245
|
}
|
|
246
246
|
}
|
|
@@ -15,11 +15,21 @@
|
|
|
15
15
|
},
|
|
16
16
|
"sessionId": {
|
|
17
17
|
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"timestamp": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"sessionType": {
|
|
23
|
+
"$ref": "#/definitions/SessionType"
|
|
18
24
|
}
|
|
19
25
|
},
|
|
20
26
|
"required": ["agentId", "sessionId"],
|
|
21
27
|
"additionalProperties": false
|
|
22
28
|
}
|
|
29
|
+
},
|
|
30
|
+
"SessionType": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"enum": ["simulated", "live", "published"]
|
|
23
33
|
}
|
|
24
34
|
}
|
|
25
35
|
}
|