plato-sdk-v2 2.0.50__py3-none-any.whl → 2.2.4__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.
- plato/__init__.py +7 -6
- plato/_generated/__init__.py +1 -1
- plato/_generated/api/v1/env/evaluate_session.py +3 -3
- plato/_generated/api/v1/env/log_state_mutation.py +4 -4
- plato/_generated/api/v1/sandbox/checkpoint_vm.py +3 -3
- plato/_generated/api/v1/sandbox/save_vm_snapshot.py +3 -3
- plato/_generated/api/v1/sandbox/setup_sandbox.py +8 -8
- plato/_generated/api/v1/session/__init__.py +2 -0
- plato/_generated/api/v1/session/get_sessions_for_archival.py +100 -0
- plato/_generated/api/v1/testcases/__init__.py +6 -2
- plato/_generated/api/v1/testcases/get_mutation_groups_for_testcase.py +98 -0
- plato/_generated/api/v1/testcases/{get_next_output_testcase_for_scoring.py → get_next_testcase_for_scoring.py} +23 -10
- plato/_generated/api/v1/testcases/get_testcase_metadata_for_scoring.py +74 -0
- plato/_generated/api/v2/__init__.py +2 -1
- plato/_generated/api/v2/jobs/__init__.py +4 -0
- plato/_generated/api/v2/jobs/checkpoint.py +3 -3
- plato/_generated/api/v2/jobs/disk_snapshot.py +3 -3
- plato/_generated/api/v2/jobs/log_for_job.py +4 -39
- plato/_generated/api/v2/jobs/make.py +4 -4
- plato/_generated/api/v2/jobs/setup_sandbox.py +97 -0
- plato/_generated/api/v2/jobs/snapshot.py +3 -3
- plato/_generated/api/v2/jobs/snapshot_store.py +91 -0
- plato/_generated/api/v2/sessions/__init__.py +4 -0
- plato/_generated/api/v2/sessions/checkpoint.py +3 -3
- plato/_generated/api/v2/sessions/disk_snapshot.py +3 -3
- plato/_generated/api/v2/sessions/evaluate.py +3 -3
- plato/_generated/api/v2/sessions/log_job_mutation.py +4 -39
- plato/_generated/api/v2/sessions/make.py +4 -4
- plato/_generated/api/v2/sessions/setup_sandbox.py +98 -0
- plato/_generated/api/v2/sessions/snapshot.py +3 -3
- plato/_generated/api/v2/sessions/snapshot_store.py +94 -0
- plato/_generated/api/v2/user/__init__.py +7 -0
- plato/_generated/api/v2/user/get_current_user.py +76 -0
- plato/_generated/models/__init__.py +174 -23
- plato/_sims_generator/__init__.py +19 -4
- plato/_sims_generator/instruction.py +203 -0
- plato/_sims_generator/templates/instruction/helpers.py.jinja +161 -0
- plato/_sims_generator/templates/instruction/init.py.jinja +43 -0
- plato/agents/__init__.py +107 -517
- plato/agents/base.py +145 -0
- plato/agents/build.py +61 -0
- plato/agents/config.py +160 -0
- plato/agents/logging.py +401 -0
- plato/agents/runner.py +161 -0
- plato/agents/trajectory.py +266 -0
- plato/chronos/__init__.py +37 -0
- plato/chronos/api/__init__.py +3 -0
- plato/chronos/api/agents/__init__.py +13 -0
- plato/chronos/api/agents/create_agent.py +63 -0
- plato/chronos/api/agents/delete_agent.py +61 -0
- plato/chronos/api/agents/get_agent.py +62 -0
- plato/chronos/api/agents/get_agent_schema.py +72 -0
- plato/chronos/api/agents/get_agent_versions.py +62 -0
- plato/chronos/api/agents/list_agents.py +57 -0
- plato/chronos/api/agents/lookup_agent.py +74 -0
- plato/chronos/api/auth/__init__.py +9 -0
- plato/chronos/api/auth/debug_auth_api_auth_debug_get.py +43 -0
- plato/chronos/api/auth/get_auth_status_api_auth_status_get.py +61 -0
- plato/chronos/api/auth/get_current_user_route_api_auth_me_get.py +60 -0
- plato/chronos/api/callback/__init__.py +11 -0
- plato/chronos/api/callback/push_agent_logs.py +61 -0
- plato/chronos/api/callback/update_agent_status.py +57 -0
- plato/chronos/api/callback/upload_artifacts.py +59 -0
- plato/chronos/api/callback/upload_logs_zip.py +57 -0
- plato/chronos/api/callback/upload_trajectory.py +57 -0
- plato/chronos/api/default/__init__.py +7 -0
- plato/chronos/api/default/health.py +43 -0
- plato/chronos/api/jobs/__init__.py +7 -0
- plato/chronos/api/jobs/launch_job.py +63 -0
- plato/chronos/api/registry/__init__.py +19 -0
- plato/chronos/api/registry/get_agent_schema_api_registry_agents__agent_name__schema_get.py +62 -0
- plato/chronos/api/registry/get_agent_versions_api_registry_agents__agent_name__versions_get.py +52 -0
- plato/chronos/api/registry/get_world_schema_api_registry_worlds__package_name__schema_get.py +68 -0
- plato/chronos/api/registry/get_world_versions_api_registry_worlds__package_name__versions_get.py +52 -0
- plato/chronos/api/registry/list_registry_agents_api_registry_agents_get.py +44 -0
- plato/chronos/api/registry/list_registry_worlds_api_registry_worlds_get.py +44 -0
- plato/chronos/api/runtimes/__init__.py +11 -0
- plato/chronos/api/runtimes/create_runtime.py +63 -0
- plato/chronos/api/runtimes/delete_runtime.py +61 -0
- plato/chronos/api/runtimes/get_runtime.py +62 -0
- plato/chronos/api/runtimes/list_runtimes.py +57 -0
- plato/chronos/api/runtimes/test_runtime.py +67 -0
- plato/chronos/api/secrets/__init__.py +11 -0
- plato/chronos/api/secrets/create_secret.py +63 -0
- plato/chronos/api/secrets/delete_secret.py +61 -0
- plato/chronos/api/secrets/get_secret.py +62 -0
- plato/chronos/api/secrets/list_secrets.py +57 -0
- plato/chronos/api/secrets/update_secret.py +68 -0
- plato/chronos/api/sessions/__init__.py +10 -0
- plato/chronos/api/sessions/get_session.py +62 -0
- plato/chronos/api/sessions/get_session_logs.py +72 -0
- plato/chronos/api/sessions/get_session_logs_download.py +62 -0
- plato/chronos/api/sessions/list_sessions.py +57 -0
- plato/chronos/api/status/__init__.py +8 -0
- plato/chronos/api/status/get_status_api_status_get.py +44 -0
- plato/chronos/api/status/get_version_info_api_version_get.py +44 -0
- plato/chronos/api/templates/__init__.py +11 -0
- plato/chronos/api/templates/create_template.py +63 -0
- plato/chronos/api/templates/delete_template.py +61 -0
- plato/chronos/api/templates/get_template.py +62 -0
- plato/chronos/api/templates/list_templates.py +57 -0
- plato/chronos/api/templates/update_template.py +68 -0
- plato/chronos/api/trajectories/__init__.py +8 -0
- plato/chronos/api/trajectories/get_trajectory.py +62 -0
- plato/chronos/api/trajectories/list_trajectories.py +62 -0
- plato/chronos/api/worlds/__init__.py +10 -0
- plato/chronos/api/worlds/create_world.py +63 -0
- plato/chronos/api/worlds/delete_world.py +61 -0
- plato/chronos/api/worlds/get_world.py +62 -0
- plato/chronos/api/worlds/list_worlds.py +57 -0
- plato/chronos/client.py +171 -0
- plato/chronos/errors.py +141 -0
- plato/chronos/models/__init__.py +647 -0
- plato/chronos/py.typed +0 -0
- plato/sims/cli.py +299 -123
- plato/sims/registry.py +77 -4
- plato/v1/cli/agent.py +88 -84
- plato/v1/cli/main.py +2 -0
- plato/v1/cli/pm.py +441 -119
- plato/v1/cli/sandbox.py +747 -191
- plato/v1/cli/sim.py +11 -0
- plato/v1/cli/verify.py +1269 -0
- plato/v1/cli/world.py +3 -0
- plato/v1/flow_executor.py +21 -17
- plato/v1/models/env.py +11 -11
- plato/v1/sdk.py +2 -2
- plato/v1/sync_env.py +11 -11
- plato/v1/sync_flow_executor.py +21 -17
- plato/v1/sync_sdk.py +4 -2
- plato/v2/__init__.py +2 -0
- plato/v2/async_/environment.py +20 -1
- plato/v2/async_/session.py +54 -3
- plato/v2/sync/environment.py +2 -1
- plato/v2/sync/session.py +52 -2
- plato/worlds/README.md +218 -0
- plato/worlds/__init__.py +54 -18
- plato/worlds/base.py +304 -93
- plato/worlds/config.py +239 -73
- plato/worlds/runner.py +391 -80
- {plato_sdk_v2-2.0.50.dist-info → plato_sdk_v2-2.2.4.dist-info}/METADATA +1 -3
- {plato_sdk_v2-2.0.50.dist-info → plato_sdk_v2-2.2.4.dist-info}/RECORD +143 -68
- {plato_sdk_v2-2.0.50.dist-info → plato_sdk_v2-2.2.4.dist-info}/entry_points.txt +1 -0
- plato/_generated/api/v2/interfaces/__init__.py +0 -27
- plato/_generated/api/v2/interfaces/v2_interface_browser_create.py +0 -68
- plato/_generated/api/v2/interfaces/v2_interface_cdp_url.py +0 -65
- plato/_generated/api/v2/interfaces/v2_interface_click.py +0 -64
- plato/_generated/api/v2/interfaces/v2_interface_close.py +0 -59
- plato/_generated/api/v2/interfaces/v2_interface_computer_create.py +0 -68
- plato/_generated/api/v2/interfaces/v2_interface_cursor.py +0 -64
- plato/_generated/api/v2/interfaces/v2_interface_key.py +0 -68
- plato/_generated/api/v2/interfaces/v2_interface_screenshot.py +0 -65
- plato/_generated/api/v2/interfaces/v2_interface_scroll.py +0 -70
- plato/_generated/api/v2/interfaces/v2_interface_type.py +0 -64
- plato/world/__init__.py +0 -44
- plato/world/base.py +0 -267
- plato/world/config.py +0 -139
- plato/world/types.py +0 -47
- {plato_sdk_v2-2.0.50.dist-info → plato_sdk_v2-2.2.4.dist-info}/WHEEL +0 -0
plato/agents/__init__.py
CHANGED
|
@@ -1,528 +1,118 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Plato agent framework.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
for building custom agents.
|
|
5
|
-
|
|
6
|
-
Built-in Agents (installed agents):
|
|
7
|
-
- ClaudeCode: Claude Code agent
|
|
8
|
-
- OpenHands: OpenHands code agent
|
|
9
|
-
- Codex: OpenAI Codex CLI agent
|
|
10
|
-
- Aider: Aider coding assistant
|
|
11
|
-
- GeminiCli: Gemini CLI agent
|
|
12
|
-
- Goose: Block Goose agent
|
|
13
|
-
- SweAgent: SWE-agent
|
|
14
|
-
- MiniSweAgent: Mini SWE-agent
|
|
15
|
-
- ClineCli: Cline CLI agent
|
|
16
|
-
- CursorCli: Cursor CLI agent
|
|
17
|
-
- OpenCode: OpenCode agent
|
|
18
|
-
- QwenCode: Qwen Coder agent
|
|
3
|
+
Provides base classes and utilities for building and running agents.
|
|
19
4
|
|
|
20
5
|
Base Classes:
|
|
21
|
-
- BaseAgent: Abstract base for
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
6
|
+
- BaseAgent: Abstract base class for agents
|
|
7
|
+
- AgentConfig: Base configuration class
|
|
8
|
+
- Secret: Annotation marker for secrets
|
|
9
|
+
|
|
10
|
+
Registry:
|
|
11
|
+
- register_agent: Decorator to register an agent
|
|
12
|
+
- get_agent: Get an agent by name
|
|
13
|
+
- get_registered_agents: Get all registered agents
|
|
14
|
+
|
|
15
|
+
Runner:
|
|
16
|
+
- AgentRunner: Run agents in Docker containers
|
|
17
|
+
- AgentRunResult: Async iterator for agent output
|
|
18
|
+
|
|
19
|
+
Trajectory (ATIF):
|
|
20
|
+
- Trajectory: ATIF trajectory model
|
|
21
|
+
- Step, Agent, ToolCall, etc.: ATIF components
|
|
22
|
+
|
|
23
|
+
Callback:
|
|
24
|
+
- ChronosCallback: Utility for Chronos communication
|
|
25
|
+
|
|
26
|
+
Example (direct execution):
|
|
27
|
+
from plato.agents import BaseAgent, AgentConfig, Secret, register_agent
|
|
28
|
+
from typing import Annotated
|
|
29
|
+
|
|
30
|
+
class MyAgentConfig(AgentConfig):
|
|
31
|
+
model_name: str = "anthropic/claude-sonnet-4"
|
|
32
|
+
api_key: Annotated[str, Secret(description="API key")]
|
|
33
|
+
|
|
34
|
+
@register_agent("my-agent")
|
|
35
|
+
class MyAgent(BaseAgent[MyAgentConfig]):
|
|
36
|
+
name = "my-agent"
|
|
37
|
+
description = "My custom agent"
|
|
38
|
+
|
|
39
|
+
async def run(self, instruction: str) -> None:
|
|
40
|
+
# Agent implementation
|
|
41
|
+
...
|
|
42
|
+
|
|
43
|
+
Example (Docker execution):
|
|
44
|
+
from plato.agents import AgentRunner
|
|
45
|
+
|
|
46
|
+
async for line in AgentRunner.run(
|
|
47
|
+
image="my-agent:latest",
|
|
48
|
+
config={"model_name": "anthropic/claude-sonnet-4"},
|
|
49
|
+
secrets={"api_key": "sk-..."},
|
|
50
|
+
instruction="Fix the bug",
|
|
51
|
+
workspace="/path/to/repo",
|
|
52
|
+
):
|
|
53
|
+
print(line)
|
|
44
54
|
"""
|
|
45
55
|
|
|
46
56
|
from __future__ import annotations
|
|
47
57
|
|
|
48
|
-
from typing import TYPE_CHECKING
|
|
49
|
-
|
|
50
|
-
# Lazy imports to avoid requiring harbor when plato.agents is not used
|
|
51
|
-
if TYPE_CHECKING:
|
|
52
|
-
from harbor.agents.base import BaseAgent
|
|
53
|
-
from harbor.agents.factory import AgentFactory
|
|
54
|
-
from harbor.agents.installed.aider import Aider
|
|
55
|
-
from harbor.agents.installed.base import BaseInstalledAgent, ExecInput
|
|
56
|
-
from harbor.agents.installed.claude_code import ClaudeCode
|
|
57
|
-
from harbor.agents.installed.cline import ClineCli
|
|
58
|
-
from harbor.agents.installed.codex import Codex
|
|
59
|
-
from harbor.agents.installed.cursor_cli import CursorCli
|
|
60
|
-
from harbor.agents.installed.gemini_cli import GeminiCli
|
|
61
|
-
from harbor.agents.installed.goose import Goose
|
|
62
|
-
from harbor.agents.installed.mini_swe_agent import MiniSweAgent
|
|
63
|
-
from harbor.agents.installed.opencode import OpenCode
|
|
64
|
-
from harbor.agents.installed.openhands import OpenHands
|
|
65
|
-
from harbor.agents.installed.qwen_code import QwenCode
|
|
66
|
-
from harbor.agents.installed.swe_agent import SweAgent
|
|
67
|
-
from harbor.models.agent.name import AgentName
|
|
68
|
-
|
|
69
58
|
__all__ = [
|
|
70
|
-
#
|
|
59
|
+
# Config
|
|
60
|
+
"AgentConfig",
|
|
61
|
+
"Secret",
|
|
62
|
+
# Build
|
|
63
|
+
"BuildConfig",
|
|
64
|
+
"load_build_config",
|
|
65
|
+
# Base
|
|
71
66
|
"BaseAgent",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
"
|
|
67
|
+
"ConfigT",
|
|
68
|
+
"register_agent",
|
|
69
|
+
"get_agent",
|
|
70
|
+
"get_registered_agents",
|
|
71
|
+
# Runner
|
|
72
|
+
"run_agent",
|
|
73
|
+
# Trajectory (ATIF)
|
|
74
|
+
"Trajectory",
|
|
75
|
+
"Step",
|
|
76
|
+
"Agent",
|
|
77
|
+
"ToolCall",
|
|
78
|
+
"Observation",
|
|
79
|
+
"ObservationResult",
|
|
80
|
+
"Metrics",
|
|
81
|
+
"FinalMetrics",
|
|
82
|
+
"SCHEMA_VERSION",
|
|
83
|
+
# Logging
|
|
84
|
+
"init_logging",
|
|
85
|
+
"span",
|
|
86
|
+
"log_event",
|
|
87
|
+
"upload_artifacts",
|
|
88
|
+
"reset_logging",
|
|
93
89
|
]
|
|
94
90
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
"ClineCli",
|
|
124
|
-
"CursorCli",
|
|
125
|
-
"OpenCode",
|
|
126
|
-
"QwenCode",
|
|
127
|
-
):
|
|
128
|
-
_check_harbor_installed()
|
|
129
|
-
|
|
130
|
-
if name == "BaseAgent":
|
|
131
|
-
from harbor.agents.base import BaseAgent
|
|
132
|
-
|
|
133
|
-
return BaseAgent
|
|
134
|
-
elif name == "BaseInstalledAgent":
|
|
135
|
-
from harbor.agents.installed.base import BaseInstalledAgent
|
|
136
|
-
|
|
137
|
-
return BaseInstalledAgent
|
|
138
|
-
elif name == "ExecInput":
|
|
139
|
-
from harbor.agents.installed.base import ExecInput
|
|
140
|
-
|
|
141
|
-
return ExecInput
|
|
142
|
-
elif name == "AgentFactory":
|
|
143
|
-
from harbor.agents.factory import AgentFactory
|
|
144
|
-
|
|
145
|
-
return AgentFactory
|
|
146
|
-
elif name == "AgentName":
|
|
147
|
-
from harbor.models.agent.name import AgentName
|
|
148
|
-
|
|
149
|
-
return AgentName
|
|
150
|
-
elif name == "ClaudeCode":
|
|
151
|
-
from harbor.agents.installed.claude_code import ClaudeCode
|
|
152
|
-
|
|
153
|
-
return ClaudeCode
|
|
154
|
-
elif name == "OpenHands":
|
|
155
|
-
from harbor.agents.installed.openhands import OpenHands
|
|
156
|
-
|
|
157
|
-
return OpenHands
|
|
158
|
-
elif name == "Codex":
|
|
159
|
-
from harbor.agents.installed.codex import Codex
|
|
160
|
-
|
|
161
|
-
return Codex
|
|
162
|
-
elif name == "Aider":
|
|
163
|
-
from harbor.agents.installed.aider import Aider
|
|
164
|
-
|
|
165
|
-
return Aider
|
|
166
|
-
elif name == "GeminiCli":
|
|
167
|
-
from harbor.agents.installed.gemini_cli import GeminiCli
|
|
168
|
-
|
|
169
|
-
return GeminiCli
|
|
170
|
-
elif name == "Goose":
|
|
171
|
-
from harbor.agents.installed.goose import Goose
|
|
172
|
-
|
|
173
|
-
return Goose
|
|
174
|
-
elif name == "SweAgent":
|
|
175
|
-
from harbor.agents.installed.swe_agent import SweAgent
|
|
176
|
-
|
|
177
|
-
return SweAgent
|
|
178
|
-
elif name == "MiniSweAgent":
|
|
179
|
-
from harbor.agents.installed.mini_swe_agent import MiniSweAgent
|
|
180
|
-
|
|
181
|
-
return MiniSweAgent
|
|
182
|
-
elif name == "ClineCli":
|
|
183
|
-
from harbor.agents.installed.cline import ClineCli
|
|
184
|
-
|
|
185
|
-
return ClineCli
|
|
186
|
-
elif name == "CursorCli":
|
|
187
|
-
from harbor.agents.installed.cursor_cli import CursorCli
|
|
188
|
-
|
|
189
|
-
return CursorCli
|
|
190
|
-
elif name == "OpenCode":
|
|
191
|
-
from harbor.agents.installed.opencode import OpenCode
|
|
192
|
-
|
|
193
|
-
return OpenCode
|
|
194
|
-
elif name == "QwenCode":
|
|
195
|
-
from harbor.agents.installed.qwen_code import QwenCode
|
|
196
|
-
|
|
197
|
-
return QwenCode
|
|
198
|
-
|
|
199
|
-
if name == "get_agent_schema":
|
|
200
|
-
return get_agent_schema
|
|
201
|
-
if name == "AGENT_SCHEMAS":
|
|
202
|
-
return AGENT_SCHEMAS
|
|
203
|
-
|
|
204
|
-
raise AttributeError(f"module 'plato.agents' has no attribute '{name}'")
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
# JSON Schemas for built-in Harbor agents
|
|
208
|
-
# These define the configuration options for each agent
|
|
209
|
-
AGENT_SCHEMAS: dict[str, dict] = {
|
|
210
|
-
"claude-code": {
|
|
211
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
212
|
-
"$id": "harbor-claude-code",
|
|
213
|
-
"title": "ClaudeCodeConfig",
|
|
214
|
-
"description": "Configuration for Claude Code agent.",
|
|
215
|
-
"type": "object",
|
|
216
|
-
"properties": {
|
|
217
|
-
"model_name": {
|
|
218
|
-
"type": "string",
|
|
219
|
-
"description": "LLM model to use (e.g., 'anthropic/claude-sonnet-4')",
|
|
220
|
-
},
|
|
221
|
-
"max_thinking_tokens": {
|
|
222
|
-
"type": ["integer", "null"],
|
|
223
|
-
"default": None,
|
|
224
|
-
"description": "Maximum tokens for extended thinking mode",
|
|
225
|
-
},
|
|
226
|
-
"version": {
|
|
227
|
-
"type": ["string", "null"],
|
|
228
|
-
"default": None,
|
|
229
|
-
"description": "Specific Claude Code version to install",
|
|
230
|
-
},
|
|
231
|
-
"prompt_template_path": {
|
|
232
|
-
"type": ["string", "null"],
|
|
233
|
-
"default": None,
|
|
234
|
-
"description": "Path to custom prompt template",
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
|
-
"required": [],
|
|
238
|
-
},
|
|
239
|
-
"openhands": {
|
|
240
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
241
|
-
"$id": "harbor-openhands",
|
|
242
|
-
"title": "OpenHandsConfig",
|
|
243
|
-
"description": "Configuration for OpenHands agent.",
|
|
244
|
-
"type": "object",
|
|
245
|
-
"properties": {
|
|
246
|
-
"model_name": {
|
|
247
|
-
"type": "string",
|
|
248
|
-
"description": "LLM model to use (e.g., 'anthropic/claude-sonnet-4')",
|
|
249
|
-
},
|
|
250
|
-
"disable_tool_calls": {
|
|
251
|
-
"type": "boolean",
|
|
252
|
-
"default": False,
|
|
253
|
-
"description": "Whether to disable native function calling",
|
|
254
|
-
},
|
|
255
|
-
"reasoning_effort": {
|
|
256
|
-
"type": ["string", "null"],
|
|
257
|
-
"enum": ["low", "medium", "high", None],
|
|
258
|
-
"default": "medium",
|
|
259
|
-
"description": "Reasoning effort level for the model",
|
|
260
|
-
},
|
|
261
|
-
"version": {
|
|
262
|
-
"type": ["string", "null"],
|
|
263
|
-
"default": None,
|
|
264
|
-
"description": "Specific OpenHands version to install",
|
|
265
|
-
},
|
|
266
|
-
"git_version": {
|
|
267
|
-
"type": ["string", "null"],
|
|
268
|
-
"default": None,
|
|
269
|
-
"description": "Git version/tag to install from",
|
|
270
|
-
},
|
|
271
|
-
},
|
|
272
|
-
"required": [],
|
|
273
|
-
},
|
|
274
|
-
"codex": {
|
|
275
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
276
|
-
"$id": "harbor-codex",
|
|
277
|
-
"title": "CodexConfig",
|
|
278
|
-
"description": "Configuration for Codex CLI agent.",
|
|
279
|
-
"type": "object",
|
|
280
|
-
"properties": {
|
|
281
|
-
"model_name": {
|
|
282
|
-
"type": "string",
|
|
283
|
-
"description": "LLM model to use (e.g., 'openai/gpt-4o')",
|
|
284
|
-
},
|
|
285
|
-
"version": {
|
|
286
|
-
"type": ["string", "null"],
|
|
287
|
-
"default": None,
|
|
288
|
-
"description": "Specific Codex version to install",
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
"required": [],
|
|
292
|
-
},
|
|
293
|
-
"aider": {
|
|
294
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
295
|
-
"$id": "harbor-aider",
|
|
296
|
-
"title": "AiderConfig",
|
|
297
|
-
"description": "Configuration for Aider agent.",
|
|
298
|
-
"type": "object",
|
|
299
|
-
"properties": {
|
|
300
|
-
"model_name": {
|
|
301
|
-
"type": "string",
|
|
302
|
-
"description": "LLM model to use",
|
|
303
|
-
},
|
|
304
|
-
"version": {
|
|
305
|
-
"type": ["string", "null"],
|
|
306
|
-
"default": None,
|
|
307
|
-
"description": "Specific Aider version to install",
|
|
308
|
-
},
|
|
309
|
-
},
|
|
310
|
-
"required": [],
|
|
311
|
-
},
|
|
312
|
-
"gemini-cli": {
|
|
313
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
314
|
-
"$id": "harbor-gemini-cli",
|
|
315
|
-
"title": "GeminiCliConfig",
|
|
316
|
-
"description": "Configuration for Gemini CLI agent.",
|
|
317
|
-
"type": "object",
|
|
318
|
-
"properties": {
|
|
319
|
-
"model_name": {
|
|
320
|
-
"type": "string",
|
|
321
|
-
"description": "LLM model to use (e.g., 'google/gemini-2.5-pro')",
|
|
322
|
-
},
|
|
323
|
-
"version": {
|
|
324
|
-
"type": ["string", "null"],
|
|
325
|
-
"default": None,
|
|
326
|
-
"description": "Specific Gemini CLI version to install",
|
|
327
|
-
},
|
|
328
|
-
},
|
|
329
|
-
"required": [],
|
|
330
|
-
},
|
|
331
|
-
"goose": {
|
|
332
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
333
|
-
"$id": "harbor-goose",
|
|
334
|
-
"title": "GooseConfig",
|
|
335
|
-
"description": "Configuration for Block Goose agent.",
|
|
336
|
-
"type": "object",
|
|
337
|
-
"properties": {
|
|
338
|
-
"model_name": {
|
|
339
|
-
"type": "string",
|
|
340
|
-
"description": "LLM model to use",
|
|
341
|
-
},
|
|
342
|
-
"version": {
|
|
343
|
-
"type": ["string", "null"],
|
|
344
|
-
"default": None,
|
|
345
|
-
"description": "Specific Goose version to install",
|
|
346
|
-
},
|
|
347
|
-
},
|
|
348
|
-
"required": [],
|
|
349
|
-
},
|
|
350
|
-
"swe-agent": {
|
|
351
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
352
|
-
"$id": "harbor-swe-agent",
|
|
353
|
-
"title": "SweAgentConfig",
|
|
354
|
-
"description": "Configuration for SWE-agent.",
|
|
355
|
-
"type": "object",
|
|
356
|
-
"properties": {
|
|
357
|
-
"model_name": {
|
|
358
|
-
"type": "string",
|
|
359
|
-
"description": "LLM model to use",
|
|
360
|
-
},
|
|
361
|
-
"version": {
|
|
362
|
-
"type": ["string", "null"],
|
|
363
|
-
"default": None,
|
|
364
|
-
"description": "Specific SWE-agent version to install",
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
"required": [],
|
|
368
|
-
},
|
|
369
|
-
"mini-swe-agent": {
|
|
370
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
371
|
-
"$id": "harbor-mini-swe-agent",
|
|
372
|
-
"title": "MiniSweAgentConfig",
|
|
373
|
-
"description": "Configuration for Mini SWE-agent.",
|
|
374
|
-
"type": "object",
|
|
375
|
-
"properties": {
|
|
376
|
-
"model_name": {
|
|
377
|
-
"type": "string",
|
|
378
|
-
"description": "LLM model to use",
|
|
379
|
-
},
|
|
380
|
-
"version": {
|
|
381
|
-
"type": ["string", "null"],
|
|
382
|
-
"default": None,
|
|
383
|
-
"description": "Specific Mini SWE-agent version to install",
|
|
384
|
-
},
|
|
385
|
-
},
|
|
386
|
-
"required": [],
|
|
387
|
-
},
|
|
388
|
-
"cline-cli": {
|
|
389
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
390
|
-
"$id": "harbor-cline-cli",
|
|
391
|
-
"title": "ClineCliConfig",
|
|
392
|
-
"description": "Configuration for Cline CLI agent.",
|
|
393
|
-
"type": "object",
|
|
394
|
-
"properties": {
|
|
395
|
-
"model_name": {
|
|
396
|
-
"type": "string",
|
|
397
|
-
"description": "LLM model to use",
|
|
398
|
-
},
|
|
399
|
-
"version": {
|
|
400
|
-
"type": ["string", "null"],
|
|
401
|
-
"default": None,
|
|
402
|
-
"description": "Specific Cline version to install",
|
|
403
|
-
},
|
|
404
|
-
},
|
|
405
|
-
"required": [],
|
|
406
|
-
},
|
|
407
|
-
"cursor-cli": {
|
|
408
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
409
|
-
"$id": "harbor-cursor-cli",
|
|
410
|
-
"title": "CursorCliConfig",
|
|
411
|
-
"description": "Configuration for Cursor CLI agent.",
|
|
412
|
-
"type": "object",
|
|
413
|
-
"properties": {
|
|
414
|
-
"model_name": {
|
|
415
|
-
"type": "string",
|
|
416
|
-
"description": "LLM model to use",
|
|
417
|
-
},
|
|
418
|
-
"version": {
|
|
419
|
-
"type": ["string", "null"],
|
|
420
|
-
"default": None,
|
|
421
|
-
"description": "Specific Cursor CLI version to install",
|
|
422
|
-
},
|
|
423
|
-
},
|
|
424
|
-
"required": [],
|
|
425
|
-
},
|
|
426
|
-
"opencode": {
|
|
427
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
428
|
-
"$id": "harbor-opencode",
|
|
429
|
-
"title": "OpenCodeConfig",
|
|
430
|
-
"description": "Configuration for OpenCode agent.",
|
|
431
|
-
"type": "object",
|
|
432
|
-
"properties": {
|
|
433
|
-
"model_name": {
|
|
434
|
-
"type": "string",
|
|
435
|
-
"description": "LLM model to use",
|
|
436
|
-
},
|
|
437
|
-
"version": {
|
|
438
|
-
"type": ["string", "null"],
|
|
439
|
-
"default": None,
|
|
440
|
-
"description": "Specific OpenCode version to install",
|
|
441
|
-
},
|
|
442
|
-
},
|
|
443
|
-
"required": [],
|
|
444
|
-
},
|
|
445
|
-
"qwen-coder": {
|
|
446
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
447
|
-
"$id": "harbor-qwen-code",
|
|
448
|
-
"title": "QwenCodeConfig",
|
|
449
|
-
"description": "Configuration for Qwen Coder agent.",
|
|
450
|
-
"type": "object",
|
|
451
|
-
"properties": {
|
|
452
|
-
"model_name": {
|
|
453
|
-
"type": "string",
|
|
454
|
-
"description": "LLM model to use",
|
|
455
|
-
},
|
|
456
|
-
"version": {
|
|
457
|
-
"type": ["string", "null"],
|
|
458
|
-
"default": None,
|
|
459
|
-
"description": "Specific Qwen Coder version to install",
|
|
460
|
-
},
|
|
461
|
-
},
|
|
462
|
-
"required": [],
|
|
463
|
-
},
|
|
464
|
-
# Plato custom agent (not from Harbor)
|
|
465
|
-
"computer-use": {
|
|
466
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
467
|
-
"$id": "plato-computer-use",
|
|
468
|
-
"title": "ComputerUseConfig",
|
|
469
|
-
"description": "Configuration for Computer-Use browser automation agent.",
|
|
470
|
-
"type": "object",
|
|
471
|
-
"properties": {
|
|
472
|
-
"model_name": {
|
|
473
|
-
"type": "string",
|
|
474
|
-
"description": "LLM model (e.g., 'claude-sonnet-4-5-20250929', 'gpt-4o', 'gemini-2.0-flash')",
|
|
475
|
-
},
|
|
476
|
-
"mode": {
|
|
477
|
-
"type": "string",
|
|
478
|
-
"enum": ["browser", "computer"],
|
|
479
|
-
"default": "browser",
|
|
480
|
-
"description": "Execution mode: 'browser' (Playwright) or 'computer' (desktop)",
|
|
481
|
-
},
|
|
482
|
-
"browser_type": {
|
|
483
|
-
"type": "string",
|
|
484
|
-
"enum": ["local", "browserbase", "steel"],
|
|
485
|
-
"default": "local",
|
|
486
|
-
"description": "Browser backend type",
|
|
487
|
-
},
|
|
488
|
-
"headless": {
|
|
489
|
-
"type": "boolean",
|
|
490
|
-
"default": True,
|
|
491
|
-
"description": "Run browser in headless mode",
|
|
492
|
-
},
|
|
493
|
-
"viewport_width": {
|
|
494
|
-
"type": "integer",
|
|
495
|
-
"default": 1280,
|
|
496
|
-
"description": "Browser viewport width",
|
|
497
|
-
},
|
|
498
|
-
"viewport_height": {
|
|
499
|
-
"type": "integer",
|
|
500
|
-
"default": 800,
|
|
501
|
-
"description": "Browser viewport height",
|
|
502
|
-
},
|
|
503
|
-
"start_url": {
|
|
504
|
-
"type": ["string", "null"],
|
|
505
|
-
"default": None,
|
|
506
|
-
"description": "Optional starting URL",
|
|
507
|
-
},
|
|
508
|
-
"timeout_seconds": {
|
|
509
|
-
"type": "integer",
|
|
510
|
-
"default": 600,
|
|
511
|
-
"description": "Timeout for agent execution",
|
|
512
|
-
},
|
|
513
|
-
},
|
|
514
|
-
"required": [],
|
|
515
|
-
},
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
def get_agent_schema(agent_name: str) -> dict | None:
|
|
520
|
-
"""Get the JSON schema for a built-in Harbor agent.
|
|
521
|
-
|
|
522
|
-
Args:
|
|
523
|
-
agent_name: The agent name (e.g., 'claude-code', 'openhands')
|
|
524
|
-
|
|
525
|
-
Returns:
|
|
526
|
-
JSON schema dict or None if agent not found
|
|
527
|
-
"""
|
|
528
|
-
return AGENT_SCHEMAS.get(agent_name)
|
|
91
|
+
from plato.agents.base import (
|
|
92
|
+
BaseAgent,
|
|
93
|
+
ConfigT,
|
|
94
|
+
get_agent,
|
|
95
|
+
get_registered_agents,
|
|
96
|
+
register_agent,
|
|
97
|
+
)
|
|
98
|
+
from plato.agents.build import BuildConfig, load_build_config
|
|
99
|
+
from plato.agents.config import AgentConfig, Secret
|
|
100
|
+
from plato.agents.logging import (
|
|
101
|
+
init_logging,
|
|
102
|
+
log_event,
|
|
103
|
+
reset_logging,
|
|
104
|
+
span,
|
|
105
|
+
upload_artifacts,
|
|
106
|
+
)
|
|
107
|
+
from plato.agents.runner import run_agent
|
|
108
|
+
from plato.agents.trajectory import (
|
|
109
|
+
SCHEMA_VERSION,
|
|
110
|
+
Agent,
|
|
111
|
+
FinalMetrics,
|
|
112
|
+
Metrics,
|
|
113
|
+
Observation,
|
|
114
|
+
ObservationResult,
|
|
115
|
+
Step,
|
|
116
|
+
ToolCall,
|
|
117
|
+
Trajectory,
|
|
118
|
+
)
|