eca
eca copied to clipboard
Modular ECA
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
The idea is to have ECA server be more modular like pi and deepseek harness. Being modular means most ECA featuress will be modules itself which can be toggled and users can add more modules to have more custom behavior, ECA already has plugins which does that but plugins mainly change config (which is quite extensible already), but having a modular definition makes easier to understand what can be expanded and makes maintaining eca easier.
example of module a user can define (API not defined yet):
(def module
{;; 1. identity (only :id is required)
:id :acme/jira :description "..." :version "0.1.0" :api 1
;; 2. dependencies
:requires #{:eca/compaction}
;; 3. config the user can set
:config {:url {:type :string :doc "Jira base URL"}}
;; 4. lifecycle
:start (fn [ctx] state) :stop (fn [ctx])
;; 5. contributions, merged into ECA's registries
:tools {} :commands {} :prompts {} :providers {} :apis {} :mcp-servers {} :agents {} :skills [] :rules []
;; 6. hooks: many listeners can react
:hooks {:tool/before-call (fn [ctx event] nil-or-changes)}
;; 7. strategies: wrap or replace one behavior
:strategies {:chat/compact (fn [ctx input next] output)}
;; 8. extension points this module offers to other modules
:defines {:hooks {} :strategies {}}})