4
File size: 2,118 Bytes
a4f4d66
 
a248cb5
a4f4d66
 
 
 
 
 
 
 
 
 
a248cb5
a4f4d66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a248cb5
 
a4f4d66
a248cb5
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""
DVNC.AI β€” root app.py
Fixed: corrected all imports to use dvnc_ai_v2_hf package with proper underscore function names.
"""

# ── Standard library ──────────────────────────────────────────────────────
import html
import random
import re
import sys
from pathlib import Path
from typing import Dict, List, Optional

# Ensure repository root is on sys.path
ROOT = Path(__file__).resolve().parent
if str(ROOT) not in sys.path:
    sys.path.insert(0, str(ROOT))

# ── Third-party ───────────────────────────────────────────────────────────
import gradio as gr

# ── Internal modules ──────────────────────────────────────────────────────
from dvnc_ai_v2_hf.agent_route_cards import build_agent_route_cards_html
from dvnc_ai_v2_hf.discovery_app_bridge import (
    get_default_route_state,
    get_discovery_css,
    get_initial_discovery_timeline_html,
)
from dvnc_ai_v2_hf.dvnc_ui_layout import get_dvnc_layout_css
from dvnc_ai_v2_hf.graph_canvas_patch import render_graph_canvas_html
from dvnc_ai_v2_hf.self_learning_graph import (
    DEFAULT_SOURCES,
    SEARCH_MODES,
    SOURCE_OPTIONS,
    build_journal_html,
    ingest_selected_papers,
    parse_uploaded_pdf,
    render_parse_result,
    run_paper_discovery,
    safe_text,
)

# ── Simplified launcher: use existing app from dvnc_ai_v2_hf ─────────────
if __name__ == "__main__":
    try:
        from dvnc_ai_v2_hf import app as internal_app
        internal_app.demo.launch()
    except (ImportError, AttributeError):
        print("Could not import dvnc_ai_v2_hf.app β€” falling back to minimal Gradio demo")
        with gr.Blocks() as demo:
            gr.Markdown("# DVNC.AI\n\nSpace configuration in progress. Check Files tab for dvnc_ai_v2_hf/app.py")
        demo.launch()