Class LocalSnapshotSpec

java.lang.Object
io.agentscope.harness.agent.sandbox.snapshot.LocalSnapshotSpec
All Implemented Interfaces:
SandboxSnapshotSpec

public class LocalSnapshotSpec extends Object implements SandboxSnapshotSpec
Snapshot spec that creates LocalSandboxSnapshot instances stored in a local directory.

Each session gets its own snapshot file at {basePath}/{sessionId}.tar.

  • Constructor Details

    • LocalSnapshotSpec

      public LocalSnapshotSpec(Path basePath)
      Creates a local snapshot spec.
      Parameters:
      basePath - directory where snapshot tar files will be stored
    • LocalSnapshotSpec

      public LocalSnapshotSpec(String basePath)
      Creates a local snapshot spec.
      Parameters:
      basePath - directory path string where snapshot tar files will be stored
  • Method Details

    • build

      public SandboxSnapshot build(String snapshotId)
      Creates a SandboxSnapshot for the given session ID.
      Specified by:
      build in interface SandboxSnapshotSpec
      Parameters:
      snapshotId - unique identifier for the snapshot (typically the session UUID)
      Returns:
      a new LocalSandboxSnapshot storing at {basePath}/{snapshotId}.tar
    • getBasePath

      public String getBasePath()
      Returns the base directory used for snapshot files.
      Returns:
      base path string