diff --git a/cron/jobs.json b/cron/jobs.json index b17993f..654ba55 100644 --- a/cron/jobs.json +++ b/cron/jobs.json @@ -269,9 +269,9 @@ "prompt": "Heartbeat check. Rulează src/heartbeat.py printr-un scurt raport de status.\nDacă nu e nimic de raportat (email=0, calendar nu are evenimente <2h, kb ok), răspunde doar cu HEARTBEAT_OK și oprește-te — nu trimite mesaj.\nDacă e ceva: raport scurt pe Discord #echo-work.", "allowed_tools": [], "enabled": true, - "last_run": "2026-05-26T18:00:00.002989+00:00", - "last_status": "error", - "next_run": "2026-05-27T06:00:00+00:00" + "last_run": "2026-05-27T06:00:00.002154+00:00", + "last_status": "ok", + "next_run": "2026-05-27T08:00:00+00:00" }, { "name": "night-execute", diff --git a/image copy.png b/image copy.png deleted file mode 100644 index 9543efe..0000000 Binary files a/image copy.png and /dev/null differ diff --git a/image.png b/image.png deleted file mode 100644 index 997eff4..0000000 Binary files a/image.png and /dev/null differ diff --git a/src/adapters/discord_bot.py b/src/adapters/discord_bot.py index e6f6842..c5d0b9d 100644 --- a/src/adapters/discord_bot.py +++ b/src/adapters/discord_bot.py @@ -913,6 +913,7 @@ def create_bot(config: Config) -> discord.Client: @app_commands.describe( voce="Voce (M1-M5 masculin, F1-F5 feminin; default M2)", text_sau_url="Text direct, URL articol, sau gol pentru ultimul răspuns Echo", + rezumat="Dacă să facă Claude rezumat înainte de TTS (doar pentru URL)", ) @app_commands.choices( voce=[ @@ -932,6 +933,7 @@ def create_bot(config: Config) -> discord.Client: interaction: discord.Interaction, voce: str | None = None, text_sau_url: str | None = None, + rezumat: bool = False, ) -> None: await interaction.response.defer() args: list[str] = [] @@ -939,6 +941,8 @@ def create_bot(config: Config) -> discord.Client: args.append(voce) if text_sau_url: args.extend(text_sau_url.split()) + if rezumat: + args.append("rezumat") result = await asyncio.to_thread(fast_dispatch, "audio", args) if result and result.startswith("__AUDIO__:"): wav_path = result[len("__AUDIO__:"):] diff --git a/src/adapters/telegram_bot.py b/src/adapters/telegram_bot.py index cb8d801..39d8909 100644 --- a/src/adapters/telegram_bot.py +++ b/src/adapters/telegram_bot.py @@ -1135,7 +1135,7 @@ def create_telegram_bot(config: Config, token: str) -> Application: BotCommand("logs", "Show log lines"), BotCommand("doctor", "Diagnostics"), BotCommand("heartbeat", "Health checks"), - BotCommand("audio", "TTS: text → voice note"), + BotCommand("audio", "TTS: text/url → voice note [voce] [rezumat]"), BotCommand("p", "Ralph: propose new project"), BotCommand("a", "Ralph: approve project for tonight"), BotCommand("l", "Ralph: list projects status"), diff --git a/src/fast_commands.py b/src/fast_commands.py index e2d3f30..2404756 100644 --- a/src/fast_commands.py +++ b/src/fast_commands.py @@ -691,9 +691,9 @@ Reminders: Audio: /audio — TTS pe text /audio — Extrage articol → audio - /audio rezumat — Rezumat Claude → audio + /audio rezumat — Rezumat Claude → audio (flag oriunde) /audio — Ultimul răspuns Echo → audio - /audio M2 [text|url|gol] — Voce specificată (M1-M5, F1-F5) + /audio M2 [text|url] [rezumat] — Voce specificată (M1-M5, F1-F5) /audio ajutor — Ajutor detaliat Ops: @@ -736,6 +736,12 @@ def cmd_audio(args: list[str]) -> str: voice = remaining[0].upper() remaining = remaining[1:] + # Detectare flag "rezumat" oriunde în args (indiferent de ordine) + do_summarize = False + if any(t.lower() == "rezumat" for t in remaining): + do_summarize = True + remaining = [t for t in remaining if t.lower() != "rezumat"] + channel_id = _get_ctx_channel() # Determinare text sursă @@ -750,30 +756,29 @@ def cmd_audio(args: list[str]) -> str: elif len(remaining) == 1 and remaining[0].lower() == "ajutor": return ( "🎙️ /audio — Text-to-Speech local (Supertonic)\n\n" - " /audio — TTS pe text dat\n" - " /audio — extrage articol → audio\n" - " /audio rezumat — rezumat Claude → audio\n" - " /audio — ultimul răspuns Echo → audio\n" - " /audio M2 <...> — voce specifică (M1-M5, F1-F5)\n\n" + " /audio — TTS pe text dat\n" + " /audio — extrage articol → audio\n" + " /audio rezumat — rezumat Claude → audio\n" + " /audio — ultimul răspuns Echo → audio\n" + " /audio M2 [text|url] [rezumat] — voce specifică (M1-M5, F1-F5)\n\n" + "Flag rezumat: poate fi pus oriunde în comandă\n" + " /audio rezumat ≡ /audio rezumat ≡ /audio M2 rezumat\n\n" "Voci: M1 M2 M3 M4 M5 (masculin) · F1 F2 F3 F4 F5 (feminin)" ) - elif (len(remaining) >= 2 - and remaining[0].lower() == "rezumat" - and remaining[1].startswith("http")): - url = remaining[1] - extracted = _extract_url_text(url) - if not extracted: - return f"Nu am putut extrage text din URL: {url}" - text = _claude_summarize(extracted) - if not text: - return "Rezumatul a eșuat. Încearcă /audio pentru extragere directă." - elif len(remaining) == 1 and remaining[0].startswith("http"): url = remaining[0] - text = _extract_url_text(url) - if not text: - return f"Nu am putut extrage text din URL: {url}" + if do_summarize: + extracted = _extract_url_text(url) + if not extracted: + return f"Nu am putut extrage text din URL: {url}" + text = _claude_summarize(extracted) + if not text: + return "Rezumatul a eșuat. Încearcă /audio pentru extragere directă." + else: + text = _extract_url_text(url) + if not text: + return f"Nu am putut extrage text din URL: {url}" else: text = " ".join(remaining)