|
1 | 1 | # ECA Development |
2 | 2 |
|
| 3 | +## Project structure |
| 4 | + |
| 5 | +The ECA codebase follows a pragmatic **layered layout** that separates concerns clearly so that you can jump straight to the part you need to change. |
| 6 | + |
| 7 | +### Files overview |
| 8 | + |
| 9 | + Path | Responsibility |
| 10 | + -------------------------|------------------------------------------------------- |
| 11 | + `bb.edn` | Babashka tasks (e.g. `bb test`, `bb debug-cli`) for local workflows and CI, the main entrypoint for most tasks. |
| 12 | + `deps.edn` | Clojure dependency coordinates and aliases used by the JVM build and the native GraalVM image. |
| 13 | + `docs/` | Markdown documentation shown at https://eca.dev |
| 14 | + `src/eca/config.clj` | Centralized place to get ECA configs from multiple places. |
| 15 | + `src/eca/logger.clj` | Logger interface to log to stderr. |
| 16 | + `src/eca/shared.clj` | shared utility fns to whole project. |
| 17 | + `src/eca/db.clj` | Simple in-memory KV store that backs sessions/MCP, all in-memory statue lives here. |
| 18 | + `src/eca/llm_api.clj` | Public façade used by features to call an LLM. |
| 19 | + `src/eca/llm_providers/` | Vendor adapters (`openai.clj`, `anthropic.clj`, `ollama.clj`). |
| 20 | + `src/eca/llm_util.clj` | Token counting, chunking, rate-limit helpers. |
| 21 | + `src/eca/features/` | **High-level capabilities exposed to the editor** |
| 22 | + ├─ `chat.clj` | Streaming chat orchestration & tool-call pipeline. |
| 23 | + ├─ `prompt.clj` | Prompt templates and variable interpolation. |
| 24 | + ├─ `index.clj` | Embedding & retrieval-augmented generation helpers. |
| 25 | + ├─ `rules.clj` | Guards that enforce user-defined project rules. |
| 26 | + ├─ `tools.clj` | Registry of built-in tool descriptors (run, approve…). |
| 27 | + └─ `tools/` | Implementation of side-effectful tools: |
| 28 | + • `filesystem.clj` | read/write/edit helpers |
| 29 | + • `shell.clj` | runs user-approved shell commands |
| 30 | + • `mcp.clj` | Multi-Command Plan supervisor |
| 31 | + • `util.clj` | misc helpers shared by tools. |
| 32 | + `src/eca/messenger.clj` | To send back to client requests/notifications over stdio. |
| 33 | + `src/eca/handlers.clj` | Entrypoint for all features. |
| 34 | + `src/eca/server.clj` | stdio **entry point**; wires everything together via `lsp4clj`. |
| 35 | + `src/eca/main.clj` | The CLI interface. |
| 36 | + `src/eca/nrepl.clj` | Starts an nREPL when `:debug` flag is passed. |
| 37 | + |
| 38 | +Together these files implement the request flow: |
| 39 | +`client/editor` → `stdin JSON-RPC` → `handlers` → `features` → `llm_api` → `llm_provider` → results streamed back. |
| 40 | + |
| 41 | +With this map you can usually answer: |
| 42 | +• _“Where does request X enter the system?”_ – look in `handlers.clj`. |
| 43 | +• _“How is tool Y executed?”_ – see `src/eca/features/tools/<y>.clj`. |
| 44 | +• _“How do we talk to provider Z?”_ – adapter under `llm_providers/`. |
| 45 | + |
| 46 | +### Tests |
| 47 | + |
| 48 | +Run with `bb test` or run test via Clojure REPL. CI will run the same task. |
| 49 | + |
3 | 50 | ## Coding |
4 | 51 |
|
5 | 52 | There are several ways of finding and fixing a bug or implementing a new feature: |
@@ -45,4 +92,6 @@ This step-by-step feature implementation help track progress and next steps: |
45 | 92 | - [ ] Basic plugin/extension documentation |
46 | 93 | ``` |
47 | 94 |
|
48 | | -Create a issue to help track the effort copying and pasting these check box to help track progress. |
| 95 | +Create a issue to help track the effort copying and pasting these check box to help track progress, [example](https://github.com/editor-code-assistant/eca/issues/5). |
| 96 | + |
| 97 | +Please provide feedback of the dificulties implementing your server, especially missing docs, to make next integrations smoother! |
0 commit comments