@wix/evalforge-evaluator 0.185.0 → 0.186.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/build/index.js +22 -6
- package/build/index.js.map +2 -2
- package/build/index.mjs +22 -6
- package/build/index.mjs.map +2 -2
- package/package.json +2 -2
package/build/index.mjs
CHANGED
|
@@ -6821,21 +6821,37 @@ function createApiClient(serverUrl, options = "") {
|
|
|
6821
6821
|
// The legacy REST endpoint enriched the capability with its latest version
|
|
6822
6822
|
// server-side; ambassador's GetCapability returns the bare entity, so we
|
|
6823
6823
|
// compose it with GetLatestCapabilityVersion in parallel here.
|
|
6824
|
+
//
|
|
6825
|
+
// The latest-version fetch is BEST-EFFORT: a failure must not drop the whole
|
|
6826
|
+
// capability. Otherwise one broken snapshot fetch makes the capability (e.g.
|
|
6827
|
+
// an MCP) silently vanish from the run. Runs that pin a version still resolve
|
|
6828
|
+
// their content via getCapabilityVersion downstream.
|
|
6824
6829
|
async getCapability(projectId2, id) {
|
|
6825
|
-
const [
|
|
6830
|
+
const [capResult, versionResult] = await Promise.allSettled([
|
|
6826
6831
|
httpClient.request(getCapability({ projectId: projectId2, capabilityId: id })),
|
|
6827
6832
|
httpClient.request(
|
|
6828
6833
|
getLatestCapabilityVersion({ projectId: projectId2, capabilityId: id })
|
|
6829
6834
|
)
|
|
6830
6835
|
]);
|
|
6831
|
-
|
|
6836
|
+
if (capResult.status === "rejected") {
|
|
6837
|
+
throw capResult.reason;
|
|
6838
|
+
}
|
|
6839
|
+
const capability = capResult.value.data.capability;
|
|
6832
6840
|
if (!capability) {
|
|
6833
6841
|
throw new Error(`Capability ${id} not found in project ${projectId2}`);
|
|
6834
6842
|
}
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6843
|
+
let latestVersion;
|
|
6844
|
+
if (versionResult.status === "fulfilled" && versionResult.value.data.capabilityVersion) {
|
|
6845
|
+
latestVersion = capabilityVersionFromProto(
|
|
6846
|
+
versionResult.value.data.capabilityVersion,
|
|
6847
|
+
projectId2
|
|
6848
|
+
);
|
|
6849
|
+
} else if (versionResult.status === "rejected") {
|
|
6850
|
+
const reason = versionResult.reason instanceof Error ? versionResult.reason.message : String(versionResult.reason);
|
|
6851
|
+
console.warn(
|
|
6852
|
+
`[Capabilities] getLatestCapabilityVersion(${id}) failed; loading capability without a snapshot (pinned versions still resolve): ${reason}`
|
|
6853
|
+
);
|
|
6854
|
+
}
|
|
6839
6855
|
return { ...capabilityFromProto(capability), latestVersion };
|
|
6840
6856
|
},
|
|
6841
6857
|
async getCapabilityVersion(projectId2, capabilityId, versionId) {
|