anixcode 0.12.1__tar.gz → 0.12.3__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.
- {anixcode-0.12.1 → anixcode-0.12.3}/PKG-INFO +1 -1
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/__init__.py +1 -1
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/agent.py +4 -2
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/i18n_en.py +2 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/settings.py +3 -1
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tui/app.py +6 -38
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tui/app.tcss +1 -45
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tui/widgets.py +0 -33
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode.egg-info/PKG-INFO +1 -1
- {anixcode-0.12.1 → anixcode-0.12.3}/pyproject.toml +1 -1
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_v011_features.py +19 -3
- {anixcode-0.12.1 → anixcode-0.12.3}/LICENSE +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/README.md +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/__main__.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/airpc.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/browser.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/checkpoints.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/cli.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/commands.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/compaction.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/danger.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/i18n.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/images.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/llm.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/mcp.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/mentions.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/projects.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/prompts.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/providers.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/storage.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tools/__init__.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tools/base.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tools/browser.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tools/files.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tools/search.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tools/shell.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tools/todo.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tools/web.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tui/__init__.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tui/anim.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode/tui/screens.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode.egg-info/SOURCES.txt +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode.egg-info/dependency_links.txt +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode.egg-info/entry_points.txt +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode.egg-info/requires.txt +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/anixcode.egg-info/top_level.txt +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/setup.cfg +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_agent.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_commands.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_i18n.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_images.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_llm.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_mcp.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_projects.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_providers.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_reliability.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_safety_mentions.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_settings.py +0 -0
- {anixcode-0.12.1 → anixcode-0.12.3}/tests/test_tools.py +0 -0
|
@@ -169,7 +169,7 @@ class SubagentTool(Tool):
|
|
|
169
169
|
sub_settings = Settings(
|
|
170
170
|
provider=self._parent.settings.provider,
|
|
171
171
|
model=self._parent.settings.model,
|
|
172
|
-
max_steps=min(15, self._parent.settings.max_steps),
|
|
172
|
+
max_steps=15 if self._parent.settings.max_steps <= 0 else min(15, self._parent.settings.max_steps),
|
|
173
173
|
context_window=self._parent.settings.context_window,
|
|
174
174
|
protect_secrets=self._parent.settings.protect_secrets,
|
|
175
175
|
full_access=self._parent.settings.full_access,
|
|
@@ -397,7 +397,9 @@ class Agent:
|
|
|
397
397
|
system = {"role": "system", "content": system_prompt(self.ctx.root, self.mode, goal=self.active_goal)}
|
|
398
398
|
overflow_retried = False
|
|
399
399
|
gave_up = False # compaction could not shrink the history: don't retry every step
|
|
400
|
-
|
|
400
|
+
step = 0
|
|
401
|
+
while self.settings.max_steps <= 0 or step < self.settings.max_steps:
|
|
402
|
+
step += 1
|
|
401
403
|
limit = self.window * compaction.COMPACT_AT
|
|
402
404
|
try:
|
|
403
405
|
gave_up, compact_events = await self._maybe_compact(session, limit, gave_up)
|
|
@@ -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 — стабильное качество и быстрые правки':
|
|
@@ -29,7 +29,7 @@ class Settings:
|
|
|
29
29
|
animations: bool = True
|
|
30
30
|
# "ask" | "allow" | "deny" for tools that change things. Reading is always allowed.
|
|
31
31
|
permissions: dict[str, str] = field(default_factory=lambda: {"edit": "ask", "exec": "ask"})
|
|
32
|
-
max_steps: int =
|
|
32
|
+
max_steps: int = 0 # 0 = unlimited (stop anytime with Esc)
|
|
33
33
|
full_access: bool = False # the agent edits and runs commands without asking
|
|
34
34
|
confirm_dangerous: bool = False # if true, dangerous shell commands still ask even in full_access
|
|
35
35
|
protect_secrets: bool = True # warn/ask before reading .env, private keys, credentials
|
|
@@ -74,6 +74,8 @@ def load_settings(base: Path | None = None) -> Settings:
|
|
|
74
74
|
raw["theme"] = "anix" # 0.1.0 saved its old default theme; switch to the new default once
|
|
75
75
|
if raw.get("theme") == "opencode":
|
|
76
76
|
raw["theme"] = "noir" # renamed in 0.8
|
|
77
|
+
if raw.get("max_steps") == 50:
|
|
78
|
+
raw["max_steps"] = 0 # old default cap removed; 0 = unlimited
|
|
77
79
|
s = Settings(**{k: v for k, v in raw.items() if k in known})
|
|
78
80
|
s.permissions = {k: v for k, v in dict(s.permissions).items() if v in PERMISSION_VALUES}
|
|
79
81
|
s.custom_providers = [
|
|
@@ -40,7 +40,7 @@ from .anim import THEME_LABELS, ActivityIndicator, AnimatedLogo, Gradient, make_
|
|
|
40
40
|
from .screens import HelpScreen, ProjectScreen, QuickMenuScreen, 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,
|
|
43
|
+
PromptInput, QuickActionBar, ReasoningBlock, TodoBar, ToolCard, UserMessage,
|
|
44
44
|
)
|
|
45
45
|
|
|
46
46
|
def _tokens(n: int) -> str:
|
|
@@ -153,35 +153,12 @@ class AnixApp(App):
|
|
|
153
153
|
return
|
|
154
154
|
self._command(cmd)
|
|
155
155
|
|
|
156
|
-
def _welcome(self) ->
|
|
156
|
+
def _welcome(self) -> Static:
|
|
157
157
|
footer = Text()
|
|
158
|
-
footer.append(f"v{__version__}\n", style="dim")
|
|
159
|
-
footer.append(tr("
|
|
160
|
-
|
|
161
|
-
|
|
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")
|
|
158
|
+
footer.append(f"v{__version__}\n\n", style="dim")
|
|
159
|
+
footer.append(tr("Опишите задачу: агент сам прочитает код, внесёт правки и запустит команды.\n"), style="dim")
|
|
160
|
+
footer.append(tr("Ctrl+K: меню · Tab: Build/Plan · Ctrl+O: модель · F1: помощь"), style="dim")
|
|
161
|
+
return AnimatedLogo(footer, animate=self.settings.animations, id="welcome")
|
|
185
162
|
|
|
186
163
|
def on_mount(self) -> None:
|
|
187
164
|
import contextlib
|
|
@@ -1279,7 +1256,6 @@ class AnixApp(App):
|
|
|
1279
1256
|
self._build_agent()
|
|
1280
1257
|
self.session.model = self.settings.model
|
|
1281
1258
|
self._refresh_bars()
|
|
1282
|
-
self.run_worker(self._refresh_welcome_if_empty())
|
|
1283
1259
|
self.notify(tr('Подключено: {0}', self.settings.model), timeout=3)
|
|
1284
1260
|
self.query_one(PromptInput).focus()
|
|
1285
1261
|
if self._pick_project:
|
|
@@ -1287,14 +1263,6 @@ class AnixApp(App):
|
|
|
1287
1263
|
|
|
1288
1264
|
self.push_screen(SetupScreen(self.settings, self.auth, self.config_base), done)
|
|
1289
1265
|
|
|
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
1266
|
def action_quick_menu(self) -> None:
|
|
1299
1267
|
if isinstance(self.screen, QuickMenuScreen):
|
|
1300
1268
|
return
|
|
@@ -33,50 +33,6 @@ Screen {
|
|
|
33
33
|
#browser-chip:hover, #menu-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
36
|
#quick-bar {
|
|
81
37
|
height: 1;
|
|
82
38
|
padding: 0 1;
|
|
@@ -87,7 +43,7 @@ Screen {
|
|
|
87
43
|
color: $text-muted;
|
|
88
44
|
text-style: none;
|
|
89
45
|
margin-left: 0;
|
|
90
|
-
margin-right:
|
|
46
|
+
margin-right: 2;
|
|
91
47
|
}
|
|
92
48
|
.chip.quick:hover {
|
|
93
49
|
background: $panel;
|
|
@@ -91,39 +91,6 @@ class QuickActionBar(Horizontal):
|
|
|
91
91
|
yield Chip(label, cb, classes="chip quick")
|
|
92
92
|
|
|
93
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
94
|
class AttachmentBar(Horizontal):
|
|
128
95
|
"""Pending image attachments shown above the prompt. Click a chip to remove it."""
|
|
129
96
|
|
|
@@ -306,15 +306,15 @@ def test_project_mcp_skills_global_rules_and_wal(tmp_path):
|
|
|
306
306
|
def test_tui_boots_with_browser_pane_and_todo_bar(tmp_path):
|
|
307
307
|
from anixcode.tui.app import AnixApp
|
|
308
308
|
from anixcode.tui.screens import QuickMenuScreen, SetupScreen
|
|
309
|
-
from anixcode.tui.widgets import BrowserPane, PromptInput, QuickActionBar, TodoBar
|
|
309
|
+
from anixcode.tui.widgets import BrowserPane, PromptInput, QuickActionBar, 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
|
-
#
|
|
317
|
-
assert app.query_one(
|
|
316
|
+
# Centered logo & QuickActionBar are visible on start
|
|
317
|
+
assert app.query_one("#welcome") is not None
|
|
318
318
|
assert app.query_one(QuickActionBar) is not None
|
|
319
319
|
pane = app.query_one(BrowserPane)
|
|
320
320
|
todos = app.query_one(TodoBar)
|
|
@@ -346,5 +346,21 @@ def test_tui_boots_with_browser_pane_and_todo_bar(tmp_path):
|
|
|
346
346
|
asyncio.run(go())
|
|
347
347
|
|
|
348
348
|
|
|
349
|
+
def test_unlimited_steps_by_default_and_legacy_50_migrates(tmp_path):
|
|
350
|
+
from anixcode.settings import load_settings
|
|
351
|
+
|
|
352
|
+
# Old settings.json with default max_steps=50 migrates to 0 (unlimited)
|
|
353
|
+
(tmp_path / "settings.json").write_text('{"max_steps": 50}', encoding="utf-8")
|
|
354
|
+
assert load_settings(tmp_path).max_steps == 0
|
|
355
|
+
|
|
356
|
+
(tmp_path / "a.txt").write_text("hi\n")
|
|
357
|
+
script = [Completion(tool_calls=[_call("read", f"r{i}", path="a.txt")]) for i in range(55)]
|
|
358
|
+
script.append(Completion(text="finished after 55 steps"))
|
|
359
|
+
agent = Agent(ScriptClient(script), "m", tmp_path, Settings())
|
|
360
|
+
events = asyncio.run(_collect(agent.run(Session("u1", str(tmp_path)), "run long")))
|
|
361
|
+
assert isinstance(events[-1], Done)
|
|
362
|
+
assert any(isinstance(e, TextDelta) and "55 steps" in e.text for e in events)
|
|
363
|
+
|
|
364
|
+
|
|
349
365
|
async def _collect(aiter):
|
|
350
366
|
return [ev async for ev in aiter]
|
|
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
|
|
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
|
|
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
|