Skip to main content

Module modules

Module modules 

Source
Expand description

§Module System

Extensible module system for Driven that allows custom agents, workflows, templates, and resources to be packaged and shared.

§Features

  • Module installation from path or URL
  • Dependency resolution and version management
  • Resource isolation to prevent conflicts
  • DX LLM format manifests

§Module Manifest Format

Modules are defined using DX LLM format in a module.dx file:

# My Custom Module
id|my-module
nm|My Custom Module
v|1.0.0
desc|A custom module for specialized workflows
author|Your Name
license|MIT

# Dependencies
dep.base-module|^1.0.0

# Resources
agent.0|custom-agent
workflow.0|custom-workflow
template.0|custom-template

§Example Usage

use driven::modules::{ModuleManager, Module};

// Create a module manager
let mut manager = ModuleManager::new(".driven/modules");

// Load existing modules
manager.load()?;

// Install a new module
manager.install(Path::new("./my-module"))?;

// List installed modules
for module in manager.list_installed() {
    println!("{}: {} v{}", module.id, module.name, module.version);
}

// Get all agents from installed modules (namespaced)
let agents = manager.get_all_agents();
// Returns: ["my-module:custom-agent", ...]

§Resource Isolation

When isolation is enabled (default), all module resources are namespaced with the module ID to prevent conflicts:

  • Agent my-agent in module my-module becomes my-module:my-agent
  • Workflow my-flow in module my-module becomes my-module:my-flow

§Dependency Resolution

The module system supports:

  • Exact version matching: 1.0.0
  • Caret requirements: ^1.0.0 (compatible with major version)
  • Tilde requirements: ~1.0.0 (compatible with minor version)
  • Wildcard: * (any version)
  • Optional dependencies: marked with optional: true

Structs§

Module
A Driven module containing agents, workflows, templates, and resources
ModuleDependency
A module dependency with version requirement
ModuleManager
Module manager for installing, updating, and managing modules

Enums§

ModuleStatus
Module installation status