@salesforce/plugin-agent 1.30.11 → 1.31.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 +19 -19
- package/lib/commands/agent/test/run-eval.d.ts +33 -0
- package/lib/commands/agent/test/run-eval.js +221 -0
- package/lib/commands/agent/test/run-eval.js.map +1 -0
- package/lib/evalFormatter.d.ts +30 -0
- package/lib/evalFormatter.js +263 -0
- package/lib/evalFormatter.js.map +1 -0
- package/lib/evalNormalizer.d.ts +57 -0
- package/lib/evalNormalizer.js +421 -0
- package/lib/evalNormalizer.js.map +1 -0
- package/lib/yamlSpecTranslator.d.ts +20 -0
- package/lib/yamlSpecTranslator.js +217 -0
- package/lib/yamlSpecTranslator.js.map +1 -0
- package/messages/agent.test.run-eval.md +91 -0
- package/oclif.manifest.json +219 -91
- package/package.json +6 -6
- package/schemas/agent-test-run__eval.json +52 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yamlSpecTranslator.js","sourceRoot":"","sources":["../src/yamlSpecTranslator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,8BAA8B;AAE9B,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAI1C,4DAA4D;AAE5D,MAAM,eAAe,GAA2B;IAC9C,yBAAyB,EAAE,eAAe;IAC1C,uBAAuB,EAAE,oDAAoD;IAC7E,gCAAgC,EAAE,6DAA6D;IAC/F,iCAAiC,EAAE,6DAA6D;CACjG,CAAC;AAEF,2DAA2D;AAE3D,MAAM,oBAAoB,GAA2B;IACnD,iBAAiB,EAAE,4BAA4B;IAC/C,kBAAkB,EAAE,6BAA6B;CAClD,CAAC;AAEF,4CAA4C;AAC5C,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,uBAAuB;IACvB,gCAAgC;IAChC,iCAAiC;CAClC,CAAC,CAAC;AAEH,qBAAqB;AAErB;;;GAGG;AACH,M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UAAU,EAAE,CAAC;YAC9B,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;QACzB,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACnC,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACtC,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACrC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,EAAE,EAAE,UAAU,KAAK,EAAE;QACrB,QAAQ;QACR,MAAM;QACN,QAAQ;KACT,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Run evaluation tests against an Agentforce agent.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Execute rich evaluation tests against an Agentforce agent using the Einstein Evaluation API. Supports both YAML test specs (same format as `sf agent generate test-spec`) and JSON payloads.
|
|
8
|
+
|
|
9
|
+
When you provide a YAML test spec, the command automatically translates test cases into Evaluation API calls and infers the agent name from the spec's `subjectName` field. This means you can use the same test spec with both `sf agent test run` and `sf agent test run-eval`.
|
|
10
|
+
|
|
11
|
+
When you provide a JSON payload, it's sent directly to the API with optional normalization. The normalizer auto-corrects common field name mistakes, converts shorthand references to JSONPath, and injects defaults. Use `--no-normalize` to disable this auto-normalization.
|
|
12
|
+
|
|
13
|
+
Supports 8+ evaluator types, including topic routing assertions, action invocation checks, string/numeric assertions, semantic similarity scoring, and LLM-based quality ratings.
|
|
14
|
+
|
|
15
|
+
# flags.spec.summary
|
|
16
|
+
|
|
17
|
+
Path to test spec file (YAML or JSON). Use `-` for stdin.
|
|
18
|
+
|
|
19
|
+
# flags.api-name.summary
|
|
20
|
+
|
|
21
|
+
Agent DeveloperName (also called API name) to resolve agent_id and agent_version_id. Auto-inferred from the YAML spec's subjectName.
|
|
22
|
+
|
|
23
|
+
# flags.wait.summary
|
|
24
|
+
|
|
25
|
+
Number of minutes to wait for results.
|
|
26
|
+
|
|
27
|
+
# flags.result-format.summary
|
|
28
|
+
|
|
29
|
+
Format of the agent test results.
|
|
30
|
+
|
|
31
|
+
# flags.batch-size.summary
|
|
32
|
+
|
|
33
|
+
Number of tests per API request (max 5).
|
|
34
|
+
|
|
35
|
+
# flags.no-normalize.summary
|
|
36
|
+
|
|
37
|
+
Disable auto-normalization of field names and shorthand references.
|
|
38
|
+
|
|
39
|
+
# examples
|
|
40
|
+
|
|
41
|
+
- Run tests using a YAML test spec on the org with alias "my-org":
|
|
42
|
+
|
|
43
|
+
<%= config.bin %> <%= command.id %> --spec tests/my-agent-testSpec.yaml --target-org my-org
|
|
44
|
+
|
|
45
|
+
- Run tests using a YAML spec with explicit agent name override; use your default org:
|
|
46
|
+
|
|
47
|
+
<%= config.bin %> <%= command.id %> --spec tests/my-agent-testSpec.yaml --api-name My_Agent --target-org my-org
|
|
48
|
+
|
|
49
|
+
- Run tests using a JSON payload:
|
|
50
|
+
|
|
51
|
+
<%= config.bin %> <%= command.id %> --spec tests/eval-payload.json --target-org my-org
|
|
52
|
+
|
|
53
|
+
- Run tests and output results in JUnit format; useful for continuous integration and deployment (CI/CD):
|
|
54
|
+
|
|
55
|
+
<%= config.bin %> <%= command.id %> --spec tests/my-agent-testSpec.yaml --target-org my-org --result-format junit
|
|
56
|
+
|
|
57
|
+
- Pipe JSON payload from stdin:
|
|
58
|
+
|
|
59
|
+
$ echo '{"tests":[...]}' | <%= config.bin %> <%= command.id %> --spec - --target-org my-org
|
|
60
|
+
|
|
61
|
+
# info.batchProgress
|
|
62
|
+
|
|
63
|
+
Running batch %s of %s (%s tests)...
|
|
64
|
+
|
|
65
|
+
# info.testComplete
|
|
66
|
+
|
|
67
|
+
Test %s: %s.
|
|
68
|
+
|
|
69
|
+
# info.summary
|
|
70
|
+
|
|
71
|
+
Results: %s passed, %s failed, %s scored, %s errors.
|
|
72
|
+
|
|
73
|
+
# info.yamlDetected
|
|
74
|
+
|
|
75
|
+
Detected YAML test spec for agent '%s' with %s test case(s). Translating to Evaluation API format.
|
|
76
|
+
|
|
77
|
+
# error.invalidPayload
|
|
78
|
+
|
|
79
|
+
Invalid test payload: %s.
|
|
80
|
+
|
|
81
|
+
# error.apiError
|
|
82
|
+
|
|
83
|
+
Einstein Eval API error (HTTP %s): %s
|
|
84
|
+
|
|
85
|
+
# error.agentNotFound
|
|
86
|
+
|
|
87
|
+
No agent found with DeveloperName (also API name) '%s'. Verify that the agent exists in the target org.
|
|
88
|
+
|
|
89
|
+
# error.agentVersionNotFound
|
|
90
|
+
|
|
91
|
+
No published version found for agent '%s'. Make sure the agent has been published at least once.
|
package/oclif.manifest.json
CHANGED
|
@@ -791,6 +791,96 @@
|
|
|
791
791
|
"test-spec:generate:agent"
|
|
792
792
|
]
|
|
793
793
|
},
|
|
794
|
+
"agent:publish:authoring-bundle": {
|
|
795
|
+
"aliases": [],
|
|
796
|
+
"args": {},
|
|
797
|
+
"description": "An authoring bundle is a metadata type (named aiAuthoringBundle) that provides the blueprint for an agent. The metadata type contains two files: the standard metatada XML file and an Agent Script file (extension \".agent\") that fully describes the agent using the Agent Script language.\n\nWhen you publish an authoring bundle to your org, a number of things happen. First, this command validates that the Agent Script file successfully compiles. If there are compilation errors, the command exits and you must fix the Agent Script file to continue. Once the Agent Script file compiles, then it's published to the org, which in turn creates new associated metadata (Bot, BotVersion, GenAiX), or new versions of the metadata if the agent already exists. The new or updated metadata is retrieved back to your DX project; specify the --skip-retrieve flag to skip this step. Finally, the authoring bundle metadata (AiAuthoringBundle) is deployed to your org.\n\nThis command uses the API name of the authoring bundle.",
|
|
798
|
+
"examples": [
|
|
799
|
+
"Publish an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
|
|
800
|
+
"Publish an authoring bundle with API name MyAuthoringBundle to the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringbundle --target-org my-dev-org"
|
|
801
|
+
],
|
|
802
|
+
"flags": {
|
|
803
|
+
"json": {
|
|
804
|
+
"description": "Format output as json.",
|
|
805
|
+
"helpGroup": "GLOBAL",
|
|
806
|
+
"name": "json",
|
|
807
|
+
"allowNo": false,
|
|
808
|
+
"type": "boolean"
|
|
809
|
+
},
|
|
810
|
+
"flags-dir": {
|
|
811
|
+
"helpGroup": "GLOBAL",
|
|
812
|
+
"name": "flags-dir",
|
|
813
|
+
"summary": "Import flag values from a directory.",
|
|
814
|
+
"hasDynamicHelp": false,
|
|
815
|
+
"multiple": false,
|
|
816
|
+
"type": "option"
|
|
817
|
+
},
|
|
818
|
+
"target-org": {
|
|
819
|
+
"char": "o",
|
|
820
|
+
"name": "target-org",
|
|
821
|
+
"noCacheDefault": true,
|
|
822
|
+
"required": true,
|
|
823
|
+
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
824
|
+
"hasDynamicHelp": true,
|
|
825
|
+
"multiple": false,
|
|
826
|
+
"type": "option"
|
|
827
|
+
},
|
|
828
|
+
"api-version": {
|
|
829
|
+
"description": "Override the api version used for api requests made by this command",
|
|
830
|
+
"name": "api-version",
|
|
831
|
+
"hasDynamicHelp": false,
|
|
832
|
+
"multiple": false,
|
|
833
|
+
"type": "option"
|
|
834
|
+
},
|
|
835
|
+
"api-name": {
|
|
836
|
+
"char": "n",
|
|
837
|
+
"name": "api-name",
|
|
838
|
+
"summary": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
|
|
839
|
+
"hasDynamicHelp": false,
|
|
840
|
+
"multiple": false,
|
|
841
|
+
"type": "option"
|
|
842
|
+
},
|
|
843
|
+
"skip-retrieve": {
|
|
844
|
+
"name": "skip-retrieve",
|
|
845
|
+
"summary": "Don't retrieve the metadata associated with the agent to your DX project.",
|
|
846
|
+
"allowNo": false,
|
|
847
|
+
"type": "boolean"
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
"hasDynamicHelp": true,
|
|
851
|
+
"hiddenAliases": [],
|
|
852
|
+
"id": "agent:publish:authoring-bundle",
|
|
853
|
+
"pluginAlias": "@salesforce/plugin-agent",
|
|
854
|
+
"pluginName": "@salesforce/plugin-agent",
|
|
855
|
+
"pluginType": "core",
|
|
856
|
+
"strict": true,
|
|
857
|
+
"summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
|
|
858
|
+
"enableJsonFlag": true,
|
|
859
|
+
"requiresProject": true,
|
|
860
|
+
"FLAGGABLE_PROMPTS": {
|
|
861
|
+
"api-name": {
|
|
862
|
+
"message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
|
|
863
|
+
"promptMessage": "API name of the authoring bundle to publish"
|
|
864
|
+
}
|
|
865
|
+
},
|
|
866
|
+
"isESM": true,
|
|
867
|
+
"relativePath": [
|
|
868
|
+
"lib",
|
|
869
|
+
"commands",
|
|
870
|
+
"agent",
|
|
871
|
+
"publish",
|
|
872
|
+
"authoring-bundle.js"
|
|
873
|
+
],
|
|
874
|
+
"aliasPermutations": [],
|
|
875
|
+
"permutations": [
|
|
876
|
+
"agent:publish:authoring-bundle",
|
|
877
|
+
"publish:agent:authoring-bundle",
|
|
878
|
+
"publish:authoring-bundle:agent",
|
|
879
|
+
"agent:authoring-bundle:publish",
|
|
880
|
+
"authoring-bundle:agent:publish",
|
|
881
|
+
"authoring-bundle:publish:agent"
|
|
882
|
+
]
|
|
883
|
+
},
|
|
794
884
|
"agent:preview:end": {
|
|
795
885
|
"aliases": [],
|
|
796
886
|
"args": {},
|
|
@@ -1136,96 +1226,6 @@
|
|
|
1136
1226
|
"start:preview:agent"
|
|
1137
1227
|
]
|
|
1138
1228
|
},
|
|
1139
|
-
"agent:publish:authoring-bundle": {
|
|
1140
|
-
"aliases": [],
|
|
1141
|
-
"args": {},
|
|
1142
|
-
"description": "An authoring bundle is a metadata type (named aiAuthoringBundle) that provides the blueprint for an agent. The metadata type contains two files: the standard metatada XML file and an Agent Script file (extension \".agent\") that fully describes the agent using the Agent Script language.\n\nWhen you publish an authoring bundle to your org, a number of things happen. First, this command validates that the Agent Script file successfully compiles. If there are compilation errors, the command exits and you must fix the Agent Script file to continue. Once the Agent Script file compiles, then it's published to the org, which in turn creates new associated metadata (Bot, BotVersion, GenAiX), or new versions of the metadata if the agent already exists. The new or updated metadata is retrieved back to your DX project; specify the --skip-retrieve flag to skip this step. Finally, the authoring bundle metadata (AiAuthoringBundle) is deployed to your org.\n\nThis command uses the API name of the authoring bundle.",
|
|
1143
|
-
"examples": [
|
|
1144
|
-
"Publish an authoring bundle by being prompted for its API name; use your default org:\n<%= config.bin %> <%= command.id %>",
|
|
1145
|
-
"Publish an authoring bundle with API name MyAuthoringBundle to the org with alias \"my-dev-org\":\n<%= config.bin %> <%= command.id %> --api-name MyAuthoringbundle --target-org my-dev-org"
|
|
1146
|
-
],
|
|
1147
|
-
"flags": {
|
|
1148
|
-
"json": {
|
|
1149
|
-
"description": "Format output as json.",
|
|
1150
|
-
"helpGroup": "GLOBAL",
|
|
1151
|
-
"name": "json",
|
|
1152
|
-
"allowNo": false,
|
|
1153
|
-
"type": "boolean"
|
|
1154
|
-
},
|
|
1155
|
-
"flags-dir": {
|
|
1156
|
-
"helpGroup": "GLOBAL",
|
|
1157
|
-
"name": "flags-dir",
|
|
1158
|
-
"summary": "Import flag values from a directory.",
|
|
1159
|
-
"hasDynamicHelp": false,
|
|
1160
|
-
"multiple": false,
|
|
1161
|
-
"type": "option"
|
|
1162
|
-
},
|
|
1163
|
-
"target-org": {
|
|
1164
|
-
"char": "o",
|
|
1165
|
-
"name": "target-org",
|
|
1166
|
-
"noCacheDefault": true,
|
|
1167
|
-
"required": true,
|
|
1168
|
-
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
1169
|
-
"hasDynamicHelp": true,
|
|
1170
|
-
"multiple": false,
|
|
1171
|
-
"type": "option"
|
|
1172
|
-
},
|
|
1173
|
-
"api-version": {
|
|
1174
|
-
"description": "Override the api version used for api requests made by this command",
|
|
1175
|
-
"name": "api-version",
|
|
1176
|
-
"hasDynamicHelp": false,
|
|
1177
|
-
"multiple": false,
|
|
1178
|
-
"type": "option"
|
|
1179
|
-
},
|
|
1180
|
-
"api-name": {
|
|
1181
|
-
"char": "n",
|
|
1182
|
-
"name": "api-name",
|
|
1183
|
-
"summary": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
|
|
1184
|
-
"hasDynamicHelp": false,
|
|
1185
|
-
"multiple": false,
|
|
1186
|
-
"type": "option"
|
|
1187
|
-
},
|
|
1188
|
-
"skip-retrieve": {
|
|
1189
|
-
"name": "skip-retrieve",
|
|
1190
|
-
"summary": "Don't retrieve the metadata associated with the agent to your DX project.",
|
|
1191
|
-
"allowNo": false,
|
|
1192
|
-
"type": "boolean"
|
|
1193
|
-
}
|
|
1194
|
-
},
|
|
1195
|
-
"hasDynamicHelp": true,
|
|
1196
|
-
"hiddenAliases": [],
|
|
1197
|
-
"id": "agent:publish:authoring-bundle",
|
|
1198
|
-
"pluginAlias": "@salesforce/plugin-agent",
|
|
1199
|
-
"pluginName": "@salesforce/plugin-agent",
|
|
1200
|
-
"pluginType": "core",
|
|
1201
|
-
"strict": true,
|
|
1202
|
-
"summary": "Publish an authoring bundle to your org, which results in a new agent or a new version of an existing agent.",
|
|
1203
|
-
"enableJsonFlag": true,
|
|
1204
|
-
"requiresProject": true,
|
|
1205
|
-
"FLAGGABLE_PROMPTS": {
|
|
1206
|
-
"api-name": {
|
|
1207
|
-
"message": "API name of the authoring bundle you want to publish; if not specified, the command provides a list that you can choose from.",
|
|
1208
|
-
"promptMessage": "API name of the authoring bundle to publish"
|
|
1209
|
-
}
|
|
1210
|
-
},
|
|
1211
|
-
"isESM": true,
|
|
1212
|
-
"relativePath": [
|
|
1213
|
-
"lib",
|
|
1214
|
-
"commands",
|
|
1215
|
-
"agent",
|
|
1216
|
-
"publish",
|
|
1217
|
-
"authoring-bundle.js"
|
|
1218
|
-
],
|
|
1219
|
-
"aliasPermutations": [],
|
|
1220
|
-
"permutations": [
|
|
1221
|
-
"agent:publish:authoring-bundle",
|
|
1222
|
-
"publish:agent:authoring-bundle",
|
|
1223
|
-
"publish:authoring-bundle:agent",
|
|
1224
|
-
"agent:authoring-bundle:publish",
|
|
1225
|
-
"authoring-bundle:agent:publish",
|
|
1226
|
-
"authoring-bundle:publish:agent"
|
|
1227
|
-
]
|
|
1228
|
-
},
|
|
1229
1229
|
"agent:test:create": {
|
|
1230
1230
|
"aliases": [],
|
|
1231
1231
|
"args": {},
|
|
@@ -1624,6 +1624,134 @@
|
|
|
1624
1624
|
"resume:test:agent"
|
|
1625
1625
|
]
|
|
1626
1626
|
},
|
|
1627
|
+
"agent:test:run-eval": {
|
|
1628
|
+
"aliases": [],
|
|
1629
|
+
"args": {},
|
|
1630
|
+
"description": "Execute rich evaluation tests against an Agentforce agent using the Einstein Evaluation API. Supports both YAML test specs (same format as `sf agent generate test-spec`) and JSON payloads.\n\nWhen you provide a YAML test spec, the command automatically translates test cases into Evaluation API calls and infers the agent name from the spec's `subjectName` field. This means you can use the same test spec with both `sf agent test run` and `sf agent test run-eval`.\n\nWhen you provide a JSON payload, it's sent directly to the API with optional normalization. The normalizer auto-corrects common field name mistakes, converts shorthand references to JSONPath, and injects defaults. Use `--no-normalize` to disable this auto-normalization.\n\nSupports 8+ evaluator types, including topic routing assertions, action invocation checks, string/numeric assertions, semantic similarity scoring, and LLM-based quality ratings.",
|
|
1631
|
+
"examples": [
|
|
1632
|
+
"Run tests using a YAML test spec on the org with alias \"my-org\":\n<%= config.bin %> <%= command.id %> --spec tests/my-agent-testSpec.yaml --target-org my-org",
|
|
1633
|
+
"Run tests using a YAML spec with explicit agent name override; use your default org:\n<%= config.bin %> <%= command.id %> --spec tests/my-agent-testSpec.yaml --api-name My_Agent --target-org my-org",
|
|
1634
|
+
"Run tests using a JSON payload:\n<%= config.bin %> <%= command.id %> --spec tests/eval-payload.json --target-org my-org",
|
|
1635
|
+
"Run tests and output results in JUnit format; useful for continuous integration and deployment (CI/CD):\n<%= config.bin %> <%= command.id %> --spec tests/my-agent-testSpec.yaml --target-org my-org --result-format junit",
|
|
1636
|
+
"Pipe JSON payload from stdin:\n$ echo '{\"tests\":[...]}' | <%= config.bin %> <%= command.id %> --spec - --target-org my-org"
|
|
1637
|
+
],
|
|
1638
|
+
"flags": {
|
|
1639
|
+
"json": {
|
|
1640
|
+
"description": "Format output as json.",
|
|
1641
|
+
"helpGroup": "GLOBAL",
|
|
1642
|
+
"name": "json",
|
|
1643
|
+
"allowNo": false,
|
|
1644
|
+
"type": "boolean"
|
|
1645
|
+
},
|
|
1646
|
+
"flags-dir": {
|
|
1647
|
+
"helpGroup": "GLOBAL",
|
|
1648
|
+
"name": "flags-dir",
|
|
1649
|
+
"summary": "Import flag values from a directory.",
|
|
1650
|
+
"hasDynamicHelp": false,
|
|
1651
|
+
"multiple": false,
|
|
1652
|
+
"type": "option"
|
|
1653
|
+
},
|
|
1654
|
+
"target-org": {
|
|
1655
|
+
"char": "o",
|
|
1656
|
+
"name": "target-org",
|
|
1657
|
+
"noCacheDefault": true,
|
|
1658
|
+
"required": true,
|
|
1659
|
+
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
1660
|
+
"hasDynamicHelp": true,
|
|
1661
|
+
"multiple": false,
|
|
1662
|
+
"type": "option"
|
|
1663
|
+
},
|
|
1664
|
+
"api-version": {
|
|
1665
|
+
"description": "Override the api version used for api requests made by this command",
|
|
1666
|
+
"name": "api-version",
|
|
1667
|
+
"hasDynamicHelp": false,
|
|
1668
|
+
"multiple": false,
|
|
1669
|
+
"type": "option"
|
|
1670
|
+
},
|
|
1671
|
+
"spec": {
|
|
1672
|
+
"char": "s",
|
|
1673
|
+
"name": "spec",
|
|
1674
|
+
"required": true,
|
|
1675
|
+
"summary": "Path to test spec file (YAML or JSON). Use `-` for stdin.",
|
|
1676
|
+
"hasDynamicHelp": false,
|
|
1677
|
+
"multiple": false,
|
|
1678
|
+
"type": "option"
|
|
1679
|
+
},
|
|
1680
|
+
"api-name": {
|
|
1681
|
+
"char": "n",
|
|
1682
|
+
"name": "api-name",
|
|
1683
|
+
"summary": "Agent DeveloperName (also called API name) to resolve agent_id and agent_version_id. Auto-inferred from the YAML spec's subjectName.",
|
|
1684
|
+
"hasDynamicHelp": false,
|
|
1685
|
+
"multiple": false,
|
|
1686
|
+
"type": "option"
|
|
1687
|
+
},
|
|
1688
|
+
"wait": {
|
|
1689
|
+
"char": "w",
|
|
1690
|
+
"name": "wait",
|
|
1691
|
+
"summary": "Number of minutes to wait for results.",
|
|
1692
|
+
"default": 10,
|
|
1693
|
+
"hasDynamicHelp": false,
|
|
1694
|
+
"multiple": false,
|
|
1695
|
+
"type": "option"
|
|
1696
|
+
},
|
|
1697
|
+
"result-format": {
|
|
1698
|
+
"name": "result-format",
|
|
1699
|
+
"summary": "Format of the agent test run results.",
|
|
1700
|
+
"default": "human",
|
|
1701
|
+
"hasDynamicHelp": false,
|
|
1702
|
+
"multiple": false,
|
|
1703
|
+
"options": [
|
|
1704
|
+
"json",
|
|
1705
|
+
"human",
|
|
1706
|
+
"junit",
|
|
1707
|
+
"tap"
|
|
1708
|
+
],
|
|
1709
|
+
"type": "option"
|
|
1710
|
+
},
|
|
1711
|
+
"batch-size": {
|
|
1712
|
+
"name": "batch-size",
|
|
1713
|
+
"summary": "Number of tests per API request (max 5).",
|
|
1714
|
+
"default": 5,
|
|
1715
|
+
"hasDynamicHelp": false,
|
|
1716
|
+
"multiple": false,
|
|
1717
|
+
"type": "option"
|
|
1718
|
+
},
|
|
1719
|
+
"no-normalize": {
|
|
1720
|
+
"name": "no-normalize",
|
|
1721
|
+
"summary": "Disable auto-normalization of field names and shorthand references.",
|
|
1722
|
+
"allowNo": false,
|
|
1723
|
+
"type": "boolean"
|
|
1724
|
+
}
|
|
1725
|
+
},
|
|
1726
|
+
"hasDynamicHelp": true,
|
|
1727
|
+
"hidden": true,
|
|
1728
|
+
"hiddenAliases": [],
|
|
1729
|
+
"id": "agent:test:run-eval",
|
|
1730
|
+
"pluginAlias": "@salesforce/plugin-agent",
|
|
1731
|
+
"pluginName": "@salesforce/plugin-agent",
|
|
1732
|
+
"pluginType": "core",
|
|
1733
|
+
"state": "beta",
|
|
1734
|
+
"strict": true,
|
|
1735
|
+
"summary": "Run evaluation tests against an Agentforce agent.",
|
|
1736
|
+
"enableJsonFlag": true,
|
|
1737
|
+
"isESM": true,
|
|
1738
|
+
"relativePath": [
|
|
1739
|
+
"lib",
|
|
1740
|
+
"commands",
|
|
1741
|
+
"agent",
|
|
1742
|
+
"test",
|
|
1743
|
+
"run-eval.js"
|
|
1744
|
+
],
|
|
1745
|
+
"aliasPermutations": [],
|
|
1746
|
+
"permutations": [
|
|
1747
|
+
"agent:test:run-eval",
|
|
1748
|
+
"test:agent:run-eval",
|
|
1749
|
+
"test:run-eval:agent",
|
|
1750
|
+
"agent:run-eval:test",
|
|
1751
|
+
"run-eval:agent:test",
|
|
1752
|
+
"run-eval:test:agent"
|
|
1753
|
+
]
|
|
1754
|
+
},
|
|
1627
1755
|
"agent:test:run": {
|
|
1628
1756
|
"aliases": [],
|
|
1629
1757
|
"args": {},
|
|
@@ -1825,5 +1953,5 @@
|
|
|
1825
1953
|
]
|
|
1826
1954
|
}
|
|
1827
1955
|
},
|
|
1828
|
-
"version": "1.
|
|
1956
|
+
"version": "1.31.1"
|
|
1829
1957
|
}
|
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.31.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.29",
|
|
15
|
-
"@salesforce/agents": "^0.
|
|
15
|
+
"@salesforce/agents": "^0.24.1",
|
|
16
16
|
"@salesforce/core": "^8.26.2",
|
|
17
17
|
"@salesforce/kit": "^3.2.4",
|
|
18
18
|
"@salesforce/sf-plugins-core": "^12.2.6",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"yaml": "^2.8.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@oclif/plugin-command-snapshot": "^5.3.
|
|
31
|
+
"@oclif/plugin-command-snapshot": "^5.3.10",
|
|
32
32
|
"@oclif/test": "^4.1.15",
|
|
33
33
|
"@salesforce/cli-plugins-testkit": "^5.3.41",
|
|
34
34
|
"@salesforce/dev-scripts": "^11.0.4",
|
|
35
|
-
"@salesforce/plugin-command-reference": "^3.1.
|
|
35
|
+
"@salesforce/plugin-command-reference": "^3.1.81",
|
|
36
36
|
"@types/inquirer": "^9.0.9",
|
|
37
37
|
"@types/react": "^18.3.3",
|
|
38
38
|
"eslint-config-xo": "^0.50.0",
|
|
@@ -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.31.1.crt",
|
|
244
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-agent/1.31.1.sig"
|
|
245
245
|
}
|
|
246
246
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$ref": "#/definitions/RunEvalResult",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"RunEvalResult": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"tests": {
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"id": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"status": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"evaluations": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": {}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"required": ["id", "status", "evaluations"],
|
|
25
|
+
"additionalProperties": false
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"summary": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"passed": {
|
|
32
|
+
"type": "number"
|
|
33
|
+
},
|
|
34
|
+
"failed": {
|
|
35
|
+
"type": "number"
|
|
36
|
+
},
|
|
37
|
+
"scored": {
|
|
38
|
+
"type": "number"
|
|
39
|
+
},
|
|
40
|
+
"errors": {
|
|
41
|
+
"type": "number"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": ["passed", "failed", "scored", "errors"],
|
|
45
|
+
"additionalProperties": false
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"required": ["tests", "summary"],
|
|
49
|
+
"additionalProperties": false
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|