Record Class DistributedStore.CompositeDistributedStore

java.lang.Object
java.lang.Record
io.agentscope.harness.agent.DistributedStore.CompositeDistributedStore
All Implemented Interfaces:
DistributedStore
Enclosing interface:
DistributedStore

public static record DistributedStore.CompositeDistributedStore(io.agentscope.core.state.AgentStateStore stateStore, BaseStore store, SandboxSnapshotSpec snapshotSpec, SandboxExecutionGuard executionGuard, MessageBus bus, AsyncToolRegistry toolRegistry, TaskRepository tasks, SessionTurnGate turnGate, TeamClient teams) extends Record implements DistributedStore
A distributed store composed from individually specified components.
  • Constructor Details

    • CompositeDistributedStore

      public CompositeDistributedStore(io.agentscope.core.state.AgentStateStore stateStore, BaseStore store, SandboxSnapshotSpec snapshotSpec, SandboxExecutionGuard executionGuard, MessageBus bus, AsyncToolRegistry toolRegistry, TaskRepository tasks, SessionTurnGate turnGate, TeamClient teams)
      Creates an instance of a CompositeDistributedStore record class.
      Parameters:
      stateStore - the value for the stateStore record component
      store - the value for the store record component
      snapshotSpec - the value for the snapshotSpec record component
      executionGuard - the value for the executionGuard record component
      bus - the value for the bus record component
      toolRegistry - the value for the toolRegistry record component
      tasks - the value for the tasks record component
      turnGate - the value for the turnGate record component
      teams - the value for the teams record component
  • Method Details

    • agentStateStore

      public io.agentscope.core.state.AgentStateStore agentStateStore()
      Description copied from interface: DistributedStore
      Creates the AgentStateStore for agent session state persistence.
      Specified by:
      agentStateStore in interface DistributedStore
      Returns:
      a distributed agent state store; must not be null
    • baseStore

      public BaseStore baseStore()
      Description copied from interface: DistributedStore
      Creates the BaseStore for workspace filesystem KV storage.
      Specified by:
      baseStore in interface DistributedStore
      Returns:
      a distributed base store; must not be null
    • sandboxSnapshotSpec

      public SandboxSnapshotSpec sandboxSnapshotSpec()
      Description copied from interface: DistributedStore
      Creates the SandboxSnapshotSpec for sandbox snapshot persistence.

      Override this when the store supports binary blob storage suitable for Docker sandbox snapshots. The default returns NoopSnapshotSpec (no snapshots).

      Specified by:
      sandboxSnapshotSpec in interface DistributedStore
      Returns:
      a sandbox snapshot spec; must not be null
    • sandboxExecutionGuard

      public SandboxExecutionGuard sandboxExecutionGuard()
      Description copied from interface: DistributedStore
      Creates the SandboxExecutionGuard for distributed sandbox concurrency control.

      Override this when the store supports distributed locking. The default returns a no-op guard (no cross-node coordination).

      Specified by:
      sandboxExecutionGuard in interface DistributedStore
      Returns:
      a sandbox execution guard; must not be null
    • messageBus

      public MessageBus messageBus()
      Description copied from interface: DistributedStore
      Creates a MessageBus for inbox-based message delivery and session event streaming.

      Override this when the store supports real-time transport (e.g. Redis Pub/Sub). The default returns null, which signals HarnessAgent to fall back to a workspace-backed implementation created from the resolved AbstractFilesystem.

      Specified by:
      messageBus in interface DistributedStore
      Returns:
      a message bus, or null to use the workspace default
    • asyncToolRegistry

      public AsyncToolRegistry asyncToolRegistry()
      Description copied from interface: DistributedStore
      Creates an AsyncToolRegistry for tracking async tool executions.

      Override this when the store supports persistent key-value storage. The default returns null, which signals HarnessAgent to fall back to a workspace-backed implementation.

      Specified by:
      asyncToolRegistry in interface DistributedStore
      Returns:
      an async tool registry, or null to use the workspace default
    • taskRepository

      public TaskRepository taskRepository()
      Description copied from interface: DistributedStore
      Creates a TaskRepository for distributed subagent background tasks.

      Override this when the store supports hosted task persistence (e.g. control-plane /api/v1/dp/tasks/*). The default returns null, which signals HarnessAgent to fall back to a workspace-backed WorkspaceTaskRepository.

      Specified by:
      taskRepository in interface DistributedStore
      Returns:
      a task repository, or null to use the workspace default
    • sessionTurnGate

      public SessionTurnGate sessionTurnGate()
      Description copied from interface: DistributedStore
      Creates a SessionTurnGate for distributed per-session turn serialization.

      Override this when the store supports hosted locks (e.g. control-plane /api/v1/dp/locks/*). The default returns null, which signals HarnessAgent to use the gateway's built-in LocalSessionTurnGate.

      When a distributed turn gate is used, configure ReActAgent conflictPolicy to FAIL so concurrent state writes surface as errors rather than silent overwrites.

      Specified by:
      sessionTurnGate in interface DistributedStore
      Returns:
      a session turn gate, or null to use the process-local default
    • teamClient

      public TeamClient teamClient()
      Description copied from interface: DistributedStore
      Creates a TeamClient for AgentTeams coordination.

      Override when the store hosts team task/message APIs (control plane) or can back a local CAS client. The default returns null.

      Specified by:
      teamClient in interface DistributedStore
      Returns:
      a team client, or null when teams mode is unavailable
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • stateStore

      public io.agentscope.core.state.AgentStateStore stateStore()
      Returns the value of the stateStore record component.
      Returns:
      the value of the stateStore record component
    • store

      public BaseStore store()
      Returns the value of the store record component.
      Returns:
      the value of the store record component
    • snapshotSpec

      public SandboxSnapshotSpec snapshotSpec()
      Returns the value of the snapshotSpec record component.
      Returns:
      the value of the snapshotSpec record component
    • executionGuard

      public SandboxExecutionGuard executionGuard()
      Returns the value of the executionGuard record component.
      Returns:
      the value of the executionGuard record component
    • bus

      public MessageBus bus()
      Returns the value of the bus record component.
      Returns:
      the value of the bus record component
    • toolRegistry

      public AsyncToolRegistry toolRegistry()
      Returns the value of the toolRegistry record component.
      Returns:
      the value of the toolRegistry record component
    • tasks

      public TaskRepository tasks()
      Returns the value of the tasks record component.
      Returns:
      the value of the tasks record component
    • turnGate

      public SessionTurnGate turnGate()
      Returns the value of the turnGate record component.
      Returns:
      the value of the turnGate record component
    • teams

      public TeamClient teams()
      Returns the value of the teams record component.
      Returns:
      the value of the teams record component