diff options
author | Nate Sesti <33237525+sestinj@users.noreply.github.com> | 2023-06-12 21:36:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-12 21:36:11 -0700 |
commit | 297511b5e3ba67e3c37e5cb4c038186093da6a95 (patch) | |
tree | c850a433c3a7d594fdeabf11cabd505bb5388d40 /extension/react-app/src/hooks | |
parent | 52ffaa321ee24d2a930ac4e6ff083aaa37be79e8 (diff) | |
parent | 01cfbc179a33c99d55acdc989dbafd554db16a92 (diff) | |
download | sncontinue-297511b5e3ba67e3c37e5cb4c038186093da6a95.tar.gz sncontinue-297511b5e3ba67e3c37e5cb4c038186093da6a95.tar.bz2 sncontinue-297511b5e3ba67e3c37e5cb4c038186093da6a95.zip |
Merge pull request #76 from continuedev/superset-of-chat
Superset of chat
Diffstat (limited to 'extension/react-app/src/hooks')
-rw-r--r-- | extension/react-app/src/hooks/ContinueGUIClientProtocol.ts | 10 | ||||
-rw-r--r-- | extension/react-app/src/hooks/useContinueGUIProtocol.ts | 18 |
2 files changed, 28 insertions, 0 deletions
diff --git a/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts b/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts index 18a91de7..824bb086 100644 --- a/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts +++ b/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts @@ -8,6 +8,16 @@ abstract class AbstractContinueGUIClientProtocol { abstract sendStepUserInput(input: string, index: number): void; abstract onStateUpdate(state: any): void; + + abstract onAvailableSlashCommands( + callback: (commands: { name: string; description: string }[]) => void + ): void; + + abstract sendClear(): void; + + abstract retryAtIndex(index: number): void; + + abstract deleteAtIndex(index: number): void; } export default AbstractContinueGUIClientProtocol; diff --git a/extension/react-app/src/hooks/useContinueGUIProtocol.ts b/extension/react-app/src/hooks/useContinueGUIProtocol.ts index f27895fb..59397742 100644 --- a/extension/react-app/src/hooks/useContinueGUIProtocol.ts +++ b/extension/react-app/src/hooks/useContinueGUIProtocol.ts @@ -45,9 +45,27 @@ class ContinueGUIClientProtocol extends AbstractContinueGUIClientProtocol { }); } + onAvailableSlashCommands( + callback: (commands: { name: string; description: string }[]) => void + ) { + this.messenger.onMessageType("available_slash_commands", (data: any) => { + if (data.commands) { + callback(data.commands); + } + }); + } + + sendClear() { + this.messenger.send("clear_history", {}); + } + retryAtIndex(index: number) { this.messenger.send("retry_at_index", { index }); } + + deleteAtIndex(index: number) { + this.messenger.send("delete_at_index", { index }); + } } export default ContinueGUIClientProtocol; |