dynamic-ralph 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.
- bin/__init__.py +0 -0
- bin/run_agent.py +94 -0
- bin/run_dynamic_ralph.py +993 -0
- bin/run_retrospective.py +369 -0
- dynamic_ralph-0.1.0.dist-info/METADATA +8 -0
- dynamic_ralph-0.1.0.dist-info/RECORD +29 -0
- dynamic_ralph-0.1.0.dist-info/WHEEL +5 -0
- dynamic_ralph-0.1.0.dist-info/entry_points.txt +4 -0
- dynamic_ralph-0.1.0.dist-info/top_level.txt +2 -0
- multi_agent/__init__.py +63 -0
- multi_agent/backend.py +180 -0
- multi_agent/backends/__init__.py +1 -0
- multi_agent/backends/claude_code.py +240 -0
- multi_agent/compose.py +17 -0
- multi_agent/constants.py +117 -0
- multi_agent/docker.py +30 -0
- multi_agent/filelock.py +44 -0
- multi_agent/models.py +100 -0
- multi_agent/prd.py +35 -0
- multi_agent/prompts.py +60 -0
- multi_agent/stream.py +99 -0
- multi_agent/workflow/__init__.py +102 -0
- multi_agent/workflow/editing.py +289 -0
- multi_agent/workflow/executor.py +685 -0
- multi_agent/workflow/models.py +212 -0
- multi_agent/workflow/prompts.py +365 -0
- multi_agent/workflow/scratch.py +134 -0
- multi_agent/workflow/state.py +235 -0
- multi_agent/workflow/steps.py +90 -0
bin/__init__.py
ADDED
|
File without changes
|
bin/run_agent.py
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Run an interactive Claude Code session inside the ralph-agent container.
|
|
3
|
+
|
|
4
|
+
Mounts host credentials (~/.claude, ~/.config/claude), the current directory
|
|
5
|
+
as /workspace, and the Docker socket. Uses ``os.execvp`` so the container
|
|
6
|
+
gets direct TTY access for a regular interactive Claude experience.
|
|
7
|
+
|
|
8
|
+
Extra arguments after ``--`` are forwarded to the ``claude`` CLI.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import os
|
|
12
|
+
import sys
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
from multi_agent.constants import GIT_EMAIL, RALPH_IMAGE, RALPH_MODE, get_git_author_identity
|
|
16
|
+
from multi_agent.docker import build_image, docker_sock_gid, image_exists
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def build_interactive_docker_command(
|
|
20
|
+
*,
|
|
21
|
+
image: str = RALPH_IMAGE,
|
|
22
|
+
workspace: str | None = None,
|
|
23
|
+
extra_args: list[str] | None = None,
|
|
24
|
+
) -> list[str]:
|
|
25
|
+
"""Build a ``docker run -it`` command for interactive Claude Code use."""
|
|
26
|
+
if workspace is None:
|
|
27
|
+
workspace = os.getcwd()
|
|
28
|
+
|
|
29
|
+
author_name, author_email = get_git_author_identity()
|
|
30
|
+
home = Path.home()
|
|
31
|
+
claude_dir = home / '.claude'
|
|
32
|
+
config_claude = home / '.config' / 'claude'
|
|
33
|
+
|
|
34
|
+
cmd: list[str] = [
|
|
35
|
+
'docker',
|
|
36
|
+
'run',
|
|
37
|
+
'-it',
|
|
38
|
+
'--rm',
|
|
39
|
+
'--group-add',
|
|
40
|
+
docker_sock_gid(),
|
|
41
|
+
'-e',
|
|
42
|
+
'IS_SANDBOX=1',
|
|
43
|
+
'-e',
|
|
44
|
+
'UV_PROJECT_ENVIRONMENT=/tmp/venv',
|
|
45
|
+
'-e',
|
|
46
|
+
f'GIT_AUTHOR_NAME={author_name}',
|
|
47
|
+
'-e',
|
|
48
|
+
f'GIT_AUTHOR_EMAIL={author_email}',
|
|
49
|
+
'-e',
|
|
50
|
+
'GIT_COMMITTER_NAME=Claude Agent',
|
|
51
|
+
'-e',
|
|
52
|
+
f'GIT_COMMITTER_EMAIL={GIT_EMAIL}',
|
|
53
|
+
'-e',
|
|
54
|
+
f'RALPH_MODE={RALPH_MODE}',
|
|
55
|
+
'-v',
|
|
56
|
+
'/var/run/docker.sock:/var/run/docker.sock',
|
|
57
|
+
'-v',
|
|
58
|
+
f'{workspace}:/workspace',
|
|
59
|
+
'-v',
|
|
60
|
+
'/workspace/.venv',
|
|
61
|
+
'-v',
|
|
62
|
+
f'{claude_dir}:/home/agent/.claude',
|
|
63
|
+
'-v',
|
|
64
|
+
f'{config_claude}:/home/agent/.config/claude',
|
|
65
|
+
'-w',
|
|
66
|
+
'/workspace',
|
|
67
|
+
image,
|
|
68
|
+
'claude',
|
|
69
|
+
'--dangerously-skip-permissions',
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
if extra_args:
|
|
73
|
+
cmd.extend(extra_args)
|
|
74
|
+
|
|
75
|
+
return cmd
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def main() -> None:
|
|
79
|
+
# Ensure the Docker image is available
|
|
80
|
+
if not image_exists():
|
|
81
|
+
build_image()
|
|
82
|
+
|
|
83
|
+
# Everything after '--' is forwarded to claude
|
|
84
|
+
extra: list[str] = []
|
|
85
|
+
if '--' in sys.argv:
|
|
86
|
+
sep = sys.argv.index('--')
|
|
87
|
+
extra = sys.argv[sep + 1 :]
|
|
88
|
+
|
|
89
|
+
cmd = build_interactive_docker_command(extra_args=extra or None)
|
|
90
|
+
os.execvp(cmd[0], cmd)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
if __name__ == '__main__':
|
|
94
|
+
main()
|