execforge 0.1.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.
- execforge-0.1.0.dist-info/METADATA +367 -0
- execforge-0.1.0.dist-info/RECORD +44 -0
- execforge-0.1.0.dist-info/WHEEL +5 -0
- execforge-0.1.0.dist-info/entry_points.txt +5 -0
- execforge-0.1.0.dist-info/licenses/LICENSE +21 -0
- execforge-0.1.0.dist-info/top_level.txt +1 -0
- orchestrator/__init__.py +4 -0
- orchestrator/__main__.py +5 -0
- orchestrator/backends/__init__.py +1 -0
- orchestrator/backends/base.py +29 -0
- orchestrator/backends/factory.py +53 -0
- orchestrator/backends/llm_cli_backend.py +87 -0
- orchestrator/backends/mock_backend.py +34 -0
- orchestrator/backends/shell_backend.py +49 -0
- orchestrator/cli/__init__.py +1 -0
- orchestrator/cli/main.py +971 -0
- orchestrator/config.py +272 -0
- orchestrator/domain/__init__.py +1 -0
- orchestrator/domain/types.py +77 -0
- orchestrator/exceptions.py +18 -0
- orchestrator/git/__init__.py +1 -0
- orchestrator/git/service.py +202 -0
- orchestrator/logging_setup.py +53 -0
- orchestrator/prompts/__init__.py +1 -0
- orchestrator/prompts/parser.py +91 -0
- orchestrator/reporting/__init__.py +1 -0
- orchestrator/reporting/console.py +197 -0
- orchestrator/reporting/events.py +44 -0
- orchestrator/reporting/selection_result.py +15 -0
- orchestrator/services/__init__.py +1 -0
- orchestrator/services/agent_runner.py +831 -0
- orchestrator/services/agent_service.py +122 -0
- orchestrator/services/project_service.py +47 -0
- orchestrator/services/prompt_source_service.py +65 -0
- orchestrator/services/run_service.py +42 -0
- orchestrator/services/step_executor.py +100 -0
- orchestrator/services/task_service.py +155 -0
- orchestrator/storage/__init__.py +1 -0
- orchestrator/storage/db.py +29 -0
- orchestrator/storage/models.py +95 -0
- orchestrator/utils/__init__.py +1 -0
- orchestrator/utils/process.py +44 -0
- orchestrator/validation/__init__.py +1 -0
- orchestrator/validation/pipeline.py +52 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
import shlex
|
|
5
|
+
|
|
6
|
+
from orchestrator.backends.base import ExecutionBackend
|
|
7
|
+
from orchestrator.domain.types import BackendContext, BackendResult, TaskStep
|
|
8
|
+
from orchestrator.exceptions import BackendError
|
|
9
|
+
from orchestrator.storage.models import TaskORM
|
|
10
|
+
from orchestrator.utils.process import run_command
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ShellBackend(ExecutionBackend):
|
|
14
|
+
name = "shell"
|
|
15
|
+
supported_step_types = {"shell", "command"}
|
|
16
|
+
|
|
17
|
+
def __init__(self, command_template: str | None = None, allowed_commands: list[str] | None = None):
|
|
18
|
+
self.command_template = command_template
|
|
19
|
+
self.allowed_commands = set(allowed_commands or [])
|
|
20
|
+
|
|
21
|
+
def execute_step(
|
|
22
|
+
self,
|
|
23
|
+
step: TaskStep,
|
|
24
|
+
task: TaskORM,
|
|
25
|
+
project_path: Path,
|
|
26
|
+
prompt_root: Path,
|
|
27
|
+
context: BackendContext,
|
|
28
|
+
) -> BackendResult:
|
|
29
|
+
task_ref = task.external_id or f"task-{task.id}"
|
|
30
|
+
command = step.command
|
|
31
|
+
if not command:
|
|
32
|
+
if not self.command_template:
|
|
33
|
+
raise BackendError(f"Step '{step.id}' requires command and no shell command_template is configured")
|
|
34
|
+
command = self.command_template.format(task_id=task_ref, title=task.title, step_id=step.id)
|
|
35
|
+
parts = shlex.split(command)
|
|
36
|
+
if not parts:
|
|
37
|
+
raise BackendError("Shell backend command_template resolved to empty command")
|
|
38
|
+
if self.allowed_commands and parts[0] not in self.allowed_commands:
|
|
39
|
+
raise BackendError(f"Command '{parts[0]}' is not in allowed command list")
|
|
40
|
+
|
|
41
|
+
result = run_command(parts, cwd=project_path, timeout=context.timeout_seconds)
|
|
42
|
+
success = result.code == 0
|
|
43
|
+
return BackendResult(
|
|
44
|
+
success=success,
|
|
45
|
+
summary=f"Shell command exited with code {result.code}",
|
|
46
|
+
stdout=result.stdout,
|
|
47
|
+
stderr=result.stderr,
|
|
48
|
+
tool_invocations=[{"tool": "shell", "step": step.id, "command": command, "exit_code": result.code}],
|
|
49
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""CLI package."""
|