aloop 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of aloop might be problematic. Click here for more details.

Files changed (62) hide show
  1. agent/__init__.py +0 -0
  2. agent/agent.py +182 -0
  3. agent/base.py +406 -0
  4. agent/context.py +126 -0
  5. agent/todo.py +149 -0
  6. agent/tool_executor.py +54 -0
  7. agent/verification.py +135 -0
  8. aloop-0.1.0.dist-info/METADATA +246 -0
  9. aloop-0.1.0.dist-info/RECORD +62 -0
  10. aloop-0.1.0.dist-info/WHEEL +5 -0
  11. aloop-0.1.0.dist-info/entry_points.txt +2 -0
  12. aloop-0.1.0.dist-info/licenses/LICENSE +21 -0
  13. aloop-0.1.0.dist-info/top_level.txt +9 -0
  14. cli.py +19 -0
  15. config.py +146 -0
  16. interactive.py +865 -0
  17. llm/__init__.py +51 -0
  18. llm/base.py +26 -0
  19. llm/compat.py +226 -0
  20. llm/content_utils.py +309 -0
  21. llm/litellm_adapter.py +450 -0
  22. llm/message_types.py +245 -0
  23. llm/model_manager.py +265 -0
  24. llm/retry.py +95 -0
  25. main.py +246 -0
  26. memory/__init__.py +20 -0
  27. memory/compressor.py +554 -0
  28. memory/manager.py +538 -0
  29. memory/serialization.py +82 -0
  30. memory/short_term.py +88 -0
  31. memory/token_tracker.py +203 -0
  32. memory/types.py +51 -0
  33. tools/__init__.py +6 -0
  34. tools/advanced_file_ops.py +557 -0
  35. tools/base.py +51 -0
  36. tools/calculator.py +50 -0
  37. tools/code_navigator.py +975 -0
  38. tools/explore.py +254 -0
  39. tools/file_ops.py +150 -0
  40. tools/git_tools.py +791 -0
  41. tools/notify.py +69 -0
  42. tools/parallel_execute.py +420 -0
  43. tools/session_manager.py +205 -0
  44. tools/shell.py +147 -0
  45. tools/shell_background.py +470 -0
  46. tools/smart_edit.py +491 -0
  47. tools/todo.py +130 -0
  48. tools/web_fetch.py +673 -0
  49. tools/web_search.py +61 -0
  50. utils/__init__.py +15 -0
  51. utils/logger.py +105 -0
  52. utils/model_pricing.py +49 -0
  53. utils/runtime.py +75 -0
  54. utils/terminal_ui.py +422 -0
  55. utils/tui/__init__.py +39 -0
  56. utils/tui/command_registry.py +49 -0
  57. utils/tui/components.py +306 -0
  58. utils/tui/input_handler.py +393 -0
  59. utils/tui/model_ui.py +204 -0
  60. utils/tui/progress.py +292 -0
  61. utils/tui/status_bar.py +178 -0
  62. utils/tui/theme.py +165 -0
utils/tui/theme.py ADDED
@@ -0,0 +1,165 @@
1
+ """Theme system for TUI with dark and light mode support."""
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Dict
5
+
6
+ from rich.style import Style
7
+ from rich.theme import Theme as RichTheme
8
+
9
+
10
+ @dataclass
11
+ class ThemeColors:
12
+ """Color palette for a TUI theme."""
13
+
14
+ # Primary colors
15
+ primary: str # Main accent color
16
+ secondary: str # Secondary accent
17
+ success: str # Success/positive
18
+ warning: str # Warning/caution
19
+ error: str # Error/negative
20
+
21
+ # Background colors
22
+ bg_primary: str # Main background
23
+ bg_secondary: str # Panel/card background
24
+ bg_highlight: str # Highlighted areas
25
+
26
+ # Text colors
27
+ text_primary: str # Primary text
28
+ text_secondary: str # Secondary/muted text
29
+ text_muted: str # Very muted text
30
+
31
+ # Semantic colors
32
+ user_input: str # User input text
33
+ assistant_output: str # Assistant output text
34
+ tool_accent: str # Tool call highlights
35
+ thinking_accent: str # Thinking process highlights
36
+
37
+
38
+ # Dark theme - Professional, high contrast
39
+ DARK_THEME = ThemeColors(
40
+ primary="#00D9FF", # Bright cyan
41
+ secondary="#A78BFA", # Soft purple
42
+ success="#10B981", # Emerald green
43
+ warning="#F59E0B", # Amber
44
+ error="#EF4444", # Red
45
+ bg_primary="#0D1117", # Deep blue-black
46
+ bg_secondary="#161B22", # Slightly lighter
47
+ bg_highlight="#21262D", # Highlight background
48
+ text_primary="#F0F6FC", # Bright white
49
+ text_secondary="#8B949E", # Gray
50
+ text_muted="#484F58", # Dark gray
51
+ user_input="#00D9FF", # Cyan
52
+ assistant_output="#F0F6FC", # White
53
+ tool_accent="#F78166", # Orange
54
+ thinking_accent="#A371F7", # Purple
55
+ )
56
+
57
+ # Light theme - Clean, professional
58
+ LIGHT_THEME = ThemeColors(
59
+ primary="#0969DA", # Blue
60
+ secondary="#8250DF", # Purple
61
+ success="#1A7F37", # Green
62
+ warning="#9A6700", # Amber
63
+ error="#CF222E", # Red
64
+ bg_primary="#FFFFFF", # White
65
+ bg_secondary="#F6F8FA", # Light gray
66
+ bg_highlight="#EAEEF2", # Slightly darker
67
+ text_primary="#1F2328", # Near black
68
+ text_secondary="#57606A", # Medium gray
69
+ text_muted="#8C959F", # Light gray
70
+ user_input="#0969DA", # Blue
71
+ assistant_output="#1F2328", # Dark
72
+ tool_accent="#BC4C00", # Orange
73
+ thinking_accent="#8250DF", # Purple
74
+ )
75
+
76
+
77
+ class Theme:
78
+ """TUI Theme manager."""
79
+
80
+ _current_theme: str = "dark"
81
+ _themes: Dict[str, ThemeColors] = {
82
+ "dark": DARK_THEME,
83
+ "light": LIGHT_THEME,
84
+ }
85
+
86
+ @classmethod
87
+ def get_colors(cls) -> ThemeColors:
88
+ """Get the current theme colors."""
89
+ return cls._themes[cls._current_theme]
90
+
91
+ @classmethod
92
+ def set_theme(cls, name: str) -> None:
93
+ """Set the current theme.
94
+
95
+ Args:
96
+ name: Theme name ('dark' or 'light')
97
+
98
+ Raises:
99
+ ValueError: If theme name is invalid
100
+ """
101
+ if name not in cls._themes:
102
+ raise ValueError(f"Unknown theme: {name}. Available: {list(cls._themes.keys())}")
103
+ cls._current_theme = name
104
+
105
+ @classmethod
106
+ def get_theme_name(cls) -> str:
107
+ """Get the current theme name."""
108
+ return cls._current_theme
109
+
110
+ @classmethod
111
+ def get_rich_theme(cls) -> RichTheme:
112
+ """Get a Rich Theme object for the current theme."""
113
+ colors = cls.get_colors()
114
+ return RichTheme(
115
+ {
116
+ # Primary styles
117
+ "primary": Style(color=colors.primary),
118
+ "secondary": Style(color=colors.secondary),
119
+ "success": Style(color=colors.success),
120
+ "warning": Style(color=colors.warning),
121
+ "error": Style(color=colors.error),
122
+ # Text styles
123
+ "text": Style(color=colors.text_primary),
124
+ "text.secondary": Style(color=colors.text_secondary),
125
+ "text.muted": Style(color=colors.text_muted),
126
+ # Semantic styles
127
+ "user": Style(color=colors.user_input, bold=True),
128
+ "assistant": Style(color=colors.assistant_output),
129
+ "tool": Style(color=colors.tool_accent),
130
+ "thinking": Style(color=colors.thinking_accent),
131
+ # UI element styles
132
+ "panel.border": Style(color=colors.text_muted),
133
+ "status.label": Style(color=colors.text_secondary),
134
+ "status.value": Style(color=colors.text_primary),
135
+ "divider": Style(color=colors.text_muted),
136
+ # Prompt styles
137
+ "prompt": Style(color=colors.user_input, bold=True),
138
+ "prompt.symbol": Style(color=colors.primary, bold=True),
139
+ }
140
+ )
141
+
142
+ @classmethod
143
+ def get_prompt_toolkit_style(cls) -> Dict[str, str]:
144
+ """Get style dict for prompt_toolkit."""
145
+ colors = cls.get_colors()
146
+ return {
147
+ "prompt": colors.user_input,
148
+ "prompt.symbol": f"{colors.primary} bold",
149
+ "": colors.text_primary, # Default text
150
+ "completion-menu": f"bg:{colors.bg_secondary} {colors.text_primary}",
151
+ "completion-menu.completion": f"bg:{colors.bg_secondary} {colors.text_primary}",
152
+ "completion-menu.completion.current": f"bg:{colors.primary} {colors.bg_primary}",
153
+ "scrollbar.background": colors.bg_secondary,
154
+ "scrollbar.button": colors.text_muted,
155
+ }
156
+
157
+
158
+ def get_theme() -> ThemeColors:
159
+ """Get the current theme colors (convenience function)."""
160
+ return Theme.get_colors()
161
+
162
+
163
+ def set_theme(name: str) -> None:
164
+ """Set the current theme (convenience function)."""
165
+ Theme.set_theme(name)