Skip to content

Commit 432784a

Browse files
committed
docs
1 parent e8b7282 commit 432784a

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

docs/development.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,52 @@
11
# ECA Development
22

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+
350
## Coding
451

552
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:
4592
- [ ] Basic plugin/extension documentation
4693
```
4794

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

Comments
 (0)