opalacoder 0.1.1__tar.gz → 0.1.4__tar.gz
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.
- opalacoder-0.1.4/.claude/rules/RULES.md +20 -0
- opalacoder-0.1.4/.claude/settings.json +21 -0
- opalacoder-0.1.4/.gitignore +128 -0
- opalacoder-0.1.1/AGENT.md → opalacoder-0.1.4/AGENTS.md +4 -0
- opalacoder-0.1.4/CLAUDE.md +34 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/GEMINI.md +5 -2
- opalacoder-0.1.4/PKG-INFO +269 -0
- opalacoder-0.1.4/README.md +243 -0
- opalacoder-0.1.4/agents.yaml +61 -0
- opalacoder-0.1.4/config.yaml +13 -0
- opalacoder-0.1.4/docs/guide/paper_memplan.md +257 -0
- opalacoder-0.1.4/docs/guide/skills-plugin-system.md +218 -0
- opalacoder-0.1.4/docs/specs/01-arquitetura.md +133 -0
- opalacoder-0.1.4/docs/specs/02-memgpt-orquestrador.md +103 -0
- opalacoder-0.1.4/docs/specs/03-skill-implement-feature.md +146 -0
- opalacoder-0.1.4/docs/specs/04-memoria.md +134 -0
- opalacoder-0.1.4/docs/specs/05-vcs-sombra.md +94 -0
- opalacoder-0.1.4/docs/specs/06-skills-e-plugins.md +260 -0
- opalacoder-0.1.4/docs/specs/07-configuracao.md +161 -0
- opalacoder-0.1.4/docs/specs/08-ide.md +153 -0
- opalacoder-0.1.4/docs/specs/09-ide-projectcreationinterface.md +75 -0
- opalacoder-0.1.4/docs/specs/README.md +79 -0
- opalacoder-0.1.4/gui_src/index.html +17 -0
- opalacoder-0.1.4/gui_src/package-lock.json +2701 -0
- opalacoder-0.1.4/gui_src/package.json +30 -0
- opalacoder-0.1.4/gui_src/src/App.jsx +1953 -0
- opalacoder-0.1.4/gui_src/src/index.css +608 -0
- opalacoder-0.1.4/gui_src/src/main.jsx +10 -0
- opalacoder-0.1.4/gui_src/vite.config.js +24 -0
- opalacoder-0.1.4/opalacoder/agent_stdin.py +551 -0
- opalacoder-0.1.4/opalacoder/agents.py +79 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/archival.py +16 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/cli.py +70 -146
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/cli_commands.py +83 -51
- opalacoder-0.1.4/opalacoder/code_index.py +681 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/config.py +117 -51
- opalacoder-0.1.4/opalacoder/copy_gui.py +20 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/embeddings.py +3 -1
- opalacoder-0.1.4/opalacoder/gui/assets/index-CZ4mgucw.css +32 -0
- opalacoder-0.1.4/opalacoder/gui/assets/index-DJeOys10.js +206 -0
- opalacoder-0.1.4/opalacoder/gui/index.html +18 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/i18n.py +22 -0
- opalacoder-0.1.4/opalacoder/ide_server.py +645 -0
- opalacoder-0.1.4/opalacoder/memgpt_runtime.py +345 -0
- opalacoder-0.1.4/opalacoder/orchestrator.py +165 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/planner.py +6 -1
- opalacoder-0.1.4/opalacoder/plugins/__init__.py +0 -0
- opalacoder-0.1.4/opalacoder/plugins/html_css_js_tools.py +497 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/project.py +86 -8
- opalacoder-0.1.4/opalacoder/skills.py +230 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/structured.py +49 -58
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/terminal.py +102 -0
- opalacoder-0.1.4/opalacoder/terminal_manager.py +157 -0
- opalacoder-0.1.4/opalacoder/tools.py +856 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/vcs.py +32 -37
- opalacoder-0.1.4/opalacoder/vector_index.py +335 -0
- opalacoder-0.1.4/opalacoder/workflow_orchestrator.py +1417 -0
- opalacoder-0.1.4/opalacoder/workflow_tools.py +336 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/pyproject.toml +8 -2
- {opalacoder-0.1.1 → opalacoder-0.1.4}/pytest.ini +2 -0
- opalacoder-0.1.4/requirements.txt +15 -0
- opalacoder-0.1.4/skills/chat-orchestrator/SKILL.md +63 -0
- opalacoder-0.1.4/skills/command-line/SKILL.md +33 -0
- opalacoder-0.1.4/skills/command-line/scripts/command_executor.py +105 -0
- opalacoder-0.1.4/skills/skills_store/html-css-js/SKILL.md +48 -0
- opalacoder-0.1.4/skills/skills_store/html-css-js/scripts/check_contracts.py +69 -0
- opalacoder-0.1.4/skills/skills_store/implement-feature/SKILL.md +46 -0
- opalacoder-0.1.4/skills/skills_store/implement-feature/scripts/run_workflow.py +149 -0
- opalacoder-0.1.4/tests/test_agent_config.py +62 -0
- opalacoder-0.1.4/tests/test_agent_stdin.py +133 -0
- opalacoder-0.1.4/tests/test_code_index_integration.py +460 -0
- opalacoder-0.1.4/tests/test_command_line_skill.py +76 -0
- opalacoder-0.1.4/tests/test_file_delete.py +61 -0
- opalacoder-0.1.4/tests/test_implement_feature_script.py +60 -0
- opalacoder-0.1.4/tests/test_memgpt_runtime.py +106 -0
- opalacoder-0.1.4/tests/test_model_commands.py +95 -0
- opalacoder-0.1.4/tests/test_planner_oracle_live.py +406 -0
- opalacoder-0.1.4/tests/test_planner_output.py +183 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/tests/test_refinement_loop.py +8 -63
- opalacoder-0.1.4/tests/test_search_bugs.py +235 -0
- opalacoder-0.1.4/tests/test_skills_directory_loader.py +225 -0
- opalacoder-0.1.4/tests/test_unhashable_dict_bug.py +168 -0
- opalacoder-0.1.4/tests/test_verification_strategies.py +440 -0
- opalacoder-0.1.4/tests/test_workflow_pipeline.py +909 -0
- opalacoder-0.1.1/.gitignore +0 -145
- opalacoder-0.1.1/ALGS.md +0 -47
- opalacoder-0.1.1/ARCH_SUMMARY.md +0 -76
- opalacoder-0.1.1/CLAUDE.md +0 -1
- opalacoder-0.1.1/PKG-INFO +0 -230
- opalacoder-0.1.1/README.md +0 -210
- opalacoder-0.1.1/agents.yaml +0 -78
- opalacoder-0.1.1/direct_gemini_test.py +0 -27
- opalacoder-0.1.1/opalacoder/agents.py +0 -239
- opalacoder-0.1.1/opalacoder/memgpt.py +0 -411
- opalacoder-0.1.1/opalacoder/orchestrator.py +0 -432
- opalacoder-0.1.1/opalacoder/skills.py +0 -184
- opalacoder-0.1.1/opalacoder/tools.py +0 -399
- opalacoder-0.1.1/rename_project.py +0 -57
- opalacoder-0.1.1/requirements.txt +0 -7
- opalacoder-0.1.1/skills/generaldeveloper.md +0 -52
- opalacoder-0.1.1/skills/html_css_js.md +0 -51
- opalacoder-0.1.1/skills/opalacoder.md +0 -37
- opalacoder-0.1.1/skills/python_subprocess.md +0 -11
- opalacoder-0.1.1/skills/react_vite.md +0 -6
- opalacoder-0.1.1/test_complexity.py +0 -1
- opalacoder-0.1.1/test_gemini.py +0 -20
- opalacoder-0.1.1/test_gemini_sequences.py +0 -52
- opalacoder-0.1.1/tests/test_agent_config.py +0 -101
- opalacoder-0.1.1/tests/test_double_inference.py +0 -21
- opalacoder-0.1.1/tests/test_executor_context_extraction.py +0 -1
- opalacoder-0.1.1/tests/test_intent_classifier.py +0 -176
- opalacoder-0.1.1/tests/test_new_features.py +0 -1
- opalacoder-0.1.1/tests/test_orchestrator_prompt.py +0 -112
- opalacoder-0.1.1/tests/test_pipeline_integration.py +0 -1
- opalacoder-0.1.1/tests/test_planner_flow.py +0 -1
- opalacoder-0.1.1/tests/test_project_dir_isolation.py +0 -1
- opalacoder-0.1.1/tests/test_skills_loading.py +0 -226
- {opalacoder-0.1.1 → opalacoder-0.1.4}/.github/workflows/publish.yml +0 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4/debug}/scratch_tail.py +0 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4/docs/guide}/analysis_results.md +0 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4/docs/guide/figs}/logotipo.png +0 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/main.py +0 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/__init__.py +0 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/api_keys.py +0 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/opalacoder/session.py +0 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/tests/test_complexity_evaluator.py +0 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/tests/test_context_guard.py +0 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/tests/test_i18n_coverage.py +0 -0
- {opalacoder-0.1.1 → opalacoder-0.1.4}/tests/test_project_store.py +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Regras para Analises dadas Questões do Usuário
|
|
2
|
+
1. **Relevância**: As análises devem ser diretamente relevantes à questão do usuário, abordando os pontos específicos levantados e evitando informações desnecessárias.
|
|
3
|
+
|
|
4
|
+
2. Nunca levante hipóteses ou suposições sem base sólida. Se a questão do usuário for ambígua, peça esclarecimentos antes de fornecer uma análise. Realize testes para validar/excluir/confirmar hipóteses, e baseie suas análises nos resultados desses testes. Não invente testes fáceis de passar ou que não testem o que você diz que testam.
|
|
5
|
+
|
|
6
|
+
# Regras de Diagnóstico de Testes
|
|
7
|
+
1. **Cobertura de Código**: Assegure-se de que os testes cubram pelo menos 80% do código, incluindo casos de borda e cenários de falha.
|
|
8
|
+
|
|
9
|
+
2. **Isolamento**: Cada teste deve ser independente e não depender de outros testes ou do estado global. Use mocks e stubs para isolar as unidades de código.
|
|
10
|
+
|
|
11
|
+
2. **Repetibilidade**: Os testes devem produzir os mesmos resultados em execuções subsequentes, independentemente da ordem de execução ou do ambiente.
|
|
12
|
+
|
|
13
|
+
3. **Clareza**: Os testes devem ser claros e fáceis de entender. Use nomes descritivos para os testes e organize-os de maneira lógica.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# Regras de Organização de Testes
|
|
17
|
+
Nunca gere arquivos de teste soltos na raiz do projeto. Use o diretório `tests/` para organizar os testes por funcionalidade ou módulo.
|
|
18
|
+
|
|
19
|
+
# Regras de Nomenclatura de Testes
|
|
20
|
+
Siga a convenção de nomenclatura `test_<nome_da_funcionalidade>.py` para arquivos de teste. Dentro dos arquivos, nomeie as funções de teste com o prefixo `test_` seguido de uma descrição clara do que está sendo testado, por exemplo, `test_calculo_soma()`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(grep -A 30 \"checkAndEnforceHardFail\\\\|improve.*loop\\\\|composite.*tool\" /tmp/smallcode/bin/smallcode.js | head -60)",
|
|
5
|
+
"Read(//tmp/smallcode/bin/**)",
|
|
6
|
+
"Bash(python -c ' *)",
|
|
7
|
+
"Read(//home/gilzamir/**)",
|
|
8
|
+
"Bash(sed -n '/DEBUG PLAN JSON/,/\\\\/DEBUG PLAN JSON/p' /home/gilzamir/log.log)",
|
|
9
|
+
"Read(//home/gilzamir/micalc/**)",
|
|
10
|
+
"Bash(git stash *)",
|
|
11
|
+
"Bash(python -m pytest tests/ -q --ignore=tests/test_planner_output.py --ignore=tests/test_agent_config.py -k \"not llm and asyncio\")",
|
|
12
|
+
"Bash(python -m pytest tests/ -q --ignore=tests/test_planner_output.py --ignore=tests/test_agent_config.py -k \"not llm\")",
|
|
13
|
+
"Bash(python -m pytest tests/test_workflow_pipeline.py tests/test_verification_strategies.py -q -k \"asyncio or \\(not llm\\)\")",
|
|
14
|
+
"Bash(python -m pytest tests/ -x -q)",
|
|
15
|
+
"Bash(python -c \"from opalacoder.cli_commands import _registry, REPLState; print\\('OK'\\); print\\([k for k in _registry._cmds]\\)\")"
|
|
16
|
+
],
|
|
17
|
+
"additionalDirectories": [
|
|
18
|
+
"/home/gilzamir"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# --- Project-specific ---
|
|
2
|
+
*.env
|
|
3
|
+
.env
|
|
4
|
+
*.env*
|
|
5
|
+
.venv
|
|
6
|
+
*.venv
|
|
7
|
+
node_modules/
|
|
8
|
+
plan.md
|
|
9
|
+
|
|
10
|
+
# --- Project runtime data ---
|
|
11
|
+
.opalacoder/
|
|
12
|
+
|
|
13
|
+
# --- Python bytecode & caches ---
|
|
14
|
+
__pycache__/
|
|
15
|
+
*.py[cod]
|
|
16
|
+
*$py.class
|
|
17
|
+
*.pyo
|
|
18
|
+
|
|
19
|
+
# --- C extensions ---
|
|
20
|
+
*.so
|
|
21
|
+
|
|
22
|
+
# --- Distribution / packaging ---
|
|
23
|
+
.Python
|
|
24
|
+
build/
|
|
25
|
+
develop-eggs/
|
|
26
|
+
dist/
|
|
27
|
+
downloads/
|
|
28
|
+
eggs/
|
|
29
|
+
.eggs/
|
|
30
|
+
lib/
|
|
31
|
+
lib64/
|
|
32
|
+
parts/
|
|
33
|
+
sdist/
|
|
34
|
+
var/
|
|
35
|
+
wheels/
|
|
36
|
+
share/python-wheels/
|
|
37
|
+
*.egg-info/
|
|
38
|
+
.installed.cfg
|
|
39
|
+
*.egg
|
|
40
|
+
MANIFEST
|
|
41
|
+
|
|
42
|
+
# --- PyInstaller ---
|
|
43
|
+
*.manifest
|
|
44
|
+
*.spec
|
|
45
|
+
|
|
46
|
+
# --- Installer logs ---
|
|
47
|
+
pip-log.txt
|
|
48
|
+
pip-delete-this-directory.txt
|
|
49
|
+
|
|
50
|
+
# --- Testing & coverage ---
|
|
51
|
+
htmlcov/
|
|
52
|
+
.tox/
|
|
53
|
+
.nox/
|
|
54
|
+
.coverage
|
|
55
|
+
.coverage.*
|
|
56
|
+
.cache
|
|
57
|
+
nosetests.xml
|
|
58
|
+
coverage.xml
|
|
59
|
+
*.cover
|
|
60
|
+
*.py,cover
|
|
61
|
+
.hypothesis/
|
|
62
|
+
.pytest_cache/
|
|
63
|
+
cover/
|
|
64
|
+
|
|
65
|
+
# --- Translations ---
|
|
66
|
+
*.mo
|
|
67
|
+
*.pot
|
|
68
|
+
|
|
69
|
+
# --- Databases ---
|
|
70
|
+
*.sqlite
|
|
71
|
+
*.sqlite3
|
|
72
|
+
*.sqlite3-journal
|
|
73
|
+
*.sqlite-shm
|
|
74
|
+
*.sqlite-wal
|
|
75
|
+
|
|
76
|
+
# --- Logging ---
|
|
77
|
+
*.log
|
|
78
|
+
|
|
79
|
+
# --- Virtual environments ---
|
|
80
|
+
env/
|
|
81
|
+
venv/
|
|
82
|
+
ENV/
|
|
83
|
+
env.bak/
|
|
84
|
+
venv.bak/
|
|
85
|
+
|
|
86
|
+
# --- Jupyter ---
|
|
87
|
+
.ipynb_checkpoints
|
|
88
|
+
|
|
89
|
+
# --- IPython ---
|
|
90
|
+
profile_default/
|
|
91
|
+
ipython_config.py
|
|
92
|
+
|
|
93
|
+
# --- PEP 582 ---
|
|
94
|
+
__pypackages__/
|
|
95
|
+
|
|
96
|
+
# --- Type checkers ---
|
|
97
|
+
.mypy_cache/
|
|
98
|
+
.dmypy.json
|
|
99
|
+
dmypy.json
|
|
100
|
+
.pyre/
|
|
101
|
+
.pytype/
|
|
102
|
+
|
|
103
|
+
# --- Build tools ---
|
|
104
|
+
.pybuilder/
|
|
105
|
+
target/
|
|
106
|
+
cython_debug/
|
|
107
|
+
docs/_build/
|
|
108
|
+
/site
|
|
109
|
+
|
|
110
|
+
# --- Misc Python tools ---
|
|
111
|
+
.scrapy
|
|
112
|
+
instance/
|
|
113
|
+
.webassets-cache
|
|
114
|
+
celerybeat-schedule
|
|
115
|
+
celerybeat.pid
|
|
116
|
+
*.sage.py
|
|
117
|
+
.spyderproject
|
|
118
|
+
.spyproject
|
|
119
|
+
.ropeproject
|
|
120
|
+
local_settings.py
|
|
121
|
+
|
|
122
|
+
# --- IDEs / Editors ---
|
|
123
|
+
.vscode/
|
|
124
|
+
.idea/
|
|
125
|
+
*.swp
|
|
126
|
+
*.swo
|
|
127
|
+
*~
|
|
128
|
+
*.db
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# General Rules
|
|
2
|
+
|
|
3
|
+
1. Don't make baseless assumptions; before drawing any conclusions, conduct tests and analysis to gather as much information as possible.
|
|
4
|
+
|
|
5
|
+
# Project Guide
|
|
6
|
+
|
|
7
|
+
## Language
|
|
8
|
+
|
|
9
|
+
All code, comments, and documentation must be written in **English**.
|
|
10
|
+
|
|
11
|
+
## Architecture
|
|
12
|
+
|
|
13
|
+
This project uses the **AgenticBlocks.IO** framework.
|
|
14
|
+
Before starting any task, read the library source and documentation at:
|
|
15
|
+
https://github.com/gilzamir/agenticblocks
|
|
16
|
+
|
|
17
|
+
Key things to understand from that repo:
|
|
18
|
+
- How blocks are structured and composed
|
|
19
|
+
- How agents communicate and dispatch events
|
|
20
|
+
- Naming conventions used throughout the framework
|
|
21
|
+
|
|
22
|
+
## Project Context
|
|
23
|
+
|
|
24
|
+
Read `docs/specs` before making changes. It contains the current project status, known issues, and decisions already made. Do not re-litigate what is documented there.
|
|
25
|
+
|
|
26
|
+
## Build & Test Commands
|
|
27
|
+
Run tests on tests dir after you implement a new feature.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
> Fill in your actual commands below — this is the highest-value section.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
python -m pytest
|
|
34
|
+
```
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# General Rules
|
|
2
|
+
|
|
3
|
+
1. Don't make baseless assumptions; before drawing any conclusions, conduct tests and analysis to gather as much information as possible.
|
|
4
|
+
|
|
1
5
|
# Project Guide
|
|
2
6
|
|
|
3
7
|
## Language
|
|
@@ -17,8 +21,7 @@ Key things to understand from that repo:
|
|
|
17
21
|
|
|
18
22
|
## Project Context
|
|
19
23
|
|
|
20
|
-
Read `
|
|
21
|
-
known issues, and decisions already made. Do not re-litigate what is documented there.
|
|
24
|
+
Read `docs/specs` before making changes. It contains the current project status, known issues, and decisions already made. Do not re-litigate what is documented there.
|
|
22
25
|
|
|
23
26
|
## Build & Test Commands
|
|
24
27
|
Run tests on tests dir after you implement a new feature.
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: opalacoder
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: Autonomous coding agent with interactive planning and modular execution
|
|
5
|
+
Project-URL: Homepage, https://github.com/gilzamir/OpalaCoder
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/gilzamir/OpalaCoder/issues
|
|
7
|
+
Author-email: Gil Zamir <gilzamir@example.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.11
|
|
13
|
+
Requires-Dist: agenticblocks-io>=0.8.37
|
|
14
|
+
Requires-Dist: chromadb>=0.4.0
|
|
15
|
+
Requires-Dist: instructor>=1.15.1
|
|
16
|
+
Requires-Dist: litellm>=1.40.0
|
|
17
|
+
Requires-Dist: numpy>=1.21.0
|
|
18
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
19
|
+
Requires-Dist: pywebview>=4.0
|
|
20
|
+
Requires-Dist: pyyaml>=6.0
|
|
21
|
+
Requires-Dist: rich>=13.0.0
|
|
22
|
+
Requires-Dist: sentence-transformers>=3.0.0
|
|
23
|
+
Requires-Dist: tree-sitter-language-pack>=1.8.0
|
|
24
|
+
Requires-Dist: tree-sitter>=0.25.0
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# OpalaCoder
|
|
28
|
+
|
|
29
|
+
**OpalaCoder** is an autonomous coding agent built on the **[AgenticBlocks.IO](https://github.com/gilzamir/agenticblocks)** framework. It features a project-centric context model and a modular, skills-oriented architecture optimized to run efficiently with local LLMs.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Core Architecture & Features
|
|
34
|
+
|
|
35
|
+
### 1. Project-Centric Context
|
|
36
|
+
All operations happen within a named project mapped to a fixed directory. This grounds the agent's workspace, scopes file/terminal access, maintains SQLite-based project memory, and keeps LLM context windows small and focused.
|
|
37
|
+
|
|
38
|
+
### 2. MemGPT Chat Orchestrator
|
|
39
|
+
The main entry point is a persistent **MemGPT Chat Orchestrator** (`MemGPTAgentBlock`). Rather than running a static intent classifier, the orchestrator converses with the user, manages long-term memory, and dynamically routes complex tasks by invoking active skills via tool-calling (`run_skill`).
|
|
40
|
+
|
|
41
|
+
### 3. Skills-Oriented Design (Anthropic Standard)
|
|
42
|
+
Capabilities are defined as modular **skills** (defined via `SKILL.md` declarations and optional Level 3 python/bash scripts).
|
|
43
|
+
- **Opt-in Activation**: Projects declare active skills in a local `skills.yaml` file.
|
|
44
|
+
- **Ephemeral Sub-Agents**: When a skill is invoked, the orchestrator spawns a focused sub-agent (`LLMAgentBlock`) dedicated to executing that skill's workflow.
|
|
45
|
+
- **Dialogue Interceptor**: The sub-agent communicates directly with the user, and an interceptor synchronizes the exchange back to the orchestrator's memory.
|
|
46
|
+
|
|
47
|
+
### 4. Code Generation (`implement-feature` Skill)
|
|
48
|
+
Software development and bug-fixing tasks are handled by the default `implement-feature` skill, running a structured Plan → Execute → Verify loop:
|
|
49
|
+
- **Interactive Planning**: Generates high-level task plans and refines them based on user feedback.
|
|
50
|
+
- **Shadow Git Checkout**: Automatically checkpoints code to an isolated repository (`.opalacoder/.git`) before plan execution, allowing instant rollback via `/undo`.
|
|
51
|
+
- **Auto-Linting**: Validates changes using syntax checkers (`node --check`, `py_compile`) after each file edit, letting the worker self-correct syntax errors autonomously.
|
|
52
|
+
|
|
53
|
+
### 5. Web-Based IDE GUI (Cross-Platform)
|
|
54
|
+
OpalaCoder features an integrated desktop GUI built using React, Vite, and `pywebview`:
|
|
55
|
+
- **Cross-Platform Support**: Works seamlessly on Linux and Windows. If `pywebview` is not available, it automatically falls back to hosting a local web server and launching the interface in your default browser.
|
|
56
|
+
- **Integrated Terminal**: Includes a real-time xterm.js terminal with shell/PTY integration for running and inspecting commands natively.
|
|
57
|
+
- **Git Source Control Sidebar**: A dedicated panel that tracks file modifications (color-coded as Modified/Untracked/Deleted) and provides a commit interface.
|
|
58
|
+
- **Global Settings Panel**: Customize the editor font size, tab size, and word wrapping, with dynamic toggle support for Light and Dark themes.
|
|
59
|
+
- **About Tab**: Version tracking (currently `0.1.4 alfa`), licensing, and developer details in the settings panel.
|
|
60
|
+
|
|
61
|
+
### 6. Persistent Projects and CLI Commands
|
|
62
|
+
|
|
63
|
+
| Command | Description |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `/help` | Show available commands |
|
|
66
|
+
| `/clear` | Clear memory and history of the current project |
|
|
67
|
+
| `/rename <name>` | Rename the active project |
|
|
68
|
+
| `/list` | List all saved projects |
|
|
69
|
+
| `/load <name>` | Load an existing project |
|
|
70
|
+
| `/delete <name>` | Delete a project (optionally deletes its directory) |
|
|
71
|
+
| `/skills` | List available skills and active ones for the project |
|
|
72
|
+
| `/addskill <name>` / `/rmskill <name>` | Add or remove skills |
|
|
73
|
+
| `/undo` | Revert the last agent change via shadow VCS |
|
|
74
|
+
| `/commit <msg>` | Manually commit to the shadow git |
|
|
75
|
+
| `/exit` / `/quit` | Exit the application |
|
|
76
|
+
|
|
77
|
+
### 7. Modular Architecture
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
opalacoder/
|
|
81
|
+
├── cli.py Entrypoint, project loading, REPL loop
|
|
82
|
+
├── memgpt_runtime.py MemGPT chat orchestrator and run_skill tool integration
|
|
83
|
+
├── agents.py Agent creation helper functions
|
|
84
|
+
├── config.py Global settings loader and CLI parser
|
|
85
|
+
├── skills.py Skill loading, selection, and routing
|
|
86
|
+
├── project.py SQLite project management and state
|
|
87
|
+
├── vcs.py Shadow git strategies (auto, hybrid, agent-driven, none)
|
|
88
|
+
├── ide_server.py Asynchronous HTTP and REST server hosting the IDE GUI
|
|
89
|
+
├── agent_stdin.py JSON stdin/stdout protocol server for remote control
|
|
90
|
+
├── code_index.py Multi-language symbol index (SQLite-backed, incremental)
|
|
91
|
+
├── vector_index.py Vector index of chunks for semantic code lookup
|
|
92
|
+
└── tools.py Shared tool definitions (run_command, memory APIs)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Requirements
|
|
98
|
+
|
|
99
|
+
- Python 3.11+
|
|
100
|
+
- [agenticblocks](https://github.com/gilzamir/agenticblocks) (install from source)
|
|
101
|
+
- An Ollama instance with the default model available:
|
|
102
|
+
- **Default model**: `ministral-3:14b`
|
|
103
|
+
- **Alternative model** (complex tasks): also `ministral-3:14b` by default; change in `agents.yaml`
|
|
104
|
+
- Other tested models: `gemma4:latest`, `mistral-nemo:latest`
|
|
105
|
+
- Any model supported by [litellm](https://docs.litellm.ai) works
|
|
106
|
+
- **Recommended Ollama version**: `0.24.0+`
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Installation
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
git clone https://github.com/gilzamir/OpalaCoder
|
|
114
|
+
cd OpalaCoder
|
|
115
|
+
|
|
116
|
+
python -m venv .env
|
|
117
|
+
source .env/bin/activate # Linux/macOS
|
|
118
|
+
# .env\Scripts\activate # Windows
|
|
119
|
+
|
|
120
|
+
# Install agenticblocks from source first
|
|
121
|
+
pip install -e /path/to/agenticblocks
|
|
122
|
+
|
|
123
|
+
# Install OpalaCoder dependencies
|
|
124
|
+
pip install -r requirements.txt
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Environment Variables (Optional)
|
|
128
|
+
|
|
129
|
+
```env
|
|
130
|
+
# Override default model (any litellm-supported string)
|
|
131
|
+
OPALA_MODEL=ollama/ministral-3:14b
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## How to Run
|
|
137
|
+
|
|
138
|
+
OpalaCoder supports three main execution modes:
|
|
139
|
+
|
|
140
|
+
### 1. Interactive CLI REPL (Default)
|
|
141
|
+
Starts the standard CLI terminal planner/execution loop:
|
|
142
|
+
```bash
|
|
143
|
+
source .env/bin/activate
|
|
144
|
+
python main.py # default (plan mode)
|
|
145
|
+
python main.py --mode auto # run without interruptions
|
|
146
|
+
python main.py --mode edit # confirm sensitive operations
|
|
147
|
+
python main.py --model ollama/gemma4 # override model
|
|
148
|
+
python main.py --db /path/to/db # custom database path
|
|
149
|
+
python main.py --version
|
|
150
|
+
python main.py --help
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 2. Web-Based IDE GUI
|
|
154
|
+
Launches the integrated React desktop application. It opens as a local app window (via `pywebview`) or falls back to your web browser:
|
|
155
|
+
```bash
|
|
156
|
+
source .env/bin/activate
|
|
157
|
+
python main.py --gui
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 3. Stdin/Stdout JSON Protocol Server
|
|
161
|
+
Launches the agent in background headless mode, communicating via single-line JSON messages:
|
|
162
|
+
```bash
|
|
163
|
+
source .env/bin/activate
|
|
164
|
+
python main.py --stdin
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Compiling Frontend GUI (Optional)
|
|
170
|
+
|
|
171
|
+
If you are developing or making changes to the React GUI, you can recompile the assets:
|
|
172
|
+
```bash
|
|
173
|
+
cd gui_src
|
|
174
|
+
npm install
|
|
175
|
+
npm run build
|
|
176
|
+
```
|
|
177
|
+
This builds the SPA bundle and saves it directly into the Python package distribution at `opalacoder/gui/`.
|
|
178
|
+
|
|
179
|
+
## Project Flow
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
main() or `--gui` (server mode)
|
|
183
|
+
│
|
|
184
|
+
├── startup_menu() ───────── Load/Create project, discover skills (via skills.yaml)
|
|
185
|
+
│
|
|
186
|
+
└── repl_loop() ──────────── Instantiate MemGPT chat-orchestrator
|
|
187
|
+
│
|
|
188
|
+
├── User enters command (e.g. `/help`, `/undo`) ── Dispatched to CLI commands
|
|
189
|
+
│
|
|
190
|
+
└── User enters demand ────────────────────────── MemGPT.run(user_input)
|
|
191
|
+
│
|
|
192
|
+
├── Direct chat (greetings, project status, general questions)
|
|
193
|
+
│
|
|
194
|
+
└── Request matches active skill ───────────── run_skill(name, context)
|
|
195
|
+
│
|
|
196
|
+
├── Instantiate ephemeral sub-agent (LLMAgentBlock)
|
|
197
|
+
├── Sub-agent loads SKILL.md and Level 3 scripts (e.g. implement-feature)
|
|
198
|
+
├── Sub-agent executes with tools, talks to user (dialogue interceptor)
|
|
199
|
+
└── Return result to MemGPT orchestrator
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Configuration (`agents.yaml`)
|
|
205
|
+
|
|
206
|
+
The main configuration file. Key fields and role overrides:
|
|
207
|
+
|
|
208
|
+
```yaml
|
|
209
|
+
default: ollama/ministral-3:14b # default model for all agents
|
|
210
|
+
alternative: ollama/ministral-3:14b # model for complex tasks
|
|
211
|
+
|
|
212
|
+
llm_defaults:
|
|
213
|
+
temperature: 1.0
|
|
214
|
+
max_tokens: 8128
|
|
215
|
+
num_ctx: 8192
|
|
216
|
+
|
|
217
|
+
agents:
|
|
218
|
+
# The fixed chat-orchestrator of the skills-oriented architecture.
|
|
219
|
+
memgpt:
|
|
220
|
+
temperature: 1.0
|
|
221
|
+
num_ctx: 16384
|
|
222
|
+
max_heartbeats: 20
|
|
223
|
+
|
|
224
|
+
# drives the plan→execute→review loop inside the implement-feature skill
|
|
225
|
+
orchestrator:
|
|
226
|
+
temperature: 1.0
|
|
227
|
+
num_ctx: 16384
|
|
228
|
+
max_heartbeats: 20
|
|
229
|
+
strategy: workflow
|
|
230
|
+
|
|
231
|
+
# executes each task command with code editing tools
|
|
232
|
+
worker:
|
|
233
|
+
temperature: 1.0
|
|
234
|
+
max_tokens: 8128
|
|
235
|
+
num_ctx: 16384
|
|
236
|
+
reasoning_effort: "none" # Must stay "none" for tool-calling integration
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Full per-agent overrides for `temperature`, `max_tokens`, `num_ctx`, `reasoning_effort`, and `debug` are supported for every agent role.
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Benchmark
|
|
244
|
+
|
|
245
|
+
A JS bug-fix benchmark is included in `scripts/`:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
# Collect instances from GitHub (requires gh CLI authenticated)
|
|
249
|
+
python scripts/collect_jsbench.py --limit 50 --out datasets/jsbench
|
|
250
|
+
|
|
251
|
+
# Evaluate OpalaCoder on collected instances
|
|
252
|
+
python scripts/eval_jsbench.py --limit 10
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Results are written to `datasets/jsbench_results.json` with per-instance pass/fail and a summary fix rate.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Build & Test
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
python -m pytest tests/ -q
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## License
|
|
268
|
+
|
|
269
|
+
MIT
|