@@ -31,7 +31,7 @@ pub fn list_tools() -> Vec<ToolDefinition> {
3131 All relations have a `state` column ('desired' | 'actual') for \
3232 set-differencing. Use $ws to reference the current workspace. \
3333 Relations: context, context_dep, entity, service, service_dep, event, \
34- value_object, repository, invariant, field, method, method_param, vo_rule."
34+ value_object, repository, module, invariant, field, method, method_param, vo_rule."
3535 . into( ) ,
3636 input_schema: json!( {
3737 "type" : "object" ,
@@ -246,6 +246,12 @@ pub fn build_model_overview(store: &Store, workspace: &str, state: &str) -> Valu
246246 workspace,
247247 ) . unwrap_or_default ( ) ;
248248
249+ let modules = store. run_datalog (
250+ & format ! ( "?[ctx, name, path, public, file_path, description] := \
251+ *module{{workspace: $ws, context: ctx, name, state: '{state}', path, public, file_path, description}}") ,
252+ workspace,
253+ ) . unwrap_or_default ( ) ;
254+
249255 // Assemble per-context JSON
250256 let bc_json: Vec < Value > = contexts. iter ( ) . map ( |ctx_row| {
251257 let ctx_name = & ctx_row[ 0 ] ;
@@ -349,7 +355,12 @@ pub fn build_model_overview(store: &Store, workspace: &str, state: &str) -> Valu
349355 json ! ( {
350356 "name" : ctx_name, "description" : ctx_row[ 1 ] , "module" : ctx_row[ 2 ] ,
351357 "entities" : ctx_entities, "services" : ctx_services, "events" : ctx_events,
352- "value_objects" : ctx_vos, "repositories" : ctx_repos, "depends_on" : deps,
358+ "value_objects" : ctx_vos, "repositories" : ctx_repos,
359+ "modules" : modules. iter( )
360+ . filter( |m| m[ 0 ] == * ctx_name)
361+ . map( |m| json!( { "name" : m[ 1 ] , "path" : m[ 2 ] , "public" : m[ 3 ] == "true" , "file_path" : m[ 4 ] , "description" : m[ 5 ] } ) )
362+ . collect:: <Vec <Value >>( ) ,
363+ "depends_on" : deps,
353364 } )
354365 } ) . collect ( ) ;
355366
0 commit comments