Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(explorer): ask before moving or deleting, and undo file actions with Ctrl+Z (#757)
Ruben Lütke2138fce1a899
diff --git a/dodaios/agentic_ide/delete_undo.py b/dodaios/agentic_ide/delete_undo.pynew file mode 100644index 0000000000..cca7c0950e--- /dev/null+++ b/dodaios/agentic_ide/delete_undo.py@@ -0,0 +1,154 @@+"""Bring back what the editor's explorer deleted, for its Undo.++A delete still goes to the system trash (or is permanent where there is none),+but the trash has no portable "put it back" call. So before the explorer+deletes an entry, a copy of it is kept here under a random token; Undo moves+that copy back to where the entry was.++Only small entries are kept (a deleted ``node_modules`` is restored from the+trash by hand, as before). Copies live in the per-user data directory, one+folder per IDE instance, and are dropped after a day or when more than+:data:`MAX_KEPT` are held.+"""++from __future__ import annotations++import json+import os+import re+import secrets+import shutil+import time+from pathlib import Path++from loguru import logger++from dodaios.core.instance import current_instance+from dodaios.core.paths import user_data_dir++from .file_editing import EditError, _resolve_entry++__all__ = ["MAX_KEPT", "MAX_UNDO_BYTES", "MAX_UNDO_FILES", "discard", "keep", "restore"]++#: Entries larger than this are not kept; Undo then points to the trash.+MAX_UNDO_BYTES = 64 * 1024 * 1024+MAX_UNDO_FILES = 2000+#: How many deletes Undo can reach back, across workspaces.+MAX_KEPT = 30+MAX_AGE_S = 24 * 3600++_TOKEN = re.compile(r"^[0-9a-f]{24}$")+_ENTRY = "entry"+_META = "meta.json"+++def _store_root() -> Path:+ return user_data_dir() / f"explorer-undo{current_instance().state_file_suffix}"+++def _root_key(root: str | os.PathLike[str]) -> str:+ return os.path.normcase(os.path.realpath(os.fspath(root)))+++def _small_enough(target: Path) -> bool:+ """True when ``target`` fits the size and file-count limits."""+ if target.is_symlink() or target.is_file():+ try:+ return target.lstat().st_size <= MAX_UNDO_BYTES+ except OSError: # unreadable size: not kept, the delete still goes to the trash+ return False+ total = 0+ files = 0+ for current, dirs, names in os.walk(target, followlinks=False):+ files += len(names) + len(dirs)+ if files > MAX_UNDO_FILES:+ return False+ for name in names:+ try:+ total += os.lstat(os.path.join(current, name)).st_size+ except OSError: # unreadable size: not kept, the delete still goes to the trash+ return False+ if total > MAX_UNDO_BYTES:+ return False+ return True+++def _prune(store: Path) -> None:+ try:+ held = [entry for entry in store.iterdir() if entry.is_dir()]+ except OSError: # no store yet, or unreadable: nothing to prune now, the next keep tries again+ return+ now = time.time()++ def age(entry: Path) -> float:+ try:+ return entry.stat().st_mtime+ except OSError: # vanished meanwhile: oldest, so it is pruned first+ return 0.0++ held.sort(key=age, reverse=True)+ for index, entry in enumerate(held):+ if index >= MAX_KEPT or now - age(entry) > MAX_AGE_S:+ shutil.rmtree(entry, ignore_errors=True)+++def keep(root: str | os.PathLike[str], path: str) -> str | None:+ """Copy the entry at ``path`` aside before a delete; returns its token.++ None when it is too large to keep or the copy failed: the delete still+ goes ahead, it just cannot be undone from the editor.+ """+ relative, target = _resolve_entry(root, path)+ if not (target.is_symlink() or target.exists()):+ raise EditError("That file or folder no longer exists.")+ if not _small_enough(target):+ return None+ store = _store_root()+ token = secrets.token_hex(12)+ folder = store / token+ try:+ folder.mkdir(parents=True)+ copy = folder / _ENTRY+ if target.is_dir() and not target.is_symlink():+ shutil.copytree(target, copy, symlinks=True)+ else:+ shutil.copy2(target, copy, follow_symlinks=False)+ meta = {"root": _root_key(root), "path": relative, "created": time.time()}+ (folder / _META).write_text(json.dumps(meta), encoding="utf-8")+ except OSError as exc:+ logger.info("Explorer undo: could not keep a copy of {}: {}", target.name, exc)+ shutil.rmtree(folder, ignore_errors=True)+ return None+ _prune(store)+ return token+++def discard(token: str | None) -> None:+ """Drop a kept copy (its delete failed, so there is nothing to undo)."""+ if token and _TOKEN.match(token):+ shutil.rmtree(_store_root() / token, ignore_errors=True)+++def restore(root: str | os.PathLike[str], token: str) -> str:+ """Put a kept entry back where it was deleted; returns its relative path."""+ if not _TOKEN.match(token):+ raise EditError("That delete can no longer be undone.")+ folder = _store_root() / token+ try:+ meta = json.loads((folder / _META).read_text(encoding="utf-8"))+ except (OSError, ValueError) as exc:+ raise EditError("That delete can no longer be undone.") from exc+ if meta.get("root") != _root_key(root) or not isinstance(meta.get("path"), str):+ raise EditError("That delete belongs to another workspace.")+ relative, target = _resolve_entry(root, meta["path"])+ if target.exists() or target.is_symlink():+ raise EditError("Something with that name already exists.")+ if not target.parent.is_dir():+ raise EditError("The folder it was in no longer exists.")+ copy = folder / _ENTRY+ if not (copy.exists() or copy.is_symlink()):+ raise EditError("That delete can no longer be undone.")+ # A move within one disk; a copy when the data folder is on another.+ shutil.move(str(copy), str(target))+ shutil.rmtree(folder, ignore_errors=True)+ return relativediff --git a/dodaios/agentic_ide/file_editing.py b/dodaios/agentic_ide/file_editing.pyindex 94c31338a4..c37d8c4fa0 100644--- a/dodaios/agentic_ide/file_editing.py+++ b/dodaios/agentic_ide/file_editing.py@@ -41,6 +41,7 @@ from dodaios.core.path_safety import UnsafePathError, contained_pathfrom dodaios.core.process_utils import NO_WINDOW_CREATIONFLAGSfrom .folders import _SKIP_DIRS+from .system_trash import move_to_trashlog = logging.getLogger(__name__)@@ -565,21 +566,14 @@ class TrashUnavailable(EditError):def _move_to_trash(target: Path) -> bool:"""Send ``target`` to the system trash; False when this machine has none.- ``send2trash`` covers the Windows Recycle Bin, the macOS Trash and the- freedesktop trash on Linux. It is optional: a headless server without it- (or without a trash folder) gets an honest "permanent delete?" question- from the editor instead of a silent permanent delete.+ A machine without a trash (a headless server) gets an honest "permanent+ delete?" question from the editor instead of a silent permanent delete."""try:- from send2trash import send2trash # type: ignore[import-not-found]- except ImportError: # no trash support: the editor asks before a permanent delete- return False- try:- send2trash(str(target))+ return move_to_trash(target)except OSError as exc:logger.info("Editor delete: system trash refused {}: {}", target.name, exc)return False- return Truedef delete_entry(root: str | os.PathLike[str], path: str, *, permanent: bool = False) -> bool:diff --git a/dodaios/agentic_ide/scm.py b/dodaios/agentic_ide/scm.pyindex 63e1a46a2f..27570643e6 100644--- a/dodaios/agentic_ide/scm.py+++ b/dodaios/agentic_ide/scm.py@@ -422,16 +422,13 @@ def unstage_all(folder: str | Path) -> None:def _trash(target: Path) -> bool:"""Move an untracked file to the system trash; False when there is none."""+ from .system_trash import move_to_trash+try:- from send2trash import send2trash # type: ignore[import-not-found]- except ImportError: # no trash support on this machine: the caller deletes for good- return False- try:- send2trash(str(target))+ return move_to_trash(target)except OSError as exc:logger.info("Source control: the trash refused {}: {}", target.name, exc)return False- return Truedef _remove_untracked(root: Path, rel: str) -> None:diff --git a/dodaios/agentic_ide/system_trash.py b/dodaios/agentic_ide/system_trash.pynew file mode 100644index 0000000000..b0eb8f6941--- /dev/null+++ b/dodaios/agentic_ide/system_trash.py@@ -0,0 +1,65 @@+"""Send a file or folder to the system trash.++``send2trash`` covers the Windows Recycle Bin, the macOS Trash and the+freedesktop trash on Linux. It is an optional import: an install that lacks+it still gets the Recycle Bin on Windows through the shell's own+``SHFileOperationW``. Elsewhere, without the package, there is no trash and+the caller asks before a permanent delete.+"""++from __future__ import annotations++import os+import sys+from pathlib import Path++__all__ = ["move_to_trash"]++_FO_DELETE = 3+_FOF_SILENT = 0x0004+_FOF_NOCONFIRMATION = 0x0010+_FOF_ALLOWUNDO = 0x0040+_FOF_NOERRORUI = 0x0400+++def _windows_recycle(target: Path) -> bool:+ """Recycle ``target`` with the Windows shell; False when the shell refuses."""+ import ctypes+ from ctypes import wintypes++ class _FileOp(ctypes.Structure):+ _fields_ = [+ ("hwnd", wintypes.HWND),+ ("wFunc", wintypes.UINT),+ ("pFrom", wintypes.LPCWSTR),+ ("pTo", wintypes.LPCWSTR),+ ("fFlags", ctypes.c_uint16),+ ("fAnyOperationsAborted", wintypes.BOOL),+ ("hNameMappings", ctypes.c_void_p),+ ("lpszProgressTitle", wintypes.LPCWSTR),+ ]++ operation = _FileOp()+ operation.wFunc = _FO_DELETE+ # The list of paths ends with an empty one: a second NUL after the last.+ operation.pFrom = os.path.abspath(target) + "\0"+ operation.fFlags = _FOF_ALLOWUNDO | _FOF_NOCONFIRMATION | _FOF_NOERRORUI | _FOF_SILENT+ result = ctypes.windll.shell32.SHFileOperationW(ctypes.byref(operation)) # type: ignore[attr-defined]+ return result == 0 and not operation.fAnyOperationsAborted and not os.path.lexists(target)+++def move_to_trash(target: Path) -> bool:+ """Move ``target`` to the system trash; False when this machine has none.++ Raises OSError when a trash exists but refused the entry.+ """+ try:+ from send2trash import send2trash # type: ignore[import-not-found]+ except ImportError:+ if sys.platform == "win32":+ if _windows_recycle(target):+ return True+ raise OSError("the Recycle Bin refused it") from None+ return False+ send2trash(str(target))+ return Truediff --git a/dodaios/ui/web/agentic_ide_routes.py b/dodaios/ui/web/agentic_ide_routes.pyindex 7c30a0e56e..be919434f8 100644--- a/dodaios/ui/web/agentic_ide_routes.py+++ b/dodaios/ui/web/agentic_ide_routes.py@@ -84,6 +84,7 @@ from pydantic import BaseModel, Fieldfrom dodaios.agentic_ide import (agent_transcript,change_authors,+ delete_undo,drop_analysis,drops,editor_backups,@@ -1136,6 +1137,12 @@ class DeleteWorkspaceEntryRequest(BaseModel):permanent: bool = False+class RestoreWorkspaceEntryRequest(BaseModel):+ """Undo a delete: put the copy kept under ``token`` back where it was."""++ token: str = Field(min_length=1, max_length=64)++class SearchResponse(BaseModel):query: strentries: list[FolderItem]@@ -2565,22 +2572,54 @@ async def copy_workspace_entry(async def delete_workspace_entry(workspace_id: str, req: DeleteWorkspaceEntryRequest) -> dict[str, object]:- """Move to the system trash; 409 ``trash_unavailable`` asks for a permanent delete."""+ """Move to the system trash; 409 ``trash_unavailable`` asks for a permanent delete.++ A copy of a small entry is kept first; ``undo_token`` (null when it was+ too large) lets the explorer's Undo put it back.+ """folder = _workspace_folder(workspace_id)+ token: str | None = Nonetry:+ token = await asyncio.to_thread(delete_undo.keep, folder, req.path)trashed = await asyncio.to_thread(file_editing.delete_entry, folder, req.path, permanent=req.permanent)except file_editing.TrashUnavailable as exc:+ await asyncio.to_thread(delete_undo.discard, token)raise HTTPException(status_code=409, detail={"message": str(exc), "trash_unavailable": True}) from excexcept file_editing.EditError as exc:+ await asyncio.to_thread(delete_undo.discard, token)raise HTTPException(status_code=404, detail=str(exc)) from excexcept OSError as exc:+ await asyncio.to_thread(delete_undo.discard, token)log.warning("Agentic IDE editor: delete failed for %s: %s", req.path, exc)raise HTTPException(status_code=500, detail="It could not be deleted.") from exc- return {"workspace_id": workspace_id, "path": req.path, "trashed": trashed}+ return {+ "workspace_id": workspace_id,+ "path": req.path,+ "trashed": trashed,+ "undo_token": token,+ }+++ "/workspaces/{workspace_id}/entries/restore",+ summary="Undo a delete in a workspace",+)+async def restore_workspace_entry(+ workspace_id: str, req: RestoreWorkspaceEntryRequest+) -> dict[str, object]:+ folder = _workspace_folder(workspace_id)+ try:+ restored = await asyncio.to_thread(delete_undo.restore, folder, req.token)+ except file_editing.EditError as exc:+ raise HTTPException(status_code=409, detail=str(exc)) from exc+ except OSError as exc:+ log.warning("Agentic IDE editor: restore failed: %s", exc)+ raise HTTPException(status_code=500, detail="It could not be restored.") from exc+ return {"workspace_id": workspace_id, "path": restored}async def _launch_terminal_target(diff --git a/dodaios/ui/web/dist/assets/de-97Arhrvu.js b/dodaios/ui/web/dist/assets/de-97Arhrvu.jsnew file mode 100644index 0000000000..9154e0450e--- /dev/null+++ b/dodaios/ui/web/dist/assets/de-97Arhrvu.js@@ -0,0 +1 @@+const e={subtitle:"Live-Gespräche laufen über OpenAI GPT-Live oder, wenn du umschaltest, über die Pipeline. Die Agenten laufen über jedes Abo und jeden Schlüssel, den du hier einschaltest.",checking:"Wird geprüft…",checked_now:"Gerade geprüft",checked_minutes:"Vor {0} Min. geprüft",loading:"Anbieter werden geladen…",load_error:"Die Anbieter konnten nicht geladen werden. Läuft das Backend?",list_label:"KI-Anbieter",list_title:"Anbieter",list_desc:"Eine Anmeldung oder ein Schlüssel pro Anbieter reicht für alle Funktionen.",overview_none:"Nicht eingerichtet",failing:"Eine Funktion dieses Anbieters schlägt fehl",status_local:"Kein Konto und kein Schlüssel nötig",status_both:"Abo und API-Key",status_subscription:"Abo verbunden",status_subscription_as:"Abo · {0}",status_key:"API-Key",status_project:"Google-Cloud-Projekt",status_none:"Nicht verbunden",use_voice:"Stimme",use_agents:"Agenten",use_speech:"Sprechen",use_hearing:"Hören",use_dictation:"Diktat",use_voice_long:"Live-Stimme",use_agents_long:"Agenten",use_speech_long:"Gesprochene Antworten",use_hearing_long:"Spracherkennung",use_dictation_long:"Diktat-Feinschliff",in_use:"Aktiv",available:"Verfügbar",not_ready:"Nicht eingerichtet",subscription_title:"Abo",subscription_desc:"Nutze das {0}-Abo, das du schon bezahlst. Kein Schlüssel, keine Abrechnung pro Nutzung.",subscription_unknown:"Anmeldung wird geprüft…",subscription_signed_in:"Angemeldet als {0}",subscription_install:"Installiere zuerst das Kommandozeilen-Tool, dann verbinden.",subscription_hint:"Nicht verbunden. „Verbinden“ öffnet die offizielle Anmeldung.",login_started_browser:"Anmeldung gestartet – schließe sie im Browserfenster ab.",login_started_terminal:"Anmeldung gestartet – schließe sie im Terminalfenster ab.",login_waiting_browser:"Warte darauf, dass du die Anmeldung im Browser abschließt…",login_waiting_terminal:"Warte darauf, dass du die Anmeldung im Terminal abschließt…",login_done:"{0} verbunden.",logout_done:"{0} getrennt.",connect:"Verbinden",disconnect:"Trennen",cli_label:"Kommandozeilen-Tool",cli_found:"Installiert",test:"Testen",key_title:"API-Key",key_desc:"Ein {0}-Schlüssel für alles: Live-Stimme, Agenten, Sprache und den Rest. Abrechnung pro Nutzung.",get_key:"Schlüssel holen",key_label:"API-Key",key_saved_hint:"Auf diesem Computer gespeichert. Alle Funktionen dieses Anbieters nutzen ihn.",key_project_hint:"Über dein Google-Cloud-Projekt angemeldet – kein Schlüssel nötig. Ein Schlüssel hier hat Vorrang.",key_missing_hint:"Kein Schlüssel gespeichert.",key_placeholder:"{0}-Schlüssel einfügen",key_show:"Schlüssel zeigen",key_hide:"Schlüssel verbergen",key_save:"Speichern",key_replace:"Ersetzen",key_remove:"Schlüssel entfernen",key_remove_confirm:"Alle Funktionen mit diesem Schlüssel hören auf.",key_saved_toast:"{0}-Schlüssel für alle Funktionen gespeichert.",key_removed_toast:"{0}-Schlüssel entfernt.",key_format_warning:"Das sieht aus wie ein {0}, nicht wie ein {1}-Schlüssel.",key_test_label:"Schlüssel prüfen",key_test_hint:"Schickt eine kurze Anfrage mit diesem Schlüssel.",separate_agents:"Agenten nutzen einen eigenen Schlüssel",separate_live_voice:"Live-Stimme nutzt einen eigenen Schlüssel",separate_codex:"Codex nutzt einen eigenen Schlüssel",separate_other:"Eine Funktion nutzt einen eigenen Schlüssel",separate_hint:"Früher nur für diese Funktion gespeichert. Stell sie auf den Schlüssel oben um, damit es bei einem bleibt.",separate_merge:"Hauptschlüssel nutzen",separate_needs_main:"Speichere zuerst einen Hauptschlüssel.",separate_merged_toast:"Läuft jetzt über den {0}-Hauptschlüssel.",voice_choice_title:"Live-Stimme",voice_choice_desc:"Wähle, über welchen Weg du mit {name} bei diesem Anbieter sprichst.",agents_title:"Agenten",agents_desc:"Der Worker, der die Hintergrundaufgaben von {name} erledigt.",agents_use:"Für Agenten nutzen",agents_needs_key:"Speichere oben einen Schlüssel, um ihn zu nutzen.",agents_needs_login_or_key:"Verbinde oben das Abo oder speichere einen Schlüssel, um ihn zu nutzen.",agents_switched:"Agenten laufen jetzt über {0}.",agents_switched_restart:"Agenten laufen nach dem nächsten Neustart über {0}.",voice_features_title:"Sprachfunktionen",voice_features_desc:"Werden in den Spracheinstellungen gewählt. Hier siehst du, was dieser Anbieter antreibt.",voice_features_open:"Spracheinstellungen",local_models_title:"Modelle auf diesem Computer",local_models_desc:"Lade die Modelle herunter, die ohne Konto laufen, starte und wähle sie.",local_models_hint:"Ollama, ein lokaler Server und die Stimme auf dem Gerät.",local_models_open:"Öffnen",agent_settings_title:"Agenten-Einstellungen",agent_settings_desc:"Mit welchem Modell die Agenten denken und wer ihre Aufgaben formuliert – egal, welcher Anbieter sie ausführt.",restart_title:"Neu starten, um das Update abzuschließen",restart_desc:"Die neue Anbieter-Seite braucht einen Neustart des App-Hintergrunddienstes. Das dauert etwa zehn Sekunden.",restart_action:"Jetzt neu starten",agent_providers_desc:"Schalte jeden Anbieter ein, den deine Agenten nutzen dürfen. Öffne einen, um Abo oder Schlüssel und seine Modelle zu wählen.",agent_providers_count:"{0} aktiv",voice_save_hint:"Speichern, damit der nächste Anruf diese Einstellungen nutzt",instructions_title:"Anweisungen",instructions_row:"Eigene Anweisungen",instructions_set:"Deine eigenen Anweisungen sind aktiv",instructions_none:"Keine – GPT-Live nutzt seine Standards",instructions_edit:"Bearbeiten",instructions_hide:"Schließen",accounts_section:"Konten",account_active:"Aktiv",account_use:"Für neue Terminals nutzen",tab_voice:"Live-Gespräche",tab_agents:"Agenten",engine_title:"Sprach-Engine",engine_live:"GPT-Live",engine_pipeline:"Pipeline",engine_live_desc:"Eine Live-Verbindung zu OpenAI GPT-Live hört zu, denkt und spricht.",engine_pipeline_desc:"Drei getrennte Schritte: Spracheingabe, Brain und Sprachausgabe. Wähle lokale, damit deine Sprache auf diesem Computer bleibt.",engine_live_setup:"Richte GPT-Live unten ein und speichere, um es für Gespräche zu nutzen.",engine_next_call:"Eine Änderung gilt ab deinem nächsten Gespräch.",engine_failed:"Die Sprach-Engine wurde nicht umgestellt: {0}",pipeline_brain_title:"Brain",pipeline_brain_desc:"Die Antworten kommen von deinem Standard-Agenten-Anbieter: {0}.",pipeline_brain_none:"Noch kein Standard-Agenten-Anbieter gewählt.",pipeline_brain_change:"In Agenten ändern",subscriptions_title:"Abos",keys_title:"API-Keys",authenticated:"Angemeldet",authenticated_as:"Angemeldet · {0}",not_installed:"Nicht installiert",not_signed_in:"Nicht angemeldet",account:"Konto",agents_needs_login:"Melde dich zuerst an, um die Agenten darüber laufen zu lassen.",agents_use_for:"Agenten über {0} laufen lassen",runtime:"Laufzeit",binary_path:"Programmpfad",binary_path_hint:"Das Kommandozeilen-Tool hinter dieser Anmeldung.",cli_check:"Prüfen",cli_check_hint:"Findet das Tool und liest Version und Anmeldung.",key_saved_short:"Schlüssel gespeichert",key_missing_short:"Kein Schlüssel",key_desc_short:"Ein Schlüssel für alles, was dieser Anbieter macht. Abrechnung pro Nutzung.",separate_title:"Eigene Schlüssel",accounts_title:"Mehrere Anmeldungen pro Tool",agent_providers_title:"Anbieter",access_title:"Zugang",access_desc:"Nutze dein Abo oder einen API-Schlüssel. Die Agenten laufen nur über den hier gewählten Zugang.",access_subscription:"Abo",access_api_key:"API-Schlüssel",access_local:"Dieser Computer",agents_needs_access:"Verbinde zuerst das Abo oder speichere einen Schlüssel.",local_title:"Auf diesem Computer",local_desc:"Die Agenten laufen mit lokalen Modellen. Kein Konto, kein Schlüssel, nichts verlässt diesen Computer.",default_title:"Standard für neue Aufgaben",default_desc:"Aufgaben, die {name} selbst abgibt, laufen hier. Jeder eingeschaltete Anbieter kann einen Agenten ausführen.",default_on:"Standard",default_make:"Als Standard",default_switched:"Neue Aufgaben laufen jetzt über {0}.",default_switched_restart:"Neue Aufgaben laufen nach dem nächsten Neustart über {0}.",models_title:"Modelle",models_count:"{0} von {1} Modellen für die Agenten",models_hide_all:"Alle aus",models_show_all:"Alle an",models_loading:"Modelle werden geladen…",models_none:"Dieser Anbieter nennt keine Modelle. Die Agenten nutzen sein Standardmodell.",models_reasoning:"Mit Denkstufen",thinking_pick:"Antwortet und nutzt Werkzeuge während eines Gesprächs",voice_ready:"Bereit",voice_not_ready:"Nicht eingerichtet"},n={section:"Missionen",title:"Mit API-Keys weitermachen, wenn die Abos aufgebraucht sind",state_off:"Aus · Missionen warten, bis ein Abo wieder frei ist",state_on:"An · {provider} · höchstens {mission_cap} pro Mission, {daily_cap} pro Tag",state_on_no_key:"An · noch kein API-Key mit bekanntem Preis",state_key_only:"Missionen laufen schon über deine API-Keys",state_no_key:"Braucht einen API-Key mit bekanntem Preis",spent:"{amount} in den letzten 24 Stunden ausgegeben",less_than_cent:"weniger als $0.01",load_error:"Diese Einstellung konnte nicht geladen werden: {detail}",save_error:"Nicht gespeichert: {detail}",confirm_title:"Mit deinem API-Key weitermachen?",confirm_intro:"Wenn alle verbundenen Abos aufgebraucht sind, laufen Missionen mit deinem eigenen API-Key weiter, statt zu warten.",confirm_billing:"{provider} rechnet jede Anfrage über diesen Key ab:",confirm_no_key:"Es ist noch kein API-Key mit bekanntem Preis eingerichtet, also kann nichts abgerechnet werden.",confirm_caps:"Jede Mission stoppt bei {mission_cap}, die gesamte automatische Nutzung bei {daily_cap} pro Tag.",confirm_off:"Du kannst das jederzeit ausschalten. Es gilt ab der nächsten Anfrage.",confirm_action:"Einschalten"},t={providers_page:e,mission_billing:n};export{t as default,n as mission_billing,e as providers_page};diff --git a/dodaios/ui/web/dist/assets/de-OS_Y-BAY.js b/dodaios/ui/web/dist/assets/de-OS_Y-BAY.jsdeleted file mode 100644index b7d757156d..0000000000--- a/dodaios/ui/web/dist/assets/de-OS_Y-BAY.js+++ /dev/null@@ -1 +0,0 @@-const e={subtitle:"Live-Gespräche laufen über OpenAI GPT-Live. Die Agenten laufen über jedes Abo und jeden Schlüssel, den du hier einschaltest.",checking:"Wird geprüft…",checked_now:"Gerade geprüft",checked_minutes:"Vor {0} Min. geprüft",loading:"Anbieter werden geladen…",load_error:"Die Anbieter konnten nicht geladen werden. Läuft das Backend?",list_label:"KI-Anbieter",list_title:"Anbieter",list_desc:"Eine Anmeldung oder ein Schlüssel pro Anbieter reicht für alle Funktionen.",overview_none:"Nicht eingerichtet",failing:"Eine Funktion dieses Anbieters schlägt fehl",status_local:"Kein Konto und kein Schlüssel nötig",status_both:"Abo und API-Key",status_subscription:"Abo verbunden",status_subscription_as:"Abo · {0}",status_key:"API-Key",status_project:"Google-Cloud-Projekt",status_none:"Nicht verbunden",use_voice:"Stimme",use_agents:"Agenten",use_speech:"Sprechen",use_hearing:"Hören",use_dictation:"Diktat",use_voice_long:"Live-Stimme",use_agents_long:"Agenten",use_speech_long:"Gesprochene Antworten",use_hearing_long:"Spracherkennung",use_dictation_long:"Diktat-Feinschliff",in_use:"Aktiv",available:"Verfügbar",not_ready:"Nicht eingerichtet",subscription_title:"Abo",subscription_desc:"Nutze das {0}-Abo, das du schon bezahlst. Kein Schlüssel, keine Abrechnung pro Nutzung.",subscription_unknown:"Anmeldung wird geprüft…",subscription_signed_in:"Angemeldet als {0}",subscription_install:"Installiere zuerst das Kommandozeilen-Tool, dann verbinden.",subscription_hint:"Nicht verbunden. „Verbinden“ öffnet die offizielle Anmeldung.",login_started_browser:"Anmeldung gestartet – schließe sie im Browserfenster ab.",login_started_terminal:"Anmeldung gestartet – schließe sie im Terminalfenster ab.",login_waiting_browser:"Warte darauf, dass du die Anmeldung im Browser abschließt…",login_waiting_terminal:"Warte darauf, dass du die Anmeldung im Terminal abschließt…",login_done:"{0} verbunden.",logout_done:"{0} getrennt.",connect:"Verbinden",disconnect:"Trennen",cli_label:"Kommandozeilen-Tool",cli_found:"Installiert",test:"Testen",key_title:"API-Key",key_desc:"Ein {0}-Schlüssel für alles: Live-Stimme, Agenten, Sprache und den Rest. Abrechnung pro Nutzung.",get_key:"Schlüssel holen",key_label:"API-Key",key_saved_hint:"Auf diesem Computer gespeichert. Alle Funktionen dieses Anbieters nutzen ihn.",key_project_hint:"Über dein Google-Cloud-Projekt angemeldet – kein Schlüssel nötig. Ein Schlüssel hier hat Vorrang.",key_missing_hint:"Kein Schlüssel gespeichert.",key_placeholder:"{0}-Schlüssel einfügen",key_show:"Schlüssel zeigen",key_hide:"Schlüssel verbergen",key_save:"Speichern",key_replace:"Ersetzen",key_remove:"Schlüssel entfernen",key_remove_confirm:"Alle Funktionen mit diesem Schlüssel hören auf.",key_saved_toast:"{0}-Schlüssel für alle Funktionen gespeichert.",key_removed_toast:"{0}-Schlüssel entfernt.",key_format_warning:"Das sieht aus wie ein {0}, nicht wie ein {1}-Schlüssel.",key_test_label:"Schlüssel prüfen",key_test_hint:"Schickt eine kurze Anfrage mit diesem Schlüssel.",separate_agents:"Agenten nutzen einen eigenen Schlüssel",separate_live_voice:"Live-Stimme nutzt einen eigenen Schlüssel",separate_codex:"Codex nutzt einen eigenen Schlüssel",separate_other:"Eine Funktion nutzt einen eigenen Schlüssel",separate_hint:"Früher nur für diese Funktion gespeichert. Stell sie auf den Schlüssel oben um, damit es bei einem bleibt.",separate_merge:"Hauptschlüssel nutzen",separate_needs_main:"Speichere zuerst einen Hauptschlüssel.",separate_merged_toast:"Läuft jetzt über den {0}-Hauptschlüssel.",voice_choice_title:"Live-Stimme",voice_choice_desc:"Wähle, über welchen Weg du mit {name} bei diesem Anbieter sprichst.",agents_title:"Agenten",agents_desc:"Der Worker, der die Hintergrundaufgaben von {name} erledigt.",agents_use:"Für Agenten nutzen",agents_needs_key:"Speichere oben einen Schlüssel, um ihn zu nutzen.",agents_needs_login_or_key:"Verbinde oben das Abo oder speichere einen Schlüssel, um ihn zu nutzen.",agents_switched:"Agenten laufen jetzt über {0}.",agents_switched_restart:"Agenten laufen nach dem nächsten Neustart über {0}.",voice_features_title:"Sprachfunktionen",voice_features_desc:"Werden in den Spracheinstellungen gewählt. Hier siehst du, was dieser Anbieter antreibt.",voice_features_open:"Spracheinstellungen",local_models_title:"Modelle auf diesem Computer",local_models_desc:"Lade die Modelle herunter, die ohne Konto laufen, starte und wähle sie.",local_models_hint:"Ollama, ein lokaler Server und die Stimme auf dem Gerät.",local_models_open:"Öffnen",agent_settings_title:"Agenten-Einstellungen",agent_settings_desc:"Mit welchem Modell die Agenten denken und wer ihre Aufgaben formuliert – egal, welcher Anbieter sie ausführt.",restart_title:"Neu starten, um das Update abzuschließen",restart_desc:"Die neue Anbieter-Seite braucht einen Neustart des App-Hintergrunddienstes. Das dauert etwa zehn Sekunden.",restart_action:"Jetzt neu starten",agent_providers_desc:"Schalte jeden Anbieter ein, den deine Agenten nutzen dürfen. Öffne einen, um Abo oder Schlüssel und seine Modelle zu wählen.",agent_providers_count:"{0} aktiv",voice_save_hint:"Speichern, damit der nächste Anruf diese Einstellungen nutzt",instructions_title:"Anweisungen",instructions_row:"Eigene Anweisungen",instructions_set:"Deine eigenen Anweisungen sind aktiv",instructions_none:"Keine – GPT-Live nutzt seine Standards",instructions_edit:"Bearbeiten",instructions_hide:"Schließen",accounts_section:"Konten",account_active:"Aktiv",account_use:"Für neue Terminals nutzen",tab_voice:"Live-Gespräche",tab_agents:"Agenten",subscriptions_title:"Abos",keys_title:"API-Keys",authenticated:"Angemeldet",authenticated_as:"Angemeldet · {0}",not_installed:"Nicht installiert",not_signed_in:"Nicht angemeldet",account:"Konto",agents_needs_login:"Melde dich zuerst an, um die Agenten darüber laufen zu lassen.",agents_use_for:"Agenten über {0} laufen lassen",runtime:"Laufzeit",binary_path:"Programmpfad",binary_path_hint:"Das Kommandozeilen-Tool hinter dieser Anmeldung.",cli_check:"Prüfen",cli_check_hint:"Findet das Tool und liest Version und Anmeldung.",key_saved_short:"Schlüssel gespeichert",key_missing_short:"Kein Schlüssel",key_desc_short:"Ein Schlüssel für alles, was dieser Anbieter macht. Abrechnung pro Nutzung.",separate_title:"Eigene Schlüssel",accounts_title:"Mehrere Anmeldungen pro Tool",agent_providers_title:"Anbieter",access_title:"Zugang",access_desc:"Nutze dein Abo oder einen API-Schlüssel. Die Agenten laufen nur über den hier gewählten Zugang.",access_subscription:"Abo",access_api_key:"API-Schlüssel",access_local:"Dieser Computer",agents_needs_access:"Verbinde zuerst das Abo oder speichere einen Schlüssel.",local_title:"Auf diesem Computer",local_desc:"Die Agenten laufen mit lokalen Modellen. Kein Konto, kein Schlüssel, nichts verlässt diesen Computer.",default_title:"Standard für neue Aufgaben",default_desc:"Aufgaben, die {name} selbst abgibt, laufen hier. Jeder eingeschaltete Anbieter kann einen Agenten ausführen.",default_on:"Standard",default_make:"Als Standard",default_switched:"Neue Aufgaben laufen jetzt über {0}.",default_switched_restart:"Neue Aufgaben laufen nach dem nächsten Neustart über {0}.",models_title:"Modelle",models_count:"{0} von {1} Modellen für die Agenten",models_hide_all:"Alle aus",models_show_all:"Alle an",models_loading:"Modelle werden geladen…",models_none:"Dieser Anbieter nennt keine Modelle. Die Agenten nutzen sein Standardmodell.",models_reasoning:"Mit Denkstufen",thinking_pick:"Antwortet und nutzt Werkzeuge während eines Gesprächs",voice_ready:"Bereit",voice_not_ready:"Nicht eingerichtet"},n={section:"Missionen",title:"Mit API-Keys weitermachen, wenn die Abos aufgebraucht sind",state_off:"Aus · Missionen warten, bis ein Abo wieder frei ist",state_on:"An · {provider} · höchstens {mission_cap} pro Mission, {daily_cap} pro Tag",state_on_no_key:"An · noch kein API-Key mit bekanntem Preis",state_key_only:"Missionen laufen schon über deine API-Keys",state_no_key:"Braucht einen API-Key mit bekanntem Preis",spent:"{amount} in den letzten 24 Stunden ausgegeben",less_than_cent:"weniger als $0.01",load_error:"Diese Einstellung konnte nicht geladen werden: {detail}",save_error:"Nicht gespeichert: {detail}",confirm_title:"Mit deinem API-Key weitermachen?",confirm_intro:"Wenn alle verbundenen Abos aufgebraucht sind, laufen Missionen mit deinem eigenen API-Key weiter, statt zu warten.",confirm_billing:"{provider} rechnet jede Anfrage über diesen Key ab:",confirm_no_key:"Es ist noch kein API-Key mit bekanntem Preis eingerichtet, also kann nichts abgerechnet werden.",confirm_caps:"Jede Mission stoppt bei {mission_cap}, die gesamte automatische Nutzung bei {daily_cap} pro Tag.",confirm_off:"Du kannst das jederzeit ausschalten. Es gilt ab der nächsten Anfrage.",confirm_action:"Einschalten"},t={providers_page:e,mission_billing:n};export{t as default,n as mission_billing,e as providers_page};diff --git a/dodaios/ui/web/dist/assets/en-C3B_NkL9.js b/dodaios/ui/web/dist/assets/en-C3B_NkL9.jsdeleted file mode 100644index ee79a974c9..0000000000--- a/dodaios/ui/web/dist/assets/en-C3B_NkL9.js+++ /dev/null@@ -1 +0,0 @@-const e={subtitle:"Live calls run on OpenAI GPT-Live. Agents run on every subscription or key you turn on here.",checking:"Checking…",checked_now:"Checked just now",checked_minutes:"Checked {0} min ago",loading:"Loading your providers…",load_error:"The providers could not be loaded. Is the backend running?",list_label:"AI providers",list_title:"Providers",list_desc:"One sign-in or one key per company covers every feature.",overview_none:"Not set up",failing:"A feature on this provider is failing",status_local:"No account or key needed",status_both:"Subscription and API key",status_subscription:"Subscription connected",status_subscription_as:"Subscription · {0}",status_key:"API key",status_project:"Google Cloud project",status_none:"Not connected",use_voice:"Voice",use_agents:"Agents",use_speech:"Speech",use_hearing:"Hearing",use_dictation:"Dictation",use_voice_long:"Live voice",use_agents_long:"Agents",use_speech_long:"Spoken replies",use_hearing_long:"Speech recognition",use_dictation_long:"Dictation clean-up",in_use:"In use",available:"Available",not_ready:"Not set up",subscription_title:"Subscription",subscription_desc:"Use the {0} plan you already pay for. No key, no per-token bill.",subscription_unknown:"Checking the sign-in…",subscription_signed_in:"Signed in as {0}",subscription_install:"Install the command-line tool first, then connect.",subscription_hint:"Not connected. Connecting opens the official sign-in.",login_started_browser:"Sign-in started — finish it in the browser window.",login_started_terminal:"Sign-in started — finish it in the terminal window.",login_waiting_browser:"Waiting for you to finish the sign-in in the browser…",login_waiting_terminal:"Waiting for you to finish the sign-in in the terminal…",login_done:"{0} connected.",logout_done:"{0} disconnected.",connect:"Connect",disconnect:"Disconnect",cli_label:"Command-line tool",cli_found:"Installed",test:"Test",key_title:"API key",key_desc:"One {0} key for everything: live voice, agents, speech and the rest. Billed per use.",get_key:"Get a key",key_label:"API key",key_saved_hint:"Saved on this computer. Every feature of this provider uses it.",key_project_hint:"Signed in through your Google Cloud project — no key needed. A key here takes over.",key_missing_hint:"No key saved.",key_placeholder:"Paste your {0} key",key_show:"Show key",key_hide:"Hide key",key_save:"Save",key_replace:"Replace",key_remove:"Remove key",key_remove_confirm:"Every feature using this key stops.",key_saved_toast:"{0} key saved for every feature.",key_removed_toast:"{0} key removed.",key_format_warning:"This looks like a {0}, not a {1} key.",key_test_label:"Check the key",key_test_hint:"Sends one short request with this key.",separate_agents:"Agents use their own key",separate_live_voice:"Live voice uses its own key",separate_codex:"Codex uses its own key",separate_other:"A feature uses its own key",separate_hint:"Saved earlier for this feature only. Switch it to the key above to keep one key.",separate_merge:"Use the main key",separate_needs_main:"Save a main key first.",separate_merged_toast:"Now on the main {0} key.",voice_choice_title:"Live voice",voice_choice_desc:"Pick the voice route to talk to {name} over this provider.",agents_title:"Agents",agents_desc:"The worker that runs {name}'s background tasks.",agents_use:"Use for agents",agents_needs_key:"Save a key above to use it.",agents_needs_login_or_key:"Connect the subscription or save a key above to use it.",agents_switched:"Agents now run on {0}.",agents_switched_restart:"Agents run on {0} after the next restart.",voice_features_title:"Speech features",voice_features_desc:"Chosen in the voice settings. Shown here so you can see what this provider powers.",voice_features_open:"Voice settings",local_models_title:"Models on this computer",local_models_desc:"Download, run and pick the models that work without any account.",local_models_hint:"Ollama, a local server and the on-device voice.",local_models_open:"Open",agent_settings_title:"Agent settings",agent_settings_desc:"The model the agents think with and who writes their task briefs — for whichever provider runs them.",restart_title:"Restart to finish the update",restart_desc:"The new provider page needs the app's background service to restart once. It takes about ten seconds.",restart_action:"Restart now",agent_providers_desc:"Turn on every provider your agents may use. Open one to choose subscription or key and its models.",agent_providers_count:"{0} on",voice_save_hint:"Save to use these settings on your next call",instructions_title:"Instructions",instructions_row:"Custom instructions",instructions_set:"Your own instructions are in use",instructions_none:"None — GPT-Live uses its defaults",instructions_edit:"Edit",instructions_hide:"Close",accounts_section:"Accounts",account_active:"Active",account_use:"Use for new terminals",tab_voice:"Live calls",tab_agents:"Agents",subscriptions_title:"Subscriptions",keys_title:"API keys",authenticated:"Authenticated",authenticated_as:"Authenticated · {0}",not_installed:"Not installed",not_signed_in:"Not signed in",account:"Account",agents_needs_login:"Sign in first to run the agents on it.",agents_use_for:"Run the agents on {0}",runtime:"Runtime",binary_path:"Binary path",binary_path_hint:"The command-line tool this sign-in runs.",cli_check:"Check",cli_check_hint:"Finds the tool, reads its version and sign-in.",key_saved_short:"Key saved",key_missing_short:"No key",key_desc_short:"One key for everything this provider does. Billed per use.",separate_title:"Separate keys",accounts_title:"Several sign-ins per tool",agent_providers_title:"Providers",access_title:"Access",access_desc:"Use your subscription or an API key. The agents run only on the one picked here.",access_subscription:"Subscription",access_api_key:"API key",access_local:"This computer",agents_needs_access:"Connect the subscription or save a key first.",local_title:"On this computer",local_desc:"Agents run on local models. No account, no key, nothing leaves this computer.",default_title:"Default for new tasks",default_desc:"Tasks {name} hands off on its own go here. Every provider that is on can run an agent.",default_on:"Default",default_make:"Make default",default_switched:"New tasks now go to {0}.",default_switched_restart:"New tasks go to {0} after the next restart.",models_title:"Models",models_count:"{0} of {1} models offered to agents",models_hide_all:"Turn all off",models_show_all:"Turn all on",models_loading:"Loading models…",models_none:"This provider lists no models. Agents use its default model.",models_reasoning:"Reasoning",thinking_pick:"Answers and uses tools during a call",voice_ready:"Ready",voice_not_ready:"Not set up"},t={section:"Missions",title:"Continue on API keys when subscriptions run out",state_off:"Off · missions wait until a subscription has room again",state_on:"On · {provider} · at most {mission_cap} per mission, {daily_cap} a day",state_on_no_key:"On · no API key with a known price yet",state_key_only:"Missions already run on your API keys",state_no_key:"Needs an API key with a known price",spent:"{amount} spent in the last 24 hours",less_than_cent:"less than $0.01",load_error:"This setting could not be loaded: {detail}",save_error:"Not saved: {detail}",confirm_title:"Continue on your API key?",confirm_intro:"When every connected subscription is used up, missions keep running on your own API key instead of waiting.",confirm_billing:"{provider} bills that key for every request:",confirm_no_key:"No API key with a known price is set up yet, so nothing can be billed.",confirm_caps:"Each mission stops at {mission_cap}, and all automatic use stops at {daily_cap} per day.",confirm_off:"You can switch this off at any time. It applies from the next request on.",confirm_action:"Turn on"},n={providers_page:e,mission_billing:t};export{n as default,t as mission_billing,e as providers_page};diff --git a/dodaios/ui/web/dist/assets/en-D8uXYvzJ.js b/dodaios/ui/web/dist/assets/en-D8uXYvzJ.jsnew file mode 100644index 0000000000..6f8dc330b4--- /dev/null+++ b/dodaios/ui/web/dist/assets/en-D8uXYvzJ.js@@ -0,0 +1 @@+const e={subtitle:"Live calls run on OpenAI GPT-Live, or on the Pipeline if you switch to it. Agents run on every subscription or key you turn on here.",checking:"Checking…",checked_now:"Checked just now",checked_minutes:"Checked {0} min ago",loading:"Loading your providers…",load_error:"The providers could not be loaded. Is the backend running?",list_label:"AI providers",list_title:"Providers",list_desc:"One sign-in or one key per company covers every feature.",overview_none:"Not set up",failing:"A feature on this provider is failing",status_local:"No account or key needed",status_both:"Subscription and API key",status_subscription:"Subscription connected",status_subscription_as:"Subscription · {0}",status_key:"API key",status_project:"Google Cloud project",status_none:"Not connected",use_voice:"Voice",use_agents:"Agents",use_speech:"Speech",use_hearing:"Hearing",use_dictation:"Dictation",use_voice_long:"Live voice",use_agents_long:"Agents",use_speech_long:"Spoken replies",use_hearing_long:"Speech recognition",use_dictation_long:"Dictation clean-up",in_use:"In use",available:"Available",not_ready:"Not set up",subscription_title:"Subscription",subscription_desc:"Use the {0} plan you already pay for. No key, no per-token bill.",subscription_unknown:"Checking the sign-in…",subscription_signed_in:"Signed in as {0}",subscription_install:"Install the command-line tool first, then connect.",subscription_hint:"Not connected. Connecting opens the official sign-in.",login_started_browser:"Sign-in started — finish it in the browser window.",login_started_terminal:"Sign-in started — finish it in the terminal window.",login_waiting_browser:"Waiting for you to finish the sign-in in the browser…",login_waiting_terminal:"Waiting for you to finish the sign-in in the terminal…",login_done:"{0} connected.",logout_done:"{0} disconnected.",connect:"Connect",disconnect:"Disconnect",cli_label:"Command-line tool",cli_found:"Installed",test:"Test",key_title:"API key",key_desc:"One {0} key for everything: live voice, agents, speech and the rest. Billed per use.",get_key:"Get a key",key_label:"API key",key_saved_hint:"Saved on this computer. Every feature of this provider uses it.",key_project_hint:"Signed in through your Google Cloud project — no key needed. A key here takes over.",key_missing_hint:"No key saved.",key_placeholder:"Paste your {0} key",key_show:"Show key",key_hide:"Hide key",key_save:"Save",key_replace:"Replace",key_remove:"Remove key",key_remove_confirm:"Every feature using this key stops.",key_saved_toast:"{0} key saved for every feature.",key_removed_toast:"{0} key removed.",key_format_warning:"This looks like a {0}, not a {1} key.",key_test_label:"Check the key",key_test_hint:"Sends one short request with this key.",separate_agents:"Agents use their own key",separate_live_voice:"Live voice uses its own key",separate_codex:"Codex uses its own key",separate_other:"A feature uses its own key",separate_hint:"Saved earlier for this feature only. Switch it to the key above to keep one key.",separate_merge:"Use the main key",separate_needs_main:"Save a main key first.",separate_merged_toast:"Now on the main {0} key.",voice_choice_title:"Live voice",voice_choice_desc:"Pick the voice route to talk to {name} over this provider.",agents_title:"Agents",agents_desc:"The worker that runs {name}'s background tasks.",agents_use:"Use for agents",agents_needs_key:"Save a key above to use it.",agents_needs_login_or_key:"Connect the subscription or save a key above to use it.",agents_switched:"Agents now run on {0}.",agents_switched_restart:"Agents run on {0} after the next restart.",voice_features_title:"Speech features",voice_features_desc:"Chosen in the voice settings. Shown here so you can see what this provider powers.",voice_features_open:"Voice settings",local_models_title:"Models on this computer",local_models_desc:"Download, run and pick the models that work without any account.",local_models_hint:"Ollama, a local server and the on-device voice.",local_models_open:"Open",agent_settings_title:"Agent settings",agent_settings_desc:"The model the agents think with and who writes their task briefs — for whichever provider runs them.",restart_title:"Restart to finish the update",restart_desc:"The new provider page needs the app's background service to restart once. It takes about ten seconds.",restart_action:"Restart now",agent_providers_desc:"Turn on every provider your agents may use. Open one to choose subscription or key and its models.",agent_providers_count:"{0} on",voice_save_hint:"Save to use these settings on your next call",instructions_title:"Instructions",instructions_row:"Custom instructions",instructions_set:"Your own instructions are in use",instructions_none:"None — GPT-Live uses its defaults",instructions_edit:"Edit",instructions_hide:"Close",accounts_section:"Accounts",account_active:"Active",account_use:"Use for new terminals",tab_voice:"Live calls",tab_agents:"Agents",engine_title:"Voice engine",engine_live:"GPT-Live",engine_pipeline:"Pipeline",engine_live_desc:"One live connection to OpenAI GPT-Live listens, thinks and speaks.",engine_pipeline_desc:"Three separate steps: voice input, the brain and voice output. Choose local ones to keep your speech on this computer.",engine_live_setup:"Set up GPT-Live below and save to use it for calls.",engine_next_call:"A change applies from your next call.",engine_failed:"The voice engine was not switched: {0}",pipeline_brain_title:"Brain",pipeline_brain_desc:"Answers come from your default agent provider: {0}.",pipeline_brain_none:"No default agent provider is set yet.",pipeline_brain_change:"Change in Agents",subscriptions_title:"Subscriptions",keys_title:"API keys",authenticated:"Authenticated",authenticated_as:"Authenticated · {0}",not_installed:"Not installed",not_signed_in:"Not signed in",account:"Account",agents_needs_login:"Sign in first to run the agents on it.",agents_use_for:"Run the agents on {0}",runtime:"Runtime",binary_path:"Binary path",binary_path_hint:"The command-line tool this sign-in runs.",cli_check:"Check",cli_check_hint:"Finds the tool, reads its version and sign-in.",key_saved_short:"Key saved",key_missing_short:"No key",key_desc_short:"One key for everything this provider does. Billed per use.",separate_title:"Separate keys",accounts_title:"Several sign-ins per tool",agent_providers_title:"Providers",access_title:"Access",access_desc:"Use your subscription or an API key. The agents run only on the one picked here.",access_subscription:"Subscription",access_api_key:"API key",access_local:"This computer",agents_needs_access:"Connect the subscription or save a key first.",local_title:"On this computer",local_desc:"Agents run on local models. No account, no key, nothing leaves this computer.",default_title:"Default for new tasks",default_desc:"Tasks {name} hands off on its own go here. Every provider that is on can run an agent.",default_on:"Default",default_make:"Make default",default_switched:"New tasks now go to {0}.",default_switched_restart:"New tasks go to {0} after the next restart.",models_title:"Models",models_count:"{0} of {1} models offered to agents",models_hide_all:"Turn all off",models_show_all:"Turn all on",models_loading:"Loading models…",models_none:"This provider lists no models. Agents use its default model.",models_reasoning:"Reasoning",thinking_pick:"Answers and uses tools during a call",voice_ready:"Ready",voice_not_ready:"Not set up"},t={section:"Missions",title:"Continue on API keys when subscriptions run out",state_off:"Off · missions wait until a subscription has room again",state_on:"On · {provider} · at most {mission_cap} per mission, {daily_cap} a day",state_on_no_key:"On · no API key with a known price yet",state_key_only:"Missions already run on your API keys",state_no_key:"Needs an API key with a known price",spent:"{amount} spent in the last 24 hours",less_than_cent:"less than $0.01",load_error:"This setting could not be loaded: {detail}",save_error:"Not saved: {detail}",confirm_title:"Continue on your API key?",confirm_intro:"When every connected subscription is used up, missions keep running on your own API key instead of waiting.",confirm_billing:"{provider} bills that key for every request:",confirm_no_key:"No API key with a known price is set up yet, so nothing can be billed.",confirm_caps:"Each mission stops at {mission_cap}, and all automatic use stops at {daily_cap} per day.",confirm_off:"You can switch this off at any time. It applies from the next request on.",confirm_action:"Turn on"},n={providers_page:e,mission_billing:t};export{n as default,t as mission_billing,e as providers_page};diff --git a/dodaios/ui/web/dist/assets/es-DqEtgi__.js b/dodaios/ui/web/dist/assets/es-DqEtgi__.jsdeleted file mode 100644index 8df73736f8..0000000000--- a/dodaios/ui/web/dist/assets/es-DqEtgi__.js+++ /dev/null@@ -1 +0,0 @@-const e={subtitle:"Las llamadas en directo funcionan con OpenAI GPT-Live. Los agentes funcionan con cada suscripción o clave que actives aquí.",checking:"Comprobando…",checked_now:"Comprobado ahora",checked_minutes:"Comprobado hace {0} min",loading:"Cargando tus proveedores…",load_error:"No se pudieron cargar los proveedores. ¿Está en marcha el backend?",list_label:"Proveedores de IA",list_title:"Proveedores",list_desc:"Un inicio de sesión o una clave por empresa cubre todas las funciones.",overview_none:"Sin configurar",failing:"Una función de este proveedor está fallando",status_local:"No hace falta cuenta ni clave",status_both:"Suscripción y clave API",status_subscription:"Suscripción conectada",status_subscription_as:"Suscripción · {0}",status_key:"Clave API",status_project:"Proyecto de Google Cloud",status_none:"Sin conectar",use_voice:"Voz",use_agents:"Agentes",use_speech:"Habla",use_hearing:"Escucha",use_dictation:"Dictado",use_voice_long:"Voz en directo",use_agents_long:"Agentes",use_speech_long:"Respuestas habladas",use_hearing_long:"Reconocimiento de voz",use_dictation_long:"Pulido del dictado",in_use:"En uso",available:"Disponible",not_ready:"Sin configurar",subscription_title:"Suscripción",subscription_desc:"Usa el plan de {0} que ya pagas. Sin clave y sin cobro por uso.",subscription_unknown:"Comprobando el inicio de sesión…",subscription_signed_in:"Sesión iniciada como {0}",subscription_install:"Instala primero la herramienta de línea de comandos y luego conecta.",subscription_hint:"Sin conectar. Conectar abre el inicio de sesión oficial.",login_started_browser:"Inicio de sesión en marcha — termínalo en la ventana del navegador.",login_started_terminal:"Inicio de sesión en marcha — termínalo en la ventana del terminal.",login_waiting_browser:"Esperando a que termines el inicio de sesión en el navegador…",login_waiting_terminal:"Esperando a que termines el inicio de sesión en el terminal…",login_done:"{0} conectado.",logout_done:"{0} desconectado.",connect:"Conectar",disconnect:"Desconectar",cli_label:"Herramienta de línea de comandos",cli_found:"Instalada",test:"Probar",key_title:"Clave API",key_desc:"Una clave de {0} para todo: voz en directo, agentes, habla y lo demás. Se cobra por uso.",get_key:"Obtener una clave",key_label:"Clave API",key_saved_hint:"Guardada en este ordenador. Todas las funciones de este proveedor la usan.",key_project_hint:"Conectado mediante tu proyecto de Google Cloud — no hace falta clave. Una clave aquí tiene prioridad.",key_missing_hint:"No hay ninguna clave guardada.",key_placeholder:"Pega tu clave de {0}",key_show:"Mostrar clave",key_hide:"Ocultar clave",key_save:"Guardar",key_replace:"Reemplazar",key_remove:"Quitar clave",key_remove_confirm:"Todas las funciones que usan esta clave se detienen.",key_saved_toast:"Clave de {0} guardada para todas las funciones.",key_removed_toast:"Clave de {0} eliminada.",key_format_warning:"Parece una {0}, no una clave de {1}.",key_test_label:"Comprobar la clave",key_test_hint:"Envía una petición corta con esta clave.",separate_agents:"Los agentes usan su propia clave",separate_live_voice:"La voz en directo usa su propia clave",separate_codex:"Codex usa su propia clave",separate_other:"Una función usa su propia clave",separate_hint:"Se guardó antes solo para esta función. Pásala a la clave de arriba para tener una sola.",separate_merge:"Usar la clave principal",separate_needs_main:"Guarda primero una clave principal.",separate_merged_toast:"Ahora usa la clave principal de {0}.",voice_choice_title:"Voz en directo",voice_choice_desc:"Elige la vía para hablar con {name} a través de este proveedor.",agents_title:"Agentes",agents_desc:"El trabajador que ejecuta las tareas en segundo plano de {name}.",agents_use:"Usar para agentes",agents_needs_key:"Guarda una clave arriba para usarlo.",agents_needs_login_or_key:"Conecta la suscripción o guarda una clave arriba para usarlo.",agents_switched:"Los agentes ahora usan {0}.",agents_switched_restart:"Los agentes usarán {0} tras el próximo reinicio.",voice_features_title:"Funciones de voz",voice_features_desc:"Se eligen en los ajustes de voz. Aquí ves qué funciones hace este proveedor.",voice_features_open:"Ajustes de voz",local_models_title:"Modelos en este ordenador",local_models_desc:"Descarga, ejecuta y elige los modelos que funcionan sin cuenta.",local_models_hint:"Ollama, un servidor local y la voz en el dispositivo.",local_models_open:"Abrir",agent_settings_title:"Ajustes de los agentes",agent_settings_desc:"El modelo con el que piensan los agentes y quién redacta sus tareas — sea cual sea el proveedor que los ejecuta.",restart_title:"Reinicia para terminar la actualización",restart_desc:"La nueva página de proveedores necesita reiniciar una vez el servicio de la app. Tarda unos diez segundos.",restart_action:"Reiniciar ahora",agent_providers_desc:"Activa cada proveedor que tus agentes pueden usar. Abre uno para elegir suscripción o clave y sus modelos.",agent_providers_count:"{0} activos",voice_save_hint:"Guarda para usar estos ajustes en tu próxima llamada",instructions_title:"Instrucciones",instructions_row:"Instrucciones propias",instructions_set:"Se usan tus propias instrucciones",instructions_none:"Ninguna: GPT-Live usa sus valores por defecto",instructions_edit:"Editar",instructions_hide:"Cerrar",accounts_section:"Cuentas",account_active:"Activa",account_use:"Usar en terminales nuevos",tab_voice:"Llamadas en directo",tab_agents:"Agentes",subscriptions_title:"Suscripciones",keys_title:"Claves API",authenticated:"Sesión iniciada",authenticated_as:"Sesión iniciada · {0}",not_installed:"No instalado",not_signed_in:"Sin sesión iniciada",account:"Cuenta",agents_needs_login:"Inicia sesión primero para ejecutar los agentes con ella.",agents_use_for:"Ejecutar los agentes con {0}",runtime:"Ejecución",binary_path:"Ruta del programa",binary_path_hint:"La herramienta de línea de comandos de este inicio de sesión.",cli_check:"Comprobar",cli_check_hint:"Busca la herramienta y lee su versión y su sesión.",key_saved_short:"Clave guardada",key_missing_short:"Sin clave",key_desc_short:"Una clave para todo lo que hace este proveedor. Se cobra por uso.",separate_title:"Claves propias",accounts_title:"Varias sesiones por herramienta",agent_providers_title:"Proveedores",access_title:"Acceso",access_desc:"Usa tu suscripción o una clave API. Los agentes solo funcionan con el acceso elegido aquí.",access_subscription:"Suscripción",access_api_key:"Clave API",access_local:"Este ordenador",agents_needs_access:"Conecta primero la suscripción o guarda una clave.",local_title:"En este ordenador",local_desc:"Los agentes funcionan con modelos locales. Sin cuenta, sin clave, nada sale de este ordenador.",default_title:"Predeterminado para tareas nuevas",default_desc:"Las tareas que {name} delega por su cuenta van aquí. Cada proveedor activado puede ejecutar un agente.",default_on:"Predeterminado",default_make:"Hacer predeterminado",default_switched:"Las tareas nuevas ahora van a {0}.",default_switched_restart:"Las tareas nuevas irán a {0} tras el próximo reinicio.",models_title:"Modelos",models_count:"{0} de {1} modelos para los agentes",models_hide_all:"Desactivar todos",models_show_all:"Activar todos",models_loading:"Cargando modelos…",models_none:"Este proveedor no lista modelos. Los agentes usan su modelo predeterminado.",models_reasoning:"Razonamiento",thinking_pick:"Responde y usa herramientas durante una llamada",voice_ready:"Listo",voice_not_ready:"Sin configurar"},a={section:"Misiones",title:"Seguir con claves API cuando se agoten las suscripciones",state_off:"Desactivado · las misiones esperan hasta que una suscripción vuelva a tener capacidad",state_on:"Activado · {provider} · como máximo {mission_cap} por misión, {daily_cap} al día",state_on_no_key:"Activado · aún no hay una clave API con precio conocido",state_key_only:"Las misiones ya funcionan con tus claves API",state_no_key:"Necesita una clave API con precio conocido",spent:"{amount} gastado en las últimas 24 horas",less_than_cent:"menos de $0.01",load_error:"No se pudo cargar este ajuste: {detail}",save_error:"No se guardó: {detail}",confirm_title:"¿Seguir con tu clave API?",confirm_intro:"Cuando todas las suscripciones conectadas se agotan, las misiones siguen funcionando con tu propia clave API en lugar de esperar.",confirm_billing:"{provider} cobra cada solicitud a esa clave:",confirm_no_key:"Todavía no hay ninguna clave API con precio conocido, así que no se puede cobrar nada.",confirm_caps:"Cada misión se detiene en {mission_cap}, y todo el uso automático se detiene en {daily_cap} al día.",confirm_off:"Puedes desactivarlo en cualquier momento. Se aplica desde la siguiente solicitud.",confirm_action:"Activar"},s={providers_page:e,mission_billing:a};export{s as default,a as mission_billing,e as providers_page};diff --git a/dodaios/ui/web/dist/assets/es-nFD5j2dP.js b/dodaios/ui/web/dist/assets/es-nFD5j2dP.jsnew file mode 100644index 0000000000..c299d2864a--- /dev/null+++ b/dodaios/ui/web/dist/assets/es-nFD5j2dP.js@@ -0,0 +1 @@+const e={subtitle:"Las llamadas en directo funcionan con OpenAI GPT-Live o, si cambias, con la Pipeline. Los agentes funcionan con cada suscripción o clave que actives aquí.",checking:"Comprobando…",checked_now:"Comprobado ahora",checked_minutes:"Comprobado hace {0} min",loading:"Cargando tus proveedores…",load_error:"No se pudieron cargar los proveedores. ¿Está en marcha el backend?",list_label:"Proveedores de IA",list_title:"Proveedores",list_desc:"Un inicio de sesión o una clave por empresa cubre todas las funciones.",overview_none:"Sin configurar",failing:"Una función de este proveedor está fallando",status_local:"No hace falta cuenta ni clave",status_both:"Suscripción y clave API",status_subscription:"Suscripción conectada",status_subscription_as:"Suscripción · {0}",status_key:"Clave API",status_project:"Proyecto de Google Cloud",status_none:"Sin conectar",use_voice:"Voz",use_agents:"Agentes",use_speech:"Habla",use_hearing:"Escucha",use_dictation:"Dictado",use_voice_long:"Voz en directo",use_agents_long:"Agentes",use_speech_long:"Respuestas habladas",use_hearing_long:"Reconocimiento de voz",use_dictation_long:"Pulido del dictado",in_use:"En uso",available:"Disponible",not_ready:"Sin configurar",subscription_title:"Suscripción",subscription_desc:"Usa el plan de {0} que ya pagas. Sin clave y sin cobro por uso.",subscription_unknown:"Comprobando el inicio de sesión…",subscription_signed_in:"Sesión iniciada como {0}",subscription_install:"Instala primero la herramienta de línea de comandos y luego conecta.",subscription_hint:"Sin conectar. Conectar abre el inicio de sesión oficial.",login_started_browser:"Inicio de sesión en marcha — termínalo en la ventana del navegador.",login_started_terminal:"Inicio de sesión en marcha — termínalo en la ventana del terminal.",login_waiting_browser:"Esperando a que termines el inicio de sesión en el navegador…",login_waiting_terminal:"Esperando a que termines el inicio de sesión en el terminal…",login_done:"{0} conectado.",logout_done:"{0} desconectado.",connect:"Conectar",disconnect:"Desconectar",cli_label:"Herramienta de línea de comandos",cli_found:"Instalada",test:"Probar",key_title:"Clave API",key_desc:"Una clave de {0} para todo: voz en directo, agentes, habla y lo demás. Se cobra por uso.",get_key:"Obtener una clave",key_label:"Clave API",key_saved_hint:"Guardada en este ordenador. Todas las funciones de este proveedor la usan.",key_project_hint:"Conectado mediante tu proyecto de Google Cloud — no hace falta clave. Una clave aquí tiene prioridad.",key_missing_hint:"No hay ninguna clave guardada.",key_placeholder:"Pega tu clave de {0}",key_show:"Mostrar clave",key_hide:"Ocultar clave",key_save:"Guardar",key_replace:"Reemplazar",key_remove:"Quitar clave",key_remove_confirm:"Todas las funciones que usan esta clave se detienen.",key_saved_toast:"Clave de {0} guardada para todas las funciones.",key_removed_toast:"Clave de {0} eliminada.",key_format_warning:"Parece una {0}, no una clave de {1}.",key_test_label:"Comprobar la clave",key_test_hint:"Envía una petición corta con esta clave.",separate_agents:"Los agentes usan su propia clave",separate_live_voice:"La voz en directo usa su propia clave",separate_codex:"Codex usa su propia clave",separate_other:"Una función usa su propia clave",separate_hint:"Se guardó antes solo para esta función. Pásala a la clave de arriba para tener una sola.",separate_merge:"Usar la clave principal",separate_needs_main:"Guarda primero una clave principal.",separate_merged_toast:"Ahora usa la clave principal de {0}.",voice_choice_title:"Voz en directo",voice_choice_desc:"Elige la vía para hablar con {name} a través de este proveedor.",agents_title:"Agentes",agents_desc:"El trabajador que ejecuta las tareas en segundo plano de {name}.",agents_use:"Usar para agentes",agents_needs_key:"Guarda una clave arriba para usarlo.",agents_needs_login_or_key:"Conecta la suscripción o guarda una clave arriba para usarlo.",agents_switched:"Los agentes ahora usan {0}.",agents_switched_restart:"Los agentes usarán {0} tras el próximo reinicio.",voice_features_title:"Funciones de voz",voice_features_desc:"Se eligen en los ajustes de voz. Aquí ves qué funciones hace este proveedor.",voice_features_open:"Ajustes de voz",local_models_title:"Modelos en este ordenador",local_models_desc:"Descarga, ejecuta y elige los modelos que funcionan sin cuenta.",local_models_hint:"Ollama, un servidor local y la voz en el dispositivo.",local_models_open:"Abrir",agent_settings_title:"Ajustes de los agentes",agent_settings_desc:"El modelo con el que piensan los agentes y quién redacta sus tareas — sea cual sea el proveedor que los ejecuta.",restart_title:"Reinicia para terminar la actualización",restart_desc:"La nueva página de proveedores necesita reiniciar una vez el servicio de la app. Tarda unos diez segundos.",restart_action:"Reiniciar ahora",agent_providers_desc:"Activa cada proveedor que tus agentes pueden usar. Abre uno para elegir suscripción o clave y sus modelos.",agent_providers_count:"{0} activos",voice_save_hint:"Guarda para usar estos ajustes en tu próxima llamada",instructions_title:"Instrucciones",instructions_row:"Instrucciones propias",instructions_set:"Se usan tus propias instrucciones",instructions_none:"Ninguna: GPT-Live usa sus valores por defecto",instructions_edit:"Editar",instructions_hide:"Cerrar",accounts_section:"Cuentas",account_active:"Activa",account_use:"Usar en terminales nuevos",tab_voice:"Llamadas en directo",tab_agents:"Agentes",engine_title:"Motor de voz",engine_live:"GPT-Live",engine_pipeline:"Pipeline",engine_live_desc:"Una conexión en directo con OpenAI GPT-Live escucha, piensa y habla.",engine_pipeline_desc:"Tres pasos separados: entrada de voz, el cerebro y salida de voz. Elige opciones locales para que tu voz no salga de este ordenador.",engine_live_setup:"Configura GPT-Live abajo y guarda para usarlo en las llamadas.",engine_next_call:"Un cambio se aplica a partir de tu próxima llamada.",engine_failed:"No se cambió el motor de voz: {0}",pipeline_brain_title:"Cerebro",pipeline_brain_desc:"Las respuestas vienen de tu proveedor de agentes predeterminado: {0}.",pipeline_brain_none:"Aún no hay un proveedor de agentes predeterminado.",pipeline_brain_change:"Cambiar en Agentes",subscriptions_title:"Suscripciones",keys_title:"Claves API",authenticated:"Sesión iniciada",authenticated_as:"Sesión iniciada · {0}",not_installed:"No instalado",not_signed_in:"Sin sesión iniciada",account:"Cuenta",agents_needs_login:"Inicia sesión primero para ejecutar los agentes con ella.",agents_use_for:"Ejecutar los agentes con {0}",runtime:"Ejecución",binary_path:"Ruta del programa",binary_path_hint:"La herramienta de línea de comandos de este inicio de sesión.",cli_check:"Comprobar",cli_check_hint:"Busca la herramienta y lee su versión y su sesión.",key_saved_short:"Clave guardada",key_missing_short:"Sin clave",key_desc_short:"Una clave para todo lo que hace este proveedor. Se cobra por uso.",separate_title:"Claves propias",accounts_title:"Varias sesiones por herramienta",agent_providers_title:"Proveedores",access_title:"Acceso",access_desc:"Usa tu suscripción o una clave API. Los agentes solo funcionan con el acceso elegido aquí.",access_subscription:"Suscripción",access_api_key:"Clave API",access_local:"Este ordenador",agents_needs_access:"Conecta primero la suscripción o guarda una clave.",local_title:"En este ordenador",local_desc:"Los agentes funcionan con modelos locales. Sin cuenta, sin clave, nada sale de este ordenador.",default_title:"Predeterminado para tareas nuevas",default_desc:"Las tareas que {name} delega por su cuenta van aquí. Cada proveedor activado puede ejecutar un agente.",default_on:"Predeterminado",default_make:"Hacer predeterminado",default_switched:"Las tareas nuevas ahora van a {0}.",default_switched_restart:"Las tareas nuevas irán a {0} tras el próximo reinicio.",models_title:"Modelos",models_count:"{0} de {1} modelos para los agentes",models_hide_all:"Desactivar todos",models_show_all:"Activar todos",models_loading:"Cargando modelos…",models_none:"Este proveedor no lista modelos. Los agentes usan su modelo predeterminado.",models_reasoning:"Razonamiento",thinking_pick:"Responde y usa herramientas durante una llamada",voice_ready:"Listo",voice_not_ready:"Sin configurar"},a={section:"Misiones",title:"Seguir con claves API cuando se agoten las suscripciones",state_off:"Desactivado · las misiones esperan hasta que una suscripción vuelva a tener capacidad",state_on:"Activado · {provider} · como máximo {mission_cap} por misión, {daily_cap} al día",state_on_no_key:"Activado · aún no hay una clave API con precio conocido",state_key_only:"Las misiones ya funcionan con tus claves API",state_no_key:"Necesita una clave API con precio conocido",spent:"{amount} gastado en las últimas 24 horas",less_than_cent:"menos de $0.01",load_error:"No se pudo cargar este ajuste: {detail}",save_error:"No se guardó: {detail}",confirm_title:"¿Seguir con tu clave API?",confirm_intro:"Cuando todas las suscripciones conectadas se agotan, las misiones siguen funcionando con tu propia clave API en lugar de esperar.",confirm_billing:"{provider} cobra cada solicitud a esa clave:",confirm_no_key:"Todavía no hay ninguna clave API con precio conocido, así que no se puede cobrar nada.",confirm_caps:"Cada misión se detiene en {mission_cap}, y todo el uso automático se detiene en {daily_cap} al día.",confirm_off:"Puedes desactivarlo en cualquier momento. Se aplica desde la siguiente solicitud.",confirm_action:"Activar"},n={providers_page:e,mission_billing:a};export{n as default,a as mission_billing,e as providers_page};diff --git a/dodaios/ui/web/dist/assets/pt-Abbxnule.js b/dodaios/ui/web/dist/assets/pt-Abbxnule.jsnew file mode 100644index 0000000000..7a0b94ca34--- /dev/null+++ b/dodaios/ui/web/dist/assets/pt-Abbxnule.js@@ -0,0 +1 @@+const e={subtitle:"As chamadas em direto correm no OpenAI GPT-Live ou, se mudares, na Pipeline. Os agentes correm em todas as subscrições ou chaves que ativares aqui.",checking:"A verificar…",checked_now:"Verificado agora mesmo",checked_minutes:"Verificado há {0} min",loading:"A carregar os teus fornecedores…",load_error:"Não foi possível carregar os fornecedores. O backend está em execução?",list_label:"Fornecedores de IA",list_title:"Fornecedores",list_desc:"Um início de sessão ou uma chave por empresa cobre todas as funcionalidades.",overview_none:"Não configurado",failing:"Uma funcionalidade deste fornecedor está a falhar",status_local:"Não é preciso conta nem chave",status_both:"Subscrição e chave de API",status_subscription:"Subscrição ligada",status_subscription_as:"Subscrição · {0}",status_key:"Chave de API",status_project:"Projeto Google Cloud",status_none:"Não ligado",use_voice:"Voz",use_agents:"Agentes",use_speech:"Fala",use_hearing:"Audição",use_dictation:"Ditado",use_voice_long:"Voz em direto",use_agents_long:"Agentes",use_speech_long:"Respostas faladas",use_hearing_long:"Reconhecimento de fala",use_dictation_long:"Limpeza do ditado",in_use:"Em uso",available:"Disponível",not_ready:"Não configurado",subscription_title:"Subscrição",subscription_desc:"Usa o plano {0} que já pagas. Sem chave, sem faturação por token.",subscription_unknown:"A verificar o início de sessão…",subscription_signed_in:"Sessão iniciada como {0}",subscription_install:"Instala primeiro a ferramenta de linha de comandos e depois liga.",subscription_hint:"Não ligado. Ligar abre o início de sessão oficial.",login_started_browser:"Início de sessão iniciado — conclui-o na janela do navegador.",login_started_terminal:"Início de sessão iniciado — conclui-o na janela do terminal.",login_waiting_browser:"À espera que concluas o início de sessão no navegador…",login_waiting_terminal:"À espera que concluas o início de sessão no terminal…",login_done:"{0} ligado.",logout_done:"{0} desligado.",connect:"Ligar",disconnect:"Desligar",cli_label:"Ferramenta de linha de comandos",cli_found:"Instalada",test:"Testar",key_title:"Chave de API",key_desc:"Uma chave {0} para tudo: voz em direto, agentes, fala e o resto. Faturada por utilização.",get_key:"Obter uma chave",key_label:"Chave de API",key_saved_hint:"Guardada neste computador. Todas as funcionalidades deste fornecedor a usam.",key_project_hint:"Sessão iniciada através do teu projeto Google Cloud — não é preciso chave. Uma chave aqui tem prioridade.",key_missing_hint:"Nenhuma chave guardada.",key_placeholder:"Cola a tua chave {0}",key_show:"Mostrar chave",key_hide:"Ocultar chave",key_save:"Guardar",key_replace:"Substituir",key_remove:"Remover chave",key_remove_confirm:"Todas as funcionalidades que usam esta chave param.",key_saved_toast:"Chave {0} guardada para todas as funcionalidades.",key_removed_toast:"Chave {0} removida.",key_format_warning:"Isto parece uma {0}, não uma chave {1}.",key_test_label:"Verificar a chave",key_test_hint:"Envia um pedido curto com esta chave.",separate_agents:"Os agentes usam a sua própria chave",separate_live_voice:"A voz em direto usa a sua própria chave",separate_codex:"O Codex usa a sua própria chave",separate_other:"Uma funcionalidade usa a sua própria chave",separate_hint:"Guardada antes apenas para esta funcionalidade. Muda-a para a chave acima para ficares com uma só chave.",separate_merge:"Usar a chave principal",separate_needs_main:"Guarda primeiro uma chave principal.",separate_merged_toast:"Agora na chave principal {0}.",voice_choice_title:"Voz em direto",voice_choice_desc:"Escolhe a via de voz para falares com {name} através deste fornecedor.",agents_title:"Agentes",agents_desc:"O worker que executa as tarefas em segundo plano de {name}.",agents_use:"Usar para agentes",agents_needs_key:"Guarda uma chave acima para o usares.",agents_needs_login_or_key:"Liga a subscrição ou guarda uma chave acima para o usares.",agents_switched:"Os agentes correm agora em {0}.",agents_switched_restart:"Os agentes vão correr em {0} após o próximo reinício.",voice_features_title:"Funcionalidades de fala",voice_features_desc:"Escolhidas nas definições de voz. Mostradas aqui para veres o que este fornecedor alimenta.",voice_features_open:"Definições de voz",local_models_title:"Modelos neste computador",local_models_desc:"Transfere, executa e escolhe os modelos que funcionam sem qualquer conta.",local_models_hint:"Ollama, um servidor local e a voz no dispositivo.",local_models_open:"Abrir",agent_settings_title:"Definições dos agentes",agent_settings_desc:"O modelo com que os agentes pensam e quem escreve as instruções das tarefas — para qualquer fornecedor que os execute.",restart_title:"Reiniciar para concluir a atualização",restart_desc:"A nova página de fornecedores precisa que o serviço em segundo plano da aplicação reinicie uma vez. Demora cerca de dez segundos.",restart_action:"Reiniciar agora",agent_providers_desc:"Ativa todos os fornecedores que os teus agentes podem usar. Abre um para escolheres subscrição ou chave e os respetivos modelos.",agent_providers_count:"{0} ativos",voice_save_hint:"Guarda para usar estas definições na próxima chamada",instructions_title:"Instruções",instructions_row:"Instruções personalizadas",instructions_set:"As tuas próprias instruções estão em uso",instructions_none:"Nenhuma — o GPT-Live usa as predefinições",instructions_edit:"Editar",instructions_hide:"Fechar",accounts_section:"Contas",account_active:"Ativa",account_use:"Usar para novos terminais",tab_voice:"Chamadas em direto",tab_agents:"Agentes",engine_title:"Motor de voz",engine_live:"GPT-Live",engine_pipeline:"Pipeline",engine_live_desc:"Uma ligação em direto ao OpenAI GPT-Live ouve, pensa e fala.",engine_pipeline_desc:"Três passos separados: entrada de voz, o cérebro e saída de voz. Escolhe opções locais para que a tua voz fique neste computador.",engine_live_setup:"Configura o GPT-Live abaixo e guarda para o usares nas chamadas.",engine_next_call:"Uma alteração aplica-se a partir da tua próxima chamada.",engine_failed:"O motor de voz não foi alterado: {0}",pipeline_brain_title:"Cérebro",pipeline_brain_desc:"As respostas vêm do teu fornecedor de agentes predefinido: {0}.",pipeline_brain_none:"Ainda não há um fornecedor de agentes predefinido.",pipeline_brain_change:"Alterar em Agentes",subscriptions_title:"Subscrições",keys_title:"Chaves de API",authenticated:"Autenticado",authenticated_as:"Autenticado · {0}",not_installed:"Não instalado",not_signed_in:"Sessão não iniciada",account:"Conta",agents_needs_login:"Inicia sessão primeiro para executar os agentes aqui.",agents_use_for:"Executar os agentes em {0}",runtime:"Runtime",binary_path:"Caminho do binário",binary_path_hint:"A ferramenta de linha de comandos que este início de sessão executa.",cli_check:"Verificar",cli_check_hint:"Encontra a ferramenta, lê a versão e o início de sessão.",key_saved_short:"Chave guardada",key_missing_short:"Sem chave",key_desc_short:"Uma chave para tudo o que este fornecedor faz. Faturada por utilização.",separate_title:"Chaves separadas",accounts_title:"Vários inícios de sessão por ferramenta",agent_providers_title:"Fornecedores",access_title:"Acesso",access_desc:"Usa a tua subscrição ou uma chave de API. Os agentes correm apenas na que escolheres aqui.",access_subscription:"Subscrição",access_api_key:"Chave de API",access_local:"Este computador",agents_needs_access:"Liga a subscrição ou guarda primeiro uma chave.",local_title:"Neste computador",local_desc:"Os agentes correm em modelos locais. Sem conta, sem chave, nada sai deste computador.",default_title:"Predefinição para novas tarefas",default_desc:"As tarefas que {name} delega por iniciativa própria vão para aqui. Qualquer fornecedor ativo pode executar um agente.",default_on:"Predefinido",default_make:"Tornar predefinido",default_switched:"As novas tarefas vão agora para {0}.",default_switched_restart:"As novas tarefas vão para {0} após o próximo reinício.",models_title:"Modelos",models_count:"{0} de {1} modelos disponibilizados aos agentes",models_hide_all:"Desativar todos",models_show_all:"Ativar todos",models_loading:"A carregar modelos…",models_none:"Este fornecedor não lista modelos. Os agentes usam o modelo predefinido.",models_reasoning:"Raciocínio",thinking_pick:"Responde e usa ferramentas durante uma chamada",voice_ready:"Pronto",voice_not_ready:"Não configurado"},a={section:"Missões",title:"Continuar com chaves de API quando as subscrições se esgotam",state_off:"Desligado · as missões aguardam até uma subscrição ter margem novamente",state_on:"Ligado · {provider} · no máximo {mission_cap} por missão, {daily_cap} por dia",state_on_no_key:"Ligado · ainda sem chave de API com preço conhecido",state_key_only:"As missões já correm com as tuas chaves de API",state_no_key:"Requer uma chave de API com preço conhecido",spent:"{amount} gastos nas últimas 24 horas",less_than_cent:"menos de $0.01",load_error:"Não foi possível carregar esta definição: {detail}",save_error:"Não guardado: {detail}",confirm_title:"Continuar com a tua chave de API?",confirm_intro:"Quando todas as subscrições ligadas estiverem esgotadas, as missões continuam a correr com a tua própria chave de API em vez de aguardarem.",confirm_billing:"{provider} cobra essa chave por cada pedido:",confirm_no_key:"Ainda não está configurada nenhuma chave de API com preço conhecido, por isso nada pode ser cobrado.",confirm_caps:"Cada missão para em {mission_cap} e toda a utilização automática para em {daily_cap} por dia.",confirm_off:"Podes desligar isto a qualquer momento. Aplica-se a partir do próximo pedido.",confirm_action:"Ativar"},o={providers_page:e,mission_billing:a};export{o as default,a as mission_billing,e as providers_page};diff --git a/dodaios/ui/web/dist/assets/pt-CSd6sWkB.js b/dodaios/ui/web/dist/assets/pt-CSd6sWkB.jsdeleted file mode 100644index d59d3ebbd6..0000000000--- a/dodaios/ui/web/dist/assets/pt-CSd6sWkB.js+++ /dev/null@@ -1 +0,0 @@-const e={subtitle:"As chamadas em direto correm no OpenAI GPT-Live. Os agentes correm em todas as subscrições ou chaves que ativares aqui.",checking:"A verificar…",checked_now:"Verificado agora mesmo",checked_minutes:"Verificado há {0} min",loading:"A carregar os teus fornecedores…",load_error:"Não foi possível carregar os fornecedores. O backend está em execução?",list_label:"Fornecedores de IA",list_title:"Fornecedores",list_desc:"Um início de sessão ou uma chave por empresa cobre todas as funcionalidades.",overview_none:"Não configurado",failing:"Uma funcionalidade deste fornecedor está a falhar",status_local:"Não é preciso conta nem chave",status_both:"Subscrição e chave de API",status_subscription:"Subscrição ligada",status_subscription_as:"Subscrição · {0}",status_key:"Chave de API",status_project:"Projeto Google Cloud",status_none:"Não ligado",use_voice:"Voz",use_agents:"Agentes",use_speech:"Fala",use_hearing:"Audição",use_dictation:"Ditado",use_voice_long:"Voz em direto",use_agents_long:"Agentes",use_speech_long:"Respostas faladas",use_hearing_long:"Reconhecimento de fala",use_dictation_long:"Limpeza do ditado",in_use:"Em uso",available:"Disponível",not_ready:"Não configurado",subscription_title:"Subscrição",subscription_desc:"Usa o plano {0} que já pagas. Sem chave, sem faturação por token.",subscription_unknown:"A verificar o início de sessão…",subscription_signed_in:"Sessão iniciada como {0}",subscription_install:"Instala primeiro a ferramenta de linha de comandos e depois liga.",subscription_hint:"Não ligado. Ligar abre o início de sessão oficial.",login_started_browser:"Início de sessão iniciado — conclui-o na janela do navegador.",login_started_terminal:"Início de sessão iniciado — conclui-o na janela do terminal.",login_waiting_browser:"À espera que concluas o início de sessão no navegador…",login_waiting_terminal:"À espera que concluas o início de sessão no terminal…",login_done:"{0} ligado.",logout_done:"{0} desligado.",connect:"Ligar",disconnect:"Desligar",cli_label:"Ferramenta de linha de comandos",cli_found:"Instalada",test:"Testar",key_title:"Chave de API",key_desc:"Uma chave {0} para tudo: voz em direto, agentes, fala e o resto. Faturada por utilização.",get_key:"Obter uma chave",key_label:"Chave de API",key_saved_hint:"Guardada neste computador. Todas as funcionalidades deste fornecedor a usam.",key_project_hint:"Sessão iniciada através do teu projeto Google Cloud — não é preciso chave. Uma chave aqui tem prioridade.",key_missing_hint:"Nenhuma chave guardada.",key_placeholder:"Cola a tua chave {0}",key_show:"Mostrar chave",key_hide:"Ocultar chave",key_save:"Guardar",key_replace:"Substituir",key_remove:"Remover chave",key_remove_confirm:"Todas as funcionalidades que usam esta chave param.",key_saved_toast:"Chave {0} guardada para todas as funcionalidades.",key_removed_toast:"Chave {0} removida.",key_format_warning:"Isto parece uma {0}, não uma chave {1}.",key_test_label:"Verificar a chave",key_test_hint:"Envia um pedido curto com esta chave.",separate_agents:"Os agentes usam a sua própria chave",separate_live_voice:"A voz em direto usa a sua própria chave",separate_codex:"O Codex usa a sua própria chave",separate_other:"Uma funcionalidade usa a sua própria chave",separate_hint:"Guardada antes apenas para esta funcionalidade. Muda-a para a chave acima para ficares com uma só chave.",separate_merge:"Usar a chave principal",separate_needs_main:"Guarda primeiro uma chave principal.",separate_merged_toast:"Agora na chave principal {0}.",voice_choice_title:"Voz em direto",voice_choice_desc:"Escolhe a via de voz para falares com {name} através deste fornecedor.",agents_title:"Agentes",agents_desc:"O worker que executa as tarefas em segundo plano de {name}.",agents_use:"Usar para agentes",agents_needs_key:"Guarda uma chave acima para o usares.",agents_needs_login_or_key:"Liga a subscrição ou guarda uma chave acima para o usares.",agents_switched:"Os agentes correm agora em {0}.",agents_switched_restart:"Os agentes vão correr em {0} após o próximo reinício.",voice_features_title:"Funcionalidades de fala",voice_features_desc:"Escolhidas nas definições de voz. Mostradas aqui para veres o que este fornecedor alimenta.",voice_features_open:"Definições de voz",local_models_title:"Modelos neste computador",local_models_desc:"Transfere, executa e escolhe os modelos que funcionam sem qualquer conta.",local_models_hint:"Ollama, um servidor local e a voz no dispositivo.",local_models_open:"Abrir",agent_settings_title:"Definições dos agentes",agent_settings_desc:"O modelo com que os agentes pensam e quem escreve as instruções das tarefas — para qualquer fornecedor que os execute.",restart_title:"Reiniciar para concluir a atualização",restart_desc:"A nova página de fornecedores precisa que o serviço em segundo plano da aplicação reinicie uma vez. Demora cerca de dez segundos.",restart_action:"Reiniciar agora",agent_providers_desc:"Ativa todos os fornecedores que os teus agentes podem usar. Abre um para escolheres subscrição ou chave e os respetivos modelos.",agent_providers_count:"{0} ativos",voice_save_hint:"Guarda para usar estas definições na próxima chamada",instructions_title:"Instruções",instructions_row:"Instruções personalizadas",instructions_set:"As tuas próprias instruções estão em uso",instructions_none:"Nenhuma — o GPT-Live usa as predefinições",instructions_edit:"Editar",instructions_hide:"Fechar",accounts_section:"Contas",account_active:"Ativa",account_use:"Usar para novos terminais",tab_voice:"Chamadas em direto",tab_agents:"Agentes",subscriptions_title:"Subscrições",keys_title:"Chaves de API",authenticated:"Autenticado",authenticated_as:"Autenticado · {0}",not_installed:"Não instalado",not_signed_in:"Sessão não iniciada",account:"Conta",agents_needs_login:"Inicia sessão primeiro para executar os agentes aqui.",agents_use_for:"Executar os agentes em {0}",runtime:"Runtime",binary_path:"Caminho do binário",binary_path_hint:"A ferramenta de linha de comandos que este início de sessão executa.",cli_check:"Verificar",cli_check_hint:"Encontra a ferramenta, lê a versão e o início de sessão.",key_saved_short:"Chave guardada",key_missing_short:"Sem chave",key_desc_short:"Uma chave para tudo o que este fornecedor faz. Faturada por utilização.",separate_title:"Chaves separadas",accounts_title:"Vários inícios de sessão por ferramenta",agent_providers_title:"Fornecedores",access_title:"Acesso",access_desc:"Usa a tua subscrição ou uma chave de API. Os agentes correm apenas na que escolheres aqui.",access_subscription:"Subscrição",access_api_key:"Chave de API",access_local:"Este computador",agents_needs_access:"Liga a subscrição ou guarda primeiro uma chave.",local_title:"Neste computador",local_desc:"Os agentes correm em modelos locais. Sem conta, sem chave, nada sai deste computador.",default_title:"Predefinição para novas tarefas",default_desc:"As tarefas que {name} delega por iniciativa própria vão para aqui. Qualquer fornecedor ativo pode executar um agente.",default_on:"Predefinido",default_make:"Tornar predefinido",default_switched:"As novas tarefas vão agora para {0}.",default_switched_restart:"As novas tarefas vão para {0} após o próximo reinício.",models_title:"Modelos",models_count:"{0} de {1} modelos disponibilizados aos agentes",models_hide_all:"Desativar todos",models_show_all:"Ativar todos",models_loading:"A carregar modelos…",models_none:"Este fornecedor não lista modelos. Os agentes usam o modelo predefinido.",models_reasoning:"Raciocínio",thinking_pick:"Responde e usa ferramentas durante uma chamada",voice_ready:"Pronto",voice_not_ready:"Não configurado"},a={section:"Missões",title:"Continuar com chaves de API quando as subscrições se esgotam",state_off:"Desligado · as missões aguardam até uma subscrição ter margem novamente",state_on:"Ligado · {provider} · no máximo {mission_cap} por missão, {daily_cap} por dia",state_on_no_key:"Ligado · ainda sem chave de API com preço conhecido",state_key_only:"As missões já correm com as tuas chaves de API",state_no_key:"Requer uma chave de API com preço conhecido",spent:"{amount} gastos nas últimas 24 horas",less_than_cent:"menos de $0.01",load_error:"Não foi possível carregar esta definição: {detail}",save_error:"Não guardado: {detail}",confirm_title:"Continuar com a tua chave de API?",confirm_intro:"Quando todas as subscrições ligadas estiverem esgotadas, as missões continuam a correr com a tua própria chave de API em vez de aguardarem.",confirm_billing:"{provider} cobra essa chave por cada pedido:",confirm_no_key:"Ainda não está configurada nenhuma chave de API com preço conhecido, por isso nada pode ser cobrado.",confirm_caps:"Cada missão para em {mission_cap} e toda a utilização automática para em {daily_cap} por dia.",confirm_off:"Podes desligar isto a qualquer momento. Aplica-se a partir do próximo pedido.",confirm_action:"Ativar"},s={providers_page:e,mission_billing:a};export{s as default,a as mission_billing,e as providers_page};diff --git a/dodaios/ui/web/dist/assets/zh-D6c_mhPI.js b/dodaios/ui/web/dist/assets/zh-D6c_mhPI.jsnew file mode 100644index 0000000000..135804285d--- /dev/null+++ b/dodaios/ui/web/dist/assets/zh-D6c_mhPI.js@@ -0,0 +1 @@+const e={subtitle:"实时通话默认运行在 OpenAI GPT-Live 上,也可以切换到 Pipeline。智能体会使用你在这里开启的所有订阅或密钥。",checking:"正在检查…",checked_now:"刚刚检查过",checked_minutes:"{0} 分钟前检查过",loading:"正在加载你的服务商…",load_error:"无法加载服务商。后端是否在运行?",list_label:"AI 服务商",list_title:"服务商",list_desc:"每家公司只需一次登录或一个密钥,即可覆盖所有功能。",overview_none:"未设置",failing:"此服务商的某项功能出现故障",status_local:"无需账号或密钥",status_both:"订阅和 API 密钥",status_subscription:"订阅已连接",status_subscription_as:"订阅 · {0}",status_key:"API 密钥",status_project:"Google Cloud 项目",status_none:"未连接",use_voice:"语音",use_agents:"智能体",use_speech:"朗读",use_hearing:"聆听",use_dictation:"听写",use_voice_long:"实时语音",use_agents_long:"智能体",use_speech_long:"语音回复",use_hearing_long:"语音识别",use_dictation_long:"听写润色",in_use:"使用中",available:"可用",not_ready:"未设置",subscription_title:"订阅",subscription_desc:"使用你已付费的 {0} 套餐。无需密钥,不按 token 计费。",subscription_unknown:"正在检查登录状态…",subscription_signed_in:"已登录为 {0}",subscription_install:"请先安装命令行工具,然后再连接。",subscription_hint:"未连接。连接时会打开官方登录页面。",login_started_browser:"登录已开始,请在浏览器窗口中完成。",login_started_terminal:"登录已开始,请在终端窗口中完成。",login_waiting_browser:"正在等待你在浏览器中完成登录…",login_waiting_terminal:"正在等待你在终端中完成登录…",login_done:"{0} 已连接。",logout_done:"{0} 已断开连接。",connect:"连接",disconnect:"断开连接",cli_label:"命令行工具",cli_found:"已安装",test:"测试",key_title:"API 密钥",key_desc:"一个 {0} 密钥搞定一切:实时语音、智能体、朗读等。按使用量计费。",get_key:"获取密钥",key_label:"API 密钥",key_saved_hint:"已保存在这台电脑上。此服务商的所有功能都会使用它。",key_project_hint:"已通过你的 Google Cloud 项目登录,无需密钥。在这里填写密钥会优先使用密钥。",key_missing_hint:"尚未保存密钥。",key_placeholder:"粘贴你的 {0} 密钥",key_show:"显示密钥",key_hide:"隐藏密钥",key_save:"保存",key_replace:"替换",key_remove:"移除密钥",key_remove_confirm:"所有使用此密钥的功能都会停止。",key_saved_toast:"{0} 密钥已保存,所有功能均可使用。",key_removed_toast:"{0} 密钥已移除。",key_format_warning:"这看起来像是 {0},而不是 {1} 密钥。",key_test_label:"检查密钥",key_test_hint:"使用此密钥发送一个简短请求。",separate_agents:"智能体使用单独的密钥",separate_live_voice:"实时语音使用单独的密钥",separate_codex:"Codex 使用单独的密钥",separate_other:"某项功能使用单独的密钥",separate_hint:"之前仅为这项功能保存。切换到上方的密钥,即可只保留一个密钥。",separate_merge:"使用主密钥",separate_needs_main:"请先保存一个主密钥。",separate_merged_toast:"现在使用主 {0} 密钥。",voice_choice_title:"实时语音",voice_choice_desc:"选择通过此服务商与 {name} 交谈的语音方式。",agents_title:"智能体",agents_desc:"负责运行 {name} 后台任务的工作者。",agents_use:"用于智能体",agents_needs_key:"请在上方保存密钥后再使用。",agents_needs_login_or_key:"请在上方连接订阅或保存密钥后再使用。",agents_switched:"智能体现在运行在 {0} 上。",agents_switched_restart:"下次重启后,智能体将运行在 {0} 上。",voice_features_title:"语音功能",voice_features_desc:"在语音设置中选择。在这里显示,方便你了解此服务商支持哪些功能。",voice_features_open:"语音设置",local_models_title:"这台电脑上的模型",local_models_desc:"下载、运行并选择无需任何账号即可使用的模型。",local_models_hint:"Ollama、本地服务器和设备端语音。",local_models_open:"打开",agent_settings_title:"智能体设置",agent_settings_desc:"智能体用来思考的模型,以及由谁编写它们的任务简报,适用于任何运行它们的服务商。",restart_title:"重启以完成更新",restart_desc:"新的服务商页面需要重启一次应用的后台服务,大约需要十秒。",restart_action:"立即重启",agent_providers_desc:"开启所有允许智能体使用的服务商。打开其中一个,即可选择订阅或密钥及其模型。",agent_providers_count:"已开启 {0} 个",voice_save_hint:"保存后,下次通话将使用这些设置",instructions_title:"指令",instructions_row:"自定义指令",instructions_set:"正在使用你自己的指令",instructions_none:"无,GPT-Live 使用默认设置",instructions_edit:"编辑",instructions_hide:"关闭",accounts_section:"账号",account_active:"当前使用",account_use:"用于新终端",tab_voice:"实时通话",tab_agents:"智能体",engine_title:"语音引擎",engine_live:"GPT-Live",engine_pipeline:"Pipeline",engine_live_desc:"通过一条与 OpenAI GPT-Live 的实时连接来聆听、思考和说话。",engine_pipeline_desc:"分为三个独立步骤:语音输入、大脑和语音输出。选择本地选项,语音就会留在这台电脑上。",engine_live_setup:"在下方设置 GPT-Live 并保存后即可用于通话。",engine_next_call:"更改从下一次通话开始生效。",engine_failed:"语音引擎未切换:{0}",pipeline_brain_title:"大脑",pipeline_brain_desc:"回答来自你的默认智能体提供商:{0}。",pipeline_brain_none:"尚未设置默认智能体提供商。",pipeline_brain_change:"在智能体中更改",subscriptions_title:"订阅",keys_title:"API 密钥",authenticated:"已认证",authenticated_as:"已认证 · {0}",not_installed:"未安装",not_signed_in:"未登录",account:"账号",agents_needs_login:"请先登录,才能在上面运行智能体。",agents_use_for:"在 {0} 上运行智能体",runtime:"运行时",binary_path:"程序路径",binary_path_hint:"此登录所运行的命令行工具。",cli_check:"检查",cli_check_hint:"查找该工具,读取其版本和登录状态。",key_saved_short:"密钥已保存",key_missing_short:"无密钥",key_desc_short:"一个密钥即可用于此服务商的所有功能。按使用量计费。",separate_title:"单独的密钥",accounts_title:"每个工具可登录多个账号",agent_providers_title:"服务商",access_title:"访问方式",access_desc:"使用你的订阅或 API 密钥。智能体只会使用这里选中的那一个。",access_subscription:"订阅",access_api_key:"API 密钥",access_local:"这台电脑",agents_needs_access:"请先连接订阅或保存密钥。",local_title:"在这台电脑上",local_desc:"智能体运行在本地模型上。无需账号,无需密钥,任何数据都不会离开这台电脑。",default_title:"新任务的默认服务商",default_desc:"{name} 自行分派的任务会交到这里。所有已开启的服务商都可以运行智能体。",default_on:"默认",default_make:"设为默认",default_switched:"新任务现在交给 {0}。",default_switched_restart:"下次重启后,新任务将交给 {0}。",models_title:"模型",models_count:"向智能体提供了 {0} / {1} 个模型",models_hide_all:"全部关闭",models_show_all:"全部开启",models_loading:"正在加载模型…",models_none:"此服务商未列出任何模型。智能体将使用它的默认模型。",models_reasoning:"推理",thinking_pick:"在通话中回答并使用工具",voice_ready:"就绪",voice_not_ready:"未设置"},_={section:"任务",title:"订阅用完时改用 API 密钥继续",state_off:"关闭 · 任务会等待,直到某个订阅重新有额度",state_on:"开启 · {provider} · 每个任务最多 {mission_cap},每天最多 {daily_cap}",state_on_no_key:"开启 · 还没有价格已知的 API 密钥",state_key_only:"任务已经在使用你的 API 密钥运行",state_no_key:"需要一个价格已知的 API 密钥",spent:"过去 24 小时已花费 {amount}",less_than_cent:"不到 $0.01",load_error:"无法加载此设置:{detail}",save_error:"未保存:{detail}",confirm_title:"改用你的 API 密钥继续?",confirm_intro:"当所有已连接的订阅都用完时,任务会使用你自己的 API 密钥继续运行,而不是等待。",confirm_billing:"{provider} 会按每次请求向该密钥计费:",confirm_no_key:"还没有设置价格已知的 API 密钥,因此不会产生任何费用。",confirm_caps:"每个任务在 {mission_cap} 时停止,所有自动使用每天在 {daily_cap} 时停止。",confirm_off:"你可以随时关闭。从下一次请求开始生效。",confirm_action:"开启"},t={providers_page:e,mission_billing:_};export{t as default,_ as mission_billing,e as providers_page};diff --git a/dodaios/ui/web/dist/assets/zh-DIo_HqGA.js b/dodaios/ui/web/dist/assets/zh-DIo_HqGA.jsdeleted file mode 100644index cd60634e02..0000000000--- a/dodaios/ui/web/dist/assets/zh-DIo_HqGA.js+++ /dev/null@@ -1 +0,0 @@-const e={subtitle:"实时通话运行在 OpenAI GPT-Live 上。智能体会使用你在这里开启的所有订阅或密钥。",checking:"正在检查…",checked_now:"刚刚检查过",checked_minutes:"{0} 分钟前检查过",loading:"正在加载你的服务商…",load_error:"无法加载服务商。后端是否在运行?",list_label:"AI 服务商",list_title:"服务商",list_desc:"每家公司只需一次登录或一个密钥,即可覆盖所有功能。",overview_none:"未设置",failing:"此服务商的某项功能出现故障",status_local:"无需账号或密钥",status_both:"订阅和 API 密钥",status_subscription:"订阅已连接",status_subscription_as:"订阅 · {0}",status_key:"API 密钥",status_project:"Google Cloud 项目",status_none:"未连接",use_voice:"语音",use_agents:"智能体",use_speech:"朗读",use_hearing:"聆听",use_dictation:"听写",use_voice_long:"实时语音",use_agents_long:"智能体",use_speech_long:"语音回复",use_hearing_long:"语音识别",use_dictation_long:"听写润色",in_use:"使用中",available:"可用",not_ready:"未设置",subscription_title:"订阅",subscription_desc:"使用你已付费的 {0} 套餐。无需密钥,不按 token 计费。",subscription_unknown:"正在检查登录状态…",subscription_signed_in:"已登录为 {0}",subscription_install:"请先安装命令行工具,然后再连接。",subscription_hint:"未连接。连接时会打开官方登录页面。",login_started_browser:"登录已开始,请在浏览器窗口中完成。",login_started_terminal:"登录已开始,请在终端窗口中完成。",login_waiting_browser:"正在等待你在浏览器中完成登录…",login_waiting_terminal:"正在等待你在终端中完成登录…",login_done:"{0} 已连接。",logout_done:"{0} 已断开连接。",connect:"连接",disconnect:"断开连接",cli_label:"命令行工具",cli_found:"已安装",test:"测试",key_title:"API 密钥",key_desc:"一个 {0} 密钥搞定一切:实时语音、智能体、朗读等。按使用量计费。",get_key:"获取密钥",key_label:"API 密钥",key_saved_hint:"已保存在这台电脑上。此服务商的所有功能都会使用它。",key_project_hint:"已通过你的 Google Cloud 项目登录,无需密钥。在这里填写密钥会优先使用密钥。",key_missing_hint:"尚未保存密钥。",key_placeholder:"粘贴你的 {0} 密钥",key_show:"显示密钥",key_hide:"隐藏密钥",key_save:"保存",key_replace:"替换",key_remove:"移除密钥",key_remove_confirm:"所有使用此密钥的功能都会停止。",key_saved_toast:"{0} 密钥已保存,所有功能均可使用。",key_removed_toast:"{0} 密钥已移除。",key_format_warning:"这看起来像是 {0},而不是 {1} 密钥。",key_test_label:"检查密钥",key_test_hint:"使用此密钥发送一个简短请求。",separate_agents:"智能体使用单独的密钥",separate_live_voice:"实时语音使用单独的密钥",separate_codex:"Codex 使用单独的密钥",separate_other:"某项功能使用单独的密钥",separate_hint:"之前仅为这项功能保存。切换到上方的密钥,即可只保留一个密钥。",separate_merge:"使用主密钥",separate_needs_main:"请先保存一个主密钥。",separate_merged_toast:"现在使用主 {0} 密钥。",voice_choice_title:"实时语音",voice_choice_desc:"选择通过此服务商与 {name} 交谈的语音方式。",agents_title:"智能体",agents_desc:"负责运行 {name} 后台任务的工作者。",agents_use:"用于智能体",agents_needs_key:"请在上方保存密钥后再使用。",agents_needs_login_or_key:"请在上方连接订阅或保存密钥后再使用。",agents_switched:"智能体现在运行在 {0} 上。",agents_switched_restart:"下次重启后,智能体将运行在 {0} 上。",voice_features_title:"语音功能",voice_features_desc:"在语音设置中选择。在这里显示,方便你了解此服务商支持哪些功能。",voice_features_open:"语音设置",local_models_title:"这台电脑上的模型",local_models_desc:"下载、运行并选择无需任何账号即可使用的模型。",local_models_hint:"Ollama、本地服务器和设备端语音。",local_models_open:"打开",agent_settings_title:"智能体设置",agent_settings_desc:"智能体用来思考的模型,以及由谁编写它们的任务简报,适用于任何运行它们的服务商。",restart_title:"重启以完成更新",restart_desc:"新的服务商页面需要重启一次应用的后台服务,大约需要十秒。",restart_action:"立即重启",agent_providers_desc:"开启所有允许智能体使用的服务商。打开其中一个,即可选择订阅或密钥及其模型。",agent_providers_count:"已开启 {0} 个",voice_save_hint:"保存后,下次通话将使用这些设置",instructions_title:"指令",instructions_row:"自定义指令",instructions_set:"正在使用你自己的指令",instructions_none:"无,GPT-Live 使用默认设置",instructions_edit:"编辑",instructions_hide:"关闭",accounts_section:"账号",account_active:"当前使用",account_use:"用于新终端",tab_voice:"实时通话",tab_agents:"智能体",subscriptions_title:"订阅",keys_title:"API 密钥",authenticated:"已认证",authenticated_as:"已认证 · {0}",not_installed:"未安装",not_signed_in:"未登录",account:"账号",agents_needs_login:"请先登录,才能在上面运行智能体。",agents_use_for:"在 {0} 上运行智能体",runtime:"运行时",binary_path:"程序路径",binary_path_hint:"此登录所运行的命令行工具。",cli_check:"检查",cli_check_hint:"查找该工具,读取其版本和登录状态。",key_saved_short:"密钥已保存",key_missing_short:"无密钥",key_desc_short:"一个密钥即可用于此服务商的所有功能。按使用量计费。",separate_title:"单独的密钥",accounts_title:"每个工具可登录多个账号",agent_providers_title:"服务商",access_title:"访问方式",access_desc:"使用你的订阅或 API 密钥。智能体只会使用这里选中的那一个。",access_subscription:"订阅",access_api_key:"API 密钥",access_local:"这台电脑",agents_needs_access:"请先连接订阅或保存密钥。",local_title:"在这台电脑上",local_desc:"智能体运行在本地模型上。无需账号,无需密钥,任何数据都不会离开这台电脑。",default_title:"新任务的默认服务商",default_desc:"{name} 自行分派的任务会交到这里。所有已开启的服务商都可以运行智能体。",default_on:"默认",default_make:"设为默认",default_switched:"新任务现在交给 {0}。",default_switched_restart:"下次重启后,新任务将交给 {0}。",models_title:"模型",models_count:"向智能体提供了 {0} / {1} 个模型",models_hide_all:"全部关闭",models_show_all:"全部开启",models_loading:"正在加载模型…",models_none:"此服务商未列出任何模型。智能体将使用它的默认模型。",models_reasoning:"推理",thinking_pick:"在通话中回答并使用工具",voice_ready:"就绪",voice_not_ready:"未设置"},t={section:"任务",title:"订阅用完时改用 API 密钥继续",state_off:"关闭 · 任务会等待,直到某个订阅重新有额度",state_on:"开启 · {provider} · 每个任务最多 {mission_cap},每天最多 {daily_cap}",state_on_no_key:"开启 · 还没有价格已知的 API 密钥",state_key_only:"任务已经在使用你的 API 密钥运行",state_no_key:"需要一个价格已知的 API 密钥",spent:"过去 24 小时已花费 {amount}",less_than_cent:"不到 $0.01",load_error:"无法加载此设置:{detail}",save_error:"未保存:{detail}",confirm_title:"改用你的 API 密钥继续?",confirm_intro:"当所有已连接的订阅都用完时,任务会使用你自己的 API 密钥继续运行,而不是等待。",confirm_billing:"{provider} 会按每次请求向该密钥计费:",confirm_no_key:"还没有设置价格已知的 API 密钥,因此不会产生任何费用。",confirm_caps:"每个任务在 {mission_cap} 时停止,所有自动使用每天在 {daily_cap} 时停止。",confirm_off:"你可以随时关闭。从下一次请求开始生效。",confirm_action:"开启"},_={providers_page:e,mission_billing:t};export{_ as default,t as mission_billing,e as providers_page};diff --git a/dodaios/ui/web/frontend/src/components/agentic/editor/EditorSurface.tsx b/dodaios/ui/web/frontend/src/components/agentic/editor/EditorSurface.tsxindex e65f1be4eb..9806e54e8e 100644--- a/dodaios/ui/web/frontend/src/components/agentic/editor/EditorSurface.tsx+++ b/dodaios/ui/web/frontend/src/components/agentic/editor/EditorSurface.tsx@@ -55,6 +55,16 @@ const keepContextMenu = (event: MouseEvent) => event.stopPropagation();* In follow mode the edit tab's text continues in further columns beside the* long-lived editor, as many as the width fits.*/+/**+ * A list that opens files on a single click (the Folder and Changes tabs)+ * keeps the keyboard, as in VS Code: Delete, F2 or the arrow keys pressed+ * next must act on the list, not type into the file it just opened.+ */+function keyboardKeptElsewhere(): boolean {+ const held = document.activeElement;+ return held instanceof HTMLElement && held.closest("[data-keeps-keyboard]") !== null;+}+export default function EditorSurface({tab,rendered,@@ -150,7 +160,7 @@ export default function EditorSurface({}if (hasKeyboard.current) {reportCursor(editor);- editor.focus();+ if (!keyboardKeptElsewhere()) editor.focus();}}, [tab.key, tab.fileKey, tab.mode, ready]);@@ -272,7 +282,7 @@ export default function EditorSurface({watchers = watchCursor(right);if (hasKeyboard.current) {reportCursor(right);- right.focus();+ if (!keyboardKeptElsewhere()) right.focus();}});return () => {diff --git a/dodaios/ui/web/frontend/src/components/agentic/editor/editorApi.ts b/dodaios/ui/web/frontend/src/components/agentic/editor/editorApi.tsindex adf50e917d..918f2f59cc 100644--- a/dodaios/ui/web/frontend/src/components/agentic/editor/editorApi.ts+++ b/dodaios/ui/web/frontend/src/components/agentic/editor/editorApi.ts@@ -143,8 +143,14 @@ export function moveEntry(workspaceId: string, source: string, destination: strireturn send(`${base(workspaceId)}/entries/move`, json("POST", { source, destination }));}+export interface DeleteResult {+ trashed: boolean;+ /** Undo puts the entry back with this; null when it was too large to keep. */+ undo_token: string | null;+}+/** Move to the system trash, or delete for good when `permanent` is set. */-export async function deleteEntry(workspaceId: string, path: string, permanent = false): Promise<{ trashed: boolean }> {+export async function deleteEntry(workspaceId: string, path: string, permanent = false): Promise<DeleteResult> {const res = await fetch(`${base(workspaceId)}/entries/delete`, json("POST", { path, permanent }));if (res.status === 409) {const { message, detail } = await failure(res);@@ -152,7 +158,13 @@ export async function deleteEntry(workspaceId: string, path: string, permanent =throw new Error(message);}if (!res.ok) throw new Error((await failure(res)).message);- return (await res.json()) as { trashed: boolean };+ const answer = (await res.json()) as Partial<DeleteResult>;+ return { trashed: Boolean(answer.trashed), undo_token: answer.undo_token ?? null };+}++/** Undo a delete: put the entry kept under `token` back where it was. */+export function restoreEntry(workspaceId: string, token: string): Promise<{ path: string }> {+ return send(`${base(workspaceId)}/entries/restore`, json("POST", { token }));}export interface EditorTabRecord {diff --git a/dodaios/ui/web/frontend/src/components/agentic/sidePanel/explorer/ExplorerPanel.test.tsx b/dodaios/ui/web/frontend/src/components/agentic/sidePanel/explorer/ExplorerPanel.test.tsxindex 17ccc03622..92ab7c3717 100644--- a/dodaios/ui/web/frontend/src/components/agentic/sidePanel/explorer/ExplorerPanel.test.tsx+++ b/dodaios/ui/web/frontend/src/components/agentic/sidePanel/explorer/ExplorerPanel.test.tsx@@ -9,6 +9,7 @@ import { useIdeChatStore } from "@/store/ideChat";import { groupsOf, useCodeEditorStore } from "@/store/codeEditor";import { parsePrintedPath, useExplorerPathRouting } from "@/store/ideExplorer";import { useIdeSidePanelStore } from "@/store/ideSidePanel";+import { useFileUndoStore } from "./explorerUndo";const CHANGES = {workspace_id: "w1",@@ -31,9 +32,15 @@ const CHANGES = {const calls: { url: string; body: string }[] = [];-function respond(url: string): unknown {+const TOKEN = "0123456789abcdef01234567";++function respond(url: string, body: string): unknown {if (url.includes("/changes")) return CHANGES;if (url.includes("/text-file/version")) return { version: url.includes("src") ? null : "v1" };+ if (url.endsWith("/entries/move")) return { path: JSON.parse(body).destination };+ if (url.endsWith("/entries/copy")) return { path: JSON.parse(body).destination.replace(/(\.\w+)$/, " copy$1") };+ if (url.endsWith("/entries/delete")) return { path: JSON.parse(body).path, trashed: true, undo_token: TOKEN };+ if (url.endsWith("/entries/restore")) return { path: "README.md" };if (url.includes("/entries")) return { path: "src/new.ts", trashed: true };if (url.includes("/files")) {if (url.includes("?path=src")) {@@ -54,13 +61,17 @@ beforeEach(() => {calls.length = 0;vi.stubGlobal("fetch", vi.fn(async (input: RequestInfo | URL, init?: RequestInit) => {const url = String(input);- calls.push({ url, body: String(init?.body ?? "") });- return new Response(JSON.stringify(respond(url)), { status: 200, headers: { "Content-Type": "application/json" } });+ const body = String(init?.body ?? "");+ calls.push({ url, body });+ return new Response(JSON.stringify(respond(url, body)), { status: 200, headers: { "Content-Type": "application/json" } });}));useEventStore.setState({ activeSection: "agentic-ide" });useIdeChatStore.setState({ workspace: { id: "w1", name: "App", path: "/code/app" }, stagedPane: null });useCodeEditorStore.setState({ tabs: [], active: {}, files: {}, visible: false, reveal: null, closed: [] });useIdeSidePanelStore.setState({ open: false, tabs: ["agents", "changes", "files"], active: "agents" });+ useFileUndoStore.setState({ undo: {}, redo: {}, busy: false });+ useEventStore.setState({ toasts: [] });+ window.localStorage.clear();});afterEach(() => {@@ -176,8 +187,8 @@ describe("ExplorerPanel", () => {expect(screen.getAllByTestId("explorer-tree-row").filter((row) => row.dataset.selected)).toHaveLength(2);fireEvent.keyDown(readme, { key: "Delete" });- expect(screen.getByTestId("explorer-delete-dialog").textContent).toContain("2");- fireEvent.click(screen.getByTestId("explorer-delete-confirm"));+ expect((await screen.findByTestId("explorer-dialog")).textContent).toContain("2");+ fireEvent.click(screen.getByTestId("explorer-dialog-confirm"));await waitFor(() => expect(calls.filter((call) => call.url.includes("/entries/delete"))).toHaveLength(2));const sent = calls.filter((call) => call.url.includes("/entries/delete")).map((call) => JSON.parse(call.body).path);expect(sent.sort()).toEqual(["README.md", "src"]);@@ -196,12 +207,9 @@ describe("ExplorerPanel", () => {expect(sent).toEqual({ source: "README.md", destination: "src/README.md", unique: true });});- it("moves a dragged row into the folder it is dropped on", async () => {- render(<ExplorerPanel view="files" />);- await waitFor(() => expect(screen.getAllByTestId("explorer-tree-row")).toHaveLength(2));- const [src, readme] = screen.getAllByTestId("explorer-tree-row");+ const dragTransfer = () => {const data: Record<string, string> = {};- const dataTransfer = {+ return {setData: (type: string, value: string) => {data[type] = value;},@@ -212,13 +220,120 @@ describe("ExplorerPanel", () => {effectAllowed: "",dropEffect: "",};- fireEvent.dragStart(readme, { dataTransfer });- fireEvent.dragOver(src, { dataTransfer });- fireEvent.drop(src, { dataTransfer });+ };+ const dragOnto = (from: HTMLElement, to: HTMLElement) => {+ const dataTransfer = dragTransfer();+ fireEvent.dragStart(from, { dataTransfer });+ fireEvent.dragOver(to, { dataTransfer });+ fireEvent.drop(to, { dataTransfer });+ fireEvent.dragEnd(from, { dataTransfer });+ };+ const moves = () => calls.filter((call) => call.url.endsWith("/entries/move")).map((call) => JSON.parse(call.body));+ const treeRow = (path: string) => screen.getAllByTestId("explorer-tree-row").find((entry) => entry.dataset.path === path)!;+ const menuItem = (menu: HTMLElement, name: RegExp) =>+ [...menu.querySelectorAll<HTMLButtonElement>('[role="menuitem"]')].find((entry) => name.test(entry.textContent ?? ""));++ it("asks before moving a dragged row into the folder it is dropped on", async () => {+ render(<ExplorerPanel view="files" />);+ await waitFor(() => expect(screen.getAllByTestId("explorer-tree-row")).toHaveLength(2));+ dragOnto(treeRow("README.md"), treeRow("src"));++ const dialog = await screen.findByTestId("explorer-dialog");+ expect(dialog.textContent).toContain("README.md");+ expect(dialog.textContent).toContain("src");+ expect(moves()).toEqual([]);+ fireEvent.click(screen.getByTestId("explorer-dialog-confirm"));++ await waitFor(() => expect(moves()).toEqual([{ source: "README.md", destination: "src/README.md" }]));+ // The target folder is read again AFTER the move, or the moved file would not show in it.+ const moveAt = calls.findIndex((call) => call.url.endsWith("/entries/move"));+ await waitFor(() =>+ expect(calls.slice(moveAt + 1).some((call) => call.url.includes("/files?path=src"))).toBe(true),+ );+ });- await waitFor(() => expect(calls.some((call) => call.url.endsWith("/entries/move"))).toBe(true));- const sent = JSON.parse(calls.find((call) => call.url.endsWith("/entries/move"))!.body);- expect(sent).toEqual({ source: "README.md", destination: "src/README.md" });+ it("does nothing when the move is cancelled", async () => {+ render(<ExplorerPanel view="files" />);+ await waitFor(() => expect(screen.getAllByTestId("explorer-tree-row")).toHaveLength(2));+ dragOnto(treeRow("README.md"), treeRow("src"));+ fireEvent.click(await screen.findByTestId("explorer-dialog-cancel"));+ await waitFor(() => expect(screen.queryByTestId("explorer-dialog")).toBeNull());+ expect(moves()).toEqual([]);+ });++ it("stops asking once told not to, and asks again from the menu", async () => {+ render(<ExplorerPanel view="files" />);+ await waitFor(() => expect(screen.getAllByTestId("explorer-tree-row")).toHaveLength(2));+ dragOnto(treeRow("README.md"), treeRow("src"));+ fireEvent.click(await screen.findByTestId("explorer-dialog-dont-ask"));+ fireEvent.click(screen.getByTestId("explorer-dialog-confirm"));+ await waitFor(() => expect(moves()).toHaveLength(1));+ expect(window.localStorage.getItem("dodaios.explorer.confirm.move")).toBe("never");++ // The fake server keeps listing README.md at the root, so it can be dragged again.+ dragOnto(treeRow("README.md"), treeRow("src"));+ await waitFor(() => expect(moves()).toHaveLength(2));+ expect(screen.queryByTestId("explorer-dialog")).toBeNull();++ fireEvent.contextMenu(screen.getByTestId("explorer-tree"), { clientX: 10, clientY: 10 });+ fireEvent.click(menuItem(await screen.findByTestId("explorer-menu"), /Ask again before moving/)!);+ expect(window.localStorage.getItem("dodaios.explorer.confirm.move")).toBeNull();+ });++ it("ignores a drop into the folder the row already sits in", async () => {+ render(<ExplorerPanel view="files" />);+ await waitFor(() => expect(screen.getAllByTestId("explorer-tree-row")).toHaveLength(2));+ dragOnto(treeRow("README.md"), screen.getByTestId("explorer-tree"));+ expect(screen.queryByTestId("explorer-dialog")).toBeNull();+ expect(moves()).toEqual([]);+ });++ it("moves back with Ctrl+Z and again with Ctrl+Y", async () => {+ window.localStorage.setItem("dodaios.explorer.confirm.move", "never");+ render(<ExplorerPanel view="files" />);+ await waitFor(() => expect(screen.getAllByTestId("explorer-tree-row")).toHaveLength(2));+ dragOnto(treeRow("README.md"), treeRow("src"));+ await waitFor(() => expect(moves()).toHaveLength(1));+ // The toast offers the same Undo.+ await waitFor(() => expect(useEventStore.getState().toasts.some((toast) => toast.action?.label === "Undo")).toBe(true));++ const tree = screen.getByTestId("explorer-tree");+ fireEvent.keyDown(tree, { key: "z", code: "KeyZ", ctrlKey: true });+ await waitFor(() => expect(moves()).toHaveLength(2));+ expect(moves()[1]).toEqual({ source: "src/README.md", destination: "README.md" });++ fireEvent.keyDown(tree, { key: "y", code: "KeyY", ctrlKey: true });+ await waitFor(() => expect(moves()).toHaveLength(3));+ expect(moves()[2]).toEqual({ source: "README.md", destination: "src/README.md" });+ });++ it("brings a deleted file back with Ctrl+Z", async () => {+ render(<ExplorerPanel view="files" />);+ await waitFor(() => expect(screen.getAllByTestId("explorer-tree-row")).toHaveLength(2));+ fireEvent.keyDown(treeRow("README.md"), { key: "Delete" });+ fireEvent.click(await screen.findByTestId("explorer-dialog-confirm"));+ await waitFor(() => expect(calls.some((call) => call.url.endsWith("/entries/delete"))).toBe(true));+ await waitFor(() => expect(useFileUndoStore.getState().undo.w1).toHaveLength(1));++ fireEvent.keyDown(screen.getByTestId("explorer-tree"), { key: "z", code: "KeyZ", ctrlKey: true });+ await waitFor(() => expect(calls.some((call) => call.url.endsWith("/entries/restore"))).toBe(true));+ expect(JSON.parse(calls.find((call) => call.url.endsWith("/entries/restore"))!.body)).toEqual({ token: TOKEN });+ });++ it("asks before an undo that deletes what a paste created", async () => {+ render(<ExplorerPanel view="files" />);+ await waitFor(() => expect(screen.getAllByTestId("explorer-tree-row")).toHaveLength(2));+ fireEvent.click(treeRow("README.md"));+ fireEvent.keyDown(treeRow("README.md"), { key: "c", ctrlKey: true });+ fireEvent.keyDown(treeRow("README.md"), { key: "v", ctrlKey: true });+ await waitFor(() => expect(useFileUndoStore.getState().undo.w1).toHaveLength(1));++ fireEvent.keyDown(screen.getByTestId("explorer-tree"), { key: "z", code: "KeyZ", ctrlKey: true });+ expect((await screen.findByTestId("explorer-dialog")).textContent).toContain("Paste");+ expect(calls.some((call) => call.url.endsWith("/entries/delete"))).toBe(false);+ fireEvent.click(screen.getByTestId("explorer-dialog-confirm"));+ await waitFor(() => expect(calls.some((call) => call.url.endsWith("/entries/delete"))).toBe(true));+ expect(JSON.parse(calls.find((call) => call.url.endsWith("/entries/delete"))!.body).path).toBe("README copy.md");});const openRowMenu = async (path: string) => {@@ -307,7 +422,7 @@ describe("ExplorerPanel", () => {await waitFor(() => expect(screen.getAllByTestId("explorer-tree-row")).toHaveLength(2));fireEvent.keyDown(screen.getAllByTestId("explorer-tree-row")[1], { key: "Delete" });expect(calls.some((call) => call.url.includes("/entries/delete"))).toBe(false);- fireEvent.click(await screen.findByTestId("explorer-delete-confirm"));+ fireEvent.click(await screen.findByTestId("explorer-dialog-confirm"));await waitFor(() => expect(calls.some((call) => call.url.includes("/entries/delete"))).toBe(true));const sent = calls.find((call) => call.url.includes("/entries/delete"));expect(JSON.parse(sent!.body)).toEqual({ path: "README.md", permanent: false });diff --git a/dodaios/ui/web/frontend/src/components/agentic/sidePanel/explorer/ExplorerPanel.tsx b/dodaios/ui/web/frontend/src/components/agentic/sidePanel/explorer/ExplorerPanel.tsxindex 831c7bfc50..96658bbebb 100644--- a/dodaios/ui/web/frontend/src/components/agentic/sidePanel/explorer/ExplorerPanel.tsx+++ b/dodaios/ui/web/frontend/src/components/agentic/sidePanel/explorer/ExplorerPanel.tsx@@ -17,6 +17,7 @@ import {GitCompareArrows,Loader2,Pencil,+ Redo2,RefreshCw,Scissors,Search,@@ -24,6 +25,7 @@ import {SquarePen,SquareTerminal,Trash2,+ Undo2,X,} from "lucide-react";import { fill, useT } from "@/i18n";@@ -37,8 +39,7 @@ import {} from "@/lib/agenticIdeApi";import { setWorkspaceDragPaths } from "@/components/agentic/paneDrop";import { AgentMark } from "@/components/agentic/AgentMark";-import { copyEntry, createEntry, deleteEntry, moveEntry, TrashUnavailableError } from "@/components/agentic/editor/editorApi";-import { moveModels } from "@/components/agentic/editor/editorModels";+import { TrashUnavailableError } from "@/components/agentic/editor/editorApi";import { forgetFileList } from "@/components/agentic/editor/QuickOpen";import { ThreadMenuItem, ThreadMenuSeparator, ThreadPopover } from "@/components/agentic/threads/ThreadPopover";import { useCodeEditorStore, isUnder } from "@/store/codeEditor";@@ -59,6 +60,20 @@ import {type WorkspaceChanges,} from "./explorerApi";import { FileTypeIcon } from "./FileTypeIcon";+import {+ entryDeletes,+ peekFileUndo,+ recordFileUndo,+ replayFileUndo,+ runFileOp,+ setConfirm,+ shouldConfirm,+ useFileUndoStore,+ type ConfirmKind,+ type FileOp,+ type FileUndoEntry,+ type UndoDirection,+} from "./explorerUndo";/** How often git is asked what changed while the Changes or Folder tab is on screen. */const CHANGES_POLL_MS = 6000;@@ -97,6 +112,16 @@ function revealLabelKey(): string {/** The tree's own drag payload: the workspace paths being moved. */const EXPLORER_DRAG_TYPE = "application/x-jarvis-explorer-paths";+/**+ * The paths of the tree drag in progress. A dragover cannot read the payload+ * (the browser hides it until the drop), but it must know whether the folder+ * under the pointer can take the drop at all.+ */+let draggedPaths: string[] | null = null;++/** How long a drag must rest on a closed folder before it opens. */+const DRAG_EXPAND_MS = 600;+/*** Start a drag that a terminal pane turns into file references, and that a* folder in the tree turns into a move (`moving` lists the workspace paths).@@ -388,7 +413,7 @@ export function ExplorerPanel({ view }: { view: ExplorerView }) {{needle ? t("ide_side_panel.explorer.no_match") : t("ide_side_panel.explorer.clean")}</p>) : (- <ul data-testid="explorer-changes">+ <ul data-testid="explorer-changes" data-keeps-keyboard>{changedFiles.map((file) => {const authors = file.authors ?? [];return (@@ -569,16 +594,20 @@ function FileTree({// "Select for compare" remembers one file; "Compare with …" on another opens the two side by side.const [compareFrom, setCompareFrom] = useState<string | null>(null);const chordAt = useRef(0);- const [confirm, setConfirm] = useState<{ paths: string[]; isDirectory: boolean; permanent: boolean } | null>(null);+ // The one question on screen (move, delete, replace, undo); answering resolves its promise.+ const [ask, setAsk] = useState<AskRequest | null>(null);// Several rows can be selected (Ctrl/Cmd+click, Shift+click) for delete,// cut/copy/paste and drag; a plain click selects one row again.const [selected, setSelected] = useState<ReadonlySet<string>>(() => new Set());const anchorRef = useRef<string | null>(null);const [clip, setClip] = useState<{ paths: string[]; cut: boolean } | null>(null);const [dropTarget, setDropTarget] = useState<string | null>(null);+ const dragExpand = useRef<{ path: string; timer: number } | null>(null);const menuAnchor = useRef<HTMLElement | null>(null);const list = useRef<HTMLUListElement>(null);const loaded = useRef<Set<string>>(new Set());+ const undoNext = useFileUndoStore((state) => state.undo[workspaceId]?.at(-1) ?? null);+ const redoNext = useFileUndoStore((state) => state.redo[workspaceId]?.at(-1) ?? null);const load = useCallback(async (path: string) => {@@ -588,8 +617,10 @@ function FileTree({loaded.current.add(path);setChildren((current) => ({ ...current, [path]: answer.entries }));setError(answer.error ?? "");+ return answer.entries;} catch (err) {setError((err as Error).message);+ return null;} finally {setLoading((current) => {const next = new Set(current);@@ -697,12 +728,51 @@ function FileTree({const editor = useCodeEditorStore.getState();const fail = (err: unknown) => pushToast("error", (err as Error).message);+ /** Ask one question in the dialog; resolves true on the confirm button. */+ const confirmWith = (request: Omit<AskRequest, "resolve">) =>+ new Promise<boolean>((resolve) => setAsk({ ...request, resolve }));++ /** Show an action as done, with an Undo button while it is still the newest one. */+ const announce = (message: string, entry: FileUndoEntry | null) => {+ pushToast(+ "success",+ message,+ entry ? { action: { label: t("ide_side_panel.explorer.undo"), onAction: () => undoFromToast(entry) } } : undefined,+ );+ };++ /** Re-read the folders around paths that changed; folders under them are read again when opened. */+ const reloadAround = async (paths: string[]) => {+ const folders = new Set<string>();+ for (const path of paths) {+ folders.add(parentPath(path));+ loaded.current = new Set([...loaded.current].filter((entry) => entry === "" || !isUnder(entry, path)));+ }+ await Promise.all(+ // Every folder read before, open or not: a closed one may open right after (a drop target).+ [...folders].filter((folder) => folder === "" || loaded.current.has(folder)).map((folder) => load(folder)),+ );+ };++ /** Open folders keep their open state when they move. */+ const followMove = (from: string, to: string) => {+ setExpanded((current) => {+ const next = new Set<string>();+ for (const entry of current) next.add(isUnder(entry, from) ? to + entry.slice(from.length) : entry);+ return next;+ });+ };+const create = async (folder: string, kind: "file" | "directory", name: string) => {onCreatingDone();const path = joinPath(folder, name.replace(/\\/g, "/"));try {- const created = await createEntry(workspaceId, path, kind);- forgetFileList(workspaceId);+ const created = await runFileOp(workspaceId, { kind: "create", path, entry: kind });+ recordFileUndo(+ workspaceId,+ t(kind === "file" ? "ide_side_panel.explorer.new_file" : "ide_side_panel.explorer.new_folder"),+ [created.inverse],+ );// "a/b/c.ts" may have created folders on the way; re-read from the top one.const top = joinPath(folder, path.slice(folder ? folder.length + 1 : 0).split("/")[0]);await load(folder);@@ -714,42 +784,20 @@ function FileTree({}};- /** Rename or move one entry; open buffers, tabs and open folders follow it. */- const moveTo = async (path: string, destination: string): Promise<string | null> => {- const saving = Object.values(useCodeEditorStore.getState().files).some(- (file) => file.workspaceId === workspaceId && file.saving && isUnder(file.path, path),- );- // A save in flight would land under the old name; wait for it.- if (saving) {- pushToast("error", t("ide_side_panel.explorer.busy_saving"));- return null;- }+ const rename = async (path: string, name: string) => {+ setRenaming(null);try {- const moved = await moveEntry(workspaceId, path, destination);- forgetFileList(workspaceId);- moveModels(workspaceId, path, moved.path);- editor.renamePath(workspaceId, path, moved.path);- setExpanded((current) => {- const next = new Set<string>();- for (const entry of current) next.add(isUnder(entry, path) ? moved.path + entry.slice(path.length) : entry);- return next;- });- loaded.current = new Set([...loaded.current].filter((entry) => !isUnder(entry, path)));- await load(parentPath(path));- if (parentPath(moved.path) !== parentPath(path)) await load(parentPath(moved.path));- return moved.path;+ const moved = await runFileOp(workspaceId, { kind: "move", from: path, to: joinPath(parentPath(path), name) });+ followMove(path, moved.path);+ recordFileUndo(workspaceId, t("ide_side_panel.explorer.rename"), [moved.inverse]);+ await reloadAround([path, moved.path]);+ setFocused(moved.path);+ setSelected(new Set([moved.path]));} catch (err) {fail(err);- return null;}};- const rename = async (path: string, name: string) => {- setRenaming(null);- const moved = await moveTo(path, joinPath(parentPath(path), name));- if (moved) setFocused(moved);- };-const isDirectory = (path: string) =>(children[parentPath(path)] ?? []).find((entry) => entry.path === path)?.is_directory ?? false;/** The folder a paste or a drop lands in: the folder itself, or a file's folder. */@@ -757,17 +805,84 @@ function FileTree({/** What an action on `path` covers: the whole selection when the row is part of it. */const selectionFor = (path: string) => (selected.has(path) && selected.size > 1 ? topLevel([...selected]) : [path]);- const moveInto = async (paths: string[], folder: string) => {- let last: string | null = null;- for (const path of topLevel(paths)) {- if (parentPath(path) === folder || isUnder(folder, path)) continue;- last = (await moveTo(path, joinPath(folder, baseName(path)))) ?? last;+ /** The folder's name as the dialogs show it; the workspace's name for the root. */+ const folderLabel = (folder: string) => (folder ? baseName(folder) : workspaceName || baseName(fullPath("").replace(/\\/g, "/")));++ /** Which of `paths` would really move into `folder` (not already there, not into itself). */+ const movable = (paths: string[], folder: string) =>+ topLevel(paths).filter((path) => parentPath(path) !== folder && !isUnder(folder, path));++ /**+ * Move entries into a folder as one undoable step. A name already taken+ * there asks before the existing entry is replaced (it goes to the trash).+ */+ const moveInto = async (paths: string[], folder: string): Promise<string[]> => {+ const moving = movable(paths, folder);+ if (moving.length === 0) return [];+ const existing = new Set(((await load(folder)) ?? childrenRef.current[folder] ?? []).map((entry) => entry.name));+ const ops: FileOp[] = [];+ const landed: string[] = [];+ const touched: string[] = [];+ for (const path of moving) {+ const name = baseName(path);+ const target = joinPath(folder, name);+ try {+ if (existing.has(name)) {+ const replace = await confirmWith({+ title: fill(t("ide_side_panel.explorer.replace_title"), { file: name, folder: folderLabel(folder) }),+ body: t("ide_side_panel.explorer.replace_body"),+ confirmLabel: t("ide_side_panel.explorer.replace"),+ danger: true,+ });+ if (!replace) continue;+ const removed = await runFileOp(workspaceId, { kind: "delete", path: target });+ ops.push(removed.inverse);+ touched.push(target);+ }+ const moved = await runFileOp(workspaceId, { kind: "move", from: path, to: target });+ followMove(path, moved.path);+ ops.push(moved.inverse);+ landed.push(moved.path);+ touched.push(...moved.touched);+ } catch (err) {+ fail(err);+ }}+ const entry = recordFileUndo(workspaceId, t("ide_side_panel.explorer.action_move"), ops);+ await reloadAround(touched);if (folder) expand(folder);- if (last) {- setFocused(last);- setSelected(new Set([last]));+ if (landed.length > 0) {+ setFocused(landed[landed.length - 1]);+ setSelected(new Set(landed));+ announce(+ landed.length === 1+ ? fill(t("ide_side_panel.explorer.moved_one"), { file: baseName(landed[0]), folder: folderLabel(folder) })+ : fill(t("ide_side_panel.explorer.moved_many"), { count: landed.length, folder: folderLabel(folder) }),+ entry,+ );}+ return landed;+ };++ /** A drag dropped on a folder: ask first (unless told not to), then move. */+ const dropInto = async (paths: string[], folder: string) => {+ const moving = movable(paths, folder);+ if (moving.length === 0) return;+ if (shouldConfirm("move")) {+ const ok = await confirmWith({+ title:+ moving.length === 1+ ? fill(t("ide_side_panel.explorer.move_one_title"), { file: baseName(moving[0]), folder: folderLabel(folder) })+ : fill(t("ide_side_panel.explorer.move_many_title"), { count: moving.length, folder: folderLabel(folder) }),+ body: t("ide_side_panel.explorer.move_body"),+ items: moving.length > 1 ? moving : undefined,+ confirmLabel: t("ide_side_panel.explorer.action_move"),+ dontAsk: "move",+ });+ if (!ok) return;+ }+ await moveInto(moving, folder);+ list.current?.focus({ preventScroll: true });};const paste = async (folder: string) => {@@ -777,38 +892,133 @@ function FileTree({setClip(null);return;}- let last: string | null = null;+ const ops: FileOp[] = [];+ const landed: string[] = [];for (const path of topLevel(clip.paths)) {try {- last = (await copyEntry(workspaceId, path, joinPath(folder, baseName(path)), true)).path;+ const copied = await runFileOp(workspaceId, {+ kind: "copy",+ source: path,+ to: joinPath(folder, baseName(path)),+ unique: true,+ });+ ops.push(copied.inverse);+ landed.push(copied.path);} catch (err) {fail(err);}}- forgetFileList(workspaceId);+ recordFileUndo(workspaceId, t("ide_side_panel.explorer.paste"), ops);await load(folder);if (folder) expand(folder);- if (last) setFocused(last);+ if (landed.length > 0) {+ setFocused(landed[landed.length - 1]);+ setSelected(new Set(landed));+ }+ };++ /** Delete after the question (always asked for a permanent delete). */+ const requestDelete = async (paths: string[], permanent = false) => {+ if (paths.length === 0) return;+ if (permanent || shouldConfirm("delete")) {+ const single = paths.length === 1;+ const title = !single+ ? "ide_side_panel.explorer.delete_many_title"+ : permanent+ ? "ide_side_panel.explorer.delete_permanent_title"+ : isDirectory(paths[0])+ ? "ide_side_panel.explorer.delete_folder_title"+ : "ide_side_panel.explorer.delete_file_title";+ const ok = await confirmWith({+ title: fill(t(title), { file: baseName(paths[0]), count: paths.length }),+ body: t(permanent ? "ide_side_panel.explorer.delete_permanent_body" : "ide_side_panel.explorer.delete_body"),+ items: single ? undefined : paths,+ confirmLabel: t(permanent ? "ide_side_panel.explorer.delete_permanent" : "ide_side_panel.explorer.delete_trash"),+ danger: true,+ dontAsk: permanent ? undefined : "delete",+ });+ if (!ok) return;+ }+ await remove(paths, permanent);};const remove = async (paths: string[], permanent: boolean) => {- setConfirm(null);+ const ops: FileOp[] = [];+ let rest: string[] = [];for (const [index, path] of paths.entries()) {try {- await deleteEntry(workspaceId, path, permanent);- editor.markDeleted(workspaceId, path);+ ops.push((await runFileOp(workspaceId, { kind: "delete", path, permanent })).inverse);} catch (err) {if (err instanceof TrashUnavailableError) {// No trash on this computer: ask once for the rest, permanently.- setConfirm({ paths: paths.slice(index), isDirectory: isDirectory(path), permanent: true });+ rest = paths.slice(index);break;}fail(err);}}- forgetFileList(workspaceId);+ const entry = recordFileUndo(workspaceId, t("ide_side_panel.explorer.delete"), ops);setSelected(new Set());- for (const folder of new Set(paths.map(parentPath))) await load(folder);+ await reloadAround(paths);+ if (ops.length > 0) {+ announce(+ ops.length === 1+ ? fill(t("ide_side_panel.explorer.deleted_one"), { file: baseName(paths[0]) })+ : fill(t("ide_side_panel.explorer.deleted_many"), { count: ops.length }),+ entry,+ );+ }+ list.current?.focus({ preventScroll: true });+ if (rest.length > 0) await requestDelete(rest, true);+ };++ /** Ctrl+Z / Ctrl+Y in the tree, and the menu's Undo / Redo. */+ const replay = async (direction: UndoDirection) => {+ const entry = peekFileUndo(workspaceId, direction);+ if (!entry) return;+ if (entryDeletes(entry) && shouldConfirm("undo")) {+ const ok = await confirmWith({+ title: fill(+ t(direction === "undo" ? "ide_side_panel.explorer.undo_confirm_title" : "ide_side_panel.explorer.redo_confirm_title"),+ { action: entry.label },+ ),+ body: t("ide_side_panel.explorer.undo_confirm_body"),+ confirmLabel: t(direction === "undo" ? "ide_side_panel.explorer.undo" : "ide_side_panel.explorer.redo"),+ dontAsk: "undo",+ });+ if (!ok) return;+ }+ const result = await replayFileUndo(workspaceId, direction);+ if (!result) return;+ // Open folders follow a folder moved back.+ for (const op of entry.ops) if (op.kind === "move") followMove(op.from, op.to);+ await reloadAround(result.touched);+ const shown = result.paths.filter((path) => !entry.ops.some((op) => op.kind === "delete" && op.path === path));+ if (shown.length > 0) {+ setFocused(shown[shown.length - 1]);+ setSelected(new Set(shown));+ for (const path of shown) {+ const parts = path.split("/");+ for (let index = 1; index < parts.length; index += 1) expand(parts.slice(0, index).join("/"));+ }+ }+ if (result.error) fail(result.error);+ else {+ pushToast(+ "info",+ fill(t(direction === "undo" ? "ide_side_panel.explorer.undone" : "ide_side_panel.explorer.redone"), { action: result.label }),+ );+ }+ list.current?.focus({ preventScroll: true });+ };++ /** The toast's Undo only takes back its own action, never a newer one. */+ const undoFromToast = (entry: FileUndoEntry) => {+ if (peekFileUndo(workspaceId, "undo") !== entry) {+ pushToast("info", t("ide_side_panel.explorer.undo_stale"));+ return;+ }+ void replay("undo");};const copy = (text: string) => void navigator.clipboard?.writeText(text).catch(fail);@@ -878,7 +1088,8 @@ function FileTree({setRenaming(item.path);} else if (event.key === "Delete") {event.preventDefault();- setConfirm({ paths: selectionFor(item.path), isDirectory: item.is_directory, permanent: false });+ // Shift+Delete skips the trash, as in every file manager.+ void requestDelete(selectionFor(item.path), event.shiftKey);} else if ((event.ctrlKey || event.metaKey) && ["c", "x"].includes(event.key.toLowerCase())) {event.preventDefault();setClip({ paths: selectionFor(item.path), cut: event.key.toLowerCase() === "x" });@@ -924,6 +1135,48 @@ function FileTree({);}+ /** Dragging over a folder: accept only a move that would change something; rest on a closed folder to open it. */+ const dragOverFolder = (event: DragEvent, folder: string, closedFolder: string | null = null) => {+ if (!event.dataTransfer.types.includes(EXPLORER_DRAG_TYPE)) return;+ if (draggedPaths && movable(draggedPaths, folder).length === 0) {+ event.dataTransfer.dropEffect = "none";+ if (dropTarget !== null) setDropTarget(null);+ return;+ }+ event.preventDefault();+ event.dataTransfer.dropEffect = "move";+ if (dropTarget !== folder) setDropTarget(folder);+ if (dragExpand.current?.path !== closedFolder) {+ if (dragExpand.current) window.clearTimeout(dragExpand.current.timer);+ dragExpand.current = closedFolder+ ? { path: closedFolder, timer: window.setTimeout(() => expand(closedFolder), DRAG_EXPAND_MS) }+ : null;+ }+ };++ const endDragHover = () => {+ setDropTarget(null);+ if (dragExpand.current) window.clearTimeout(dragExpand.current.timer);+ dragExpand.current = null;+ };++ const dropOn = (event: DragEvent, folder: string) => {+ endDragHover();+ const raw = event.dataTransfer.getData(EXPLORER_DRAG_TYPE);+ draggedPaths = null;+ if (!raw) return;+ event.preventDefault();+ let paths: unknown;+ try {+ paths = JSON.parse(raw);+ } catch {+ return;+ }+ if (Array.isArray(paths) && paths.every((path) => typeof path === "string")) void dropInto(paths as string[], folder);+ };++ const askingOff = (["move", "delete", "undo"] as ConfirmKind[]).some((kind) => !shouldConfirm(kind));+const menuFolder = menu ? (menu.isDirectory ? menu.path : parentPath(menu.path)) : "";const pick = (action: () => void) => () => {setMenu(null);@@ -935,9 +1188,10 @@ function FileTree({<ulref={list}data-testid="explorer-tree"+ data-keeps-keyboardrole="tree"aria-label={t("ide_side_panel.explorer.view_files")}- className="min-h-full"+ className={cn("min-h-full focus-visible:outline-none", dropTarget === "" && "bg-primary/5 ring-1 ring-inset ring-primary/40")}// A click on the empty space below the rows clears the selection, so// New File / New Folder go to the workspace root again.onClick={(event) => {@@ -947,21 +1201,30 @@ function FileTree({}}}onContextMenu={(event) => openMenu(event, "", true)}+ tabIndex={-1}+ onKeyDown={(event) => {+ // Undo / redo of the tree's own file actions, while the tree has focus.+ if (!(event.ctrlKey || event.metaKey) || event.altKey) return;+ if ((event.target as HTMLElement).tagName === "INPUT") return;+ const letter = event.code?.startsWith("Key") ? event.code.slice(3).toLowerCase() : event.key.toLowerCase();+ if (letter === "z" && !event.shiftKey) {+ event.preventDefault();+ void replay("undo");+ } else if (letter === "y" || (letter === "z" && event.shiftKey)) {+ event.preventDefault();+ void replay("redo");+ }+ }}// Dropped on the empty space below the rows: into the workspace root.onDragOver={(event) => {- if (event.target !== event.currentTarget || !event.dataTransfer.types.includes(EXPLORER_DRAG_TYPE)) return;- event.preventDefault();- event.dataTransfer.dropEffect = "move";- setDropTarget("");+ if (event.target !== event.currentTarget) return;+ dragOverFolder(event, "");}}- onDragLeave={() => setDropTarget(null)}- onDrop={(event) => {- setDropTarget(null);- const raw = event.dataTransfer.getData(EXPLORER_DRAG_TYPE);- if (!raw) return;- event.preventDefault();- void moveInto(JSON.parse(raw) as string[], "");+ onDragLeave={(event) => {+ // Moving between rows fires a leave on each; only leaving the tree counts.+ if (!event.currentTarget.contains(event.relatedTarget as Node | null)) endDragHover();}}+ onDrop={(event) => dropOn(event, "")}>{error && <li className="px-3 py-2 text-[11px] text-destructive">{error}</li>}{rows.map((row) => {@@ -1002,22 +1265,24 @@ function FileTree({<buttontype="button"draggable- onDragStart={(event) => startFileDrag(event, selectionFor(item.path).map(absolute), selectionFor(item.path))}+ onDragStart={(event) => {+ const paths = selectionFor(item.path);+ // Dragging a row outside the selection drags that row alone, and selects it.+ if (!selected.has(item.path)) setSelected(new Set([item.path]));+ startFileDrag(event, paths.map(absolute), paths);+ draggedPaths = paths;+ }}+ onDragEnd={() => {+ draggedPaths = null;+ endDragHover();+ }}onDragOver={(event) => {- if (!event.dataTransfer.types.includes(EXPLORER_DRAG_TYPE)) return;- event.preventDefault();event.stopPropagation();- event.dataTransfer.dropEffect = "move";- setDropTarget(folderFor(item.path));+ dragOverFolder(event, folderFor(item.path), item.is_directory && !open ? item.path : null);}}- onDragLeave={() => setDropTarget(null)}onDrop={(event) => {- setDropTarget(null);- const raw = event.dataTransfer.getData(EXPLORER_DRAG_TYPE);- if (!raw) return;- event.preventDefault();event.stopPropagation();- void moveInto(JSON.parse(raw) as string[], folderFor(item.path));+ dropOn(event, folderFor(item.path));}}onClick={(event) => {setFocused(item.path);@@ -1059,7 +1324,9 @@ function FileTree({current && "bg-secondary",selected.has(item.path) && selected.size > 1 && "bg-primary/10",focused === item.path && "ring-1 ring-inset ring-ring/50",- item.is_directory && dropTarget === item.path && "bg-primary/15 ring-1 ring-inset ring-primary/50",+ // The whole folder the drop lands in lights up, as in VS Code.+ dropTarget !== null && dropTarget !== "" && isUnder(item.path, dropTarget) && "bg-primary/10",+ dropTarget === item.path && "ring-1 ring-inset ring-primary/60",clip?.cut && clip.paths.includes(item.path) && "opacity-50",)}>@@ -1162,90 +1429,151 @@ function FileTree({label={t("ide_side_panel.explorer.delete")}hint="Del"danger- onSelect={pick(() => setConfirm({ paths: selectionFor(menu.path), isDirectory: menu.isDirectory, permanent: false }))}+ onSelect={pick(() => void requestDelete(selectionFor(menu.path)))}/></>)}+ {(undoNext || redoNext || askingOff) && <ThreadMenuSeparator />}+ {undoNext && (+ <ThreadMenuItem+ icon={<Undo2 className="h-4 w-4" />}+ label={fill(t("ide_side_panel.explorer.undo_action"), { action: undoNext.label })}+ hint="Ctrl+Z"+ onSelect={pick(() => void replay("undo"))}+ />+ )}+ {redoNext && (+ <ThreadMenuItem+ icon={<Redo2 className="h-4 w-4" />}+ label={fill(t("ide_side_panel.explorer.redo_action"), { action: redoNext.label })}+ hint="Ctrl+Y"+ onSelect={pick(() => void replay("redo"))}+ />+ )}+ {askingOff && (+ <ThreadMenuItem+ icon={<span aria-hidden />}+ label={t("ide_side_panel.explorer.ask_again")}+ onSelect={pick(() => {+ for (const kind of ["move", "delete", "undo"] as ConfirmKind[]) setConfirm(kind, true);+ })}+ />+ )}</div>)}</ThreadPopover>- {confirm && (- <DeleteDialog- name={baseName(confirm.paths[0])}- count={confirm.paths.length}- isDirectory={confirm.isDirectory}- permanent={confirm.permanent}- onCancel={() => setConfirm(null)}- onConfirm={() => void remove(confirm.paths, confirm.permanent)}+ {ask && (+ <ConfirmDialog+ key={ask.title}+ request={ask}+ onDone={(ok, dontAskAgain) => {+ setAsk(null);+ if (ok && dontAskAgain && ask.dontAsk) setConfirm(ask.dontAsk, false);+ ask.resolve(ok);+ }}/>)}</>);}-function DeleteDialog({- name,- count,- isDirectory,- permanent,- onConfirm,- onCancel,-}: {- name: string;- count: number;- isDirectory: boolean;- permanent: boolean;- onConfirm: () => void;- onCancel: () => void;-}) {+/** One question the Folder tab asks before a move, delete, replace or undo. */+interface AskRequest {+ title: string;+ body?: string;+ /** Workspace paths the question is about, listed when there are several. */+ items?: string[];+ confirmLabel: string;+ danger?: boolean;+ /** Offers "Don't ask me again" for this kind of question. */+ dontAsk?: ConfirmKind;+ resolve: (ok: boolean) => void;+}++/** How many entries a dialog lists before it says "and N more". */+const DIALOG_LIST_MAX = 8;++function ConfirmDialog({ request, onDone }: { request: AskRequest; onDone: (ok: boolean, dontAskAgain: boolean) => void }) {const t = useT();const confirmButton = useRef<HTMLButtonElement>(null);+ const [dontAsk, setDontAsk] = useState(false);useEffect(() => confirmButton.current?.focus(), []);- const title =- count > 1- ? "ide_side_panel.explorer.delete_many_title"- : permanent- ? "ide_side_panel.explorer.delete_permanent_title"- : isDirectory- ? "ide_side_panel.explorer.delete_folder_title"- : "ide_side_panel.explorer.delete_file_title";+ const items = request.items ?? [];+ const hidden = items.length - DIALOG_LIST_MAX;return (<divrole="presentation"+ data-testid="explorer-dialog-backdrop"className="fixed inset-0 z-[86] flex items-center justify-center bg-background/60 p-4"+ onMouseDown={(event) => {+ if (event.target === event.currentTarget) onDone(false, false);+ }}onKeyDown={(event) => {if (event.key === "Escape") {event.stopPropagation();- onCancel();+ onDone(false, false);}}}><sectionrole="alertdialog"aria-modal="true"- aria-labelledby="explorer-delete-title"- data-testid="explorer-delete-dialog"+ aria-labelledby="explorer-dialog-title"+ aria-describedby={request.body ? "explorer-dialog-body" : undefined}+ data-testid="explorer-dialog"className="w-full max-w-sm rounded-xl border border-border bg-popover p-4 text-popover-foreground shadow-float">- <h2 id="explorer-delete-title" className="text-sm font-semibold text-foreground-strong">- {fill(t(title), { file: name, count })}+ <h2 id="explorer-dialog-title" className="break-words text-sm font-semibold text-foreground-strong">+ {request.title}</h2>- <p className="mt-1.5 text-xs text-muted-foreground">- {t(permanent ? "ide_side_panel.explorer.delete_permanent_body" : "ide_side_panel.explorer.delete_body")}- </p>+ {items.length > 0 && (+ <ul className="scrollbar-jarvis mt-2 max-h-40 overflow-y-auto rounded-md border border-border/60 bg-background/40 px-2 py-1.5 font-mono text-[11px] text-muted-foreground">+ {items.slice(0, DIALOG_LIST_MAX).map((path) => (+ <li key={path} className="truncate" title={path}>+ {path}+ </li>+ ))}+ {hidden > 0 && <li>{fill(t("ide_side_panel.explorer.and_more"), { count: hidden })}</li>}+ </ul>+ )}+ {request.body && (+ <p id="explorer-dialog-body" className="mt-2 text-xs text-muted-foreground">+ {request.body}+ </p>+ )}+ {request.dontAsk && (+ <label className="mt-3 flex cursor-pointer select-none items-center gap-2 text-xs text-muted-foreground">+ <input+ type="checkbox"+ checked={dontAsk}+ onChange={(event) => setDontAsk(event.target.checked)}+ data-testid="explorer-dialog-dont-ask"+ className="h-3.5 w-3.5 accent-primary"+ />+ {t("ide_side_panel.explorer.dont_ask_again")}+ </label>+ )}<div className="mt-4 flex justify-end gap-2">- <button type="button" onClick={onCancel} className="h-8 rounded-md px-3 text-xs text-muted-foreground hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">+ <button+ type="button"+ onClick={() => onDone(false, false)}+ data-testid="explorer-dialog-cancel"+ className="h-8 rounded-md px-3 text-xs text-muted-foreground hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ >{t("ide_side_panel.explorer.cancel")}</button><buttonref={confirmButton}type="button"- onClick={onConfirm}- data-testid="explorer-delete-confirm"- className="h-8 rounded-md bg-destructive px-3 text-xs font-medium text-destructive-foreground hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ onClick={() => onDone(true, dontAsk)}+ data-testid="explorer-dialog-confirm"+ className={cn(+ "h-8 rounded-md px-3 text-xs font-medium hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",+ request.danger ? "bg-destructive text-destructive-foreground" : "bg-primary text-primary-foreground",+ )}>- {t(permanent ? "ide_side_panel.explorer.delete_permanent" : "ide_side_panel.explorer.delete")}+ {request.confirmLabel}</button></div></section>diff --git a/dodaios/ui/web/frontend/src/components/agentic/sidePanel/explorer/explorerUndo.ts b/dodaios/ui/web/frontend/src/components/agentic/sidePanel/explorer/explorerUndo.tsnew file mode 100644index 0000000000..b6b083c1bb--- /dev/null+++ b/dodaios/ui/web/frontend/src/components/agentic/sidePanel/explorer/explorerUndo.ts@@ -0,0 +1,224 @@+/**+ * Undo and redo for the Folder tab's file actions, and the "ask first"+ * preferences that guard them.+ *+ * Every action runs as one or more {@link FileOp}s. Running an op returns its+ * inverse; an undo entry is the list of inverses, so undoing it runs them+ * backwards and collects THEIR inverses as the redo entry (and the other way+ * round). A delete is undone from the copy the server keeps for that purpose+ * (`undo_token`); without one (too large) Undo says to use the trash.+ */++import { create } from "zustand";++import { fill, translate } from "@/i18n";+import {+ copyEntry,+ createEntry,+ deleteEntry,+ moveEntry,+ restoreEntry,+ TrashUnavailableError,+} from "@/components/agentic/editor/editorApi";+import { checkDisk, moveModels } from "@/components/agentic/editor/editorModels";+import { forgetFileList } from "@/components/agentic/editor/QuickOpen";+import { isUnder, useCodeEditorStore } from "@/store/codeEditor";++export type FileOp =+ | { kind: "move"; from: string; to: string }+ /** `fallbackPermanent`: on a machine without trash, delete for good (a copy is kept for Undo). */+ | { kind: "delete"; path: string; permanent?: boolean; fallbackPermanent?: boolean }+ | { kind: "restore"; path: string; token: string | null }+ | { kind: "copy"; source: string; to: string; unique?: boolean }+ | { kind: "create"; path: string; entry: "file" | "directory" };++export interface FileOpResult {+ /** The op that takes this one back. */+ inverse: FileOp;+ /** Where the entry is now (moved, copied, created or restored); the old path for a delete. */+ path: string;+ /** Workspace paths whose folders need a re-read. */+ touched: string[];+}++export interface FileUndoEntry {+ /** What the user did, as shown in "Undo: …". */+ label: string;+ /** The inverses of the ops that ran, in the order they ran. */+ ops: FileOp[];+}++const MAX_ENTRIES = 50;++const baseName = (path: string) => path.split("/").filter(Boolean).pop() ?? path;++/** Run one file op against the server and keep the open editor tabs in step. */+export async function runFileOp(workspaceId: string, op: FileOp): Promise<FileOpResult> {+ const editor = useCodeEditorStore.getState();+ switch (op.kind) {+ case "move": {+ // A save in flight would land under the old name; wait for it.+ const saving = Object.values(editor.files).some(+ (file) => file.workspaceId === workspaceId && file.saving && isUnder(file.path, op.from),+ );+ if (saving) throw new Error(translate("ide_side_panel.explorer.busy_saving"));+ const moved = await moveEntry(workspaceId, op.from, op.to);+ forgetFileList(workspaceId);+ moveModels(workspaceId, op.from, moved.path);+ editor.renamePath(workspaceId, op.from, moved.path);+ return { inverse: { kind: "move", from: moved.path, to: op.from }, path: moved.path, touched: [op.from, moved.path] };+ }+ case "delete": {+ let answer;+ try {+ answer = await deleteEntry(workspaceId, op.path, op.permanent ?? false);+ } catch (err) {+ if (!(err instanceof TrashUnavailableError) || !op.fallbackPermanent) throw err;+ answer = await deleteEntry(workspaceId, op.path, true);+ }+ useCodeEditorStore.getState().markDeleted(workspaceId, op.path);+ forgetFileList(workspaceId);+ return { inverse: { kind: "restore", path: op.path, token: answer.undo_token }, path: op.path, touched: [op.path] };+ }+ case "restore": {+ if (!op.token) {+ throw new Error(fill(translate("ide_side_panel.explorer.undo_too_large"), { file: baseName(op.path) }));+ }+ const restored = await restoreEntry(workspaceId, op.token);+ forgetFileList(workspaceId);+ // Open tabs of the restored files leave their "deleted" state.+ for (const [fileKey, file] of Object.entries(useCodeEditorStore.getState().files)) {+ if (file.workspaceId === workspaceId && isUnder(file.path, restored.path)) void checkDisk(fileKey);+ }+ return {+ inverse: { kind: "delete", path: restored.path, fallbackPermanent: true },+ path: restored.path,+ touched: [restored.path],+ };+ }+ case "copy": {+ const copied = await copyEntry(workspaceId, op.source, op.to, op.unique ?? false);+ forgetFileList(workspaceId);+ return { inverse: { kind: "delete", path: copied.path, fallbackPermanent: true }, path: copied.path, touched: [copied.path] };+ }+ case "create": {+ const created = await createEntry(workspaceId, op.path, op.entry);+ forgetFileList(workspaceId);+ return { inverse: { kind: "delete", path: created.path, fallbackPermanent: true }, path: created.path, touched: [created.path] };+ }+ }+}++interface FileUndoState {+ undo: Record<string, FileUndoEntry[]>;+ redo: Record<string, FileUndoEntry[]>;+ /** True while an undo or redo runs; a second press waits for it. */+ busy: boolean;+ record: (workspaceId: string, entry: FileUndoEntry) => void;+}++export const useFileUndoStore = create<FileUndoState>((set) => ({+ undo: {},+ redo: {},+ busy: false,+ record: (workspaceId, entry) =>+ set((state) => {+ if (entry.ops.length === 0) return {};+ const stack = [...(state.undo[workspaceId] ?? []), entry].slice(-MAX_ENTRIES);+ // A new action ends the redo chain, as in every editor.+ return { undo: { ...state.undo, [workspaceId]: stack }, redo: { ...state.redo, [workspaceId]: [] } };+ }),+}));++/** Remember a finished action for Undo; `ops` are the inverses its ops returned. */+export function recordFileUndo(workspaceId: string, label: string, ops: FileOp[]): FileUndoEntry | null {+ if (ops.length === 0) return null;+ const entry = { label, ops };+ useFileUndoStore.getState().record(workspaceId, entry);+ return entry;+}++export type UndoDirection = "undo" | "redo";++/** The entry the next undo or redo would run, without running it. */+export function peekFileUndo(workspaceId: string, direction: UndoDirection): FileUndoEntry | null {+ const stack = useFileUndoStore.getState()[direction][workspaceId] ?? [];+ return stack[stack.length - 1] ?? null;+}++export interface ReplayResult {+ label: string;+ /** Where the entries are now. */+ paths: string[];+ touched: string[];+ error: Error | null;+}++/**+ * Undo or redo the newest action. One op failing (a file too large to keep,+ * a name taken meanwhile) does not stop the others; the ops that succeeded+ * move to the other stack, so what was done can still be redone.+ */+export async function replayFileUndo(workspaceId: string, direction: UndoDirection): Promise<ReplayResult | null> {+ const store = useFileUndoStore;+ if (store.getState().busy) return null;+ const entry = peekFileUndo(workspaceId, direction);+ if (!entry) return null;+ const other: UndoDirection = direction === "undo" ? "redo" : "undo";+ store.setState((state) => ({+ busy: true,+ [direction]: { ...state[direction], [workspaceId]: (state[direction][workspaceId] ?? []).slice(0, -1) },+ }));+ const inverses: FileOp[] = [];+ const paths: string[] = [];+ const touched: string[] = [];+ let error: Error | null = null;+ try {+ for (const op of [...entry.ops].reverse()) {+ try {+ const result = await runFileOp(workspaceId, op);+ inverses.push(result.inverse);+ paths.push(result.path);+ touched.push(...result.touched);+ } catch (err) {+ error ??= err instanceof Error ? err : new Error(String(err));+ }+ }+ } finally {+ store.setState((state) => ({+ busy: false,+ [other]:+ inverses.length > 0+ ? { ...state[other], [workspaceId]: [...(state[other][workspaceId] ?? []), { label: entry.label, ops: inverses }].slice(-MAX_ENTRIES) }+ : state[other],+ }));+ }+ return { label: entry.label, paths, touched, error };+}++/** Whether undoing (or redoing) this entry deletes something. */+export function entryDeletes(entry: FileUndoEntry): boolean {+ return entry.ops.some((op) => op.kind === "delete");+}++/** The questions the Folder tab can be told to stop asking. Permanent deletes always ask. */+export type ConfirmKind = "move" | "delete" | "undo";++const confirmKey = (kind: ConfirmKind) => `dodaios.explorer.confirm.${kind}`;++export function shouldConfirm(kind: ConfirmKind): boolean {+ try {+ return window.localStorage.getItem(confirmKey(kind)) !== "never";+ } catch {+ return true; // storage blocked: ask every time+ }+}++export function setConfirm(kind: ConfirmKind, ask: boolean): void {+ try {+ if (ask) window.localStorage.removeItem(confirmKey(kind));+ else window.localStorage.setItem(confirmKey(kind), "never");+ } catch {+ // storage blocked: the choice lasts until the page reloads at most+ }+}diff --git a/dodaios/ui/web/frontend/src/i18n/locales/de.json b/dodaios/ui/web/frontend/src/i18n/locales/de.jsonindex 11891169ad..b74c5d5966 100644--- a/dodaios/ui/web/frontend/src/i18n/locales/de.json+++ b/dodaios/ui/web/frontend/src/i18n/locales/de.json@@ -7592,8 +7592,8 @@"delete_file_title": "{file} löschen?","delete_folder_title": "Den Ordner {file} mit allem Inhalt löschen?","delete_permanent_title": "{file} endgültig löschen?",- "delete_body": "Es landet im Papierkorb und lässt sich von dort wiederherstellen.",- "delete_permanent_body": "Dieser Computer hat keinen Papierkorb. Endgültiges Löschen lässt sich nicht rückgängig machen.",+ "delete_body": "Es landet im Papierkorb. Strg+Z im Ordner-Tab holt es zurück.",+ "delete_permanent_body": "Dieser Computer hat keinen Papierkorb. Strg+Z holt kleine Dateien einen Tag lang zurück; größere sind endgültig weg.","delete_permanent": "Endgültig löschen","cut": "Ausschneiden","copy": "Kopieren",@@ -7608,7 +7608,33 @@"find_in_folder": "In Ordner suchen…","select_compare": "Für Vergleich auswählen","compare_with": "Mit {file} vergleichen",- "cancel": "Abbrechen"+ "cancel": "Abbrechen",+ "delete_trash": "In den Papierkorb",+ "deleted_one": "{file} gelöscht.",+ "deleted_many": "{count} Einträge gelöscht.",+ "action_move": "Verschieben",+ "move_one_title": "{file} nach {folder} verschieben?",+ "move_many_title": "Diese {count} Einträge nach {folder} verschieben?",+ "move_body": "Strg+Z im Ordner-Tab verschiebt es zurück.",+ "moved_one": "{file} nach {folder} verschoben.",+ "moved_many": "{count} Einträge nach {folder} verschoben.",+ "replace_title": "In {folder} gibt es schon {file}. Ersetzen?",+ "replace_body": "Das vorhandene landet im Papierkorb. Strg+Z holt es zurück.",+ "replace": "Ersetzen",+ "and_more": "und {count} weitere",+ "dont_ask_again": "Nicht mehr fragen",+ "undo": "Rückgängig",+ "redo": "Wiederholen",+ "undo_action": "{action} rückgängig machen",+ "redo_action": "{action} wiederholen",+ "undo_confirm_title": "{action} rückgängig machen?",+ "redo_confirm_title": "{action} wiederholen?",+ "undo_confirm_body": "Damit wird gelöscht, was dieser Schritt angelegt hat. Es landet im Papierkorb.",+ "undone": "Rückgängig gemacht: {action}",+ "redone": "Wiederholt: {action}",+ "undo_stale": "Danach kamen weitere Dateiaktionen. Mit Strg+Z im Ordner-Tab geht es Schritt für Schritt zurück.",+ "undo_too_large": "{file} war zu groß, um es für Rückgängig aufzubewahren. Hol es aus dem Papierkorb zurück.",+ "ask_again": "Vor Verschieben und Löschen wieder fragen"},"search": {"placeholder": "In allen Dateien suchen",diff --git a/dodaios/ui/web/frontend/src/i18n/locales/en.json b/dodaios/ui/web/frontend/src/i18n/locales/en.jsonindex 3e6f9070ec..7d37775b43 100644--- a/dodaios/ui/web/frontend/src/i18n/locales/en.json+++ b/dodaios/ui/web/frontend/src/i18n/locales/en.json@@ -7592,8 +7592,8 @@"delete_file_title": "Delete {file}?","delete_folder_title": "Delete the folder {file} and everything in it?","delete_permanent_title": "Delete {file} permanently?",- "delete_body": "It goes to the trash, so you can still restore it.",- "delete_permanent_body": "This computer has no trash to move it to. A permanent delete cannot be undone.",+ "delete_body": "It goes to the trash. Ctrl+Z in the Folder tab brings it back.",+ "delete_permanent_body": "This computer has no trash. Ctrl+Z can bring small files back for a day; larger ones are gone for good.","delete_permanent": "Delete permanently","cut": "Cut","copy": "Copy",@@ -7608,7 +7608,33 @@"find_in_folder": "Find in folder…","select_compare": "Select for compare","compare_with": "Compare with {file}",- "cancel": "Cancel"+ "cancel": "Cancel",+ "delete_trash": "Move to trash",+ "deleted_one": "Deleted {file}.",+ "deleted_many": "Deleted {count} items.",+ "action_move": "Move",+ "move_one_title": "Move {file} into {folder}?",+ "move_many_title": "Move these {count} items into {folder}?",+ "move_body": "Ctrl+Z in the Folder tab moves it back.",+ "moved_one": "Moved {file} into {folder}.",+ "moved_many": "Moved {count} items into {folder}.",+ "replace_title": "{folder} already has an item named {file}. Replace it?",+ "replace_body": "The existing one goes to the trash. Ctrl+Z brings it back.",+ "replace": "Replace",+ "and_more": "and {count} more",+ "dont_ask_again": "Don't ask me again",+ "undo": "Undo",+ "redo": "Redo",+ "undo_action": "Undo {action}",+ "redo_action": "Redo {action}",+ "undo_confirm_title": "Undo {action}?",+ "redo_confirm_title": "Redo {action}?",+ "undo_confirm_body": "This deletes what that action created. It goes to the trash.",+ "undone": "Undone: {action}",+ "redone": "Redone: {action}",+ "undo_stale": "Newer file actions came after this one. Press Ctrl+Z in the Folder tab to go back step by step.",+ "undo_too_large": "{file} was too large to keep for Undo. Restore it from the trash.",+ "ask_again": "Ask again before moving and deleting"},"search": {"placeholder": "Search in all files",diff --git a/dodaios/ui/web/frontend/src/i18n/locales/es.json b/dodaios/ui/web/frontend/src/i18n/locales/es.jsonindex 74035eb11c..4c9b040ab2 100644--- a/dodaios/ui/web/frontend/src/i18n/locales/es.json+++ b/dodaios/ui/web/frontend/src/i18n/locales/es.json@@ -7592,8 +7592,8 @@"delete_file_title": "¿Eliminar {file}?","delete_folder_title": "¿Eliminar la carpeta {file} y todo su contenido?","delete_permanent_title": "¿Eliminar {file} definitivamente?",- "delete_body": "Irá a la papelera, así que aún podrás restaurarlo.",- "delete_permanent_body": "Este equipo no tiene papelera. Una eliminación definitiva no se puede deshacer.",+ "delete_body": "Va a la papelera. Ctrl+Z en la pestaña Carpeta lo recupera.",+ "delete_permanent_body": "Este equipo no tiene papelera. Ctrl+Z puede recuperar archivos pequeños durante un día; los grandes se pierden para siempre.","delete_permanent": "Eliminar definitivamente","cut": "Cortar","copy": "Copiar",@@ -7608,7 +7608,33 @@"find_in_folder": "Buscar en la carpeta…","select_compare": "Seleccionar para comparar","compare_with": "Comparar con {file}",- "cancel": "Cancelar"+ "cancel": "Cancelar",+ "delete_trash": "Mover a la papelera",+ "deleted_one": "{file} eliminado.",+ "deleted_many": "{count} elementos eliminados.",+ "action_move": "Mover",+ "move_one_title": "¿Mover {file} a {folder}?",+ "move_many_title": "¿Mover estos {count} elementos a {folder}?",+ "move_body": "Ctrl+Z en la pestaña Carpeta lo devuelve a su sitio.",+ "moved_one": "{file} movido a {folder}.",+ "moved_many": "{count} elementos movidos a {folder}.",+ "replace_title": "{folder} ya tiene un elemento llamado {file}. ¿Reemplazarlo?",+ "replace_body": "El existente va a la papelera. Ctrl+Z lo recupera.",+ "replace": "Reemplazar",+ "and_more": "y {count} más",+ "dont_ask_again": "No volver a preguntar",+ "undo": "Deshacer",+ "redo": "Rehacer",+ "undo_action": "Deshacer {action}",+ "redo_action": "Rehacer {action}",+ "undo_confirm_title": "¿Deshacer {action}?",+ "redo_confirm_title": "¿Rehacer {action}?",+ "undo_confirm_body": "Esto elimina lo que creó esa acción. Va a la papelera.",+ "undone": "Deshecho: {action}",+ "redone": "Rehecho: {action}",+ "undo_stale": "Después hubo más acciones con archivos. Pulsa Ctrl+Z en la pestaña Carpeta para volver paso a paso.",+ "undo_too_large": "{file} era demasiado grande para guardarlo para Deshacer. Recupéralo de la papelera.",+ "ask_again": "Volver a preguntar antes de mover y eliminar"},"search": {"placeholder": "Buscar en todos los archivos",diff --git a/dodaios/ui/web/frontend/src/i18n/locales/pt.json b/dodaios/ui/web/frontend/src/i18n/locales/pt.jsonindex 78a769364b..9e145e881d 100644--- a/dodaios/ui/web/frontend/src/i18n/locales/pt.json+++ b/dodaios/ui/web/frontend/src/i18n/locales/pt.json@@ -7592,8 +7592,8 @@"delete_file_title": "Eliminar {file}?","delete_folder_title": "Eliminar a pasta {file} e todo o seu conteúdo?","delete_permanent_title": "Eliminar {file} permanentemente?",- "delete_body": "Vai para o lixo, por isso ainda o podes restaurar.",- "delete_permanent_body": "Este computador não tem lixo para onde o mover. Uma eliminação permanente não pode ser anulada.",+ "delete_body": "Vai para a lixeira. Ctrl+Z na aba Pasta traz de volta.",+ "delete_permanent_body": "Este computador não tem lixeira. Ctrl+Z pode trazer arquivos pequenos de volta por um dia; os maiores se perdem para sempre.","delete_permanent": "Eliminar permanentemente","cut": "Cortar","copy": "Copiar",@@ -7608,7 +7608,33 @@"find_in_folder": "Procurar na pasta…","select_compare": "Selecionar para comparar","compare_with": "Comparar com {file}",- "cancel": "Cancelar"+ "cancel": "Cancelar",+ "delete_trash": "Mover para a lixeira",+ "deleted_one": "{file} excluído.",+ "deleted_many": "{count} itens excluídos.",+ "action_move": "Mover",+ "move_one_title": "Mover {file} para {folder}?",+ "move_many_title": "Mover estes {count} itens para {folder}?",+ "move_body": "Ctrl+Z na aba Pasta move de volta.",+ "moved_one": "{file} movido para {folder}.",+ "moved_many": "{count} itens movidos para {folder}.",+ "replace_title": "{folder} já tem um item chamado {file}. Substituir?",+ "replace_body": "O existente vai para a lixeira. Ctrl+Z traz de volta.",+ "replace": "Substituir",+ "and_more": "e mais {count}",+ "dont_ask_again": "Não perguntar de novo",+ "undo": "Desfazer",+ "redo": "Refazer",+ "undo_action": "Desfazer {action}",+ "redo_action": "Refazer {action}",+ "undo_confirm_title": "Desfazer {action}?",+ "redo_confirm_title": "Refazer {action}?",+ "undo_confirm_body": "Isso exclui o que essa ação criou. Vai para a lixeira.",+ "undone": "Desfeito: {action}",+ "redone": "Refeito: {action}",+ "undo_stale": "Depois disso vieram outras ações com arquivos. Pressione Ctrl+Z na aba Pasta para voltar passo a passo.",+ "undo_too_large": "{file} era grande demais para guardar para Desfazer. Recupere-o da lixeira.",+ "ask_again": "Perguntar de novo antes de mover e excluir"},"search": {"placeholder": "Pesquisar em todos os ficheiros",diff --git a/dodaios/ui/web/frontend/src/i18n/locales/zh.json b/dodaios/ui/web/frontend/src/i18n/locales/zh.jsonindex 3511a4a35a..dcd18079c9 100644--- a/dodaios/ui/web/frontend/src/i18n/locales/zh.json+++ b/dodaios/ui/web/frontend/src/i18n/locales/zh.json@@ -7592,8 +7592,8 @@"delete_file_title": "要删除 {file} 吗?","delete_folder_title": "要删除文件夹 {file} 及其中的所有内容吗?","delete_permanent_title": "要永久删除 {file} 吗?",- "delete_body": "它会被移到回收站,你仍然可以恢复。",- "delete_permanent_body": "这台电脑没有可移入的回收站。永久删除无法撤销。",+ "delete_body": "它会进入回收站。在“文件夹”标签中按 Ctrl+Z 可恢复。",+ "delete_permanent_body": "这台电脑没有回收站。Ctrl+Z 可在一天内恢复小文件;较大的文件将永久删除。","delete_permanent": "永久删除","cut": "剪切","copy": "复制",@@ -7608,7 +7608,33 @@"find_in_folder": "在文件夹中查找…","select_compare": "选择以进行比较","compare_with": "与 {file} 比较",- "cancel": "取消"+ "cancel": "取消",+ "delete_trash": "移到回收站",+ "deleted_one": "已删除 {file}。",+ "deleted_many": "已删除 {count} 项。",+ "action_move": "移动",+ "move_one_title": "将 {file} 移到 {folder}?",+ "move_many_title": "将这 {count} 项移到 {folder}?",+ "move_body": "在“文件夹”标签中按 Ctrl+Z 可移回。",+ "moved_one": "已将 {file} 移到 {folder}。",+ "moved_many": "已将 {count} 项移到 {folder}。",+ "replace_title": "{folder} 中已有名为 {file} 的项。要替换吗?",+ "replace_body": "现有的那个会进入回收站。Ctrl+Z 可恢复。",+ "replace": "替换",+ "and_more": "还有 {count} 项",+ "dont_ask_again": "不再询问",+ "undo": "撤销",+ "redo": "重做",+ "undo_action": "撤销{action}",+ "redo_action": "重做{action}",+ "undo_confirm_title": "撤销{action}?",+ "redo_confirm_title": "重做{action}?",+ "undo_confirm_body": "这会删除该操作创建的内容。它会进入回收站。",+ "undone": "已撤销:{action}",+ "redone": "已重做:{action}",+ "undo_stale": "之后还有其他文件操作。在“文件夹”标签中按 Ctrl+Z 可逐步撤销。",+ "undo_too_large": "{file} 太大,无法为撤销保留。请从回收站恢复。",+ "ask_again": "移动和删除前再次询问"},"search": {"placeholder": "在所有文件中搜索",diff --git a/tests/unit/agentic_ide/test_delete_undo.py b/tests/unit/agentic_ide/test_delete_undo.pynew file mode 100644index 0000000000..5ede7f2f7d--- /dev/null+++ b/tests/unit/agentic_ide/test_delete_undo.py@@ -0,0 +1,85 @@+"""The explorer's Undo for deletes: a kept copy goes back where it was."""++from __future__ import annotations++from pathlib import Path++import pytest++from dodaios.agentic_ide import delete_undo+from dodaios.agentic_ide.file_editing import EditError+++def store(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:+ folder = tmp_path / "store"+ monkeypatch.setattr(delete_undo, "_store_root", lambda: folder)+ return folder+++def root(tmp_path: Path) -> Path:+ folder = tmp_path / "project"+ folder.mkdir()+ return folder+++def test_keep_and_restore_a_file(root: Path, store: Path) -> None:+ (root / "notes.md").write_text("draft", encoding="utf-8")+ token = delete_undo.keep(root, "notes.md")+ assert token+ (root / "notes.md").unlink()++ assert delete_undo.restore(root, token) == "notes.md"+ assert (root / "notes.md").read_text(encoding="utf-8") == "draft"+ assert not (store / token).exists()+++def test_restore_refuses_to_overwrite(root: Path, store: Path) -> None:+ (root / "a.txt").write_text("old", encoding="utf-8")+ token = delete_undo.keep(root, "a.txt")+ assert token+ (root / "a.txt").write_text("new", encoding="utf-8")++ with pytest.raises(EditError):+ delete_undo.restore(root, token)+ assert (root / "a.txt").read_text(encoding="utf-8") == "new"+++def test_restore_refuses_another_workspace(root: Path, tmp_path: Path, store: Path) -> None:+ (root / "a.txt").write_text("x", encoding="utf-8")+ token = delete_undo.keep(root, "a.txt")+ other = tmp_path / "other"+ other.mkdir()+ assert token+ with pytest.raises(EditError):+ delete_undo.restore(other, token)+++def test_bad_tokens_are_refused(root: Path, store: Path) -> None:+ for token in ("../../etc", "zz", "0" * 24):+ with pytest.raises(EditError):+ delete_undo.restore(root, token)+++def test_large_entries_are_not_kept(+ root: Path, store: Path, monkeypatch: pytest.MonkeyPatch+) -> None:+ monkeypatch.setattr(delete_undo, "MAX_UNDO_BYTES", 4)+ (root / "big.bin").write_bytes(b"0123456789")+ assert delete_undo.keep(root, "big.bin") is None+ monkeypatch.setattr(delete_undo, "MAX_UNDO_FILES", 2)+ (root / "many").mkdir()+ for index in range(5):+ (root / "many" / f"{index}.txt").write_text("", encoding="utf-8")+ assert delete_undo.keep(root, "many") is None+++def test_only_the_newest_copies_are_held(+ root: Path, store: Path, monkeypatch: pytest.MonkeyPatch+) -> None:+ monkeypatch.setattr(delete_undo, "MAX_KEPT", 2)+ (root / "a.txt").write_text("x", encoding="utf-8")+ tokens = [delete_undo.keep(root, "a.txt") for _ in range(4)]+ assert all(tokens)+ assert len([entry for entry in store.iterdir() if entry.is_dir()]) == 2diff --git a/tests/unit/agentic_ide/test_file_editing.py b/tests/unit/agentic_ide/test_file_editing.pyindex aa98d63842..2a5ccd2910 100644--- a/tests/unit/agentic_ide/test_file_editing.py+++ b/tests/unit/agentic_ide/test_file_editing.py@@ -3,6 +3,7 @@from __future__ import annotationsimport os+import shutilimport subprocessimport sysfrom pathlib import Path@@ -11,7 +12,7 @@ from types import SimpleNamespaceimport pytestfrom fastapi import HTTPException-from dodaios.agentic_ide import file_editing+from dodaios.agentic_ide import delete_undo, file_editingfrom dodaios.agentic_ide.file_editing import (EditConflict,EditError,@@ -305,6 +306,8 @@ def workspace(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:get=lambda workspace_id: session if workspace_id == "workspace-1" else None)monkeypatch.setattr(routes, "get_registry", lambda: registry)+ # Undo copies of deleted entries go to the test's folder, never the user's.+ monkeypatch.setattr(delete_undo, "_store_root", lambda: tmp_path / "undo-store")return root@@ -408,3 +411,48 @@ def test_save_keeps_the_file_mode(tmp_path: Path) -> None:write_text_file(tmp_path, "run.sh", "echo bye\n", expected_version=loaded.version)assert script.stat().st_mode & 0o777 == 0o755+++async def test_delete_route_keeps_a_copy_that_restore_puts_back(+ workspace: Path, monkeypatch: pytest.MonkeyPatch+) -> None:+ (workspace / "src").mkdir()+ (workspace / "src" / "a.txt").write_text("hello", encoding="utf-8")+ def fake_trash(target: Path) -> bool:+ shutil.rmtree(target)+ return True++ monkeypatch.setattr(file_editing, "_move_to_trash", fake_trash)+ answer = await routes.delete_workspace_entry(+ "workspace-1", routes.DeleteWorkspaceEntryRequest(path="src")+ )+ assert answer["trashed"] is True+ assert not (workspace / "src").exists()+ token = answer["undo_token"]+ assert isinstance(token, str)++ restored = await routes.restore_workspace_entry(+ "workspace-1", routes.RestoreWorkspaceEntryRequest(token=token)+ )+ assert restored["path"] == "src"+ assert (workspace / "src" / "a.txt").read_text(encoding="utf-8") == "hello"++ # A token is used once.+ with pytest.raises(HTTPException) as caught:+ await routes.restore_workspace_entry(+ "workspace-1", routes.RestoreWorkspaceEntryRequest(token=token)+ )+ assert caught.value.status_code == 409+++async def test_failed_delete_drops_its_undo_copy(+ workspace: Path, tmp_path: Path, monkeypatch: pytest.MonkeyPatch+) -> None:+ (workspace / "a.txt").write_text("x", encoding="utf-8")+ monkeypatch.setattr(file_editing, "_move_to_trash", lambda target: False)+ with pytest.raises(HTTPException):+ await routes.delete_workspace_entry(+ "workspace-1", routes.DeleteWorkspaceEntryRequest(path="a.txt")+ )+ store = tmp_path / "undo-store"+ assert not store.exists() or not any(store.iterdir())diff --git a/tests/unit/agentic_ide/test_system_trash.py b/tests/unit/agentic_ide/test_system_trash.pynew file mode 100644index 0000000000..4470fe811a--- /dev/null+++ b/tests/unit/agentic_ide/test_system_trash.py@@ -0,0 +1,51 @@+"""The system trash: send2trash when installed, the Windows shell otherwise."""++from __future__ import annotations++import builtins+import sys+from pathlib import Path++import pytest++from dodaios.agentic_ide import system_trash+++def no_send2trash(monkeypatch: pytest.MonkeyPatch) -> None:+ real_import = builtins.__import__++ def fake_import(name: str, *args: object, **kwargs: object) -> object:+ if name == "send2trash":+ raise ImportError(name)+ return real_import(name, *args, **kwargs) # type: ignore[arg-type]++ monkeypatch.setattr(builtins, "__import__", fake_import)+++def test_without_the_package_windows_uses_the_shell(+ no_send2trash: None, monkeypatch: pytest.MonkeyPatch, tmp_path: Path+) -> None:+ recycled: list[Path] = []+ monkeypatch.setattr(sys, "platform", "win32")+ monkeypatch.setattr(+ system_trash, "_windows_recycle", lambda target: recycled.append(target) or True+ )+ assert system_trash.move_to_trash(tmp_path / "a.txt") is True+ assert recycled == [tmp_path / "a.txt"]+++def test_a_refusing_recycle_bin_is_an_error(+ no_send2trash: None, monkeypatch: pytest.MonkeyPatch, tmp_path: Path+) -> None:+ monkeypatch.setattr(sys, "platform", "win32")+ monkeypatch.setattr(system_trash, "_windows_recycle", lambda target: False)+ with pytest.raises(OSError):+ system_trash.move_to_trash(tmp_path / "a.txt")+++def test_without_the_package_elsewhere_there_is_no_trash(+ no_send2trash: None, monkeypatch: pytest.MonkeyPatch, tmp_path: Path+) -> None:+ monkeypatch.setattr(sys, "platform", "linux")+ assert system_trash.move_to_trash(tmp_path / "a.txt") is False