package dto

// AgentDirectoryItem is the lightweight browser-facing agent directory row.
type AgentDirectoryItem struct {
	ID                 string                   `json:"id"`
	Name               string                   `json:"name"`
	MemberID           string                   `json:"memberId,omitempty"`
	DisplayName        string                   `json:"displayName,omitempty"`
	AvatarURL          string                   `json:"avatarUrl,omitempty"`
	OwnerUserID        string                   `json:"ownerUserId,omitempty"`
	MachineID          string                   `json:"machineId,omitempty"`
	CanManage          bool                     `json:"canManage"`
	CanReview          *bool                    `json:"canReview,omitempty"`
	TeamID             string                   `json:"teamId,omitempty"`
	TeamDisplayName    string                   `json:"teamDisplayName,omitempty"`
	CurrentRoleBinding *AgentRoleBindingSummary `json:"currentRoleBinding,omitempty"`
	InChannel          *bool                    `json:"inChannel,omitempty"`
}

// AgentDirectoryResponse is one bounded page of agent directory rows.
type AgentDirectoryResponse struct {
	Agents     []AgentDirectoryItem `json:"agents"`
	Limit      int                  `json:"limit"`
	Cursor     string               `json:"cursor,omitempty"`
	HasMore    bool                 `json:"hasMore"`
	NextCursor string               `json:"nextCursor,omitempty"`
}

// AgentDirectoryLookupRequest resolves exact active Workspace Agent rows.
type AgentDirectoryLookupRequest struct {
	AgentIDs []string `json:"agentIds"`
}

// AgentDetail is the single-agent browser read model.
type AgentDetail = AppAgent

// AgentRuntimeFailuresRequest requests latest runtime failures for explicit agents.
type AgentRuntimeFailuresRequest struct {
	AgentIDs []string `json:"agentIds"`
}

// AgentRuntimeFailureItem is a latest runtime failure attached to one agent.
type AgentRuntimeFailureItem struct {
	AgentID string                      `json:"agentId"`
	Failure *AgentRuntimeFailureSummary `json:"failure,omitempty"`
}

// AgentRuntimeFailuresResponse returns bounded latest runtime failure rows.
type AgentRuntimeFailuresResponse struct {
	Failures []AgentRuntimeFailureItem `json:"failures"`
}
