Interface SkillResources
public interface SkillResources
Lazy resource accessor for a single skill.
Decouples "what resources exist" from "how to fetch their contents", so that repositories
backed by an AbstractFilesystem can answer load_skill_through_path calls
on demand without preloading every byte of every skill into memory at registration time.
All paths are relative to the skill root (e.g. "references/guide.md",
"scripts/run.py"). Absolute paths and path traversal sequences ("..") are
rejected by implementations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SkillResourcesempty()Returns a no-op accessor that reports no resources.list()Lists all relative resource paths that this accessor can serve.Reads a text resource as UTF-8.Optional<byte[]>readBinary(String relativePath) Reads a binary resource.
-
Method Details
-
read
Reads a text resource as UTF-8.- Parameters:
relativePath- path relative to the skill root- Returns:
- content, or empty if the resource does not exist or read fails
-
readBinary
Reads a binary resource.- Parameters:
relativePath- path relative to the skill root- Returns:
- content, or empty if the resource does not exist or read fails
-
list
Lists all relative resource paths that this accessor can serve.Used by
SkillLoadToolto build a friendly "available resources" enumeration when a requested path is not found.- Returns:
- unmodifiable list of relative paths; never
null
-
empty
Returns a no-op accessor that reports no resources.- Returns:
- shared empty instance
-