feat: add index-aware recipe resolution with repo support

- fetch_recipe_from_repos() iterates repos by priority, channels, with
  mirror fallback — caches indexes at /cache/indexes/

- Conditional HTTP downloads (curl -z) to only re-fetch stale indexes

- build_registry and fetch-package prefer repos { } over remotes = [...]
  when both are present

- Fallback chain: local .kap → repos (index-aware) → remotes (legacy)
This commit is contained in:
2026-08-04 13:50:29 -04:00
parent 4f1ce17ec8
commit 7b0538c392
3 changed files with 267 additions and 2 deletions
+7
View File
@@ -1,5 +1,7 @@
#pragma once
#include "kappa/dsl/system.hpp"
#include <string>
#include <vector>
@@ -13,7 +15,12 @@ struct RecipeResult {
std::string error;
};
// Legacy: flat URL list (backward compat with remotes = [...])
RecipeResult fetch_recipe(const std::string& name,
const std::vector<std::string>& remotes);
// Index-aware: named repos with channels, mirrors, and cached indexes
RecipeResult fetch_recipe_from_repos(const std::string& name,
const std::vector<dsl::RepoDef>& repos);
} // namespace kappa::fetch