Skip to content

Commit 19f6b23

Browse files
akoclaude
andcommitted
feat: include agent-editor documents in DESCRIBE MODULE WITH ALL
DESCRIBE MODULE <name> WITH ALL now emits CREATE MODEL, CREATE KNOWLEDGE BASE, CREATE CONSUMED MCP SERVICE, and CREATE AGENT statements for the module's agent-editor documents. Emission order follows referential dependencies: Model / Knowledge Base / Consumed MCP Service first (leaves), Agent last since its body may reference any of the other three via its TOOL / KNOWLEDGE BASE / MCP SERVICE blocks. Verified against test3 project: - DESCRIBE MODULE Agents WITH ALL now includes MyFirstModel, Knowledge_base, Consumed_MCP_service, and Agent007 (with its MCP + KB blocks) - DESCRIBE MODULE AgentEditorCommons WITH ALL includes the 4 older agent samples Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fbc0d4c commit 19f6b23

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

mdl/executor/cmd_modules.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,47 @@ func (e *Executor) describeModule(moduleName string, withAll bool) error {
756756
}
757757
}
758758

759+
// Output agent-editor documents. Order matches referential dependencies:
760+
// Model / KnowledgeBase / ConsumedMCPService first (leaves), Agent last
761+
// (may reference the others via its TOOL / KNOWLEDGE BASE / MCP SERVICE
762+
// blocks).
763+
if models, err := e.reader.ListAgentEditorModels(); err == nil {
764+
for _, m := range models {
765+
if moduleContainers[m.ContainerID] {
766+
if err := e.describeAgentEditorModel(ast.QualifiedName{Module: moduleName, Name: m.Name}); err == nil {
767+
fmt.Fprintln(e.output)
768+
}
769+
}
770+
}
771+
}
772+
if kbs, err := e.reader.ListAgentEditorKnowledgeBases(); err == nil {
773+
for _, kb := range kbs {
774+
if moduleContainers[kb.ContainerID] {
775+
if err := e.describeAgentEditorKnowledgeBase(ast.QualifiedName{Module: moduleName, Name: kb.Name}); err == nil {
776+
fmt.Fprintln(e.output)
777+
}
778+
}
779+
}
780+
}
781+
if svcs, err := e.reader.ListAgentEditorConsumedMCPServices(); err == nil {
782+
for _, svc := range svcs {
783+
if moduleContainers[svc.ContainerID] {
784+
if err := e.describeAgentEditorConsumedMCPService(ast.QualifiedName{Module: moduleName, Name: svc.Name}); err == nil {
785+
fmt.Fprintln(e.output)
786+
}
787+
}
788+
}
789+
}
790+
if agents, err := e.reader.ListAgentEditorAgents(); err == nil {
791+
for _, a := range agents {
792+
if moduleContainers[a.ContainerID] {
793+
if err := e.describeAgentEditorAgent(ast.QualifiedName{Module: moduleName, Name: a.Name}); err == nil {
794+
fmt.Fprintln(e.output)
795+
}
796+
}
797+
}
798+
}
799+
759800
fmt.Fprintln(e.output, "/")
760801
return nil
761802
}

0 commit comments

Comments
 (0)