anixcode 0.12.2__tar.gz → 0.12.4__tar.gz

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.
Files changed (59) hide show
  1. {anixcode-0.12.2 → anixcode-0.12.4}/PKG-INFO +1 -1
  2. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/__init__.py +1 -1
  3. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/i18n_en.py +2 -0
  4. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tui/app.py +8 -126
  5. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tui/app.tcss +4 -72
  6. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tui/screens.py +10 -126
  7. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tui/widgets.py +4 -63
  8. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode.egg-info/PKG-INFO +1 -1
  9. {anixcode-0.12.2 → anixcode-0.12.4}/pyproject.toml +1 -1
  10. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_v011_features.py +3 -15
  11. {anixcode-0.12.2 → anixcode-0.12.4}/LICENSE +0 -0
  12. {anixcode-0.12.2 → anixcode-0.12.4}/README.md +0 -0
  13. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/__main__.py +0 -0
  14. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/agent.py +0 -0
  15. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/airpc.py +0 -0
  16. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/browser.py +0 -0
  17. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/checkpoints.py +0 -0
  18. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/cli.py +0 -0
  19. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/commands.py +0 -0
  20. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/compaction.py +0 -0
  21. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/danger.py +0 -0
  22. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/i18n.py +0 -0
  23. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/images.py +0 -0
  24. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/llm.py +0 -0
  25. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/mcp.py +0 -0
  26. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/mentions.py +0 -0
  27. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/projects.py +0 -0
  28. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/prompts.py +0 -0
  29. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/providers.py +0 -0
  30. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/settings.py +0 -0
  31. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/storage.py +0 -0
  32. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tools/__init__.py +0 -0
  33. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tools/base.py +0 -0
  34. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tools/browser.py +0 -0
  35. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tools/files.py +0 -0
  36. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tools/search.py +0 -0
  37. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tools/shell.py +0 -0
  38. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tools/todo.py +0 -0
  39. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tools/web.py +0 -0
  40. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tui/__init__.py +0 -0
  41. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode/tui/anim.py +0 -0
  42. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode.egg-info/SOURCES.txt +0 -0
  43. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode.egg-info/dependency_links.txt +0 -0
  44. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode.egg-info/entry_points.txt +0 -0
  45. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode.egg-info/requires.txt +0 -0
  46. {anixcode-0.12.2 → anixcode-0.12.4}/anixcode.egg-info/top_level.txt +0 -0
  47. {anixcode-0.12.2 → anixcode-0.12.4}/setup.cfg +0 -0
  48. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_agent.py +0 -0
  49. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_commands.py +0 -0
  50. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_i18n.py +0 -0
  51. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_images.py +0 -0
  52. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_llm.py +0 -0
  53. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_mcp.py +0 -0
  54. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_projects.py +0 -0
  55. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_providers.py +0 -0
  56. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_reliability.py +0 -0
  57. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_safety_mentions.py +0 -0
  58. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_settings.py +0 -0
  59. {anixcode-0.12.2 → anixcode-0.12.4}/tests/test_tools.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anixcode
3
- Version: 0.12.2
3
+ Version: 0.12.4
4
4
  Summary: AI coding agent for the terminal. Bring your own API key.
5
5
  Author: an1zy
6
6
  License-Expression: MIT
@@ -1,3 +1,3 @@
1
1
  """ANIX Code: an AI coding agent for your terminal. Bring your own API key."""
2
2
 
3
- __version__ = "0.12.2"
3
+ __version__ = "0.12.4"
@@ -376,6 +376,8 @@ EN: dict[str, str] = {
376
376
  '<цель|stop>': '<goal|stop>',
377
377
  '? Помощь': '? Help',
378
378
  '@ Файл': '@ File',
379
+ 'Ctrl+K: меню · Tab: Build/Plan · Ctrl+O: модель · F1: помощь':
380
+ 'Ctrl+K: menu · Tab: Build/Plan · Ctrl+O: model · F1: help',
379
381
  'Enter — разрешить · Esc — отклонить · или напишите словами, как сделать иначе…':
380
382
  'Enter — allow · Esc — deny · or type what to do instead…',
381
383
  'GPT-4.1 / GPT-4o / o3 — стабильное качество и быстрые правки':
@@ -37,10 +37,10 @@ from ..settings import Credentials, Settings, config_dir, load_auth, load_projec
37
37
  from ..storage import Session, Store
38
38
  from ..tools import ToolContext, ToolResult, default_tools
39
39
  from .anim import THEME_LABELS, ActivityIndicator, AnimatedLogo, Gradient, make_themes, palette
40
- from .screens import HelpScreen, ProjectScreen, QuickMenuScreen, SessionsScreen, SetupScreen, ThemeScreen
40
+ from .screens import HelpScreen, ProjectScreen, SessionsScreen, SetupScreen, ThemeScreen
41
41
  from .widgets import (
42
42
  AssistantMessage, AttachmentBar, BrowserPane, BtwCard, Chip, ErrorMessage, MentionList, Notice, PermissionBar,
43
- PromptInput, QuickActionBar, ReasoningBlock, TodoBar, ToolCard, UserMessage, WelcomePanel,
43
+ PromptInput, ReasoningBlock, TodoBar, ToolCard, UserMessage,
44
44
  )
45
45
 
46
46
  def _tokens(n: int) -> str:
@@ -68,7 +68,6 @@ class AnixApp(App):
68
68
  Binding("ctrl+n", "new_session", tr("Новая"), show=False),
69
69
  Binding("ctrl+s", "sessions", tr("Сессии"), show=False),
70
70
  Binding("ctrl+t", "cycle_theme", tr("Тема"), show=False),
71
- Binding("ctrl+k", "quick_menu", tr("Меню"), priority=True, show=False),
72
71
  Binding("ctrl+b", "toggle_browser", tr("Браузер"), show=False),
73
72
  Binding("alt+v", "paste_image", tr("Вставить фото"), priority=True, show=False),
74
73
  Binding("f1", "help", tr("Помощь"), show=False),
@@ -103,7 +102,6 @@ class AnixApp(App):
103
102
  def compose(self) -> ComposeResult:
104
103
  with Horizontal(id="header"):
105
104
  yield Brand(id="brand")
106
- yield Chip(tr(" ≡ Меню "), self.action_quick_menu, id="menu-chip")
107
105
  yield Chip(tr(" Браузер "), self.action_toggle_browser, id="browser-chip")
108
106
  yield Chip("BUILD", self.action_toggle_mode, id="mode")
109
107
  with Horizontal(id="workspace"):
@@ -119,69 +117,18 @@ class AnixApp(App):
119
117
  yield PermissionBar(self._resolve_permission, id="permission")
120
118
  yield AttachmentBar(self._remove_image, id="attachments")
121
119
  yield MentionList(id="mentions")
122
- yield QuickActionBar([
123
- (tr("/ Команды"), lambda: self._prefill("/")),
124
- (tr("@ Файл"), lambda: self._prefill("@")),
125
- (tr("+ Фото"), self.action_paste_image),
126
- ("/goal", lambda: self._prefill("/goal ")),
127
- ("/btw", lambda: self._prefill("/btw ")),
128
- (tr("↶ Откат"), self.action_undo),
129
- (tr("? Помощь"), self.action_help),
130
- ], id="quick-bar")
131
120
  yield PromptInput(id="prompt")
132
121
  with Horizontal(id="statusbar"):
133
122
  yield Chip("", self.action_connect, id="status-model")
134
123
  yield Static(id="status-usage")
135
124
  yield Chip("", self.action_toggle_access, id="status-access")
136
125
 
137
- def _prefill(self, text: str) -> None:
138
- """Put a starter prefix into the prompt box and focus it (for 1-click beginner buttons)."""
139
- prompt = self.query_one(PromptInput)
140
- if text == "@" and prompt.text and not prompt.text.endswith(" "):
141
- prompt.insert(" @")
142
- elif text == "@":
143
- prompt.insert("@")
144
- else:
145
- prompt.text = text
146
- prompt.move_cursor(prompt.document.end)
147
- prompt.focus()
148
- self._update_mentions()
149
-
150
- def _run_starter_command(self, cmd: str) -> None:
151
- if self._agent_busy:
152
- self.notify(tr("Агент ещё работает. Esc — остановить."), severity="warning")
153
- return
154
- self._command(cmd)
155
-
156
- def _welcome(self) -> WelcomePanel:
126
+ def _welcome(self) -> Static:
157
127
  footer = Text()
158
- footer.append(f"v{__version__}\n", style="dim")
159
- footer.append(tr("ИИ-помощник для кода: просто опишите задачу обычными словами или нажмите кнопку ниже."), style="dim")
160
- logo = AnimatedLogo(footer, animate=self.settings.animations)
161
- proj_ok = not projects.is_unsuitable(self.project_root)
162
- rules_ok = (self.project_root / "AGENTS.md").exists()
163
- steps = [
164
- (self.settings.ready,
165
- tr("1. Модель: {0}", self.settings.model[:22]) if self.settings.ready else tr("1. Подключить модель →"),
166
- self.action_connect),
167
- (proj_ok,
168
- tr("2. Проект: {0}", self.project_root.name[:20]) if proj_ok else tr("2. Выбрать папку проекта →"),
169
- self.action_projects),
170
- (rules_ok,
171
- tr("3. Правила: AGENTS.md") if rules_ok else tr("3. Изучить проект (/init)"),
172
- lambda: self._run_starter_command("/init")),
173
- ]
174
- starters = [
175
- (tr("Изучить проект (/init)"), lambda: self._run_starter_command("/init")),
176
- (tr("Проверить код (/review)"), lambda: self._run_starter_command("/review")),
177
- (tr("Запустить тесты (/test)"), lambda: self._run_starter_command("/test")),
178
- (tr("Поставить цель (/goal)"), lambda: self._prefill("/goal ")),
179
- (tr("Быстрый вопрос (/btw)"), lambda: self._prefill("/btw ")),
180
- (tr("Открыть браузер"), self.action_toggle_browser),
181
- (tr("Сменить тему"), self.action_cycle_theme),
182
- (tr("Как пользоваться"), self.action_help),
183
- ]
184
- return WelcomePanel(logo, steps, starters, id="welcome")
128
+ footer.append(f"v{__version__}\n\n", style="dim")
129
+ footer.append(tr("Опишите задачу: агент сам прочитает код, внесёт правки и запустит команды.\n"), style="dim")
130
+ footer.append(tr("Tab: Build/Plan · Ctrl+O: модель · F1: все клавиши"), style="dim")
131
+ return AnimatedLogo(footer, animate=self.settings.animations, id="welcome")
185
132
 
186
133
  def on_mount(self) -> None:
187
134
  import contextlib
@@ -270,7 +217,6 @@ class AnixApp(App):
270
217
  bar.show(req)
271
218
  prompt = self.query_one(PromptInput)
272
219
  prompt.permission_handler = self._resolve_permission
273
- prompt.set_hint(tr("Enter — разрешить · Esc — отклонить · или напишите словами, как сделать иначе…"))
274
220
  prompt.focus()
275
221
  indicator = self.query_one(ActivityIndicator)
276
222
  indicator.set_phase(tr("Ждёт разрешения: Enter / Esc"), paused=True)
@@ -280,7 +226,6 @@ class AnixApp(App):
280
226
  finally:
281
227
  self._pending = None
282
228
  prompt.permission_handler = None
283
- self._sync_prompt_hint()
284
229
  bar.hide()
285
230
  indicator.set_phase(tr('Выполняет: {0}', req.title))
286
231
 
@@ -307,19 +252,8 @@ class AnixApp(App):
307
252
  if self.settings.full_access and self._pending is not None:
308
253
  self._resolve_permission("once")
309
254
 
310
- def _sync_prompt_hint(self) -> None:
311
- try:
312
- prompt = self.query_one(PromptInput)
313
- except Exception:
314
- return
315
- if self._agent_busy:
316
- prompt.set_hint(tr("Агент работает… Напишите следующее сообщение (в очередь) или /btw <вопрос>…"))
317
- else:
318
- prompt.set_hint(tr("Напишите задачу (Enter — отправить · / — команды · @ — файлы · Alt+V — скриншот)…"))
319
-
320
255
  def _refresh_bars(self) -> None:
321
256
  self._pulse_brand(force=True)
322
- self._sync_prompt_hint()
323
257
  mode = self.agent.mode if self.agent else self._agent_mode
324
258
  goal_on = bool(self.agent and self.agent.active_goal)
325
259
  badge = self.query_one("#mode", Chip)
@@ -331,7 +265,7 @@ class AnixApp(App):
331
265
  if self.settings.reasoning_effort:
332
266
  model.append(f" · {self.settings.reasoning_effort}", style="dim")
333
267
  else:
334
- model = Text(tr("Модель не подключена — нажмите здесь"), style="bold yellow")
268
+ model = Text(tr("модель не подключена · ctrl+o"), style="dim")
335
269
  s = self.session
336
270
  usage = Text(f"↑{_tokens(s.tokens_in)} ↓{_tokens(s.tokens_out)}", style="dim")
337
271
  if s.tokens_cached:
@@ -1279,7 +1213,6 @@ class AnixApp(App):
1279
1213
  self._build_agent()
1280
1214
  self.session.model = self.settings.model
1281
1215
  self._refresh_bars()
1282
- self.run_worker(self._refresh_welcome_if_empty())
1283
1216
  self.notify(tr('Подключено: {0}', self.settings.model), timeout=3)
1284
1217
  self.query_one(PromptInput).focus()
1285
1218
  if self._pick_project:
@@ -1287,57 +1220,6 @@ class AnixApp(App):
1287
1220
 
1288
1221
  self.push_screen(SetupScreen(self.settings, self.auth, self.config_base), done)
1289
1222
 
1290
- async def _refresh_welcome_if_empty(self) -> None:
1291
- chat = self.query_one("#chat", VerticalScroll)
1292
- welcomes = list(chat.query("#welcome"))
1293
- if welcomes and not self.session.messages:
1294
- for w in welcomes:
1295
- await w.remove()
1296
- await chat.mount(self._welcome())
1297
-
1298
- def action_quick_menu(self) -> None:
1299
- if isinstance(self.screen, QuickMenuScreen):
1300
- return
1301
- items = [
1302
- ("connect", tr("Подключить модель"), tr("выбрать провайдера, ключ и модель"), "Ctrl+O"),
1303
- ("project", tr("Выбрать проект"), tr("открыть папку или склонировать с GitHub"), "Ctrl+P"),
1304
- ("init", tr("Изучить проект"), tr("агент разберёт код и создаст AGENTS.md"), "/init"),
1305
- ("goal", tr("Поставить цель"), tr("автономная работа до полной проверки"), "/goal"),
1306
- ("btw", tr("Быстрый вопрос"), tr("спросить без изменения истории диалога"), "/btw"),
1307
- ("browser", tr("Встроенный браузер"), tr("открыть сайт/localhost прямо в окне"), "Ctrl+B"),
1308
- ("review", tr("Проверить изменения"), tr("поиск багов и рисков в текущем коде"), "/review"),
1309
- ("test", tr("Запустить тесты"), tr("найти тесты, прогнать и починить"), "/test"),
1310
- ("commit", tr("Сделать коммит"), tr("подготовить и закоммитить изменения"), "/commit"),
1311
- ("undo", tr("Откатить правки"), tr("вернуть файлы к состоянию до ответа"), "/undo"),
1312
- ("redo", tr("Вернуть правки"), tr("повторить откаченные правки"), "/redo"),
1313
- ("mode", tr("Режим Build / Plan"), tr("править код или только читать/планировать"), "Tab"),
1314
- ("permissions", tr("Полный доступ"), tr("включить/выключить запросы подтверждений"), "F2"),
1315
- ("image", tr("Вставить скриншот"), tr("прикрепить изображение из буфера обмена"), "Alt+V"),
1316
- ("sessions", tr("Прошлые сессии"), tr("вернуться к предыдущему диалогу"), "Ctrl+S"),
1317
- ("new", tr("Новая сессия"), tr("начать чистый диалог в этом проекте"), "Ctrl+N"),
1318
- ("theme", tr("Выбрать тему"), tr("сменить цвета интерфейса с предпросмотром"), "Ctrl+T"),
1319
- ("language", tr("Сменить язык"), tr("переключить Русский / English"), "/language"),
1320
- ("doctor", tr("Проверка системы"), tr("проверить модель, git, ripgrep, браузер"), "/doctor"),
1321
- ("help", tr("Справка"), tr("все горячие клавиши и команды"), "F1"),
1322
- ]
1323
-
1324
- def done(choice: str | None) -> None:
1325
- if not choice:
1326
- self.query_one(PromptInput).focus()
1327
- return
1328
- if choice == "goal":
1329
- self._prefill("/goal ")
1330
- elif choice == "btw":
1331
- self._prefill("/btw ")
1332
- elif choice == "browser":
1333
- self.action_toggle_browser()
1334
- elif choice in ("init", "review", "test", "commit"):
1335
- self._run_starter_command(f"/{choice}")
1336
- else:
1337
- self._command(f"/{choice}")
1338
-
1339
- self.push_screen(QuickMenuScreen(items), done)
1340
-
1341
1223
  async def _reset_chat(self) -> None:
1342
1224
  chat = self.query_one("#chat", VerticalScroll)
1343
1225
  await chat.remove_children()
@@ -23,64 +23,20 @@ Screen {
23
23
  background: $warning;
24
24
  color: $background;
25
25
  }
26
- #browser-chip, #menu-chip {
26
+ #browser-chip {
27
27
  width: auto;
28
28
  margin-right: 1;
29
29
  padding: 0 1;
30
30
  background: $surface;
31
31
  color: $text-muted;
32
32
  }
33
- #browser-chip:hover, #menu-chip:hover, #mode:hover {
33
+ #browser-chip:hover, #mode:hover {
34
34
  text-style: bold reverse;
35
35
  }
36
- #welcome-panel {
37
- width: 100%;
38
- height: auto;
39
- align-horizontal: center;
40
- }
41
- #welcome-box {
42
- width: 96;
43
- max-width: 96%;
44
- height: auto;
45
- margin: 0 0 1 0;
46
- padding: 1 2;
47
- background: $surface;
48
- border: round $panel;
49
- }
50
- .welcome-section {
51
- color: $text-muted;
52
- margin-top: 1;
53
- }
54
- .welcome-row {
55
- height: auto;
56
- margin: 0 0 1 0;
57
- }
58
- .chip.step.done {
59
- background: $success 20%;
60
- color: $success;
61
- margin-left: 0;
62
- margin-right: 1;
63
- }
64
- .chip.step.pending {
65
- background: $warning 25%;
66
- color: $warning;
67
- margin-left: 0;
68
- margin-right: 1;
69
- }
70
- .chip.starter {
71
- background: $panel;
72
- color: $text;
73
- margin-left: 0;
74
- margin-right: 1;
75
- }
76
- .chip.starter:hover {
77
- background: $primary;
78
- color: $background;
79
- }
80
- #quick-bar {
36
+ #browser-links {
37
+ display: none;
81
38
  height: 1;
82
39
  padding: 0 1;
83
- margin-bottom: 0;
84
40
  }
85
41
  .chip.quick {
86
42
  background: transparent;
@@ -94,30 +50,6 @@ Screen {
94
50
  color: $text;
95
51
  text-style: bold;
96
52
  }
97
- .chip.always {
98
- background: $primary 25%;
99
- color: $primary;
100
- }
101
- #browser-links {
102
- display: none;
103
- height: 1;
104
- padding: 0 1;
105
- }
106
- .setup-guide {
107
- padding: 0 1;
108
- margin-bottom: 1;
109
- border-left: thick $primary;
110
- background: $panel;
111
- color: $text;
112
- }
113
- #advanced-box {
114
- height: auto;
115
- }
116
- #menu-list {
117
- height: auto;
118
- max-height: 18;
119
- margin: 1 0;
120
- }
121
53
  #status-model:hover {
122
54
  text-style: bold underline;
123
55
  }
@@ -94,7 +94,7 @@ class ProviderEditScreen(ModalScreen[dict | None]):
94
94
 
95
95
 
96
96
  class SetupScreen(ModalScreen[bool]):
97
- """Beginner-friendly 3-step setup wizard: pick provider, paste key, save (model pre-filled)."""
97
+ """Pick a provider, paste a key, choose a model."""
98
98
 
99
99
  BINDINGS = [("escape", "cancel", tr("Отмена"))]
100
100
 
@@ -104,7 +104,6 @@ class SetupScreen(ModalScreen[bool]):
104
104
  self.auth = auth
105
105
  self.base = base
106
106
  self._model_ids: list[str] = []
107
- self._show_advanced = False
108
107
 
109
108
  def _options(self) -> list[tuple[str, str]]:
110
109
  return [(("★ " if p.is_user else "") + p.name, p.id) for p in providers.all_providers(self.settings)]
@@ -113,33 +112,25 @@ class SetupScreen(ModalScreen[bool]):
113
112
  ids = {p.id for p in providers.all_providers(self.settings)}
114
113
  current = self.settings.provider if self.settings.provider in ids else "deepseek"
115
114
  with Vertical(id="dialog"):
116
- yield Label(tr("Подключение ИИ-модели"), classes="dialog-title")
117
- yield Static(
118
- tr("Шаг 1: выберите провайдера → Шаг 2: вставьте ключ (если нужен) → Шаг 3: нажмите «Сохранить»."),
119
- classes="setup-guide",
120
- )
121
- yield Label(tr("1. Провайдер"))
115
+ yield Label(tr("Подключение модели"), classes="dialog-title")
116
+ yield Label(tr("Провайдер"))
122
117
  with Horizontal(id="provider-row"):
123
118
  yield Select(self._options(), value=current, allow_blank=False, id="provider")
124
119
  yield Button(tr("+ Свой"), id="add-provider")
125
120
  yield Button(tr("Удалить"), id="del-provider", variant="error")
126
- yield Static(id="provider-hint", classes="hint")
127
- yield Label(tr("2. API-ключ"), id="key-label")
121
+ yield Label(tr("API-ключ"))
128
122
  yield Input(password=True, id="key")
129
123
  yield Static(id="key-hint", classes="hint")
130
- yield Label(tr("3. Модель (уже выбрана рекомендуемая)"))
124
+ yield Label(tr("Адрес сервера"))
125
+ yield Input(id="base-url")
126
+ yield Label(tr("Модель"))
131
127
  with Horizontal(id="model-row"):
132
128
  yield Input(id="model", placeholder=tr("название модели"))
133
129
  yield Button(tr("Список моделей"), id="fetch")
134
130
  yield OptionList(id="models")
135
- with Vertical(id="advanced-box"):
136
- yield Label(tr("Адрес сервера (обычно менять не нужно)"))
137
- yield Input(id="base-url")
138
131
  yield Static(id="setup-error", classes="error")
139
132
  with Horizontal(classes="buttons"):
140
- yield Button(tr("Сохранить и начать"), id="save", variant="primary")
141
- yield Button(tr("Проверить связь"), id="test-conn")
142
- yield Button(tr("Адрес сервера"), id="toggle-adv")
133
+ yield Button(tr("Сохранить"), id="save", variant="primary")
143
134
  yield Button(tr("Отмена"), id="cancel")
144
135
 
145
136
  def on_mount(self) -> None:
@@ -156,15 +147,10 @@ class SetupScreen(ModalScreen[bool]):
156
147
  def _fill(self, pid: str) -> None:
157
148
  p = providers.get(pid, self.settings)
158
149
  cred = self.auth.get(pid, Credentials())
159
- self.query_one("#provider-hint", Static).update(p.hint or "")
160
150
  key = self.query_one("#key", Input)
161
151
  key.value = ""
162
- key.placeholder = tr('сохранён: {0}', mask(cred.api_key)) if cred.api_key else (
163
- tr("вставьте ваш API-ключ (sk-…)") if p.needs_key else tr("не обязателен для локальной модели")
164
- )
165
- hint = tr('Где взять ключ бесплатно/в кабинете: {0}', p.key_url) if p.key_url else (
166
- tr("Ключ не нужен — работает локально на вашем компьютере") if not p.needs_key else ""
167
- )
152
+ key.placeholder = tr('сохранён: {0}', mask(cred.api_key)) if cred.api_key else ("sk-…" if p.needs_key else tr("не обязателен"))
153
+ hint = tr('Где взять ключ: {0}', p.key_url) if p.key_url else (tr("Ключ не нужен") if not p.needs_key else "")
168
154
  self.query_one("#key-hint", Static).update(hint)
169
155
  self.query_one("#base-url", Input).value = cred.base_url or p.base_url
170
156
  model = self.settings.model if self.settings.provider == pid else p.default_model
@@ -172,37 +158,6 @@ class SetupScreen(ModalScreen[bool]):
172
158
  self.query_one("#models", OptionList).remove_class("visible")
173
159
  self.query_one("#setup-error", Static).update("")
174
160
  self.query_one("#del-provider", Button).display = p.is_user
175
- # Hide technical server URL for standard providers unless custom/overridden/toggled
176
- need_url = pid == "custom" or p.is_user or bool(cred.base_url) or self._show_advanced
177
- self.query_one("#advanced-box", Vertical).display = need_url
178
-
179
- @on(Button.Pressed, "#toggle-adv")
180
- def _toggle_advanced(self) -> None:
181
- self._show_advanced = not self._show_advanced
182
- self.query_one("#advanced-box", Vertical).display = self._show_advanced
183
-
184
- @on(Button.Pressed, "#test-conn")
185
- def _test_conn_pressed(self) -> None:
186
- self.test_connection()
187
-
188
- @work(exclusive=True, group="setup-test")
189
- async def test_connection(self) -> None:
190
- status = self.query_one("#setup-error", Static)
191
- base_url = self.query_one("#base-url", Input).value.strip()
192
- if not base_url.startswith(("http://", "https://")):
193
- status.update(Text(tr("Укажите адрес сервера, начиная с http:// или https://"), style="red"))
194
- return
195
- status.update(Text(tr("Проверяю подключение…"), style="yellow"))
196
- client = make_client(base_url, self._current_key(), provider=self.provider_id)
197
- try:
198
- models = await client.list_models()
199
- except LLMError as e:
200
- status.update(Text(str(e), style="red"))
201
- return
202
- finally:
203
- await client.aclose()
204
- status.update(Text(tr("✓ Подключение работает! Найдено моделей: {0}. Можно нажимать «Сохранить и начать».", len(models)),
205
- style="green"))
206
161
 
207
162
  def _reload_options(self, select_id: str) -> None:
208
163
  select = self.query_one("#provider", Select)
@@ -451,77 +406,6 @@ class HelpScreen(ModalScreen[None]):
451
406
  self.dismiss(None)
452
407
 
453
408
 
454
- class QuickMenuScreen(ModalScreen[str | None]):
455
- """Beginner-friendly visual command & action menu (Ctrl+K or ☰ Menu button)."""
456
-
457
- BINDINGS = [("escape", "close", tr("Закрыть"))]
458
-
459
- def __init__(self, items: list[tuple[str, str, str, str]]) -> None:
460
- """items: list of (action_key, icon_title, description, shortcut)."""
461
- super().__init__()
462
- self._all_items = items
463
- self._filtered = list(items)
464
-
465
- def compose(self) -> ComposeResult:
466
- with Vertical(id="dialog"):
467
- yield Label(tr("Меню действий"), classes="dialog-title")
468
- yield Input(placeholder=tr("Поиск действия (например: браузер, цель, тест, тема, откат)…"), id="menu-search")
469
- yield OptionList(id="menu-list")
470
- yield Label(tr("↑↓ или клик — выбрать · Enter — выполнить · Esc — закрыть"), classes="hint")
471
-
472
- def on_mount(self) -> None:
473
- self._render_list("")
474
- self.query_one("#menu-search", Input).focus()
475
-
476
- def _render_list(self, query: str) -> None:
477
- q = query.strip().lower()
478
- self._filtered = [
479
- it for it in self._all_items
480
- if not q or q in it[0].lower() or q in it[1].lower() or q in it[2].lower()
481
- ]
482
- box = self.query_one("#menu-list", OptionList)
483
- box.clear_options()
484
- for _key, title, desc, shortcut in self._filtered:
485
- row = Text()
486
- row.append(f"{title:<30}", style="bold")
487
- row.append(f" {desc}", style="dim")
488
- if shortcut:
489
- row.append(f" [{shortcut}]", style="italic")
490
- box.add_option(row)
491
- if self._filtered:
492
- box.highlighted = 0
493
-
494
- @on(Input.Changed, "#menu-search")
495
- def _search_changed(self, event: Input.Changed) -> None:
496
- self._render_list(event.value)
497
-
498
- @on(Input.Submitted, "#menu-search")
499
- def _search_submitted(self) -> None:
500
- box = self.query_one("#menu-list", OptionList)
501
- if self._filtered:
502
- idx = box.highlighted if box.highlighted is not None and box.highlighted < len(self._filtered) else 0
503
- self.dismiss(self._filtered[idx][0])
504
-
505
- @on(OptionList.OptionSelected, "#menu-list")
506
- def _picked(self, event: OptionList.OptionSelected) -> None:
507
- if 0 <= event.option_index < len(self._filtered):
508
- self.dismiss(self._filtered[event.option_index][0])
509
-
510
- def on_key(self, event) -> None:
511
- if event.key in ("down", "up"):
512
- box = self.query_one("#menu-list", OptionList)
513
- if self._filtered:
514
- if event.key == "down":
515
- box.action_cursor_down()
516
- else:
517
- box.action_cursor_up()
518
- event.stop()
519
- event.prevent_default()
520
-
521
- def action_close(self) -> None:
522
- self.dismiss(None)
523
-
524
-
525
409
  CUSTOM_HELP = tr("""\
526
410
  ## Свои команды
527
411
 
@@ -41,37 +41,34 @@ class Chip(Static):
41
41
 
42
42
 
43
43
  class PermissionBar(Horizontal):
44
- """One line above the prompt: "Выполнить: rm -rf build [Разрешить ⏎] [Всегда] [Отклонить esc] [Полный доступ]"."""
44
+ """One line above the prompt: "Выполнить: rm -rf build [Разрешить ⏎] [Отклонить esc] [Полный доступ]"."""
45
45
 
46
46
  def __init__(self, on_decide, **kwargs) -> None:
47
47
  super().__init__(**kwargs)
48
48
  self.perm_text = Static(id="perm-text")
49
49
  self.perm_decide = on_decide
50
50
  self.perm_ok = Chip(tr(" Разрешить ⏎ "), lambda: self.perm_decide("once"), classes="chip ok")
51
- self.perm_always = Chip(tr(" Всегда в сессии "), lambda: self.perm_decide("always"), classes="chip always")
52
51
  self.perm_no = Chip(tr(" Отклонить esc "), lambda: self.perm_decide("deny"), classes="chip no")
53
52
  self.perm_full = Chip(tr(" Полный доступ "), lambda: self.perm_decide("full"), classes="chip full")
54
53
 
55
54
  def compose(self):
56
55
  yield self.perm_text
57
56
  yield self.perm_ok
58
- yield self.perm_always
59
57
  yield self.perm_no
60
58
  yield self.perm_full
61
59
 
62
60
  def show(self, req) -> None:
63
61
  text = Text()
64
- verb = tr("Изменить файл") if req.kind == "edit" else (tr("Прочитать секретный файл") if req.kind == "read" else tr("Выполнить"))
62
+ verb = tr("Изменить") if req.kind == "edit" else tr("Выполнить")
65
63
  text.append(f"{verb}: ", style="bold")
66
64
  text.append(req.title, style="bold red" if req.dangerous else "bold")
67
65
  for why in req.danger:
68
66
  text.append(f" · {why}", style="red")
69
67
  for why in req.warnings:
70
68
  text.append(f" · {why}", style="yellow")
71
- text.append(tr("\nНажмите Enter — разрешить · Esc — отклонить · или напишите словами, как сделать иначе"),
69
+ text.append(tr("\nEnter — разрешить · Esc — отклонить · напишите текст и Enter — отклонить с пояснением"),
72
70
  style="dim")
73
71
  self.perm_text.update(text)
74
- self.perm_always.display = not req.dangerous
75
72
  self.set_class(req.dangerous, "danger")
76
73
  self.display = True
77
74
 
@@ -79,51 +76,6 @@ class PermissionBar(Horizontal):
79
76
  self.display = False
80
77
 
81
78
 
82
- class QuickActionBar(Horizontal):
83
- """1-line clickable toolbar above the input so beginners never have to memorize slash commands."""
84
-
85
- def __init__(self, actions: list[tuple[str, Callable[[], None]]], **kwargs) -> None:
86
- super().__init__(**kwargs)
87
- self._actions = actions
88
-
89
- def compose(self):
90
- for label, cb in self._actions:
91
- yield Chip(label, cb, classes="chip quick")
92
-
93
-
94
- class WelcomePanel(Vertical):
95
- """Friendly start screen with live 3-step readiness strip and 1-click starter actions."""
96
-
97
- def __init__(
98
- self,
99
- logo: Static,
100
- steps: list[tuple[bool, str, Callable[[], None]]],
101
- starters: list[tuple[str, Callable[[], None]]],
102
- **kwargs,
103
- ) -> None:
104
- super().__init__(**kwargs)
105
- self._logo = logo
106
- self._steps = steps
107
- self._starters = starters
108
-
109
- def compose(self):
110
- yield self._logo
111
- with Vertical(id="welcome-box"):
112
- yield Static(tr("Быстрый старт (нажмите на любой шаг):"), classes="welcome-section")
113
- with Horizontal(classes="welcome-row"):
114
- for done, label, cb in self._steps:
115
- mark = "✓ " if done else "○ "
116
- cls = "chip step done" if done else "chip step pending"
117
- yield Chip(f" {mark}{label} ", cb, classes=cls)
118
- yield Static(tr("Популярные действия — просто нажмите или напишите задачу внизу:"), classes="welcome-section")
119
- with Horizontal(classes="welcome-row"):
120
- for label, cb in self._starters[:4]:
121
- yield Chip(f" {label} ", cb, classes="chip starter")
122
- with Horizontal(classes="welcome-row"):
123
- for label, cb in self._starters[4:]:
124
- yield Chip(f" {label} ", cb, classes="chip starter")
125
-
126
-
127
79
  class AttachmentBar(Horizontal):
128
80
  """Pending image attachments shown above the prompt. Click a chip to remove it."""
129
81
 
@@ -196,24 +148,13 @@ class PromptInput(TextArea):
196
148
  pass
197
149
 
198
150
  def __init__(self, **kwargs) -> None:
199
- try:
200
- super().__init__(
201
- soft_wrap=True, show_line_numbers=False, tab_behavior="focus",
202
- placeholder=tr("Напишите задачу (Enter — отправить · / — команды · @ — файлы · Alt+V — скриншот)…"),
203
- **kwargs,
204
- )
205
- except TypeError: # older Textual without TextArea.placeholder
206
- super().__init__(soft_wrap=True, show_line_numbers=False, tab_behavior="focus", **kwargs)
151
+ super().__init__(soft_wrap=True, show_line_numbers=False, tab_behavior="focus", **kwargs)
207
152
  self._prompt_history: list[str] = []
208
153
  self._prompt_pos = 0
209
154
  self.mention_list: MentionList | None = None
210
155
  self.permission_handler = None # set while the agent waits for approval
211
156
  self.has_attachments: Callable[[], bool] | None = None
212
157
 
213
- def set_hint(self, text: str) -> None:
214
- if hasattr(self, "placeholder"):
215
- self.placeholder = text
216
-
217
158
  def suggestion_query(self) -> tuple[str, str] | None:
218
159
  """('command', 'rev') while typing '/rev' at the start, ('mention', 'src/a') after '@', else None."""
219
160
  row, col = self.cursor_location
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anixcode
3
- Version: 0.12.2
3
+ Version: 0.12.4
4
4
  Summary: AI coding agent for the terminal. Bring your own API key.
5
5
  Author: an1zy
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "anixcode"
3
- version = "0.12.2"
3
+ version = "0.12.4"
4
4
  description = "AI coding agent for the terminal. Bring your own API key."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -305,17 +305,15 @@ def test_project_mcp_skills_global_rules_and_wal(tmp_path):
305
305
 
306
306
  def test_tui_boots_with_browser_pane_and_todo_bar(tmp_path):
307
307
  from anixcode.tui.app import AnixApp
308
- from anixcode.tui.screens import QuickMenuScreen, SetupScreen
309
- from anixcode.tui.widgets import BrowserPane, PromptInput, QuickActionBar, TodoBar, WelcomePanel
308
+ from anixcode.tui.screens import SetupScreen
309
+ from anixcode.tui.widgets import BrowserPane, TodoBar
310
310
 
311
311
  async def go():
312
312
  store = Store(tmp_path / "tui.db")
313
313
  app = AnixApp(tmp_path, Settings(provider="deepseek", model="deepseek-chat", animations=False),
314
314
  store, base=tmp_path)
315
315
  async with app.run_test() as pilot:
316
- # Beginner-friendly WelcomePanel & QuickActionBar are visible on start
317
- assert app.query_one(WelcomePanel) is not None
318
- assert app.query_one(QuickActionBar) is not None
316
+ assert app.query_one("#welcome") is not None
319
317
  pane = app.query_one(BrowserPane)
320
318
  todos = app.query_one(TodoBar)
321
319
  assert not pane.display and not todos.display
@@ -328,16 +326,6 @@ def test_tui_boots_with_browser_pane_and_todo_bar(tmp_path):
328
326
  app.action_reasoning("medium")
329
327
  await pilot.pause()
330
328
  assert app.settings.reasoning_effort == "medium"
331
- # Prefill helper fills /goal cleanly for beginners
332
- app._prefill("/goal ")
333
- assert app.query_one(PromptInput).text == "/goal "
334
- # Quick menu (Ctrl+K) opens and closes cleanly
335
- app.action_quick_menu()
336
- await pilot.pause()
337
- assert isinstance(app.screen, QuickMenuScreen)
338
- app.screen.action_close()
339
- await pilot.pause()
340
- # Setup wizard opens cleanly with pre-filled defaults
341
329
  app.action_connect()
342
330
  await pilot.pause()
343
331
  assert isinstance(app.screen, SetupScreen)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes