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 | 6676ff5ae1141dd37a11cfaa1dc07c8d24dcbf76 (patch) | |
| tree | b66cd84fc66d21daac2333b9f7c6b4ee54370ed9 /extension/react-app/src/hooks | |
| parent | 19769044e875295c2e247dfd4c9d91ab1bf5dc28 (diff) | |
| parent | 221d352e149a9b09e48010f14e98049bada2e7eb (diff) | |
| download | sncontinue-6676ff5ae1141dd37a11cfaa1dc07c8d24dcbf76.tar.gz sncontinue-6676ff5ae1141dd37a11cfaa1dc07c8d24dcbf76.tar.bz2 sncontinue-6676ff5ae1141dd37a11cfaa1dc07c8d24dcbf76.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; | 
