From 9753504717bd5d37a3ddbdeed667dc0aa6c7a9c6 Mon Sep 17 00:00:00 2001 From: David Hagerty Date: Mon, 9 Feb 2026 10:43:10 -0500 Subject: [PATCH] refactor: clean up modules for v2 compatibility, add v2 tool registry factory --- src/graph/export.rs | 3 ++- src/graph/interchange.rs | 7 +++++-- src/tools/factory.rs | 29 +++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/graph/export.rs b/src/graph/export.rs index 1f31815..ae89d10 100644 --- a/src/graph/export.rs +++ b/src/graph/export.rs @@ -74,7 +74,8 @@ async fn generate_adr_markdown( // Separate edges by type for efficient lookup let mut option_edges = Vec::new(); - let mut status_edges_map: std::collections::HashMap> = std::collections::HashMap::new(); + let mut status_edges_map: std::collections::HashMap> = + std::collections::HashMap::new(); for (edge, node) in &all_edges { if edge.edge_type == crate::graph::EdgeType::LeadsTo { diff --git a/src/graph/interchange.rs b/src/graph/interchange.rs index 0a29dd8..c40f74c 100644 --- a/src/graph/interchange.rs +++ b/src/graph/interchange.rs @@ -463,8 +463,11 @@ fn detect_node_changes(db_node: &GraphNode, toml_node: &TomlNode) -> Result, + permission_handler: Arc, + graph_store: Arc, +) -> ToolRegistry { + let registry = create_default_registry(validator, permission_handler); + + // Register graph tools + registry.register(Arc::new(CreateNodeTool::new(graph_store.clone()))); + registry.register(Arc::new(UpdateNodeTool::new(graph_store.clone()))); + registry.register(Arc::new(AddEdgeTool::new(graph_store.clone()))); + registry.register(Arc::new(QueryNodesTool::new(graph_store.clone()))); + registry.register(Arc::new(SearchNodesTool::new(graph_store.clone()))); + registry.register(Arc::new(ClaimTaskTool::new(graph_store.clone()))); + registry.register(Arc::new(LogDecisionTool::new(graph_store.clone()))); + registry.register(Arc::new(ChooseOptionTool::new(graph_store.clone()))); + registry.register(Arc::new(RecordOutcomeTool::new(graph_store.clone()))); + registry.register(Arc::new(RecordObservationTool::new(graph_store.clone()))); + registry.register(Arc::new(RevisitTool::new(graph_store))); + + registry +} -- 2.51.2