package dto

import "time"

type WebAgentRoleSource struct {
	Kind      string `json:"kind"`
	PresetID  string `json:"presetId,omitempty"`
	RoleID    string `json:"roleId,omitempty"`
	VersionID string `json:"versionId,omitempty"`
	Locale    string `json:"locale,omitempty"`
}

type WebAgentCreateFromRoleRequest struct {
	Name            string                         `json:"name"`
	Description     string                         `json:"description"`
	Runtime         string                         `json:"runtime"`
	Model           string                         `json:"model"`
	ReasoningEffort string                         `json:"reasoningEffort"`
	LLMMode         string                         `json:"llmMode,omitempty"`
	BaseURL         string                         `json:"baseUrl,omitempty"`
	APIKey          string                         `json:"apiKey,omitempty"`
	Headers         map[string]string              `json:"headers,omitempty"`
	WireAPI         string                         `json:"wireApi,omitempty"`
	ModelProfileID  string                         `json:"modelProfileId,omitempty"`
	MachineID       string                         `json:"machineId"`
	ChannelIDs      []string                       `json:"channelIds,omitempty"`
	Source          WebAgentRoleSource             `json:"source"`
	RoleDisplayName string                         `json:"roleDisplayName,omitempty"`
	Realization     WebAgentRoleRealizationRequest `json:"realization,omitempty"`
}

type WebAgentApplyRoleRequest struct {
	Source          WebAgentRoleSource             `json:"source"`
	RoleDisplayName string                         `json:"roleDisplayName,omitempty"`
	Realization     WebAgentRoleRealizationRequest `json:"realization,omitempty"`
}

type WebAgentRoleRealizationRequest struct {
	DryRun         bool   `json:"dryRun,omitempty"`
	Apply          bool   `json:"apply,omitempty"`
	SkipOptional   bool   `json:"skipOptional,omitempty"`
	StorageScope   string `json:"storageScope,omitempty"`
	TemplateLocale string `json:"templateLocale,omitempty"`
}

type WebAgentRoleRealizationItemResponse struct {
	ManifestItemType string `json:"manifestItemType"`
	ManifestItemName string `json:"manifestItemName,omitempty"`
	Action           string `json:"action"`
	Status           string `json:"status"`
	ResourceID       string `json:"resourceId,omitempty"`
	AccessLevel      string `json:"accessLevel,omitempty"`
	Branch           string `json:"branch,omitempty"`
	Message          string `json:"message,omitempty"`
	Required         bool   `json:"required"`
}

type WebAgentRoleRealizationResponse struct {
	RoleID  string                                `json:"roleId"`
	AgentID string                                `json:"agentId"`
	DryRun  bool                                  `json:"dryRun"`
	Apply   bool                                  `json:"apply"`
	Items   []WebAgentRoleRealizationItemResponse `json:"items"`
}

type WebAgentCreateFromRoleResponse struct {
	Agent       AppAgent                        `json:"agent"`
	Source      WebAgentRoleSource              `json:"source"`
	Partial     bool                            `json:"partial"`
	Realization WebAgentRoleRealizationResponse `json:"realization"`
	CreatedAt   time.Time                       `json:"createdAt,omitempty"`
}

type WebAgentApplyRoleResponse struct {
	Agent       AppAgent                        `json:"agent"`
	Source      WebAgentRoleSource              `json:"source"`
	Partial     bool                            `json:"partial"`
	Realization WebAgentRoleRealizationResponse `json:"realization"`
	AppliedAt   time.Time                       `json:"appliedAt,omitempty"`
}
