diff options
Diffstat (limited to 'makima/src/server/mod.rs')
| -rw-r--r-- | makima/src/server/mod.rs | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/makima/src/server/mod.rs b/makima/src/server/mod.rs index e5b55e7..927e9a5 100644 --- a/makima/src/server/mod.rs +++ b/makima/src/server/mod.rs @@ -18,7 +18,7 @@ use tower_http::trace::TraceLayer; use utoipa::OpenApi; use utoipa_swagger_ui::SwaggerUi; -use crate::server::handlers::{api_keys, chains, chat, contract_chat, contract_daemon, contract_discuss, contracts, file_ws, files, history, listen, mesh, mesh_chat, mesh_daemon, mesh_merge, mesh_supervisor, mesh_ws, repository_history, speak, templates, transcript_analysis, users, versions}; +use crate::server::handlers::{api_keys, chat, contract_chat, contract_daemon, contract_discuss, contracts, directives, file_ws, files, history, listen, mesh, mesh_chat, mesh_daemon, mesh_merge, mesh_supervisor, mesh_ws, repository_history, speak, templates, transcript_analysis, users, versions}; use crate::server::openapi::ApiDoc; use crate::server::state::SharedState; @@ -214,51 +214,55 @@ pub fn make_router(state: SharedState) -> Router { ) // Timeline endpoint (unified history for user) .route("/timeline", get(history::get_timeline)) - // Chain endpoints (multi-contract orchestration) + // Directive endpoints (replacement for chains) .route( - "/chains", - get(chains::list_chains).post(chains::create_chain), + "/directives", + get(directives::list_directives).post(directives::create_directive), ) - .route("/chains/init", post(chains::init_chain)) .route( - "/chains/{id}", - get(chains::get_chain) - .put(chains::update_chain) - .delete(chains::delete_chain), + "/directives/{id}", + get(directives::get_directive) + .put(directives::update_directive) + .delete(directives::archive_directive), ) - .route("/chains/{id}/contracts", get(chains::get_chain_contracts)) - .route("/chains/{id}/graph", get(chains::get_chain_graph)) - .route("/chains/{id}/events", get(chains::get_chain_events)) - .route("/chains/{id}/editor", get(chains::get_chain_editor)) - // Chain contract definitions + .route("/directives/{id}/start", post(directives::start_directive)) + .route("/directives/{id}/pause", post(directives::pause_directive)) + .route("/directives/{id}/resume", post(directives::resume_directive)) + .route("/directives/{id}/stop", post(directives::stop_directive)) + // Directive chain management + .route("/directives/{id}/chain", get(directives::get_chain)) + .route("/directives/{id}/chain/graph", get(directives::get_chain_graph)) + .route("/directives/{id}/chain/replan", post(directives::replan_chain)) + // Directive step management .route( - "/chains/{id}/definitions", - get(chains::list_chain_definitions).post(chains::create_chain_definition), + "/directives/{id}/chain/steps", + post(directives::add_step), ) .route( - "/chains/{chain_id}/definitions/{definition_id}", - put(chains::update_chain_definition).delete(chains::delete_chain_definition), + "/directives/{id}/chain/steps/{step_id}", + get(directives::get_step) + .put(directives::update_step) + .delete(directives::delete_step), ) + .route("/directives/{id}/chain/steps/{step_id}/skip", post(directives::skip_step)) + // Directive evaluations + .route("/directives/{id}/evaluations", get(directives::list_evaluations)) + // Directive events + .route("/directives/{id}/events", get(directives::list_events)) + .route("/directives/{id}/events/stream", get(directives::stream_events)) + // Directive verifiers .route( - "/chains/{id}/definitions/graph", - get(chains::get_chain_definition_graph), + "/directives/{id}/verifiers", + get(directives::list_verifiers).post(directives::add_verifier), ) - // 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), + "/directives/{id}/verifiers/{verifier_id}", + axum::routing::put(directives::update_verifier), ) + // Directive approvals + .route("/directives/{id}/approvals", get(directives::list_approvals)) + .route("/directives/{id}/approvals/{approval_id}/approve", post(directives::approve_request)) + .route("/directives/{id}/approvals/{approval_id}/deny", post(directives::deny_request)) // Contract type templates (built-in only) .route("/contract-types", get(templates::list_contract_types)) // Settings endpoints |
