@salesforce/plugin-agent 1.24.14-demo.8 → 1.24.14-nga.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 +74 -46
- package/lib/commands/agent/generate/authoring-bundle.js +1 -1
- package/lib/commands/agent/generate/authoring-bundle.js.map +1 -1
- package/lib/commands/agent/preview.d.ts +4 -10
- package/lib/commands/agent/preview.js +104 -44
- package/lib/commands/agent/preview.js.map +1 -1
- package/lib/commands/agent/publish/authoring-bundle.js +9 -3
- package/lib/commands/agent/publish/authoring-bundle.js.map +1 -1
- package/lib/commands/agent/validate/authoring-bundle.js +16 -12
- package/lib/commands/agent/validate/authoring-bundle.js.map +1 -1
- package/lib/common.d.ts +8 -0
- package/lib/common.js +39 -0
- package/lib/common.js.map +1 -0
- package/lib/components/agent-preview-react.d.ts +3 -2
- package/lib/components/agent-preview-react.js +36 -13
- package/lib/components/agent-preview-react.js.map +1 -1
- package/messages/agent.generate.authoring-bundle.md +16 -12
- package/messages/agent.preview.md +7 -3
- package/messages/agent.publish.authoring-bundle.md +14 -9
- package/messages/agent.validate.authoring-bundle.md +14 -9
- package/oclif.manifest.json +29 -23
- package/package.json +7 -5
|
@@ -23,6 +23,7 @@ import { Agent, findAuthoringBundle } from '@salesforce/agents';
|
|
|
23
23
|
import { RequestStatus } from '@salesforce/source-deploy-retrieve';
|
|
24
24
|
import { ensureArray } from '@salesforce/kit';
|
|
25
25
|
import { promptForAgentFiles } from '../../../flags.js';
|
|
26
|
+
import { throwAgentCompilationError } from '../../../common.js';
|
|
26
27
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
27
28
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.publish.authoring-bundle');
|
|
28
29
|
export default class AgentPublishAuthoringBundle extends SfCommand {
|
|
@@ -86,8 +87,13 @@ export default class AgentPublishAuthoringBundle extends SfCommand {
|
|
|
86
87
|
const targetOrg = flags['target-org'];
|
|
87
88
|
const conn = targetOrg.getConnection(flags['api-version']);
|
|
88
89
|
// First compile the .agent file to get the Agent JSON
|
|
89
|
-
const
|
|
90
|
-
|
|
90
|
+
const compileResponse = await Agent.compileAgentScript(conn, readFileSync(join(authoringBundleDir, `${apiName}.agent`), 'utf8'));
|
|
91
|
+
if (compileResponse.status === 'success') {
|
|
92
|
+
mso.skipTo('Publish Agent');
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
throwAgentCompilationError(compileResponse.errors);
|
|
96
|
+
}
|
|
91
97
|
// Then publish the Agent JSON to create the agent
|
|
92
98
|
// Set up lifecycle listeners for retrieve events
|
|
93
99
|
Lifecycle.getInstance().on('scopedPreRetrieve', () => {
|
|
@@ -107,7 +113,7 @@ export default class AgentPublishAuthoringBundle extends SfCommand {
|
|
|
107
113
|
}
|
|
108
114
|
return Promise.resolve();
|
|
109
115
|
});
|
|
110
|
-
const result = await Agent.publishAgentJson(conn, this.project,
|
|
116
|
+
const result = await Agent.publishAgentJson(conn, this.project, compileResponse.compiledArtifact);
|
|
111
117
|
mso.stop();
|
|
112
118
|
return {
|
|
113
119
|
success: true,
|
|
@@ -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,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,MA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AI,EAAE,CAAC;YAEX,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,gBAAgB,EAAE,MAAM,CAAC,aAAa;aACvC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,2BAA2B;YAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,MAAM,YAAY,GAAG,QAAQ,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;YAE/E,uCAAuC;YACvC,GAAG,CAAC,KAAK,EAAE,CAAC;YAEZ,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAEzB,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;aAChC,CAAC;QACJ,CAAC;IACH,CAAC"}
|
|
@@ -19,8 +19,8 @@ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
|
19
19
|
import { Messages, SfError } from '@salesforce/core';
|
|
20
20
|
import { MultiStageOutput } from '@oclif/multi-stage-output';
|
|
21
21
|
import { Agent, findAuthoringBundle } from '@salesforce/agents';
|
|
22
|
-
import { Duration, sleep } from '@salesforce/kit';
|
|
23
22
|
import { colorize } from '@oclif/core/ux';
|
|
23
|
+
import { throwAgentCompilationError } from '../../../common.js';
|
|
24
24
|
import { promptForAgentFiles } from '../../../flags.js';
|
|
25
25
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
26
26
|
const messages = Messages.loadMessages('@salesforce/plugin-agent', 'agent.validate.authoring-bundle');
|
|
@@ -88,26 +88,30 @@ export default class AgentValidateAuthoringBundle extends SfCommand {
|
|
|
88
88
|
mso.skipTo('Validating Authoring Bundle');
|
|
89
89
|
const targetOrg = flags['target-org'];
|
|
90
90
|
const conn = targetOrg.getConnection(flags['api-version']);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
91
|
+
const result = await Agent.compileAgentScript(conn, readFileSync(join(authoringBundleDir, `${apiName}.agent`), 'utf8'));
|
|
92
|
+
if (result.status === 'success') {
|
|
93
|
+
mso.updateData({ status: 'COMPLETED' });
|
|
94
|
+
mso.stop('completed');
|
|
95
|
+
return {
|
|
96
|
+
success: true,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
throwAgentCompilationError(result.errors);
|
|
101
|
+
}
|
|
99
102
|
}
|
|
100
103
|
catch (error) {
|
|
101
104
|
// Handle validation errors
|
|
102
105
|
const err = SfError.wrap(error);
|
|
103
106
|
let count = 0;
|
|
104
|
-
const
|
|
107
|
+
const rawError = err.message ? err.message : err.name;
|
|
108
|
+
const formattedError = rawError
|
|
105
109
|
.split('\n')
|
|
106
110
|
.map((line) => {
|
|
107
111
|
count += 1;
|
|
108
112
|
const type = line.split(':')[0];
|
|
109
|
-
const rest = line.substring(line.indexOf(':')).trim();
|
|
110
|
-
return `- ${colorize('red', type)}
|
|
113
|
+
const rest = line.includes(':') ? line.substring(line.indexOf(':')).trim() : '';
|
|
114
|
+
return `- ${colorize('red', type)}${rest}`;
|
|
111
115
|
})
|
|
112
116
|
.join('\n');
|
|
113
117
|
mso.updateData({ errors: count.toString(), status: 'ERROR' });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-bundle.js","sourceRoot":"","sources":["../../../../src/commands/agent/validate/authoring-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CA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AAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;YAC9D,GAAG,CAAC,KAAK,EAAE,CAAC;YAEZ,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,yBAAyB,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;YAC3E,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;aAChC,CAAC;QACJ,CAAC;IACH,CAAC"}
|
package/lib/common.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CompilationError } from '@salesforce/agents';
|
|
2
|
+
/**
|
|
3
|
+
* Utility function to generate SfError when there are agent compilation errors.
|
|
4
|
+
*
|
|
5
|
+
* @param compilationErrors - The compilation errors as strings, CompilationError objects, or array of either
|
|
6
|
+
* @throws SfError - Always throws a Salesforce CLI error
|
|
7
|
+
*/
|
|
8
|
+
export declare function throwAgentCompilationError(compilationErrors: CompilationError[]): never;
|
package/lib/common.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { EOL } from 'node:os';
|
|
17
|
+
import { SfError } from '@salesforce/core';
|
|
18
|
+
/**
|
|
19
|
+
* Utility function to generate SfError when there are agent compilation errors.
|
|
20
|
+
*
|
|
21
|
+
* @param compilationErrors - The compilation errors as strings, CompilationError objects, or array of either
|
|
22
|
+
* @throws SfError - Always throws a Salesforce CLI error
|
|
23
|
+
*/
|
|
24
|
+
export function throwAgentCompilationError(compilationErrors) {
|
|
25
|
+
if (compilationErrors.length === 0) {
|
|
26
|
+
throw SfError.create({
|
|
27
|
+
name: 'CompileAgentScriptError',
|
|
28
|
+
message: 'Unknown compilation error occurred',
|
|
29
|
+
data: compilationErrors,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const errors = compilationErrors;
|
|
33
|
+
throw SfError.create({
|
|
34
|
+
name: 'CompileAgentScriptError',
|
|
35
|
+
message: errors.map((e) => `${e.errorType}: ${e.description} [Ln ${e.lineStart}, Col ${e.colStart}]`).join(EOL),
|
|
36
|
+
data: errors,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,iBAAqC;IAC9E,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,MAAM,OAAO,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,yBAAyB;YAC/B,OAAO,EAAE,oCAAoC;YAC7C,IAAI,EAAE,iBAAiB;SACxB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,MAAM,GAAG,iBAAiB,CAAC;IAEjC,MAAM,OAAO,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,yBAAyB;QAC/B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,WAAW,QAAQ,CAAC,CAAC,SAAS,SAAS,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC/G,IAAI,EAAE,MAAM;KACb,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Connection } from '@salesforce/core';
|
|
3
|
-
import {
|
|
3
|
+
import { AgentPreviewBase } from '@salesforce/agents';
|
|
4
4
|
/**
|
|
5
5
|
* Ideas:
|
|
6
6
|
* - Limit height based on terminal height
|
|
@@ -10,7 +10,8 @@ import { AgentPreview } from '@salesforce/agents';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function AgentPreviewReact(props: {
|
|
12
12
|
readonly connection: Connection;
|
|
13
|
-
readonly agent:
|
|
13
|
+
readonly agent: AgentPreviewBase;
|
|
14
14
|
readonly name: string;
|
|
15
15
|
readonly outputDir: string | undefined;
|
|
16
|
+
readonly isLocalAgent: boolean;
|
|
16
17
|
}): React.ReactNode;
|
|
@@ -19,7 +19,7 @@ import * as process from 'node:process';
|
|
|
19
19
|
import React from 'react';
|
|
20
20
|
import { Box, Text, useInput } from 'ink';
|
|
21
21
|
import TextInput from 'ink-text-input';
|
|
22
|
-
import { SfError } from '@salesforce/core';
|
|
22
|
+
import { SfError, Lifecycle } from '@salesforce/core';
|
|
23
23
|
import { writeDebugLog } from '@salesforce/agents';
|
|
24
24
|
import { sleep } from '@salesforce/kit';
|
|
25
25
|
// Component to show a simple typing animation
|
|
@@ -38,8 +38,6 @@ function Typing() {
|
|
|
38
38
|
React.createElement(Text, { color: colors[1] }, "."),
|
|
39
39
|
React.createElement(Text, { color: colors[2] }, ".")));
|
|
40
40
|
}
|
|
41
|
-
// Split the content on newlines, then find the longest array element
|
|
42
|
-
const calculateWidth = (content) => content.split('\n').reduce((acc, line) => Math.max(acc, line.length), 0) + 4;
|
|
43
41
|
const saveTranscriptsToFile = (outputDir, messages, responses) => {
|
|
44
42
|
if (!outputDir)
|
|
45
43
|
return;
|
|
@@ -69,7 +67,7 @@ export function AgentPreviewReact(props) {
|
|
|
69
67
|
const [tempDir, setTempDir] = React.useState('');
|
|
70
68
|
const [responses, setResponses] = React.useState([]);
|
|
71
69
|
const [apexDebugLogs, setApexDebugLogs] = React.useState([]);
|
|
72
|
-
const { connection, agent, name, outputDir } = props;
|
|
70
|
+
const { connection, agent, name, outputDir, isLocalAgent } = props;
|
|
73
71
|
useInput((input, key) => {
|
|
74
72
|
if (key.escape) {
|
|
75
73
|
setSessionEnded(true);
|
|
@@ -95,6 +93,24 @@ export function AgentPreviewReact(props) {
|
|
|
95
93
|
void endSession();
|
|
96
94
|
}, [sessionEnded]);
|
|
97
95
|
React.useEffect(() => {
|
|
96
|
+
// Set up event listeners for agent compilation and simulation events
|
|
97
|
+
const lifecycle = Lifecycle.getInstance();
|
|
98
|
+
const handleCompilingEvent = () => {
|
|
99
|
+
setHeader('Compiling agent...');
|
|
100
|
+
return Promise.resolve();
|
|
101
|
+
};
|
|
102
|
+
const handleSimulationStartingEvent = () => {
|
|
103
|
+
setHeader('Starting session...');
|
|
104
|
+
return Promise.resolve();
|
|
105
|
+
};
|
|
106
|
+
const handleSessionStartedEvent = () => {
|
|
107
|
+
setHeader(`New session started with "${props.name}"`);
|
|
108
|
+
return Promise.resolve();
|
|
109
|
+
};
|
|
110
|
+
// Listen for the events
|
|
111
|
+
lifecycle.on('agents:compiling', handleCompilingEvent);
|
|
112
|
+
lifecycle.on('agents:simulation-starting', handleSimulationStartingEvent);
|
|
113
|
+
lifecycle.on('agents:session-started', handleSessionStartedEvent);
|
|
98
114
|
const startSession = async () => {
|
|
99
115
|
try {
|
|
100
116
|
const session = await agent.start();
|
|
@@ -106,7 +122,17 @@ export function AgentPreviewReact(props) {
|
|
|
106
122
|
const dateForDir = new Date().toISOString().replace(/:/g, '-').split('.')[0];
|
|
107
123
|
setTempDir(path.join(outputDir, `${dateForDir}--${session.sessionId}`));
|
|
108
124
|
}
|
|
109
|
-
|
|
125
|
+
// Add disclaimer for local agents before the agent's first message
|
|
126
|
+
const initialMessages = [];
|
|
127
|
+
if (isLocalAgent) {
|
|
128
|
+
initialMessages.push({
|
|
129
|
+
role: 'system',
|
|
130
|
+
content: 'Agent preview does not provide strict adherence to connection endpoint configuration and escalation is not supported.\n\nTo test escalation, publish your agent then use the desired connection endpoint (e.g., Web Page, SMS, etc).',
|
|
131
|
+
timestamp: new Date(),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
initialMessages.push({ role: name, content: session.messages[0].message, timestamp: new Date() });
|
|
135
|
+
setMessages(initialMessages);
|
|
110
136
|
}
|
|
111
137
|
catch (e) {
|
|
112
138
|
const sfError = SfError.wrap(e);
|
|
@@ -117,23 +143,20 @@ export function AgentPreviewReact(props) {
|
|
|
117
143
|
}
|
|
118
144
|
};
|
|
119
145
|
void startSession();
|
|
120
|
-
}, []);
|
|
146
|
+
}, [agent, name, outputDir, props.name, isLocalAgent]);
|
|
121
147
|
React.useEffect(() => {
|
|
122
148
|
saveTranscriptsToFile(tempDir, messages, responses);
|
|
123
149
|
}, [tempDir, messages, responses]);
|
|
124
150
|
return (React.createElement(Box, { flexDirection: "column" },
|
|
125
151
|
React.createElement(Box, { flexDirection: "column", width: process.stdout.columns, borderStyle: "round", alignItems: "center", marginTop: 1, marginBottom: 1, paddingLeft: 1, paddingRight: 1 },
|
|
126
152
|
React.createElement(Text, { bold: true }, header)),
|
|
127
|
-
messages.length > 0 && (React.createElement(Box, { flexDirection: "column" }, messages.map(({ timestamp: ts, role, content }, idx) => (React.createElement(Box, { key: role + '__' + ts.toISOString() + '__' + idx.toString(), alignItems: role === 'user' ? 'flex-end' : 'flex-start', flexDirection: "column" },
|
|
153
|
+
messages.length > 0 && (React.createElement(Box, { flexDirection: "column" }, messages.map(({ timestamp: ts, role, content }, idx) => (React.createElement(Box, { key: role + '__' + ts.toISOString() + '__' + idx.toString(), alignItems: role === 'user' ? 'flex-end' : 'flex-start', flexDirection: "column" }, role === 'system' ? (React.createElement(Box, { width: process.stdout.columns, borderStyle: "round", borderColor: "yellow", paddingLeft: 1, paddingRight: 1, marginBottom: 1 },
|
|
154
|
+
React.createElement(Text, null, content))) : (React.createElement(React.Fragment, null,
|
|
128
155
|
React.createElement(Box, { flexDirection: "row", columnGap: 1 },
|
|
129
156
|
React.createElement(Text, null, role === 'user' ? 'You' : role),
|
|
130
157
|
React.createElement(Text, { color: "grey" }, ts.toLocaleString())),
|
|
131
|
-
React.createElement(Box
|
|
132
|
-
|
|
133
|
-
, {
|
|
134
|
-
// Use 70% of the terminal width, or the width of a single line of content, whichever is smaller
|
|
135
|
-
width: Math.min(process.stdout.columns * 0.7, calculateWidth(content)), borderStyle: "round", paddingLeft: 1, paddingRight: 1 },
|
|
136
|
-
React.createElement(Text, null, content))))))),
|
|
158
|
+
React.createElement(Box, { borderStyle: "round", paddingLeft: 1, paddingRight: 1 },
|
|
159
|
+
React.createElement(Text, null, content))))))))),
|
|
137
160
|
isTyping ? (React.createElement(Box, { flexDirection: "column" },
|
|
138
161
|
React.createElement(Box, { alignItems: "flex-start", flexDirection: "column" },
|
|
139
162
|
React.createElement(Box, { flexDirection: "row", columnGap: 1 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-preview-react.js","sourceRoot":"","sources":["../../src/components/agent-preview-react.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EA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AAC,OAAO,EAC7B,WAAW,EAAC,OAAO,EACnB,SAAS,EAAE,CAAC,EACZ,YAAY,EAAE,CAAC,EACf,WAAW,EAAE,CAAC,EACd,YAAY,EAAE,CAAC;YAEf,oBAAC,IAAI,IAAC,IAAI,0BAAqB;YAC9B,SAAS,CAAC,CAAC,CAAC,oBAAC,IAAI;;gBAAoB,OAAO;mCAAwB,CAAC,CAAC,CAAC,IAAI;YAC3E,SAAS,CAAC,CAAC,CAAC,oBAAC,IAAI;;gBAAoB,OAAO;kCAAuB,CAAC,CAAC,CAAC,IAAI;YAC1E,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,oBAAC,IAAI;;gBAAmB,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAQ,CACxF,CACP,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
# summary
|
|
2
2
|
|
|
3
|
-
Generate
|
|
3
|
+
Generate a local authoring bundle from an existing agent spec YAML file.
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Authoring bundles are metadata types that represent the next-gen Salesforce agents. Their exact metadata name is AiAuthoringBundle and they consist of a standard "\*-meta.xml" metadata file and an agent file (with extension ".agent") that fully describes the next-gen agent. Use this command to generate an authoring bundle based on an agent spec YAML file, which you create with the "agent create agent-spec" command.
|
|
8
|
+
|
|
9
|
+
By default, authoring bundles are generated in the force-app/main/default/aiAuthoringBundles/<api-name> directory. Use the --output-dir to generate them elsewhere.
|
|
8
10
|
|
|
9
11
|
# flags.spec.summary
|
|
10
12
|
|
|
11
|
-
Path to the agent
|
|
13
|
+
Path to the agent spec YAML file.
|
|
12
14
|
|
|
13
15
|
# flags.output-dir.summary
|
|
14
16
|
|
|
15
|
-
Directory where the authoring bundle files
|
|
17
|
+
Directory where the authoring bundle files are generated.
|
|
16
18
|
|
|
17
19
|
# flags.name.summary
|
|
18
20
|
|
|
@@ -20,7 +22,7 @@ Name (label) of the authoring bundle.
|
|
|
20
22
|
|
|
21
23
|
# flags.api-name.summary
|
|
22
24
|
|
|
23
|
-
API name of the new authoring bundle; if not specified, the API name is derived from the authoring bundle name (label); the API name
|
|
25
|
+
API name of the new authoring bundle; if not specified, the API name is derived from the authoring bundle name (label); the API name can't exist in the org.
|
|
24
26
|
|
|
25
27
|
# flags.api-name.prompt
|
|
26
28
|
|
|
@@ -28,20 +30,22 @@ API name of the new authoring bundle
|
|
|
28
30
|
|
|
29
31
|
# examples
|
|
30
32
|
|
|
31
|
-
- Generate an authoring bundle from
|
|
32
|
-
|
|
33
|
+
- Generate an authoring bundle from the "specs/agentSpec.yaml" agent spec YAML file and give it the label "My Authoring Bundle":
|
|
34
|
+
|
|
35
|
+
<%= config.bin %> <%= command.id %> --spec-file specs/agentSpec.yaml --name "My Authoring Bundle"
|
|
36
|
+
|
|
37
|
+
- Same as previous example, but generate the files in the other-package-dir/main/default/aiAuthoringBundles directory:
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
<%= config.bin %> <%= command.id %> --spec-file path/to/spec.yaml --name "My Authoring Bundle" --output-dir path/to/output
|
|
39
|
+
<%= config.bin %> <%= command.id %> --spec-file specs/agentSpec.yaml --name "My Authoring Bundle" --output-dir other-package-dir/main/default/aiAuthoringBundles
|
|
36
40
|
|
|
37
41
|
# error.no-spec-file
|
|
38
42
|
|
|
39
|
-
No agent
|
|
43
|
+
No agent spec YAML file found at the specified path.
|
|
40
44
|
|
|
41
45
|
# error.invalid-spec-file
|
|
42
46
|
|
|
43
|
-
The specified file is not a valid agent
|
|
47
|
+
The specified file is not a valid agent spec YAML file.
|
|
44
48
|
|
|
45
49
|
# error.failed-to-create-agent
|
|
46
50
|
|
|
47
|
-
Failed to create
|
|
51
|
+
Failed to create a next-gen agent from the agent spec YAML file.
|
|
@@ -12,7 +12,7 @@ When the session concludes, the command asks if you want to save the API respons
|
|
|
12
12
|
|
|
13
13
|
Find the agent's API name in its Agent Details page of your org's Agentforce Studio UI in Setup. If your agent is currently deactivated, use the "agent activate" CLI command to activate it.
|
|
14
14
|
|
|
15
|
-
IMPORTANT: Before you use this command, you must complete a number of configuration steps in your org and your DX project. The examples in this help assume you've completed the steps. See "Preview an Agent" in the "Agentforce Developer Guide" for complete documentation: https://developer.salesforce.com/docs/einstein/genai/guide/agent-dx-preview.html.
|
|
15
|
+
IMPORTANT: Before you use this command, you must complete a number of configuration steps in your org and your DX project. For example, you must first create the link to a client connected app using the "org login web --client-app" CLI command to then get the value of the --client-app flag of this command. The examples in this help assume you've completed the steps. See "Preview an Agent" in the "Agentforce Developer Guide" for complete documentation: https://developer.salesforce.com/docs/einstein/genai/guide/agent-dx-preview.html.
|
|
16
16
|
|
|
17
17
|
# flags.api-name.summary
|
|
18
18
|
|
|
@@ -20,16 +20,20 @@ API name of the agent you want to interact with.
|
|
|
20
20
|
|
|
21
21
|
# flags.authoring-bundle.summary
|
|
22
22
|
|
|
23
|
-
Preview
|
|
23
|
+
Preview a next-gen agent by specifying the API name of the authoring bundle metadata component that implements it.
|
|
24
24
|
|
|
25
25
|
# flags.client-app.summary
|
|
26
26
|
|
|
27
|
-
Name of the linked client app to use for the agent connection.
|
|
27
|
+
Name of the linked client app to use for the agent connection.
|
|
28
28
|
|
|
29
29
|
# flags.output-dir.summary
|
|
30
30
|
|
|
31
31
|
Directory where conversation transcripts are saved.
|
|
32
32
|
|
|
33
|
+
# flags.use-live-actions.summary
|
|
34
|
+
|
|
35
|
+
Use real actions in the org; if not specified, preview uses AI to mock actions.
|
|
36
|
+
|
|
33
37
|
# flags.apex-debug.summary
|
|
34
38
|
|
|
35
39
|
Enable Apex debug logging during the agent preview conversation.
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
# summary
|
|
2
2
|
|
|
3
|
-
Publish an
|
|
3
|
+
Publish an authoring bundle to your org, which results in a new next-gen agent.
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
When you publish an authoring bundle to your org, a number of things happen. First, this command validates that the agent file (with extension ".agent") successfully compiles. Then the authoring bundle metadata component is deployed to the org, and all associated metadata components, such as the Bot, BotVersion, and GenAiXXX components, are either created or updated. The org then creates a new next-gen agent based on the deployed authoring bundle and associated metadata. Finally, all the metadata associated with the new agent is retrieved back to your local DX project.
|
|
8
|
+
|
|
9
|
+
Authoring bundles are metadata types that represent the next-gen Salesforce agents. Their exact metadata name is AiAuthoringBundle and they consist of a standard "\*-meta.xml" metadata file and an agent file (with extension ".agent") that fully describes the next-gen agent.
|
|
10
|
+
|
|
11
|
+
This command requires the API name of the authoring bundle; if you don't provide it with the --api-name flag, the command prompts you for it.
|
|
8
12
|
|
|
9
13
|
# examples
|
|
10
14
|
|
|
11
|
-
- Publish an
|
|
12
|
-
|
|
15
|
+
- Publish an authoring bundle with API name MyAuthoringBundle to the org with alias "my-org", resulting in a new agent named "My Fab Agent"::
|
|
16
|
+
|
|
17
|
+
<%= config.bin %> <%= command.id %> --api-name MyAuthoringbundle --agent-name "My Fab Agent" --target-org my-org
|
|
13
18
|
|
|
14
19
|
# flags.api-name.summary
|
|
15
20
|
|
|
16
|
-
API name of the
|
|
21
|
+
API name of the authoring bundle you want to publish.
|
|
17
22
|
|
|
18
23
|
# flags.api-name.prompt
|
|
19
24
|
|
|
@@ -21,15 +26,15 @@ API name of the authoring bundle to publish
|
|
|
21
26
|
|
|
22
27
|
# flags.agent-name.summary
|
|
23
28
|
|
|
24
|
-
Name for the new agent
|
|
29
|
+
Name for the new agent that is created from the published authoring bundle.
|
|
25
30
|
|
|
26
31
|
# error.missingRequiredFlags
|
|
27
32
|
|
|
28
|
-
Required flag(s) missing: %s
|
|
33
|
+
Required flag(s) missing: %s.
|
|
29
34
|
|
|
30
35
|
# error.invalidBundlePath
|
|
31
36
|
|
|
32
|
-
Invalid bundle path.
|
|
37
|
+
Invalid bundle path. Provide a valid directory path to an authoring bundle.
|
|
33
38
|
|
|
34
39
|
# error.publishFailed
|
|
35
40
|
|
|
@@ -42,4 +47,4 @@ Could not find a .bundle-meta.xml file with API name '%s' in the project.
|
|
|
42
47
|
|
|
43
48
|
# error.agentNotFoundAction
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
Check that the API name is correct and that the .agent file exists in your project directory.
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
# summary
|
|
2
2
|
|
|
3
|
-
Validate
|
|
3
|
+
Validate a local authoring bundle to ensure it compiles successfully and can be used to create a next-gen agent.
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Authoring bundles are metadata types that represent the next-gen Salesforce agents. Their exact metadata name is AiAuthoringBundle and they consist of a standard "\*-meta.xml" metadata file and an agent file (with extension ".agent") that fully describes the next-gen agent. Generate a local authoring bundle with the "agent generate authoring-bundle" command.
|
|
8
|
+
|
|
9
|
+
This command validates that the agent file (with extension ".agent") that's part of the authoring bundle compiles without errors and can later be used to successfully create a next-gen agent.
|
|
10
|
+
|
|
11
|
+
This command requires the API name of the authoring bundle; if you don't provide it with the --api-name flag, the command prompts you for it.
|
|
8
12
|
|
|
9
13
|
# examples
|
|
10
14
|
|
|
11
|
-
- Validate
|
|
12
|
-
|
|
15
|
+
- Validate a local authoring bundle with API name MyAuthoringBundle:
|
|
16
|
+
|
|
17
|
+
<%= config.bin %> <%= command.id %> --api-name MyAuthoringBundle
|
|
13
18
|
|
|
14
19
|
# flags.api-name.summary
|
|
15
20
|
|
|
16
|
-
API name of the
|
|
21
|
+
API name of the authoring bundle you want to validate.
|
|
17
22
|
|
|
18
23
|
# flags.api-name.prompt
|
|
19
24
|
|
|
@@ -21,15 +26,15 @@ API name of the authoring bundle to validate
|
|
|
21
26
|
|
|
22
27
|
# error.missingRequiredFlags
|
|
23
28
|
|
|
24
|
-
Required flag(s) missing: %s
|
|
29
|
+
Required flag(s) missing: %s.
|
|
25
30
|
|
|
26
31
|
# error.invalidBundlePath
|
|
27
32
|
|
|
28
|
-
Invalid bundle path.
|
|
33
|
+
Invalid authoring bundle path. Provide a valid directory path to the authoring bundle you want to validate.
|
|
29
34
|
|
|
30
35
|
# error.compilationFailed
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
Compilation of the agent file failed with the following errors:
|
|
33
38
|
%s
|
|
34
39
|
|
|
35
40
|
# error.agentNotFound
|
|
@@ -38,4 +43,4 @@ Could not find a .bundle-meta.xml file with API name '%s' in the project.
|
|
|
38
43
|
|
|
39
44
|
# error.agentNotFoundAction
|
|
40
45
|
|
|
41
|
-
|
|
46
|
+
Check that the API name is correct and that the ".agent" file exists in your project directory.
|