summaryrefslogtreecommitdiff
path: root/extension/react-app/src/hooks
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-06-12 13:18:16 -0700
committerNate Sesti <sestinj@gmail.com>2023-06-12 13:18:16 -0700
commita13cb867ec0ea831d78e6d928463bd256babced5 (patch)
treea7f16db0f260bc93196fc67e885cbd9054fe91f7 /extension/react-app/src/hooks
parent0851b826c069cbdd1706a4107feb90f0ffa13129 (diff)
downloadsncontinue-a13cb867ec0ea831d78e6d928463bd256babced5.tar.gz
sncontinue-a13cb867ec0ea831d78e6d928463bd256babced5.tar.bz2
sncontinue-a13cb867ec0ea831d78e6d928463bd256babced5.zip
clear history and delete step buttons
Diffstat (limited to 'extension/react-app/src/hooks')
-rw-r--r--extension/react-app/src/hooks/ContinueGUIClientProtocol.ts6
-rw-r--r--extension/react-app/src/hooks/useContinueGUIProtocol.ts8
2 files changed, 14 insertions, 0 deletions
diff --git a/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts b/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts
index 18a91de7..71303c70 100644
--- a/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts
+++ b/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts
@@ -8,6 +8,12 @@ abstract class AbstractContinueGUIClientProtocol {
abstract sendStepUserInput(input: string, index: number): void;
abstract onStateUpdate(state: any): 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..a8e28fc5 100644
--- a/extension/react-app/src/hooks/useContinueGUIProtocol.ts
+++ b/extension/react-app/src/hooks/useContinueGUIProtocol.ts
@@ -45,9 +45,17 @@ class ContinueGUIClientProtocol extends AbstractContinueGUIClientProtocol {
});
}
+ 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;