using Nexus.Api.Models; namespace Nexus.Api.Services; public interface IOpenClawAgentConfigurationService { Task GetAgentFilesAsync( string agentId, CancellationToken cancellationToken = default); Task GetAgentFileAsync( string agentId, string fileName, CancellationToken cancellationToken = default); Task SetAgentFileAsync( string agentId, string fileName, UpdateOpenClawAgentFileRequest request, OpenClawInvocationContext invocationContext, CancellationToken cancellationToken = default); Task GetWorkspaceAsync( string agentId, string? path, int offset, int limit, CancellationToken cancellationToken = default); Task GetWorkspaceFileAsync( string agentId, string path, CancellationToken cancellationToken = default); Task GetConfigSchemaAsync( string path, CancellationToken cancellationToken = default); Task GetConfigAsync( CancellationToken cancellationToken = default); Task PatchConfigAsync( PatchOpenClawConfigRequest request, OpenClawInvocationContext invocationContext, CancellationToken cancellationToken = default); } public sealed class OpenClawAgentConfigurationValidationException( string field, string message) : Exception(message) { public string Field { get; } = field; } public sealed class OpenClawAgentConfigurationConflictException( string code, string message, string? expectedHash = null, string? currentHash = null) : Exception(message) { public string Code { get; } = code; public string? ExpectedHash { get; } = expectedHash; public string? CurrentHash { get; } = currentHash; } public sealed class OpenClawAgentConfigurationUnavailableException( string state, string method, string requiredScope, string message) : Exception(message) { public string State { get; } = state; public string Method { get; } = method; public string RequiredScope { get; } = requiredScope; } public sealed class OpenClawAgentConfigurationVerificationException( string message) : Exception(message);