Interface FileSink

All Known Implementing Classes:
CapturingFileSink, LocalFileSink, NoOpFileSink
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface FileSink
Abstraction over the CreateFileCommand side effect.

Keeping this as an interface lets the embedding application decide whether files are written to disk, captured in memory, uploaded to object storage, or rejected entirely. The runtime never assumes a filesystem.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final FileSink
    Shared singleton NoOpFileSink that accepts writes but performs no I/O.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    write(String runId, String stepId, String path, String content)
    Accept a file produced by an agent.
  • Field Details

    • NO_OP_FILE_SINK

      static final FileSink NO_OP_FILE_SINK
      Shared singleton NoOpFileSink that accepts writes but performs no I/O.
  • Method Details

    • write

      void write(String runId, String stepId, String path, String content)
      Accept a file produced by an agent. Implementations are responsible for their own path-traversal protection when the target is a real filesystem.
      Parameters:
      runId - id of the owning run — useful for scoping outputs per run
      stepId - id of the producing step
      path - the path the agent requested
      content - the file content