comate-cli 0.5.6__tar.gz → 0.5.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.
Files changed (139) hide show
  1. {comate_cli-0.5.6 → comate_cli-0.5.7}/PKG-INFO +1 -1
  2. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/tui.py +7 -3
  3. {comate_cli-0.5.6 → comate_cli-0.5.7}/pyproject.toml +1 -1
  4. comate_cli-0.5.7/tests/test_tui_team_messages.py +121 -0
  5. {comate_cli-0.5.6 → comate_cli-0.5.7}/uv.lock +2 -2
  6. {comate_cli-0.5.6 → comate_cli-0.5.7}/.gitignore +0 -0
  7. {comate_cli-0.5.6 → comate_cli-0.5.7}/README.md +0 -0
  8. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/__init__.py +0 -0
  9. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/__main__.py +0 -0
  10. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/main.py +0 -0
  11. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/mcp_cli.py +0 -0
  12. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/__init__.py +0 -0
  13. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/animations.py +0 -0
  14. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/app.py +0 -0
  15. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/assistant_render.py +0 -0
  16. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/codenames.py +0 -0
  17. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/custom_slash_commands.py +0 -0
  18. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/env_utils.py +0 -0
  19. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/error_display.py +0 -0
  20. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/event_renderer.py +0 -0
  21. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/figures.py +0 -0
  22. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/fragment_utils.py +0 -0
  23. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/history_printer.py +0 -0
  24. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/input_geometry.py +0 -0
  25. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/layout_coordinator.py +0 -0
  26. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/logging_adapter.py +0 -0
  27. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/logo.py +0 -0
  28. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/markdown_render.py +0 -0
  29. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/mention_completer.py +0 -0
  30. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/message_style.py +0 -0
  31. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/models.py +0 -0
  32. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/path_context_hint.py +0 -0
  33. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/__init__.py +0 -0
  34. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/components/__init__.py +0 -0
  35. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/components/detail_view.py +0 -0
  36. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/components/plugin_list.py +0 -0
  37. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/components/search_box.py +0 -0
  38. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/components/tab_bar.py +0 -0
  39. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/marketplace_install_view.py +0 -0
  40. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/plugin_picker.py +0 -0
  41. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/tabs/__init__.py +0 -0
  42. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/tabs/discover_tab.py +0 -0
  43. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/tabs/errors_tab.py +0 -0
  44. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/tabs/installed_tab.py +0 -0
  45. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/plugins/tabs/marketplaces_tab.py +0 -0
  46. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/preflight.py +0 -0
  47. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/question_view.py +0 -0
  48. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/resume_selector.py +0 -0
  49. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/rewind_store.py +0 -0
  50. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/rpc_protocol.py +0 -0
  51. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/rpc_stdio.py +0 -0
  52. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/selection_menu.py +0 -0
  53. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/session_view.py +0 -0
  54. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/slash_commands.py +0 -0
  55. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/startup.py +0 -0
  56. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/status_bar.py +0 -0
  57. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/text_effects.py +0 -0
  58. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/tips.py +0 -0
  59. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/tool_view.py +0 -0
  60. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/tui_parts/__init__.py +0 -0
  61. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/tui_parts/commands.py +0 -0
  62. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/tui_parts/history_sync.py +0 -0
  63. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/tui_parts/input_behavior.py +0 -0
  64. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/tui_parts/key_bindings.py +0 -0
  65. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/tui_parts/mcp_connecting_view.py +0 -0
  66. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/tui_parts/render_panels.py +0 -0
  67. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/tui_parts/slash_command_registry.py +0 -0
  68. {comate_cli-0.5.6 → comate_cli-0.5.7}/comate_cli/terminal_agent/tui_parts/ui_mode.py +0 -0
  69. {comate_cli-0.5.6 → comate_cli-0.5.7}/docs/superpowers/plans/2026-04-03-phrase-shuffle.md +0 -0
  70. {comate_cli-0.5.6 → comate_cli-0.5.7}/docs/superpowers/specs/2026-04-01-conditional-diff-subtitle-design.md +0 -0
  71. {comate_cli-0.5.6 → comate_cli-0.5.7}/docs/superpowers/specs/2026-04-03-phrase-shuffle-design.md +0 -0
  72. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/conftest.py +0 -0
  73. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_animator_shuffle.py +0 -0
  74. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_app_mcp_preload.py +0 -0
  75. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_app_preflight_gate.py +0 -0
  76. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_app_print_mode.py +0 -0
  77. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_app_shutdown.py +0 -0
  78. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_app_usage_line.py +0 -0
  79. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_cli_project_root.py +0 -0
  80. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_compact_command_semantics.py +0 -0
  81. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_completion_context_activation.py +0 -0
  82. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_completion_status_panel.py +0 -0
  83. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_context_command.py +0 -0
  84. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_custom_slash_commands.py +0 -0
  85. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_discover_tab.py +0 -0
  86. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_errors_tab.py +0 -0
  87. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_event_renderer.py +0 -0
  88. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_event_renderer_boundary.py +0 -0
  89. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_event_renderer_e2e.py +0 -0
  90. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_event_renderer_streaming.py +0 -0
  91. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_format_error.py +0 -0
  92. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_handle_error.py +0 -0
  93. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_history_printer.py +0 -0
  94. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_history_sync.py +0 -0
  95. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_input_behavior.py +0 -0
  96. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_input_history.py +0 -0
  97. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_installed_tab.py +0 -0
  98. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_interrupt_exit_semantics.py +0 -0
  99. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_layout_coordinator.py +0 -0
  100. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_logging_adapter.py +0 -0
  101. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_logo.py +0 -0
  102. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_main_args.py +0 -0
  103. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_markdown_render.py +0 -0
  104. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_marketplaces_tab.py +0 -0
  105. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_mcp_cli.py +0 -0
  106. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_mcp_slash_command.py +0 -0
  107. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_mention_completer.py +0 -0
  108. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_path_context_hint.py +0 -0
  109. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_plugin_slash_commands.py +0 -0
  110. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_plugin_tui_components.py +0 -0
  111. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_preflight.py +0 -0
  112. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_preflight_copilot.py +0 -0
  113. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_question_key_bindings.py +0 -0
  114. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_question_view.py +0 -0
  115. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_resume_selector.py +0 -0
  116. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_rewind_command_semantics.py +0 -0
  117. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_rewind_store.py +0 -0
  118. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_rpc_protocol.py +0 -0
  119. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_rpc_stdio_bridge.py +0 -0
  120. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_selection_menu.py +0 -0
  121. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_skills_slash_command.py +0 -0
  122. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_slash_argument_hint.py +0 -0
  123. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_slash_completer.py +0 -0
  124. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_slash_registry.py +0 -0
  125. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_status_bar.py +0 -0
  126. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_status_bar_transient.py +0 -0
  127. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_task_panel_format.py +0 -0
  128. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_task_panel_key_bindings.py +0 -0
  129. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_task_panel_rendering.py +0 -0
  130. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_task_poll.py +0 -0
  131. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_tool_view.py +0 -0
  132. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_tui_elapsed_status.py +0 -0
  133. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_tui_esc_queue.py +0 -0
  134. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_tui_mcp_init_gate.py +0 -0
  135. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_tui_paste_placeholder.py +0 -0
  136. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_tui_queue_preview.py +0 -0
  137. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_tui_queue_sdk_source.py +0 -0
  138. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_tui_split_invariance.py +0 -0
  139. {comate_cli-0.5.6 → comate_cli-0.5.7}/tests/test_update_check.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: comate-cli
3
- Version: 0.5.6
3
+ Version: 0.5.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
@@ -179,9 +179,13 @@ class TerminalAgentTUI(
179
179
  from prompt_toolkit.application import get_app
180
180
  from prompt_toolkit.application.dummy import DummyApplication
181
181
  app = get_app()
182
- if not isinstance(app, DummyApplication):
183
- app.create_background_task(run_in_terminal(_write, in_executor=False))
184
- return
182
+ if isinstance(app, DummyApplication):
183
+ _write()
184
+ else:
185
+ # run_in_terminal() 自身已经会调度 Future;不能再交给
186
+ # create_background_task() 二次包装,否则会触发重复执行竞态。
187
+ run_in_terminal(_write, in_executor=False)
188
+ return
185
189
  except Exception:
186
190
  pass
187
191
  _write()
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "comate-cli"
7
- version = "0.5.6"
7
+ version = "0.5.7"
8
8
  description = "Comate terminal CLI built on comate-agent-sdk"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -0,0 +1,121 @@
1
+ from __future__ import annotations
2
+
3
+ from types import SimpleNamespace
4
+ from unittest.mock import patch
5
+
6
+ from prompt_toolkit.history import InMemoryHistory
7
+
8
+ from comate_agent_sdk.agent.events import TeamMessageEvent
9
+ from comate_cli.terminal_agent.tui import TerminalAgentTUI
10
+
11
+
12
+ class _FakeRenderer:
13
+ latest_diff_lines = None
14
+
15
+ def __init__(self) -> None:
16
+ self.team_messages: list[dict[str, object]] = []
17
+ self._show_thinking_cb = None
18
+
19
+ def history_entries(self) -> list[object]:
20
+ return []
21
+
22
+ def append_team_message_event(self, **kwargs) -> None:
23
+ self.team_messages.append(dict(kwargs))
24
+
25
+ def append_system_message(self, _text: str, severity: str | None = None) -> None:
26
+ return None
27
+
28
+ def has_active_todos(self) -> bool:
29
+ return False
30
+
31
+ def has_running_tools(self) -> bool:
32
+ return False
33
+
34
+
35
+ class _FakeSession:
36
+ def __init__(self) -> None:
37
+ self.session_id = "session-for-team-message-test"
38
+ self._cwd = "."
39
+ self._storage_root = "."
40
+ self._agent = SimpleNamespace(
41
+ _team=SimpleNamespace(team_message_event_callback=None),
42
+ _runtime_state=SimpleNamespace(skills=[]),
43
+ )
44
+
45
+ def get_mode(self) -> str:
46
+ return "act"
47
+
48
+ def peek_queue(self) -> list[object]:
49
+ return []
50
+
51
+
52
+ class _FakeStatusBar:
53
+ transient_message = ""
54
+ transient_severity = None
55
+ has_transient = False
56
+
57
+ def __init__(self) -> None:
58
+ self.mode = "act"
59
+
60
+ def set_mode(self, mode: str) -> None:
61
+ self.mode = mode
62
+
63
+ def get_mode(self) -> str:
64
+ return self.mode
65
+
66
+ def info_status_text(self) -> str:
67
+ return "test-model"
68
+
69
+ def git_diff_fragments(self) -> list[tuple[str, str]]:
70
+ return []
71
+
72
+
73
+ def test_team_message_callback_does_not_wrap_run_in_terminal_with_background_task() -> None:
74
+ session = _FakeSession()
75
+ renderer = _FakeRenderer()
76
+ fake_app = SimpleNamespace(create_background_task_called=False)
77
+
78
+ def _create_background_task(_future) -> None:
79
+ fake_app.create_background_task_called = True
80
+
81
+ fake_app.create_background_task = _create_background_task
82
+
83
+ def _run_in_terminal_now(func, render_cli_done=False, in_executor=False): # type: ignore[no-untyped-def]
84
+ assert render_cli_done is False
85
+ assert in_executor is False
86
+ func()
87
+ return object()
88
+
89
+ with (
90
+ patch(
91
+ "comate_cli.terminal_agent.tui.discover_custom_slash_commands",
92
+ return_value=SimpleNamespace(warnings=[], commands=[]),
93
+ ),
94
+ patch.object(TerminalAgentTUI, "_create_input_history", return_value=InMemoryHistory()),
95
+ patch("prompt_toolkit.application.get_app", return_value=fake_app),
96
+ patch("comate_cli.terminal_agent.tui.run_in_terminal", side_effect=_run_in_terminal_now),
97
+ ):
98
+ TerminalAgentTUI(session, _FakeStatusBar(), renderer) # type: ignore[arg-type]
99
+ callback = session._agent._team.team_message_event_callback
100
+ callback(
101
+ TeamMessageEvent(
102
+ agent_name="team-lead",
103
+ from_agent="worker",
104
+ to_agent="team-lead",
105
+ message_type="message",
106
+ content_preview="ready",
107
+ timestamp="2026-05-06T00:00:00Z",
108
+ )
109
+ )
110
+
111
+ assert fake_app.create_background_task_called is False
112
+ assert renderer.team_messages == [
113
+ {
114
+ "agent_name": "team-lead",
115
+ "from_agent": "worker",
116
+ "to_agent": "team-lead",
117
+ "message_type": "message",
118
+ "content_preview": "ready",
119
+ "timestamp": "2026-05-06T00:00:00Z",
120
+ }
121
+ ]
@@ -389,7 +389,7 @@ wheels = [
389
389
 
390
390
  [[package]]
391
391
  name = "comate-agent-sdk"
392
- version = "0.6.6"
392
+ version = "0.6.7"
393
393
  source = { editable = "../../" }
394
394
  dependencies = [
395
395
  { name = "aiohttp" },
@@ -461,7 +461,7 @@ dev = [
461
461
 
462
462
  [[package]]
463
463
  name = "comate-cli"
464
- version = "0.5.5"
464
+ version = "0.5.6"
465
465
  source = { editable = "." }
466
466
  dependencies = [
467
467
  { name = "charset-normalizer" },
File without changes
File without changes
File without changes