create-loopengine 0.1.38 → 0.1.39
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/package.json +1 -1
- package/template/adapters/http.ts +10 -2
package/package.json
CHANGED
|
@@ -102,6 +102,7 @@ import {
|
|
|
102
102
|
installAbility,
|
|
103
103
|
upgradeAbility,
|
|
104
104
|
listInstalledAbilities,
|
|
105
|
+
backfillDependencies,
|
|
105
106
|
AbilityAlreadyInstalledError,
|
|
106
107
|
AbilityCollisionError,
|
|
107
108
|
AbilityManifestError,
|
|
@@ -1033,9 +1034,16 @@ async function handleAbilitiesGet(res: ServerResponse, agentName: string): Promi
|
|
|
1033
1034
|
const installed = listInstalledAbilities(agentName)
|
|
1034
1035
|
const abilities = await Promise.all(
|
|
1035
1036
|
installed.map(async (a) => {
|
|
1037
|
+
// a.dependencies is only ever undefined for a record from before
|
|
1038
|
+
// that field existed — backfillDependencies re-derives and
|
|
1039
|
+
// persists it once rather than this route silently treating
|
|
1040
|
+
// "never recorded" the same as "confirmed zero", which would
|
|
1041
|
+
// otherwise permanently hide "Install deps" for an ability that
|
|
1042
|
+
// genuinely still needs something.
|
|
1043
|
+
const dependencies = a.dependencies !== undefined ? a.dependencies : ((await backfillDependencies(agentName, a.name)) ?? [])
|
|
1036
1044
|
const latestVersion = await fetchLatestAbilityVersion(a.name)
|
|
1037
|
-
const missingDependencies =
|
|
1038
|
-
return { ...a, latestVersion, upToDate: latestVersion !== null && latestVersion === a.version, missingDependencies }
|
|
1045
|
+
const missingDependencies = dependencies.filter((dep) => !hasNodeModule(dep))
|
|
1046
|
+
return { ...a, dependencies, latestVersion, upToDate: latestVersion !== null && latestVersion === a.version, missingDependencies }
|
|
1039
1047
|
}),
|
|
1040
1048
|
)
|
|
1041
1049
|
res.writeHead(200, { 'content-type': 'application/json' }).end(JSON.stringify({ abilities }))
|