BaseFutureSkillSource

Java-friendly base for implementing a SkillSource: every engine method is a suspend returning a Result, and this base final-overrides each to await a CompletableFuture from the Java subclass, mapping a completed future to Result.success and any failure to a Result.failure of SkillSourceException. Return each future promptly and do any blocking work inside it. Complete the future exceptionally with a SkillSourceException to report a skill error whose message reaches the LLM.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
suspend override fun listFrontmatters(): Result<List<Frontmatter>>

Returns the frontmatter for all available skills.

Link copied to clipboard
suspend override fun listResources(skillName: String, resourceDirectoryPath: String): Result<List<String>>

Returns a list of resource paths within a specific directory for a given skill.

Link copied to clipboard
suspend override fun loadFrontmatter(skillName: String): Result<Frontmatter>

Loads the frontmatter for a single skill by name.

Link copied to clipboard
suspend override fun loadInstructions(skillName: String): Result<String>

Loads the instruction body for a single skill by name.

Link copied to clipboard
suspend override fun loadResource(skillName: String, resourcePath: String): Result<ByteArray>

Loads a specific resource file for a given skill.