java.lang.Object
com.agentforge4j.runtime.command.LocalFileSink
- All Implemented Interfaces:
FileSink
FileSink that writes under baseDir, namespacing paths by runId and
rejecting paths that escape the base directory.-
Field Summary
Fields inherited from interface com.agentforge4j.runtime.command.FileSink
NO_OP_FILE_SINK -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LocalFileSink
Creates a sink rooted atbaseDir.- Parameters:
baseDir- root directory for all runs; relative paths use the default file system rules
-
-
Method Details
-
write
Writes UTF-8 text tobaseDir/runId/path, creating parent directories as needed.- Specified by:
writein interfaceFileSink- Parameters:
runId- id of the owning run — useful for scoping outputs per runstepId- id of the producing steppath- the path the agent requestedcontent- the file content- Throws:
IllegalArgumentException- ifrunId,stepId, orpathis blank, or the resolved path escapesbaseDirIllegalStateException- if the file cannot be written
-