// Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; namespace Microsoft.Agents.AI.Tools.Shell; /// /// Configuration for . New knobs will be /// added as properties here so the constructor surface stays binary-stable. /// public sealed class DockerShellExecutorOptions { /// OCI image to run. Must include bash and (for persistent mode) sleep. public string Image { get; set; } = DockerShellExecutor.DefaultImage; /// Optional container name. When , a unique name is generated. public string? ContainerName { get; set; } /// Execution mode. Defaults to . public ShellMode Mode { get; set; } = ShellMode.Persistent; /// Optional host directory mounted at . public string? HostWorkdir { get; set; } /// Path inside the container. Defaults to /workspace. public string ContainerWorkdir { get; set; } = DockerShellExecutor.DefaultContainerWorkdir; /// When (the default), the host workdir is mounted read-only. public bool MountReadonly { get; set; } = true; /// Docker network mode. Defaults to . public string Network { get; set; } = DockerNetworkMode.None; /// Container memory limit, in bytes. selects 512 MiB. public long? MemoryBytes { get; set; } /// Max processes inside the container. public int PidsLimit { get; set; } = DockerShellExecutor.DefaultPidsLimit; /// Container user. Defaults to (nobody). public ContainerUser User { get; set; } = ContainerUser.Default; /// When (the default), the container root filesystem is read-only. public bool ReadOnlyRoot { get; set; } = true; /// Additional args appended to docker run. public IReadOnlyList? ExtraRunArgs { get; set; } /// Environment variables passed via -e to every command. public IReadOnlyDictionary? Environment { get; set; } /// /// Optional . Less critical than for /// since the container provides /// isolation; selects a default policy. /// public ShellPolicy? Policy { get; set; } /// Per-command timeout. disables timeouts. public TimeSpan? Timeout { get; set; } /// Per-stream cap before head+tail truncation. Defaults to 64 KiB. public int MaxOutputBytes { get; set; } = 64 * 1024; /// Override (e.g. podman). public string DockerBinary { get; set; } = "docker"; }