Interface SkillSource
- All Known Implementing Classes:
AbstractSkillSource, InMemorySkillSource, LocalSkillSource
All operations are asynchronous and communicate failures reactively through the returned
Single error channel (terminating with onError), rather than throwing exceptions
synchronously. Implementation must use the SkillSourceException for propagating error
message back to the LLM.
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<com.google.common.collect.ImmutableMap<String, Frontmatter>> Lists all availableFrontmatters for discovered skills.io.reactivex.rxjava3.core.Single<com.google.common.collect.ImmutableList<String>> listResources(String skillName, String resourceDirectory) Lists all resource files for a specific skill within a given directory.io.reactivex.rxjava3.core.Single<Frontmatter> loadFrontmatter(String skillName) Loads theFrontmatterfor a specific skill.io.reactivex.rxjava3.core.Single<String> loadInstructions(String skillName) Loads the instructions (body of SKILL.md) for a specific skill.io.reactivex.rxjava3.core.Single<com.google.common.io.ByteSource> loadResource(String skillName, String resourcePath) Loads a specific resource file content.
-
Method Details
-
listFrontmatters
io.reactivex.rxjava3.core.Single<com.google.common.collect.ImmutableMap<String, Frontmatter>> listFrontmatters()Lists all availableFrontmatters for discovered skills.If the source is misconfigured, such as directory doesn't exist, or having malformed skill, the returned
Singlewill terminate with aSkillSourceExceptionwith the reason in the message.- Returns:
- a
Singleemitting a map where keys are skill names and values are theirFrontmatter
-
listResources
io.reactivex.rxjava3.core.Single<com.google.common.collect.ImmutableList<String>> listResources(String skillName, String resourceDirectory) Lists all resource files for a specific skill within a given directory.If the skill or the resource directory does not exist, the returned
Singlewill terminate with aSkillSourceException.- Parameters:
skillName- the name of the skillresourceDirectory- the relative directory within the skill to list (e.g., "assets", "scripts")- Returns:
- a
Singleemitting a list of resource paths relative to the skill directory
-
loadFrontmatter
Loads theFrontmatterfor a specific skill.If the skill is not found or its frontmatter is malformed, the returned
Singlewill terminate with aSkillSourceExceptionor parsing error.- Parameters:
skillName- the name of the skill- Returns:
- a
Singleemitting theFrontmatterfor the skill
-
loadInstructions
Loads the instructions (body of SKILL.md) for a specific skill.If the skill is not found or its file structure is invalid (e.g., unclosed frontmatter blocks), the returned
Singlewill terminate with aSkillSourceException.- Parameters:
skillName- the name of the skill- Returns:
- a
Singleemitting the instructions as a String
-
loadResource
io.reactivex.rxjava3.core.Single<com.google.common.io.ByteSource> loadResource(String skillName, String resourcePath) Loads a specific resource file content.If the skill or the specific resource path cannot be found, the returned
Singlewill terminate with aSkillSourceException.- Parameters:
skillName- the name of the skillresourcePath- the path to the resource file relative to the skill directory- Returns:
- a
Singleemitting theByteSourcefor the resource content
-