package dto

// SkillResponse is the JSON response for skill endpoints.
type SkillResponse struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	Version     string   `json:"version,omitempty"`
	Author      string   `json:"author,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	FileName    string   `json:"fileName"`
	CreatedAt   *string  `json:"createdAt,omitempty"`
}

// SkillImportRequest is the JSON request body for importing a skill
// with metadata when the file lacks front-matter.
type SkillImportRequest struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	Version     string   `json:"version,omitempty"`
	Author      string   `json:"author,omitempty"`
	Tags        []string `json:"tags,omitempty"`
}

// BatchImportResult records the outcome of a single skill during batch import.
type BatchImportResult struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Status string `json:"status"` // "created", "skipped_exists", "overwritten"
}

// BatchImportResponse is the aggregate result returned by batch import.
type BatchImportResponse struct {
	Imported []BatchImportResult `json:"imported"`
	Created  int                 `json:"created"`
	Skipped  int                 `json:"skipped"`
	Errors   []string            `json:"errors,omitempty"`
}

// SkillFileNode is one file or directory in a skill content tree.
type SkillFileNode struct {
	Name       string          `json:"name"`
	Path       string          `json:"path"`
	IsDir      bool            `json:"isDir"`
	Size       int64           `json:"size,omitempty"`
	ModifiedAt string          `json:"modifiedAt,omitempty"`
	Children   []SkillFileNode `json:"children,omitempty"`
}

// SkillFilesTreeResponse is the JSON response for listing a skill content tree.
type SkillFilesTreeResponse struct {
	Root      string          `json:"root"`
	Nodes     []SkillFileNode `json:"nodes"`
	Truncated bool            `json:"truncated,omitempty"`
}

// SkillFileResponse is the JSON response for previewing one skill file.
type SkillFileResponse struct {
	Path       string `json:"path"`
	Name       string `json:"name"`
	Size       int64  `json:"size"`
	ModifiedAt string `json:"modifiedAt,omitempty"`
	Content    string `json:"content,omitempty"`
	Binary     bool   `json:"binary,omitempty"`
	Truncated  bool   `json:"truncated,omitempty"`
}
