@chrysb/alphaclaw 0.9.1-beta.0 → 0.9.2
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.
|
@@ -109,7 +109,13 @@ const fetchLatestVersionFromRegistry = async ({ fetchImpl }) => {
|
|
|
109
109
|
response,
|
|
110
110
|
"Failed to fetch latest AlphaClaw version",
|
|
111
111
|
);
|
|
112
|
-
|
|
112
|
+
const latestVersion = normalizeVersion(data?.["dist-tags"]?.latest);
|
|
113
|
+
const latestOpenclawVersion = latestVersion
|
|
114
|
+
? normalizeOpenclawVersion(
|
|
115
|
+
data?.versions?.[latestVersion]?.dependencies?.openclaw,
|
|
116
|
+
)
|
|
117
|
+
: null;
|
|
118
|
+
return { latestVersion, latestOpenclawVersion };
|
|
113
119
|
};
|
|
114
120
|
|
|
115
121
|
const fetchTemplatePackageVersions = async ({
|
|
@@ -134,7 +140,14 @@ const fetchTemplatePackageVersions = async ({
|
|
|
134
140
|
response,
|
|
135
141
|
"Could not fetch the deployment template metadata",
|
|
136
142
|
);
|
|
137
|
-
|
|
143
|
+
const versions = extractTemplateVersions(data);
|
|
144
|
+
if (!versions.latestOpenclawVersion && versions.latestVersion) {
|
|
145
|
+
try {
|
|
146
|
+
const registry = await fetchLatestVersionFromRegistry({ fetchImpl });
|
|
147
|
+
versions.latestOpenclawVersion = registry.latestOpenclawVersion || null;
|
|
148
|
+
} catch {}
|
|
149
|
+
}
|
|
150
|
+
return versions;
|
|
138
151
|
};
|
|
139
152
|
|
|
140
153
|
const fetchTemplateHeadRef = async ({
|
|
@@ -396,9 +409,10 @@ const createAlphaclawVersionService = ({
|
|
|
396
409
|
) {
|
|
397
410
|
return kRegistryStatusCache;
|
|
398
411
|
}
|
|
399
|
-
const
|
|
412
|
+
const registry = await fetchLatestVersionFromRegistry({ fetchImpl });
|
|
400
413
|
kRegistryStatusCache = {
|
|
401
|
-
latestVersion,
|
|
414
|
+
latestVersion: registry.latestVersion,
|
|
415
|
+
latestOpenclawVersion: registry.latestOpenclawVersion,
|
|
402
416
|
fetchedAt: Date.now(),
|
|
403
417
|
};
|
|
404
418
|
return kRegistryStatusCache;
|
|
@@ -614,6 +628,7 @@ const createAlphaclawVersionService = ({
|
|
|
614
628
|
return buildVersionStatus({
|
|
615
629
|
strategy,
|
|
616
630
|
latestVersion: status.latestVersion,
|
|
631
|
+
latestOpenclawVersion: status.latestOpenclawVersion,
|
|
617
632
|
});
|
|
618
633
|
} catch (err) {
|
|
619
634
|
const cachedTemplateStatus = strategy.templateRepoUrl
|
|
@@ -625,7 +640,9 @@ const createAlphaclawVersionService = ({
|
|
|
625
640
|
strategy,
|
|
626
641
|
latestVersion:
|
|
627
642
|
cachedTemplateStatus.latestVersion || kRegistryStatusCache.latestVersion,
|
|
628
|
-
latestOpenclawVersion:
|
|
643
|
+
latestOpenclawVersion:
|
|
644
|
+
cachedTemplateStatus.latestOpenclawVersion ||
|
|
645
|
+
kRegistryStatusCache.latestOpenclawVersion,
|
|
629
646
|
ok: false,
|
|
630
647
|
error: err.message || "Failed to fetch latest AlphaClaw version",
|
|
631
648
|
});
|