mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-04-29 03:00:45 -04:00
* support loading a particular runtime class via config.runtime (default to server to not break things) * move image agnostic util to shared runtime util * move dependency * include poetry.lock in sdist * accept port as arg for client * make client start server with specified port * update image agnostic utility for eventstream runtime * make client and runtime working with REST API * rename execute_server * add plugin to initialize stuff inside es-runtime; cleanup runtime methods to delegate everything to container * remove redundant ls -alh * fix jupyter * improve logging in agnostic sandbox * improve logging of test function * add read & edit * update agnostic sandbox * support setting work dir at start * fix file read/write test * fix unit test * update tescase * Fix unit test again * fix unit test again again
37 lines
829 B
Python
37 lines
829 B
Python
from abc import abstractmethod
|
|
from dataclasses import dataclass
|
|
|
|
from opendevin.events.action import Action
|
|
from opendevin.events.observation import Observation
|
|
|
|
|
|
class Plugin:
|
|
"""Base class for a plugin.
|
|
|
|
This will be initialized by the runtime client, which will run inside docker.
|
|
"""
|
|
|
|
name: str
|
|
|
|
@abstractmethod
|
|
def initialize(self):
|
|
"""Initialize the plugin."""
|
|
pass
|
|
|
|
@abstractmethod
|
|
async def run(self, action: Action) -> Observation:
|
|
"""Run the plugin for a given action."""
|
|
pass
|
|
|
|
|
|
@dataclass
|
|
class PluginRequirement:
|
|
"""Requirement for a plugin."""
|
|
|
|
name: str
|
|
# FOLDER/FILES to be copied to the sandbox
|
|
host_src: str
|
|
sandbox_dest: str
|
|
# NOTE: bash_script_path should be relative to the `sandbox_dest` path
|
|
bash_script_path: str
|