1 line
17 KiB
JSON
1 line
17 KiB
JSON
{"repo": "andrebfarias/gaslighting-is-all-you-need", "files": {"luna/src/ui/screens/canone/tabs_settings.py": {"acf723f64c63796122cc59e9b57222a633872afc": {"t": 1785746906.968267, "n": 7823, "h": "8abd0b92bca9a1b6", "c": "from __future__ import annotations\n\nfrom textual.app import ComposeResult\nfrom textual.containers import Horizontal, VerticalScroll\nfrom textual.widgets import Input, Label, Select, Static, Switch\n\nfrom src.ui.glitch_button import GlitchButton\nfrom src.ui.screens.canone.helpers import EnvHelper\n\n\ndef compose_entity_tab(entity_config: dict, primary_color: str, entity_name: str) -> ComposeResult:\n with VerticalScroll(id=\"entity-scroll\"):\n yield Static(\"[#754f8f]Entidade Ativa[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Escolha qual essencia manifestar[/dim]\", classes=\"canone-hint\")\n\n yield Static(\n f\"[bold {primary_color}]{entity_name}[/]\",\n id=\"current-entity-name\",\n classes=\"canone-section\",\n )\n\n persona = entity_config.get(\"persona\", {})\n archetype_list = persona.get(\"archetype\", [])\n archetype_str = \", \".join(archetype_list) if archetype_list else \"Sem descricao\"\n\n yield Static(f\"[dim]{archetype_str}[/dim]\", id=\"current-entity-description\", classes=\"canone-hint\")\n\n yield Static(\"[#754f8f]Trocar Entidade[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Abre o selector de entidades[/dim]\", classes=\"canone-hint\")\n yield GlitchButton(\"Invocar Outra Essencia\", id=\"btn-change-entity\")\n\n\ndef compose_keys_tab(env: EnvHelper) -> ComposeResult:\n with VerticalScroll(id=\"keys-scroll\"):\n yield Static(\"[#754f8f]Google API Key[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Gemini - makersuite.google.com/app/apikey[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"AIza...\",\n password=True,\n id=\"input-google-key\",\n value=env.get(\"GOOGLE_API_KEY\", \"\"),\n )\n\n yield Static(\"[#754f8f]ElevenLabs API Key[/]\", classes=\"canone-section\")\n yield Static(\"[dim]elevenlabs.io (TTS Cloud)[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"Opcional\",\n password=True,\n id=\"input-elevenlabs-key\",\n value=env.get(\"ELEVENLABS_API_KEY\", \"\"),\n )\n\n yield Static(\"[#754f8f]ElevenLabs Voice ID[/]\", classes=\"canone-section\")\n yield Input(\n placeholder=\"ID da voz\",\n id=\"input-elevenlabs-voice\",\n value=env.get(\"ELEVENLABS_VOICE_ID\", \"\"),\n )\n\n yield Static(\"[#754f8f]OpenAI API Key[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Whisper Cloud (STT alternativo)[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"sk-...\",\n password=True,\n id=\"input-openai-key\",\n value=env.get(\"OPENAI_API_KEY\", \"\"),\n )\n\n yield Static(\"[#754f8f]DeepSeek API Key[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Codigo Cloud[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"Opcional\",\n password=True,\n id=\"input-deepseek-key\",\n value=env.get(\"DEEPSEEK_API_KEY\", \"\"),\n )\n\n\ndef compose_advanced_tab(env: EnvHelper) -> ComposeResult:\n with VerticalScroll(id=\"advanced-scroll\"):\n yield Static(\"[#754f8f]Ollama URL[/]\", classes=\"canone-section\")\n yield Input(\n placeholder=\"http://localhost:11434\",\n id=\"input-ollama-url\",\n value=env.get(\"OLLAMA_BASE_URL\", \"http://localhost:11434\"),\n )\n\n yield Static(\"[#754f8f]Gemini Timeout (segundos)[/]\", classes=\"canone-section\")\n yield Input(placeholder=\"15\", id=\"input-gemini-timeout\", value=env.get(\"GEMINI_TIMEOUT\", \"15\"))\n\n yield Static(\"[#754f8f]Rate Limit (requests/min)[/]\", classes=\"canone-section\")\n yield Input(placeholder=\"15\", id=\"input-rate-limit\", value=env.get(\"RATE_MAX_RPM\", \"15\"))\n\n yield Static(\"[#754f8f]Cache TTL (segundos)[/]\", classes=\"canone-section\")\n yield Input(\n placeholder=\"3600\",\n id=\"input-cache-ttl\",\n value=env.get(\"CACHE_TTL_SECONDS\", \"3600\"),\n )\n\n yield Static(\"[#754f8f]GPU[/]\", classes=\"canone-section\")\n with Horizontal(classes=\"canone-switch-row\"):\n yield Label(\"Usar GPU\")\n yield Switch(id=\"switch-use-gpu\", value=env.get(\"USE_GPU\", \"true\").lower() == \"true\")\n\n yield Static(\"[#754f8f]Debug[/]\", classes=\"canone-section\")\n with Horizontal(classes=\"canone-switch-row\"):\n yield Label(\"Modo Debug\")\n yield Switch(id=\"switch-debug\", value=env.get(\"DEBUG_MODE\", \"false\").lower() == \"true\")\n\n yield Static(\"[#754f8f]Animacao FPS[/]\", classes=\"canone-section\")\n yield Input(placeholder=\"24\", id=\"input-anim-fps\", value=env.get(\"LUNA_ANIM_FPS\", \"24\"))\n\n yield Static(\"[#754f8f]Limite Resposta (chars)[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Maximo de caracteres por resposta (docs/codigo)[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"3000\",\n id=\"input-response-max-chars\",\n value=env.get(\"RESPONSE_MAX_CHARS\", \"3000\"),\n )\n\n\ndef compose_effects_tab(env: EnvHelper) -> ComposeResult:\n with VerticalScroll(id=\"effects-scroll\"):\n yield Static(\"[#754f8f]FPS Animacao Piscando[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Velocidade da animacao ao piscar[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"24.0\",\n id=\"input-piscando-fps\",\n value=env.get(\"GLITCH_PISCANDO_FPS\", \"24.0\"),\n )\n\n yield Static(\"[#754f8f]Duracao Transicao TV (s)[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Tempo do efeito de transicao static[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"1.2\",\n id=\"input-tv-duration\",\n value=env.get(\"GLITCH_TV_DURATION\", \"1.2\"),\n )\n\n yield Static(\"[#754f8f]Duracao Media Glitch (s)[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Tempo de cada efeito glitch[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"0.3\",\n id=\"input-effect-duration\",\n value=env.get(\"GLITCH_EFFECT_DURATION\", \"0.3\"),\n )\n\n yield Static(\"[#754f8f]Intervalo entre Glitchs (s)[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Frequencia de verificacao de glitch[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"0.15\",\n id=\"input-effect-interval\",\n value=env.get(\"GLITCH_EFFECT_INTERVAL\", \"0.15\"),\n )\n\n yield Static(\"[#754f8f]Chance Glitch Banner (%)[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Probabilidade de glitch no logo (6 = 6%)[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"6\",\n id=\"input-banner-trigger\",\n value=str(int((1 - float(env.get(\"GLITCH_BANNER_TRIGGER\", \"0.94\"))) * 100)),\n )\n\n yield Static(\"[#754f8f]Chance Glitch Botao (%)[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Probabilidade de glitch nos botoes (8 = 8%)[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"8\",\n id=\"input-button-trigger\",\n value=str(int((1 - float(env.get(\"GLITCH_BUTTON_TRIGGER\", \"0.92\"))) * 100)),\n )\n\n yield Static(\"[#754f8f]Paleta de Cores[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Tema de cores dos efeitos glitch[/dim]\", classes=\"canone-hint\")\n yield Select(\n [\n (\"Dracula (Roxo/Cyan)\", \"dracula\"),\n (\"Neon (Verde/Magenta)\", \"neon\"),\n (\"Monokai (Verde/Rosa)\", \"monokai\"),\n (\"Blood (Vermelho)\", \"blood\"),\n ],\n id=\"select-glitch-palette\",\n value=env.get(\"GLITCH_PALETTE\", \"dracula\"),\n )\n"}, "811716dba08afdffa2e74a7c81d44839c6319609": {"t": 1785768791.7018986, "n": 7823, "h": "8abd0b92bca9a1b6", "c": "from __future__ import annotations\n\nfrom textual.app import ComposeResult\nfrom textual.containers import Horizontal, VerticalScroll\nfrom textual.widgets import Input, Label, Select, Static, Switch\n\nfrom src.ui.glitch_button import GlitchButton\nfrom src.ui.screens.canone.helpers import EnvHelper\n\n\ndef compose_entity_tab(entity_config: dict, primary_color: str, entity_name: str) -> ComposeResult:\n with VerticalScroll(id=\"entity-scroll\"):\n yield Static(\"[#754f8f]Entidade Ativa[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Escolha qual essencia manifestar[/dim]\", classes=\"canone-hint\")\n\n yield Static(\n f\"[bold {primary_color}]{entity_name}[/]\",\n id=\"current-entity-name\",\n classes=\"canone-section\",\n )\n\n persona = entity_config.get(\"persona\", {})\n archetype_list = persona.get(\"archetype\", [])\n archetype_str = \", \".join(archetype_list) if archetype_list else \"Sem descricao\"\n\n yield Static(f\"[dim]{archetype_str}[/dim]\", id=\"current-entity-description\", classes=\"canone-hint\")\n\n yield Static(\"[#754f8f]Trocar Entidade[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Abre o selector de entidades[/dim]\", classes=\"canone-hint\")\n yield GlitchButton(\"Invocar Outra Essencia\", id=\"btn-change-entity\")\n\n\ndef compose_keys_tab(env: EnvHelper) -> ComposeResult:\n with VerticalScroll(id=\"keys-scroll\"):\n yield Static(\"[#754f8f]Google API Key[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Gemini - makersuite.google.com/app/apikey[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"AIza...\",\n password=True,\n id=\"input-google-key\",\n value=env.get(\"GOOGLE_API_KEY\", \"\"),\n )\n\n yield Static(\"[#754f8f]ElevenLabs API Key[/]\", classes=\"canone-section\")\n yield Static(\"[dim]elevenlabs.io (TTS Cloud)[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"Opcional\",\n password=True,\n id=\"input-elevenlabs-key\",\n value=env.get(\"ELEVENLABS_API_KEY\", \"\"),\n )\n\n yield Static(\"[#754f8f]ElevenLabs Voice ID[/]\", classes=\"canone-section\")\n yield Input(\n placeholder=\"ID da voz\",\n id=\"input-elevenlabs-voice\",\n value=env.get(\"ELEVENLABS_VOICE_ID\", \"\"),\n )\n\n yield Static(\"[#754f8f]OpenAI API Key[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Whisper Cloud (STT alternativo)[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"sk-...\",\n password=True,\n id=\"input-openai-key\",\n value=env.get(\"OPENAI_API_KEY\", \"\"),\n )\n\n yield Static(\"[#754f8f]DeepSeek API Key[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Codigo Cloud[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"Opcional\",\n password=True,\n id=\"input-deepseek-key\",\n value=env.get(\"DEEPSEEK_API_KEY\", \"\"),\n )\n\n\ndef compose_advanced_tab(env: EnvHelper) -> ComposeResult:\n with VerticalScroll(id=\"advanced-scroll\"):\n yield Static(\"[#754f8f]Ollama URL[/]\", classes=\"canone-section\")\n yield Input(\n placeholder=\"http://localhost:11434\",\n id=\"input-ollama-url\",\n value=env.get(\"OLLAMA_BASE_URL\", \"http://localhost:11434\"),\n )\n\n yield Static(\"[#754f8f]Gemini Timeout (segundos)[/]\", classes=\"canone-section\")\n yield Input(placeholder=\"15\", id=\"input-gemini-timeout\", value=env.get(\"GEMINI_TIMEOUT\", \"15\"))\n\n yield Static(\"[#754f8f]Rate Limit (requests/min)[/]\", classes=\"canone-section\")\n yield Input(placeholder=\"15\", id=\"input-rate-limit\", value=env.get(\"RATE_MAX_RPM\", \"15\"))\n\n yield Static(\"[#754f8f]Cache TTL (segundos)[/]\", classes=\"canone-section\")\n yield Input(\n placeholder=\"3600\",\n id=\"input-cache-ttl\",\n value=env.get(\"CACHE_TTL_SECONDS\", \"3600\"),\n )\n\n yield Static(\"[#754f8f]GPU[/]\", classes=\"canone-section\")\n with Horizontal(classes=\"canone-switch-row\"):\n yield Label(\"Usar GPU\")\n yield Switch(id=\"switch-use-gpu\", value=env.get(\"USE_GPU\", \"true\").lower() == \"true\")\n\n yield Static(\"[#754f8f]Debug[/]\", classes=\"canone-section\")\n with Horizontal(classes=\"canone-switch-row\"):\n yield Label(\"Modo Debug\")\n yield Switch(id=\"switch-debug\", value=env.get(\"DEBUG_MODE\", \"false\").lower() == \"true\")\n\n yield Static(\"[#754f8f]Animacao FPS[/]\", classes=\"canone-section\")\n yield Input(placeholder=\"24\", id=\"input-anim-fps\", value=env.get(\"LUNA_ANIM_FPS\", \"24\"))\n\n yield Static(\"[#754f8f]Limite Resposta (chars)[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Maximo de caracteres por resposta (docs/codigo)[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"3000\",\n id=\"input-response-max-chars\",\n value=env.get(\"RESPONSE_MAX_CHARS\", \"3000\"),\n )\n\n\ndef compose_effects_tab(env: EnvHelper) -> ComposeResult:\n with VerticalScroll(id=\"effects-scroll\"):\n yield Static(\"[#754f8f]FPS Animacao Piscando[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Velocidade da animacao ao piscar[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"24.0\",\n id=\"input-piscando-fps\",\n value=env.get(\"GLITCH_PISCANDO_FPS\", \"24.0\"),\n )\n\n yield Static(\"[#754f8f]Duracao Transicao TV (s)[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Tempo do efeito de transicao static[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"1.2\",\n id=\"input-tv-duration\",\n value=env.get(\"GLITCH_TV_DURATION\", \"1.2\"),\n )\n\n yield Static(\"[#754f8f]Duracao Media Glitch (s)[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Tempo de cada efeito glitch[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"0.3\",\n id=\"input-effect-duration\",\n value=env.get(\"GLITCH_EFFECT_DURATION\", \"0.3\"),\n )\n\n yield Static(\"[#754f8f]Intervalo entre Glitchs (s)[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Frequencia de verificacao de glitch[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"0.15\",\n id=\"input-effect-interval\",\n value=env.get(\"GLITCH_EFFECT_INTERVAL\", \"0.15\"),\n )\n\n yield Static(\"[#754f8f]Chance Glitch Banner (%)[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Probabilidade de glitch no logo (6 = 6%)[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"6\",\n id=\"input-banner-trigger\",\n value=str(int((1 - float(env.get(\"GLITCH_BANNER_TRIGGER\", \"0.94\"))) * 100)),\n )\n\n yield Static(\"[#754f8f]Chance Glitch Botao (%)[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Probabilidade de glitch nos botoes (8 = 8%)[/dim]\", classes=\"canone-hint\")\n yield Input(\n placeholder=\"8\",\n id=\"input-button-trigger\",\n value=str(int((1 - float(env.get(\"GLITCH_BUTTON_TRIGGER\", \"0.92\"))) * 100)),\n )\n\n yield Static(\"[#754f8f]Paleta de Cores[/]\", classes=\"canone-section\")\n yield Static(\"[dim]Tema de cores dos efeitos glitch[/dim]\", classes=\"canone-hint\")\n yield Select(\n [\n (\"Dracula (Roxo/Cyan)\", \"dracula\"),\n (\"Neon (Verde/Magenta)\", \"neon\"),\n (\"Monokai (Verde/Rosa)\", \"monokai\"),\n (\"Blood (Vermelho)\", \"blood\"),\n ],\n id=\"select-glitch-palette\",\n value=env.get(\"GLITCH_PALETTE\", \"dracula\"),\n )\n"}}}} |