diff options
| author | Nate Sesti <33237525+sestinj@users.noreply.github.com> | 2023-07-26 00:56:29 -0700 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-26 00:56:29 -0700 | 
| commit | def8e5612cd4c889a2e26d4152fffcf3d694abdf (patch) | |
| tree | ca423625619b9d628651bcc9a395ba8f47fa03a6 /extension/react-app/src/hooks | |
| parent | b759e2dbfe36b3e8873527b9736d64866da9b604 (diff) | |
| parent | d9a4ed993aad36464776c093333af1a310e5a492 (diff) | |
| download | sncontinue-def8e5612cd4c889a2e26d4152fffcf3d694abdf.tar.gz sncontinue-def8e5612cd4c889a2e26d4152fffcf3d694abdf.tar.bz2 sncontinue-def8e5612cd4c889a2e26d4152fffcf3d694abdf.zip | |
Merge pull request #297 from continuedev/merge-config-py-TO-main
Merge config py to main
Diffstat (limited to 'extension/react-app/src/hooks')
| -rw-r--r-- | extension/react-app/src/hooks/AbstractContinueGUIClientProtocol.ts | 10 | ||||
| -rw-r--r-- | extension/react-app/src/hooks/ContinueGUIClientProtocol.ts | 19 | 
2 files changed, 14 insertions, 15 deletions
| diff --git a/extension/react-app/src/hooks/AbstractContinueGUIClientProtocol.ts b/extension/react-app/src/hooks/AbstractContinueGUIClientProtocol.ts index 6c0df8fc..8e3735ec 100644 --- a/extension/react-app/src/hooks/AbstractContinueGUIClientProtocol.ts +++ b/extension/react-app/src/hooks/AbstractContinueGUIClientProtocol.ts @@ -1,3 +1,5 @@ +import { ContextItemId } from "../../../schema/FullState"; +  abstract class AbstractContinueGUIClientProtocol {    abstract sendMainInput(input: string): void; @@ -13,23 +15,21 @@ abstract class AbstractContinueGUIClientProtocol {      callback: (commands: { name: string; description: string }[]) => void    ): void; -  abstract changeDefaultModel(model: string): void; -    abstract sendClear(): void;    abstract retryAtIndex(index: number): void;    abstract deleteAtIndex(index: number): void; -  abstract deleteContextAtIndices(indices: number[]): void; +  abstract deleteContextWithIds(ids: ContextItemId[]): void;    abstract setEditingAtIndices(indices: number[]): void; -  abstract setPinnedAtIndices(indices: number[]): void; -    abstract toggleAddingHighlightedCode(): void;    abstract showLogsAtIndex(index: number): void; + +  abstract selectContextItem(id: string, query: string): void;  }  export default AbstractContinueGUIClientProtocol; diff --git a/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts b/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts index 7d6c2a71..b8019664 100644 --- a/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts +++ b/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts @@ -1,3 +1,4 @@ +import { ContextItemId } from "../../../schema/FullState";  import AbstractContinueGUIClientProtocol from "./AbstractContinueGUIClientProtocol";  import { Messenger, WebsocketMessenger } from "./messenger";  import { VscodeMessenger } from "./vscodeMessenger"; @@ -52,10 +53,6 @@ class ContinueGUIClientProtocol extends AbstractContinueGUIClientProtocol {      });    } -  changeDefaultModel(model: string) { -    this.messenger.send("change_default_model", { model }); -  } -    sendClear() {      this.messenger.send("clear_history", {});    } @@ -68,18 +65,16 @@ class ContinueGUIClientProtocol extends AbstractContinueGUIClientProtocol {      this.messenger.send("delete_at_index", { index });    } -  deleteContextAtIndices(indices: number[]) { -    this.messenger.send("delete_context_at_indices", { indices }); +  deleteContextWithIds(ids: ContextItemId[]) { +    this.messenger.send("delete_context_with_ids", { +      ids: ids.map((id) => `${id.provider_title}-${id.item_id}`), +    });    }    setEditingAtIndices(indices: number[]) {      this.messenger.send("set_editing_at_indices", { indices });    } -  setPinnedAtIndices(indices: number[]) { -    this.messenger.send("set_pinned_at_indices", { indices }); -  } -    toggleAddingHighlightedCode(): void {      this.messenger.send("toggle_adding_highlighted_code", {});    } @@ -87,6 +82,10 @@ class ContinueGUIClientProtocol extends AbstractContinueGUIClientProtocol {    showLogsAtIndex(index: number): void {      this.messenger.send("show_logs_at_index", { index });    } + +  selectContextItem(id: string, query: string): void { +    this.messenger.send("select_context_item", { id, query }); +  }  }  export default ContinueGUIClientProtocol; | 
