fix(agent-packages): show local inventory before refresh

This commit is contained in:
mesalogo
2026-10-14 00:53:23 +08:00
parent 3ba1ef305d
commit a63060e097
10 changed files with 85 additions and 20 deletions
@@ -300,6 +300,17 @@ export class AgentPackageManager {
})
}
async getAllInventory(options: { refresh?: boolean } = {}): Promise<AgentPackageInventory> {
const linux = await this.forPlatform('linux').getInventory(options)
const darwin = this.forPlatform('darwin')
darwin.#catalogState = this.forPlatform('linux').#catalogState
const mac = await darwin.getInventory(options)
return agentPackageInventorySchema.parse({
...linux,
entries: [...linux.entries, ...mac.entries]
})
}
#select(catalog: AgentPackageCatalog, architecture: AgentArchitecture, desktopVersion: string) {
return selectLatestCompatibleEntry(catalog, architecture, desktopVersion, this.#platform)
}