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 Type
    Method
    Description
    Returns a no-op accessor that reports no resources.
    Lists all relative resource paths that this accessor can serve.
    read(String relativePath)
    Reads a text resource as UTF-8.
    Optional<byte[]>
    readBinary(String relativePath)
    Reads a binary resource.
  • Method Details

    • read

      Optional<String> read(String relativePath)
      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

      Optional<byte[]> readBinary(String relativePath)
      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

      List<String> list()
      Lists all relative resource paths that this accessor can serve.

      Used by SkillLoadTool to build a friendly "available resources" enumeration when a requested path is not found.

      Returns:
      unmodifiable list of relative paths; never null
    • empty

      static SkillResources empty()
      Returns a no-op accessor that reports no resources.
      Returns:
      shared empty instance