feat: add browser script skill execution

This commit is contained in:
zyl
2026-03-30 02:15:07 +08:00
parent f7e2ff256e
commit d2c9902966
22 changed files with 1775 additions and 249 deletions

View File

@@ -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()) {