tagword-codeagent 1.1.6__py3-none-any.whl

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 (173) hide show
  1. codeagent/__init__.py +10 -0
  2. codeagent/__main__.py +13 -0
  3. codeagent/cli/__init__.py +13 -0
  4. codeagent/cli/entrypoint.py +161 -0
  5. codeagent/cli/main.py +979 -0
  6. codeagent/core/__init__.py +2 -0
  7. codeagent/core/attachments.py +342 -0
  8. codeagent/core/audio_models.py +50 -0
  9. codeagent/core/bootstrap.py +178 -0
  10. codeagent/core/default_presets.py +159 -0
  11. codeagent/core/env.py +106 -0
  12. codeagent/core/folder_picker.py +151 -0
  13. codeagent/core/image_understanding.py +90 -0
  14. codeagent/core/models.py +6 -0
  15. codeagent/core/paths.py +238 -0
  16. codeagent/core/pricing.py +107 -0
  17. codeagent/core/process_ports.py +258 -0
  18. codeagent/core/seed_bridge.py +21 -0
  19. codeagent/core/settings.py +98 -0
  20. codeagent/core/speech_synth.py +330 -0
  21. codeagent/core/team_config.py +247 -0
  22. codeagent/core/team_manager.py +245 -0
  23. codeagent/core/token_counter.py +41 -0
  24. codeagent/core/tts_voices.py +103 -0
  25. codeagent/core/usage_billing.py +72 -0
  26. codeagent/core/vision_models.py +93 -0
  27. codeagent/memory/diary.py +144 -0
  28. codeagent/persona_defaults/README.md +12 -0
  29. codeagent/persona_defaults/agent.md +352 -0
  30. codeagent/persona_defaults/identity.md +29 -0
  31. codeagent/persona_defaults/memory.md +4 -0
  32. codeagent/persona_defaults/skills.md +325 -0
  33. codeagent/persona_defaults/soul.md +38 -0
  34. codeagent/persona_defaults/tools.md +41 -0
  35. codeagent/persona_defaults/user.md +18 -0
  36. codeagent/runtime/__init__.py +11 -0
  37. codeagent/runtime/agent_context.py +6 -0
  38. codeagent/runtime/agent_runtime.py +21 -0
  39. codeagent/runtime/compact_prompt.py +9 -0
  40. codeagent/runtime/compact_state.py +40 -0
  41. codeagent/runtime/llm_worker.py +132 -0
  42. codeagent/runtime/orchestrator.py +161 -0
  43. codeagent/runtime/prompt_enrichment.py +324 -0
  44. codeagent/runtime/session_manager.py +30 -0
  45. codeagent/runtime/task_split.py +38 -0
  46. codeagent/runtime/turn_loop.py +13 -0
  47. codeagent/runtime/worker.py +48 -0
  48. codeagent/server/__init__.py +505 -0
  49. codeagent/server/app_factory.py +1292 -0
  50. codeagent/server/attachment_api.py +261 -0
  51. codeagent/server/hub.py +175 -0
  52. codeagent/server/icon.png +0 -0
  53. codeagent/server/self_healing.py +143 -0
  54. codeagent/server/team_engine.py +243 -0
  55. codeagent/server/tts_api.py +51 -0
  56. codeagent/server/webui_api_app.py +3180 -0
  57. codeagent/skills/__init__.py +2 -0
  58. codeagent/skills/select.py +144 -0
  59. codeagent/tools/__init__.py +6 -0
  60. codeagent/tools/agent_tools.py +10 -0
  61. codeagent/web/__init__.py +1 -0
  62. codeagent/web/__pycache__/__init__.cpython-313.pyc +0 -0
  63. codeagent/web/__pycache__/app.cpython-313.pyc +0 -0
  64. codeagent/web/__pycache__/auth_impl.cpython-313.pyc +0 -0
  65. codeagent/web/auth_impl.py +326 -0
  66. codeagent/web/static/00-marked.min.js +6 -0
  67. codeagent/web/static/00-mermaid.min.js +2314 -0
  68. codeagent/web/static/00-purify.min.js +3 -0
  69. codeagent/web/static/00-storage.js +83 -0
  70. codeagent/web/static/00-utils.js +51 -0
  71. codeagent/web/static/01-theme.css +96 -0
  72. codeagent/web/static/01a-scroll.js +86 -0
  73. codeagent/web/static/01b-think.js +62 -0
  74. codeagent/web/static/01c-session-identity.js +81 -0
  75. codeagent/web/static/01c-session-thinking.js +61 -0
  76. codeagent/web/static/01c-session-tree-menus.js +349 -0
  77. codeagent/web/static/01c-session-tree.js +531 -0
  78. codeagent/web/static/01c-session-utilities.js +83 -0
  79. codeagent/web/static/01c-vision-model.js +132 -0
  80. codeagent/web/static/01d-image-gen-model.js +84 -0
  81. codeagent/web/static/01e-audio-model.js +97 -0
  82. codeagent/web/static/01f-compose-ui.js +88 -0
  83. codeagent/web/static/01g-tts-settings.js +128 -0
  84. codeagent/web/static/01h-music-model.js +85 -0
  85. codeagent/web/static/01i-model-stack.js +291 -0
  86. codeagent/web/static/01j-video-gen-model.js +85 -0
  87. codeagent/web/static/01k-model-stack-bootstrap.js +66 -0
  88. codeagent/web/static/01k-model-stack-state.js +209 -0
  89. codeagent/web/static/01q-inflight.js +195 -0
  90. codeagent/web/static/02-reset.css +22 -0
  91. codeagent/web/static/02-session-ui.js +201 -0
  92. codeagent/web/static/03-layout-p1.css +2 -0
  93. codeagent/web/static/03-layout-p2.css +2 -0
  94. codeagent/web/static/03a-links-stream.js +88 -0
  95. codeagent/web/static/03b-stream-text.js +119 -0
  96. codeagent/web/static/03c-render-bubble.js +520 -0
  97. codeagent/web/static/03d-agent-bubble.js +126 -0
  98. codeagent/web/static/03e-tool-trace.js +182 -0
  99. codeagent/web/static/03f-timeline.js +54 -0
  100. codeagent/web/static/03g-bubble-tts.js +292 -0
  101. codeagent/web/static/04-components-p1.css +1 -0
  102. codeagent/web/static/04-components-p2b.css +1 -0
  103. codeagent/web/static/04-components-p3.css +2 -0
  104. codeagent/web/static/04-components-p4.css +1 -0
  105. codeagent/web/static/04-components-p5.css +1 -0
  106. codeagent/web/static/04-components-p6.css +58 -0
  107. codeagent/web/static/04-components-p7.css +4 -0
  108. codeagent/web/static/04-components-p8.css +1 -0
  109. codeagent/web/static/04-components-p9.css +1 -0
  110. codeagent/web/static/04-ws-connect.js +351 -0
  111. codeagent/web/static/04-ws-helpers.js +116 -0
  112. codeagent/web/static/05-chat-p1.css +1058 -0
  113. codeagent/web/static/05-chat-p2.css +1 -0
  114. codeagent/web/static/05-chat-p3.css +295 -0
  115. codeagent/web/static/05a-session-history.js +176 -0
  116. codeagent/web/static/05b-session-list.js +114 -0
  117. codeagent/web/static/05c-dialog.js +123 -0
  118. codeagent/web/static/05d-project-create.js +172 -0
  119. codeagent/web/static/05e-project-remote.js +143 -0
  120. codeagent/web/static/06-chat.js +552 -0
  121. codeagent/web/static/06-utilities.css +181 -0
  122. codeagent/web/static/06b-attachments.js +304 -0
  123. codeagent/web/static/06c-camera.js +488 -0
  124. codeagent/web/static/07-activity-bar.css +127 -0
  125. codeagent/web/static/09-git-p1.css +1 -0
  126. codeagent/web/static/09-git-p2.css +1 -0
  127. codeagent/web/static/09a-init-bind.js +110 -0
  128. codeagent/web/static/09b-panel-toggle.js +80 -0
  129. codeagent/web/static/09c-api-refresh.js +100 -0
  130. codeagent/web/static/09d-status-log.js +80 -0
  131. codeagent/web/static/09e-commit.js +80 -0
  132. codeagent/web/static/09f-remote.js +93 -0
  133. codeagent/web/static/11a-cron-parse.js +117 -0
  134. codeagent/web/static/11b-cron-panel.js +100 -0
  135. codeagent/web/static/11c-cron-card.js +133 -0
  136. codeagent/web/static/11d-cron-form.js +105 -0
  137. codeagent/web/static/11e-env-config.js +168 -0
  138. codeagent/web/static/11f-env-llm-a-state.js +136 -0
  139. codeagent/web/static/11f-env-llm-b-form.js +409 -0
  140. codeagent/web/static/11f-env-llm-c-board.js +322 -0
  141. codeagent/web/static/11g-env-paths-git.js +973 -0
  142. codeagent/web/static/11h-env-mcp-a-state.js +161 -0
  143. codeagent/web/static/11h-env-mcp-b-form.js +229 -0
  144. codeagent/web/static/11h-env-mcp-c-board.js +565 -0
  145. codeagent/web/static/12-plugins.js +127 -0
  146. codeagent/web/static/13a-skills.js +156 -0
  147. codeagent/web/static/13a-todo-utils.js +140 -0
  148. codeagent/web/static/13b-todo-fetch.js +106 -0
  149. codeagent/web/static/13b-tools.js +127 -0
  150. codeagent/web/static/13c-todo-crud.js +92 -0
  151. codeagent/web/static/14-activity-bar.js +177 -0
  152. codeagent/web/static/15-plans.css +194 -0
  153. codeagent/web/static/15-plans.js +219 -0
  154. codeagent/web/static/16-mobile.css +612 -0
  155. codeagent/web/static/16-mobile.js +178 -0
  156. codeagent/web/static/17-preset-ux.css +287 -0
  157. codeagent/web/static/18-agent-mgr.css +616 -0
  158. codeagent/web/static/18-agent-mgr.js +204 -0
  159. codeagent/web/static/24-health-dashboard.js +68 -0
  160. codeagent/web/static/99-brand-polish.css +152 -0
  161. codeagent/web/static/body.html +824 -0
  162. codeagent/web/static/setup/setup_form.html +171 -0
  163. codeagent/web/static/setup/setup_head.html +100 -0
  164. codeagent/web/static/setup/setup_tail.html +264 -0
  165. codeagent/web/static/setup/setup_test.html +38 -0
  166. codeagent/web/web_login.html +265 -0
  167. codeagent/web/webui.html +35 -0
  168. tagword_codeagent-1.1.6.dist-info/METADATA +273 -0
  169. tagword_codeagent-1.1.6.dist-info/RECORD +173 -0
  170. tagword_codeagent-1.1.6.dist-info/WHEEL +5 -0
  171. tagword_codeagent-1.1.6.dist-info/entry_points.txt +3 -0
  172. tagword_codeagent-1.1.6.dist-info/licenses/LICENSE +21 -0
  173. tagword_codeagent-1.1.6.dist-info/top_level.txt +1 -0
codeagent/__init__.py ADDED
@@ -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
+
codeagent/__main__.py ADDED
@@ -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}")
@@ -0,0 +1,161 @@
1
+ """CodeAgent Main CLI Entry Point - Clean Implementation"""
2
+ import argparse
3
+ import sys
4
+ from datetime import datetime
5
+
6
+ from seed.core.persistence import ensure_session_dir, list_sessions, save_session
7
+ from seed.core.routing import find_commands, get_all_commands
8
+ from seed_tools import setup_builtin_tools
9
+
10
+ # Prefer ``python -m codeagent`` / ``codeagent.cli.main`` — kept for compatibility.
11
+
12
+
13
+ def main():
14
+ parser = argparse.ArgumentParser(
15
+ prog='codeagent',
16
+ description="CodeAgent: Autonomous agent for task execution with command routing and session management"
17
+ )
18
+ parser.add_argument('--version', '-v', action='version', version='CodeAgent v1.1.0')
19
+ subparsers = parser.add_subparsers(dest='command', help='Available commands')
20
+
21
+ # Run command
22
+ run = subparsers.add_parser('run', help='Run agent with prompt')
23
+ run.add_argument('prompt', nargs='?', default='', help='Prompt to execute')
24
+ run.add_argument('--max-turns', type=int, default=8)
25
+ run.add_argument('--budget', type=int, default=2000)
26
+ run.add_argument('--save', '-s', help="Save session ID")
27
+
28
+ # Route command
29
+ route = subparsers.add_parser('route', help='Find matching commands')
30
+ route.add_argument('prompt', help='Prompt to route')
31
+ route.add_argument('--limit', '-n', type=int, default=20)
32
+
33
+ # Commands command
34
+ cmds = subparsers.add_parser('commands', help='List all commands')
35
+ cmds.add_argument('--limit', '-n', type=int, default=50)
36
+ cmds.add_argument('--query', '-q', help='Filter by query')
37
+
38
+ # Tools command
39
+ tools = subparsers.add_parser('tools', help='List all tools')
40
+ tools.add_argument('--limit', '-n', type=int, default=50)
41
+
42
+ # Summary command
43
+ sum = subparsers.add_parser('summary', help='Show session summary')
44
+ sum.add_argument('--session', '-S', help='Session ID')
45
+
46
+ # Session command
47
+ sess = subparsers.add_parser('session', help='Manage sessions')
48
+ sess.add_argument('action', choices=['list', 'save', 'delete', 'help'])
49
+ sess.add_argument('session_id', nargs='?', help='Session ID')
50
+
51
+ if len(sys.argv) < 2:
52
+ parser.print_help()
53
+ return 0
54
+
55
+ args = parser.parse_args()
56
+
57
+ if not args.command:
58
+ parser.print_help()
59
+ return 0
60
+
61
+ cmd = getattr(args, 'command', None)
62
+ if cmd == 'run':
63
+ handle_run(args)
64
+ elif cmd == 'route':
65
+ handle_route(args)
66
+ elif cmd == 'commands':
67
+ handle_commands(args)
68
+ elif cmd == 'tools':
69
+ handle_tools(args)
70
+ elif cmd == 'summary':
71
+ handle_summary(args)
72
+ elif cmd == 'session':
73
+ handle_session(args)
74
+ return 0
75
+
76
+ def handle_run(args):
77
+ prompt = args.prompt
78
+ if not prompt:
79
+ print("Usage: codeagent run [options] <prompt>")
80
+ sys.exit(1)
81
+ ensure_session_dir()
82
+ session_id = args.save or f"agent-{datetime.now().strftime('%Y%m%d-%H%M%S')}"
83
+ matched = find_commands(prompt, limit=5)
84
+ matches = [m for m in matched if hasattr(m, 'name')]
85
+ print("=== CodeAgent Run Result")
86
+ print(f"Session ID: {session_id}")
87
+ print(f"Prompt: {prompt}")
88
+ print(f"Matched commands: {len(matches)}")
89
+ for c in matches:
90
+ if hasattr(c, 'name'):
91
+ desc = c.description if hasattr(c, 'description') else ""
92
+ print(f" - {c.name}: {desc}")
93
+ if args.save:
94
+ save_session(session_id, [prompt], 0, 0)
95
+ print(f"Session saved: ~/.codeagent/sessions/{session_id}.json")
96
+
97
+ def handle_route(args):
98
+ prompt = args.prompt
99
+ limit = args.limit
100
+ print("=== CodeAgent Route Result")
101
+ print(f"Query: {prompt}")
102
+ matched = find_commands(prompt, limit=limit)
103
+ print(f"Matches found: {len(matched)}")
104
+ for c in matched[:limit]:
105
+ name = c.name if hasattr(c, 'name') else repr(c)
106
+ desc = c.description if hasattr(c, 'description') else ""
107
+ print(f" - {name}: {desc}")
108
+
109
+ def handle_commands(args):
110
+ all_cmds = get_all_commands()
111
+ limit = args.limit or 50
112
+ result = all_cmds[:limit]
113
+ print("=== CodeAgent Commands")
114
+ print(f"Total commands: {len(result)}")
115
+ for c in result:
116
+ cat = getattr(c, 'category', 'default')
117
+ if hasattr(c, 'name'):
118
+ print(f" [{cat}] {c.name}")
119
+
120
+ def handle_tools(args):
121
+ registry, _executor = setup_builtin_tools()
122
+ tools = registry.list_all()
123
+ limit = args.limit or 50
124
+ print("=== CodeAgent Tools")
125
+ print(f"Total tools: {len(tools)}")
126
+ for t in tools[:limit]:
127
+ print(f" - [basic]: {t.name} - {t.description}")
128
+
129
+ def handle_summary(args):
130
+ session_id = getattr(args, 'session', None)
131
+ print("=== CodeAgent Session Summary")
132
+ sessions = list_sessions()
133
+ print("Sessions directory: ~/.codeagent/sessions/")
134
+ print(f"Found {len(sessions)} sessions")
135
+ if session_id:
136
+ print(f"Searched: {session_id}")
137
+
138
+ def handle_session(args):
139
+ action = args.action
140
+ session_id = args.session_id
141
+ if action == 'list':
142
+ sessions = list_sessions()
143
+ print("=== Session List")
144
+ print(f"Total: {len(sessions)}")
145
+ for s in sessions:
146
+ print(f" - {s}")
147
+ elif action == 'save' and session_id:
148
+ ensure_session_dir()
149
+ save_session(session_id, [], 0, 0)
150
+ print(f"Session saved: {session_id}")
151
+ elif action == 'delete' and session_id:
152
+ from seed.core.persistence import delete_session
153
+ if delete_session(session_id):
154
+ print(f"Deleted: {session_id}")
155
+ else:
156
+ print(f"Not found: {session_id}")
157
+ elif action == 'help':
158
+ print("Available actions: list, save, delete, help")
159
+
160
+ if __name__ == "__main__":
161
+ sys.exit(main() or 0)