@salesforce/plugin-agent 1.30.2 → 1.30.4
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 +19 -19
- package/lib/commands/agent/validate/authoring-bundle.js +19 -37
- package/lib/commands/agent/validate/authoring-bundle.js.map +1 -1
- package/lib/common.d.ts +3 -1
- package/lib/common.js +6 -1
- package/lib/common.js.map +1 -1
- package/oclif.manifest.json +85 -85
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -116,7 +116,7 @@ EXAMPLES
|
|
|
116
116
|
$ sf agent activate --api-name Resort_Manager --target-org my-org
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
119
|
+
_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/activate.ts)_
|
|
120
120
|
|
|
121
121
|
## `sf agent create`
|
|
122
122
|
|
|
@@ -183,7 +183,7 @@ EXAMPLES
|
|
|
183
183
|
$ sf agent create --name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
186
|
+
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/create.ts)_
|
|
187
187
|
|
|
188
188
|
## `sf agent deactivate`
|
|
189
189
|
|
|
@@ -223,7 +223,7 @@ EXAMPLES
|
|
|
223
223
|
$ sf agent deactivate --api-name Resort_Manager --target-org my-org
|
|
224
224
|
```
|
|
225
225
|
|
|
226
|
-
_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
226
|
+
_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/deactivate.ts)_
|
|
227
227
|
|
|
228
228
|
## `sf agent generate agent-spec`
|
|
229
229
|
|
|
@@ -330,7 +330,7 @@ EXAMPLES
|
|
|
330
330
|
$ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
|
|
331
331
|
```
|
|
332
332
|
|
|
333
|
-
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
333
|
+
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/generate/agent-spec.ts)_
|
|
334
334
|
|
|
335
335
|
## `sf agent generate authoring-bundle`
|
|
336
336
|
|
|
@@ -407,7 +407,7 @@ EXAMPLES
|
|
|
407
407
|
other-package-dir/main/default --target-org my-dev-org
|
|
408
408
|
```
|
|
409
409
|
|
|
410
|
-
_See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
410
|
+
_See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/generate/authoring-bundle.ts)_
|
|
411
411
|
|
|
412
412
|
## `sf agent generate template`
|
|
413
413
|
|
|
@@ -455,7 +455,7 @@ EXAMPLES
|
|
|
455
455
|
force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
|
|
456
456
|
```
|
|
457
457
|
|
|
458
|
-
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
458
|
+
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/generate/template.ts)_
|
|
459
459
|
|
|
460
460
|
## `sf agent generate test-spec`
|
|
461
461
|
|
|
@@ -516,7 +516,7 @@ EXAMPLES
|
|
|
516
516
|
force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
|
|
517
517
|
```
|
|
518
518
|
|
|
519
|
-
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
519
|
+
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/generate/test-spec.ts)_
|
|
520
520
|
|
|
521
521
|
## `sf agent preview`
|
|
522
522
|
|
|
@@ -589,7 +589,7 @@ EXAMPLES
|
|
|
589
589
|
$ sf agent preview --use-live-actions --apex-debug --output-dir transcripts/my-preview
|
|
590
590
|
```
|
|
591
591
|
|
|
592
|
-
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
592
|
+
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/preview.ts)_
|
|
593
593
|
|
|
594
594
|
## `sf agent preview end`
|
|
595
595
|
|
|
@@ -644,7 +644,7 @@ EXAMPLES
|
|
|
644
644
|
$ sf agent preview end --authoring-bundle My_Local_Agent
|
|
645
645
|
```
|
|
646
646
|
|
|
647
|
-
_See code: [src/commands/agent/preview/end.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
647
|
+
_See code: [src/commands/agent/preview/end.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/preview/end.ts)_
|
|
648
648
|
|
|
649
649
|
## `sf agent preview send`
|
|
650
650
|
|
|
@@ -702,7 +702,7 @@ EXAMPLES
|
|
|
702
702
|
$ sf agent preview send --utterance "what can you help me with?" --authoring-bundle My_Local_Agent
|
|
703
703
|
```
|
|
704
704
|
|
|
705
|
-
_See code: [src/commands/agent/preview/send.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
705
|
+
_See code: [src/commands/agent/preview/send.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/preview/send.ts)_
|
|
706
706
|
|
|
707
707
|
## `sf agent preview sessions`
|
|
708
708
|
|
|
@@ -735,7 +735,7 @@ EXAMPLES
|
|
|
735
735
|
$ sf agent preview sessions
|
|
736
736
|
```
|
|
737
737
|
|
|
738
|
-
_See code: [src/commands/agent/preview/sessions.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
738
|
+
_See code: [src/commands/agent/preview/sessions.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/preview/sessions.ts)_
|
|
739
739
|
|
|
740
740
|
## `sf agent preview start`
|
|
741
741
|
|
|
@@ -792,7 +792,7 @@ EXAMPLES
|
|
|
792
792
|
$ sf agent preview start --api-name My_Published_Agent
|
|
793
793
|
```
|
|
794
794
|
|
|
795
|
-
_See code: [src/commands/agent/preview/start.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
795
|
+
_See code: [src/commands/agent/preview/start.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/preview/start.ts)_
|
|
796
796
|
|
|
797
797
|
## `sf agent publish authoring-bundle`
|
|
798
798
|
|
|
@@ -841,7 +841,7 @@ EXAMPLES
|
|
|
841
841
|
$ sf agent publish authoring-bundle --api-name MyAuthoringbundle --target-org my-dev-org
|
|
842
842
|
```
|
|
843
843
|
|
|
844
|
-
_See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
844
|
+
_See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/publish/authoring-bundle.ts)_
|
|
845
845
|
|
|
846
846
|
## `sf agent test create`
|
|
847
847
|
|
|
@@ -896,7 +896,7 @@ EXAMPLES
|
|
|
896
896
|
$ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
|
|
897
897
|
```
|
|
898
898
|
|
|
899
|
-
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
899
|
+
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/test/create.ts)_
|
|
900
900
|
|
|
901
901
|
## `sf agent test list`
|
|
902
902
|
|
|
@@ -931,7 +931,7 @@ EXAMPLES
|
|
|
931
931
|
$ sf agent test list --target-org my-org
|
|
932
932
|
```
|
|
933
933
|
|
|
934
|
-
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
934
|
+
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/test/list.ts)_
|
|
935
935
|
|
|
936
936
|
## `sf agent test results`
|
|
937
937
|
|
|
@@ -997,7 +997,7 @@ FLAG DESCRIPTIONS
|
|
|
997
997
|
expression when using custom evaluations.
|
|
998
998
|
```
|
|
999
999
|
|
|
1000
|
-
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
1000
|
+
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/test/results.ts)_
|
|
1001
1001
|
|
|
1002
1002
|
## `sf agent test resume`
|
|
1003
1003
|
|
|
@@ -1070,7 +1070,7 @@ FLAG DESCRIPTIONS
|
|
|
1070
1070
|
expression when using custom evaluations.
|
|
1071
1071
|
```
|
|
1072
1072
|
|
|
1073
|
-
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
1073
|
+
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/test/resume.ts)_
|
|
1074
1074
|
|
|
1075
1075
|
## `sf agent test run`
|
|
1076
1076
|
|
|
@@ -1144,7 +1144,7 @@ FLAG DESCRIPTIONS
|
|
|
1144
1144
|
expression when using custom evaluations.
|
|
1145
1145
|
```
|
|
1146
1146
|
|
|
1147
|
-
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
1147
|
+
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/test/run.ts)_
|
|
1148
1148
|
|
|
1149
1149
|
## `sf agent validate authoring-bundle`
|
|
1150
1150
|
|
|
@@ -1191,6 +1191,6 @@ EXAMPLES
|
|
|
1191
1191
|
$ sf agent validate authoring-bundle --api-name MyAuthoringBundle --target-org my-dev-org
|
|
1192
1192
|
```
|
|
1193
1193
|
|
|
1194
|
-
_See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.
|
|
1194
|
+
_See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.30.4/src/commands/agent/validate/authoring-bundle.ts)_
|
|
1195
1195
|
|
|
1196
1196
|
<!-- commandsstop -->
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
17
|
-
import { Messages
|
|
17
|
+
import { Messages } from '@salesforce/core';
|
|
18
18
|
import { MultiStageOutput } from '@oclif/multi-stage-output';
|
|
19
19
|
import { Agent } from '@salesforce/agents';
|
|
20
20
|
import { colorize } from '@oclif/core/ux';
|
|
@@ -76,45 +76,27 @@ export default class AgentValidateAuthoringBundle extends SfCommand {
|
|
|
76
76
|
},
|
|
77
77
|
],
|
|
78
78
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
mso.stop('completed');
|
|
88
|
-
return {
|
|
89
|
-
success: true,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
throwAgentCompilationError(result.errors);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
catch (error) {
|
|
97
|
-
// Handle validation errors
|
|
98
|
-
const err = SfError.wrap(error);
|
|
99
|
-
let count = 0;
|
|
100
|
-
const rawError = err.message ? err.message : err.name;
|
|
101
|
-
const formattedError = rawError
|
|
102
|
-
.split('\n')
|
|
103
|
-
.map((line) => {
|
|
104
|
-
count += 1;
|
|
105
|
-
const type = line.split(':')[0];
|
|
106
|
-
const rest = line.includes(':') ? line.substring(line.indexOf(':')).trim() : '';
|
|
107
|
-
return `- ${colorize('red', type)}${rest}`;
|
|
108
|
-
})
|
|
109
|
-
.join('\n');
|
|
110
|
-
mso.updateData({ errors: count.toString(), status: 'ERROR' });
|
|
111
|
-
mso.error();
|
|
112
|
-
this.error(messages.getMessage('error.compilationFailed', [formattedError]));
|
|
79
|
+
mso.skipTo('Validating Authoring Bundle');
|
|
80
|
+
const targetOrg = flags['target-org'];
|
|
81
|
+
const conn = targetOrg.getConnection(flags['api-version']);
|
|
82
|
+
const agent = await Agent.init({ connection: conn, project: this.project, aabName });
|
|
83
|
+
const result = await agent.compile();
|
|
84
|
+
if (result.status === 'success') {
|
|
85
|
+
mso.updateData({ status: 'COMPLETED' });
|
|
86
|
+
mso.stop('completed');
|
|
113
87
|
return {
|
|
114
|
-
success:
|
|
115
|
-
errors: err.message.split('\n'),
|
|
88
|
+
success: true,
|
|
116
89
|
};
|
|
117
90
|
}
|
|
91
|
+
// Validation failed with compilation errors -> exit 1 (404/500 set by @salesforce/agents)
|
|
92
|
+
mso.updateData({ errors: result.errors.length.toString(), status: 'ERROR' });
|
|
93
|
+
mso.error();
|
|
94
|
+
this.log(messages.getMessage('error.compilationFailed', [
|
|
95
|
+
result.errors
|
|
96
|
+
.map((line) => `- ${colorize('red', line.errorType)}: ${line.description} [Ln ${line.lineStart}, Col ${line.colStart}]`)
|
|
97
|
+
.join('\n'),
|
|
98
|
+
]));
|
|
99
|
+
throwAgentCompilationError(result.errors);
|
|
118
100
|
}
|
|
119
101
|
}
|
|
120
102
|
//# sourceMappingURL=authoring-bundle.js.map
|
|
@@ -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,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"authoring-bundle.js","sourceRoot":"","sources":["../../../../src/commands/agent/validate/authoring-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAmB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,iCAAiC,CAAC,CAAC;AAOtG,MAAM,CAAC,OAAO,OAAO,4BAA6B,SAAQ,SAA6C;IAC9F,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,KAAK,GAAG;QAC7B,YAAY,EAAE,KAAK,CAAC,WAAW,EAAE;QACjC,aA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AC,yBAAyB,EAAE;YAC7C,MAAM,CAAC,MAAM;iBACV,GAAG,CACF,CAAC,IAAI,EAAE,EAAE,CACP,KAAK,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC,WAAW,QAAQ,IAAI,CAAC,SAAS,SAAS,IAAI,CAAC,QAAQ,GAAG,CAC3G;iBACA,IAAI,CAAC,IAAI,CAAC;SACd,CAAC,CACH,CAAC;QACF,0BAA0B,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC"}
|
package/lib/common.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { CompilationError } from '@salesforce/agents';
|
|
1
|
+
import { CompilationError, COMPILATION_API_EXIT_CODES } from '@salesforce/agents';
|
|
2
|
+
/** Re-export so consumers can use the library's exit code contract (404 → 2, 500 → 3). */
|
|
3
|
+
export { COMPILATION_API_EXIT_CODES };
|
|
2
4
|
/**
|
|
3
5
|
* Utility function to generate SfError when there are agent compilation errors.
|
|
4
6
|
*
|
package/lib/common.js
CHANGED
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { EOL } from 'node:os';
|
|
17
17
|
import { SfError } from '@salesforce/core';
|
|
18
|
+
import { COMPILATION_API_EXIT_CODES } from '@salesforce/agents';
|
|
19
|
+
/** Re-export so consumers can use the library's exit code contract (404 → 2, 500 → 3). */
|
|
20
|
+
export { COMPILATION_API_EXIT_CODES };
|
|
18
21
|
/**
|
|
19
22
|
* Utility function to generate SfError when there are agent compilation errors.
|
|
20
23
|
*
|
|
@@ -27,13 +30,15 @@ export function throwAgentCompilationError(compilationErrors) {
|
|
|
27
30
|
name: 'CompileAgentScriptError',
|
|
28
31
|
message: 'Unknown compilation error occurred',
|
|
29
32
|
data: compilationErrors,
|
|
33
|
+
exitCode: 1,
|
|
30
34
|
});
|
|
31
35
|
}
|
|
32
36
|
const errors = compilationErrors;
|
|
33
37
|
throw SfError.create({
|
|
34
38
|
name: 'CompileAgentScriptError',
|
|
35
39
|
message: errors.map((e) => `${e.errorType}: ${e.description} [Ln ${e.lineStart}, Col ${e.colStart}]`).join(EOL),
|
|
36
|
-
data: errors,
|
|
40
|
+
data: { errors },
|
|
41
|
+
exitCode: 1,
|
|
37
42
|
});
|
|
38
43
|
}
|
|
39
44
|
//# sourceMappingURL=common.js.map
|
package/lib/common.js.map
CHANGED
|
@@ -1 +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;
|
|
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;AAC3C,OAAO,EAAoB,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAElF,0FAA0F;AAC1F,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAEtC;;;;;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;YACvB,QAAQ,EAAE,CAAC;SACZ,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,EAAE,MAAM,EAAE;QAChB,QAAQ,EAAE,CAAC;KACZ,CAAC,CAAC;AACL,CAAC"}
|
package/oclif.manifest.json
CHANGED
|
@@ -1226,90 +1226,6 @@
|
|
|
1226
1226
|
"start:preview:agent"
|
|
1227
1227
|
]
|
|
1228
1228
|
},
|
|
1229
|
-
"agent:validate:authoring-bundle": {
|
|
1230
|
-
"aliases": [],
|
|
1231
|
-
"args": {},
|
|
1232
|
-
"description": "An authoring bundle is a metadata type (named aiAuthoringBundle) that provides the blueprint for an agent. The metadata type contains two files: the standard metatada XML file and an Agent Script file (extension \".agent\") that fully describes the agent using the Agent Script language.\n\nThis command validates that the Agent Script file in the authoring bundle compiles without errors so that you can later publish the bundle to your org. Use this command while you code the Agent Script file to ensure that it's valid. If the validation fails, the command outputs the list of syntax errors, a brief description of the error, and the location in the Agent Script file where the error occurred.\n\nThis command uses the API name of the authoring bundle. If you don't provide an API name with the --api-name flag, the command searches the current DX project and outputs a list of authoring bundles that it found for you to choose from.",
|
|
1233
|
-
"examples": [
|
|
1234
|
-
"Validate an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
|
|
1235
|
-
"Validate an authoring bundle with API name MyAuthoringBundle; use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringBundle --target-org my-dev-org"
|
|
1236
|
-
],
|
|
1237
|
-
"flags": {
|
|
1238
|
-
"json": {
|
|
1239
|
-
"description": "Format output as json.",
|
|
1240
|
-
"helpGroup": "GLOBAL",
|
|
1241
|
-
"name": "json",
|
|
1242
|
-
"allowNo": false,
|
|
1243
|
-
"type": "boolean"
|
|
1244
|
-
},
|
|
1245
|
-
"flags-dir": {
|
|
1246
|
-
"helpGroup": "GLOBAL",
|
|
1247
|
-
"name": "flags-dir",
|
|
1248
|
-
"summary": "Import flag values from a directory.",
|
|
1249
|
-
"hasDynamicHelp": false,
|
|
1250
|
-
"multiple": false,
|
|
1251
|
-
"type": "option"
|
|
1252
|
-
},
|
|
1253
|
-
"target-org": {
|
|
1254
|
-
"char": "o",
|
|
1255
|
-
"name": "target-org",
|
|
1256
|
-
"noCacheDefault": true,
|
|
1257
|
-
"required": true,
|
|
1258
|
-
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
1259
|
-
"hasDynamicHelp": true,
|
|
1260
|
-
"multiple": false,
|
|
1261
|
-
"type": "option"
|
|
1262
|
-
},
|
|
1263
|
-
"api-version": {
|
|
1264
|
-
"description": "Override the api version used for api requests made by this command",
|
|
1265
|
-
"name": "api-version",
|
|
1266
|
-
"hasDynamicHelp": false,
|
|
1267
|
-
"multiple": false,
|
|
1268
|
-
"type": "option"
|
|
1269
|
-
},
|
|
1270
|
-
"api-name": {
|
|
1271
|
-
"char": "n",
|
|
1272
|
-
"name": "api-name",
|
|
1273
|
-
"summary": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
|
|
1274
|
-
"hasDynamicHelp": false,
|
|
1275
|
-
"multiple": false,
|
|
1276
|
-
"type": "option"
|
|
1277
|
-
}
|
|
1278
|
-
},
|
|
1279
|
-
"hasDynamicHelp": true,
|
|
1280
|
-
"hiddenAliases": [],
|
|
1281
|
-
"id": "agent:validate:authoring-bundle",
|
|
1282
|
-
"pluginAlias": "@salesforce/plugin-agent",
|
|
1283
|
-
"pluginName": "@salesforce/plugin-agent",
|
|
1284
|
-
"pluginType": "core",
|
|
1285
|
-
"strict": true,
|
|
1286
|
-
"summary": "Validate an authoring bundle to ensure its Agent Script file compiles successfully and can be used to publish an agent.",
|
|
1287
|
-
"enableJsonFlag": true,
|
|
1288
|
-
"requiresProject": true,
|
|
1289
|
-
"FLAGGABLE_PROMPTS": {
|
|
1290
|
-
"api-name": {
|
|
1291
|
-
"message": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
|
|
1292
|
-
"promptMessage": "API name of the authoring bundle to validate"
|
|
1293
|
-
}
|
|
1294
|
-
},
|
|
1295
|
-
"isESM": true,
|
|
1296
|
-
"relativePath": [
|
|
1297
|
-
"lib",
|
|
1298
|
-
"commands",
|
|
1299
|
-
"agent",
|
|
1300
|
-
"validate",
|
|
1301
|
-
"authoring-bundle.js"
|
|
1302
|
-
],
|
|
1303
|
-
"aliasPermutations": [],
|
|
1304
|
-
"permutations": [
|
|
1305
|
-
"agent:validate:authoring-bundle",
|
|
1306
|
-
"validate:agent:authoring-bundle",
|
|
1307
|
-
"validate:authoring-bundle:agent",
|
|
1308
|
-
"agent:authoring-bundle:validate",
|
|
1309
|
-
"authoring-bundle:agent:validate",
|
|
1310
|
-
"authoring-bundle:validate:agent"
|
|
1311
|
-
]
|
|
1312
|
-
},
|
|
1313
1229
|
"agent:test:create": {
|
|
1314
1230
|
"aliases": [],
|
|
1315
1231
|
"args": {},
|
|
@@ -1823,7 +1739,91 @@
|
|
|
1823
1739
|
"run:agent:test",
|
|
1824
1740
|
"run:test:agent"
|
|
1825
1741
|
]
|
|
1742
|
+
},
|
|
1743
|
+
"agent:validate:authoring-bundle": {
|
|
1744
|
+
"aliases": [],
|
|
1745
|
+
"args": {},
|
|
1746
|
+
"description": "An authoring bundle is a metadata type (named aiAuthoringBundle) that provides the blueprint for an agent. The metadata type contains two files: the standard metatada XML file and an Agent Script file (extension \".agent\") that fully describes the agent using the Agent Script language.\n\nThis command validates that the Agent Script file in the authoring bundle compiles without errors so that you can later publish the bundle to your org. Use this command while you code the Agent Script file to ensure that it's valid. If the validation fails, the command outputs the list of syntax errors, a brief description of the error, and the location in the Agent Script file where the error occurred.\n\nThis command uses the API name of the authoring bundle. If you don't provide an API name with the --api-name flag, the command searches the current DX project and outputs a list of authoring bundles that it found for you to choose from.",
|
|
1747
|
+
"examples": [
|
|
1748
|
+
"Validate an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
|
|
1749
|
+
"Validate an authoring bundle with API name MyAuthoringBundle; use the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringBundle --target-org my-dev-org"
|
|
1750
|
+
],
|
|
1751
|
+
"flags": {
|
|
1752
|
+
"json": {
|
|
1753
|
+
"description": "Format output as json.",
|
|
1754
|
+
"helpGroup": "GLOBAL",
|
|
1755
|
+
"name": "json",
|
|
1756
|
+
"allowNo": false,
|
|
1757
|
+
"type": "boolean"
|
|
1758
|
+
},
|
|
1759
|
+
"flags-dir": {
|
|
1760
|
+
"helpGroup": "GLOBAL",
|
|
1761
|
+
"name": "flags-dir",
|
|
1762
|
+
"summary": "Import flag values from a directory.",
|
|
1763
|
+
"hasDynamicHelp": false,
|
|
1764
|
+
"multiple": false,
|
|
1765
|
+
"type": "option"
|
|
1766
|
+
},
|
|
1767
|
+
"target-org": {
|
|
1768
|
+
"char": "o",
|
|
1769
|
+
"name": "target-org",
|
|
1770
|
+
"noCacheDefault": true,
|
|
1771
|
+
"required": true,
|
|
1772
|
+
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
1773
|
+
"hasDynamicHelp": true,
|
|
1774
|
+
"multiple": false,
|
|
1775
|
+
"type": "option"
|
|
1776
|
+
},
|
|
1777
|
+
"api-version": {
|
|
1778
|
+
"description": "Override the api version used for api requests made by this command",
|
|
1779
|
+
"name": "api-version",
|
|
1780
|
+
"hasDynamicHelp": false,
|
|
1781
|
+
"multiple": false,
|
|
1782
|
+
"type": "option"
|
|
1783
|
+
},
|
|
1784
|
+
"api-name": {
|
|
1785
|
+
"char": "n",
|
|
1786
|
+
"name": "api-name",
|
|
1787
|
+
"summary": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
|
|
1788
|
+
"hasDynamicHelp": false,
|
|
1789
|
+
"multiple": false,
|
|
1790
|
+
"type": "option"
|
|
1791
|
+
}
|
|
1792
|
+
},
|
|
1793
|
+
"hasDynamicHelp": true,
|
|
1794
|
+
"hiddenAliases": [],
|
|
1795
|
+
"id": "agent:validate:authoring-bundle",
|
|
1796
|
+
"pluginAlias": "@salesforce/plugin-agent",
|
|
1797
|
+
"pluginName": "@salesforce/plugin-agent",
|
|
1798
|
+
"pluginType": "core",
|
|
1799
|
+
"strict": true,
|
|
1800
|
+
"summary": "Validate an authoring bundle to ensure its Agent Script file compiles successfully and can be used to publish an agent.",
|
|
1801
|
+
"enableJsonFlag": true,
|
|
1802
|
+
"requiresProject": true,
|
|
1803
|
+
"FLAGGABLE_PROMPTS": {
|
|
1804
|
+
"api-name": {
|
|
1805
|
+
"message": "API name of the authoring bundle you want to validate; if not specified, the command provides a list that you can choose from.",
|
|
1806
|
+
"promptMessage": "API name of the authoring bundle to validate"
|
|
1807
|
+
}
|
|
1808
|
+
},
|
|
1809
|
+
"isESM": true,
|
|
1810
|
+
"relativePath": [
|
|
1811
|
+
"lib",
|
|
1812
|
+
"commands",
|
|
1813
|
+
"agent",
|
|
1814
|
+
"validate",
|
|
1815
|
+
"authoring-bundle.js"
|
|
1816
|
+
],
|
|
1817
|
+
"aliasPermutations": [],
|
|
1818
|
+
"permutations": [
|
|
1819
|
+
"agent:validate:authoring-bundle",
|
|
1820
|
+
"validate:agent:authoring-bundle",
|
|
1821
|
+
"validate:authoring-bundle:agent",
|
|
1822
|
+
"agent:authoring-bundle:validate",
|
|
1823
|
+
"authoring-bundle:agent:validate",
|
|
1824
|
+
"authoring-bundle:validate:agent"
|
|
1825
|
+
]
|
|
1826
1826
|
}
|
|
1827
1827
|
},
|
|
1828
|
-
"version": "1.30.
|
|
1828
|
+
"version": "1.30.4"
|
|
1829
1829
|
}
|
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.30.
|
|
4
|
+
"version": "1.30.4",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"enableO11y": true,
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"@inquirer/prompts": "^7.10.1",
|
|
12
12
|
"@oclif/core": "^4",
|
|
13
13
|
"@oclif/multi-stage-output": "^0.8.29",
|
|
14
|
-
"@salesforce/agents": "^0.23.
|
|
14
|
+
"@salesforce/agents": "^0.23.3",
|
|
15
15
|
"@salesforce/core": "^8.26.2",
|
|
16
16
|
"@salesforce/kit": "^3.2.4",
|
|
17
17
|
"@salesforce/sf-plugins-core": "^12.2.6",
|
|
18
|
-
"@salesforce/source-deploy-retrieve": "^12.31.
|
|
18
|
+
"@salesforce/source-deploy-retrieve": "^12.31.14",
|
|
19
19
|
"@salesforce/types": "^1.6.0",
|
|
20
20
|
"ansis": "^3.3.2",
|
|
21
|
-
"fast-xml-parser": "^5.3.
|
|
21
|
+
"fast-xml-parser": "^5.3.7",
|
|
22
22
|
"glob": "^11.0.3",
|
|
23
23
|
"ink": "5.0.1",
|
|
24
24
|
"ink-text-input": "^6.0.0",
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
"exports": "./lib/index.js",
|
|
240
240
|
"type": "module",
|
|
241
241
|
"sfdx": {
|
|
242
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.30.
|
|
243
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.30.
|
|
242
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.30.4.crt",
|
|
243
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.30.4.sig"
|
|
244
244
|
}
|
|
245
245
|
}
|