Skip to main content

convergio_types/
manifest.rs

1//! Semantic manifest — every extension declares what it is, provides, and requires.
2
3/// What kind of module this is.
4#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
5pub enum ModuleKind {
6    /// Core infrastructure — must always be present.
7    Core,
8    /// Platform service — orchestration layer.
9    Platform,
10    /// Pluggable extension — optional, can be added/removed.
11    Extension,
12    /// External integration — registered via HTTP bridge.
13    Integration,
14}
15
16/// The manifest — identity + capabilities + dependencies.
17#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
18pub struct Manifest {
19    /// Unique identifier (e.g. "convergio-mesh").
20    pub id: String,
21    /// Human and LLM readable description.
22    pub description: String,
23    /// SemVer version.
24    pub version: String,
25    /// Classification.
26    pub kind: ModuleKind,
27    /// What this module provides to the system.
28    pub provides: Vec<Capability>,
29    /// What this module requires from the system.
30    pub requires: Vec<Dependency>,
31    /// Tools that agents can invoke through this module.
32    pub agent_tools: Vec<ToolSpec>,
33    /// Node roles that must include this extension.
34    /// Empty = loaded on ALL roles (infrastructure/platform).
35    #[serde(default)]
36    pub required_roles: Vec<String>,
37}
38
39/// A capability provided by a module.
40#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
41pub struct Capability {
42    /// Capability name (e.g. "peer-sync").
43    pub name: String,
44    /// SemVer version of this capability.
45    pub version: String,
46    /// What it does — for routing and LLM reasoning.
47    pub description: String,
48}
49
50/// A dependency required by a module.
51#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
52pub struct Dependency {
53    /// Required capability name.
54    pub capability: String,
55    /// SemVer version requirement (e.g. ">=2.0, <3.0").
56    pub version_req: String,
57    /// If false, the module degrades gracefully when this is absent.
58    pub required: bool,
59}
60
61/// A tool that agents can invoke.
62#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
63pub struct ToolSpec {
64    pub name: String,
65    pub description: String,
66    pub parameters_schema: serde_json::Value,
67}