Skip to content

Commit a80e020

Browse files
committed
Support for commands
1 parent 13d1517 commit a80e020

File tree

18 files changed

+415
-221
lines changed

18 files changed

+415
-221
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
## Unreleased
44

55
- Fix openai api key read from config.
6+
- Support commands via `/`.
7+
- Support MCP prompts via commands.
68

79
## 0.11.2
810

docs/features.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ Here are the current supported contexts types:
4242
- `directory`: a directory in the workspace, server will read all file contexts and pass to LLM.
4343
- `repoMap`: a summary view of workspaces files and folders, server will calculate this and pass to LLM. Currently, the repo-map includes only the file paths in git.
4444

45+
### Commands
46+
47+
Eca supports commands that usually arer triggered via `/` in the chat, completing in the chat will show the known commands which include ECA commands and MCP prompts.
48+
4549
## Completion
4650

4751
Soon

docs/models.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## Built-in providers and capabilities
44

5-
| model | MCP / tools | thinking/reasioning | prompt caching | web_search |
6-
|-----------|-------------|---------------------|----------------|------------|
7-
| OpenAI || X | X ||
8-
| Anthropic || X |||
9-
| Ollama || X | X | X |
5+
| model | MCP / tools | MCP prompts | thinking/reasioning | prompt caching | web_search |
6+
|-----------|-------------|-------------|---------------------|----------------|------------|
7+
| OpenAI || | X | X ||
8+
| Anthropic || | X |||
9+
| Ollama || | X | X | X |
1010

1111
### OpenAI
1212

docs/protocol.md

Lines changed: 87 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -626,14 +626,62 @@ interface ToolCallRejected {
626626
type ToolCallOrigin = 'mcp' | 'native';
627627
```
628628

629+
### Chat approve tool call (➡️)
630+
631+
A client notification for server to approve a waiting tool call.
632+
This will execute the tool call and continue the LLM chat loop.
633+
634+
_Notification:_
635+
636+
* method: `chat/toolCallApprove`
637+
* params: `ChatToolCallApproveParams` defined as follows:
638+
639+
```typescript
640+
interface ChatToolCallApproveParams {
641+
/**
642+
* The chat session identifier.
643+
*/
644+
chatId: string;
645+
646+
/**
647+
* The tool call identifier to approve.
648+
*/
649+
toolCallId: string;
650+
}
651+
```
652+
653+
### Chat reject tool call (➡️)
654+
655+
A client notification for server to reject a waiting tool call.
656+
This will not execute the tool call and return to the LLM chat loop.
657+
658+
_Notification:_
659+
660+
* method: `chat/toolCallReject`
661+
* params: `ChatToolCallRejectParams` defined as follows:
662+
663+
```typescript
664+
interface ChatToolCallRejectParams {
665+
/**
666+
* The chat session identifier.
667+
*/
668+
chatId: string;
669+
670+
/**
671+
* The tool call identifier to reject.
672+
*/
673+
toolCallId: string;
674+
}
675+
```
676+
629677
### Chat Query Context (↩️)
630678

631-
A request sent from client to server, querying for the available context to user add to prompt calls.
679+
A request sent from client to server, querying for all the available contexts for user add to prompt calls.
632680

633681
_Request:_
634682

635683
* method: `chat/queryContext`
636-
* params: `ChatQueryParams` defined as follows:
684+
* params: `ChatQueryContextParams` defined as follows:
637685

638686
```typescript
639687
interface ChatQueryContextParams {
@@ -670,51 +718,65 @@ interface ChatQueryContextResponse {
670718
}
671719
```
672720

673-
### Chat approve tool call (➡️)
721+
### Chat Query Commands (↩️)
674722

675-
A client notification for server to approve a waiting tool call.
676-
This will execute the tool call and continue the LLM chat loop.
723+
A request sent from client to server, querying for all the available commands for user to call.
724+
Commands are multiple possible actions like MCP prompts, doctor, costs. Usually the
725+
UX follows `/<command>` to spawn a command.
677726

678-
_Notification:_
727+
_Request:_
679728

680-
* method: `chat/toolCallApprove`
681-
* params: `ChatToolCallApproveParams` defined as follows:
729+
* method: `chat/queryCommands`
730+
* params: `ChatQueryCommandsParams` defined as follows:
682731

683732
```typescript
684-
interface ChatToolCallApproveParams {
733+
interface ChatQueryCommandsParams {
685734
/**
686735
* The chat session identifier.
687736
*/
688-
chatId: string;
689-
737+
chatId?: string;
738+
690739
/**
691-
* The tool call identifier to approve.
740+
* The query to filter results, blank string returns all available commands.
692741
*/
693-
toolCallId: string;
742+
query: string;
694743
}
695744
```
696745

697-
### Chat reject tool call (➡️)
746+
_Response:_
698747

699-
A client notification for server to reject a waiting tool call.
700-
This will not execute the tool call and return to the LLM chat loop.
748+
```typescript
749+
interface ChatQueryCommandsResponse {
750+
/**
751+
* The chat session identifier.
752+
*/
753+
chatId?: string;
701754

702-
_Notification:_
755+
/**
756+
* The returned available Commands.
757+
*/
758+
commands: ChatCommand[];
759+
}
703760

704-
* method: `chat/toolCallReject`
705-
* params: `ChatToolCallRejectParams` defined as follows:
761+
interface ChatCommand {
762+
/**
763+
* The name of the command.
764+
*/
765+
name: string;
706766

707-
```typescript
708-
interface ChatToolCallRejectParams {
709767
/**
710-
* The chat session identifier.
768+
* The description of the command.
711769
*/
712-
chatId: string;
770+
description: string;
713771

714772
/**
715-
* The tool call identifier to reject.
773+
* The arguments of the command.
716774
*/
717-
toolCallId: string;
775+
arguments: [{
776+
name: string;
777+
description?: string;
778+
required: boolean;
779+
}];
718780
}
719781
```
720782

0 commit comments

Comments
 (0)