feat: ship agent-first mission control v0.2.57
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
public sealed record ActivityItemDto(
|
||||
long Id,
|
||||
string Type,
|
||||
string Message,
|
||||
DateTimeOffset At,
|
||||
EntityRefDto? Entity,
|
||||
OperationResultDto? Operation = null);
|
||||
|
||||
public sealed record ActivityPageDto(
|
||||
IReadOnlyList<ActivityItemDto> Items,
|
||||
int TotalCount,
|
||||
int Page,
|
||||
int PageSize,
|
||||
int TotalPages);
|
||||
@@ -0,0 +1,95 @@
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
public sealed record CreateAgentProposalRequest(
|
||||
string Name,
|
||||
string? Role = null,
|
||||
string? Description = null,
|
||||
string? Model = null,
|
||||
string? Emoji = null,
|
||||
string? Avatar = null,
|
||||
IReadOnlyDictionary<string, string>? Files = null,
|
||||
string? ClientRequestId = null);
|
||||
|
||||
public sealed record AgentProposalActionRequest(
|
||||
int ExpectedRevision,
|
||||
string? Reason = null);
|
||||
|
||||
public sealed record AgentProposalFileDto(
|
||||
string Name,
|
||||
string ContentHash,
|
||||
int Size,
|
||||
string? Content = null);
|
||||
|
||||
public sealed record AgentProposalErrorDto(
|
||||
string Code,
|
||||
string Message,
|
||||
string? Recovery = null);
|
||||
|
||||
public sealed record AgentProposalDto(
|
||||
Guid Id,
|
||||
string Source,
|
||||
string RequestedName,
|
||||
string RequestedAgentId,
|
||||
string? Role,
|
||||
string? Description,
|
||||
string? Model,
|
||||
string? Emoji,
|
||||
string? Avatar,
|
||||
string Workspace,
|
||||
IReadOnlyList<AgentProposalFileDto> Files,
|
||||
string Status,
|
||||
string RequestedBy,
|
||||
string? ApprovedBy,
|
||||
string? RejectedBy,
|
||||
string? RejectionReason,
|
||||
string? OpenClawAgentId,
|
||||
string? OpenClawWorkspace,
|
||||
AgentProposalErrorDto? Error,
|
||||
int Revision,
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset UpdatedAt,
|
||||
DateTimeOffset? ApprovedAt,
|
||||
DateTimeOffset? RejectedAt,
|
||||
DateTimeOffset? CompletedAt);
|
||||
|
||||
public sealed record AgentProposalCollectionDto(
|
||||
IReadOnlyList<AgentProposalDto> Items,
|
||||
string? NextCursor,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
public sealed record AgentProposalOperationDto(
|
||||
bool Ok,
|
||||
string State,
|
||||
string Message,
|
||||
AgentProposalDto? Proposal,
|
||||
string? Recovery,
|
||||
string CorrelationId,
|
||||
DateTimeOffset CompletedAt,
|
||||
OperationResultDto? Operation = null);
|
||||
|
||||
public sealed record AgentCreateModelOptionDto(
|
||||
string Id,
|
||||
string Name,
|
||||
string Provider,
|
||||
bool Available);
|
||||
|
||||
public sealed record AgentCreateOptionsDto(
|
||||
bool CanSubmitProposal,
|
||||
bool CanProvision,
|
||||
string State,
|
||||
string? Reason,
|
||||
string WorkspaceRoot,
|
||||
IReadOnlyList<string> ExistingAgentIds,
|
||||
IReadOnlyList<AgentCreateModelOptionDto> Models,
|
||||
IReadOnlyList<string> StandardFiles,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
/// <summary>
|
||||
/// Structured MCP result. Proposal markdown is intentionally omitted.
|
||||
/// </summary>
|
||||
public sealed record AgentProposalToolResult(
|
||||
bool Ok,
|
||||
string State,
|
||||
string Message,
|
||||
AgentProposalDto? Proposal,
|
||||
string? Recovery);
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
public sealed record BrowserMetricRequest(
|
||||
string Name,
|
||||
double Value,
|
||||
string Rating,
|
||||
string RouteName,
|
||||
string BuildVersion,
|
||||
string NavigationType,
|
||||
string LiveMode,
|
||||
string? CorrelationId);
|
||||
@@ -9,7 +9,7 @@ public sealed record DashboardAgentInfo(
|
||||
string? CurrentTask,
|
||||
string? Description,
|
||||
string[] Tags,
|
||||
int Progress = 0,
|
||||
double? Progress = null,
|
||||
int Workload = 0,
|
||||
string? Goal = null,
|
||||
string RoleBadge = "badge-slate",
|
||||
@@ -18,7 +18,10 @@ public sealed record DashboardAgentInfo(
|
||||
string? StatusDetail = null,
|
||||
string? Elapsed = null,
|
||||
string? Think = null,
|
||||
string? Next = null
|
||||
string? Next = null,
|
||||
long? TotalTokens = null,
|
||||
decimal? CostUsd = null,
|
||||
DateTimeOffset? TelemetryAt = null
|
||||
);
|
||||
|
||||
public sealed record MessageEntry(
|
||||
@@ -99,7 +102,9 @@ public sealed record DashboardTaskDto(
|
||||
List<DashboardTaskDto>? ChildTasks = null,
|
||||
int ChildTaskCount = 0,
|
||||
int OpenChildTaskCount = 0,
|
||||
bool HasVisibleDelegation = false
|
||||
bool HasVisibleDelegation = false,
|
||||
Guid? ProjectId = null,
|
||||
OperationResultDto? Operation = null
|
||||
);
|
||||
|
||||
public sealed record CreateDashboardTaskRequest(
|
||||
@@ -175,7 +180,8 @@ public sealed record ResetStaleRequest(
|
||||
);
|
||||
|
||||
public sealed record ResetStaleResponse(
|
||||
int ResetCount
|
||||
int ResetCount,
|
||||
OperationResultDto? Operation = null
|
||||
);
|
||||
|
||||
public sealed record PostActivityRequest(
|
||||
@@ -201,9 +207,14 @@ public sealed record AgentWorkflowOverview(
|
||||
|
||||
public sealed record NotificationDto(
|
||||
Guid Id, string Type, string Title, string? Message,
|
||||
string ForUser, Guid? TaskId, bool IsRead, DateTimeOffset CreatedAt
|
||||
string ForUser, Guid? TaskId, bool IsRead, DateTimeOffset CreatedAt,
|
||||
OperationResultDto? Operation = null
|
||||
);
|
||||
|
||||
public sealed record NotificationReadAllResultDto(
|
||||
int Marked,
|
||||
OperationResultDto Operation);
|
||||
|
||||
public sealed record UnreadCountDto(int Count);
|
||||
|
||||
public sealed record LiveUpdateEnvelope(
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Transport-safe reference to a Nexus or OpenClaw-owned entity. Routing stays
|
||||
/// a frontend concern, so this contract deliberately contains no URL.
|
||||
/// </summary>
|
||||
public sealed record EntityRefDto(
|
||||
string Type,
|
||||
string Id,
|
||||
string? Label = null);
|
||||
|
||||
public sealed record OperationResultDto(
|
||||
string OperationId,
|
||||
string Status,
|
||||
int Revision,
|
||||
EntityRefDto? PrimaryRef,
|
||||
IReadOnlyList<EntityRefDto> AffectedRefs,
|
||||
string? TraceId);
|
||||
|
||||
/// <summary>
|
||||
/// Content-minimized event sent to authenticated Mission Control clients.
|
||||
/// Payloads may carry state and correlation metadata, but never prompts,
|
||||
/// credentials, markdown content, tool arguments, or entity names.
|
||||
/// </summary>
|
||||
public sealed record DomainEventDto(
|
||||
long Sequence,
|
||||
string EventType,
|
||||
EntityRefDto Entity,
|
||||
int EntityRevision,
|
||||
DateTimeOffset OccurredAt,
|
||||
JsonElement Payload);
|
||||
|
||||
public static class DomainEventTypes
|
||||
{
|
||||
public const string ResyncRequired = "resync_required";
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
public sealed record OpenClawAgentFileSummaryDto(
|
||||
string Name,
|
||||
bool Missing,
|
||||
long? Size,
|
||||
DateTimeOffset? UpdatedAt,
|
||||
string? ContentHash);
|
||||
|
||||
public sealed record OpenClawAgentFileCollectionDto(
|
||||
string AgentId,
|
||||
IReadOnlyList<OpenClawAgentFileSummaryDto> Files,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
public sealed record OpenClawAgentFileDto(
|
||||
string AgentId,
|
||||
string Name,
|
||||
bool Missing,
|
||||
long? Size,
|
||||
DateTimeOffset? UpdatedAt,
|
||||
string? Content,
|
||||
string ContentHash,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
public sealed record UpdateOpenClawAgentFileRequest(
|
||||
string Content,
|
||||
string ExpectedHash);
|
||||
|
||||
public sealed record OpenClawAgentFileWriteDto(
|
||||
bool Ok,
|
||||
string State,
|
||||
string Message,
|
||||
OpenClawAgentFileDto File,
|
||||
bool Verified,
|
||||
string IdempotencyKey,
|
||||
string CorrelationId,
|
||||
DateTimeOffset CompletedAt,
|
||||
OperationResultDto? Operation = null);
|
||||
|
||||
public sealed record OpenClawWorkspaceEntryDto(
|
||||
string Path,
|
||||
string Name,
|
||||
string Kind,
|
||||
long? Size,
|
||||
DateTimeOffset? UpdatedAt);
|
||||
|
||||
public sealed record OpenClawWorkspaceCollectionDto(
|
||||
string AgentId,
|
||||
string Path,
|
||||
string? ParentPath,
|
||||
IReadOnlyList<OpenClawWorkspaceEntryDto> Entries,
|
||||
int TotalEntries,
|
||||
int Offset,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
public sealed record OpenClawWorkspaceFileDto(
|
||||
string AgentId,
|
||||
string Path,
|
||||
string Name,
|
||||
long Size,
|
||||
DateTimeOffset? UpdatedAt,
|
||||
string MimeType,
|
||||
string Encoding,
|
||||
string Content,
|
||||
string ContentHash,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
public sealed record OpenClawConfigSchemaChildDto(
|
||||
string Key,
|
||||
string Path,
|
||||
JsonNode? Type,
|
||||
bool Required,
|
||||
bool HasChildren,
|
||||
string? ReloadKind,
|
||||
JsonNode? Hint);
|
||||
|
||||
public sealed record OpenClawConfigSchemaLookupDto(
|
||||
string Path,
|
||||
JsonNode? Schema,
|
||||
string? ReloadKind,
|
||||
JsonNode? Hint,
|
||||
IReadOnlyList<OpenClawConfigSchemaChildDto> Children,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
public sealed record OpenClawConfigSnapshotDto(
|
||||
bool Exists,
|
||||
bool Valid,
|
||||
string? Hash,
|
||||
JsonNode? Config,
|
||||
JsonNode? Issues,
|
||||
JsonNode? Warnings,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
public sealed record PatchOpenClawConfigRequest(
|
||||
JsonNode Patch,
|
||||
string BaseHash,
|
||||
IReadOnlyList<string>? ReplacePaths = null,
|
||||
string? Note = null,
|
||||
int? RestartDelayMs = null);
|
||||
|
||||
public sealed record OpenClawConfigPatchDto(
|
||||
bool Ok,
|
||||
string State,
|
||||
string Message,
|
||||
OpenClawConfigSnapshotDto Snapshot,
|
||||
JsonNode? Restart,
|
||||
bool Verified,
|
||||
string IdempotencyKey,
|
||||
string CorrelationId,
|
||||
DateTimeOffset CompletedAt,
|
||||
OperationResultDto? Operation = null);
|
||||
|
||||
public sealed record OpenClawAgentConfigurationErrorDto(
|
||||
string Code,
|
||||
string Message,
|
||||
string? RequiredMethod = null,
|
||||
string? RequiredScope = null);
|
||||
@@ -0,0 +1,362 @@
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
public sealed record OpenClawConnectionDto(
|
||||
string State,
|
||||
bool Configured,
|
||||
bool CredentialConfigured,
|
||||
bool Connected,
|
||||
string Endpoint,
|
||||
string? GatewayVersion,
|
||||
string? RequiredVersion,
|
||||
bool VersionPinned,
|
||||
bool VersionMatches,
|
||||
int? ProtocolVersion,
|
||||
IReadOnlyList<string> GrantedScopes,
|
||||
IReadOnlyList<string> AdvertisedEvents,
|
||||
DateTimeOffset? LastConnectedAt,
|
||||
DateTimeOffset? LastEventAt,
|
||||
int ReconnectAttempts,
|
||||
string? Message,
|
||||
string? Recovery,
|
||||
DateTimeOffset CheckedAt,
|
||||
string? DeviceId = null,
|
||||
bool PairingRequired = false,
|
||||
string? PairingRequestId = null);
|
||||
|
||||
public sealed record OpenClawCapabilityDto(
|
||||
string Id,
|
||||
string Label,
|
||||
string Method,
|
||||
string RequiredScope,
|
||||
bool Available,
|
||||
string State,
|
||||
string? Reason);
|
||||
|
||||
public sealed record OpenClawCollectionDto<T>(
|
||||
string State,
|
||||
IReadOnlyList<T> Items,
|
||||
string? NextCursor,
|
||||
string? Message,
|
||||
string? Recovery,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
public sealed record OpenClawOperationDto<T>(
|
||||
bool Ok,
|
||||
string State,
|
||||
string Message,
|
||||
T? Data,
|
||||
string? Recovery,
|
||||
DateTimeOffset CompletedAt,
|
||||
string? OperationId = null,
|
||||
string? CorrelationId = null,
|
||||
string? IdempotencyKey = null,
|
||||
string? TraceParent = null,
|
||||
string? Actor = null,
|
||||
OperationResultDto? Operation = null);
|
||||
|
||||
public sealed record OpenClawTaskDto(
|
||||
string Id,
|
||||
string Title,
|
||||
string Status,
|
||||
string? Kind,
|
||||
string? Runtime,
|
||||
string? AgentId,
|
||||
string? SessionKey,
|
||||
string? RunId,
|
||||
string? FlowId,
|
||||
string? ParentTaskId,
|
||||
DateTimeOffset? CreatedAt,
|
||||
DateTimeOffset? StartedAt,
|
||||
DateTimeOffset? UpdatedAt,
|
||||
DateTimeOffset? FinishedAt,
|
||||
double? Progress,
|
||||
string? Summary,
|
||||
string? Error,
|
||||
bool CanCancel);
|
||||
|
||||
public sealed record OpenClawSessionDto(
|
||||
string Key,
|
||||
string? SessionId,
|
||||
string AgentId,
|
||||
string Title,
|
||||
string Status,
|
||||
string? Kind,
|
||||
string? Channel,
|
||||
string? Model,
|
||||
string? Provider,
|
||||
string? RunId,
|
||||
DateTimeOffset? UpdatedAt,
|
||||
long? InputTokens,
|
||||
long? OutputTokens,
|
||||
long? TotalTokens,
|
||||
bool CanAbort);
|
||||
|
||||
public sealed record OpenClawCronJobDto(
|
||||
string Id,
|
||||
string Name,
|
||||
string? Description,
|
||||
string Schedule,
|
||||
string? TimeZone,
|
||||
bool Enabled,
|
||||
string Status,
|
||||
string? AgentId,
|
||||
string? SessionKey,
|
||||
DateTimeOffset? NextRunAt,
|
||||
DateTimeOffset? LastRunAt,
|
||||
string? LastRunStatus,
|
||||
string? LastError,
|
||||
bool CanRun,
|
||||
string? ResourceHash = null);
|
||||
|
||||
public sealed record OpenClawCronScheduleDto(
|
||||
string Kind,
|
||||
string? Expression,
|
||||
string? TimeZone,
|
||||
string? At,
|
||||
long? EveryMs,
|
||||
long? AnchorMs,
|
||||
long? StaggerMs,
|
||||
string? Command,
|
||||
string? WorkingDirectory);
|
||||
|
||||
public sealed record OpenClawCronPayloadDto(
|
||||
string Kind,
|
||||
string? Text,
|
||||
string? Message,
|
||||
string? Model,
|
||||
IReadOnlyList<string> Fallbacks,
|
||||
string? Thinking,
|
||||
double? TimeoutSeconds,
|
||||
bool? AllowUnsafeExternalContent,
|
||||
bool? LightContext,
|
||||
IReadOnlyList<string> ToolsAllow,
|
||||
IReadOnlyList<string> Arguments,
|
||||
string? WorkingDirectory,
|
||||
IReadOnlyList<string> EnvironmentKeys,
|
||||
bool InputConfigured,
|
||||
double? NoOutputTimeoutSeconds,
|
||||
int? OutputMaxBytes);
|
||||
|
||||
public sealed record OpenClawCronDestinationDto(
|
||||
string? Channel,
|
||||
string? Target,
|
||||
string? AccountId,
|
||||
string? Mode);
|
||||
|
||||
public sealed record OpenClawCronDeliveryDto(
|
||||
string Mode,
|
||||
string? Channel,
|
||||
string? Target,
|
||||
string? ThreadId,
|
||||
string? AccountId,
|
||||
bool? BestEffort,
|
||||
OpenClawCronDestinationDto? CompletionDestination,
|
||||
OpenClawCronDestinationDto? FailureDestination);
|
||||
|
||||
public sealed record OpenClawCronTriggerDto(
|
||||
string Script,
|
||||
bool Once);
|
||||
|
||||
public sealed record OpenClawCronFailureAlertDto(
|
||||
int? After,
|
||||
string? Channel,
|
||||
string? Target,
|
||||
long? CooldownMs,
|
||||
bool? IncludeSkipped,
|
||||
string? Mode,
|
||||
string? AccountId);
|
||||
|
||||
public sealed record OpenClawCronJobDetailDto(
|
||||
string Id,
|
||||
string Name,
|
||||
string? DisplayName,
|
||||
string? Description,
|
||||
bool Enabled,
|
||||
bool DeleteAfterRun,
|
||||
string? AgentId,
|
||||
string? SessionKey,
|
||||
string SessionTarget,
|
||||
string WakeMode,
|
||||
OpenClawCronScheduleDto Schedule,
|
||||
OpenClawCronPayloadDto Payload,
|
||||
OpenClawCronDeliveryDto? Delivery,
|
||||
OpenClawCronTriggerDto? Trigger,
|
||||
OpenClawCronFailureAlertDto? FailureAlert,
|
||||
DateTimeOffset? CreatedAt,
|
||||
DateTimeOffset? UpdatedAt,
|
||||
DateTimeOffset? NextRunAt,
|
||||
DateTimeOffset? LastRunAt,
|
||||
string? LastRunStatus,
|
||||
string? LastError,
|
||||
string ResourceHash,
|
||||
bool CanUpdate,
|
||||
bool CanDelete,
|
||||
bool CanRun);
|
||||
|
||||
public sealed record OpenClawCronRunDto(
|
||||
string Id,
|
||||
string JobId,
|
||||
string? JobName,
|
||||
string? RunId,
|
||||
string Status,
|
||||
string Action,
|
||||
string? Summary,
|
||||
string? Error,
|
||||
string? ErrorReason,
|
||||
string? DeliveryStatus,
|
||||
string? DeliveryError,
|
||||
bool? Delivered,
|
||||
bool? TriggerFired,
|
||||
string? DiagnosticsSummary,
|
||||
IReadOnlyList<OpenClawCronRunDiagnosticDto> Diagnostics,
|
||||
string? SessionId,
|
||||
string? SessionKey,
|
||||
DateTimeOffset? OccurredAt,
|
||||
DateTimeOffset? RunAt,
|
||||
long? DurationMs,
|
||||
DateTimeOffset? NextRunAt,
|
||||
string? Model,
|
||||
string? Provider,
|
||||
long? InputTokens,
|
||||
long? OutputTokens,
|
||||
long? TotalTokens);
|
||||
|
||||
public sealed record OpenClawCronRunDiagnosticDto(
|
||||
DateTimeOffset? OccurredAt,
|
||||
string Source,
|
||||
string Severity,
|
||||
string Message,
|
||||
string? ToolName,
|
||||
double? ExitCode,
|
||||
bool Truncated);
|
||||
|
||||
public sealed record CreateOpenClawCronJobRequest(
|
||||
string Name,
|
||||
JsonObject Schedule,
|
||||
string SessionTarget,
|
||||
string WakeMode,
|
||||
JsonObject Payload,
|
||||
string? Description = null,
|
||||
bool Enabled = true,
|
||||
string? AgentId = null,
|
||||
string? SessionKey = null,
|
||||
bool? DeleteAfterRun = null,
|
||||
JsonObject? Delivery = null,
|
||||
JsonObject? Trigger = null,
|
||||
JsonNode? FailureAlert = null,
|
||||
string? DeclarationKey = null,
|
||||
string? DisplayName = null);
|
||||
|
||||
public sealed record PatchOpenClawCronJobRequest(
|
||||
JsonObject Patch,
|
||||
string? ExpectedHash = null);
|
||||
|
||||
public sealed record OpenClawActivityDto(
|
||||
string Id,
|
||||
string EventType,
|
||||
string Kind,
|
||||
string Action,
|
||||
string Status,
|
||||
string Message,
|
||||
string? Severity,
|
||||
string? Actor,
|
||||
string? AgentId,
|
||||
string? SessionKey,
|
||||
string? RunId,
|
||||
DateTimeOffset? OccurredAt,
|
||||
string Source);
|
||||
|
||||
public sealed record OpenClawApprovalDto(
|
||||
string Id,
|
||||
string Kind,
|
||||
string Title,
|
||||
string? Description,
|
||||
string Status,
|
||||
string Severity,
|
||||
string? Command,
|
||||
string? WorkingDirectory,
|
||||
string? AgentId,
|
||||
string? SessionKey,
|
||||
DateTimeOffset? RequestedAt,
|
||||
DateTimeOffset? ExpiresAt,
|
||||
IReadOnlyList<string> AllowedDecisions,
|
||||
bool CanResolve);
|
||||
|
||||
public sealed record OpenClawModelDto(
|
||||
string Id,
|
||||
string Name,
|
||||
string Provider,
|
||||
bool Configured,
|
||||
bool Available,
|
||||
int? ContextWindow,
|
||||
string? Reason);
|
||||
|
||||
public sealed record OpenClawModelAuthExpiryDto(
|
||||
DateTimeOffset At,
|
||||
long RemainingMs,
|
||||
string Label);
|
||||
|
||||
public sealed record OpenClawModelAuthProfileSummaryDto(
|
||||
string Type,
|
||||
string Status,
|
||||
int Count);
|
||||
|
||||
public sealed record OpenClawModelAuthApiKeyDto(
|
||||
string Source,
|
||||
string? EnvVar);
|
||||
|
||||
public sealed record OpenClawModelAuthUsageDto(
|
||||
string? Summary,
|
||||
string? Plan);
|
||||
|
||||
/// <summary>
|
||||
/// Browser-safe projection of OpenClaw models.authStatus.
|
||||
/// Profile identifiers, account identities, billing details and credentials are
|
||||
/// deliberately absent from this public contract.
|
||||
/// </summary>
|
||||
public sealed record OpenClawModelAuthProviderDto(
|
||||
string Provider,
|
||||
string DisplayName,
|
||||
string Status,
|
||||
OpenClawModelAuthExpiryDto? Expiry,
|
||||
IReadOnlyList<OpenClawModelAuthProfileSummaryDto> Profiles,
|
||||
OpenClawModelAuthApiKeyDto? ApiKey,
|
||||
OpenClawModelAuthUsageDto? Usage);
|
||||
|
||||
public sealed record OpenClawAgentDto(
|
||||
string Id,
|
||||
string Name,
|
||||
string? Description,
|
||||
string? Model,
|
||||
string? Provider,
|
||||
string? Workspace,
|
||||
string Status);
|
||||
|
||||
public sealed record OpenClawOverviewDto(
|
||||
OpenClawConnectionDto Connection,
|
||||
IReadOnlyList<OpenClawCapabilityDto> Capabilities,
|
||||
OpenClawCollectionDto<OpenClawTaskDto> Tasks,
|
||||
OpenClawCollectionDto<OpenClawSessionDto> Sessions,
|
||||
OpenClawCollectionDto<OpenClawCronJobDto> CronJobs,
|
||||
OpenClawCollectionDto<OpenClawApprovalDto> Approvals,
|
||||
OpenClawCollectionDto<OpenClawActivityDto> Activity,
|
||||
OpenClawCollectionDto<OpenClawModelDto> Models,
|
||||
OpenClawCollectionDto<OpenClawAgentDto> Agents,
|
||||
DateTimeOffset GeneratedAt);
|
||||
|
||||
public sealed record CancelOpenClawTaskRequest(string? Reason);
|
||||
|
||||
public sealed record AbortOpenClawSessionRequest(
|
||||
string SessionKey,
|
||||
string? RunId = null,
|
||||
bool ClearQueued = true);
|
||||
|
||||
public sealed record ResolveOpenClawApprovalRequest(
|
||||
string Kind,
|
||||
string Decision);
|
||||
|
||||
public sealed record PatchOpenClawSessionModelRequest(
|
||||
string SessionKey,
|
||||
string Model);
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
public sealed record OpenClawStreamEventDto(
|
||||
string Id,
|
||||
string Type,
|
||||
string EventName,
|
||||
string Category,
|
||||
long? Sequence,
|
||||
long? StateVersion,
|
||||
long? PreviousSequence,
|
||||
bool SequenceGapDetected,
|
||||
bool SequenceResetDetected,
|
||||
long? MissingSequenceFrom,
|
||||
long? MissingSequenceTo,
|
||||
DateTimeOffset OccurredAt,
|
||||
JsonNode? Payload);
|
||||
|
||||
public sealed record OpenClawEventBatch(
|
||||
IReadOnlyList<OpenClawStreamEventDto> Events,
|
||||
string? Cursor,
|
||||
bool ReplayBoundaryMissed,
|
||||
string? OldestAvailableId,
|
||||
string? LatestAvailableId,
|
||||
DateTimeOffset ProjectedAt);
|
||||
@@ -0,0 +1,95 @@
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
public sealed record StartOpenClawRunRequest(
|
||||
string Prompt,
|
||||
string AgentId,
|
||||
string SessionKey,
|
||||
string? Title = null,
|
||||
Guid? TaskId = null,
|
||||
Guid? ProjectId = null);
|
||||
|
||||
public sealed record OpenClawRunActionRequest(string? Reason = null);
|
||||
|
||||
/// <summary>
|
||||
/// Trusted invocation context assembled by the Nexus HTTP boundary. Actor is
|
||||
/// derived from the authenticated principal and is never accepted from JSON.
|
||||
/// </summary>
|
||||
public sealed record OpenClawInvocationMetadata(
|
||||
string IdempotencyKey,
|
||||
string CorrelationId,
|
||||
string Actor,
|
||||
string? TraceParent);
|
||||
|
||||
public sealed record OpenClawRunDto(
|
||||
Guid Id,
|
||||
string Title,
|
||||
string Prompt,
|
||||
string AgentId,
|
||||
string SessionKey,
|
||||
string Status,
|
||||
Guid? TaskId,
|
||||
Guid? ProjectId,
|
||||
string? OpenClawRunId,
|
||||
Guid? RetriedFromRunId,
|
||||
string CorrelationId,
|
||||
string Actor,
|
||||
string? LastError,
|
||||
long? LastGatewaySequence,
|
||||
bool SequenceGapDetected,
|
||||
bool CanStop,
|
||||
bool CanRetry,
|
||||
bool CanResume,
|
||||
string? ResumeCapabilityMessage,
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset UpdatedAt,
|
||||
DateTimeOffset? StartedAt,
|
||||
DateTimeOffset? FinishedAt);
|
||||
|
||||
public sealed record OpenClawRunHistoryDto(
|
||||
long Id,
|
||||
Guid RunId,
|
||||
string Action,
|
||||
string FromStatus,
|
||||
string ToStatus,
|
||||
string Message,
|
||||
string Actor,
|
||||
string CorrelationId,
|
||||
string? IdempotencyKey,
|
||||
string? TraceParent,
|
||||
string? GatewayEventId,
|
||||
long? GatewaySequence,
|
||||
bool SequenceGapDetected,
|
||||
Guid? ResultRunId,
|
||||
DateTimeOffset OccurredAt);
|
||||
|
||||
public sealed record OpenClawRunCollectionDto(
|
||||
IReadOnlyList<OpenClawRunDto> Items,
|
||||
string? NextCursor,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
public sealed record OpenClawRunOperationDto(
|
||||
bool Ok,
|
||||
string State,
|
||||
string Message,
|
||||
OpenClawRunDto Run,
|
||||
OpenClawRunDto? ResultRun,
|
||||
DateTimeOffset CompletedAt,
|
||||
OperationResultDto? Operation = null);
|
||||
|
||||
public sealed record OpenClawRunHistoryResponse(
|
||||
OpenClawRunDto Run,
|
||||
IReadOnlyList<OpenClawRunHistoryDto> Transitions,
|
||||
string GatewayHistoryState,
|
||||
JsonNode? GatewayHistory,
|
||||
string? Message,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
public sealed record OpenClawRunQuery(
|
||||
int Limit = 50,
|
||||
string? Cursor = null,
|
||||
string? Status = null,
|
||||
Guid? TaskId = null,
|
||||
Guid? ProjectId = null,
|
||||
string? SessionKey = null);
|
||||
@@ -0,0 +1,154 @@
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Public, secret-free representation of Nexus' single OpenClaw connection profile.
|
||||
/// OpenClaw remains the authority for agents, configuration and scheduled jobs.
|
||||
/// </summary>
|
||||
public sealed record OpenClawSetupStatusDto(
|
||||
string ProfileId,
|
||||
string State,
|
||||
bool ExperimentalBlocked,
|
||||
bool HasProfile,
|
||||
string? Endpoint,
|
||||
string? DiscoverySource,
|
||||
string AdoptionState,
|
||||
bool ManagementEnabled,
|
||||
string? RequiredVersion,
|
||||
string? GatewayVersion,
|
||||
int? ProtocolVersion,
|
||||
string? DeviceId,
|
||||
bool DeviceTokenConfigured,
|
||||
bool PairingRequired,
|
||||
string? PairingRequestId,
|
||||
IReadOnlyList<string> GrantedScopes,
|
||||
IReadOnlyList<string> AdvertisedMethods,
|
||||
string? CapabilityHash,
|
||||
int? Revision,
|
||||
DateTimeOffset? LastProbedAt,
|
||||
DateTimeOffset? LastVerifiedAt,
|
||||
DateTimeOffset? AdoptedAt,
|
||||
DateTimeOffset? UpdatedAt,
|
||||
string? Message,
|
||||
string? Recovery,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
public sealed record OpenClawDiscoveryRequest(bool IncludeMdns = false);
|
||||
|
||||
public sealed record OpenClawDiscoveryCandidateDto(
|
||||
string Endpoint,
|
||||
string Source,
|
||||
bool IsCurrentConnectorEndpoint,
|
||||
bool RequiresTlsFingerprint,
|
||||
bool IsValid,
|
||||
string? Reason);
|
||||
|
||||
public sealed record OpenClawDiscoveryDto(
|
||||
IReadOnlyList<OpenClawDiscoveryCandidateDto> Candidates,
|
||||
string MdnsState,
|
||||
string? Message,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
public sealed record ProbeOpenClawRequest(
|
||||
string Endpoint,
|
||||
string? TlsCertificateFingerprint = null)
|
||||
{
|
||||
public override string ToString()
|
||||
=> $"{nameof(ProbeOpenClawRequest)} {{ EndpointSupplied = {!string.IsNullOrWhiteSpace(Endpoint)}, TlsFingerprintSupplied = {!string.IsNullOrWhiteSpace(TlsCertificateFingerprint)} }}";
|
||||
}
|
||||
|
||||
public sealed record OpenClawProbeDto(
|
||||
string Endpoint,
|
||||
string Source,
|
||||
bool IsCurrentConnectorEndpoint,
|
||||
bool Connected,
|
||||
string? GatewayVersion,
|
||||
string? RequiredVersion,
|
||||
bool VersionMatches,
|
||||
int? ProtocolVersion,
|
||||
string? DeviceId,
|
||||
bool PairingRequired,
|
||||
string? PairingRequestId,
|
||||
IReadOnlyList<string> GrantedScopes,
|
||||
IReadOnlyList<string> AdvertisedMethods,
|
||||
string CapabilityHash,
|
||||
bool CanAttach,
|
||||
bool LeastPrivilegeSatisfied,
|
||||
DateTimeOffset CheckedAt);
|
||||
|
||||
/// <summary>
|
||||
/// Bootstrap credentials are deliberately request-only. The setup profile and all
|
||||
/// response contracts contain no corresponding field, so they cannot be persisted
|
||||
/// or returned to the browser.
|
||||
/// </summary>
|
||||
public sealed record AttachOpenClawRequest(
|
||||
string Endpoint,
|
||||
string DiscoverySource,
|
||||
string? TlsCertificateFingerprint = null,
|
||||
string? BootstrapToken = null,
|
||||
string? BootstrapSecretReference = null)
|
||||
{
|
||||
public override string ToString()
|
||||
=> $"{nameof(AttachOpenClawRequest)} {{ EndpointSupplied = {!string.IsNullOrWhiteSpace(Endpoint)}, DiscoverySourceSupplied = {!string.IsNullOrWhiteSpace(DiscoverySource)}, TlsFingerprintSupplied = {!string.IsNullOrWhiteSpace(TlsCertificateFingerprint)}, BootstrapCredentialSupplied = {!string.IsNullOrWhiteSpace(BootstrapToken) || !string.IsNullOrWhiteSpace(BootstrapSecretReference)} }}";
|
||||
}
|
||||
|
||||
public sealed record VerifyOpenClawRequest(int ExpectedRevision);
|
||||
|
||||
public sealed record AdoptOpenClawRequest(int ExpectedRevision);
|
||||
|
||||
public sealed record SetOpenClawManagementRequest(
|
||||
bool Enabled,
|
||||
bool Confirmed,
|
||||
int ExpectedRevision);
|
||||
|
||||
public sealed record DeleteOpenClawConnectionRequest(
|
||||
string Endpoint,
|
||||
string? DeviceId,
|
||||
int ExpectedRevision);
|
||||
|
||||
public sealed record OpenClawAdoptionInventoryDto(
|
||||
int? AgentCount,
|
||||
int? AgentFileCount,
|
||||
int? CronJobCount,
|
||||
int? ModelCount,
|
||||
int? ChannelCount,
|
||||
int? NodeCount,
|
||||
IReadOnlyList<string> Diagnostics,
|
||||
DateTimeOffset CapturedAt);
|
||||
|
||||
public sealed record OpenClawSetupOperationDto<T>(
|
||||
bool Ok,
|
||||
string State,
|
||||
string Message,
|
||||
T? Data,
|
||||
string? Recovery,
|
||||
DateTimeOffset CompletedAt);
|
||||
|
||||
public static class OpenClawSetupStates
|
||||
{
|
||||
public const string NotConfigured = "not_configured";
|
||||
public const string Discovered = "discovered";
|
||||
public const string Probed = "probed";
|
||||
public const string Attached = "attached";
|
||||
public const string Verified = "verified";
|
||||
public const string Adopted = "adopted";
|
||||
public const string Disconnected = "disconnected";
|
||||
public const string PairingRequired = "pairing_required";
|
||||
public const string ScopeUpgradeRequired = "scope_upgrade_required";
|
||||
public const string ExcessiveScope = "excessive_scope";
|
||||
public const string ExperimentalBlocked = "experimental_blocked";
|
||||
public const string DynamicEndpointUnsupported = "dynamic_endpoint_unsupported";
|
||||
public const string InvalidEndpoint = "invalid_endpoint";
|
||||
public const string InvalidRequest = "invalid_request";
|
||||
public const string ConcurrencyConflict = "concurrency_conflict";
|
||||
public const string NotFound = "not_found";
|
||||
public const string GatewayUnavailable = "gateway_unavailable";
|
||||
public const string Removed = "removed";
|
||||
}
|
||||
|
||||
public static class OpenClawAdoptionStates
|
||||
{
|
||||
public const string None = "none";
|
||||
public const string Attached = "attached";
|
||||
public const string Verified = "verified";
|
||||
public const string Adopted = "adopted";
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
public sealed record StartOpenClawWizardRequest(
|
||||
string Mode = "local",
|
||||
bool Confirmed = false);
|
||||
|
||||
public sealed record AdvanceOpenClawWizardRequest(
|
||||
string SessionId,
|
||||
string? StepId = null,
|
||||
JsonNode? Value = null,
|
||||
bool HasAnswer = true);
|
||||
|
||||
public sealed record OpenClawWizardOptionDto(
|
||||
JsonNode? Value,
|
||||
string Label,
|
||||
string? Hint);
|
||||
|
||||
public sealed record OpenClawWizardDeviceCodeDto(
|
||||
string Code,
|
||||
int? ExpiresInMinutes,
|
||||
string? Message);
|
||||
|
||||
public sealed record OpenClawWizardStepDto(
|
||||
string Id,
|
||||
string Type,
|
||||
string? Title,
|
||||
string? Message,
|
||||
IReadOnlyList<OpenClawWizardOptionDto> Options,
|
||||
JsonNode? InitialValue,
|
||||
string? Placeholder,
|
||||
bool Sensitive,
|
||||
string? Executor,
|
||||
string? ExternalUrl,
|
||||
OpenClawWizardDeviceCodeDto? DeviceCode,
|
||||
bool CanAnswer,
|
||||
string? BlockedReason);
|
||||
|
||||
public sealed record OpenClawWizardResultDto(
|
||||
bool Ok,
|
||||
string State,
|
||||
string Message,
|
||||
string? SessionId,
|
||||
bool Done,
|
||||
string? Status,
|
||||
string? Error,
|
||||
OpenClawWizardStepDto? Step,
|
||||
string? Recovery,
|
||||
DateTimeOffset CompletedAt);
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Transport contract for a Nexus-owned mission scope. Persistence entities
|
||||
/// stay behind the API boundary so OpenAPI remains the frontend authority.
|
||||
/// </summary>
|
||||
public sealed record ProjectDto(
|
||||
Guid Id,
|
||||
string Name,
|
||||
string Description,
|
||||
string Status,
|
||||
int Progress,
|
||||
DateTimeOffset UpdatedAt,
|
||||
OperationResultDto? Operation = null);
|
||||
|
||||
public sealed record ProjectTaskDto(
|
||||
Guid Id,
|
||||
string Title,
|
||||
string State,
|
||||
string Priority,
|
||||
Guid ProjectId,
|
||||
string? AssignedTo,
|
||||
string? ExpectedFrom,
|
||||
bool IsAgentTask,
|
||||
DateTimeOffset UpdatedAt);
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
public sealed record SecurityTokenConfigDto(
|
||||
string Issuer,
|
||||
string Audience,
|
||||
int RefreshTokenDays,
|
||||
int AccessTokenMinutes);
|
||||
|
||||
public sealed record SecurityCookieConfigDto(
|
||||
bool HttpOnly,
|
||||
bool Secure,
|
||||
string SameSite);
|
||||
|
||||
public sealed record SecurityStatusDto(
|
||||
string AuthMethod,
|
||||
SecurityTokenConfigDto TokenConfig,
|
||||
string RateLimit,
|
||||
string PasswordPolicy,
|
||||
SecurityCookieConfigDto CookieConfig,
|
||||
bool TwoFactorEnabled,
|
||||
bool PasskeyEnabled,
|
||||
DateTimeOffset CheckedAt);
|
||||
@@ -0,0 +1,41 @@
|
||||
namespace Nexus.Api.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Compact task representation used by the paged mission-control board.
|
||||
/// Child tasks are represented by their own cards and linked through
|
||||
/// <see cref="ParentTaskId"/> so the client can build the hierarchy in O(n).
|
||||
/// </summary>
|
||||
public sealed record TaskBoardCardDto(
|
||||
Guid Id,
|
||||
string Title,
|
||||
string? Detail,
|
||||
string Source,
|
||||
string State,
|
||||
string Priority,
|
||||
string? AssignedTo,
|
||||
Guid? ParentTaskId,
|
||||
Guid? ProjectId,
|
||||
DateTimeOffset? DueDate,
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset UpdatedAt,
|
||||
bool IsAgentTask,
|
||||
string? ExpectedFrom,
|
||||
string? LastActivityMessage,
|
||||
DateTimeOffset? LastActivityAt,
|
||||
int ChildTaskCount,
|
||||
int OpenChildTaskCount,
|
||||
bool HasVisibleDelegation);
|
||||
|
||||
/// <summary>
|
||||
/// Initial task-board page. Active columns are complete; the Done column is
|
||||
/// keyset-paginated by <c>(UpdatedAt DESC, Id DESC)</c>.
|
||||
/// </summary>
|
||||
public sealed record TaskBoardPageDto(
|
||||
string Revision,
|
||||
IReadOnlyList<TaskBoardCardDto> Offen,
|
||||
IReadOnlyList<TaskBoardCardDto> InProgress,
|
||||
IReadOnlyList<TaskBoardCardDto> Review,
|
||||
IReadOnlyList<TaskBoardCardDto> Blocked,
|
||||
IReadOnlyList<TaskBoardCardDto> Done,
|
||||
string? NextDoneCursor,
|
||||
bool HasMoreDone);
|
||||
Reference in New Issue
Block a user