@scemoon/cdh 1.0.0 → 1.0.4

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 (147) hide show
  1. package/cdh/__pycache__/cli.cpython-314.pyc +0 -0
  2. package/cdh/__pycache__/scaffold.cpython-314.pyc +0 -0
  3. package/cdh/cli.py +473 -87
  4. package/cdh/scaffold.py +386 -121
  5. package/onecode/__pycache__/cli.cpython-314.pyc +0 -0
  6. package/onecode/__pycache__/commands.cpython-314.pyc +0 -0
  7. package/onecode/__pycache__/config.cpython-314.pyc +0 -0
  8. package/onecode/agent/__pycache__/cdh_loader.cpython-314.pyc +0 -0
  9. package/onecode/agent/__pycache__/engine.cpython-314.pyc +0 -0
  10. package/onecode/agent/__pycache__/onecode_agent_acp.cpython-314.pyc +0 -0
  11. package/onecode/agent/__pycache__/session.cpython-314.pyc +0 -0
  12. package/onecode/agent/agents/__pycache__/types.cpython-314.pyc +0 -0
  13. package/onecode/agent/agents/types.py +123 -79
  14. package/onecode/agent/cdh_loader.py +26 -13
  15. package/onecode/agent/engine.py +426 -235
  16. package/onecode/agent/onecode_agent_acp.py +202 -75
  17. package/onecode/agent/session.py +8 -13
  18. package/onecode/agent/tools/__pycache__/agent_tools.cpython-314.pyc +0 -0
  19. package/onecode/agent/tools/__pycache__/todo_tools.cpython-314.pyc +0 -0
  20. package/onecode/agent/tools/agent_tools.py +4 -4
  21. package/onecode/agent/tools/todo_tools.py +188 -0
  22. package/onecode/cli.py +3 -3
  23. package/onecode/commands.py +439 -194
  24. package/onecode/config.py +3 -3
  25. package/onecode/config_screen.py +4 -2
  26. package/onecode/models/__pycache__/errors.cpython-314.pyc +0 -0
  27. package/onecode/models/__pycache__/messages.cpython-314.pyc +0 -0
  28. package/onecode/models/__pycache__/provider.cpython-314.pyc +0 -0
  29. package/onecode/models/errors.py +11 -1
  30. package/onecode/models/messages.py +35 -16
  31. package/onecode/models/provider.py +243 -12
  32. package/onecode/models/providers/__pycache__/anthropic_provider.cpython-314.pyc +0 -0
  33. package/onecode/models/providers/__pycache__/deepseek_provider.cpython-314.pyc +0 -0
  34. package/onecode/models/providers/__pycache__/glm_provider.cpython-314.pyc +0 -0
  35. package/onecode/models/providers/__pycache__/minimax_provider.cpython-314.pyc +0 -0
  36. package/onecode/models/providers/__pycache__/minimaxi_provider.cpython-314.pyc +0 -0
  37. package/onecode/models/providers/__pycache__/ollama_provider.cpython-314.pyc +0 -0
  38. package/onecode/models/providers/__pycache__/openai_provider.cpython-314.pyc +0 -0
  39. package/onecode/models/providers/anthropic_provider.py +4 -2
  40. package/onecode/models/providers/deepseek_provider.py +2 -0
  41. package/onecode/models/providers/glm_provider.py +2 -1
  42. package/onecode/models/providers/minimax_provider.py +2 -1
  43. package/onecode/models/providers/minimaxi_provider.py +76 -25
  44. package/onecode/models/providers/ollama_provider.py +2 -1
  45. package/onecode/models/providers/openai_provider.py +4 -0
  46. package/onecode/tasks/manager.py +1 -1
  47. package/package.json +1 -1
  48. package/pyproject.toml +10 -0
  49. package/run.js +24 -7
  50. package/tui/__pycache__/agents.cpython-314.pyc +0 -0
  51. package/tui/__pycache__/app.cpython-314.pyc +0 -0
  52. package/tui/__pycache__/db.cpython-314.pyc +0 -0
  53. package/tui/__pycache__/directory_watcher.cpython-314.pyc +0 -0
  54. package/tui/__pycache__/messages.cpython-314.pyc +0 -0
  55. package/tui/__pycache__/paths.cpython-314.pyc +0 -0
  56. package/tui/__pycache__/settings_schema.cpython-314.pyc +0 -0
  57. package/tui/acp/__pycache__/agent.cpython-314.pyc +0 -0
  58. package/tui/acp/__pycache__/api.cpython-314.pyc +0 -0
  59. package/tui/acp/__pycache__/messages.cpython-314.pyc +0 -0
  60. package/tui/acp/__pycache__/prompt.cpython-314.pyc +0 -0
  61. package/tui/acp/__pycache__/protocol.cpython-314.pyc +0 -0
  62. package/tui/acp/agent.py +60 -11
  63. package/tui/acp/api.py +6 -0
  64. package/tui/acp/messages.py +11 -0
  65. package/tui/acp/prompt.py +1 -1
  66. package/tui/acp/protocol.py +31 -0
  67. package/tui/agents.py +8 -7
  68. package/tui/app.py +60 -8
  69. package/tui/data/agents/ampcode.com.toml +1 -0
  70. package/tui/data/agents/augmentcode.com.toml +1 -0
  71. package/tui/data/agents/cdh.cloud-dev-harness.toml +3 -2
  72. package/tui/data/agents/crowai.dev.toml +1 -0
  73. package/tui/data/agents/deepagents.langchain.com +1 -0
  74. package/tui/data/agents/docker.com.toml +1 -0
  75. package/tui/data/agents/goose.ai.toml +1 -0
  76. package/tui/data/agents/inference.huggingface.co.toml +1 -1
  77. package/tui/data/agents/kiro.dev.toml +1 -0
  78. package/tui/data/agents/onecode.dev.toml +22 -0
  79. package/tui/data/agents/openclaw.ai.toml +1 -1
  80. package/tui/data/agents/openhands.dev.toml +1 -0
  81. package/tui/data/agents/stakpak.dev.toml +1 -0
  82. package/tui/data/agents/vibe.mistral.ai.toml +1 -0
  83. package/tui/data/agents/vtcode.dev.toml +1 -0
  84. package/tui/db.py +23 -0
  85. package/tui/directory_watcher.py +35 -1
  86. package/tui/messages.py +4 -1
  87. package/tui/paths.py +3 -3
  88. package/tui/screens/__pycache__/main.cpython-314.pyc +0 -0
  89. package/tui/screens/component_picker.py +148 -0
  90. package/tui/screens/main.py +47 -95
  91. package/tui/screens/projects.tcss +10 -0
  92. package/tui/screens/projects_app.py +33 -5
  93. package/tui/screens/projects_screen.py +171 -9
  94. package/tui/screens/store.py +1 -1
  95. package/tui/settings_schema.py +1 -1
  96. package/tui/widgets/__pycache__/ask_user.cpython-314.pyc +0 -0
  97. package/tui/widgets/__pycache__/conversation.cpython-314.pyc +0 -0
  98. package/tui/widgets/__pycache__/modified_files.cpython-314.pyc +0 -0
  99. package/tui/widgets/__pycache__/plan.cpython-314.pyc +0 -0
  100. package/tui/widgets/__pycache__/project_directory_tree.cpython-314.pyc +0 -0
  101. package/tui/widgets/__pycache__/question.cpython-314.pyc +0 -0
  102. package/tui/widgets/__pycache__/subagent.cpython-314.pyc +0 -0
  103. package/tui/widgets/__pycache__/tool_call.cpython-314.pyc +0 -0
  104. package/tui/widgets/ask_user.py +1 -1
  105. package/tui/widgets/conversation.py +99 -42
  106. package/tui/widgets/modified_files.py +191 -65
  107. package/tui/widgets/plan.py +22 -0
  108. package/tui/widgets/project_directory_tree.py +22 -10
  109. package/tui/widgets/project_grid_select.py +23 -1
  110. package/tui/widgets/question.py +1 -1
  111. package/tui/widgets/subagent.py +202 -36
  112. package/tui/widgets/subagent_screen.py +186 -0
  113. package/tui/widgets/tool_call.py +5 -8
  114. package/cdh/__pycache__/__init__.cpython-313.pyc +0 -0
  115. package/cdh/__pycache__/scaffold.cpython-313.pyc +0 -0
  116. package/onecode/__pycache__/config_screen.cpython-314.pyc +0 -0
  117. package/onecode/__pycache__/mock_data.cpython-314.pyc +0 -0
  118. package/onecode/agent/__pycache__/cdh_agent_acp.cpython-313.pyc +0 -0
  119. package/onecode/agent/__pycache__/cdh_agent_acp.cpython-314.pyc +0 -0
  120. package/onecode/agent/__pycache__/harness_skill.cpython-314.pyc +0 -0
  121. package/onecode/agent/tools/__pycache__/task_tools.cpython-314.pyc +0 -0
  122. package/onecode/agent/tools/task_tools.py +0 -249
  123. package/onecode/codebase/__pycache__/config.cpython-314.pyc +0 -0
  124. package/onecode/models/providers/__pycache__/mock_provider.cpython-314.pyc +0 -0
  125. package/onecode/skills/__pycache__/manager.cpython-314.pyc +0 -0
  126. package/tui/__pycache__/danger.cpython-314.pyc +0 -0
  127. package/tui/__pycache__/directory_suggester.cpython-314.pyc +0 -0
  128. package/tui/screens/__pycache__/log.cpython-314.pyc +0 -0
  129. package/tui/screens/__pycache__/projects_screen.cpython-314.pyc +0 -0
  130. package/tui/screens/__pycache__/sessions.cpython-314.pyc +0 -0
  131. package/tui/screens/__pycache__/settings.cpython-314.pyc +0 -0
  132. package/tui/screens/__pycache__/store.cpython-314.pyc +0 -0
  133. package/tui/widgets/__pycache__/acp_content.cpython-314.pyc +0 -0
  134. package/tui/widgets/__pycache__/conversation.cpython-313.pyc +0 -0
  135. package/tui/widgets/__pycache__/diff_view.cpython-314.pyc +0 -0
  136. package/tui/widgets/__pycache__/directory_input.cpython-314.pyc +0 -0
  137. package/tui/widgets/__pycache__/future_text.cpython-314.pyc +0 -0
  138. package/tui/widgets/__pycache__/grid_select.cpython-314.pyc +0 -0
  139. package/tui/widgets/__pycache__/mandelbrot.cpython-314.pyc +0 -0
  140. package/tui/widgets/__pycache__/markdown_note.cpython-314.pyc +0 -0
  141. package/tui/widgets/__pycache__/project_grid_select.cpython-314.pyc +0 -0
  142. package/tui/widgets/__pycache__/project_summary.cpython-314.pyc +0 -0
  143. package/tui/widgets/__pycache__/session_grid_select.cpython-314.pyc +0 -0
  144. package/tui/widgets/__pycache__/session_summary.cpython-314.pyc +0 -0
  145. package/tui/widgets/__pycache__/shell_result.cpython-314.pyc +0 -0
  146. package/tui/widgets/__pycache__/terminal.cpython-313.pyc +0 -0
  147. package/tui/widgets/__pycache__/tool_call.cpython-313.pyc +0 -0
@@ -1,249 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import Any
4
-
5
- from onecode.agent.tools.protocol import ToolResult
6
- from onecode.agent.tools.registry import ToolSpec
7
-
8
-
9
- class TaskCreateTool:
10
- def __init__(self, task_manager):
11
- self._tm = task_manager
12
-
13
- def spec(self) -> ToolSpec:
14
- return ToolSpec(
15
- name="TaskCreate",
16
- description="Create a fine-grained task (1-3 tool calls each). For large work, split into multiple smaller tasks with dependencies. Returns task id.",
17
- input_schema={
18
- "type": "object",
19
- "properties": {
20
- "subject": {"type": "string", "description": "Short, action-oriented title (verb + noun, e.g. 'Create User model')"},
21
- "description": {"type": "string", "description": "What needs to be done + acceptance criteria"},
22
- "activeForm": {"type": "string", "description": "Active form description"},
23
- "metadata": {"type": "object", "description": 'Optional metadata. Supports priority (high/medium/low) and effort (small/medium/large)'},
24
- },
25
- "required": ["subject", "description"],
26
- },
27
- )
28
-
29
- def run(self, tool_input: dict[str, Any]) -> ToolResult:
30
- task = self._tm.create_task(
31
- subject=tool_input.get("subject", ""),
32
- description=tool_input.get("description", ""),
33
- active_form=tool_input.get("activeForm", ""),
34
- metadata=tool_input.get("metadata"),
35
- )
36
- return ToolResult(name="TaskCreate", output={"task": {"id": task["id"], "subject": task["subject"]}})
37
-
38
-
39
-
40
- class TaskGetTool:
41
- def __init__(self, task_manager):
42
- self._tm = task_manager
43
-
44
- def spec(self) -> ToolSpec:
45
- return ToolSpec(
46
- name="TaskGet",
47
- description="Retrieve a task by ID.",
48
- input_schema={
49
- "type": "object",
50
- "properties": {
51
- "taskId": {"type": "string", "description": "Task id to retrieve"},
52
- },
53
- "required": ["taskId"],
54
- },
55
- )
56
-
57
- def run(self, tool_input: dict[str, Any]) -> ToolResult:
58
- task_id = tool_input.get("taskId", "")
59
- task = self._tm.get_task(task_id)
60
- if task is None:
61
- return ToolResult(name="TaskGet", output={"task": None})
62
- info = {k: task[k] for k in ("id", "subject", "description", "status", "blocks", "blockedBy")}
63
- return ToolResult(name="TaskGet", output={"task": info})
64
-
65
-
66
-
67
- class TaskListTool:
68
- def __init__(self, task_manager):
69
- self._tm = task_manager
70
-
71
- def spec(self) -> ToolSpec:
72
- return ToolSpec(
73
- name="TaskList",
74
- description="List all tasks with their current status and dependencies.",
75
- input_schema={"type": "object", "properties": {}, "required": []},
76
- )
77
-
78
- def run(self, tool_input: dict[str, Any]) -> ToolResult:
79
- tasks = self._tm.list_tasks()
80
- if not tasks:
81
- return ToolResult(name="TaskList", output={"tasks": []})
82
- summaries = []
83
- for t in tasks:
84
- s = {"id": t["id"], "subject": t["subject"], "status": t["status"]}
85
- if t.get("owner"):
86
- s["owner"] = t["owner"]
87
- s["blockedBy"] = list(t.get("blockedBy") or [])
88
- summaries.append(s)
89
- return ToolResult(name="TaskList", output={"tasks": summaries})
90
-
91
-
92
-
93
- class TaskUpdateTool:
94
- def __init__(self, task_manager):
95
- self._tm = task_manager
96
-
97
- def spec(self) -> ToolSpec:
98
- return ToolSpec(
99
- name="TaskUpdate",
100
- description="Update a task: subject, description, status, owner, dependencies, output.",
101
- input_schema={
102
- "type": "object",
103
- "properties": {
104
- "taskId": {"type": "string", "description": "Task id to update"},
105
- "subject": {"type": "string"},
106
- "description": {"type": "string"},
107
- "activeForm": {"type": "string"},
108
- "status": {"type": "string", "description": "pending|in_progress|completed|deleted"},
109
- "owner": {"type": "string"},
110
- "addBlocks": {"type": "array", "items": {"type": "string"}, "description": "Task IDs this task blocks"},
111
- "addBlockedBy": {"type": "array", "items": {"type": "string"}, "description": "Task IDs that block this"},
112
- "metadata": {"type": "object"},
113
- "output": {"type": "string", "description": "Key results to pass to downstream tasks"},
114
- },
115
- "required": ["taskId"],
116
- },
117
- )
118
-
119
- def run(self, tool_input: dict[str, Any]) -> ToolResult:
120
- task_id = tool_input.get("taskId", "")
121
- updates = {k: v for k, v in tool_input.items() if k != "taskId" and v is not None}
122
- if "subject" not in updates and "title" in updates:
123
- updates["subject"] = updates.pop("title")
124
- if "addBlocks" not in updates and "blocks" in updates and isinstance(updates.get("blocks"), list):
125
- updates["addBlocks"] = updates.pop("blocks")
126
- result = self._tm.update_task(task_id, **updates)
127
- if result is None:
128
- return ToolResult(name="TaskUpdate", output={"success": False, "taskId": task_id, "error": "Task not found"}, is_error=True)
129
- if result.get("deleted"):
130
- return ToolResult(name="TaskUpdate", output={"success": True, "taskId": task_id, "updatedFields": ["deleted"]})
131
- return ToolResult(name="TaskUpdate", output={"success": True, "taskId": task_id, "task": {"id": result["id"], "subject": result["subject"], "status": result["status"]}})
132
-
133
-
134
-
135
- class TaskOutputTool:
136
- def __init__(self, task_manager):
137
- self._tm = task_manager
138
-
139
- def spec(self) -> ToolSpec:
140
- return ToolSpec(
141
- name="TaskOutput",
142
- description="Get output for a task.",
143
- input_schema={
144
- "type": "object",
145
- "properties": {
146
- "task_id": {"type": "string", "description": "Task id to get output for"},
147
- },
148
- "required": ["task_id"],
149
- },
150
- )
151
-
152
- def run(self, tool_input: dict[str, Any]) -> ToolResult:
153
- task_id = tool_input.get("task_id", "")
154
- result = self._tm.get_task_output(task_id)
155
- return ToolResult(name="TaskOutput", output=result)
156
-
157
-
158
-
159
- class TaskStopTool:
160
- def __init__(self, task_manager):
161
- self._tm = task_manager
162
-
163
- def spec(self) -> ToolSpec:
164
- return ToolSpec(
165
- name="TaskStop",
166
- description="Stop/cancel a running task.",
167
- input_schema={
168
- "type": "object",
169
- "properties": {
170
- "task_id": {"type": "string", "description": "Task id to stop"},
171
- },
172
- "required": ["task_id"],
173
- },
174
- )
175
-
176
- def run(self, tool_input: dict[str, Any]) -> ToolResult:
177
- task_id = tool_input.get("task_id", "")
178
- result = self._tm.update_task(task_id, status="completed")
179
- if result is None:
180
- return ToolResult(name="TaskStop", output={"success": False, "stopped": False, "error": "Task not found"}, is_error=True)
181
- if result.get("deleted"):
182
- return ToolResult(name="TaskStop", output={"success": True, "stopped": True, "task_id": task_id})
183
- return ToolResult(name="TaskStop", output={"success": True, "stopped": True, "task_id": task_id})
184
-
185
-
186
-
187
- class TodoCreateTool:
188
- def __init__(self, task_manager):
189
- self._tm = task_manager
190
-
191
- def spec(self) -> ToolSpec:
192
- return ToolSpec(
193
- name="TodoCreate",
194
- description="Create a todo item. Returns todo id.",
195
- input_schema={
196
- "type": "object",
197
- "properties": {
198
- "text": {"type": "string", "description": "Todo item text"},
199
- },
200
- "required": ["text"],
201
- },
202
- )
203
-
204
- def run(self, tool_input: dict[str, Any]) -> ToolResult:
205
- text = tool_input.get("text", "")
206
- todo_id = self._tm.add_todo(text)
207
- return ToolResult(name="TodoCreate", output={"id": todo_id, "text": text})
208
-
209
-
210
-
211
- class TodoListTool:
212
- def __init__(self, task_manager):
213
- self._tm = task_manager
214
-
215
- def spec(self) -> ToolSpec:
216
- return ToolSpec(
217
- name="TodoList",
218
- description="List all todo items.",
219
- input_schema={"type": "object", "properties": {}, "required": []},
220
- )
221
-
222
- def run(self, tool_input: dict[str, Any]) -> ToolResult:
223
- todos = self._tm.list_todos()
224
- return ToolResult(name="TodoList", output=todos)
225
-
226
-
227
-
228
- class TodoCompleteTool:
229
- def __init__(self, task_manager):
230
- self._tm = task_manager
231
-
232
- def spec(self) -> ToolSpec:
233
- return ToolSpec(
234
- name="TodoComplete",
235
- description="Mark a todo as completed.",
236
- input_schema={
237
- "type": "object",
238
- "properties": {
239
- "todo_id": {"type": "string", "description": "Todo id to complete"},
240
- },
241
- "required": ["todo_id"],
242
- },
243
- )
244
-
245
- def run(self, tool_input: dict[str, Any]) -> ToolResult:
246
- todo_id = tool_input.get("todo_id", tool_input.get("id", ""))
247
- ok = self._tm.complete_todo(str(todo_id))
248
- return ToolResult(name="TodoComplete", output={"success": ok, "todo_id": todo_id}, is_error=not ok)
249
-