agentpool 2.1.9__py3-none-any.whl → 2.5.0__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.
- acp/__init__.py +13 -4
- acp/acp_requests.py +20 -77
- acp/agent/connection.py +8 -0
- acp/agent/implementations/debug_server/debug_server.py +6 -2
- acp/agent/protocol.py +6 -0
- acp/bridge/README.md +15 -2
- acp/bridge/__init__.py +3 -2
- acp/bridge/__main__.py +60 -19
- acp/bridge/ws_server.py +173 -0
- acp/bridge/ws_server_cli.py +89 -0
- acp/client/connection.py +38 -29
- acp/client/implementations/default_client.py +3 -2
- acp/client/implementations/headless_client.py +2 -2
- acp/connection.py +2 -2
- acp/notifications.py +20 -50
- acp/schema/__init__.py +2 -0
- acp/schema/agent_responses.py +21 -0
- acp/schema/client_requests.py +3 -3
- acp/schema/session_state.py +63 -29
- acp/stdio.py +39 -9
- acp/task/supervisor.py +2 -2
- acp/transports.py +362 -2
- acp/utils.py +17 -4
- agentpool/__init__.py +6 -1
- agentpool/agents/__init__.py +2 -0
- agentpool/agents/acp_agent/acp_agent.py +407 -277
- agentpool/agents/acp_agent/acp_converters.py +196 -38
- agentpool/agents/acp_agent/client_handler.py +191 -26
- agentpool/agents/acp_agent/session_state.py +17 -6
- agentpool/agents/agent.py +607 -572
- agentpool/agents/agui_agent/__init__.py +0 -2
- agentpool/agents/agui_agent/agui_agent.py +176 -110
- agentpool/agents/agui_agent/agui_converters.py +0 -131
- agentpool/agents/agui_agent/helpers.py +3 -4
- agentpool/agents/base_agent.py +632 -17
- agentpool/agents/claude_code_agent/FORKING.md +191 -0
- agentpool/agents/claude_code_agent/__init__.py +13 -1
- agentpool/agents/claude_code_agent/claude_code_agent.py +1058 -291
- agentpool/agents/claude_code_agent/converters.py +74 -143
- agentpool/agents/claude_code_agent/history.py +474 -0
- agentpool/agents/claude_code_agent/models.py +77 -0
- agentpool/agents/claude_code_agent/static_info.py +100 -0
- agentpool/agents/claude_code_agent/usage.py +242 -0
- agentpool/agents/context.py +40 -0
- agentpool/agents/events/__init__.py +24 -0
- agentpool/agents/events/builtin_handlers.py +67 -1
- agentpool/agents/events/event_emitter.py +32 -2
- agentpool/agents/events/events.py +104 -3
- agentpool/agents/events/infer_info.py +145 -0
- agentpool/agents/events/processors.py +254 -0
- agentpool/agents/interactions.py +41 -6
- agentpool/agents/modes.py +67 -0
- agentpool/agents/slashed_agent.py +5 -4
- agentpool/agents/tool_call_accumulator.py +213 -0
- agentpool/agents/tool_wrapping.py +18 -6
- agentpool/common_types.py +56 -21
- agentpool/config_resources/__init__.py +38 -1
- agentpool/config_resources/acp_assistant.yml +2 -2
- agentpool/config_resources/agents.yml +3 -0
- agentpool/config_resources/agents_template.yml +1 -0
- agentpool/config_resources/claude_code_agent.yml +10 -6
- agentpool/config_resources/external_acp_agents.yml +2 -1
- agentpool/delegation/base_team.py +4 -30
- agentpool/delegation/pool.py +136 -289
- agentpool/delegation/team.py +58 -57
- agentpool/delegation/teamrun.py +51 -55
- agentpool/diagnostics/__init__.py +53 -0
- agentpool/diagnostics/lsp_manager.py +1593 -0
- agentpool/diagnostics/lsp_proxy.py +41 -0
- agentpool/diagnostics/lsp_proxy_script.py +229 -0
- agentpool/diagnostics/models.py +398 -0
- agentpool/functional/run.py +10 -4
- agentpool/mcp_server/__init__.py +0 -2
- agentpool/mcp_server/client.py +76 -32
- agentpool/mcp_server/conversions.py +54 -13
- agentpool/mcp_server/manager.py +34 -54
- agentpool/mcp_server/registries/official_registry_client.py +35 -1
- agentpool/mcp_server/tool_bridge.py +186 -139
- agentpool/messaging/__init__.py +0 -2
- agentpool/messaging/compaction.py +72 -197
- agentpool/messaging/connection_manager.py +11 -10
- agentpool/messaging/event_manager.py +5 -5
- agentpool/messaging/message_container.py +6 -30
- agentpool/messaging/message_history.py +99 -8
- agentpool/messaging/messagenode.py +52 -14
- agentpool/messaging/messages.py +54 -35
- agentpool/messaging/processing.py +12 -22
- agentpool/models/__init__.py +1 -1
- agentpool/models/acp_agents/base.py +6 -24
- agentpool/models/acp_agents/mcp_capable.py +126 -157
- agentpool/models/acp_agents/non_mcp.py +129 -95
- agentpool/models/agents.py +98 -76
- agentpool/models/agui_agents.py +1 -1
- agentpool/models/claude_code_agents.py +144 -19
- agentpool/models/file_parsing.py +0 -1
- agentpool/models/manifest.py +113 -50
- agentpool/prompts/conversion_manager.py +1 -1
- agentpool/prompts/prompts.py +5 -2
- agentpool/repomap.py +1 -1
- agentpool/resource_providers/__init__.py +11 -1
- agentpool/resource_providers/aggregating.py +56 -5
- agentpool/resource_providers/base.py +70 -4
- agentpool/resource_providers/codemode/code_executor.py +72 -5
- agentpool/resource_providers/codemode/helpers.py +2 -2
- agentpool/resource_providers/codemode/provider.py +64 -12
- agentpool/resource_providers/codemode/remote_mcp_execution.py +2 -2
- agentpool/resource_providers/codemode/remote_provider.py +9 -12
- agentpool/resource_providers/filtering.py +3 -1
- agentpool/resource_providers/mcp_provider.py +89 -12
- agentpool/resource_providers/plan_provider.py +228 -46
- agentpool/resource_providers/pool.py +7 -3
- agentpool/resource_providers/resource_info.py +111 -0
- agentpool/resource_providers/static.py +4 -2
- agentpool/sessions/__init__.py +4 -1
- agentpool/sessions/manager.py +33 -5
- agentpool/sessions/models.py +59 -6
- agentpool/sessions/protocol.py +28 -0
- agentpool/sessions/session.py +11 -55
- agentpool/skills/registry.py +13 -8
- agentpool/storage/manager.py +572 -49
- agentpool/talk/registry.py +4 -4
- agentpool/talk/talk.py +9 -10
- agentpool/testing.py +538 -20
- agentpool/tool_impls/__init__.py +6 -0
- agentpool/tool_impls/agent_cli/__init__.py +42 -0
- agentpool/tool_impls/agent_cli/tool.py +95 -0
- agentpool/tool_impls/bash/__init__.py +64 -0
- agentpool/tool_impls/bash/helpers.py +35 -0
- agentpool/tool_impls/bash/tool.py +171 -0
- agentpool/tool_impls/delete_path/__init__.py +70 -0
- agentpool/tool_impls/delete_path/tool.py +142 -0
- agentpool/tool_impls/download_file/__init__.py +80 -0
- agentpool/tool_impls/download_file/tool.py +183 -0
- agentpool/tool_impls/execute_code/__init__.py +55 -0
- agentpool/tool_impls/execute_code/tool.py +163 -0
- agentpool/tool_impls/grep/__init__.py +80 -0
- agentpool/tool_impls/grep/tool.py +200 -0
- agentpool/tool_impls/list_directory/__init__.py +73 -0
- agentpool/tool_impls/list_directory/tool.py +197 -0
- agentpool/tool_impls/question/__init__.py +42 -0
- agentpool/tool_impls/question/tool.py +127 -0
- agentpool/tool_impls/read/__init__.py +104 -0
- agentpool/tool_impls/read/tool.py +305 -0
- agentpool/tools/__init__.py +2 -1
- agentpool/tools/base.py +114 -34
- agentpool/tools/manager.py +57 -1
- agentpool/ui/base.py +2 -2
- agentpool/ui/mock_provider.py +2 -2
- agentpool/ui/stdlib_provider.py +2 -2
- agentpool/utils/file_watcher.py +269 -0
- agentpool/utils/identifiers.py +121 -0
- agentpool/utils/pydantic_ai_helpers.py +46 -0
- agentpool/utils/streams.py +616 -2
- agentpool/utils/subprocess_utils.py +155 -0
- agentpool/utils/token_breakdown.py +461 -0
- agentpool/vfs_registry.py +7 -2
- {agentpool-2.1.9.dist-info → agentpool-2.5.0.dist-info}/METADATA +41 -27
- agentpool-2.5.0.dist-info/RECORD +579 -0
- {agentpool-2.1.9.dist-info → agentpool-2.5.0.dist-info}/WHEEL +1 -1
- agentpool_cli/__main__.py +24 -0
- agentpool_cli/create.py +1 -1
- agentpool_cli/serve_acp.py +100 -21
- agentpool_cli/serve_agui.py +87 -0
- agentpool_cli/serve_opencode.py +119 -0
- agentpool_cli/ui.py +557 -0
- agentpool_commands/__init__.py +42 -5
- agentpool_commands/agents.py +75 -2
- agentpool_commands/history.py +62 -0
- agentpool_commands/mcp.py +176 -0
- agentpool_commands/models.py +56 -3
- agentpool_commands/pool.py +260 -0
- agentpool_commands/session.py +1 -1
- agentpool_commands/text_sharing/__init__.py +119 -0
- agentpool_commands/text_sharing/base.py +123 -0
- agentpool_commands/text_sharing/github_gist.py +80 -0
- agentpool_commands/text_sharing/opencode.py +462 -0
- agentpool_commands/text_sharing/paste_rs.py +59 -0
- agentpool_commands/text_sharing/pastebin.py +116 -0
- agentpool_commands/text_sharing/shittycodingagent.py +112 -0
- agentpool_commands/tools.py +57 -0
- agentpool_commands/utils.py +80 -30
- agentpool_config/__init__.py +30 -2
- agentpool_config/agentpool_tools.py +498 -0
- agentpool_config/builtin_tools.py +77 -22
- agentpool_config/commands.py +24 -1
- agentpool_config/compaction.py +258 -0
- agentpool_config/converters.py +1 -1
- agentpool_config/event_handlers.py +42 -0
- agentpool_config/events.py +1 -1
- agentpool_config/forward_targets.py +1 -4
- agentpool_config/jinja.py +3 -3
- agentpool_config/mcp_server.py +132 -6
- agentpool_config/nodes.py +1 -1
- agentpool_config/observability.py +44 -0
- agentpool_config/session.py +0 -3
- agentpool_config/storage.py +82 -38
- agentpool_config/task.py +3 -3
- agentpool_config/tools.py +11 -22
- agentpool_config/toolsets.py +109 -233
- agentpool_server/a2a_server/agent_worker.py +307 -0
- agentpool_server/a2a_server/server.py +23 -18
- agentpool_server/acp_server/acp_agent.py +234 -181
- agentpool_server/acp_server/commands/acp_commands.py +151 -156
- agentpool_server/acp_server/commands/docs_commands/fetch_repo.py +18 -17
- agentpool_server/acp_server/event_converter.py +651 -0
- agentpool_server/acp_server/input_provider.py +53 -10
- agentpool_server/acp_server/server.py +24 -90
- agentpool_server/acp_server/session.py +173 -331
- agentpool_server/acp_server/session_manager.py +8 -34
- agentpool_server/agui_server/server.py +3 -1
- agentpool_server/mcp_server/server.py +5 -2
- agentpool_server/opencode_server/.rules +95 -0
- agentpool_server/opencode_server/ENDPOINTS.md +401 -0
- agentpool_server/opencode_server/OPENCODE_UI_TOOLS_COMPLETE.md +202 -0
- agentpool_server/opencode_server/__init__.py +19 -0
- agentpool_server/opencode_server/command_validation.py +172 -0
- agentpool_server/opencode_server/converters.py +975 -0
- agentpool_server/opencode_server/dependencies.py +24 -0
- agentpool_server/opencode_server/input_provider.py +421 -0
- agentpool_server/opencode_server/models/__init__.py +250 -0
- agentpool_server/opencode_server/models/agent.py +53 -0
- agentpool_server/opencode_server/models/app.py +72 -0
- agentpool_server/opencode_server/models/base.py +26 -0
- agentpool_server/opencode_server/models/common.py +23 -0
- agentpool_server/opencode_server/models/config.py +37 -0
- agentpool_server/opencode_server/models/events.py +821 -0
- agentpool_server/opencode_server/models/file.py +88 -0
- agentpool_server/opencode_server/models/mcp.py +44 -0
- agentpool_server/opencode_server/models/message.py +179 -0
- agentpool_server/opencode_server/models/parts.py +323 -0
- agentpool_server/opencode_server/models/provider.py +81 -0
- agentpool_server/opencode_server/models/pty.py +43 -0
- agentpool_server/opencode_server/models/question.py +56 -0
- agentpool_server/opencode_server/models/session.py +111 -0
- agentpool_server/opencode_server/routes/__init__.py +29 -0
- agentpool_server/opencode_server/routes/agent_routes.py +473 -0
- agentpool_server/opencode_server/routes/app_routes.py +202 -0
- agentpool_server/opencode_server/routes/config_routes.py +302 -0
- agentpool_server/opencode_server/routes/file_routes.py +571 -0
- agentpool_server/opencode_server/routes/global_routes.py +94 -0
- agentpool_server/opencode_server/routes/lsp_routes.py +319 -0
- agentpool_server/opencode_server/routes/message_routes.py +761 -0
- agentpool_server/opencode_server/routes/permission_routes.py +63 -0
- agentpool_server/opencode_server/routes/pty_routes.py +300 -0
- agentpool_server/opencode_server/routes/question_routes.py +128 -0
- agentpool_server/opencode_server/routes/session_routes.py +1276 -0
- agentpool_server/opencode_server/routes/tui_routes.py +139 -0
- agentpool_server/opencode_server/server.py +475 -0
- agentpool_server/opencode_server/state.py +151 -0
- agentpool_server/opencode_server/time_utils.py +8 -0
- agentpool_storage/__init__.py +12 -0
- agentpool_storage/base.py +184 -2
- agentpool_storage/claude_provider/ARCHITECTURE.md +433 -0
- agentpool_storage/claude_provider/__init__.py +42 -0
- agentpool_storage/claude_provider/provider.py +1089 -0
- agentpool_storage/file_provider.py +278 -15
- agentpool_storage/memory_provider.py +193 -12
- agentpool_storage/models.py +3 -0
- agentpool_storage/opencode_provider/ARCHITECTURE.md +386 -0
- agentpool_storage/opencode_provider/__init__.py +16 -0
- agentpool_storage/opencode_provider/helpers.py +414 -0
- agentpool_storage/opencode_provider/provider.py +895 -0
- agentpool_storage/project_store.py +325 -0
- agentpool_storage/session_store.py +26 -6
- agentpool_storage/sql_provider/__init__.py +4 -2
- agentpool_storage/sql_provider/models.py +48 -0
- agentpool_storage/sql_provider/sql_provider.py +269 -3
- agentpool_storage/sql_provider/utils.py +12 -13
- agentpool_storage/zed_provider/__init__.py +16 -0
- agentpool_storage/zed_provider/helpers.py +281 -0
- agentpool_storage/zed_provider/models.py +130 -0
- agentpool_storage/zed_provider/provider.py +442 -0
- agentpool_storage/zed_provider.py +803 -0
- agentpool_toolsets/__init__.py +0 -2
- agentpool_toolsets/builtin/__init__.py +2 -12
- agentpool_toolsets/builtin/code.py +96 -57
- agentpool_toolsets/builtin/debug.py +118 -48
- agentpool_toolsets/builtin/execution_environment.py +115 -230
- agentpool_toolsets/builtin/file_edit/file_edit.py +115 -7
- agentpool_toolsets/builtin/skills.py +9 -4
- agentpool_toolsets/builtin/subagent_tools.py +64 -51
- agentpool_toolsets/builtin/workers.py +4 -2
- agentpool_toolsets/composio_toolset.py +2 -2
- agentpool_toolsets/entry_points.py +3 -1
- agentpool_toolsets/fsspec_toolset/__init__.py +13 -1
- agentpool_toolsets/fsspec_toolset/diagnostics.py +860 -73
- agentpool_toolsets/fsspec_toolset/grep.py +99 -7
- agentpool_toolsets/fsspec_toolset/helpers.py +3 -2
- agentpool_toolsets/fsspec_toolset/image_utils.py +161 -0
- agentpool_toolsets/fsspec_toolset/toolset.py +500 -95
- agentpool_toolsets/mcp_discovery/__init__.py +5 -0
- agentpool_toolsets/mcp_discovery/data/mcp_servers.parquet +0 -0
- agentpool_toolsets/mcp_discovery/toolset.py +511 -0
- agentpool_toolsets/mcp_run_toolset.py +87 -12
- agentpool_toolsets/notifications.py +33 -33
- agentpool_toolsets/openapi.py +3 -1
- agentpool_toolsets/search_toolset.py +3 -1
- agentpool-2.1.9.dist-info/RECORD +0 -474
- agentpool_config/resources.py +0 -33
- agentpool_server/acp_server/acp_tools.py +0 -43
- agentpool_server/acp_server/commands/spawn.py +0 -210
- agentpool_storage/text_log_provider.py +0 -275
- agentpool_toolsets/builtin/agent_management.py +0 -239
- agentpool_toolsets/builtin/chain.py +0 -288
- agentpool_toolsets/builtin/history.py +0 -36
- agentpool_toolsets/builtin/integration.py +0 -85
- agentpool_toolsets/builtin/tool_management.py +0 -90
- agentpool_toolsets/builtin/user_interaction.py +0 -52
- agentpool_toolsets/semantic_memory_toolset.py +0 -536
- {agentpool-2.1.9.dist-info → agentpool-2.5.0.dist-info}/entry_points.txt +0 -0
- {agentpool-2.1.9.dist-info → agentpool-2.5.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"""File operation models."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Literal, Self
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, Field
|
|
8
|
+
|
|
9
|
+
from agentpool_server.opencode_server.models.base import OpenCodeBaseModel
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FileNode(OpenCodeBaseModel):
|
|
13
|
+
"""File or directory node."""
|
|
14
|
+
|
|
15
|
+
name: str
|
|
16
|
+
path: str
|
|
17
|
+
type: Literal["file", "directory"]
|
|
18
|
+
size: int | None = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class FileContent(OpenCodeBaseModel):
|
|
22
|
+
"""File content response."""
|
|
23
|
+
|
|
24
|
+
path: str
|
|
25
|
+
content: str
|
|
26
|
+
encoding: str = "utf-8"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class FileStatus(OpenCodeBaseModel):
|
|
30
|
+
"""File status (for VCS)."""
|
|
31
|
+
|
|
32
|
+
path: str
|
|
33
|
+
status: str # modified, added, deleted, etc.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class TextWrapper(OpenCodeBaseModel):
|
|
37
|
+
"""Wrapper for text content."""
|
|
38
|
+
|
|
39
|
+
text: str
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class SubmatchInfo(OpenCodeBaseModel):
|
|
43
|
+
"""Submatch information."""
|
|
44
|
+
|
|
45
|
+
match: TextWrapper
|
|
46
|
+
start: int
|
|
47
|
+
end: int
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def create(cls, text: str, start: int, end: int) -> Self:
|
|
51
|
+
return cls(match=TextWrapper(text=text), start=start, end=end)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class FindMatch(BaseModel):
|
|
55
|
+
"""Text search match."""
|
|
56
|
+
|
|
57
|
+
path: TextWrapper
|
|
58
|
+
lines: TextWrapper
|
|
59
|
+
line_number: int # these here are snake_case in the API, so we inherit from BaseModel
|
|
60
|
+
absolute_offset: int
|
|
61
|
+
submatches: list[SubmatchInfo] = Field(default_factory=list)
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def create(
|
|
65
|
+
cls,
|
|
66
|
+
path: str,
|
|
67
|
+
lines: str,
|
|
68
|
+
line_number: int,
|
|
69
|
+
absolute_offset: int,
|
|
70
|
+
submatches: list[SubmatchInfo] | None = None,
|
|
71
|
+
) -> FindMatch:
|
|
72
|
+
return cls(
|
|
73
|
+
path=TextWrapper(text=path),
|
|
74
|
+
lines=TextWrapper(text=lines),
|
|
75
|
+
line_number=line_number,
|
|
76
|
+
absolute_offset=absolute_offset,
|
|
77
|
+
submatches=submatches or [],
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class Symbol(OpenCodeBaseModel):
|
|
82
|
+
"""Code symbol."""
|
|
83
|
+
|
|
84
|
+
name: str
|
|
85
|
+
kind: str
|
|
86
|
+
path: str
|
|
87
|
+
line: int
|
|
88
|
+
character: int
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""MCP and logging models."""
|
|
2
|
+
|
|
3
|
+
from typing import Any, Literal
|
|
4
|
+
|
|
5
|
+
from pydantic import Field
|
|
6
|
+
|
|
7
|
+
from agentpool_server.opencode_server.models.base import OpenCodeBaseModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class LogRequest(OpenCodeBaseModel):
|
|
11
|
+
"""Log entry request."""
|
|
12
|
+
|
|
13
|
+
service: str
|
|
14
|
+
level: Literal["debug", "info", "warn", "error"]
|
|
15
|
+
message: str
|
|
16
|
+
extra: dict[str, Any] | None = None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class MCPStatus(OpenCodeBaseModel):
|
|
20
|
+
"""MCP server status."""
|
|
21
|
+
|
|
22
|
+
name: str
|
|
23
|
+
status: Literal["connected", "disconnected", "error"]
|
|
24
|
+
tools: list[str] = Field(default_factory=list)
|
|
25
|
+
error: str | None = None
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class McpResource(OpenCodeBaseModel):
|
|
29
|
+
"""MCP resource info matching OpenCode SDK McpResource type."""
|
|
30
|
+
|
|
31
|
+
name: str
|
|
32
|
+
"""Name of the resource."""
|
|
33
|
+
|
|
34
|
+
uri: str
|
|
35
|
+
"""URI identifying the resource location."""
|
|
36
|
+
|
|
37
|
+
description: str | None = None
|
|
38
|
+
"""Optional description of the resource."""
|
|
39
|
+
|
|
40
|
+
mime_type: str | None = None
|
|
41
|
+
"""MIME type of the resource content."""
|
|
42
|
+
|
|
43
|
+
client: str
|
|
44
|
+
"""Name of the MCP client/server providing this resource."""
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"""Message related models."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any, Literal
|
|
6
|
+
|
|
7
|
+
from pydantic import Field
|
|
8
|
+
|
|
9
|
+
from agentpool_server.opencode_server.models.base import OpenCodeBaseModel
|
|
10
|
+
from agentpool_server.opencode_server.models.common import TimeCreated # noqa: TC001
|
|
11
|
+
from agentpool_server.opencode_server.models.parts import Part # noqa: TC001
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class MessageSummary(OpenCodeBaseModel):
|
|
15
|
+
"""Summary information for a message."""
|
|
16
|
+
|
|
17
|
+
title: str | None = None
|
|
18
|
+
body: str | None = None
|
|
19
|
+
diffs: list[Any] = Field(default_factory=list)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class MessagePath(OpenCodeBaseModel):
|
|
23
|
+
"""Path context for a message."""
|
|
24
|
+
|
|
25
|
+
cwd: str
|
|
26
|
+
root: str
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class MessageTime(OpenCodeBaseModel):
|
|
30
|
+
"""Time information for a message (milliseconds)."""
|
|
31
|
+
|
|
32
|
+
created: int
|
|
33
|
+
completed: int | None = None
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class TokensCache(OpenCodeBaseModel):
|
|
37
|
+
"""Token cache information."""
|
|
38
|
+
|
|
39
|
+
read: int = 0
|
|
40
|
+
write: int = 0
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class Tokens(OpenCodeBaseModel):
|
|
44
|
+
"""Token usage information."""
|
|
45
|
+
|
|
46
|
+
cache: TokensCache = Field(default_factory=TokensCache)
|
|
47
|
+
input: int = 0
|
|
48
|
+
output: int = 0
|
|
49
|
+
reasoning: int = 0
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class UserMessageModel(OpenCodeBaseModel):
|
|
53
|
+
"""Model info for user message."""
|
|
54
|
+
|
|
55
|
+
provider_id: str
|
|
56
|
+
model_id: str
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class UserMessage(OpenCodeBaseModel):
|
|
60
|
+
"""User message."""
|
|
61
|
+
|
|
62
|
+
id: str
|
|
63
|
+
role: Literal["user"] = "user"
|
|
64
|
+
session_id: str
|
|
65
|
+
time: TimeCreated
|
|
66
|
+
agent: str = "default"
|
|
67
|
+
model: UserMessageModel | None = None
|
|
68
|
+
summary: MessageSummary | None = None
|
|
69
|
+
system: str | None = None
|
|
70
|
+
tools: dict[str, bool] | None = None
|
|
71
|
+
variant: str | None = None
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class AssistantMessage(OpenCodeBaseModel):
|
|
75
|
+
"""Assistant message."""
|
|
76
|
+
|
|
77
|
+
id: str
|
|
78
|
+
role: Literal["assistant"] = "assistant"
|
|
79
|
+
session_id: str
|
|
80
|
+
parent_id: str # Required - links to user message
|
|
81
|
+
model_id: str
|
|
82
|
+
provider_id: str
|
|
83
|
+
mode: str = "default"
|
|
84
|
+
agent: str = "default"
|
|
85
|
+
path: MessagePath
|
|
86
|
+
time: MessageTime
|
|
87
|
+
tokens: Tokens = Field(default_factory=Tokens)
|
|
88
|
+
cost: float = 0.0
|
|
89
|
+
error: dict[str, Any] | None = None
|
|
90
|
+
summary: bool | None = None
|
|
91
|
+
finish: str | None = None
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class MessageWithParts(OpenCodeBaseModel):
|
|
95
|
+
"""Message with its parts."""
|
|
96
|
+
|
|
97
|
+
info: UserMessage | AssistantMessage
|
|
98
|
+
parts: list[Part] = Field(default_factory=list)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
# Request models
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class TextPartInput(OpenCodeBaseModel):
|
|
105
|
+
"""Text part for input."""
|
|
106
|
+
|
|
107
|
+
type: Literal["text"] = "text"
|
|
108
|
+
text: str
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class FilePartSourceText(OpenCodeBaseModel):
|
|
112
|
+
"""Source text info for file part."""
|
|
113
|
+
|
|
114
|
+
value: str
|
|
115
|
+
start: int
|
|
116
|
+
end: int
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class FilePartSource(OpenCodeBaseModel):
|
|
120
|
+
"""Source info for file part."""
|
|
121
|
+
|
|
122
|
+
text: FilePartSourceText | None = None
|
|
123
|
+
type: str | None = None
|
|
124
|
+
path: str | None = None
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class FilePartInput(OpenCodeBaseModel):
|
|
128
|
+
"""File part for input (image, document, etc.)."""
|
|
129
|
+
|
|
130
|
+
type: Literal["file"] = "file"
|
|
131
|
+
mime: str
|
|
132
|
+
filename: str | None = None
|
|
133
|
+
url: str # Can be data: URI or file path
|
|
134
|
+
source: FilePartSource | None = None
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
PartInput = TextPartInput | FilePartInput
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
class MessageModelInfo(OpenCodeBaseModel):
|
|
141
|
+
"""Model info in message request."""
|
|
142
|
+
|
|
143
|
+
provider_id: str
|
|
144
|
+
model_id: str
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
class MessageRequest(OpenCodeBaseModel):
|
|
148
|
+
"""Request body for sending a message."""
|
|
149
|
+
|
|
150
|
+
parts: list[PartInput]
|
|
151
|
+
message_id: str | None = None
|
|
152
|
+
model: MessageModelInfo | None = None
|
|
153
|
+
agent: str | None = None
|
|
154
|
+
no_reply: bool | None = None
|
|
155
|
+
system: str | None = None
|
|
156
|
+
tools: dict[str, bool] | None = None
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
class ShellRequest(OpenCodeBaseModel):
|
|
160
|
+
"""Request body for running a shell command."""
|
|
161
|
+
|
|
162
|
+
agent: str
|
|
163
|
+
command: str
|
|
164
|
+
model: MessageModelInfo | None = None
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
class CommandRequest(OpenCodeBaseModel):
|
|
168
|
+
"""Request body for executing a slash command."""
|
|
169
|
+
|
|
170
|
+
command: str
|
|
171
|
+
arguments: str | None = None
|
|
172
|
+
agent: str | None = None
|
|
173
|
+
model: str | None = None # Format: "providerID/modelID"
|
|
174
|
+
message_id: str | None = None
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
# Type unions
|
|
178
|
+
|
|
179
|
+
MessageInfo = UserMessage | AssistantMessage
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
"""Message part models."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any, Literal
|
|
6
|
+
|
|
7
|
+
from pydantic import Field
|
|
8
|
+
|
|
9
|
+
from agentpool_server.opencode_server.models.base import OpenCodeBaseModel
|
|
10
|
+
from agentpool_server.opencode_server.models.common import TimeCreated # noqa: TC001
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TimeStart(OpenCodeBaseModel):
|
|
14
|
+
"""Time with only start (milliseconds).
|
|
15
|
+
|
|
16
|
+
Used by: ToolStateRunning
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
start: int
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class TimeStartEnd(OpenCodeBaseModel):
|
|
23
|
+
"""Time with start and end, both required (milliseconds).
|
|
24
|
+
|
|
25
|
+
Used by: ToolStateError
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
start: int
|
|
29
|
+
end: int
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class TimeStartEndOptional(OpenCodeBaseModel):
|
|
33
|
+
"""Time with start required and end optional (milliseconds).
|
|
34
|
+
|
|
35
|
+
Used by: TextPart
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
start: int
|
|
39
|
+
end: int | None = None
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class TimeStartEndCompacted(OpenCodeBaseModel):
|
|
43
|
+
"""Time with start, end required, and optional compacted (milliseconds).
|
|
44
|
+
|
|
45
|
+
Used by: ToolStateCompleted
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
start: int
|
|
49
|
+
end: int
|
|
50
|
+
compacted: int | None = None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class TextPart(OpenCodeBaseModel):
|
|
54
|
+
"""Text content part."""
|
|
55
|
+
|
|
56
|
+
id: str
|
|
57
|
+
type: Literal["text"] = "text"
|
|
58
|
+
message_id: str
|
|
59
|
+
session_id: str
|
|
60
|
+
text: str
|
|
61
|
+
synthetic: bool | None = None
|
|
62
|
+
ignored: bool | None = None
|
|
63
|
+
time: TimeStartEndOptional | None = None
|
|
64
|
+
metadata: dict[str, Any] | None = None
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class ToolStatePending(OpenCodeBaseModel):
|
|
68
|
+
"""Pending tool state."""
|
|
69
|
+
|
|
70
|
+
status: Literal["pending"] = "pending"
|
|
71
|
+
input: dict[str, Any] = Field(default_factory=dict)
|
|
72
|
+
raw: str = ""
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class ToolStateRunning(OpenCodeBaseModel):
|
|
76
|
+
"""Running tool state."""
|
|
77
|
+
|
|
78
|
+
status: Literal["running"] = "running"
|
|
79
|
+
time: TimeStart
|
|
80
|
+
input: dict[str, Any] = Field(default_factory=dict)
|
|
81
|
+
metadata: dict[str, Any] | None = None
|
|
82
|
+
title: str | None = None
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class ToolStateCompleted(OpenCodeBaseModel):
|
|
86
|
+
"""Completed tool state."""
|
|
87
|
+
|
|
88
|
+
status: Literal["completed"] = "completed"
|
|
89
|
+
input: dict[str, Any] = Field(default_factory=dict)
|
|
90
|
+
output: str = ""
|
|
91
|
+
title: str = ""
|
|
92
|
+
metadata: dict[str, Any] = Field(default_factory=dict)
|
|
93
|
+
time: TimeStartEndCompacted
|
|
94
|
+
attachments: list[Any] | None = None
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class ToolStateError(OpenCodeBaseModel):
|
|
98
|
+
"""Error tool state."""
|
|
99
|
+
|
|
100
|
+
status: Literal["error"] = "error"
|
|
101
|
+
input: dict[str, Any] = Field(default_factory=dict)
|
|
102
|
+
error: str = ""
|
|
103
|
+
metadata: dict[str, Any] | None = None
|
|
104
|
+
time: TimeStartEnd
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
ToolState = ToolStatePending | ToolStateRunning | ToolStateCompleted | ToolStateError
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class ToolPart(OpenCodeBaseModel):
|
|
111
|
+
"""Tool call part."""
|
|
112
|
+
|
|
113
|
+
id: str
|
|
114
|
+
type: Literal["tool"] = "tool"
|
|
115
|
+
message_id: str
|
|
116
|
+
session_id: str
|
|
117
|
+
call_id: str
|
|
118
|
+
tool: str
|
|
119
|
+
state: ToolState
|
|
120
|
+
metadata: dict[str, Any] | None = None
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class FilePartSourceText(OpenCodeBaseModel):
|
|
124
|
+
"""File part source text."""
|
|
125
|
+
|
|
126
|
+
value: str
|
|
127
|
+
start: int
|
|
128
|
+
end: int
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
class FileSource(OpenCodeBaseModel):
|
|
132
|
+
"""File source."""
|
|
133
|
+
|
|
134
|
+
text: FilePartSourceText
|
|
135
|
+
type: Literal["file"] = "file"
|
|
136
|
+
path: str
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class FilePart(OpenCodeBaseModel):
|
|
140
|
+
"""File content part."""
|
|
141
|
+
|
|
142
|
+
id: str
|
|
143
|
+
type: Literal["file"] = "file"
|
|
144
|
+
message_id: str
|
|
145
|
+
session_id: str
|
|
146
|
+
mime: str
|
|
147
|
+
filename: str | None = None
|
|
148
|
+
url: str
|
|
149
|
+
source: FileSource | None = None
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
class AgentPartSource(OpenCodeBaseModel):
|
|
153
|
+
"""Agent part source location in original text."""
|
|
154
|
+
|
|
155
|
+
value: str
|
|
156
|
+
start: int
|
|
157
|
+
end: int
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
class AgentPart(OpenCodeBaseModel):
|
|
161
|
+
"""Agent mention part - references a sub-agent to delegate to.
|
|
162
|
+
|
|
163
|
+
When a user types @agent-name in the prompt, this part is created.
|
|
164
|
+
The server should inject a synthetic instruction to call the task tool
|
|
165
|
+
with the specified agent.
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
id: str
|
|
169
|
+
type: Literal["agent"] = "agent"
|
|
170
|
+
message_id: str
|
|
171
|
+
session_id: str
|
|
172
|
+
name: str
|
|
173
|
+
"""Name of the agent to delegate to."""
|
|
174
|
+
source: AgentPartSource | None = None
|
|
175
|
+
"""Source location in the original prompt text."""
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
class SnapshotPart(OpenCodeBaseModel):
|
|
179
|
+
"""File system snapshot reference."""
|
|
180
|
+
|
|
181
|
+
id: str
|
|
182
|
+
type: Literal["snapshot"] = "snapshot"
|
|
183
|
+
message_id: str
|
|
184
|
+
session_id: str
|
|
185
|
+
snapshot: str
|
|
186
|
+
"""Snapshot identifier."""
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
class PatchPart(OpenCodeBaseModel):
|
|
190
|
+
"""Diff/patch content part."""
|
|
191
|
+
|
|
192
|
+
id: str
|
|
193
|
+
type: Literal["patch"] = "patch"
|
|
194
|
+
message_id: str
|
|
195
|
+
session_id: str
|
|
196
|
+
hash: str
|
|
197
|
+
"""Hash of the patch."""
|
|
198
|
+
files: list[str] = Field(default_factory=list)
|
|
199
|
+
"""List of files affected by this patch."""
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
class ReasoningPart(OpenCodeBaseModel):
|
|
203
|
+
"""Extended thinking/reasoning content part.
|
|
204
|
+
|
|
205
|
+
Used for models that support extended thinking (e.g., Claude with thinking tokens).
|
|
206
|
+
"""
|
|
207
|
+
|
|
208
|
+
id: str
|
|
209
|
+
type: Literal["reasoning"] = "reasoning"
|
|
210
|
+
message_id: str
|
|
211
|
+
session_id: str
|
|
212
|
+
text: str
|
|
213
|
+
"""The reasoning/thinking content."""
|
|
214
|
+
metadata: dict[str, Any] | None = None
|
|
215
|
+
time: TimeStartEndOptional | None = None
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
class CompactionPart(OpenCodeBaseModel):
|
|
219
|
+
"""Marks where conversation was compacted/summarized."""
|
|
220
|
+
|
|
221
|
+
id: str
|
|
222
|
+
type: Literal["compaction"] = "compaction"
|
|
223
|
+
message_id: str
|
|
224
|
+
session_id: str
|
|
225
|
+
auto: bool = False
|
|
226
|
+
"""Whether this was an automatic compaction."""
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
class SubtaskPart(OpenCodeBaseModel):
|
|
230
|
+
"""References a spawned subtask."""
|
|
231
|
+
|
|
232
|
+
id: str
|
|
233
|
+
type: Literal["subtask"] = "subtask"
|
|
234
|
+
message_id: str
|
|
235
|
+
session_id: str
|
|
236
|
+
prompt: str
|
|
237
|
+
"""The prompt for the subtask."""
|
|
238
|
+
description: str
|
|
239
|
+
"""Description of what the subtask does."""
|
|
240
|
+
agent: str
|
|
241
|
+
"""The agent handling this subtask."""
|
|
242
|
+
command: str | None = None
|
|
243
|
+
"""Optional command associated with the subtask."""
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
class APIErrorInfo(OpenCodeBaseModel):
|
|
247
|
+
"""API error information for retry parts."""
|
|
248
|
+
|
|
249
|
+
message: str
|
|
250
|
+
status_code: int | None = None
|
|
251
|
+
is_retryable: bool = False
|
|
252
|
+
response_headers: dict[str, str] | None = None
|
|
253
|
+
response_body: str | None = None
|
|
254
|
+
metadata: dict[str, str] | None = None
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
class RetryPart(OpenCodeBaseModel):
|
|
258
|
+
"""Marks a retry of a failed operation."""
|
|
259
|
+
|
|
260
|
+
id: str
|
|
261
|
+
type: Literal["retry"] = "retry"
|
|
262
|
+
message_id: str
|
|
263
|
+
session_id: str
|
|
264
|
+
attempt: int
|
|
265
|
+
"""Which retry attempt this is."""
|
|
266
|
+
error: APIErrorInfo
|
|
267
|
+
"""Error information from the failed attempt."""
|
|
268
|
+
time: TimeCreated
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
class StepStartPart(OpenCodeBaseModel):
|
|
272
|
+
"""Step start marker."""
|
|
273
|
+
|
|
274
|
+
id: str
|
|
275
|
+
type: Literal["step-start"] = "step-start"
|
|
276
|
+
message_id: str
|
|
277
|
+
session_id: str
|
|
278
|
+
snapshot: str | None = None
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
class TokenCache(OpenCodeBaseModel):
|
|
282
|
+
"""Token cache information."""
|
|
283
|
+
|
|
284
|
+
read: int = 0
|
|
285
|
+
write: int = 0
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
class StepFinishTokens(OpenCodeBaseModel):
|
|
289
|
+
"""Token usage for step finish."""
|
|
290
|
+
|
|
291
|
+
input: int = 0
|
|
292
|
+
output: int = 0
|
|
293
|
+
reasoning: int = 0
|
|
294
|
+
cache: TokenCache = Field(default_factory=TokenCache)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
class StepFinishPart(OpenCodeBaseModel):
|
|
298
|
+
"""Step finish marker."""
|
|
299
|
+
|
|
300
|
+
id: str
|
|
301
|
+
type: Literal["step-finish"] = "step-finish"
|
|
302
|
+
message_id: str
|
|
303
|
+
session_id: str
|
|
304
|
+
reason: str = "stop"
|
|
305
|
+
snapshot: str | None = None
|
|
306
|
+
cost: float = 0.0
|
|
307
|
+
tokens: StepFinishTokens = Field(default_factory=StepFinishTokens)
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
Part = (
|
|
311
|
+
TextPart
|
|
312
|
+
| ToolPart
|
|
313
|
+
| FilePart
|
|
314
|
+
| AgentPart
|
|
315
|
+
| SnapshotPart
|
|
316
|
+
| PatchPart
|
|
317
|
+
| ReasoningPart
|
|
318
|
+
| CompactionPart
|
|
319
|
+
| SubtaskPart
|
|
320
|
+
| RetryPart
|
|
321
|
+
| StepStartPart
|
|
322
|
+
| StepFinishPart
|
|
323
|
+
)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"""Provider, model, and mode related models."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from pydantic import Field
|
|
6
|
+
|
|
7
|
+
from agentpool_server.opencode_server.models.base import OpenCodeBaseModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ModelCost(OpenCodeBaseModel):
|
|
11
|
+
"""Cost information for a model."""
|
|
12
|
+
|
|
13
|
+
input: float
|
|
14
|
+
output: float
|
|
15
|
+
cache_read: float | None = None
|
|
16
|
+
cache_write: float | None = None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ModelLimit(OpenCodeBaseModel):
|
|
20
|
+
"""Limit information for a model."""
|
|
21
|
+
|
|
22
|
+
context: float
|
|
23
|
+
output: float
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Model(OpenCodeBaseModel):
|
|
27
|
+
"""Model information."""
|
|
28
|
+
|
|
29
|
+
id: str
|
|
30
|
+
name: str
|
|
31
|
+
attachment: bool = False
|
|
32
|
+
cost: ModelCost
|
|
33
|
+
limit: ModelLimit
|
|
34
|
+
options: dict[str, Any] = Field(default_factory=dict)
|
|
35
|
+
reasoning: bool = False
|
|
36
|
+
release_date: str = ""
|
|
37
|
+
temperature: bool = True
|
|
38
|
+
tool_call: bool = True
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class Provider(OpenCodeBaseModel):
|
|
42
|
+
"""Provider information."""
|
|
43
|
+
|
|
44
|
+
id: str
|
|
45
|
+
name: str
|
|
46
|
+
env: list[str] = Field(default_factory=list)
|
|
47
|
+
models: dict[str, Model] = Field(default_factory=dict)
|
|
48
|
+
api: str | None = None
|
|
49
|
+
npm: str | None = None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class ProvidersResponse(OpenCodeBaseModel):
|
|
53
|
+
"""Response for /config/providers endpoint."""
|
|
54
|
+
|
|
55
|
+
providers: list[Provider]
|
|
56
|
+
default: dict[str, str] = Field(default_factory=dict)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class ProviderListResponse(OpenCodeBaseModel):
|
|
60
|
+
"""Response for /provider endpoint."""
|
|
61
|
+
|
|
62
|
+
all: list[Provider]
|
|
63
|
+
default: dict[str, str] = Field(default_factory=dict)
|
|
64
|
+
connected: list[str] = Field(default_factory=list)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class ModeModel(OpenCodeBaseModel):
|
|
68
|
+
"""Model selection for a mode."""
|
|
69
|
+
|
|
70
|
+
model_id: str
|
|
71
|
+
provider_id: str
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class Mode(OpenCodeBaseModel):
|
|
75
|
+
"""Agent mode configuration."""
|
|
76
|
+
|
|
77
|
+
name: str
|
|
78
|
+
tools: dict[str, bool] = Field(default_factory=dict)
|
|
79
|
+
model: ModeModel | None = None
|
|
80
|
+
prompt: str | None = None
|
|
81
|
+
temperature: float | None = None
|