Class DirEntry
java.lang.Object
io.agentscope.harness.agent.sandbox.layout.WorkspaceEntry
io.agentscope.harness.agent.sandbox.layout.DirEntry
Layout entry that creates a directory, optionally with nested child entries.
Child entries are a map of filename to WorkspaceEntry and may themselves be
nested DirEntry instances, enabling recursive tree-like workspace structures.
-
Constructor Summary
ConstructorsConstructorDescriptionDirEntry()Creates an empty directory entry.DirEntry(Map<String, WorkspaceEntry> children) Creates a directory entry with the given children. -
Method Summary
Modifier and TypeMethodDescriptionchild(String name, WorkspaceEntry entry) Adds a child entry to this directory.Returns the child entries in this directory.voidsetChildren(Map<String, WorkspaceEntry> children) Sets the child entries for this directory.Methods inherited from class io.agentscope.harness.agent.sandbox.layout.WorkspaceEntry
isEphemeral, setEphemeral
-
Constructor Details
-
DirEntry
public DirEntry()Creates an empty directory entry. -
DirEntry
Creates a directory entry with the given children.- Parameters:
children- map of child name to child entry
-
-
Method Details
-
getChildren
Returns the child entries in this directory.- Returns:
- mutable map of child name to child entry
-
setChildren
Sets the child entries for this directory.- Parameters:
children- map of child name to child entry
-
child
Adds a child entry to this directory.- Parameters:
name- child filenameentry- child entry- Returns:
- this instance for chaining
-