Skip to content

Commit 425f0a9

Browse files
committed
docs
1 parent 0340c9d commit 425f0a9

File tree

1 file changed

+48
-5
lines changed

1 file changed

+48
-5
lines changed

docs/protocol.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The protocol defines a set of lifecycle messages that manage the connection and
5353

5454
=== "Initialization flow"
5555

56-
The following timeline illustrates the typical initialize handshake between client and server, including the actions done by server after initialization.
56+
Handshake between client and server, including the actions done by server after initialization.
5757

5858
```mermaid
5959
sequenceDiagram
@@ -62,13 +62,29 @@ The protocol defines a set of lifecycle messages that manage the connection and
6262
participant S as ECA Server
6363
C->>+S: initialize (request)
6464
Note right of S: Save workspace-folders/capabilties
65-
S-->>-C: initialize (response)
66-
C->>+S: initialized (notification)
65+
S->>-C: initialize (response)
66+
C--)+S: initialized (notification)
6767
Note right of S: Sync models: Request models.dev <br/>for models capabilities
6868
Note right of S: Notify which models/behaviors are <br/>avaialble and their defaults.
69-
S->>C: config/updated (notification)
69+
S--)C: config/updated (notification)
7070
Note right of S: Init MCP servers
71-
S->>-C: tool/serverUpdated (notification)
71+
S--)-C: tool/serverUpdated (notification)
72+
```
73+
74+
=== "Shutdown flow"
75+
76+
Shutdown process between client and server
77+
78+
```mermaid
79+
sequenceDiagram
80+
autonumber
81+
participant C as Client / Editor
82+
participant S as ECA Server
83+
C->>+S: shutdown (request)
84+
Note right of S: Finish MCP servers process
85+
S-->>-C: shutdown (response)
86+
C->>+S: exit (notification)
87+
Note right of S: Server stops its process
7288
```
7389

7490
### Initialize (↩️)
@@ -219,6 +235,33 @@ _Notification:_
219235

220236
## Code Assistant Features
221237

238+
=== "Chat: simple"
239+
240+
Example of a basic chat conversation with only texts:
241+
242+
```mermaid
243+
sequenceDiagram
244+
autonumber
245+
participant C as Client / Editor
246+
participant S as ECA Server
247+
participant L as LLM
248+
C->>+S: chat/prompt
249+
Note over C,S: User sends: Hello there!
250+
S->>C: chat/contentReceived (system: start)
251+
Note right of S: Parse contexts,<br/>renew login,<br/>prepare prompt
252+
S->>+L: Send prompt
253+
S-->>-C: chat/prompt
254+
Note over C,S: Request sent to LLM
255+
loop LLM streaming
256+
Note right of L: Returns first `Hel`,<br/>then `lo`, etc
257+
L-->>S: Stream data
258+
S->>C: chat/contentReceived (assistant: text)
259+
260+
end
261+
L->>-S: Finish response
262+
S->>C: chat/contentReceived (system: finished)
263+
```
264+
222265
### Chat Prompt (↩️)
223266

224267
A request sent from client to server, starting or continuing a chat in natural language as an agent.

0 commit comments

Comments
 (0)