Class ObjectStoreTranscriptStore

java.lang.Object
io.agentscope.harness.agent.transcript.ObjectStoreTranscriptStore
All Implemented Interfaces:
TranscriptStore

public class ObjectStoreTranscriptStore extends Object implements TranscriptStore
TranscriptStore that writes immutable segment objects through AbstractFilesystem (S3/OSS/NAS/sandbox backends that implement upload). Each flush uploads a new key — never rewrites an existing object.
  • Constructor Details

    • ObjectStoreTranscriptStore

      public ObjectStoreTranscriptStore(AbstractFilesystem filesystem)
    • ObjectStoreTranscriptStore

      public ObjectStoreTranscriptStore(AbstractFilesystem filesystem, io.agentscope.core.agent.RuntimeContext rc, String rootPrefix)
  • Method Details

    • withRuntimeContext

      public TranscriptStore withRuntimeContext(io.agentscope.core.agent.RuntimeContext rc)
      Description copied from interface: TranscriptStore
      Returns a store view bound to the given per-call RuntimeContext so that namespace-scoped backends (e.g., per-user local filesystems) route transcript segments into the caller's namespace instead of the un-namespaced root.

      Stores whose location is fixed at construction time may ignore the context and return this.

      Specified by:
      withRuntimeContext in interface TranscriptStore
    • withFilesystem

      public ObjectStoreTranscriptStore withFilesystem(AbstractFilesystem filesystem)
      Returns a store that writes through filesystem while preserving this store's runtime context and root prefix. Used when session mirrors pin a sandbox reference for async upload.
    • appendSegment

      public String appendSegment(TranscriptRef ref, long seqStart, long seqEnd, String writerId, byte[] jsonl)
      Description copied from interface: TranscriptStore
      Appends one immutable JSONL segment and returns its storage key.
      Specified by:
      appendSegment in interface TranscriptStore
      Parameters:
      ref - transcript identity
      seqStart - inclusive start sequence (caller-assigned, contiguous preferred)
      seqEnd - inclusive end sequence
      writerId - unique writer / replica id (prevents key collisions)
      jsonl - UTF-8 JSONL payload (one SessionEntry per line)
      Returns:
      storage key of the written segment
    • listSegments

      public List<TranscriptStore.SegmentInfo> listSegments(TranscriptRef ref)
      Description copied from interface: TranscriptStore
      Lists segments ordered by seqStart ascending.
      Specified by:
      listSegments in interface TranscriptStore
    • readSegment

      public InputStream readSegment(String segmentKey)
      Description copied from interface: TranscriptStore
      Opens a segment for reading; caller must close the stream.
      Specified by:
      readSegment in interface TranscriptStore
    • compact

      public void compact(TranscriptRef ref)
      Description copied from interface: TranscriptStore
      Optional compaction of small segments into a single object.
      Specified by:
      compact in interface TranscriptStore
    • delete

      public void delete(TranscriptRef ref)
      Description copied from interface: TranscriptStore
      Deletes all segments for the transcript.
      Specified by:
      delete in interface TranscriptStore