1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! Plugin system for ZeptoClaw
//!
//! This module provides a plugin system that allows loading tools from external
//! JSON-defined command plugins. Each plugin is a directory containing a
//! `plugin.json` manifest and optional scripts. Plugins wrap shell commands
//! with parameter interpolation, making it easy to extend ZeptoClaw's tool
//! set without writing Rust code.
//!
//! # Architecture
//!
//! - **types**: Core data structures (`PluginManifest`, `PluginToolDef`, `Plugin`, `PluginConfig`)
//! - **loader**: Plugin discovery, loading, and manifest validation
//! - **registry**: Plugin and tool registration with conflict detection
//!
//! # Plugin Directory Structure
//!
//! ```text
//! ~/.zeptoclaw/plugins/
//! ├── git-tools/
//! │ └── plugin.json
//! ├── docker-tools/
//! │ ├── plugin.json
//! │ └── scripts/
//! │ └── helper.sh
//! └── custom-tool/
//! └── plugin.json
//! ```
//!
//! # Example plugin.json
//!
//! ```json
//! {
//! "name": "git-tools",
//! "version": "1.0.0",
//! "description": "Git integration tools",
//! "author": "ZeptoClaw",
//! "tools": [
//! {
//! "name": "git_status",
//! "description": "Get the git status of the workspace",
//! "parameters": {
//! "type": "object",
//! "properties": {
//! "path": { "type": "string", "description": "Repository path" }
//! },
//! "required": ["path"]
//! },
//! "command": "git -C {{path}} status --porcelain",
//! "timeout_secs": 10
//! }
//! ]
//! }
//! ```
//!
//! # Usage
//!
//! ```rust,no_run
//! use std::path::PathBuf;
//! use zeptoclaw::plugins::{discover_plugins, PluginRegistry};
//!
//! let dirs = vec![PathBuf::from("/home/user/.zeptoclaw/plugins")];
//! let plugins = discover_plugins(&dirs).unwrap();
//!
//! let mut registry = PluginRegistry::new();
//! for plugin in plugins {
//! registry.register(plugin).unwrap();
//! }
//!
//! println!("Loaded {} plugins with {} tools", registry.plugin_count(), registry.tool_count());
//! ```
pub use ;
pub use PluginRegistry;
pub use ;
pub use ;