Class KubernetesSandboxClient

java.lang.Object
io.agentscope.extensions.sandbox.kubernetes.KubernetesSandboxClient
All Implemented Interfaces:
io.agentscope.harness.agent.sandbox.SandboxClient<KubernetesSandboxClientOptions>

public class KubernetesSandboxClient extends Object implements io.agentscope.harness.agent.sandbox.SandboxClient<KubernetesSandboxClientOptions>
Harness SandboxClient for agent-sandbox backed Kubernetes sandboxes.

Delegates lifecycle and transport to the Java agent-sandbox client SDK (SandboxClient).

  • Constructor Details

  • Method Details

    • create

      public io.agentscope.harness.agent.sandbox.Sandbox create(io.agentscope.harness.agent.sandbox.WorkspaceSpec workspaceSpec, io.agentscope.harness.agent.sandbox.snapshot.SandboxSnapshotSpec snapshotSpec, KubernetesSandboxClientOptions options)
      Specified by:
      create in interface io.agentscope.harness.agent.sandbox.SandboxClient<KubernetesSandboxClientOptions>
    • resume

      public io.agentscope.harness.agent.sandbox.Sandbox resume(io.agentscope.harness.agent.sandbox.SandboxState state)
      Specified by:
      resume in interface io.agentscope.harness.agent.sandbox.SandboxClient<KubernetesSandboxClientOptions>
    • delete

      public void delete(io.agentscope.harness.agent.sandbox.Sandbox sandbox)
      Specified by:
      delete in interface io.agentscope.harness.agent.sandbox.SandboxClient<KubernetesSandboxClientOptions>
    • serializeState

      public String serializeState(io.agentscope.harness.agent.sandbox.SandboxState state)
      Specified by:
      serializeState in interface io.agentscope.harness.agent.sandbox.SandboxClient<KubernetesSandboxClientOptions>
    • deserializeState

      public io.agentscope.harness.agent.sandbox.SandboxState deserializeState(String json)
      Specified by:
      deserializeState in interface io.agentscope.harness.agent.sandbox.SandboxClient<KubernetesSandboxClientOptions>
    • deserializeState

      public io.agentscope.harness.agent.sandbox.SandboxState deserializeState(String json, io.agentscope.harness.agent.sandbox.snapshot.SandboxSnapshotSpec snapshotSpec)
      Restores the runtime storage client omitted from remote snapshot JSON while keeping the persisted archive id. This is needed even when the existing Kubernetes claim resumes successfully and the manager does not fall back to creating a new sandbox.
      Specified by:
      deserializeState in interface io.agentscope.harness.agent.sandbox.SandboxClient<KubernetesSandboxClientOptions>
    • toConnectionConfig

      public static SandboxConnectionConfig toConnectionConfig(KubernetesSandboxClientOptions opts)
      Maps harness options to an SDK connection config.
      Parameters:
      opts - harness options
      Returns:
      SDK connection config