Skip to content

Commit 429a370

Browse files
committed
feat: wire modules into show_model output
- Query module relation and include modules array per bounded context - Add module to query_model documented relations list - Bump version to 0.1.6
1 parent 63ffaaa commit 429a370

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.dendrites/store.db

-328 KB
Binary file not shown.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dendrites"
3-
version = "0.1.5"
3+
version = "0.1.6"
44
edition = "2024"
55
description = "Domain Model Context Protocol Server - Architectural meta-layer for GitHub Copilot"
66
license = "MIT"

src/mcp/tools.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)