chcode 0.1.0__tar.gz → 0.1.1__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 (88) hide show
  1. {chcode-0.1.0 → chcode-0.1.1}/PKG-INFO +14 -9
  2. {chcode-0.1.0 → chcode-0.1.1}/README.md +13 -8
  3. {chcode-0.1.0 → chcode-0.1.1}/README_zh.md +9 -12
  4. {chcode-0.1.0 → chcode-0.1.1}/chcode/agents/runner.py +7 -7
  5. {chcode-0.1.0 → chcode-0.1.1}/chcode/chat.py +194 -161
  6. {chcode-0.1.0 → chcode-0.1.1}/chcode/cli.py +21 -5
  7. {chcode-0.1.0 → chcode-0.1.1}/chcode/config.py +268 -201
  8. {chcode-0.1.0 → chcode-0.1.1}/chcode/prompts.py +20 -112
  9. {chcode-0.1.0 → chcode-0.1.1}/chcode/session.py +26 -11
  10. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/git_manager.py +45 -3
  11. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/multimodal.py +25 -22
  12. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/shell/semantics.py +1 -1
  13. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/shell/session.py +7 -1
  14. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/tool_result_pipeline.py +0 -1
  15. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/tools.py +116 -321
  16. {chcode-0.1.0 → chcode-0.1.1}/chcode/vision_config.py +83 -103
  17. {chcode-0.1.0 → chcode-0.1.1}/pyproject.toml +1 -1
  18. {chcode-0.1.0 → chcode-0.1.1}/tests/test_chat_repl.py +140 -23
  19. {chcode-0.1.0 → chcode-0.1.1}/tests/test_chat_repl_extended.py +120 -0
  20. {chcode-0.1.0 → chcode-0.1.1}/tests/test_cli_extended.py +100 -21
  21. chcode-0.1.1/tests/test_config.py +327 -0
  22. {chcode-0.1.0 → chcode-0.1.1}/tests/test_config_extended.py +0 -4
  23. {chcode-0.1.0 → chcode-0.1.1}/tests/test_config_pure.py +19 -1
  24. {chcode-0.1.0 → chcode-0.1.1}/tests/test_coverage_gaps.py +13 -7
  25. {chcode-0.1.0 → chcode-0.1.1}/tests/test_git_manager_extended.py +175 -0
  26. {chcode-0.1.0 → chcode-0.1.1}/tests/test_runner.py +9 -0
  27. {chcode-0.1.0 → chcode-0.1.1}/tests/test_runner_extended.py +10 -5
  28. {chcode-0.1.0 → chcode-0.1.1}/tests/test_session.py +24 -0
  29. {chcode-0.1.0 → chcode-0.1.1}/tests/test_shell_session_extended.py +1 -0
  30. {chcode-0.1.0 → chcode-0.1.1}/tests/test_tool_result_pipeline.py +3 -2
  31. {chcode-0.1.0 → chcode-0.1.1}/tests/test_tools.py +9 -24
  32. {chcode-0.1.0 → chcode-0.1.1}/tests/test_tools_extended.py +45 -110
  33. {chcode-0.1.0 → chcode-0.1.1}/tests/test_vision_config.py +1 -29
  34. chcode-0.1.0/tests/test_config.py +0 -116
  35. {chcode-0.1.0 → chcode-0.1.1}/.github/workflows/publish.yml +0 -0
  36. {chcode-0.1.0 → chcode-0.1.1}/.github/workflows/test.yml +0 -0
  37. {chcode-0.1.0 → chcode-0.1.1}/.gitignore +0 -0
  38. {chcode-0.1.0 → chcode-0.1.1}/LICENSE +0 -0
  39. {chcode-0.1.0 → chcode-0.1.1}/assets/chagent.png +0 -0
  40. {chcode-0.1.0 → chcode-0.1.1}/assets/chcode.png +0 -0
  41. {chcode-0.1.0 → chcode-0.1.1}/assets/test.mp4 +0 -0
  42. {chcode-0.1.0 → chcode-0.1.1}/chcode/__init__.py +0 -0
  43. {chcode-0.1.0 → chcode-0.1.1}/chcode/__main__.py +0 -0
  44. {chcode-0.1.0 → chcode-0.1.1}/chcode/agent_setup.py +0 -0
  45. {chcode-0.1.0 → chcode-0.1.1}/chcode/agents/__init__.py +0 -0
  46. {chcode-0.1.0 → chcode-0.1.1}/chcode/agents/definitions.py +0 -0
  47. {chcode-0.1.0 → chcode-0.1.1}/chcode/agents/loader.py +0 -0
  48. {chcode-0.1.0 → chcode-0.1.1}/chcode/display.py +0 -0
  49. {chcode-0.1.0 → chcode-0.1.1}/chcode/skill_manager.py +0 -0
  50. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/__init__.py +0 -0
  51. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/enhanced_chat_openai.py +0 -0
  52. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/git_checker.py +0 -0
  53. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/modelscope_ratelimit.py +0 -0
  54. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/shell/__init__.py +0 -0
  55. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/shell/output.py +0 -0
  56. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/shell/provider.py +0 -0
  57. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/shell/result.py +0 -0
  58. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/skill_loader.py +0 -0
  59. {chcode-0.1.0 → chcode-0.1.1}/chcode/utils/text_utils.py +0 -0
  60. {chcode-0.1.0 → chcode-0.1.1}/docs/plans/2026-04-23-vision-tool.md +0 -0
  61. {chcode-0.1.0 → chcode-0.1.1}/tests/__init__.py +0 -0
  62. {chcode-0.1.0 → chcode-0.1.1}/tests/conftest.py +0 -0
  63. {chcode-0.1.0 → chcode-0.1.1}/tests/test_agent_setup.py +0 -0
  64. {chcode-0.1.0 → chcode-0.1.1}/tests/test_agent_setup_extended.py +0 -0
  65. {chcode-0.1.0 → chcode-0.1.1}/tests/test_chat_helpers.py +0 -0
  66. {chcode-0.1.0 → chcode-0.1.1}/tests/test_cli.py +0 -0
  67. {chcode-0.1.0 → chcode-0.1.1}/tests/test_definitions.py +0 -0
  68. {chcode-0.1.0 → chcode-0.1.1}/tests/test_display.py +0 -0
  69. {chcode-0.1.0 → chcode-0.1.1}/tests/test_display_extended.py +0 -0
  70. {chcode-0.1.0 → chcode-0.1.1}/tests/test_enhanced_chat_openai.py +0 -0
  71. {chcode-0.1.0 → chcode-0.1.1}/tests/test_enhanced_chat_openai_extended.py +0 -0
  72. {chcode-0.1.0 → chcode-0.1.1}/tests/test_git_checker.py +0 -0
  73. {chcode-0.1.0 → chcode-0.1.1}/tests/test_git_manager.py +0 -0
  74. {chcode-0.1.0 → chcode-0.1.1}/tests/test_loader.py +0 -0
  75. {chcode-0.1.0 → chcode-0.1.1}/tests/test_multimodal.py +0 -0
  76. {chcode-0.1.0 → chcode-0.1.1}/tests/test_multimodal_middleware.py +0 -0
  77. {chcode-0.1.0 → chcode-0.1.1}/tests/test_output.py +0 -0
  78. {chcode-0.1.0 → chcode-0.1.1}/tests/test_prompt_toolkit_ui.py +0 -0
  79. {chcode-0.1.0 → chcode-0.1.1}/tests/test_prompts.py +0 -0
  80. {chcode-0.1.0 → chcode-0.1.1}/tests/test_provider.py +0 -0
  81. {chcode-0.1.0 → chcode-0.1.1}/tests/test_result.py +0 -0
  82. {chcode-0.1.0 → chcode-0.1.1}/tests/test_semantics.py +0 -0
  83. {chcode-0.1.0 → chcode-0.1.1}/tests/test_shell_session.py +0 -0
  84. {chcode-0.1.0 → chcode-0.1.1}/tests/test_skill_loader.py +0 -0
  85. {chcode-0.1.0 → chcode-0.1.1}/tests/test_skill_loader_extended.py +0 -0
  86. {chcode-0.1.0 → chcode-0.1.1}/tests/test_skill_manager_extended.py +0 -0
  87. {chcode-0.1.0 → chcode-0.1.1}/tests/test_vision.py +0 -0
  88. {chcode-0.1.0 → chcode-0.1.1}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chcode
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Terminal-based AI coding agent with typer+rich
5
5
  Project-URL: Homepage, https://github.com/ScarletMercy/chcode
6
6
  Project-URL: Repository, https://github.com/ScarletMercy/chcode
@@ -179,14 +179,19 @@ Terminal-based AI coding agent, built with LangChain + Typer + Rich.
179
179
  ### Install
180
180
 
181
181
  ```bash
182
- # Option 1: Install with pip
183
- pip install chcode
184
-
185
- # Option 2: Install with uv (recommended)
186
- uv tool install chcode
187
-
188
- # Option 3: Install with pipx
189
- pipx install chcode
182
+ # Stable release (PyPI) choose one
183
+ pip install chcode # pip
184
+ uv tool install chcode # uv (recommended)
185
+ pipx install chcode # pipx
186
+
187
+ # Latest version (GitHub) — choose one
188
+ uv tool install git+https://github.com/ScarletMercy/chcode.git # uv (recommended)
189
+ pipx install git+https://github.com/ScarletMercy/chcode.git # pipx
190
+
191
+ # Development (from source)
192
+ git clone https://github.com/ScarletMercy/chcode.git
193
+ cd chcode
194
+ pip install -e . # or: uv sync && uv run chcode
190
195
  ```
191
196
 
192
197
  ### Run
@@ -135,14 +135,19 @@ Terminal-based AI coding agent, built with LangChain + Typer + Rich.
135
135
  ### Install
136
136
 
137
137
  ```bash
138
- # Option 1: Install with pip
139
- pip install chcode
140
-
141
- # Option 2: Install with uv (recommended)
142
- uv tool install chcode
143
-
144
- # Option 3: Install with pipx
145
- pipx install chcode
138
+ # Stable release (PyPI) choose one
139
+ pip install chcode # pip
140
+ uv tool install chcode # uv (recommended)
141
+ pipx install chcode # pipx
142
+
143
+ # Latest version (GitHub) — choose one
144
+ uv tool install git+https://github.com/ScarletMercy/chcode.git # uv (recommended)
145
+ pipx install git+https://github.com/ScarletMercy/chcode.git # pipx
146
+
147
+ # Development (from source)
148
+ git clone https://github.com/ScarletMercy/chcode.git
149
+ cd chcode
150
+ pip install -e . # or: uv sync && uv run chcode
146
151
  ```
147
152
 
148
153
  ### Run
@@ -135,22 +135,19 @@
135
135
  ### 安装
136
136
 
137
137
  ```bash
138
- # 方式一:使用 uv 全局安装(推荐)
139
- uv tool install git+https://github.com/ScarletMercy/chcode.git
138
+ # 稳定版(PyPI)— 三选一
139
+ pip install chcode # pip
140
+ uv tool install chcode # uv(推荐)
141
+ pipx install chcode # pipx
140
142
 
141
- # 方式二:克隆并用 uv 安装
142
- git clone https://github.com/ScarletMercy/chcode.git
143
- cd chcode
144
- uv sync
145
- uv run chcode
146
-
147
- # 方式三:使用 pipx 全局安装
148
- pipx install git+https://github.com/ScarletMercy/chcode.git
143
+ # 最新版(GitHub)— 二选一
144
+ uv tool install git+https://github.com/ScarletMercy/chcode.git # uv(推荐)
145
+ pipx install git+https://github.com/ScarletMercy/chcode.git # pipx
149
146
 
150
- # 方式四:克隆并用 pip 安装
147
+ # 开发测试(从源码)
151
148
  git clone https://github.com/ScarletMercy/chcode.git
152
149
  cd chcode
153
- pip install -e .
150
+ pip install -e . # 或: uv sync && uv run chcode
154
151
  ```
155
152
 
156
153
  ### 运行
@@ -70,7 +70,7 @@ def _resolve_tools(
70
70
  ) -> list:
71
71
  result = []
72
72
  for t in all_tools:
73
- name = getattr(t, "name", None) or getattr(t, "func", {}).get("__name__", "")
73
+ name = getattr(t, "name", None) or getattr(getattr(t, "func", None), "__name__", "")
74
74
  if name == "agent":
75
75
  continue
76
76
  if name in agent_def.disallowed_tools:
@@ -89,7 +89,7 @@ async def run_subagent(
89
89
  skill_loader: SkillLoader,
90
90
  timeout_seconds: int = 300,
91
91
  description: str = "",
92
- ) -> str:
92
+ ) -> tuple[str, bool]:
93
93
  # 守卫:超时最小 300s
94
94
  timeout_seconds = max(timeout_seconds, 300)
95
95
  from chcode.utils.tools import ALL_TOOLS
@@ -142,11 +142,11 @@ async def run_subagent(
142
142
  timeout=timeout_seconds,
143
143
  )
144
144
  except asyncio.TimeoutError:
145
- return f"Agent {agent_def.agent_type} timed out after {timeout_seconds}s."
145
+ return f"Agent {agent_def.agent_type} timed out after {timeout_seconds}s.", True
146
146
  except ModelSwitchError:
147
- return f"Agent {agent_def.agent_type} 主模型失败,已切换备用模型,请重试"
147
+ return f"Agent {agent_def.agent_type} 主模型失败,已切换备用模型,请重试", True
148
148
  except Exception as e:
149
- return f"Agent {agent_def.agent_type} error: {e}"
149
+ return f"Agent {agent_def.agent_type} error: {e}", True
150
150
 
151
151
  from chcode.utils import get_text_content
152
152
  messages = result.get("messages", [])
@@ -154,6 +154,6 @@ async def run_subagent(
154
154
  if msg.type == "ai" and msg.content:
155
155
  content = get_text_content(msg.content)
156
156
  if content.strip():
157
- return content.strip()
157
+ return content.strip(), False
158
158
 
159
- return "(Agent completed with no text output)"
159
+ return "(Agent completed with no text output)", False