feat: add browser script skill execution
This commit is contained in:
17
third_party/zeroclaw/src/tools/read_skill.rs
vendored
17
third_party/zeroclaw/src/tools/read_skill.rs
vendored
@@ -168,6 +168,23 @@ pub async fn read_skill_bundle(location: &Path) -> std::io::Result<String> {
|
||||
&mut pending,
|
||||
);
|
||||
|
||||
if location.file_name().and_then(|name| name.to_str()) == Some("SKILL.toml") {
|
||||
let sibling_markdown = skill_root.join("SKILL.md");
|
||||
if sibling_markdown.exists() {
|
||||
if let Ok(markdown) = tokio::fs::read_to_string(&sibling_markdown).await {
|
||||
output.push_str("\n\n## Referenced File: SKILL.md\n\n");
|
||||
output.push_str(&markdown);
|
||||
enqueue_reference_paths(
|
||||
&markdown,
|
||||
sibling_markdown.parent().unwrap_or(skill_root.as_path()),
|
||||
&skill_root,
|
||||
&mut queued,
|
||||
&mut pending,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while let Some(path) = pending.pop_front() {
|
||||
let canonical = path.canonicalize().unwrap_or(path.clone());
|
||||
if !canonical.starts_with(&skill_root) || !appended.insert(canonical.clone()) {
|
||||
|
||||
Reference in New Issue
Block a user