summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-06-02 01:05:59 -0400
committerNate Sesti <sestinj@gmail.com>2023-06-02 01:05:59 -0400
commit7f28abee0312c675e11e35ca9f2101ab2ef17c07 (patch)
treea5e83c40b42894f8cd50a4f76845e33715240394
parentf82ccddd3bc10093fea497ab15e8c1ae132ce66d (diff)
downloadsncontinue-7f28abee0312c675e11e35ca9f2101ab2ef17c07.tar.gz
sncontinue-7f28abee0312c675e11e35ca9f2101ab2ef17c07.tar.bz2
sncontinue-7f28abee0312c675e11e35ca9f2101ab2ef17c07.zip
notebook -> gui
-rw-r--r--continuedev/src/continuedev/core/autopilot.py (renamed from continuedev/src/continuedev/core/agent.py)0
-rw-r--r--continuedev/src/continuedev/plugins/__init__.py26
-rw-r--r--continuedev/src/continuedev/plugins/load.py21
-rw-r--r--continuedev/src/continuedev/plugins/policy/__init__.py4
-rw-r--r--continuedev/src/continuedev/plugins/policy/hookspecs.py10
-rw-r--r--continuedev/src/continuedev/plugins/policy/libs/__init__.py0
-rw-r--r--continuedev/src/continuedev/plugins/policy/libs/alternate.py20
-rw-r--r--continuedev/src/continuedev/plugins/step/__init__.py4
-rw-r--r--continuedev/src/continuedev/plugins/step/hookspecs.py15
-rw-r--r--continuedev/src/continuedev/plugins/step/libs/__init__.py0
-rw-r--r--continuedev/src/continuedev/plugins/step/libs/hello_world.py9
-rw-r--r--continuedev/src/continuedev/server/gui.py (renamed from continuedev/src/continuedev/server/notebook.py)8
-rw-r--r--continuedev/src/continuedev/server/gui_protocol.py (renamed from continuedev/src/continuedev/server/notebook_protocol.py)2
-rw-r--r--continuedev/src/continuedev/server/ide.py16
-rw-r--r--continuedev/src/continuedev/server/ide_protocol.py12
-rw-r--r--continuedev/src/continuedev/server/main.py4
-rw-r--r--docs/docs/concepts/agent.md8
-rw-r--r--docs/docs/concepts/autopilot.md30
-rw-r--r--docs/docs/concepts/gui.md4
-rw-r--r--docs/docs/concepts/ide.md14
-rw-r--r--docs/docs/how-continue-works.md37
-rw-r--r--extension/react-app/src/App.tsx6
-rw-r--r--extension/react-app/src/hooks/ContinueGUIClientProtocol.ts (renamed from extension/react-app/src/hooks/ContinueNotebookClientProtocol.ts)4
-rw-r--r--extension/react-app/src/hooks/useContinueGUIProtocol.ts (renamed from extension/react-app/src/hooks/useContinueNotebookProtocol.ts)6
-rw-r--r--extension/react-app/src/hooks/useWebsocket.ts16
-rw-r--r--extension/react-app/src/tabs/gui.tsx (renamed from extension/react-app/src/tabs/notebook.tsx)16
-rw-r--r--extension/src/activation/activate.ts4
-rw-r--r--extension/src/commands.ts4
-rw-r--r--extension/src/continueIdeClient.ts8
29 files changed, 129 insertions, 179 deletions
diff --git a/continuedev/src/continuedev/core/agent.py b/continuedev/src/continuedev/core/autopilot.py
index 6e920ab4..6e920ab4 100644
--- a/continuedev/src/continuedev/core/agent.py
+++ b/continuedev/src/continuedev/core/autopilot.py
diff --git a/continuedev/src/continuedev/plugins/__init__.py b/continuedev/src/continuedev/plugins/__init__.py
deleted file mode 100644
index 0ce6d079..00000000
--- a/continuedev/src/continuedev/plugins/__init__.py
+++ /dev/null
@@ -1,26 +0,0 @@
-from typing import List
-import pluggy
-from .step import hookspecs
-from .step.libs import hello_world
-
-builtin_libs = [hello_world]
-
-def get_plugin_manager(use_plugins: List[str]) -> pluggy.PluginManager:
- pm = pluggy.PluginManager("continue.step")
- pm.add_hookspecs(hookspecs)
- pm.load_setuptools_entrypoints("continue.step")
-
- # Only use plugins that are specified in the config file
- for plugin, name in pm.list_name_plugin():
- if name not in use_plugins:
- pm.set_blocked(plugin)
-
- # Print warning if plugin not found
- for name in use_plugins:
- if not pm.has_plugin(name):
- print(f"Plugin {name} not found.")
-
- for lib in builtin_libs:
- pm.register(lib)
-
- return pm \ No newline at end of file
diff --git a/continuedev/src/continuedev/plugins/load.py b/continuedev/src/continuedev/plugins/load.py
deleted file mode 100644
index adbaad09..00000000
--- a/continuedev/src/continuedev/plugins/load.py
+++ /dev/null
@@ -1,21 +0,0 @@
-def load_validator_plugin(config: ValidatorPluginConfig) -> Validator:
- if config.name == "continue.tb_validator":
- return PythonTracebackValidator(config.cmd, config.cwd)
- elif config.name == "continue.pytest_validator":
- return PytestValidator(cwd=config.cwd)
- else:
- raise KeyError("Unknown validator plugin name")
-
-def load_llm_plugin(config: LLMPluginConfig) -> LLM:
- if config.provider == "openai":
- return OpenAI(api_key=config.api_key)
- else:
- raise KeyError("Unknown LLM provider: " + config.provider)
-
-def load_policy_plugin(config: PolicyPluginConfig) -> Policy:
- if config.name == "continue.random_policy":
- return RandomPolicy()
- elif config.name == "continue.dfs_policy":
- return DFSPolicy()
- else:
- raise KeyError("Unknown policy plugin name") \ No newline at end of file
diff --git a/continuedev/src/continuedev/plugins/policy/__init__.py b/continuedev/src/continuedev/plugins/policy/__init__.py
deleted file mode 100644
index b9722bae..00000000
--- a/continuedev/src/continuedev/plugins/policy/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-import pluggy
-
-hookimpl = pluggy.HookimplMarker("continue.policy")
-"""Marker to be imported and used in plugins (and for own implementations)""" \ No newline at end of file
diff --git a/continuedev/src/continuedev/plugins/policy/hookspecs.py b/continuedev/src/continuedev/plugins/policy/hookspecs.py
deleted file mode 100644
index abe932d3..00000000
--- a/continuedev/src/continuedev/plugins/policy/hookspecs.py
+++ /dev/null
@@ -1,10 +0,0 @@
-from typing import List, Tuple
-import pluggy
-from ...libs.policy import Policy, Step
-
-hookspec = pluggy.HookspecMarker("continue.policy")
-
-class PolicyPlugin(Policy):
- @hookspec
- def next(self) -> Step:
- """Get the next step to run""" \ No newline at end of file
diff --git a/continuedev/src/continuedev/plugins/policy/libs/__init__.py b/continuedev/src/continuedev/plugins/policy/libs/__init__.py
deleted file mode 100644
index e69de29b..00000000
--- a/continuedev/src/continuedev/plugins/policy/libs/__init__.py
+++ /dev/null
diff --git a/continuedev/src/continuedev/plugins/policy/libs/alternate.py b/continuedev/src/continuedev/plugins/policy/libs/alternate.py
deleted file mode 100644
index 3087c059..00000000
--- a/continuedev/src/continuedev/plugins/policy/libs/alternate.py
+++ /dev/null
@@ -1,20 +0,0 @@
-from plugins import policy
-from ....core.main import History, Step
-
-
-class AlternatingPolicy:
- """A Policy that alternates between two steps."""
-
- def __init__(self, first: Step, second: Step):
- self.first = first
- self.second = second
- self.last_was_first = False
-
- @policy.hookimpl
- def next(self, history: History) -> Step:
- if self.last_was_first:
- self.last_was_first = False
- return self.second
- else:
- self.last_was_first = True
- return self.first
diff --git a/continuedev/src/continuedev/plugins/step/__init__.py b/continuedev/src/continuedev/plugins/step/__init__.py
deleted file mode 100644
index e6d8cd3b..00000000
--- a/continuedev/src/continuedev/plugins/step/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-import pluggy
-
-hookimpl = pluggy.HookimplMarker("continue.step")
-"""Marker to be imported and used in plugins (and for own implementations)""" \ No newline at end of file
diff --git a/continuedev/src/continuedev/plugins/step/hookspecs.py b/continuedev/src/continuedev/plugins/step/hookspecs.py
deleted file mode 100644
index a5714fc5..00000000
--- a/continuedev/src/continuedev/plugins/step/hookspecs.py
+++ /dev/null
@@ -1,15 +0,0 @@
-from typing import Coroutine
-import pluggy
-from ...core.main import Step
-from ...core.observation import Observation
-from ...core.sdk import ContinueSDK
-
-hookspec = pluggy.HookspecMarker("continue.step")
-
-# Perhaps Actions should be generic about what their inputs must be.
-
-
-class StepPlugin(Step):
- @hookspec
- async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
- """Run"""
diff --git a/continuedev/src/continuedev/plugins/step/libs/__init__.py b/continuedev/src/continuedev/plugins/step/libs/__init__.py
deleted file mode 100644
index e69de29b..00000000
--- a/continuedev/src/continuedev/plugins/step/libs/__init__.py
+++ /dev/null
diff --git a/continuedev/src/continuedev/plugins/step/libs/hello_world.py b/continuedev/src/continuedev/plugins/step/libs/hello_world.py
deleted file mode 100644
index 72255bfd..00000000
--- a/continuedev/src/continuedev/plugins/step/libs/hello_world.py
+++ /dev/null
@@ -1,9 +0,0 @@
-from ....plugins import step
-from ....libs.steps import ContinueSDK
-
-
-class HelloWorldStep:
- """A Step that prints "Hello World!"."""
- @step.hookimpl
- def run(sdk: ContinueSDK):
- print("Hello World!")
diff --git a/continuedev/src/continuedev/server/notebook.py b/continuedev/src/continuedev/server/gui.py
index 8ebe2853..3d1a5a82 100644
--- a/continuedev/src/continuedev/server/notebook.py
+++ b/continuedev/src/continuedev/server/gui.py
@@ -5,13 +5,13 @@ from pydantic import BaseModel
from uvicorn.main import Server
from .session_manager import SessionManager, session_manager, Session
-from .notebook_protocol import AbstractNotebookProtocolServer
+from .gui_protocol import AbstractGUIProtocolServer
from ..libs.util.queue import AsyncSubscriptionQueue
import asyncio
import nest_asyncio
nest_asyncio.apply()
-router = APIRouter(prefix="/notebook", tags=["notebook"])
+router = APIRouter(prefix="/gui", tags=["gui"])
# Graceful shutdown by closing websockets
original_handler = Server.handle_exit
@@ -43,7 +43,7 @@ T = TypeVar("T", bound=BaseModel)
# You should probably abstract away the websocket stuff into a separate class
-class NotebookProtocolServer(AbstractNotebookProtocolServer):
+class GUIProtocolServer(AbstractGUIProtocolServer):
websocket: WebSocket
session: Session
sub_queue: AsyncSubscriptionQueue = AsyncSubscriptionQueue()
@@ -107,7 +107,7 @@ async def websocket_endpoint(websocket: WebSocket, session: Session = Depends(we
print("Session started")
session_manager.register_websocket(session.session_id, websocket)
- protocol = NotebookProtocolServer(session)
+ protocol = GUIProtocolServer(session)
protocol.websocket = websocket
# Update any history that may have happened before connection
diff --git a/continuedev/src/continuedev/server/notebook_protocol.py b/continuedev/src/continuedev/server/gui_protocol.py
index c2be82e0..e32d80ef 100644
--- a/continuedev/src/continuedev/server/notebook_protocol.py
+++ b/continuedev/src/continuedev/server/gui_protocol.py
@@ -2,7 +2,7 @@ from typing import Any
from abc import ABC, abstractmethod
-class AbstractNotebookProtocolServer(ABC):
+class AbstractGUIProtocolServer(ABC):
@abstractmethod
async def handle_json(self, data: Any):
"""Handle a json message"""
diff --git a/continuedev/src/continuedev/server/ide.py b/continuedev/src/continuedev/server/ide.py
index 32f0b3ba..71017ce0 100644
--- a/continuedev/src/continuedev/server/ide.py
+++ b/continuedev/src/continuedev/server/ide.py
@@ -12,7 +12,7 @@ from ..models.filesystem import FileSystem, RangeInFile, EditDiff, RealFileSyste
from ..models.main import Traceback
from ..models.filesystem_edit import AddDirectory, AddFile, DeleteDirectory, DeleteFile, FileSystemEdit, FileEdit, FileEditWithFullContents, RenameDirectory, RenameFile, SequentialFileSystemEdit
from pydantic import BaseModel
-from .notebook import SessionManager, session_manager
+from .gui import SessionManager, session_manager
from .ide_protocol import AbstractIdeProtocolServer
@@ -106,8 +106,8 @@ class IdeProtocolServer(AbstractIdeProtocolServer):
return resp_model.parse_obj(resp)
async def handle_json(self, message_type: str, data: Any):
- if message_type == "openNotebook":
- await self.openNotebook()
+ if message_type == "openGUI":
+ await self.openGUI()
elif message_type == "setFileOpen":
await self.setFileOpen(data["filepath"], data["open"])
elif message_type == "fileEdits":
@@ -131,9 +131,9 @@ class IdeProtocolServer(AbstractIdeProtocolServer):
"open": open
})
- async def openNotebook(self):
+ async def openGUI(self):
session_id = self.session_manager.new_session(self)
- await self._send_json("openNotebook", {
+ await self._send_json("openGUI", {
"sessionId": session_id
})
@@ -148,7 +148,7 @@ class IdeProtocolServer(AbstractIdeProtocolServer):
self._receive_json(ShowSuggestionResponse)
for i in range(len(suggestions))
]) # WORKING ON THIS FLOW HERE. Fine now to just await for response, instead of doing something fancy with a "waiting" state on the autopilot.
- # Just need connect the suggestionId to the IDE (and the notebook)
+ # Just need connect the suggestionId to the IDE (and the gui)
return any([r.accepted for r in responses])
# ------------------------------- #
@@ -168,11 +168,11 @@ class IdeProtocolServer(AbstractIdeProtocolServer):
# Access to Autopilot (so SessionManager)
pass
- def onCloseNotebook(self, session_id: str):
+ def onCloseGUI(self, session_id: str):
# Accesss to SessionManager
pass
- def onOpenNotebookRequest(self):
+ def onOpenGUIRequest(self):
pass
def onFileEdits(self, edits: List[FileEditWithFullContents]):
diff --git a/continuedev/src/continuedev/server/ide_protocol.py b/continuedev/src/continuedev/server/ide_protocol.py
index 15d019b4..4f505e80 100644
--- a/continuedev/src/continuedev/server/ide_protocol.py
+++ b/continuedev/src/continuedev/server/ide_protocol.py
@@ -24,8 +24,8 @@ class AbstractIdeProtocolServer(ABC):
"""Set whether a file is open"""
@abstractmethod
- async def openNotebook(self):
- """Open a notebook"""
+ async def openGUI(self):
+ """Open a GUI"""
@abstractmethod
async def showSuggestionsAndWait(self, suggestions: List[FileEdit]) -> bool:
@@ -44,12 +44,12 @@ class AbstractIdeProtocolServer(ABC):
"""Called when a file system update is received"""
@abstractmethod
- def onCloseNotebook(self, session_id: str):
- """Called when a notebook is closed"""
+ def onCloseGUI(self, session_id: str):
+ """Called when a GUI is closed"""
@abstractmethod
- def onOpenNotebookRequest(self):
- """Called when a notebook is requested to be opened"""
+ def onOpenGUIRequest(self):
+ """Called when a GUI is requested to be opened"""
@abstractmethod
async def getOpenFiles(self) -> List[str]:
diff --git a/continuedev/src/continuedev/server/main.py b/continuedev/src/continuedev/server/main.py
index 1ffe1450..7b7124de 100644
--- a/continuedev/src/continuedev/server/main.py
+++ b/continuedev/src/continuedev/server/main.py
@@ -2,14 +2,14 @@ import os
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from .ide import router as ide_router
-from .notebook import router as notebook_router
+from .gui import router as gui_router
import uvicorn
import argparse
app = FastAPI()
app.include_router(ide_router)
-app.include_router(notebook_router)
+app.include_router(gui_router)
# Add CORS support
app.add_middleware(
diff --git a/docs/docs/concepts/agent.md b/docs/docs/concepts/agent.md
deleted file mode 100644
index bbcc6f57..00000000
--- a/docs/docs/concepts/agent.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Autopilot
-
-`Autopilot` contains the
-
-- History
-- LLM
-- Policy
-- IDE
diff --git a/docs/docs/concepts/autopilot.md b/docs/docs/concepts/autopilot.md
new file mode 100644
index 00000000..71090eb0
--- /dev/null
+++ b/docs/docs/concepts/autopilot.md
@@ -0,0 +1,30 @@
+# Autopilot
+
+**TODO: Better explain in one sentence what this is and what its purpose is**
+
+:::info
+The **autopilot** is the main loop, completing steps and then deciding the next step and repeating
+:::
+
+## Details
+
+The Autopilot class is the center of Continue. Every step is initiated from the Autopilot, which provides it with a ContinueSDK.
+
+- Records history
+- Allows reversal
+- Injects SDK
+- Has policy to decide what step to take next
+- Accepts user input and acts on it
+- Main event loop
+- Contains main classes that are provided through the SDK, including LLM, History, IDE
+
+---
+
+- An autopilot takes user input from the React app
+- You can see this happening in `server/gui.py`
+- It basically queues user inputs, pops off the most recent, runs that as a "UserInputStep", uses its Policy to run other steps until the next step is None, and then pops off the next user input. When nothing left, just waits for more
+- `Autopilot` contains the
+ - History
+ - LLM
+ - Policy
+ - IDE
diff --git a/docs/docs/concepts/gui.md b/docs/docs/concepts/gui.md
index dfdc2a7a..f9cff697 100644
--- a/docs/docs/concepts/gui.md
+++ b/docs/docs/concepts/gui.md
@@ -3,11 +3,11 @@
The `GUI` enables you to guide steps and makes everything transparent, so you can review all steps that were automated, giving you the opportunity to undo and rerun any that ran incorrectly.
**From GUI to Core**
+
- Natural language instructions from the developer
- Hover / clicked on a step
- Other user input
**From Core to GUI**
-- Updates to state (e.g. a new step)
-**Q: do we call this the Continue GUI or Notebook?** \ No newline at end of file
+- Updates to state (e.g. a new step)
diff --git a/docs/docs/concepts/ide.md b/docs/docs/concepts/ide.md
index 980b589d..4684c362 100644
--- a/docs/docs/concepts/ide.md
+++ b/docs/docs/concepts/ide.md
@@ -24,9 +24,9 @@ Get the workspace directory
Set whether a file is open
-### openNotebook
+### openGUI
-Open a notebook
+Open a gui
### showSuggestionsAndWait
@@ -44,13 +44,13 @@ Called when a traceback is received
Called when a file system update is received
-### onCloseNotebook
+### onCloseGUI
-Called when a notebook is closed
+Called when a gui is closed
-### onOpenNotebookRequest
+### onOpenGUIRequest
-Called when a notebook is requested to be opened
+Called when a gui is requested to be opened
### getOpenFiles
@@ -78,4 +78,4 @@ Apply a file edit
### saveFile
-Save a file \ No newline at end of file
+Save a file
diff --git a/docs/docs/how-continue-works.md b/docs/docs/how-continue-works.md
new file mode 100644
index 00000000..e6648cbc
--- /dev/null
+++ b/docs/docs/how-continue-works.md
@@ -0,0 +1,37 @@
+# How `Continue` works
+
+![Continue Architecture Diagram](/img/continue-architecture.png)
+
+## Overview
+
+The `Continue` library consists of an [SDK](./concepts/sdk.md), a [GUI](./concepts/gui.md), and a [Core](./concepts/core.md) that brings everything together.
+
+The [SDK](./concepts/sdk.md) gives you access to the tools (e.g. open a directory, edit a file, call a model, etc.) needed to define steps that integrate LLMs into your IDE.
+
+The [GUI](./concepts/gui.md) lets you transparently review every automated step, providing the opportunity to undo and rerun any that ran incorrectly.
+
+The [Core](./concepts/core.md) holds the main event loop, responsible for connecting IDE, SDK, and GUI and deciding which steps to take next.
+
+## Details
+
+**TODO: Refactor all of this and make it fit with language above**
+
+- Continue connects any code editor (primarily VS Code right now) to a server (the Continue server) that can take actions in the editor in accordance with defined recipes at the request of a user through the GUI
+- What this looks like:
+ - The Continue VS Code extension runs the ContinueIdeProtocol, launches the Continue Python server in the background, and opens the Continue GUI in a side-panel.
+ - The Continue server is the brain, communication center, and source of truth, interacting with VS Code through the ContinueIdeProtocol and with the GUI through the GUIProtocol.
+ - Communication between the extension and GUI happens through the Continue server.
+ - When you type a natural language command in the GUI, this is sent to the Continue server, where the `Autopilot` class takes action, potentially using the ContinueIdeProtocol to request actions be taken in the IDE, and then updates the GUI to display the new history.
+- `core` directory contains major concepts
+ - This includes Autopilot, Policy, SDK (all in their own files so far)
+ - It also includes `main.py`, which contains History, HistoryNode, Step, and others
+ - You'll find `env.py` here too, which is a common place to load environment variables, which can then be imported from here
+- `libs` contains misc. stuff
+- `llm` for language model utilities
+- `steps` for builtin Continue steps
+- `util` for very misc. stuff
+- `chroma` for chroma code that deals with codebase embeddings
+- `models` contains all the Pydantic models and `generate_json_schema.py`, a script that converts them to JSONSchema .json files in `schema/json`
+- `server` runs the servers that communicate with a) the React app (`gui.py`) and b) the IDE (`ide.py`)
+- `ide_protocol.py` is just the abstract version of what is implemented in `ide.py`, and `main.py` runs both `gui.py` and `ide.py` as a single FastAPI server. This is the entry point to the Continue server, and acts as a bridge between IDE and React app
+- We use OpenAPI/JSONSchema to define types so that it's really easy to bring them across language barriers. Use Pydantic types, then run `poetry run typegen` from the root of continuedev folder to generate JSONSchema json files in the `schema/json` folder. Then `npm run typegen` from the extension folder generates the types that are used within the extension.
diff --git a/extension/react-app/src/App.tsx b/extension/react-app/src/App.tsx
index 0c40ced1..a51541d0 100644
--- a/extension/react-app/src/App.tsx
+++ b/extension/react-app/src/App.tsx
@@ -4,7 +4,7 @@ import { Provider } from "react-redux";
import store from "./redux/store";
import WelcomeTab from "./tabs/welcome";
import ChatTab from "./tabs/chat";
-import Notebook from "./tabs/notebook";
+import GUI from "./tabs/gui";
function App() {
return (
@@ -13,8 +13,8 @@ function App() {
<DebugPanel
tabs={[
{
- element: <Notebook />,
- title: "Notebook",
+ element: <GUI />,
+ title: "GUI",
},
// { element: <MainTab />, title: "Debug Panel" },
// { element: <WelcomeTab />, title: "Welcome" },
diff --git a/extension/react-app/src/hooks/ContinueNotebookClientProtocol.ts b/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts
index 75fd7373..18a91de7 100644
--- a/extension/react-app/src/hooks/ContinueNotebookClientProtocol.ts
+++ b/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts
@@ -1,4 +1,4 @@
-abstract class AbstractContinueNotebookClientProtocol {
+abstract class AbstractContinueGUIClientProtocol {
abstract sendMainInput(input: string): void;
abstract reverseToIndex(index: number): void;
@@ -10,4 +10,4 @@ abstract class AbstractContinueNotebookClientProtocol {
abstract onStateUpdate(state: any): void;
}
-export default AbstractContinueNotebookClientProtocol;
+export default AbstractContinueGUIClientProtocol;
diff --git a/extension/react-app/src/hooks/useContinueNotebookProtocol.ts b/extension/react-app/src/hooks/useContinueGUIProtocol.ts
index b785cc84..a3a1d0c9 100644
--- a/extension/react-app/src/hooks/useContinueNotebookProtocol.ts
+++ b/extension/react-app/src/hooks/useContinueGUIProtocol.ts
@@ -1,9 +1,9 @@
-import AbstractContinueNotebookClientProtocol from "./ContinueNotebookClientProtocol";
+import AbstractContinueGUIClientProtocol from "./ContinueGUIClientProtocol";
// import { Messenger, WebsocketMessenger } from "../../../src/util/messenger";
import { Messenger, WebsocketMessenger } from "./messenger";
import { VscodeMessenger } from "./vscodeMessenger";
-class ContinueNotebookClientProtocol extends AbstractContinueNotebookClientProtocol {
+class ContinueGUIClientProtocol extends AbstractContinueGUIClientProtocol {
messenger: Messenger;
// Server URL must contain the session ID param
serverUrlWithSessionId: string;
@@ -46,4 +46,4 @@ class ContinueNotebookClientProtocol extends AbstractContinueNotebookClientProto
}
}
-export default ContinueNotebookClientProtocol;
+export default ContinueGUIClientProtocol;
diff --git a/extension/react-app/src/hooks/useWebsocket.ts b/extension/react-app/src/hooks/useWebsocket.ts
index 016fa17d..e762666f 100644
--- a/extension/react-app/src/hooks/useWebsocket.ts
+++ b/extension/react-app/src/hooks/useWebsocket.ts
@@ -1,15 +1,15 @@
import React, { useEffect, useState } from "react";
import { RootStore } from "../redux/store";
import { useSelector } from "react-redux";
-import ContinueNotebookClientProtocol from "./useContinueNotebookProtocol";
+import ContinueGUIClientProtocol from "./useContinueGUIProtocol";
import { postVscMessage } from "../vscode";
-function useContinueNotebookProtocol(useVscodeMessagePassing: boolean = true) {
+function useContinueGUIProtocol(useVscodeMessagePassing: boolean = true) {
const sessionId = useSelector((state: RootStore) => state.config.sessionId);
const serverHttpUrl = useSelector((state: RootStore) => state.config.apiUrl);
- const [client, setClient] = useState<
- ContinueNotebookClientProtocol | undefined
- >(undefined);
+ const [client, setClient] = useState<ContinueGUIClientProtocol | undefined>(
+ undefined
+ );
useEffect(() => {
if (!sessionId || !serverHttpUrl) {
@@ -22,12 +22,12 @@ function useContinueNotebookProtocol(useVscodeMessagePassing: boolean = true) {
const serverUrlWithSessionId =
serverHttpUrl.replace("http", "ws") +
- "/notebook/ws?session_id=" +
+ "/gui/ws?session_id=" +
encodeURIComponent(sessionId);
console.log("Creating websocket", serverUrlWithSessionId);
console.log("Using vscode message passing", useVscodeMessagePassing);
- const newClient = new ContinueNotebookClientProtocol(
+ const newClient = new ContinueGUIClientProtocol(
serverUrlWithSessionId,
useVscodeMessagePassing
);
@@ -36,4 +36,4 @@ function useContinueNotebookProtocol(useVscodeMessagePassing: boolean = true) {
return client;
}
-export default useContinueNotebookProtocol;
+export default useContinueGUIProtocol;
diff --git a/extension/react-app/src/tabs/notebook.tsx b/extension/react-app/src/tabs/gui.tsx
index 02c9ff31..5ddddbfc 100644
--- a/extension/react-app/src/tabs/notebook.tsx
+++ b/extension/react-app/src/tabs/gui.tsx
@@ -14,9 +14,9 @@ import StepContainer from "../components/StepContainer";
import { useSelector } from "react-redux";
import { RootStore } from "../redux/store";
import useContinueWebsocket from "../hooks/useWebsocket";
-import useContinueNotebookProtocol from "../hooks/useWebsocket";
+import useContinueGUIProtocol from "../hooks/useWebsocket";
-let TopNotebookDiv = styled.div`
+let TopGUIDiv = styled.div`
display: grid;
grid-template-columns: 1fr;
`;
@@ -29,11 +29,11 @@ let UserInputQueueItem = styled.div`
text-align: center;
`;
-interface NotebookProps {
+interface GUIProps {
firstObservation?: any;
}
-function Notebook(props: NotebookProps) {
+function GUI(props: GUIProps) {
const [waitingForSteps, setWaitingForSteps] = useState(false);
const [userInputQueue, setUserInputQueue] = useState<string[]>([]);
const [history, setHistory] = useState<History | undefined>();
@@ -156,7 +156,7 @@ function Notebook(props: NotebookProps) {
// } as any
// );
- const client = useContinueNotebookProtocol();
+ const client = useContinueGUIProtocol();
useEffect(() => {
console.log("CLIENT ON STATE UPDATE: ", client, client?.onStateUpdate);
@@ -207,7 +207,7 @@ function Notebook(props: NotebookProps) {
// const iterations = useSelector(selectIterations);
return (
- <TopNotebookDiv>
+ <TopGUIDiv>
{typeof client === "undefined" && (
<>
<Loader></Loader>
@@ -258,8 +258,8 @@ function Notebook(props: NotebookProps) {
}}
></MainTextInput>
<ContinueButton onClick={onMainTextInput}></ContinueButton>
- </TopNotebookDiv>
+ </TopGUIDiv>
);
}
-export default Notebook;
+export default GUI;
diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts
index f8f3c65a..40def480 100644
--- a/extension/src/activation/activate.ts
+++ b/extension/src/activation/activate.ts
@@ -59,10 +59,10 @@ export function activateExtension(
})
),
]).then(() => {
- ideProtocolClient?.openNotebook();
+ ideProtocolClient?.openGUI();
});
} else {
- ideProtocolClient.openNotebook().then(() => {
+ ideProtocolClient.openGUI().then(() => {
// openCapturedTerminal();
});
}
diff --git a/extension/src/commands.ts b/extension/src/commands.ts
index aeeb4b4f..f0c1744b 100644
--- a/extension/src/commands.ts
+++ b/extension/src/commands.ts
@@ -62,11 +62,11 @@ const commandsMap: { [command: string]: (...args: any) => any } = {
"continue.acceptSuggestion": acceptSuggestionCommand,
"continue.rejectSuggestion": rejectSuggestionCommand,
"continue.openDebugPanel": () => {
- ideProtocolClient.openNotebook();
+ ideProtocolClient.openGUI();
},
"continue.focusContinueInput": async () => {
if (!debugPanelWebview) {
- await ideProtocolClient.openNotebook();
+ await ideProtocolClient.openGUI();
}
debugPanelWebview?.postMessage({
type: "focusContinueInput",
diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts
index 477d1420..ab890801 100644
--- a/extension/src/continueIdeClient.ts
+++ b/extension/src/continueIdeClient.ts
@@ -97,7 +97,7 @@ class IdeProtocolClient {
this.openFile(data.filepath);
// TODO: Close file
break;
- case "openNotebook":
+ case "openGUI":
case "connected":
break;
default:
@@ -133,17 +133,17 @@ class IdeProtocolClient {
// ------------------------------------ //
// Initiate Request
- closeNotebook(sessionId: string) {
+ closeGUI(sessionId: string) {
this.panels.get(sessionId)?.dispose();
this.panels.delete(sessionId);
}
- async openNotebook() {
+ async openGUI() {
console.log("OPENING NOTEBOOK");
if (this.messenger === null) {
console.log("MESSENGER IS NULL");
}
- const resp = await this.messenger?.sendAndReceive("openNotebook", {});
+ const resp = await this.messenger?.sendAndReceive("openGUI", {});
const sessionId = resp.sessionId;
console.log("SESSION ID", sessionId);