ata-coder 2.4.2__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 (118) hide show
  1. ata_coder/__init__.py +1 -0
  2. ata_coder/agent.py +874 -0
  3. ata_coder/agent_compact.py +190 -0
  4. ata_coder/agent_controller.py +218 -0
  5. ata_coder/agent_extension.py +69 -0
  6. ata_coder/agent_routing.py +105 -0
  7. ata_coder/agent_subsystems.py +72 -0
  8. ata_coder/agent_tools.py +318 -0
  9. ata_coder/agent_undo.py +63 -0
  10. ata_coder/anthropic_client.py +465 -0
  11. ata_coder/change_tracker.py +368 -0
  12. ata_coder/clawd_integration.py +574 -0
  13. ata_coder/commands/__init__.py +128 -0
  14. ata_coder/commands/_core.py +184 -0
  15. ata_coder/commands/_safety.py +95 -0
  16. ata_coder/commands/_settings.py +241 -0
  17. ata_coder/commands/_workflow.py +451 -0
  18. ata_coder/commands.py +974 -0
  19. ata_coder/config.py +257 -0
  20. ata_coder/core/__init__.py +35 -0
  21. ata_coder/core/events.py +73 -0
  22. ata_coder/core/queue.py +85 -0
  23. ata_coder/core/state.py +17 -0
  24. ata_coder/event_queue.py +5 -0
  25. ata_coder/extension.py +654 -0
  26. ata_coder/extensions/__init__.py +1 -0
  27. ata_coder/extensions/hello_skill.py +47 -0
  28. ata_coder/fool_proof.py +295 -0
  29. ata_coder/git_workflow.py +371 -0
  30. ata_coder/gui.py +511 -0
  31. ata_coder/llm_client.py +543 -0
  32. ata_coder/main.py +814 -0
  33. ata_coder/mcp_client.py +1095 -0
  34. ata_coder/memory.py +539 -0
  35. ata_coder/model_registry.py +134 -0
  36. ata_coder/model_router.py +105 -0
  37. ata_coder/permissions.py +274 -0
  38. ata_coder/privilege.py +464 -0
  39. ata_coder/project.py +273 -0
  40. ata_coder/prompt_template.py +423 -0
  41. ata_coder/prompts/auto-mode.md +7 -0
  42. ata_coder/prompts/coding-rules.md +40 -0
  43. ata_coder/prompts/execution-guardrails.md +14 -0
  44. ata_coder/prompts/memory-system.md +24 -0
  45. ata_coder/prompts/output-style.md +23 -0
  46. ata_coder/prompts/safety.md +17 -0
  47. ata_coder/prompts/slash-commands.md +24 -0
  48. ata_coder/prompts/sub-agents.md +38 -0
  49. ata_coder/prompts/system-reminders.md +17 -0
  50. ata_coder/prompts/system.md +105 -0
  51. ata_coder/prompts/tool-policy.md +46 -0
  52. ata_coder/repl_theme.py +99 -0
  53. ata_coder/repl_tracker.py +89 -0
  54. ata_coder/repl_ui.py +1214 -0
  55. ata_coder/safety_guard.py +434 -0
  56. ata_coder/self_correct.py +346 -0
  57. ata_coder/server.py +882 -0
  58. ata_coder/server_session.py +159 -0
  59. ata_coder/server_shell.py +129 -0
  60. ata_coder/session.py +431 -0
  61. ata_coder/settings.py +439 -0
  62. ata_coder/setup_wizard.py +136 -0
  63. ata_coder/skill_extension.py +92 -0
  64. ata_coder/skills/architect/SKILL.md +42 -0
  65. ata_coder/skills/code-reviewer/SKILL.md +37 -0
  66. ata_coder/skills/codecraft/SKILL.md +452 -0
  67. ata_coder/skills/debugger/SKILL.md +45 -0
  68. ata_coder/skills/doc-writer/SKILL.md +36 -0
  69. ata_coder/skills/general-coder/SKILL.md +76 -0
  70. ata_coder/skills/math-calculator/README.md +40 -0
  71. ata_coder/skills/math-calculator/SKILL.md +59 -0
  72. ata_coder/skills/math-calculator/handler.py +103 -0
  73. ata_coder/skills/math-calculator/prompts/system.md +8 -0
  74. ata_coder/skills/math-calculator/requirements.txt +2 -0
  75. ata_coder/skills/math-calculator/resources/constants.json +8 -0
  76. ata_coder/skills/math-calculator/tests/test_handler.py +53 -0
  77. ata_coder/skills/security-auditor/SKILL.md +40 -0
  78. ata_coder/skills/test-writer/SKILL.md +36 -0
  79. ata_coder/skills/weather-skill/README.md +45 -0
  80. ata_coder/skills/weather-skill/handler.py +76 -0
  81. ata_coder/skills/weather-skill/manifest.json +48 -0
  82. ata_coder/skills/weather-skill/prompts/system_prompt.txt +9 -0
  83. ata_coder/skills/weather-skill/prompts/user_prompt_template.txt +3 -0
  84. ata_coder/skills/weather-skill/requirements.txt +1 -0
  85. ata_coder/skills/weather-skill/resources/city_list.json +17 -0
  86. ata_coder/skills/weather-skill/resources/error_messages.json +7 -0
  87. ata_coder/skills/weather-skill/tests/test_handler.py +28 -0
  88. ata_coder/skills/weather-skill/weather_utils.py +50 -0
  89. ata_coder/skills.py +1014 -0
  90. ata_coder/sub_agent.py +273 -0
  91. ata_coder/sub_agent_manager.py +203 -0
  92. ata_coder/system_prompt_builder.py +146 -0
  93. ata_coder/task_planner.py +391 -0
  94. ata_coder/terminal.py +318 -0
  95. ata_coder/test_runner.py +219 -0
  96. ata_coder/thread_supervisor.py +195 -0
  97. ata_coder/tool_defs.py +335 -0
  98. ata_coder/tools/__init__.py +11 -0
  99. ata_coder/tools/definitions.py +335 -0
  100. ata_coder/tools/executor.py +1036 -0
  101. ata_coder/tools/result.py +26 -0
  102. ata_coder/tools/subagent.py +332 -0
  103. ata_coder/tools/web.py +361 -0
  104. ata_coder/tools.py +1576 -0
  105. ata_coder/types.py +92 -0
  106. ata_coder/utils.py +113 -0
  107. ata_coder/web/css/style.css +180 -0
  108. ata_coder/web/index.html +84 -0
  109. ata_coder/web/js/app.js +489 -0
  110. ata_coder/web/package-lock.json +25 -0
  111. ata_coder/web/package.json +10 -0
  112. ata_coder/web/tsconfig.json +13 -0
  113. ata_coder-2.4.2.dist-info/METADATA +799 -0
  114. ata_coder-2.4.2.dist-info/RECORD +118 -0
  115. ata_coder-2.4.2.dist-info/WHEEL +5 -0
  116. ata_coder-2.4.2.dist-info/entry_points.txt +2 -0
  117. ata_coder-2.4.2.dist-info/licenses/LICENSE +21 -0
  118. ata_coder-2.4.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,335 @@
1
+ """Tool definitions (OpenAI function format)."""
2
+
3
+ TOOL_DEFINITIONS = [
4
+ {
5
+ "type": "function",
6
+ "function": {
7
+ "name": "read_file",
8
+ "description": "Read the contents of a file. Returns the file content with line numbers.",
9
+ "parameters": {
10
+ "type": "object",
11
+ "properties": {
12
+ "file_path": {
13
+ "type": "string",
14
+ "description": "The absolute or relative path to the file to read.",
15
+ },
16
+ "offset": {
17
+ "type": "integer",
18
+ "description": "Line number to start reading from (1-based).",
19
+ },
20
+ "limit": {
21
+ "type": "integer",
22
+ "description": "Maximum number of lines to read.",
23
+ },
24
+ },
25
+ "required": ["file_path"],
26
+ },
27
+ },
28
+ },
29
+ {
30
+ "type": "function",
31
+ "function": {
32
+ "name": "write_file",
33
+ "description": "Write content to a file. Creates the file if it doesn't exist, overwrites if it does.",
34
+ "parameters": {
35
+ "type": "object",
36
+ "properties": {
37
+ "file_path": {
38
+ "type": "string",
39
+ "description": "The absolute or relative path to the file to write.",
40
+ },
41
+ "content": {
42
+ "type": "string",
43
+ "description": "The content to write to the file.",
44
+ },
45
+ },
46
+ "required": ["file_path", "content"],
47
+ },
48
+ },
49
+ },
50
+ {
51
+ "type": "function",
52
+ "function": {
53
+ "name": "edit_file",
54
+ "description": "Perform exact string replacement in a file. The old_string must match exactly (including whitespace/indentation) and be unique in the file.",
55
+ "parameters": {
56
+ "type": "object",
57
+ "properties": {
58
+ "file_path": {
59
+ "type": "string",
60
+ "description": "The absolute or relative path to the file to edit.",
61
+ },
62
+ "old_string": {
63
+ "type": "string",
64
+ "description": "The exact text to find and replace.",
65
+ },
66
+ "new_string": {
67
+ "type": "string",
68
+ "description": "The text to replace it with.",
69
+ },
70
+ },
71
+ "required": ["file_path", "old_string", "new_string"],
72
+ },
73
+ },
74
+ },
75
+ {
76
+ "type": "function",
77
+ "function": {
78
+ "name": "rename_symbol",
79
+ "description": "Safely rename a Python symbol (function, class, variable) — updates definition and all references, skipping comments and strings. Uses AST-aware matching.",
80
+ "parameters": {
81
+ "type": "object",
82
+ "properties": {
83
+ "file_path": {
84
+ "type": "string",
85
+ "description": "The absolute or relative path to the Python file.",
86
+ },
87
+ "old_name": {
88
+ "type": "string",
89
+ "description": "Current symbol name to rename.",
90
+ },
91
+ "new_name": {
92
+ "type": "string",
93
+ "description": "New symbol name.",
94
+ },
95
+ "symbol_type": {
96
+ "type": "string",
97
+ "enum": ["function", "class", "variable", "method"],
98
+ "description": "Type of symbol being renamed.",
99
+ },
100
+ },
101
+ "required": ["file_path", "old_name", "new_name"],
102
+ },
103
+ },
104
+ },
105
+ {
106
+ "type": "function",
107
+ "function": {
108
+ "name": "run_shell",
109
+ "description": "Execute a shell command and return stdout/stderr. Use for build, test, lint, git, and other development commands.",
110
+ "parameters": {
111
+ "type": "object",
112
+ "properties": {
113
+ "command": {
114
+ "type": "string",
115
+ "description": "The shell command to execute.",
116
+ },
117
+ "timeout": {
118
+ "type": "integer",
119
+ "description": "Timeout in seconds (default: 120).",
120
+ },
121
+ },
122
+ "required": ["command"],
123
+ },
124
+ },
125
+ },
126
+ {
127
+ "type": "function",
128
+ "function": {
129
+ "name": "grep",
130
+ "description": "Search file contents using regular expressions. Returns matching files and lines.",
131
+ "parameters": {
132
+ "type": "object",
133
+ "properties": {
134
+ "pattern": {
135
+ "type": "string",
136
+ "description": "The regex pattern to search for.",
137
+ },
138
+ "path": {
139
+ "type": "string",
140
+ "description": "Directory or file to search in. Defaults to current directory.",
141
+ },
142
+ "glob": {
143
+ "type": "string",
144
+ "description": "Filter files by glob pattern (e.g. '*.py', 'src/**/*.ts').",
145
+ },
146
+ "case_sensitive": {
147
+ "type": "boolean",
148
+ "description": "Whether search is case-sensitive (default: false).",
149
+ },
150
+ },
151
+ "required": ["pattern"],
152
+ },
153
+ },
154
+ },
155
+ {
156
+ "type": "function",
157
+ "function": {
158
+ "name": "glob",
159
+ "description": "Find files matching a glob pattern. Returns sorted list of matching file paths.",
160
+ "parameters": {
161
+ "type": "object",
162
+ "properties": {
163
+ "pattern": {
164
+ "type": "string",
165
+ "description": "Glob pattern to match (e.g. '**/*.py', 'src/**/*.ts').",
166
+ },
167
+ "path": {
168
+ "type": "string",
169
+ "description": "Directory to search in. Defaults to current directory.",
170
+ },
171
+ },
172
+ "required": ["pattern"],
173
+ },
174
+ },
175
+ },
176
+ {
177
+ "type": "function",
178
+ "function": {
179
+ "name": "list_dir",
180
+ "description": "List contents of a directory with file types and sizes.",
181
+ "parameters": {
182
+ "type": "object",
183
+ "properties": {
184
+ "path": {
185
+ "type": "string",
186
+ "description": "Directory path to list. Defaults to current directory.",
187
+ },
188
+ "recursive": {
189
+ "type": "boolean",
190
+ "description": "Whether to list recursively (default: false).",
191
+ },
192
+ },
193
+ },
194
+ },
195
+ },
196
+ {
197
+ "type": "function",
198
+ "function": {
199
+ "name": "web_search",
200
+ "description": "Search the web with tiered fallback: Bing → Baidu → Google (no API key required). Returns titles, URLs, and snippets. Use when you need up-to-date information beyond your knowledge cutoff.",
201
+ "parameters": {
202
+ "type": "object",
203
+ "properties": {
204
+ "query": {
205
+ "type": "string",
206
+ "description": "The search query.",
207
+ },
208
+ "max_results": {
209
+ "type": "integer",
210
+ "description": "Maximum number of results (default: 10, max: 20).",
211
+ },
212
+ },
213
+ "required": ["query"],
214
+ },
215
+ },
216
+ },
217
+ {
218
+ "type": "function",
219
+ "function": {
220
+ "name": "web_fetch",
221
+ "description": "Fetch a web page and extract its text content. Strips HTML/scripts/CSS, returns plain text. Use after web_search to read the full content of a result. Caps at 15,000 characters.",
222
+ "parameters": {
223
+ "type": "object",
224
+ "properties": {
225
+ "url": {
226
+ "type": "string",
227
+ "description": "The URL to fetch (must be a full http/https URL).",
228
+ },
229
+ },
230
+ "required": ["url"],
231
+ },
232
+ },
233
+ },
234
+ {
235
+ "type": "function",
236
+ "function": {
237
+ "name": "spawn_subagent",
238
+ "description": "Spawn a sub-agent to work on a task in parallel. The sub-agent runs in a background thread with its own isolated context window (no access to the main conversation history). Use for parallel searches, independent analysis, or delegating self-contained work. Returns immediately with the agent ID — use collect_subagent to get results. Max 5 concurrent sub-agents.",
239
+ "parameters": {
240
+ "type": "object",
241
+ "properties": {
242
+ "task": {
243
+ "type": "string",
244
+ "description": "The task to delegate. Must be self-contained — the sub-agent has NO context from the main conversation. Be specific about what to do and what format to return results in.",
245
+ },
246
+ "skill": {
247
+ "type": "string",
248
+ "description": "Optional skill name for the sub-agent (e.g., 'code-reviewer', 'debugger', 'test-writer').",
249
+ },
250
+ "model": {
251
+ "type": "string",
252
+ "description": "Optional model override for the sub-agent. Use a cheaper/faster model for simple tasks.",
253
+ },
254
+ },
255
+ "required": ["task"],
256
+ },
257
+ },
258
+ },
259
+ {
260
+ "type": "function",
261
+ "function": {
262
+ "name": "collect_subagent",
263
+ "description": "Collect results from a previously spawned sub-agent. Blocks until the sub-agent completes or times out. The sub-agent's full message history is available in the result for context injection.",
264
+ "parameters": {
265
+ "type": "object",
266
+ "properties": {
267
+ "agent_id": {
268
+ "type": "string",
269
+ "description": "The agent ID returned by spawn_subagent.",
270
+ },
271
+ "timeout": {
272
+ "type": "number",
273
+ "description": "Max wait time in seconds (default: 300).",
274
+ },
275
+ },
276
+ "required": ["agent_id"],
277
+ },
278
+ },
279
+ },
280
+ {
281
+ "type": "function",
282
+ "function": {
283
+ "name": "list_subagents",
284
+ "description": "List all sub-agents and their statuses (running, done, failed, cancelled). Use to check on spawned sub-agents.",
285
+ "parameters": {
286
+ "type": "object",
287
+ "properties": {},
288
+ },
289
+ },
290
+ },
291
+ {
292
+ "type": "function",
293
+ "function": {
294
+ "name": "mcp_search",
295
+ "description": "Search MCP (Model Context Protocol) tools and resources across all connected servers. Use this to find available MCP tools by keyword, or discover MCP resources (files, data, APIs) exposed by connected servers.",
296
+ "parameters": {
297
+ "type": "object",
298
+ "properties": {
299
+ "query": {
300
+ "type": "string",
301
+ "description": "Search keyword. Matches against MCP tool names, descriptions, and resource URIs.",
302
+ },
303
+ "type": {
304
+ "type": "string",
305
+ "enum": ["tools", "resources", "all"],
306
+ "description": "What to search: 'tools' (default), 'resources', or 'all'.",
307
+ },
308
+ },
309
+ "required": ["query"],
310
+ },
311
+ },
312
+ },
313
+ {
314
+ "type": "function",
315
+ "function": {
316
+ "name": "analyze_image",
317
+ "description": "Analyze an image using a multimodal vision model. The vision provider is configured via VISION_MODEL / VISION_API_BASE / VISION_API_KEY environment variables (falls back to the main API config). Pass the path to an image file (PNG, JPG, GIF, WEBP) and a prompt describing what to look for. Returns a text description of the image content. Use this to read screenshots, photos, diagrams, charts, or any visual content.",
318
+ "parameters": {
319
+ "type": "object",
320
+ "properties": {
321
+ "image_path": {
322
+ "type": "string",
323
+ "description": "Absolute path to the image file to analyze.",
324
+ },
325
+ "prompt": {
326
+ "type": "string",
327
+ "description": "What to look for in the image. Be specific: 'Describe all UI elements in this screenshot', 'What text is visible?', 'Describe this diagram'.",
328
+ },
329
+ },
330
+ "required": ["image_path"],
331
+ },
332
+ },
333
+ },
334
+ ]
335
+