Skip to main content

ai_agent/utils/plugins/
walk_plugin_markdown.rs

1// Source: ~/claudecode/openclaudecode/src/utils/plugins/walkPluginMarkdown.ts
2#![allow(dead_code)]
3
4use std::path::Path;
5
6/// Options for walking a plugin directory.
7#[derive(Debug, Clone, Default)]
8pub struct WalkPluginMarkdownOpts {
9    pub stop_at_skill_dir: Option<bool>,
10    pub log_label: Option<String>,
11}
12
13/// Error type for walk_plugin_markdown operations.
14#[derive(Debug)]
15pub struct WalkPluginMarkdownError {
16    pub message: String,
17    pub path: String,
18}
19
20impl std::fmt::Display for WalkPluginMarkdownError {
21    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22        write!(
23            f,
24            "walk_plugin_markdown error at {}: {}",
25            self.path, self.message
26        )
27    }
28}
29
30impl std::error::Error for WalkPluginMarkdownError {}
31
32/// Recursively walk a plugin directory, invoking on_file for each .md file.
33/// Stub implementation - full implementation would recursively scan directories.
34pub async fn walk_plugin_markdown<F, Fut>(
35    _root_dir: &Path,
36    _on_file: F,
37    _opts: WalkPluginMarkdownOpts,
38) -> std::io::Result<()>
39where
40    F: Fn(String, Vec<String>) -> Fut + Send + Sync + Clone,
41    Fut: std::future::Future<Output = ()> + Send,
42{
43    // Stub: simplified implementation
44    Ok(())
45}