From 0302b4596e14210884df5d645df9a179d8f0c1c6 Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 5 Feb 2026 00:48:38 +0000 Subject: Add multi-repository support for chains Chains can now have multiple repositories attached, with one marked as primary. Repositories are used by contracts created from chain definitions. Backend changes: - Add chain_repositories table migration - Add ChainRepository model with CRUD operations - Add API endpoints for listing, adding, deleting repositories - Add endpoint to set a repository as primary - Update Chain and ChainEditorData models to use repositories - Update chain parser to support repositories in YAML format - Remove deprecated repository_url/local_path from Chain Frontend changes: - Add ChainRepository interface and API functions - Add repository section to ChainEditor showing attached repos - Add modal for adding new repositories (remote or local) - Support setting primary repository and removing repositories Co-Authored-By: Claude Opus 4.5 --- makima/src/server/mod.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'makima/src/server/mod.rs') diff --git a/makima/src/server/mod.rs b/makima/src/server/mod.rs index 5dde099..f6d2eda 100644 --- a/makima/src/server/mod.rs +++ b/makima/src/server/mod.rs @@ -245,6 +245,19 @@ pub fn make_router(state: SharedState) -> Router { // Chain control .route("/chains/{id}/start", post(chains::start_chain)) .route("/chains/{id}/stop", post(chains::stop_chain)) + // Chain repositories + .route( + "/chains/{id}/repositories", + get(chains::list_chain_repositories).post(chains::add_chain_repository), + ) + .route( + "/chains/{chain_id}/repositories/{repository_id}", + axum::routing::delete(chains::delete_chain_repository), + ) + .route( + "/chains/{chain_id}/repositories/{repository_id}/primary", + put(chains::set_chain_repository_primary), + ) // Contract type templates (built-in only) .route("/contract-types", get(templates::list_contract_types)) // Settings endpoints -- cgit v1.2.3