comate-cli 0.3.4__tar.gz → 0.3.7__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.
- {comate_cli-0.3.4 → comate_cli-0.3.7}/.gitignore +2 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/PKG-INFO +2 -1
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/app.py +8 -3
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/path_context_hint.py +4 -2
- {comate_cli-0.3.4 → comate_cli-0.3.7}/pyproject.toml +2 -1
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_path_context_hint.py +23 -0
- comate_cli-0.3.7/tests/test_update_check.py +152 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/uv.lock +3 -1
- {comate_cli-0.3.4 → comate_cli-0.3.7}/README.md +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/__init__.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/__main__.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/main.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/mcp_cli.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/__init__.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/animations.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/assistant_render.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/codenames.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/custom_slash_commands.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/env_utils.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/error_display.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/event_renderer.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/fragment_utils.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/history_printer.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/input_geometry.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/layout_coordinator.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/logging_adapter.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/logo.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/markdown_render.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/mention_completer.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/message_style.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/models.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/preflight.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/question_view.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/resume_selector.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/rewind_store.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/rpc_protocol.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/rpc_stdio.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/selection_menu.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/session_view.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/slash_commands.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/startup.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/status_bar.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/text_effects.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/tips.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/tool_view.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/tui.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/tui_parts/__init__.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/tui_parts/commands.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/tui_parts/history_sync.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/tui_parts/input_behavior.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/tui_parts/key_bindings.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/tui_parts/render_panels.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/tui_parts/slash_command_registry.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/tui_parts/ui_mode.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/conftest.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_app_mcp_preload.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_app_preflight_gate.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_app_print_mode.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_app_shutdown.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_app_usage_line.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_cli_project_root.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_compact_command_semantics.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_completion_context_activation.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_completion_status_panel.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_context_command.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_custom_slash_commands.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_event_renderer.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_format_error.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_handle_error.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_history_printer.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_history_sync.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_input_behavior.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_input_history.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_interrupt_exit_semantics.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_layout_coordinator.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_logging_adapter.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_logo.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_main_args.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_mcp_cli.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_mcp_slash_command.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_mention_completer.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_preflight.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_preflight_copilot.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_question_key_bindings.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_question_view.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_resume_selector.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_rewind_command_semantics.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_rewind_store.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_rpc_protocol.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_rpc_stdio_bridge.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_selection_menu.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_skills_slash_command.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_slash_argument_hint.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_slash_completer.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_slash_registry.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_status_bar.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_status_bar_transient.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_task_panel_format.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_task_panel_key_bindings.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_task_panel_rendering.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_task_poll.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_tool_view.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_tui_elapsed_status.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_tui_mcp_init_gate.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_tui_paste_placeholder.py +0 -0
- {comate_cli-0.3.4 → comate_cli-0.3.7}/tests/test_tui_split_invariance.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: comate-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.7
|
|
4
4
|
Summary: Comate terminal CLI built on comate-agent-sdk
|
|
5
5
|
Project-URL: Homepage, https://github.com/AndyLee1024/agent-sdk
|
|
6
6
|
Project-URL: Repository, https://github.com/AndyLee1024/agent-sdk
|
|
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
16
16
|
Requires-Python: >=3.11
|
|
17
17
|
Requires-Dist: comate-agent-sdk<1.0.0,>=0.0.2
|
|
18
|
+
Requires-Dist: packaging>=25.0
|
|
18
19
|
Requires-Dist: prompt-toolkit>=3.0
|
|
19
20
|
Requires-Dist: rich>=14.0
|
|
20
21
|
Description-Content-Type: text/markdown
|
|
@@ -60,7 +60,7 @@ def _is_chinese_locale() -> bool:
|
|
|
60
60
|
async def _check_update() -> str | None:
|
|
61
61
|
"""异步检查 comate-cli 是否有新版本,返回提示字符串或 None。
|
|
62
62
|
|
|
63
|
-
中文 locale
|
|
63
|
+
中文 locale 自动使用清华 TUNA 镜像源,其余使用官方 PyPI。
|
|
64
64
|
"""
|
|
65
65
|
package = "comate-cli"
|
|
66
66
|
try:
|
|
@@ -86,8 +86,8 @@ async def _check_update() -> str | None:
|
|
|
86
86
|
return None
|
|
87
87
|
|
|
88
88
|
try:
|
|
89
|
-
from importlib.metadata import version as _v
|
|
90
89
|
from packaging.version import Version
|
|
90
|
+
|
|
91
91
|
if Version(latest) > Version(current):
|
|
92
92
|
return (
|
|
93
93
|
f"[dim] New version available: [bold cyan]{latest}[/] "
|
|
@@ -95,7 +95,12 @@ async def _check_update() -> str | None:
|
|
|
95
95
|
f"Run [bold green]uv tool upgrade {package}[/] to upgrade.[/]"
|
|
96
96
|
)
|
|
97
97
|
except Exception:
|
|
98
|
-
|
|
98
|
+
logger.debug(
|
|
99
|
+
"update comparison failed (current=%s, latest=%s)",
|
|
100
|
+
current,
|
|
101
|
+
latest,
|
|
102
|
+
exc_info=True,
|
|
103
|
+
)
|
|
99
104
|
return None
|
|
100
105
|
|
|
101
106
|
|
|
@@ -34,9 +34,11 @@ def build_path_context_hint(text: str, project_root: Path) -> str | None:
|
|
|
34
34
|
|
|
35
35
|
try:
|
|
36
36
|
if candidate.is_dir():
|
|
37
|
-
|
|
37
|
+
desc = _describe_dir(raw_path, candidate)
|
|
38
|
+
hint_lines.append(f"{desc} [{candidate}]")
|
|
38
39
|
elif candidate.is_file():
|
|
39
|
-
|
|
40
|
+
desc = _describe_file(raw_path, candidate)
|
|
41
|
+
hint_lines.append(f"{desc} [{candidate}]")
|
|
40
42
|
else:
|
|
41
43
|
# Not found — only include if path looks like a filesystem path
|
|
42
44
|
if "/" in raw_path or "." in raw_path:
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "comate-cli"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.7"
|
|
8
8
|
description = "Comate terminal CLI built on comate-agent-sdk"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -25,6 +25,7 @@ dependencies = [
|
|
|
25
25
|
"comate-agent-sdk>=0.0.2,<1.0.0",
|
|
26
26
|
"rich>=14.0",
|
|
27
27
|
"prompt-toolkit>=3.0",
|
|
28
|
+
"packaging>=25.0",
|
|
28
29
|
]
|
|
29
30
|
|
|
30
31
|
[project.urls]
|
|
@@ -104,3 +104,26 @@ class TestBuildPathContextHint(unittest.TestCase):
|
|
|
104
104
|
link.symlink_to(target) # target doesn't exist
|
|
105
105
|
hint = build_path_context_hint("check @link.txt", self.root)
|
|
106
106
|
self.assertIn("not found", hint)
|
|
107
|
+
|
|
108
|
+
def test_file_hint_includes_absolute_path(self) -> None:
|
|
109
|
+
"""File hints should include [absolute_path] suffix."""
|
|
110
|
+
f = self.root / "demo.py"
|
|
111
|
+
f.write_text("x\n")
|
|
112
|
+
hint = build_path_context_hint("check @demo.py", self.root)
|
|
113
|
+
expected_abs = str(f.resolve())
|
|
114
|
+
self.assertIn(f"[{expected_abs}]", hint)
|
|
115
|
+
|
|
116
|
+
def test_dir_hint_includes_absolute_path(self) -> None:
|
|
117
|
+
"""Directory hints should include [absolute_path] suffix."""
|
|
118
|
+
d = self.root / "src"
|
|
119
|
+
d.mkdir()
|
|
120
|
+
(d / "a.py").write_text("x")
|
|
121
|
+
hint = build_path_context_hint("check @src/", self.root)
|
|
122
|
+
expected_abs = str(d.resolve())
|
|
123
|
+
self.assertIn(f"[{expected_abs}]", hint)
|
|
124
|
+
|
|
125
|
+
def test_not_found_has_no_absolute_path(self) -> None:
|
|
126
|
+
"""'not found' lines should NOT include [absolute_path] suffix."""
|
|
127
|
+
hint = build_path_context_hint("read @missing.txt", self.root)
|
|
128
|
+
self.assertIn("not found", hint)
|
|
129
|
+
self.assertNotIn("[", hint.split("not found")[1])
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import tomllib
|
|
4
|
+
import unittest
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from types import SimpleNamespace
|
|
7
|
+
from unittest.mock import AsyncMock, MagicMock, patch
|
|
8
|
+
|
|
9
|
+
from comate_cli.terminal_agent import app as app_module
|
|
10
|
+
from comate_cli.terminal_agent.preflight import PreflightResult
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class _FakeResponse:
|
|
14
|
+
def __init__(self, latest: str) -> None:
|
|
15
|
+
self._latest = latest
|
|
16
|
+
|
|
17
|
+
def raise_for_status(self) -> None:
|
|
18
|
+
return None
|
|
19
|
+
|
|
20
|
+
def json(self) -> dict[str, object]:
|
|
21
|
+
return {"info": {"version": self._latest}}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class _FakeClient:
|
|
25
|
+
def __init__(self, latest: str) -> None:
|
|
26
|
+
self._latest = latest
|
|
27
|
+
|
|
28
|
+
async def __aenter__(self) -> _FakeClient:
|
|
29
|
+
return self
|
|
30
|
+
|
|
31
|
+
async def __aexit__(self, exc_type, exc, tb) -> bool:
|
|
32
|
+
return False
|
|
33
|
+
|
|
34
|
+
async def get(self, url: str) -> _FakeResponse:
|
|
35
|
+
return _FakeResponse(self._latest)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class _FailingClient:
|
|
39
|
+
async def __aenter__(self) -> _FailingClient:
|
|
40
|
+
return self
|
|
41
|
+
|
|
42
|
+
async def __aexit__(self, exc_type, exc, tb) -> bool:
|
|
43
|
+
return False
|
|
44
|
+
|
|
45
|
+
async def get(self, url: str) -> _FakeResponse:
|
|
46
|
+
raise RuntimeError("boom")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class TestCheckUpdate(unittest.IsolatedAsyncioTestCase):
|
|
50
|
+
async def test_check_update_returns_hint_when_latest_is_newer(self) -> None:
|
|
51
|
+
with (
|
|
52
|
+
patch.object(app_module, "_is_chinese_locale", return_value=False),
|
|
53
|
+
patch.object(app_module.importlib.metadata, "version", return_value="0.3.3"),
|
|
54
|
+
patch("httpx.AsyncClient", side_effect=lambda **_: _FakeClient("0.3.6")),
|
|
55
|
+
):
|
|
56
|
+
hint = await app_module._check_update()
|
|
57
|
+
|
|
58
|
+
self.assertIsNotNone(hint)
|
|
59
|
+
assert hint is not None
|
|
60
|
+
self.assertIn("0.3.6", hint)
|
|
61
|
+
self.assertIn("0.3.3", hint)
|
|
62
|
+
self.assertIn("uv tool upgrade comate-cli", hint)
|
|
63
|
+
|
|
64
|
+
async def test_check_update_returns_none_when_versions_match(self) -> None:
|
|
65
|
+
with (
|
|
66
|
+
patch.object(app_module, "_is_chinese_locale", return_value=False),
|
|
67
|
+
patch.object(app_module.importlib.metadata, "version", return_value="0.3.6"),
|
|
68
|
+
patch("httpx.AsyncClient", side_effect=lambda **_: _FakeClient("0.3.6")),
|
|
69
|
+
):
|
|
70
|
+
hint = await app_module._check_update()
|
|
71
|
+
|
|
72
|
+
self.assertIsNone(hint)
|
|
73
|
+
|
|
74
|
+
async def test_check_update_logs_and_returns_none_on_network_error(self) -> None:
|
|
75
|
+
with (
|
|
76
|
+
patch.object(app_module, "_is_chinese_locale", return_value=False),
|
|
77
|
+
patch.object(app_module.importlib.metadata, "version", return_value="0.3.3"),
|
|
78
|
+
patch("httpx.AsyncClient", side_effect=lambda **_: _FailingClient()),
|
|
79
|
+
self.assertLogs(app_module.logger, level="DEBUG") as logs,
|
|
80
|
+
):
|
|
81
|
+
hint = await app_module._check_update()
|
|
82
|
+
|
|
83
|
+
self.assertIsNone(hint)
|
|
84
|
+
self.assertTrue(
|
|
85
|
+
any("update check failed" in message for message in logs.output),
|
|
86
|
+
logs.output,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
async def test_run_prints_update_hint(self) -> None:
|
|
90
|
+
session = MagicMock()
|
|
91
|
+
session.get_mode.return_value = "default"
|
|
92
|
+
session.get_usage = AsyncMock(
|
|
93
|
+
return_value=SimpleNamespace(
|
|
94
|
+
total_prompt_tokens=0,
|
|
95
|
+
total_prompt_cached_tokens=0,
|
|
96
|
+
total_completion_tokens=0,
|
|
97
|
+
total_reasoning_tokens=0,
|
|
98
|
+
)
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
renderer = MagicMock()
|
|
102
|
+
logging_session = MagicMock()
|
|
103
|
+
status_bar = MagicMock()
|
|
104
|
+
tui = MagicMock()
|
|
105
|
+
tui.run = AsyncMock()
|
|
106
|
+
tui.session = session
|
|
107
|
+
tui.initialized_session_id = None
|
|
108
|
+
|
|
109
|
+
with (
|
|
110
|
+
patch.object(
|
|
111
|
+
app_module,
|
|
112
|
+
"run_preflight_if_needed",
|
|
113
|
+
AsyncMock(return_value=PreflightResult(status="configured")),
|
|
114
|
+
),
|
|
115
|
+
patch.object(app_module, "_build_agent", return_value=MagicMock()),
|
|
116
|
+
patch.object(app_module, "print_logo"),
|
|
117
|
+
patch.object(app_module, "EventRenderer", return_value=renderer),
|
|
118
|
+
patch("comate_cli.terminal_agent.logging_adapter.setup_tui_logging", return_value=logging_session),
|
|
119
|
+
patch.object(app_module, "_resolve_session", return_value=(session, "new")),
|
|
120
|
+
patch.object(app_module, "_check_update", AsyncMock(return_value="[dim] New version available: 0.3.6[/]")),
|
|
121
|
+
patch.object(app_module, "StatusBar", return_value=status_bar),
|
|
122
|
+
patch.object(app_module, "TerminalAgentTUI", return_value=tui),
|
|
123
|
+
patch.object(app_module, "_graceful_shutdown", AsyncMock()),
|
|
124
|
+
patch.object(app_module.console, "print") as mock_console_print,
|
|
125
|
+
patch.object(app_module.random, "choice", return_value="test-tip"),
|
|
126
|
+
):
|
|
127
|
+
await app_module.run()
|
|
128
|
+
|
|
129
|
+
self.assertTrue(
|
|
130
|
+
any(
|
|
131
|
+
"New version available" in str(call.args[0])
|
|
132
|
+
for call in mock_console_print.call_args_list
|
|
133
|
+
if call.args
|
|
134
|
+
),
|
|
135
|
+
mock_console_print.call_args_list,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class TestCliPyproject(unittest.TestCase):
|
|
140
|
+
def test_pyproject_declares_packaging_runtime_dependency(self) -> None:
|
|
141
|
+
pyproject_path = Path(__file__).resolve().parents[1] / "pyproject.toml"
|
|
142
|
+
data = tomllib.loads(pyproject_path.read_text(encoding="utf-8"))
|
|
143
|
+
dependencies = data["project"]["dependencies"]
|
|
144
|
+
|
|
145
|
+
self.assertTrue(
|
|
146
|
+
any(str(dep).startswith("packaging") for dep in dependencies),
|
|
147
|
+
dependencies,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
if __name__ == "__main__":
|
|
152
|
+
unittest.main(verbosity=2)
|
|
@@ -364,7 +364,7 @@ wheels = [
|
|
|
364
364
|
|
|
365
365
|
[[package]]
|
|
366
366
|
name = "comate-agent-sdk"
|
|
367
|
-
version = "0.3.
|
|
367
|
+
version = "0.3.4"
|
|
368
368
|
source = { editable = "../../" }
|
|
369
369
|
dependencies = [
|
|
370
370
|
{ name = "aiohttp" },
|
|
@@ -433,6 +433,7 @@ version = "0.3.4"
|
|
|
433
433
|
source = { editable = "." }
|
|
434
434
|
dependencies = [
|
|
435
435
|
{ name = "comate-agent-sdk" },
|
|
436
|
+
{ name = "packaging" },
|
|
436
437
|
{ name = "prompt-toolkit" },
|
|
437
438
|
{ name = "rich" },
|
|
438
439
|
]
|
|
@@ -445,6 +446,7 @@ dev = [
|
|
|
445
446
|
[package.metadata]
|
|
446
447
|
requires-dist = [
|
|
447
448
|
{ name = "comate-agent-sdk", editable = "../../" },
|
|
449
|
+
{ name = "packaging", specifier = ">=25.0" },
|
|
448
450
|
{ name = "prompt-toolkit", specifier = ">=3.0" },
|
|
449
451
|
{ name = "rich", specifier = ">=14.0" },
|
|
450
452
|
]
|
|
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
|
{comate_cli-0.3.4 → comate_cli-0.3.7}/comate_cli/terminal_agent/tui_parts/slash_command_registry.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|