|
2 | 2 |
|
3 | 3 | import subprocess |
4 | 4 | from pathlib import Path |
5 | | -from typing import Dict, Type |
| 5 | +from typing import Dict, Optional, Tuple, Type |
6 | 6 |
|
7 | 7 | from ..config import ConfigManager |
8 | 8 | from ..endpoints import EndpointManager |
|
36 | 36 | # Backwards-compat: expose UI helpers that used to be available from code_assistant_manager.tools |
37 | 37 |
|
38 | 38 | # Expose model selector functions |
| 39 | +from ..menu.menus import display_centered_menu, select_two_models # noqa: F401 |
| 40 | + |
| 41 | + |
| 42 | +def select_model( |
| 43 | + models: list[str], prompt: str = "Select a model:" |
| 44 | +) -> Tuple[bool, Optional[str]]: |
| 45 | + """Backward-compatible wrapper for model selection. |
| 46 | +
|
| 47 | + Args: |
| 48 | + models: List of available models |
| 49 | + prompt: Display prompt for selection |
| 50 | +
|
| 51 | + Returns: |
| 52 | + Tuple of (success, selected_model) |
| 53 | + """ |
| 54 | + success, idx = display_centered_menu(prompt, models, "Cancel") |
| 55 | + if success and idx is not None: |
| 56 | + return True, models[idx] |
| 57 | + return False, None |
| 58 | + |
39 | 59 |
|
40 | 60 | # Backwards-compatible exports: expose tool classes at package level |
41 | 61 | from .claude import ClaudeTool # noqa: F401 |
|
45 | 65 | from .crush import CrushTool # noqa: F401 |
46 | 66 | from .cursor import CursorTool # noqa: F401 |
47 | 67 | from .droid import DroidTool # noqa: F401 |
48 | | -from .gemini import GeminiTool # noqa: F401 |
49 | | -from .iflow import IfLowTool # noqa: F401 |
50 | | -from .neovate import NeovateTool # noqa: F401 |
51 | | -from .qodercli import QoderCLITool # noqa: F401 |
52 | | -from .qwen import QwenTool # noqa: F401 |
53 | | -from .zed import ZedTool # noqa: F401 |
54 | 68 |
|
55 | 69 | # Expose endpoint display functions |
56 | 70 | from .endpoint_display import ( # noqa: F401 |
57 | 71 | display_all_tool_endpoints, |
58 | 72 | display_tool_endpoints, |
59 | 73 | ) |
| 74 | +from .gemini import GeminiTool # noqa: F401 |
| 75 | +from .iflow import IfLowTool # noqa: F401 |
| 76 | +from .neovate import NeovateTool # noqa: F401 |
| 77 | +from .qodercli import QoderCLITool # noqa: F401 |
| 78 | +from .qwen import QwenTool # noqa: F401 |
| 79 | +from .zed import ZedTool # noqa: F401 |
60 | 80 |
|
61 | 81 | # Backwards-compat: expose commonly patched names used in tests |
62 | 82 | # so tests that patch code_assistant_manager.tools.<name> continue to work. |
|
0 commit comments