Self-hosted AI workspace.
Python
Merge lab into refactor/email-library-package
Alexandre Teixeira799adbbde626
diff --cc tests/test_action_menu_order.pyindex d5f2f0e13,263978347..30a1b49bc--- a/tests/test_action_menu_order.py+++ b/tests/test_action_menu_order.py@@@ -262,8 -257,8 +262,8 @@@ def test_unsubscribe_scan_status_sits_bdef test_unsubscribe_success_removes_messages_before_the_next_scan() -> None:- frontend = (ROOT / "static/js/emailLibrary.js").read_text(encoding="utf-8")+ frontend = email_library_source()- backend = (ROOT / "routes/email_routes.py").read_text(encoding="utf-8")+ backend = (ROOT / "routes/email/email_routes.py").read_text(encoding="utf-8")mcp = (ROOT / "mcp_servers/email_server.py").read_text(encoding="utf-8")assert "async function _deleteAfterUnsubscribe" in frontendassert "action: 'delete'" in frontend[frontend.index("async function _deleteAfterUnsubscribe"):]diff --cc tests/test_active_document_visibility_contract.pyindex 93b5a720f,ddb9df847..1423c1670--- a/tests/test_active_document_visibility_contract.py+++ b/tests/test_active_document_visibility_contract.py@@@ -1,6 -1,6 +1,7 @@@from pathlib import Pathimport re+ from tests.helpers.document_source import document_source, function_body+from tests.helpers.js_modules import email_library_pathsROOT = Path(__file__).resolve().parents[1]diff --cc tests/test_card_menu_style_contract.pyindex 7d8f9d3d1,f073a56d2..e8409c123--- a/tests/test_card_menu_style_contract.py+++ b/tests/test_card_menu_style_contract.py@@@ -1,5 -1,5 +1,6 @@@from pathlib import Path+ from tests.helpers.stylesheets import app_css+from tests.helpers.js_modules import email_library_pathsROOT = Path(__file__).resolve().parents[1]diff --cc tests/test_email_ai_reply_context_draft_static.pyindex b3d5a4264,6bb370268..d66bb8d3d--- a/tests/test_email_ai_reply_context_draft_static.py+++ b/tests/test_email_ai_reply_context_draft_static.py@@@ -1,5 -1,5 +1,6 @@@from pathlib import Path+ from tests.helpers.document_source import document_source+from tests.helpers.js_modules import email_library_sourceROOT = Path(__file__).resolve().parent.parentdiff --cc tests/test_email_attachment_search.pyindex 93f5f8392,5237dd577..d36500188--- a/tests/test_email_attachment_search.py+++ b/tests/test_email_attachment_search.py@@@ -1,6 -1,6 +1,7 @@@import sqlite3from email.message import EmailMessage+ from tests.helpers.document_source import document_source+from tests.helpers.js_modules import email_library_sourcedef test_attachment_filename_is_part_of_ui_index_search(tmp_path, monkeypatch):diff --cc tests/test_email_folder_chip_static.pyindex c274143e7,4410414ab..9e56bf5c2--- a/tests/test_email_folder_chip_static.py+++ b/tests/test_email_folder_chip_static.py@@@ -1,13 -1,13 +1,14 @@@from pathlib import Path+ from tests.helpers.stylesheets import app_css+from tests.helpers.js_modules import email_library_sourceROOT = Path(__file__).resolve().parents[1]def test_folder_chip_stays_with_date_and_moves_down():- source = (ROOT / "static" / "js" / "emailLibrary.js").read_text()+ source = email_library_source()- css = (ROOT / "static" / "style.css").read_text()+ css = app_css()assert 'class="email-meta-date-group"' in sourcegroup_markup = source[source.index('class="email-meta-date-group"'):][:180]diff --cc tests/test_email_library_bulk_actions.pyindex 570258a29,2af53fd20..4e9930678--- a/tests/test_email_library_bulk_actions.py+++ b/tests/test_email_library_bulk_actions.py@@@ -1,9 -1,10 +1,10 @@@from pathlib import Path+ from tests.helpers.document_source import document_source+from tests.helpers.js_modules import email_library_source, js_function_source_REPO = Path(__file__).resolve().parents[1]- _EMAIL_ROUTES = _REPO / "routes" / "email_routes.py"-_EMAIL_LIBRARY = _REPO / "static" / "js" / "emailLibrary.js"+ _EMAIL_ROUTES = _REPO / "routes" / "email" / "email_routes.py"_EMAIL_MCP_SERVER = _REPO / "mcp_servers" / "email_server.py"_EMAIL_FIXTURE_HELPER = _REPO / "scripts" / "ody_eval_email_fixture.py"diff --cc tests/test_email_open_dedup_js.pyindex 1a624a83c,9af8020b0..18d98bc0a--- a/tests/test_email_open_dedup_js.py+++ b/tests/test_email_open_dedup_js.py@@@ -6,7 -6,7 +6,8 @@@ import subprocesfrom pathlib import Pathimport pytest+ from tests.helpers.document_source import document_source+from tests.helpers.js_modules import email_library_source, js_function_source_REPO = Path(__file__).resolve().parent.parentdiff --cc tests/test_email_ui_async_identity.pyindex 74b8db22f,36eb43c66..f38d7f297--- a/tests/test_email_ui_async_identity.py+++ b/tests/test_email_ui_async_identity.py@@@ -1,5 -1,5 +1,6 @@@from pathlib import Path+ from tests.helpers.document_source import document_source+from tests.helpers.js_modules import email_library_sourceROOT = Path(__file__).resolve().parents[1]diff --cc tests/test_external_context_tool_gate.pyindex 513b465ee,e949f88e0..cc8d7f4f0--- a/tests/test_external_context_tool_gate.py+++ b/tests/test_external_context_tool_gate.py@@@ -8,7 -8,6 +8,8 @@@ from pathlib import Patimport pytest++from tests.helpers.document_source import document_source+from tests.helpers.js_modules import email_library_pathsimport src.tool_capabilities as tool_capabilitiesfrom src.tool_capabilities import (KNOWN_CAPABILITY_TOOLS,@@@ -1404,12 -1404,15 +1405,17 @@@ def test_frontend_tool_approval_uses_op"static/js/chat.js","static/js/chatRenderer.js","static/js/chatStream.js",- "static/js/document.js","static/js/emailInbox.js",- "static/js/emailLibrary.js","static/js/settings.js","static/js/slashCommands.js",)- ] + [p.read_text() for p in email_library_paths(include_wrapper=True)]+ ]- # The document editor is a module set, not one file: a stale version string- # must not be able to hide in a module extracted out of document.js.++ # Both the document editor and email library are module sets.+ approval_module_sources.append(document_source())++ approval_module_sources.extend(++ p.read_text()++ for p in email_library_paths(include_wrapper=True)++ )assert all("20260722emailfastindex1" not in sourcefor source in approval_module_sourcesdiff --cc tests/test_notes_mobile_checklist_toggle_static.pyindex e78345ad5,a4690f81e..12ad4a034--- a/tests/test_notes_mobile_checklist_toggle_static.py+++ b/tests/test_notes_mobile_checklist_toggle_static.py@@@ -1,8 -1,7 +1,8 @@@from pathlib import Pathimport re- from tests.helpers.stylesheets import app_css+ from tests.helpers.stylesheets import app_css, stylesheet_cache_version+from tests.helpers.js_modules import email_library_sourceROOT = Path(__file__).resolve().parent.parent