from typing import ClassVar

from resources.base import DOCUMENT, PROJECT, Resource, ResourceDetails
from resources.shapes import FLAG, Field, Shape


class Profile(Shape, Resource):
    data_fields: ClassVar[list[Field]] = [
        Field(default="", name="calling"),
        Field(default="", name="sample"),
        Field(default="", name="introduction"),
        Field(default="", name="humour"),
        Field(default="", name="naming"),
        Field(default="", name="agent_name"),
        Field(default="", name="address"),
        Field(default="", name="art"),
        Field(default="", name="emoji"),
        Field(FLAG, False, name="system"),
        Field(default=dict, name="animation_schedule"),
    ]
    details: ClassVar[ResourceDetails] = ResourceDetails(
        title="Profile",
        abstract="How the agent talks to you: its voice, what it calls you and a sample line",
        help=("A profile's brief is its voice in plain words: the tone, the humour, how it uses your name and when it reacts. "
              "--set calling=\"title and name\", name, none or \"its own words\" says what it calls you, and --set address=\"<words>\" holds those own words; --set humour=\"<how>\" is how it answers a "
              "meme, a joke, criticism or anger; --set naming=\"<how>\" is how it names the helpers and subagents it starts; "
              "--set agent_name=\"<name>\" is the name they address it by, and can be changed on every profile; "
              "--set emoji=\"<faces>\" are the few emoji it reacts with and now and then uses in what it writes, separated by spaces; "
              "--set sample=\"<line>\" is how it answers the sample question, shown in the profile's preview; --set introduction=\"<words>\" is a short 'who am I' in its own voice, shown on its card. The five that ship with the journal "
              "cannot be changed or removed: "
              "journal profile duplicate <n> makes one you can."),
    )
    type = "profile"
    event_labels = {"created": "Profile written", "updated": "Profile changed", "completed": "Profile closed"}
    labels = {"brief": "How it talks"}
    icon = "docs"
    command_names = {"complete": "retire"}
    scope = PROJECT
    view = DOCUMENT
    progress = ("agent_name", "files", "pictures", "animation_schedule")
