tagword-codeagent 1.1.6__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 (178) hide show
  1. tagword_codeagent-1.1.6/LICENSE +21 -0
  2. tagword_codeagent-1.1.6/PKG-INFO +273 -0
  3. tagword_codeagent-1.1.6/README.md +246 -0
  4. tagword_codeagent-1.1.6/codeagent/__init__.py +10 -0
  5. tagword_codeagent-1.1.6/codeagent/__main__.py +13 -0
  6. tagword_codeagent-1.1.6/codeagent/cli/__init__.py +13 -0
  7. tagword_codeagent-1.1.6/codeagent/cli/entrypoint.py +161 -0
  8. tagword_codeagent-1.1.6/codeagent/cli/main.py +979 -0
  9. tagword_codeagent-1.1.6/codeagent/core/__init__.py +2 -0
  10. tagword_codeagent-1.1.6/codeagent/core/attachments.py +342 -0
  11. tagword_codeagent-1.1.6/codeagent/core/audio_models.py +50 -0
  12. tagword_codeagent-1.1.6/codeagent/core/bootstrap.py +178 -0
  13. tagword_codeagent-1.1.6/codeagent/core/default_presets.py +159 -0
  14. tagword_codeagent-1.1.6/codeagent/core/env.py +106 -0
  15. tagword_codeagent-1.1.6/codeagent/core/folder_picker.py +151 -0
  16. tagword_codeagent-1.1.6/codeagent/core/image_understanding.py +90 -0
  17. tagword_codeagent-1.1.6/codeagent/core/models.py +6 -0
  18. tagword_codeagent-1.1.6/codeagent/core/paths.py +238 -0
  19. tagword_codeagent-1.1.6/codeagent/core/pricing.py +107 -0
  20. tagword_codeagent-1.1.6/codeagent/core/process_ports.py +258 -0
  21. tagword_codeagent-1.1.6/codeagent/core/seed_bridge.py +21 -0
  22. tagword_codeagent-1.1.6/codeagent/core/settings.py +98 -0
  23. tagword_codeagent-1.1.6/codeagent/core/speech_synth.py +330 -0
  24. tagword_codeagent-1.1.6/codeagent/core/team_config.py +247 -0
  25. tagword_codeagent-1.1.6/codeagent/core/team_manager.py +245 -0
  26. tagword_codeagent-1.1.6/codeagent/core/token_counter.py +41 -0
  27. tagword_codeagent-1.1.6/codeagent/core/tts_voices.py +103 -0
  28. tagword_codeagent-1.1.6/codeagent/core/usage_billing.py +72 -0
  29. tagword_codeagent-1.1.6/codeagent/core/vision_models.py +93 -0
  30. tagword_codeagent-1.1.6/codeagent/memory/diary.py +144 -0
  31. tagword_codeagent-1.1.6/codeagent/persona_defaults/README.md +12 -0
  32. tagword_codeagent-1.1.6/codeagent/persona_defaults/agent.md +352 -0
  33. tagword_codeagent-1.1.6/codeagent/persona_defaults/identity.md +29 -0
  34. tagword_codeagent-1.1.6/codeagent/persona_defaults/memory.md +4 -0
  35. tagword_codeagent-1.1.6/codeagent/persona_defaults/skills.md +325 -0
  36. tagword_codeagent-1.1.6/codeagent/persona_defaults/soul.md +38 -0
  37. tagword_codeagent-1.1.6/codeagent/persona_defaults/tools.md +41 -0
  38. tagword_codeagent-1.1.6/codeagent/persona_defaults/user.md +18 -0
  39. tagword_codeagent-1.1.6/codeagent/runtime/__init__.py +11 -0
  40. tagword_codeagent-1.1.6/codeagent/runtime/agent_context.py +6 -0
  41. tagword_codeagent-1.1.6/codeagent/runtime/agent_runtime.py +21 -0
  42. tagword_codeagent-1.1.6/codeagent/runtime/compact_prompt.py +9 -0
  43. tagword_codeagent-1.1.6/codeagent/runtime/compact_state.py +40 -0
  44. tagword_codeagent-1.1.6/codeagent/runtime/llm_worker.py +132 -0
  45. tagword_codeagent-1.1.6/codeagent/runtime/orchestrator.py +161 -0
  46. tagword_codeagent-1.1.6/codeagent/runtime/prompt_enrichment.py +324 -0
  47. tagword_codeagent-1.1.6/codeagent/runtime/session_manager.py +30 -0
  48. tagword_codeagent-1.1.6/codeagent/runtime/task_split.py +38 -0
  49. tagword_codeagent-1.1.6/codeagent/runtime/turn_loop.py +13 -0
  50. tagword_codeagent-1.1.6/codeagent/runtime/worker.py +48 -0
  51. tagword_codeagent-1.1.6/codeagent/server/__init__.py +505 -0
  52. tagword_codeagent-1.1.6/codeagent/server/app_factory.py +1292 -0
  53. tagword_codeagent-1.1.6/codeagent/server/attachment_api.py +261 -0
  54. tagword_codeagent-1.1.6/codeagent/server/hub.py +175 -0
  55. tagword_codeagent-1.1.6/codeagent/server/icon.png +0 -0
  56. tagword_codeagent-1.1.6/codeagent/server/self_healing.py +143 -0
  57. tagword_codeagent-1.1.6/codeagent/server/team_engine.py +243 -0
  58. tagword_codeagent-1.1.6/codeagent/server/tts_api.py +51 -0
  59. tagword_codeagent-1.1.6/codeagent/server/webui_api_app.py +3180 -0
  60. tagword_codeagent-1.1.6/codeagent/skills/__init__.py +2 -0
  61. tagword_codeagent-1.1.6/codeagent/skills/select.py +144 -0
  62. tagword_codeagent-1.1.6/codeagent/tools/__init__.py +6 -0
  63. tagword_codeagent-1.1.6/codeagent/tools/agent_tools.py +10 -0
  64. tagword_codeagent-1.1.6/codeagent/web/__init__.py +1 -0
  65. tagword_codeagent-1.1.6/codeagent/web/__pycache__/__init__.cpython-313.pyc +0 -0
  66. tagword_codeagent-1.1.6/codeagent/web/__pycache__/app.cpython-313.pyc +0 -0
  67. tagword_codeagent-1.1.6/codeagent/web/__pycache__/auth_impl.cpython-313.pyc +0 -0
  68. tagword_codeagent-1.1.6/codeagent/web/auth_impl.py +326 -0
  69. tagword_codeagent-1.1.6/codeagent/web/static/00-marked.min.js +6 -0
  70. tagword_codeagent-1.1.6/codeagent/web/static/00-mermaid.min.js +2314 -0
  71. tagword_codeagent-1.1.6/codeagent/web/static/00-purify.min.js +3 -0
  72. tagword_codeagent-1.1.6/codeagent/web/static/00-storage.js +83 -0
  73. tagword_codeagent-1.1.6/codeagent/web/static/00-utils.js +51 -0
  74. tagword_codeagent-1.1.6/codeagent/web/static/01-theme.css +96 -0
  75. tagword_codeagent-1.1.6/codeagent/web/static/01a-scroll.js +86 -0
  76. tagword_codeagent-1.1.6/codeagent/web/static/01b-think.js +62 -0
  77. tagword_codeagent-1.1.6/codeagent/web/static/01c-session-identity.js +81 -0
  78. tagword_codeagent-1.1.6/codeagent/web/static/01c-session-thinking.js +61 -0
  79. tagword_codeagent-1.1.6/codeagent/web/static/01c-session-tree-menus.js +349 -0
  80. tagword_codeagent-1.1.6/codeagent/web/static/01c-session-tree.js +531 -0
  81. tagword_codeagent-1.1.6/codeagent/web/static/01c-session-utilities.js +83 -0
  82. tagword_codeagent-1.1.6/codeagent/web/static/01c-vision-model.js +132 -0
  83. tagword_codeagent-1.1.6/codeagent/web/static/01d-image-gen-model.js +84 -0
  84. tagword_codeagent-1.1.6/codeagent/web/static/01e-audio-model.js +97 -0
  85. tagword_codeagent-1.1.6/codeagent/web/static/01f-compose-ui.js +88 -0
  86. tagword_codeagent-1.1.6/codeagent/web/static/01g-tts-settings.js +128 -0
  87. tagword_codeagent-1.1.6/codeagent/web/static/01h-music-model.js +85 -0
  88. tagword_codeagent-1.1.6/codeagent/web/static/01i-model-stack.js +291 -0
  89. tagword_codeagent-1.1.6/codeagent/web/static/01j-video-gen-model.js +85 -0
  90. tagword_codeagent-1.1.6/codeagent/web/static/01k-model-stack-bootstrap.js +66 -0
  91. tagword_codeagent-1.1.6/codeagent/web/static/01k-model-stack-state.js +209 -0
  92. tagword_codeagent-1.1.6/codeagent/web/static/01q-inflight.js +195 -0
  93. tagword_codeagent-1.1.6/codeagent/web/static/02-reset.css +22 -0
  94. tagword_codeagent-1.1.6/codeagent/web/static/02-session-ui.js +201 -0
  95. tagword_codeagent-1.1.6/codeagent/web/static/03-layout-p1.css +2 -0
  96. tagword_codeagent-1.1.6/codeagent/web/static/03-layout-p2.css +2 -0
  97. tagword_codeagent-1.1.6/codeagent/web/static/03a-links-stream.js +88 -0
  98. tagword_codeagent-1.1.6/codeagent/web/static/03b-stream-text.js +119 -0
  99. tagword_codeagent-1.1.6/codeagent/web/static/03c-render-bubble.js +520 -0
  100. tagword_codeagent-1.1.6/codeagent/web/static/03d-agent-bubble.js +126 -0
  101. tagword_codeagent-1.1.6/codeagent/web/static/03e-tool-trace.js +182 -0
  102. tagword_codeagent-1.1.6/codeagent/web/static/03f-timeline.js +54 -0
  103. tagword_codeagent-1.1.6/codeagent/web/static/03g-bubble-tts.js +292 -0
  104. tagword_codeagent-1.1.6/codeagent/web/static/04-components-p1.css +1 -0
  105. tagword_codeagent-1.1.6/codeagent/web/static/04-components-p2b.css +1 -0
  106. tagword_codeagent-1.1.6/codeagent/web/static/04-components-p3.css +2 -0
  107. tagword_codeagent-1.1.6/codeagent/web/static/04-components-p4.css +1 -0
  108. tagword_codeagent-1.1.6/codeagent/web/static/04-components-p5.css +1 -0
  109. tagword_codeagent-1.1.6/codeagent/web/static/04-components-p6.css +58 -0
  110. tagword_codeagent-1.1.6/codeagent/web/static/04-components-p7.css +4 -0
  111. tagword_codeagent-1.1.6/codeagent/web/static/04-components-p8.css +1 -0
  112. tagword_codeagent-1.1.6/codeagent/web/static/04-components-p9.css +1 -0
  113. tagword_codeagent-1.1.6/codeagent/web/static/04-ws-connect.js +351 -0
  114. tagword_codeagent-1.1.6/codeagent/web/static/04-ws-helpers.js +116 -0
  115. tagword_codeagent-1.1.6/codeagent/web/static/05-chat-p1.css +1058 -0
  116. tagword_codeagent-1.1.6/codeagent/web/static/05-chat-p2.css +1 -0
  117. tagword_codeagent-1.1.6/codeagent/web/static/05-chat-p3.css +295 -0
  118. tagword_codeagent-1.1.6/codeagent/web/static/05a-session-history.js +176 -0
  119. tagword_codeagent-1.1.6/codeagent/web/static/05b-session-list.js +114 -0
  120. tagword_codeagent-1.1.6/codeagent/web/static/05c-dialog.js +123 -0
  121. tagword_codeagent-1.1.6/codeagent/web/static/05d-project-create.js +172 -0
  122. tagword_codeagent-1.1.6/codeagent/web/static/05e-project-remote.js +143 -0
  123. tagword_codeagent-1.1.6/codeagent/web/static/06-chat.js +552 -0
  124. tagword_codeagent-1.1.6/codeagent/web/static/06-utilities.css +181 -0
  125. tagword_codeagent-1.1.6/codeagent/web/static/06b-attachments.js +304 -0
  126. tagword_codeagent-1.1.6/codeagent/web/static/06c-camera.js +488 -0
  127. tagword_codeagent-1.1.6/codeagent/web/static/07-activity-bar.css +127 -0
  128. tagword_codeagent-1.1.6/codeagent/web/static/09-git-p1.css +1 -0
  129. tagword_codeagent-1.1.6/codeagent/web/static/09-git-p2.css +1 -0
  130. tagword_codeagent-1.1.6/codeagent/web/static/09a-init-bind.js +110 -0
  131. tagword_codeagent-1.1.6/codeagent/web/static/09b-panel-toggle.js +80 -0
  132. tagword_codeagent-1.1.6/codeagent/web/static/09c-api-refresh.js +100 -0
  133. tagword_codeagent-1.1.6/codeagent/web/static/09d-status-log.js +80 -0
  134. tagword_codeagent-1.1.6/codeagent/web/static/09e-commit.js +80 -0
  135. tagword_codeagent-1.1.6/codeagent/web/static/09f-remote.js +93 -0
  136. tagword_codeagent-1.1.6/codeagent/web/static/11a-cron-parse.js +117 -0
  137. tagword_codeagent-1.1.6/codeagent/web/static/11b-cron-panel.js +100 -0
  138. tagword_codeagent-1.1.6/codeagent/web/static/11c-cron-card.js +133 -0
  139. tagword_codeagent-1.1.6/codeagent/web/static/11d-cron-form.js +105 -0
  140. tagword_codeagent-1.1.6/codeagent/web/static/11e-env-config.js +168 -0
  141. tagword_codeagent-1.1.6/codeagent/web/static/11f-env-llm-a-state.js +136 -0
  142. tagword_codeagent-1.1.6/codeagent/web/static/11f-env-llm-b-form.js +409 -0
  143. tagword_codeagent-1.1.6/codeagent/web/static/11f-env-llm-c-board.js +322 -0
  144. tagword_codeagent-1.1.6/codeagent/web/static/11g-env-paths-git.js +973 -0
  145. tagword_codeagent-1.1.6/codeagent/web/static/11h-env-mcp-a-state.js +161 -0
  146. tagword_codeagent-1.1.6/codeagent/web/static/11h-env-mcp-b-form.js +229 -0
  147. tagword_codeagent-1.1.6/codeagent/web/static/11h-env-mcp-c-board.js +565 -0
  148. tagword_codeagent-1.1.6/codeagent/web/static/12-plugins.js +127 -0
  149. tagword_codeagent-1.1.6/codeagent/web/static/13a-skills.js +156 -0
  150. tagword_codeagent-1.1.6/codeagent/web/static/13a-todo-utils.js +140 -0
  151. tagword_codeagent-1.1.6/codeagent/web/static/13b-todo-fetch.js +106 -0
  152. tagword_codeagent-1.1.6/codeagent/web/static/13b-tools.js +127 -0
  153. tagword_codeagent-1.1.6/codeagent/web/static/13c-todo-crud.js +92 -0
  154. tagword_codeagent-1.1.6/codeagent/web/static/14-activity-bar.js +177 -0
  155. tagword_codeagent-1.1.6/codeagent/web/static/15-plans.css +194 -0
  156. tagword_codeagent-1.1.6/codeagent/web/static/15-plans.js +219 -0
  157. tagword_codeagent-1.1.6/codeagent/web/static/16-mobile.css +612 -0
  158. tagword_codeagent-1.1.6/codeagent/web/static/16-mobile.js +178 -0
  159. tagword_codeagent-1.1.6/codeagent/web/static/17-preset-ux.css +287 -0
  160. tagword_codeagent-1.1.6/codeagent/web/static/18-agent-mgr.css +616 -0
  161. tagword_codeagent-1.1.6/codeagent/web/static/18-agent-mgr.js +204 -0
  162. tagword_codeagent-1.1.6/codeagent/web/static/24-health-dashboard.js +68 -0
  163. tagword_codeagent-1.1.6/codeagent/web/static/99-brand-polish.css +152 -0
  164. tagword_codeagent-1.1.6/codeagent/web/static/body.html +824 -0
  165. tagword_codeagent-1.1.6/codeagent/web/static/setup/setup_form.html +171 -0
  166. tagword_codeagent-1.1.6/codeagent/web/static/setup/setup_head.html +100 -0
  167. tagword_codeagent-1.1.6/codeagent/web/static/setup/setup_tail.html +264 -0
  168. tagword_codeagent-1.1.6/codeagent/web/static/setup/setup_test.html +38 -0
  169. tagword_codeagent-1.1.6/codeagent/web/web_login.html +265 -0
  170. tagword_codeagent-1.1.6/codeagent/web/webui.html +35 -0
  171. tagword_codeagent-1.1.6/pyproject.toml +84 -0
  172. tagword_codeagent-1.1.6/setup.cfg +4 -0
  173. tagword_codeagent-1.1.6/tagword_codeagent.egg-info/PKG-INFO +273 -0
  174. tagword_codeagent-1.1.6/tagword_codeagent.egg-info/SOURCES.txt +176 -0
  175. tagword_codeagent-1.1.6/tagword_codeagent.egg-info/dependency_links.txt +1 -0
  176. tagword_codeagent-1.1.6/tagword_codeagent.egg-info/entry_points.txt +3 -0
  177. tagword_codeagent-1.1.6/tagword_codeagent.egg-info/requires.txt +22 -0
  178. tagword_codeagent-1.1.6/tagword_codeagent.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 tagword
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,273 @@
1
+ Metadata-Version: 2.4
2
+ Name: tagword-codeagent
3
+ Version: 1.1.6
4
+ Summary: LLM agent with Markdown config, tool loop, Web UI, sessions, memory, and webhooks
5
+ License: MIT
6
+ Requires-Python: >=3.9
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: seed-kernel
10
+ Requires-Dist: seed-model-providers
11
+ Requires-Dist: seed-toolbox[code]
12
+ Requires-Dist: uvicorn[standard]>=0.30.0
13
+ Requires-Dist: starlette>=0.37.0
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest>=7.0; extra == "dev"
16
+ Provides-Extra: lint
17
+ Requires-Dist: pre-commit>=3.0; extra == "lint"
18
+ Provides-Extra: yaml
19
+ Requires-Dist: pyyaml>=6.0; extra == "yaml"
20
+ Provides-Extra: vision
21
+ Requires-Dist: pypdf>=4.0; extra == "vision"
22
+ Provides-Extra: bundle
23
+ Requires-Dist: rumps>=0.4.0; extra == "bundle"
24
+ Requires-Dist: pyinstaller>=6.0; extra == "bundle"
25
+ Requires-Dist: pillow>=10.0; extra == "bundle"
26
+ Dynamic: license-file
27
+
28
+ # CodeAgent
29
+
30
+ 一个**自主全栈开发 Agent** — 用 Markdown 配置文件驱动人格与行为,支持 Web UI,开箱即用。
31
+
32
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
33
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](pyproject.toml)
34
+
35
+ ---
36
+
37
+ ## 概览
38
+
39
+ CodeAgent 是一个**自主全栈开发 Agent** —— 它能独立承接从需求分析到交付维护的完整项目周期。由 Markdown 配置文件(`agent.md`、`soul.md`、`skills.md` 等)定义人格与行为规则,配合强大的工具系统,实现最小人工干预下的自动化开发。
40
+
41
+ ### 架构分层
42
+
43
+ ```
44
+ ┌─────────────────────────────────────────────────┐
45
+ │ CodeAgent(本仓库) │
46
+ │ CLI · HTTP/WebSocket · Web UI · 认证 · Agent 层 │
47
+ ├─────────────────────────────────────────────────┤
48
+ │ seed 核心引擎(LLM/路由/会话) │
49
+ │ seed-tools[code] 内置工具注册与执行 │
50
+ │ seed-model-providers 模型提供商目录(tokenizer)│
51
+ └─────────────────────────────────────────────────┘
52
+ ```
53
+
54
+ ### 核心特性
55
+
56
+ - 🧠 **LLM 驱动** — 支持 OpenAI、Anthropic、DeepSeek、本地模型等多种后端
57
+ - 📜 **人格即配置** — 用 Markdown 定义 Agent 的身份、行为准则、技能,无需改代码
58
+ - 🛠️ **工具系统** — 45+ 内置工具:文件操作、Shell 执行、代码分析、Git 管理、数据库、部署
59
+ - 🌐 **Web UI v2** — 现代化 React + Vite 前端,可视化聊天、工具调用链、会话历史
60
+ - 📋 **项目管控** — 内置待办管理、项目规划(docs/plans 面板)、版本追踪
61
+ - 🔌 **可扩展** — 自定义工具、Webhook、多 Agent 协作(Multi-Agent Hub)
62
+ - 🧩 **多步工作流** — 内置 fix-and-commit、new-feature、audit-project 等自动化流水线
63
+ - 🌍 **国内友好** — 自动检测国内网络,使用 PyPI 镜像(清华源)加速安装
64
+
65
+ ## 快速开始
66
+
67
+ ### ⭐ 一键运行(强烈推荐)
68
+
69
+ ```bash
70
+ # 克隆仓库
71
+ git clone https://github.com/tagword/codeagent.git
72
+ cd codeagent
73
+
74
+ # 一键运行(自动检测环境、安装依赖、启动服务)
75
+ bash run.sh
76
+ ```
77
+
78
+ 脚本会自动:
79
+ 1. 检测 Python(≥ 3.9)和 Git
80
+ 2. **自动识别国内网络** → 使用清华 PyPI 镜像加速
81
+ 3. 创建虚拟环境 `.venv`
82
+ 4. 安装 CodeAgent 及全部依赖(含私有 seed 框架)
83
+ 5. 构建 Web UI v2 前端(如有 Node.js)
84
+ 6. 启动 Web 服务 → 浏览器打开 `http://localhost:8765`
85
+
86
+ > 💡 支持自定义参数:`bash run.sh --port 8766 --host 0.0.0.0`
87
+ > 💡 `run.sh` 内置了网络重试和 tarball 降级机制,网络不稳定时比 `pip install -e .` 更可靠
88
+
89
+ ### 一键安装
90
+
91
+ ```bash
92
+ curl -fsSL https://raw.githubusercontent.com/tagword/codeagent/main/install.sh | bash
93
+ ```
94
+
95
+ 安装完成后:
96
+
97
+ ```bash
98
+ cd ~/codeagent
99
+ bash run.sh
100
+ ```
101
+
102
+ ### 手动安装
103
+
104
+ > ⚠️ CodeAgent 依赖的 `seed` / `seed-model-providers` / `seed-tools` 是**私有包**(不在 PyPI 上),
105
+ > pyproject.toml 使用 `git+https` 自动从 GitHub 拉取。确保已安装 **Git** 且有**网络连接**。
106
+
107
+ ```bash
108
+ # 克隆仓库
109
+ git clone https://github.com/tagword/codeagent.git
110
+ cd codeagent
111
+
112
+ # 创建虚拟环境
113
+ python -m venv .venv
114
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
115
+
116
+ # 安装(自动从 GitHub 拉取 seed 私有依赖)
117
+ pip install -e .
118
+
119
+ # 启动
120
+ codeagent serve
121
+ ```
122
+
123
+ 浏览器打开 `http://localhost:8765` 即可使用。
124
+
125
+ ### 国内用户加速
126
+
127
+ 脚本会自动检测网络环境,如直连 PyPI 超时则自动切换至清华镜像源。也可手动指定:
128
+
129
+ ```bash
130
+ pip install -e . -i https://pypi.tuna.tsinghua.edu.cn/simple
131
+
132
+ # npm 前端构建(可选)
133
+ cd webui-v2
134
+ npm install --registry=https://registry.npmmirror.com
135
+ npm run build
136
+ ```
137
+
138
+ ### 命令行使用
139
+
140
+ ```bash
141
+ # 查看帮助
142
+ codeagent --help
143
+
144
+ # 启动交互式聊天(LLM + 工具循环)
145
+ codeagent chat --llm
146
+
147
+ # 运行单次任务
148
+ codeagent run "帮我整理当前目录的文件结构"
149
+
150
+ # 管理 Web UI 令牌
151
+ codeagent webui-token init
152
+ codeagent webui-token show
153
+ codeagent webui-token reset
154
+
155
+ # 重启服务
156
+ codeagent restart serve --port 8765
157
+ ```
158
+
159
+ ## 配置
160
+
161
+ ### 首次初始化
162
+
163
+ ```bash
164
+ codeagent config init
165
+ ```
166
+
167
+ 会生成默认配置文件到 `config/` 目录。
168
+
169
+ ### 环境变量
170
+
171
+ 编辑 `config/env`(参考 `config/env.example`),核心配置项:
172
+
173
+ | 配置项 | 说明 |
174
+ |--------|------|
175
+ | `CODEAGENT_PROVIDER` | LLM 提供商(openai / deepseek / anthropic 等) |
176
+ | `CODEAGENT_API_KEY` | API 密钥 |
177
+ | `CODEAGENT_MODEL` | 模型名称 |
178
+ | `CODEAGENT_BASE_URL` | API 端点地址 |
179
+ | `CODEAGENT_AGENT_ID` | 当前 Agent 标识(默认 `default`) |
180
+
181
+ 详细环境变量清单见 [docs/ENV_REFERENCE.md](docs/ENV_REFERENCE.md)。
182
+
183
+ ### Web UI 认证
184
+
185
+ ```bash
186
+ codeagent webui-token init # 生成访问令牌
187
+ codeagent webui-token show # 查看当前令牌
188
+ ```
189
+
190
+ 启动服务后访问 `http://localhost:8765`,输入令牌即可登录。
191
+
192
+ ## 项目结构
193
+
194
+ ```
195
+ codeagent/
196
+ ├── codeagent/ # 核心源码
197
+ │ ├── cli/main.py # 命令行入口
198
+ │ ├── core/ # 核心模块(bootstrap / env / attachments 等)
199
+ │ ├── server/ # HTTP / WebSocket 服务
200
+ │ │ ├── webui_api_app.py # WebUI REST API
201
+ │ │ ├── app_factory.py # Starlette 应用工厂
202
+ │ │ └── ...
203
+ │ ├── web/ # Web 认证与路由
204
+ │ └── webui/ # 内置 Web UI(Vue 版,v1 兼容)
205
+ ├── webui-v2/ # Web UI v2(React + Vite + TypeScript)
206
+ │ ├── src/ # 前端源码
207
+ │ ├── dist/ # 构建产物
208
+ │ └── package.json
209
+ ├── agents/ # Agent 人格配置
210
+ │ ├── default/ # 默认 Agent(agent.md / soul.md / skills.md)
211
+ │ └── test_agent/
212
+ ├── config/ # 运行时配置
213
+ │ ├── env # 环境变量(本地,不提交)
214
+ │ ├── env.example # 环境变量模板
215
+ │ └── codeagent.setup.json
216
+ ├── docs/ # 开发文档与参考
217
+ │ ├── ENV_REFERENCE.md # 完整环境变量手册
218
+ │ ├── AGNES_API.md # API 文档
219
+ │ ├── CONTEXT_COMPACT.md # 上下文压缩机制
220
+ │ └── ...
221
+ ├── skills/ # 可复用的技能定义
222
+ ├── tests/ # 测试
223
+ ├── deploy/ # 部署配置(supervisord)
224
+ ├── run.sh # ★ 一键运行脚本(推荐)
225
+ ├── install.sh # 一键安装脚本
226
+ ├── pyproject.toml # 项目元数据与依赖
227
+ └── README.md
228
+ ```
229
+
230
+ ## Web UI v2
231
+
232
+ 基于 **React 19 + Vite + TypeScript + Tailwind v4** 的现代化前端。
233
+
234
+ ```bash
235
+ cd webui-v2
236
+ npm install
237
+ npm run dev # 开发模式
238
+ npm run build # 生产构建
239
+ ```
240
+
241
+ 也可通过 `run.sh` 或 `codeagent serve` 自动 serve 构建产物。
242
+
243
+ ## 技术栈
244
+
245
+ | 层 | 技术 |
246
+ |----|------|
247
+ | **核心引擎** | seed (LLM 调用 / 路由 / 会话 / 工具运行时) |
248
+ | **后端服务** | Python 3.9+ / Starlette / WebSocket / Uvicorn |
249
+ | **前端 v2** | React 19 / TypeScript / Vite / Tailwind v4 |
250
+ | **前端 v1** | Vanilla JS + CSS(无框架,内置兜底) |
251
+ | **LLM 集成** | OpenAI / Anthropic / DeepSeek / Ollama / 兼容 API |
252
+ | **工具系统** | 异步工具调度 + 安全检查 + 沙箱 |
253
+ | **数据存储** | SQLite(会话 / 记忆 / 项目状态) |
254
+
255
+ ## 开发
256
+
257
+ ```bash
258
+ # 安装开发依赖
259
+ pip install -e '.[dev]'
260
+
261
+ # 运行测试
262
+ pytest
263
+
264
+ # 代码检查
265
+ ruff check codeagent/
266
+
267
+ # 安全审计
268
+ bandit -r codeagent/
269
+ ```
270
+
271
+ ## 许可证
272
+
273
+ [MIT](LICENSE) © 2025 tagword
@@ -0,0 +1,246 @@
1
+ # CodeAgent
2
+
3
+ 一个**自主全栈开发 Agent** — 用 Markdown 配置文件驱动人格与行为,支持 Web UI,开箱即用。
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](pyproject.toml)
7
+
8
+ ---
9
+
10
+ ## 概览
11
+
12
+ CodeAgent 是一个**自主全栈开发 Agent** —— 它能独立承接从需求分析到交付维护的完整项目周期。由 Markdown 配置文件(`agent.md`、`soul.md`、`skills.md` 等)定义人格与行为规则,配合强大的工具系统,实现最小人工干预下的自动化开发。
13
+
14
+ ### 架构分层
15
+
16
+ ```
17
+ ┌─────────────────────────────────────────────────┐
18
+ │ CodeAgent(本仓库) │
19
+ │ CLI · HTTP/WebSocket · Web UI · 认证 · Agent 层 │
20
+ ├─────────────────────────────────────────────────┤
21
+ │ seed 核心引擎(LLM/路由/会话) │
22
+ │ seed-tools[code] 内置工具注册与执行 │
23
+ │ seed-model-providers 模型提供商目录(tokenizer)│
24
+ └─────────────────────────────────────────────────┘
25
+ ```
26
+
27
+ ### 核心特性
28
+
29
+ - 🧠 **LLM 驱动** — 支持 OpenAI、Anthropic、DeepSeek、本地模型等多种后端
30
+ - 📜 **人格即配置** — 用 Markdown 定义 Agent 的身份、行为准则、技能,无需改代码
31
+ - 🛠️ **工具系统** — 45+ 内置工具:文件操作、Shell 执行、代码分析、Git 管理、数据库、部署
32
+ - 🌐 **Web UI v2** — 现代化 React + Vite 前端,可视化聊天、工具调用链、会话历史
33
+ - 📋 **项目管控** — 内置待办管理、项目规划(docs/plans 面板)、版本追踪
34
+ - 🔌 **可扩展** — 自定义工具、Webhook、多 Agent 协作(Multi-Agent Hub)
35
+ - 🧩 **多步工作流** — 内置 fix-and-commit、new-feature、audit-project 等自动化流水线
36
+ - 🌍 **国内友好** — 自动检测国内网络,使用 PyPI 镜像(清华源)加速安装
37
+
38
+ ## 快速开始
39
+
40
+ ### ⭐ 一键运行(强烈推荐)
41
+
42
+ ```bash
43
+ # 克隆仓库
44
+ git clone https://github.com/tagword/codeagent.git
45
+ cd codeagent
46
+
47
+ # 一键运行(自动检测环境、安装依赖、启动服务)
48
+ bash run.sh
49
+ ```
50
+
51
+ 脚本会自动:
52
+ 1. 检测 Python(≥ 3.9)和 Git
53
+ 2. **自动识别国内网络** → 使用清华 PyPI 镜像加速
54
+ 3. 创建虚拟环境 `.venv`
55
+ 4. 安装 CodeAgent 及全部依赖(含私有 seed 框架)
56
+ 5. 构建 Web UI v2 前端(如有 Node.js)
57
+ 6. 启动 Web 服务 → 浏览器打开 `http://localhost:8765`
58
+
59
+ > 💡 支持自定义参数:`bash run.sh --port 8766 --host 0.0.0.0`
60
+ > 💡 `run.sh` 内置了网络重试和 tarball 降级机制,网络不稳定时比 `pip install -e .` 更可靠
61
+
62
+ ### 一键安装
63
+
64
+ ```bash
65
+ curl -fsSL https://raw.githubusercontent.com/tagword/codeagent/main/install.sh | bash
66
+ ```
67
+
68
+ 安装完成后:
69
+
70
+ ```bash
71
+ cd ~/codeagent
72
+ bash run.sh
73
+ ```
74
+
75
+ ### 手动安装
76
+
77
+ > ⚠️ CodeAgent 依赖的 `seed` / `seed-model-providers` / `seed-tools` 是**私有包**(不在 PyPI 上),
78
+ > pyproject.toml 使用 `git+https` 自动从 GitHub 拉取。确保已安装 **Git** 且有**网络连接**。
79
+
80
+ ```bash
81
+ # 克隆仓库
82
+ git clone https://github.com/tagword/codeagent.git
83
+ cd codeagent
84
+
85
+ # 创建虚拟环境
86
+ python -m venv .venv
87
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
88
+
89
+ # 安装(自动从 GitHub 拉取 seed 私有依赖)
90
+ pip install -e .
91
+
92
+ # 启动
93
+ codeagent serve
94
+ ```
95
+
96
+ 浏览器打开 `http://localhost:8765` 即可使用。
97
+
98
+ ### 国内用户加速
99
+
100
+ 脚本会自动检测网络环境,如直连 PyPI 超时则自动切换至清华镜像源。也可手动指定:
101
+
102
+ ```bash
103
+ pip install -e . -i https://pypi.tuna.tsinghua.edu.cn/simple
104
+
105
+ # npm 前端构建(可选)
106
+ cd webui-v2
107
+ npm install --registry=https://registry.npmmirror.com
108
+ npm run build
109
+ ```
110
+
111
+ ### 命令行使用
112
+
113
+ ```bash
114
+ # 查看帮助
115
+ codeagent --help
116
+
117
+ # 启动交互式聊天(LLM + 工具循环)
118
+ codeagent chat --llm
119
+
120
+ # 运行单次任务
121
+ codeagent run "帮我整理当前目录的文件结构"
122
+
123
+ # 管理 Web UI 令牌
124
+ codeagent webui-token init
125
+ codeagent webui-token show
126
+ codeagent webui-token reset
127
+
128
+ # 重启服务
129
+ codeagent restart serve --port 8765
130
+ ```
131
+
132
+ ## 配置
133
+
134
+ ### 首次初始化
135
+
136
+ ```bash
137
+ codeagent config init
138
+ ```
139
+
140
+ 会生成默认配置文件到 `config/` 目录。
141
+
142
+ ### 环境变量
143
+
144
+ 编辑 `config/env`(参考 `config/env.example`),核心配置项:
145
+
146
+ | 配置项 | 说明 |
147
+ |--------|------|
148
+ | `CODEAGENT_PROVIDER` | LLM 提供商(openai / deepseek / anthropic 等) |
149
+ | `CODEAGENT_API_KEY` | API 密钥 |
150
+ | `CODEAGENT_MODEL` | 模型名称 |
151
+ | `CODEAGENT_BASE_URL` | API 端点地址 |
152
+ | `CODEAGENT_AGENT_ID` | 当前 Agent 标识(默认 `default`) |
153
+
154
+ 详细环境变量清单见 [docs/ENV_REFERENCE.md](docs/ENV_REFERENCE.md)。
155
+
156
+ ### Web UI 认证
157
+
158
+ ```bash
159
+ codeagent webui-token init # 生成访问令牌
160
+ codeagent webui-token show # 查看当前令牌
161
+ ```
162
+
163
+ 启动服务后访问 `http://localhost:8765`,输入令牌即可登录。
164
+
165
+ ## 项目结构
166
+
167
+ ```
168
+ codeagent/
169
+ ├── codeagent/ # 核心源码
170
+ │ ├── cli/main.py # 命令行入口
171
+ │ ├── core/ # 核心模块(bootstrap / env / attachments 等)
172
+ │ ├── server/ # HTTP / WebSocket 服务
173
+ │ │ ├── webui_api_app.py # WebUI REST API
174
+ │ │ ├── app_factory.py # Starlette 应用工厂
175
+ │ │ └── ...
176
+ │ ├── web/ # Web 认证与路由
177
+ │ └── webui/ # 内置 Web UI(Vue 版,v1 兼容)
178
+ ├── webui-v2/ # Web UI v2(React + Vite + TypeScript)
179
+ │ ├── src/ # 前端源码
180
+ │ ├── dist/ # 构建产物
181
+ │ └── package.json
182
+ ├── agents/ # Agent 人格配置
183
+ │ ├── default/ # 默认 Agent(agent.md / soul.md / skills.md)
184
+ │ └── test_agent/
185
+ ├── config/ # 运行时配置
186
+ │ ├── env # 环境变量(本地,不提交)
187
+ │ ├── env.example # 环境变量模板
188
+ │ └── codeagent.setup.json
189
+ ├── docs/ # 开发文档与参考
190
+ │ ├── ENV_REFERENCE.md # 完整环境变量手册
191
+ │ ├── AGNES_API.md # API 文档
192
+ │ ├── CONTEXT_COMPACT.md # 上下文压缩机制
193
+ │ └── ...
194
+ ├── skills/ # 可复用的技能定义
195
+ ├── tests/ # 测试
196
+ ├── deploy/ # 部署配置(supervisord)
197
+ ├── run.sh # ★ 一键运行脚本(推荐)
198
+ ├── install.sh # 一键安装脚本
199
+ ├── pyproject.toml # 项目元数据与依赖
200
+ └── README.md
201
+ ```
202
+
203
+ ## Web UI v2
204
+
205
+ 基于 **React 19 + Vite + TypeScript + Tailwind v4** 的现代化前端。
206
+
207
+ ```bash
208
+ cd webui-v2
209
+ npm install
210
+ npm run dev # 开发模式
211
+ npm run build # 生产构建
212
+ ```
213
+
214
+ 也可通过 `run.sh` 或 `codeagent serve` 自动 serve 构建产物。
215
+
216
+ ## 技术栈
217
+
218
+ | 层 | 技术 |
219
+ |----|------|
220
+ | **核心引擎** | seed (LLM 调用 / 路由 / 会话 / 工具运行时) |
221
+ | **后端服务** | Python 3.9+ / Starlette / WebSocket / Uvicorn |
222
+ | **前端 v2** | React 19 / TypeScript / Vite / Tailwind v4 |
223
+ | **前端 v1** | Vanilla JS + CSS(无框架,内置兜底) |
224
+ | **LLM 集成** | OpenAI / Anthropic / DeepSeek / Ollama / 兼容 API |
225
+ | **工具系统** | 异步工具调度 + 安全检查 + 沙箱 |
226
+ | **数据存储** | SQLite(会话 / 记忆 / 项目状态) |
227
+
228
+ ## 开发
229
+
230
+ ```bash
231
+ # 安装开发依赖
232
+ pip install -e '.[dev]'
233
+
234
+ # 运行测试
235
+ pytest
236
+
237
+ # 代码检查
238
+ ruff check codeagent/
239
+
240
+ # 安全审计
241
+ bandit -r codeagent/
242
+ ```
243
+
244
+ ## 许可证
245
+
246
+ [MIT](LICENSE) © 2025 tagword
@@ -0,0 +1,10 @@
1
+ """
2
+ CodeAgent — Personality layer
3
+
4
+ Architecture:
5
+ - seed/ : Core engine (LLM execution, tool system, session management)
6
+ - codeagent/ : Personality layer (CLI, server, web UI, skills, per-agent config)
7
+ """
8
+
9
+ __version__ = "1.1.2"
10
+
@@ -0,0 +1,13 @@
1
+ """Allow ``python -m codeagent`` from the repository root."""
2
+ import os
3
+ import sys
4
+
5
+ # Ensure repo root is on sys.path.
6
+ repo_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
7
+ if repo_root not in sys.path:
8
+ sys.path.insert(0, repo_root)
9
+
10
+ from codeagent.cli.main import main # noqa: E402
11
+
12
+ if __name__ == "__main__":
13
+ main()
@@ -0,0 +1,13 @@
1
+ """CLI package. Lazy-export ``main`` so ``python -m codeagent.cli.main`` does not pre-load the module."""
2
+
3
+ from __future__ import annotations
4
+
5
+ __all__ = ("main",)
6
+
7
+
8
+ def __getattr__(name: str):
9
+ if name == "main":
10
+ from .main import main as _main
11
+
12
+ return _main
13
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")