类 Skills
java.lang.Object
com.agentsflex.skill.util.Skills
- 作者:
- Christian Tzolov, Micahel Yang
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private static StringderiveBasePathFromUrl(URL skillUrl) Derives the JAR-internal base path from a resource URL by stripping the SKILL.md filename and thejar:file:...!/prefix.loadDirectories(List<String> rootDirectories) loadDirectory(String rootDirectory) Recursively finds all SKILL.md files in the given root directory and returns their parsed contents.private static SkillparseSkill(InputStream is, String entryPath) Parses a SKILL.md file from an input stream into aSkill.scanClasspathJarsForSkills(String classpathPrefix) Scans all classpath JARs for SKILL.md files under the given prefix.scanJarForSkills(JarFile jarFile, String entryPrefix) Scans a single JAR file for SKILL.md entries under the given prefix.
-
构造器详细资料
-
Skills
public Skills()
-
-
方法详细资料
-
loadDirectories
-
loadDirectory
Recursively finds all SKILL.md files in the given root directory and returns their parsed contents.- 参数:
rootDirectory- the root directory to search for SKILL.md files- 返回:
- a list of Skill objects containing the basePath, front-matter, and content of each SKILL.md file
- 抛出:
RuntimeException- if an I/O error occurs while reading the directory or files
-
scanClasspathJarsForSkills
Scans all classpath JARs for SKILL.md files under the given prefix. Discovers JARs viaClassLoader.getResources("META-INF/MANIFEST.MF")— a technique used by Spring internally when standard classpath resolution is insufficient.- 抛出:
IOException
-
scanJarForSkills
Scans a single JAR file for SKILL.md entries under the given prefix.- 参数:
jarFile- the JAR to scanentryPrefix- the entry prefix to match (must end with '/')- 返回:
- a list of Skill objects found in this JAR
- 抛出:
IOException
-
parseSkill
Parses a SKILL.md file from an input stream into aSkill.- 参数:
is- the input stream containing the SKILL.md markdown contententryPath- the JAR entry path — used to derive the base directory- 抛出:
IOException
-
deriveBasePathFromUrl
Derives the JAR-internal base path from a resource URL by stripping the SKILL.md filename and thejar:file:...!/prefix.
-