Past input (#513)
* feat: 🚧 use ComboBox in place of UserInputContainer * feat: 🚧 adding context to previous inputs steps * feat: ✨ preview context items on click * feat: 🚧 more work on context items ui * style: 🚧 working out the details of ctx item buttons * feat: ✨ getting the final details * fix: 🐛 fix height of ctx items bar * fix: 🐛 last couple of details * fix: 🐛 pass model param through to hf inference api * fix: 🔊 better logging for timeout * feat: ✨ option to set the meilisearch url * fix: 🐛 fix height of past inputs
This commit is contained in:
parent
d4acf4bb11
commit
95363a5b52
41 changed files with 1446 additions and 564 deletions
6
.vscode/launch.json
vendored
6
.vscode/launch.json
vendored
|
|
@ -37,7 +37,11 @@
|
|||
"type": "python",
|
||||
"request": "launch",
|
||||
"module": "continuedev.src.continuedev.__main__",
|
||||
"args": ["--port", "8001"],
|
||||
"args": [
|
||||
"--port",
|
||||
"8001"
|
||||
// "--meilisearch-url", "http://localhost:7701"
|
||||
],
|
||||
"justMyCode": false,
|
||||
"subProcess": false
|
||||
// Does it need a build task?
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ app = typer.Typer()
|
|||
def main(
|
||||
port: int = typer.Option(65432, help="server port"),
|
||||
host: str = typer.Option("127.0.0.1", help="server host"),
|
||||
meilisearch_url: Optional[str] = typer.Option(
|
||||
None, help="The URL of the MeiliSearch server if running manually"
|
||||
),
|
||||
config: Optional[str] = typer.Option(
|
||||
None, help="The path to the configuration file"
|
||||
),
|
||||
|
|
@ -20,7 +23,7 @@ def main(
|
|||
if headless:
|
||||
run(config)
|
||||
else:
|
||||
run_server(port=port, host=host)
|
||||
run_server(port=port, host=host, meilisearch_url=meilisearch_url)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ from ..plugins.steps.core.core import (
|
|||
)
|
||||
from ..plugins.steps.on_traceback import DefaultOnTracebackStep
|
||||
from ..server.ide_protocol import AbstractIdeProtocolServer
|
||||
from ..server.meilisearch_server import stop_meilisearch
|
||||
from ..server.meilisearch_server import get_meilisearch_url, stop_meilisearch
|
||||
from .config import ContinueConfig
|
||||
from .context import ContextManager
|
||||
from .main import (
|
||||
|
|
@ -179,6 +179,7 @@ class Autopilot(ContinueBaseModel):
|
|||
config=self.continue_sdk.config,
|
||||
saved_context_groups=self._saved_context_groups,
|
||||
context_providers=self.context_manager.get_provider_descriptions(),
|
||||
meilisearch_url=get_meilisearch_url(),
|
||||
)
|
||||
self.full_state = full_state
|
||||
return full_state
|
||||
|
|
@ -306,7 +307,8 @@ class Autopilot(ContinueBaseModel):
|
|||
await self.update_subscribers()
|
||||
|
||||
async def edit_step_at_index(self, user_input: str, index: int):
|
||||
step_to_rerun = self.history.timeline[index].step.copy()
|
||||
node_to_rerun = self.history.timeline[index].copy()
|
||||
step_to_rerun = node_to_rerun.step
|
||||
step_to_rerun.user_input = user_input
|
||||
step_to_rerun.description = user_input
|
||||
|
||||
|
|
@ -318,13 +320,29 @@ class Autopilot(ContinueBaseModel):
|
|||
node_to_delete.deleted = True
|
||||
|
||||
self.history.current_index = index - 1
|
||||
|
||||
# Set the context to the context used by that step
|
||||
await self.context_manager.clear_context()
|
||||
for context_item in node_to_rerun.context_used:
|
||||
await self.context_manager.manually_add_context_item(context_item)
|
||||
|
||||
await self.update_subscribers()
|
||||
|
||||
# Rerun from the current step
|
||||
await self.run_from_step(step_to_rerun)
|
||||
|
||||
async def delete_context_with_ids(self, ids: List[str]):
|
||||
await self.context_manager.delete_context_with_ids(ids)
|
||||
async def delete_context_with_ids(
|
||||
self, ids: List[str], index: Optional[int] = None
|
||||
):
|
||||
if index is None:
|
||||
await self.context_manager.delete_context_with_ids(ids)
|
||||
else:
|
||||
self.history.timeline[index].context_used = list(
|
||||
filter(
|
||||
lambda item: item.description.id.to_string() not in ids,
|
||||
self.history.timeline[index].context_used,
|
||||
)
|
||||
)
|
||||
await self.update_subscribers()
|
||||
|
||||
async def toggle_adding_highlighted_code(self):
|
||||
|
|
@ -380,7 +398,12 @@ class Autopilot(ContinueBaseModel):
|
|||
|
||||
# Update history - do this first so we get top-first tree ordering
|
||||
index_of_history_node = self.history.add_node(
|
||||
HistoryNode(step=step, observation=None, depth=self._step_depth)
|
||||
HistoryNode(
|
||||
step=step,
|
||||
observation=None,
|
||||
depth=self._step_depth,
|
||||
context_used=await self.context_manager.get_selected_items(),
|
||||
)
|
||||
)
|
||||
|
||||
# Call all subscribed callbacks
|
||||
|
|
@ -600,7 +623,7 @@ class Autopilot(ContinueBaseModel):
|
|||
|
||||
async def accept_user_input(self, user_input: str):
|
||||
self._main_user_input_queue.append(user_input)
|
||||
await self.update_subscribers()
|
||||
# await self.update_subscribers()
|
||||
|
||||
if len(self._main_user_input_queue) > 1:
|
||||
return
|
||||
|
|
@ -609,7 +632,7 @@ class Autopilot(ContinueBaseModel):
|
|||
# Just run the step that takes user input, and
|
||||
# then up to the policy to decide how to deal with it.
|
||||
self._main_user_input_queue.pop(0)
|
||||
await self.update_subscribers()
|
||||
# await self.update_subscribers()
|
||||
await self.run_from_step(UserInputStep(user_input=user_input))
|
||||
|
||||
while len(self._main_user_input_queue) > 0:
|
||||
|
|
@ -635,6 +658,16 @@ class Autopilot(ContinueBaseModel):
|
|||
await self.context_manager.select_context_item(id, query)
|
||||
await self.update_subscribers()
|
||||
|
||||
async def select_context_item_at_index(self, id: str, query: str, index: int):
|
||||
# TODO: This is different from how it works for the main input
|
||||
# Ideally still tracked through the ContextProviders
|
||||
# so they can watch for duplicates
|
||||
context_item = await self.context_manager.get_context_item(id, query)
|
||||
if context_item is None:
|
||||
return
|
||||
self.history.timeline[index].context_used.append(context_item)
|
||||
await self.update_subscribers()
|
||||
|
||||
async def set_config_attr(self, key_path: List[str], value: redbaron.RedBaron):
|
||||
edit_config_property(key_path, value)
|
||||
await self.update_subscribers()
|
||||
|
|
|
|||
|
|
@ -10,7 +10,11 @@ from ..libs.util.create_async_task import create_async_task
|
|||
from ..libs.util.devdata import dev_data_logger
|
||||
from ..libs.util.logging import logger
|
||||
from ..libs.util.telemetry import posthog_logger
|
||||
from ..server.meilisearch_server import poll_meilisearch_running, restart_meilisearch
|
||||
from ..server.meilisearch_server import (
|
||||
get_meilisearch_url,
|
||||
poll_meilisearch_running,
|
||||
restart_meilisearch,
|
||||
)
|
||||
from .main import (
|
||||
ChatMessage,
|
||||
ContextItem,
|
||||
|
|
@ -127,7 +131,7 @@ class ContextProvider(BaseModel):
|
|||
|
||||
Default implementation uses the search index to get the item.
|
||||
"""
|
||||
async with Client("http://localhost:7700") as search_client:
|
||||
async with Client(get_meilisearch_url()) as search_client:
|
||||
try:
|
||||
result = await search_client.index(SEARCH_INDEX_NAME).get_document(
|
||||
id.to_string()
|
||||
|
|
@ -295,7 +299,7 @@ class ContextManager:
|
|||
}
|
||||
for item in context_items
|
||||
]
|
||||
async with Client("http://localhost:7700") as search_client:
|
||||
async with Client(get_meilisearch_url()) as search_client:
|
||||
|
||||
async def add_docs():
|
||||
index = await search_client.get_index(SEARCH_INDEX_NAME)
|
||||
|
|
@ -313,7 +317,7 @@ class ContextManager:
|
|||
"""
|
||||
Deletes the documents in the search index.
|
||||
"""
|
||||
async with Client("http://localhost:7700") as search_client:
|
||||
async with Client(get_meilisearch_url()) as search_client:
|
||||
await asyncio.wait_for(
|
||||
search_client.index(SEARCH_INDEX_NAME).delete_documents(ids),
|
||||
timeout=20,
|
||||
|
|
@ -321,7 +325,7 @@ class ContextManager:
|
|||
|
||||
async def load_index(self, workspace_dir: str, should_retry: bool = True):
|
||||
try:
|
||||
async with Client("http://localhost:7700") as search_client:
|
||||
async with Client(get_meilisearch_url()) as search_client:
|
||||
# First, create the index if it doesn't exist
|
||||
# The index is currently shared by all workspaces
|
||||
await search_client.create_index(SEARCH_INDEX_NAME)
|
||||
|
|
@ -422,6 +426,18 @@ class ContextManager:
|
|||
)
|
||||
await self.context_providers[id.provider_title].add_context_item(id, query)
|
||||
|
||||
async def get_context_item(self, id: str, query: str) -> ContextItem:
|
||||
"""
|
||||
Returns the ContextItem with the given id.
|
||||
"""
|
||||
id: ContextItemId = ContextItemId.from_string(id)
|
||||
if id.provider_title not in self.provider_titles:
|
||||
raise ValueError(
|
||||
f"Context provider with title {id.provider_title} not found"
|
||||
)
|
||||
|
||||
return await self.context_providers[id.provider_title].get_item(id, query)
|
||||
|
||||
async def delete_context_with_ids(self, ids: List[str]):
|
||||
"""
|
||||
Deletes the ContextItems with the given IDs, lets ContextProviders recalculate.
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ class HistoryNode(ContinueBaseModel):
|
|||
deleted: bool = False
|
||||
active: bool = True
|
||||
logs: List[str] = []
|
||||
context_used: List["ContextItem"] = []
|
||||
|
||||
def to_chat_messages(self) -> List[ChatMessage]:
|
||||
if self.step.description is None or self.step.manage_own_chat_context:
|
||||
|
|
@ -312,6 +313,7 @@ class FullState(ContinueBaseModel):
|
|||
config: ContinueConfig
|
||||
saved_context_groups: Dict[str, List[ContextItem]] = {}
|
||||
context_providers: List[ContextProviderDescription] = []
|
||||
meilisearch_url: Optional[str] = None
|
||||
|
||||
|
||||
class ContinueSDK:
|
||||
|
|
|
|||
|
|
@ -31,24 +31,24 @@ config = ContinueConfig(
|
|||
custom_commands=[
|
||||
CustomCommand(
|
||||
name="test",
|
||||
description="Write unit tests for the highlighted code",
|
||||
description="Write unit tests for highlighted code",
|
||||
prompt="Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
|
||||
)
|
||||
],
|
||||
slash_commands=[
|
||||
SlashCommand(
|
||||
name="edit",
|
||||
description="Edit code in the current file or the highlighted code",
|
||||
description="Edit highlighted code",
|
||||
step=EditHighlightedCodeStep,
|
||||
),
|
||||
SlashCommand(
|
||||
name="config",
|
||||
description="Customize Continue - slash commands, LLMs, system message, etc.",
|
||||
description="Customize Continue",
|
||||
step=OpenConfigStep,
|
||||
),
|
||||
SlashCommand(
|
||||
name="comment",
|
||||
description="Write comments for the current file or highlighted code",
|
||||
description="Write comments for the highlighted code",
|
||||
step=CommentCodeStep,
|
||||
),
|
||||
SlashCommand(
|
||||
|
|
@ -58,7 +58,7 @@ config = ContinueConfig(
|
|||
),
|
||||
SlashCommand(
|
||||
name="share",
|
||||
description="Download and share the session transcript",
|
||||
description="Download and share this session",
|
||||
step=ShareSessionStep,
|
||||
),
|
||||
SlashCommand(
|
||||
|
|
|
|||
|
|
@ -57,16 +57,15 @@ class HuggingFaceInferenceAPI(LLM):
|
|||
if "stop" in args:
|
||||
args["stop_sequences"] = args["stop"]
|
||||
del args["stop"]
|
||||
if "model" in args:
|
||||
del args["model"]
|
||||
|
||||
return args
|
||||
|
||||
async def _stream_complete(self, prompt, options):
|
||||
self.collect_args(options)
|
||||
args = self.collect_args(options)
|
||||
|
||||
client = InferenceClient(self.endpoint_url, token=self.hf_token)
|
||||
|
||||
stream = client.text_generation(prompt, stream=True, details=True)
|
||||
stream = client.text_generation(prompt, stream=True, details=True, **args)
|
||||
|
||||
for r in stream:
|
||||
# skip special tokens
|
||||
|
|
|
|||
|
|
@ -257,8 +257,17 @@ class HighlightedCodeContextProvider(ContextProvider):
|
|||
self._disambiguate_highlighted_ranges()
|
||||
|
||||
async def set_editing_at_ids(self, ids: List[str]):
|
||||
# Don't do anything if there are no valid ids here
|
||||
count = 0
|
||||
for hr in self.highlighted_ranges:
|
||||
hr.item.editing = hr.item.description.id.to_string() in ids
|
||||
if hr.item.description.id.item_id in ids:
|
||||
count += 1
|
||||
|
||||
if count == 0:
|
||||
return
|
||||
|
||||
for hr in self.highlighted_ranges:
|
||||
hr.item.editing = hr.item.description.id.item_id in ids
|
||||
|
||||
async def add_context_item(
|
||||
self, id: ContextItemId, query: str, prev: List[ContextItem] = None
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class GUIProtocolServer:
|
|||
elif message_type == "delete_at_index":
|
||||
self.on_delete_at_index(data["index"])
|
||||
elif message_type == "delete_context_with_ids":
|
||||
self.on_delete_context_with_ids(data["ids"])
|
||||
self.on_delete_context_with_ids(data["ids"], data.get("index", None))
|
||||
elif message_type == "toggle_adding_highlighted_code":
|
||||
self.on_toggle_adding_highlighted_code()
|
||||
elif message_type == "set_editing_at_ids":
|
||||
|
|
@ -112,9 +112,11 @@ class GUIProtocolServer:
|
|||
elif message_type == "show_logs_at_index":
|
||||
self.on_show_logs_at_index(data["index"])
|
||||
elif message_type == "show_context_virtual_file":
|
||||
self.show_context_virtual_file()
|
||||
self.show_context_virtual_file(data.get("index", None))
|
||||
elif message_type == "select_context_item":
|
||||
self.select_context_item(data["id"], data["query"])
|
||||
elif message_type == "select_context_item_at_index":
|
||||
self.select_context_item_at_index(data["id"], data["query"], data["index"])
|
||||
elif message_type == "load_session":
|
||||
self.load_session(data.get("session_id", None))
|
||||
elif message_type == "edit_step_at_index":
|
||||
|
|
@ -171,9 +173,9 @@ class GUIProtocolServer:
|
|||
self.on_error,
|
||||
)
|
||||
|
||||
def on_delete_context_with_ids(self, ids: List[str]):
|
||||
def on_delete_context_with_ids(self, ids: List[str], index: Optional[int] = None):
|
||||
create_async_task(
|
||||
self.session.autopilot.delete_context_with_ids(ids), self.on_error
|
||||
self.session.autopilot.delete_context_with_ids(ids, index), self.on_error
|
||||
)
|
||||
|
||||
def on_toggle_adding_highlighted_code(self):
|
||||
|
|
@ -188,7 +190,7 @@ class GUIProtocolServer:
|
|||
def on_show_logs_at_index(self, index: int):
|
||||
name = "Continue Context"
|
||||
logs = "\n\n############################################\n\n".join(
|
||||
["This is the prompt sent to the LLM during this step"]
|
||||
["This is the prompt that was sent to the LLM during this step"]
|
||||
+ self.session.autopilot.continue_sdk.history.timeline[index].logs
|
||||
)
|
||||
create_async_task(
|
||||
|
|
@ -196,12 +198,20 @@ class GUIProtocolServer:
|
|||
)
|
||||
posthog_logger.capture_event("show_logs_at_index", {})
|
||||
|
||||
def show_context_virtual_file(self):
|
||||
def show_context_virtual_file(self, index: Optional[int] = None):
|
||||
async def async_stuff():
|
||||
msgs = await self.session.autopilot.continue_sdk.get_chat_context()
|
||||
if index is None:
|
||||
context_items = (
|
||||
await self.session.autopilot.context_manager.get_selected_items()
|
||||
)
|
||||
elif index < len(self.session.autopilot.continue_sdk.history.timeline):
|
||||
context_items = self.session.autopilot.continue_sdk.history.timeline[
|
||||
index
|
||||
].context_used
|
||||
|
||||
ctx = "\n\n-----------------------------------\n\n".join(
|
||||
["This is the exact context that will be passed to the LLM"]
|
||||
+ list(map(lambda x: x.content, msgs))
|
||||
["These are the context items that will be passed to the LLM"]
|
||||
+ list(map(lambda x: x.content, context_items))
|
||||
)
|
||||
await self.session.autopilot.ide.showVirtualFile(
|
||||
"Continue - Selected Context", ctx
|
||||
|
|
@ -218,6 +228,13 @@ class GUIProtocolServer:
|
|||
self.session.autopilot.select_context_item(id, query), self.on_error
|
||||
)
|
||||
|
||||
def select_context_item_at_index(self, id: str, query: str, index: int):
|
||||
"""Called when user selects an item from the dropdown for prev UserInputStep"""
|
||||
create_async_task(
|
||||
self.session.autopilot.select_context_item_at_index(id, query, index),
|
||||
self.on_error,
|
||||
)
|
||||
|
||||
def load_session(self, session_id: Optional[str] = None):
|
||||
async def load_and_tell_to_reconnect():
|
||||
new_session_id = await session_manager.load_session(
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from pydantic import BaseModel
|
|||
from starlette.websockets import WebSocketDisconnect, WebSocketState
|
||||
from uvicorn.main import Server
|
||||
|
||||
from ..core.main import ContinueCustomException
|
||||
from ..libs.util.create_async_task import create_async_task
|
||||
from ..libs.util.devdata import dev_data_logger
|
||||
from ..libs.util.logging import logger
|
||||
|
|
@ -39,7 +40,6 @@ from ..models.filesystem_edit import (
|
|||
from ..plugins.steps.core.core import DisplayErrorStep
|
||||
from .gui import session_manager
|
||||
from .ide_protocol import AbstractIdeProtocolServer
|
||||
from .meilisearch_server import start_meilisearch
|
||||
from .session_manager import SessionManager
|
||||
|
||||
nest_asyncio.apply()
|
||||
|
|
@ -201,21 +201,24 @@ class IdeProtocolServer(AbstractIdeProtocolServer):
|
|||
except RuntimeError as e:
|
||||
logger.warning(f"Error sending IDE message, websocket probably closed: {e}")
|
||||
|
||||
async def _receive_json(self, message_type: str, timeout: int = 20) -> Any:
|
||||
async def _receive_json(
|
||||
self, message_type: str, timeout: int = 20, message=None
|
||||
) -> Any:
|
||||
try:
|
||||
return await asyncio.wait_for(
|
||||
self.sub_queue.get(message_type), timeout=timeout
|
||||
)
|
||||
except asyncio.TimeoutError:
|
||||
raise Exception(
|
||||
f"IDE Protocol _receive_json timed out after 20 seconds: {message_type}"
|
||||
raise ContinueCustomException(
|
||||
title=f"IDE Protocol _receive_json timed out after 20 seconds: {message_type}",
|
||||
message=f"IDE Protocol _receive_json timed out after 20 seconds. The message sent was: {message or ''}",
|
||||
)
|
||||
|
||||
async def _send_and_receive_json(
|
||||
self, data: Any, resp_model: Type[T], message_type: str
|
||||
) -> T:
|
||||
await self._send_json(message_type, data)
|
||||
resp = await self._receive_json(message_type)
|
||||
resp = await self._receive_json(message_type, message=data)
|
||||
return resp_model.parse_obj(resp)
|
||||
|
||||
async def handle_json(self, message_type: str, data: Any):
|
||||
|
|
@ -597,17 +600,6 @@ async def websocket_endpoint(websocket: WebSocket, session_id: str = None):
|
|||
logger.debug(f"Accepted websocket connection from {websocket.client}")
|
||||
await websocket.send_json({"messageType": "connected", "data": {}})
|
||||
|
||||
# Start meilisearch
|
||||
try:
|
||||
|
||||
async def on_err(e):
|
||||
logger.debug(f"Failed to start MeiliSearch: {e}")
|
||||
|
||||
create_async_task(start_meilisearch(), on_err)
|
||||
except Exception as e:
|
||||
logger.debug("Failed to start MeiliSearch")
|
||||
logger.debug(e)
|
||||
|
||||
# Message handler
|
||||
def handle_msg(msg):
|
||||
message = json.loads(msg)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import argparse
|
||||
import asyncio
|
||||
import atexit
|
||||
from contextlib import asynccontextmanager
|
||||
from typing import Optional
|
||||
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
|
|
@ -9,10 +11,21 @@ from fastapi.middleware.cors import CORSMiddleware
|
|||
from ..libs.util.logging import logger
|
||||
from .gui import router as gui_router
|
||||
from .ide import router as ide_router
|
||||
from .meilisearch_server import start_meilisearch, stop_meilisearch
|
||||
from .session_manager import router as sessions_router
|
||||
from .session_manager import session_manager
|
||||
|
||||
app = FastAPI()
|
||||
meilisearch_url_global = None
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
await start_meilisearch(url=meilisearch_url_global)
|
||||
yield
|
||||
stop_meilisearch()
|
||||
|
||||
|
||||
app = FastAPI(lifespan=lifespan)
|
||||
|
||||
app.include_router(ide_router)
|
||||
app.include_router(gui_router)
|
||||
|
|
@ -34,7 +47,13 @@ def health():
|
|||
return {"status": "ok"}
|
||||
|
||||
|
||||
def run_server(port: int = 65432, host: str = "127.0.0.1"):
|
||||
def run_server(
|
||||
port: int = 65432, host: str = "127.0.0.1", meilisearch_url: Optional[str] = None
|
||||
):
|
||||
global meilisearch_url_global
|
||||
|
||||
meilisearch_url_global = meilisearch_url
|
||||
|
||||
config = uvicorn.Config(app, host=host, port=port)
|
||||
server = uvicorn.Server(config)
|
||||
server.run()
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@ import asyncio
|
|||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
from typing import Optional
|
||||
|
||||
import aiofiles
|
||||
import aiohttp
|
||||
import psutil
|
||||
from meilisearch_python_async import Client
|
||||
|
||||
from ..libs.util.logging import logger
|
||||
|
|
@ -89,13 +91,22 @@ async def ensure_meilisearch_installed() -> bool:
|
|||
return True
|
||||
|
||||
|
||||
meilisearch_process = None
|
||||
DEFAULT_MEILISEARCH_URL = "http://localhost:7700"
|
||||
meilisearch_url = DEFAULT_MEILISEARCH_URL
|
||||
|
||||
|
||||
def get_meilisearch_url():
|
||||
return meilisearch_url
|
||||
|
||||
|
||||
async def check_meilisearch_running() -> bool:
|
||||
"""
|
||||
Checks if MeiliSearch is running.
|
||||
"""
|
||||
|
||||
try:
|
||||
async with Client("http://localhost:7700") as client:
|
||||
async with Client(meilisearch_url) as client:
|
||||
try:
|
||||
resp = await client.health()
|
||||
if resp.status != "available":
|
||||
|
|
@ -117,14 +128,16 @@ async def poll_meilisearch_running(frequency: int = 0.1) -> bool:
|
|||
await asyncio.sleep(frequency)
|
||||
|
||||
|
||||
meilisearch_process = None
|
||||
|
||||
|
||||
async def start_meilisearch():
|
||||
async def start_meilisearch(url: Optional[str] = None):
|
||||
"""
|
||||
Starts the MeiliSearch server, wait for it.
|
||||
"""
|
||||
global meilisearch_process
|
||||
global meilisearch_process, meilisearch_url
|
||||
|
||||
if url is not None:
|
||||
logger.debug("Using MeiliSearch at URL: " + url)
|
||||
meilisearch_url = url
|
||||
return
|
||||
|
||||
serverPath = getServerFolderPath()
|
||||
|
||||
|
|
@ -157,9 +170,6 @@ def stop_meilisearch():
|
|||
meilisearch_process = None
|
||||
|
||||
|
||||
import psutil
|
||||
|
||||
|
||||
def kill_proc(port):
|
||||
for proc in psutil.process_iter():
|
||||
try:
|
||||
|
|
@ -180,4 +190,4 @@ def kill_proc(port):
|
|||
async def restart_meilisearch():
|
||||
stop_meilisearch()
|
||||
kill_proc(7700)
|
||||
await start_meilisearch()
|
||||
await start_meilisearch(url=meilisearch_url)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
"continue.serverUrl": {
|
||||
"type": "string",
|
||||
"default": "http://localhost:65432",
|
||||
"description": "The URL of the Continue server. Only change this if you are running the server manually. If you want to use an LLM hosted at a custom URL, please see https://continue.dev/docs/customization#change-the-default-llm. All other configuration is done in `~/.continue/config.py`, which you can access by using the '/config' slash command."
|
||||
"description": "The URL of the Continue server if you are running Continue manually. NOTE: This is NOT the URL of the LLM server. If you want to use an LLM hosted at a custom URL, please see https://continue.dev/docs/customization#change-the-default-llm and complete configuration in `~/.continue/config.py`, which you can access by using the '/config' slash command."
|
||||
},
|
||||
"continue.manuallyRunningServer": {
|
||||
"type": "boolean",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -14,6 +14,7 @@ const Div = styled.div`
|
|||
background-color: #ff000011;
|
||||
border-radius: ${defaultBorderRadius};
|
||||
border: 1px solid #cc0000;
|
||||
margin: 8px;
|
||||
`;
|
||||
|
||||
interface ErrorStepContainerProps {
|
||||
|
|
@ -28,8 +29,8 @@ function ErrorStepContainer(props: ErrorStepContainerProps) {
|
|||
<div
|
||||
style={{
|
||||
position: "absolute",
|
||||
right: "4px",
|
||||
top: "4px",
|
||||
right: "12px",
|
||||
top: "12px",
|
||||
display: "flex",
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ interface HeaderButtonWithTextProps {
|
|||
active?: boolean;
|
||||
className?: string;
|
||||
onKeyDown?: (e: any) => void;
|
||||
tabIndex?: number;
|
||||
}
|
||||
|
||||
const HeaderButtonWithText = React.forwardRef<
|
||||
|
|
@ -39,6 +40,7 @@ const HeaderButtonWithText = React.forwardRef<
|
|||
onKeyDown={props.onKeyDown}
|
||||
className={props.className}
|
||||
ref={ref}
|
||||
tabIndex={props.tabIndex}
|
||||
>
|
||||
{props.children}
|
||||
</HeaderButton>
|
||||
|
|
|
|||
|
|
@ -1,23 +1,23 @@
|
|||
import { useContext, useEffect, useState } from "react";
|
||||
import { useContext, useEffect, useRef, useState } from "react";
|
||||
import styled from "styled-components";
|
||||
import {
|
||||
StyledTooltip,
|
||||
defaultBorderRadius,
|
||||
lightGray,
|
||||
secondaryDark,
|
||||
vscBackground,
|
||||
vscForeground,
|
||||
} from ".";
|
||||
import {
|
||||
TrashIcon,
|
||||
PaintBrushIcon,
|
||||
ExclamationTriangleIcon,
|
||||
EyeIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { GUIClientContext } from "../App";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { setBottomMessage } from "../redux/slices/uiStateSlice";
|
||||
import { ContextItem } from "../../../schema/FullState";
|
||||
import { getFontSize } from "../util";
|
||||
import HeaderButtonWithText from "./HeaderButtonWithText";
|
||||
|
||||
const Button = styled.button<{ fontSize?: number }>`
|
||||
border: none;
|
||||
|
|
@ -80,7 +80,13 @@ interface PillButtonProps {
|
|||
editingAny: boolean;
|
||||
index: number;
|
||||
areMultipleItems?: boolean;
|
||||
onDelete?: () => void;
|
||||
onDelete?: (index?: number) => void;
|
||||
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
||||
stepIndex?: number;
|
||||
previewing?: boolean;
|
||||
toggleViewContent?: () => void;
|
||||
onBlur?: () => void;
|
||||
focusing?: boolean;
|
||||
}
|
||||
|
||||
interface StyledButtonProps {
|
||||
|
|
@ -88,6 +94,14 @@ interface StyledButtonProps {
|
|||
editing?: boolean;
|
||||
}
|
||||
|
||||
const Container = styled.div<{ previewing?: boolean }>`
|
||||
border-radius: ${defaultBorderRadius};
|
||||
background-color: ${secondaryDark};
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
`;
|
||||
|
||||
const StyledButton = styled(Button)<StyledButtonProps>`
|
||||
position: relative;
|
||||
border-color: ${(props) => props.borderColor || "transparent"};
|
||||
|
|
@ -96,12 +110,34 @@ const StyledButton = styled(Button)<StyledButtonProps>`
|
|||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: ${lightGray};
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
/* border-color: ${lightGray}; */
|
||||
text-decoration: underline;
|
||||
}
|
||||
`;
|
||||
|
||||
const HoverableInsidePillButton = styled(HeaderButtonWithText)<{
|
||||
color: string;
|
||||
}>`
|
||||
&:hover {
|
||||
background-color: ${(props) => props.color};
|
||||
}
|
||||
`;
|
||||
|
||||
const ClickableInsidePillButton = styled(HeaderButtonWithText)<{
|
||||
color: string;
|
||||
selected: boolean;
|
||||
}>`
|
||||
${(props) =>
|
||||
props.selected &&
|
||||
`
|
||||
background-color: ${props.color};
|
||||
|
||||
&:hover {
|
||||
background-color: ${props.color};
|
||||
}
|
||||
`}
|
||||
`;
|
||||
|
||||
const PillButton = (props: PillButtonProps) => {
|
||||
const [isHovered, setIsHovered] = useState(false);
|
||||
const client = useContext(GUIClientContext);
|
||||
|
|
@ -116,122 +152,125 @@ const PillButton = (props: PillButtonProps) => {
|
|||
}
|
||||
}, [props.editing, props.item]);
|
||||
|
||||
const dispatch = useDispatch();
|
||||
const pillContainerRef = useRef<HTMLDivElement>(null);
|
||||
const buttonRef = useRef<HTMLButtonElement>(null);
|
||||
|
||||
return (
|
||||
<div style={{ position: "relative" }}>
|
||||
<StyledButton
|
||||
fontSize={getFontSize()}
|
||||
borderColor={props.editing ? (warning ? "red" : undefined) : undefined}
|
||||
onMouseEnter={() => {
|
||||
setIsHovered(true);
|
||||
if (props.onHover) {
|
||||
props.onHover(true);
|
||||
<Container previewing={props.previewing} ref={pillContainerRef}>
|
||||
<StyledButton
|
||||
fontSize={getFontSize()}
|
||||
borderColor={
|
||||
props.editing ? (warning ? "red" : undefined) : undefined
|
||||
}
|
||||
}}
|
||||
onMouseLeave={() => {
|
||||
setIsHovered(false);
|
||||
if (props.onHover) {
|
||||
props.onHover(false);
|
||||
}
|
||||
}}
|
||||
className="pill-button"
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Backspace") {
|
||||
props.onDelete?.();
|
||||
}
|
||||
}}
|
||||
>
|
||||
{isHovered && (
|
||||
<GridDiv
|
||||
style={{
|
||||
gridTemplateColumns:
|
||||
props.item.editable &&
|
||||
props.areMultipleItems &&
|
||||
props.editingAny
|
||||
? "1fr 1fr"
|
||||
: "1fr",
|
||||
backgroundColor: vscBackground,
|
||||
}}
|
||||
>
|
||||
{props.editingAny &&
|
||||
props.item.editable &&
|
||||
props.areMultipleItems && (
|
||||
<ButtonDiv
|
||||
data-tooltip-id={`edit-${props.index}`}
|
||||
backgroundColor={"#8800aa55"}
|
||||
onClick={() => {
|
||||
client?.setEditingAtIds([
|
||||
props.item.description.id.item_id,
|
||||
]);
|
||||
}}
|
||||
>
|
||||
<PaintBrushIcon style={{ margin: "auto" }} width="1.6em" />
|
||||
</ButtonDiv>
|
||||
)}
|
||||
|
||||
<StyledTooltip id={`pin-${props.index}`}>
|
||||
Edit this range
|
||||
</StyledTooltip>
|
||||
<ButtonDiv
|
||||
data-tooltip-id={`delete-${props.index}`}
|
||||
backgroundColor={"#cc000055"}
|
||||
ref={buttonRef}
|
||||
onMouseEnter={() => {
|
||||
setIsHovered(true);
|
||||
if (props.onHover) {
|
||||
props.onHover(true);
|
||||
}
|
||||
}}
|
||||
onMouseLeave={() => {
|
||||
setIsHovered(false);
|
||||
if (props.onHover) {
|
||||
props.onHover(false);
|
||||
}
|
||||
}}
|
||||
className={`pill-button-${props.stepIndex || "main"}`}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Backspace") {
|
||||
props.onDelete?.(props.stepIndex);
|
||||
} else if (e.key === "v") {
|
||||
props.toggleViewContent?.();
|
||||
} else if (e.key === "e") {
|
||||
client?.setEditingAtIds([props.item.description.id.item_id]);
|
||||
}
|
||||
}}
|
||||
onClick={(e) => {
|
||||
props.onClick?.(e);
|
||||
}}
|
||||
onBlur={(e) => {
|
||||
if (!pillContainerRef.current?.contains(e.relatedTarget as any)) {
|
||||
props.onBlur?.();
|
||||
} else {
|
||||
e.preventDefault();
|
||||
buttonRef.current?.focus();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<span className={isHovered ? "underline" : ""}>
|
||||
{props.item.description.name}
|
||||
</span>
|
||||
</StyledButton>
|
||||
{((props.focusing && props.item.editable && props.editingAny) ||
|
||||
props.editing) && (
|
||||
<>
|
||||
<ClickableInsidePillButton
|
||||
data-tooltip-id={`circle-div-${props.item.description.name}`}
|
||||
text={
|
||||
props.editing ? "Editing this range" : "Edit this range (e)"
|
||||
}
|
||||
onClick={() => {
|
||||
client?.deleteContextWithIds([props.item.description.id]);
|
||||
dispatch(setBottomMessage(undefined));
|
||||
if (!props.editing) {
|
||||
client?.setEditingAtIds([props.item.description.id.item_id]);
|
||||
}
|
||||
}}
|
||||
tabIndex={-1}
|
||||
color="#f0f4"
|
||||
selected={props.editing}
|
||||
>
|
||||
<TrashIcon style={{ margin: "auto" }} width="1.6em" />
|
||||
</ButtonDiv>
|
||||
</GridDiv>
|
||||
<PaintBrushIcon width="1.4em" height="1.4em" />
|
||||
</ClickableInsidePillButton>
|
||||
<StyledTooltip id={`circle-div-${props.item.description.name}`}>
|
||||
Editing this range
|
||||
</StyledTooltip>
|
||||
</>
|
||||
)}
|
||||
{props.item.description.name}
|
||||
</StyledButton>
|
||||
{(props.focusing || props.previewing) && (
|
||||
<ClickableInsidePillButton
|
||||
text="View (v)"
|
||||
onClick={() => props.toggleViewContent?.()}
|
||||
tabIndex={-1}
|
||||
color="#ff04"
|
||||
selected={props.previewing || false}
|
||||
>
|
||||
<EyeIcon width="1.4em" height="1.4em" />
|
||||
</ClickableInsidePillButton>
|
||||
)}
|
||||
{props.focusing && (
|
||||
<HoverableInsidePillButton
|
||||
text="Delete (⌫)"
|
||||
onClick={() => props.onDelete?.(props.stepIndex)}
|
||||
tabIndex={-1}
|
||||
color="#f004"
|
||||
>
|
||||
<TrashIcon width="1.4em" height="1.4em" />
|
||||
</HoverableInsidePillButton>
|
||||
)}
|
||||
</Container>
|
||||
<StyledTooltip id={`edit-${props.index}`}>
|
||||
{props.item.editing
|
||||
? "Editing this section (with entire file as context)"
|
||||
: "Edit this section"}
|
||||
</StyledTooltip>
|
||||
<StyledTooltip id={`delete-${props.index}`}>Delete</StyledTooltip>
|
||||
{props.editing &&
|
||||
(warning ? (
|
||||
<>
|
||||
<CircleDiv
|
||||
data-tooltip-id={`circle-div-${props.item.description.name}`}
|
||||
className="z-10"
|
||||
>
|
||||
<ExclamationTriangleIcon
|
||||
style={{ margin: "auto" }}
|
||||
width="1.0em"
|
||||
strokeWidth={2}
|
||||
/>
|
||||
</CircleDiv>
|
||||
<StyledTooltip id={`circle-div-${props.item.description.name}`}>
|
||||
{warning}
|
||||
</StyledTooltip>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<CircleDiv
|
||||
data-tooltip-id={`circle-div-${props.item.description.name}`}
|
||||
style={{
|
||||
backgroundColor: "#8800aa55",
|
||||
border: `0.5px solid ${lightGray}`,
|
||||
padding: "1px",
|
||||
zIndex: 1,
|
||||
}}
|
||||
>
|
||||
<PaintBrushIcon
|
||||
style={{ margin: "auto" }}
|
||||
width="1.0em"
|
||||
strokeWidth={2}
|
||||
/>
|
||||
</CircleDiv>
|
||||
<StyledTooltip id={`circle-div-${props.item.description.name}`}>
|
||||
Editing this range
|
||||
</StyledTooltip>
|
||||
</>
|
||||
))}
|
||||
{props.editing && warning && (
|
||||
<>
|
||||
<CircleDiv
|
||||
data-tooltip-id={`circle-div-${props.item.description.name}`}
|
||||
className="z-10"
|
||||
>
|
||||
<ExclamationTriangleIcon
|
||||
style={{ margin: "auto" }}
|
||||
width="1.0em"
|
||||
strokeWidth={2}
|
||||
/>
|
||||
</CircleDiv>
|
||||
<StyledTooltip id={`circle-div-${props.item.description.name}`}>
|
||||
{warning}
|
||||
</StyledTooltip>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@ const ButtonsDiv = styled.div`
|
|||
background-color: ${vscBackground};
|
||||
box-shadow: 1px 1px 10px ${vscBackground};
|
||||
border-radius: ${defaultBorderRadius};
|
||||
|
||||
z-index: 100;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
right: 8px;
|
||||
top: 16px;
|
||||
height: 0;
|
||||
`;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,12 +12,13 @@ import { getFontSize } from "../util";
|
|||
const StyledMarkdownPreview = styled(MarkdownPreview)<{
|
||||
light?: boolean;
|
||||
fontSize?: number;
|
||||
maxHeight?: number;
|
||||
}>`
|
||||
pre {
|
||||
background-color: ${(props) =>
|
||||
props.light ? vscBackground : secondaryDark};
|
||||
border-radius: ${defaultBorderRadius};
|
||||
border: 0.5px solid ${lightGray};
|
||||
/* border: 0.5px solid ${lightGray}; */
|
||||
|
||||
max-width: calc(100vw - 24px);
|
||||
}
|
||||
|
|
@ -34,6 +35,15 @@ const StyledMarkdownPreview = styled(MarkdownPreview)<{
|
|||
props.light ? vscBackground : secondaryDark};
|
||||
color: ${vscForeground};
|
||||
padding: 12px;
|
||||
|
||||
${(props) => {
|
||||
if (props.maxHeight) {
|
||||
return `
|
||||
max-height: ${props.maxHeight}px;
|
||||
overflow-y: auto;
|
||||
`;
|
||||
}
|
||||
}}
|
||||
}
|
||||
|
||||
background-color: ${(props) => (props.light ? "transparent" : vscBackground)};
|
||||
|
|
|
|||
|
|
@ -150,6 +150,8 @@ const NUM_STAGES = suggestionsStages.length;
|
|||
|
||||
const TutorialDiv = styled.div`
|
||||
margin: 4px;
|
||||
margin-left: 8px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
background-color: #ff02;
|
||||
border-radius: ${defaultBorderRadius};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ const CollapseButton = styled.div`
|
|||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
margin-left: 5px;
|
||||
margin-left: 13px;
|
||||
cursor: pointer;
|
||||
`;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import { useSelector } from "react-redux";
|
|||
interface UserInputContainerProps {
|
||||
onDelete: () => void;
|
||||
children: string;
|
||||
historyNode: HistoryNode;
|
||||
index: number;
|
||||
onToggle: (arg0: boolean) => void;
|
||||
onToggleAll: (arg0: boolean) => void;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export const StyledTooltip = styled(Tooltip)`
|
|||
padding: 6px;
|
||||
padding-left: 12px;
|
||||
padding-right: 12px;
|
||||
z-index: 100;
|
||||
z-index: 1000;
|
||||
|
||||
max-width: 80vw;
|
||||
`;
|
||||
|
|
@ -196,6 +196,11 @@ export const HeaderButton = styled.button<{ inverted: boolean | undefined }>`
|
|||
border-radius: ${defaultBorderRadius};
|
||||
cursor: ${({ disabled }) => (disabled ? "default" : "pointer")};
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: ${({ inverted }) =>
|
||||
typeof inverted === "undefined" || inverted
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ abstract class AbstractContinueGUIClientProtocol {
|
|||
|
||||
abstract deleteAtIndex(index: number): void;
|
||||
|
||||
abstract deleteContextWithIds(ids: ContextItemId[]): void;
|
||||
abstract deleteContextWithIds(ids: ContextItemId[], index?: number): void;
|
||||
|
||||
abstract setEditingAtIds(ids: string[]): void;
|
||||
|
||||
|
|
@ -33,6 +33,12 @@ abstract class AbstractContinueGUIClientProtocol {
|
|||
|
||||
abstract selectContextItem(id: string, query: string): void;
|
||||
|
||||
abstract selectContextItemAtIndex(
|
||||
id: string,
|
||||
query: string,
|
||||
index: number
|
||||
): void;
|
||||
|
||||
abstract loadSession(session_id?: string): void;
|
||||
|
||||
abstract onReconnectAtSession(session_id: string): void;
|
||||
|
|
|
|||
|
|
@ -101,9 +101,10 @@ class ContinueGUIClientProtocol extends AbstractContinueGUIClientProtocol {
|
|||
this.messenger?.send("delete_at_index", { index });
|
||||
}
|
||||
|
||||
deleteContextWithIds(ids: ContextItemId[]) {
|
||||
deleteContextWithIds(ids: ContextItemId[], index?: number) {
|
||||
this.messenger?.send("delete_context_with_ids", {
|
||||
ids: ids.map((id) => `${id.provider_title}-${id.item_id}`),
|
||||
index,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -119,14 +120,22 @@ class ContinueGUIClientProtocol extends AbstractContinueGUIClientProtocol {
|
|||
this.messenger?.send("show_logs_at_index", { index });
|
||||
}
|
||||
|
||||
showContextVirtualFile(): void {
|
||||
this.messenger?.send("show_context_virtual_file", {});
|
||||
showContextVirtualFile(index?: number): void {
|
||||
this.messenger?.send("show_context_virtual_file", { index });
|
||||
}
|
||||
|
||||
selectContextItem(id: string, query: string): void {
|
||||
this.messenger?.send("select_context_item", { id, query });
|
||||
}
|
||||
|
||||
selectContextItemAtIndex(id: string, query: string, index: number): void {
|
||||
this.messenger?.send("select_context_item_at_index", {
|
||||
id,
|
||||
query,
|
||||
index,
|
||||
});
|
||||
}
|
||||
|
||||
editStepAtIndex(userInput: string, index: number): void {
|
||||
this.messenger?.send("edit_step_at_index", {
|
||||
user_input: userInput,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import { usePostHog } from "posthog-js/react";
|
|||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { RootStore } from "../redux/store";
|
||||
import { postVscMessage } from "../vscode";
|
||||
import UserInputContainer from "../components/UserInputContainer";
|
||||
import { isMetaEquivalentKeyPressed } from "../util";
|
||||
import {
|
||||
setBottomMessage,
|
||||
|
|
@ -30,6 +29,7 @@ import RingLoader from "../components/RingLoader";
|
|||
import {
|
||||
setServerState,
|
||||
temporarilyClearSession,
|
||||
temporarilyCreateNewUserInput,
|
||||
temporarilyPushToUserInputQueue,
|
||||
} from "../redux/slices/serverStateReducer";
|
||||
import TimelineItem from "../components/TimelineItem";
|
||||
|
|
@ -76,11 +76,8 @@ const TitleTextInput = styled(TextInput)`
|
|||
const StepsDiv = styled.div`
|
||||
position: relative;
|
||||
background-color: transparent;
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
|
||||
& > * {
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
|
@ -331,7 +328,7 @@ function GUI(props: GUIProps) {
|
|||
}
|
||||
|
||||
client.sendMainInput(input);
|
||||
dispatch(temporarilyPushToUserInputQueue(input));
|
||||
dispatch(temporarilyCreateNewUserInput(input));
|
||||
|
||||
// Increment localstorage counter for popup
|
||||
const counter = localStorage.getItem("mainTextEntryCounter");
|
||||
|
|
@ -645,10 +642,19 @@ function GUI(props: GUIProps) {
|
|||
<>
|
||||
{node.step.name === "User Input" ? (
|
||||
node.step.hide || (
|
||||
<UserInputContainer
|
||||
active={getStepsInUserInputGroup(index).some((i) => {
|
||||
return history.timeline[i].active;
|
||||
})}
|
||||
<ComboBox
|
||||
isMainInput={false}
|
||||
value={node.step.description as string}
|
||||
active={
|
||||
getStepsInUserInputGroup(index).some((i) => {
|
||||
return history.timeline[i].active;
|
||||
}) || history.timeline[index].active
|
||||
}
|
||||
onEnter={(e, value) => {
|
||||
if (value) client?.editStepAtIndex(value, index);
|
||||
e?.stopPropagation();
|
||||
e?.preventDefault();
|
||||
}}
|
||||
groupIndices={getStepsInUserInputGroup(index)}
|
||||
onToggle={(isOpen: boolean) => {
|
||||
// Collapse all steps in the section
|
||||
|
|
@ -678,10 +684,7 @@ function GUI(props: GUIProps) {
|
|||
client?.deleteAtIndex(i);
|
||||
});
|
||||
}}
|
||||
historyNode={node}
|
||||
>
|
||||
{node.step.description as string}
|
||||
</UserInputContainer>
|
||||
/>
|
||||
)
|
||||
) : (
|
||||
<TimelineItem
|
||||
|
|
@ -761,8 +764,9 @@ function GUI(props: GUIProps) {
|
|||
|
||||
<div ref={aboveComboBoxDivRef} />
|
||||
<ComboBox
|
||||
isMainInput={true}
|
||||
ref={mainTextInputRef}
|
||||
onEnter={(e) => {
|
||||
onEnter={(e, _) => {
|
||||
onMainTextInput(e);
|
||||
e?.stopPropagation();
|
||||
e?.preventDefault();
|
||||
|
|
|
|||
|
|
@ -98,6 +98,21 @@ export const serverStateSlice = createSlice({
|
|||
temporarilyPushToUserInputQueue: (state, action) => {
|
||||
state.user_input_queue = [...state.user_input_queue, action.payload];
|
||||
},
|
||||
temporarilyCreateNewUserInput: (state, action) => {
|
||||
state.history.timeline = [
|
||||
...state.history.timeline,
|
||||
{
|
||||
step: {
|
||||
description: action.payload,
|
||||
name: "User Input",
|
||||
hide: false,
|
||||
},
|
||||
depth: 0,
|
||||
active: false,
|
||||
context_used: state.selected_context_items,
|
||||
},
|
||||
];
|
||||
},
|
||||
temporarilyClearSession: (state, action) => {
|
||||
state.history.timeline = [];
|
||||
state.selected_context_items = [];
|
||||
|
|
@ -114,5 +129,6 @@ export const {
|
|||
setServerState,
|
||||
temporarilyPushToUserInputQueue,
|
||||
temporarilyClearSession,
|
||||
temporarilyCreateNewUserInput,
|
||||
} = serverStateSlice.actions;
|
||||
export default serverStateSlice.reducer;
|
||||
|
|
|
|||
|
|
@ -46,3 +46,57 @@ export function getFontSize(): number {
|
|||
const fontSize = localStorage.getItem("fontSize");
|
||||
return fontSize ? parseInt(fontSize) : 13;
|
||||
}
|
||||
|
||||
export function getMarkdownLanguageTagForFile(filepath: string): string {
|
||||
const ext = filepath.split(".").pop();
|
||||
switch (ext) {
|
||||
case "py":
|
||||
return "python";
|
||||
case "js":
|
||||
return "javascript";
|
||||
case "ts":
|
||||
return "typescript";
|
||||
case "java":
|
||||
return "java";
|
||||
case "go":
|
||||
return "go";
|
||||
case "rb":
|
||||
return "ruby";
|
||||
case "rs":
|
||||
return "rust";
|
||||
case "c":
|
||||
return "c";
|
||||
case "cpp":
|
||||
return "cpp";
|
||||
case "cs":
|
||||
return "csharp";
|
||||
case "php":
|
||||
return "php";
|
||||
case "scala":
|
||||
return "scala";
|
||||
case "swift":
|
||||
return "swift";
|
||||
case "kt":
|
||||
return "kotlin";
|
||||
case "md":
|
||||
return "markdown";
|
||||
case "json":
|
||||
return "json";
|
||||
case "html":
|
||||
return "html";
|
||||
case "css":
|
||||
return "css";
|
||||
case "sh":
|
||||
return "shell";
|
||||
case "yaml":
|
||||
return "yaml";
|
||||
case "toml":
|
||||
return "toml";
|
||||
case "tex":
|
||||
return "latex";
|
||||
case "sql":
|
||||
return "sql";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
13
extension/schema/ContinueConfig.d.ts
vendored
13
extension/schema/ContinueConfig.d.ts
vendored
|
|
@ -71,11 +71,15 @@ export type VerifySsl = boolean;
|
|||
* Path to a custom CA bundle to use when making the HTTP request
|
||||
*/
|
||||
export type CaBundlePath = string;
|
||||
/**
|
||||
* Proxy URL to use when making the HTTP request
|
||||
*/
|
||||
export type Proxy = string;
|
||||
/**
|
||||
* The API key for the LLM provider.
|
||||
*/
|
||||
export type ApiKey = string;
|
||||
export type Unused = LLM[];
|
||||
export type Saved = LLM[];
|
||||
/**
|
||||
* The temperature parameter for sampling from the LLM. Higher temperatures will result in more random output, while lower temperatures will result in more predictable output. This value ranges from 0 to 1.
|
||||
*/
|
||||
|
|
@ -205,12 +209,10 @@ export interface FunctionCall {
|
|||
*/
|
||||
export interface Models1 {
|
||||
default: LLM;
|
||||
small?: LLM;
|
||||
medium?: LLM;
|
||||
large?: LLM;
|
||||
summarize?: LLM;
|
||||
edit?: LLM;
|
||||
chat?: LLM;
|
||||
unused?: Unused;
|
||||
saved?: Saved;
|
||||
sdk?: ContinueSDK;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
|
|
@ -224,6 +226,7 @@ export interface LLM {
|
|||
timeout?: Timeout;
|
||||
verify_ssl?: VerifySsl;
|
||||
ca_bundle_path?: CaBundlePath;
|
||||
proxy?: Proxy;
|
||||
prompt_templates?: PromptTemplates;
|
||||
api_key?: ApiKey;
|
||||
[k: string]: unknown;
|
||||
|
|
|
|||
34
extension/schema/FullState.d.ts
vendored
34
extension/schema/FullState.d.ts
vendored
|
|
@ -23,21 +23,22 @@ export type Depth = number;
|
|||
export type Deleted = boolean;
|
||||
export type Active = boolean;
|
||||
export type Logs = string[];
|
||||
export type Timeline = HistoryNode[];
|
||||
export type CurrentIndex = number;
|
||||
export type Active1 = boolean;
|
||||
export type UserInputQueue = string[];
|
||||
export type Name3 = string;
|
||||
export type Description1 = string;
|
||||
export type SlashCommands = SlashCommandDescription[];
|
||||
export type AddingHighlightedCode = boolean;
|
||||
export type Name4 = string;
|
||||
export type Description2 = string;
|
||||
export type ProviderTitle = string;
|
||||
export type ItemId = string;
|
||||
export type Content1 = string;
|
||||
export type Editing = boolean;
|
||||
export type Editable = boolean;
|
||||
export type ContextUsed = ContextItem[];
|
||||
export type Timeline = HistoryNode[];
|
||||
export type CurrentIndex = number;
|
||||
export type Active1 = boolean;
|
||||
export type UserInputQueue = string[];
|
||||
export type Name4 = string;
|
||||
export type Description2 = string;
|
||||
export type SlashCommands = SlashCommandDescription[];
|
||||
export type AddingHighlightedCode = boolean;
|
||||
export type SelectedContextItems = ContextItem[];
|
||||
export type SessionId = string;
|
||||
export type Title = string;
|
||||
|
|
@ -51,6 +52,7 @@ export type Description3 = string;
|
|||
export type Dynamic = boolean;
|
||||
export type RequiresQuery = boolean;
|
||||
export type ContextProviders = ContextProviderDescription[];
|
||||
export type MeilisearchUrl = string;
|
||||
|
||||
/**
|
||||
* A full state of the program, including the history
|
||||
|
|
@ -66,6 +68,7 @@ export interface FullState1 {
|
|||
config: ContinueConfig;
|
||||
saved_context_groups?: SavedContextGroups;
|
||||
context_providers?: ContextProviders;
|
||||
meilisearch_url?: MeilisearchUrl;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
/**
|
||||
|
|
@ -86,6 +89,7 @@ export interface HistoryNode {
|
|||
deleted?: Deleted;
|
||||
active?: Active;
|
||||
logs?: Logs;
|
||||
context_used?: ContextUsed;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Step {
|
||||
|
|
@ -114,11 +118,6 @@ export interface FunctionCall {
|
|||
export interface Observation {
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface SlashCommandDescription {
|
||||
name: Name3;
|
||||
description: Description1;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* A ContextItem is a single item that is stored in the ContextManager.
|
||||
*/
|
||||
|
|
@ -135,8 +134,8 @@ export interface ContextItem {
|
|||
* The id can be used to retrieve the ContextItem from the ContextManager.
|
||||
*/
|
||||
export interface ContextItemDescription {
|
||||
name: Name4;
|
||||
description: Description2;
|
||||
name: Name3;
|
||||
description: Description1;
|
||||
id: ContextItemId;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
|
|
@ -148,6 +147,11 @@ export interface ContextItemId {
|
|||
item_id: ItemId;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface SlashCommandDescription {
|
||||
name: Name4;
|
||||
description: Description2;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface SessionInfo {
|
||||
session_id: SessionId;
|
||||
title: Title;
|
||||
|
|
|
|||
38
extension/schema/History.d.ts
vendored
38
extension/schema/History.d.ts
vendored
|
|
@ -23,6 +23,14 @@ export type Depth = number;
|
|||
export type Deleted = boolean;
|
||||
export type Active = boolean;
|
||||
export type Logs = string[];
|
||||
export type Name3 = string;
|
||||
export type Description1 = string;
|
||||
export type ProviderTitle = string;
|
||||
export type ItemId = string;
|
||||
export type Content1 = string;
|
||||
export type Editing = boolean;
|
||||
export type Editable = boolean;
|
||||
export type ContextUsed = ContextItem[];
|
||||
export type Timeline = HistoryNode[];
|
||||
export type CurrentIndex = number;
|
||||
|
||||
|
|
@ -44,6 +52,7 @@ export interface HistoryNode {
|
|||
deleted?: Deleted;
|
||||
active?: Active;
|
||||
logs?: Logs;
|
||||
context_used?: ContextUsed;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Step {
|
||||
|
|
@ -72,3 +81,32 @@ export interface FunctionCall {
|
|||
export interface Observation {
|
||||
[k: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* A ContextItem is a single item that is stored in the ContextManager.
|
||||
*/
|
||||
export interface ContextItem {
|
||||
description: ContextItemDescription;
|
||||
content: Content1;
|
||||
editing?: Editing;
|
||||
editable?: Editable;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* A ContextItemDescription is a description of a ContextItem that is displayed to the user when they type '@'.
|
||||
*
|
||||
* The id can be used to retrieve the ContextItem from the ContextManager.
|
||||
*/
|
||||
export interface ContextItemDescription {
|
||||
name: Name3;
|
||||
description: Description1;
|
||||
id: ContextItemId;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* A ContextItemId is a unique identifier for a ContextItem.
|
||||
*/
|
||||
export interface ContextItemId {
|
||||
provider_title: ProviderTitle;
|
||||
item_id: ItemId;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
|
|
|
|||
38
extension/schema/HistoryNode.d.ts
vendored
38
extension/schema/HistoryNode.d.ts
vendored
|
|
@ -23,6 +23,14 @@ export type Depth = number;
|
|||
export type Deleted = boolean;
|
||||
export type Active = boolean;
|
||||
export type Logs = string[];
|
||||
export type Name3 = string;
|
||||
export type Description1 = string;
|
||||
export type ProviderTitle = string;
|
||||
export type ItemId = string;
|
||||
export type Content1 = string;
|
||||
export type Editing = boolean;
|
||||
export type Editable = boolean;
|
||||
export type ContextUsed = ContextItem[];
|
||||
|
||||
/**
|
||||
* A point in history, a list of which make up History
|
||||
|
|
@ -34,6 +42,7 @@ export interface HistoryNode1 {
|
|||
deleted?: Deleted;
|
||||
active?: Active;
|
||||
logs?: Logs;
|
||||
context_used?: ContextUsed;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Step {
|
||||
|
|
@ -62,3 +71,32 @@ export interface FunctionCall {
|
|||
export interface Observation {
|
||||
[k: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* A ContextItem is a single item that is stored in the ContextManager.
|
||||
*/
|
||||
export interface ContextItem {
|
||||
description: ContextItemDescription;
|
||||
content: Content1;
|
||||
editing?: Editing;
|
||||
editable?: Editable;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* A ContextItemDescription is a description of a ContextItem that is displayed to the user when they type '@'.
|
||||
*
|
||||
* The id can be used to retrieve the ContextItem from the ContextManager.
|
||||
*/
|
||||
export interface ContextItemDescription {
|
||||
name: Name3;
|
||||
description: Description1;
|
||||
id: ContextItemId;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* A ContextItemId is a unique identifier for a ContextItem.
|
||||
*/
|
||||
export interface ContextItemId {
|
||||
provider_title: ProviderTitle;
|
||||
item_id: ItemId;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
|
|
|
|||
5
extension/schema/LLM.d.ts
vendored
5
extension/schema/LLM.d.ts
vendored
|
|
@ -42,6 +42,10 @@ export type VerifySsl = boolean;
|
|||
* Path to a custom CA bundle to use when making the HTTP request
|
||||
*/
|
||||
export type CaBundlePath = string;
|
||||
/**
|
||||
* Proxy URL to use when making the HTTP request
|
||||
*/
|
||||
export type Proxy = string;
|
||||
/**
|
||||
* The API key for the LLM provider.
|
||||
*/
|
||||
|
|
@ -57,6 +61,7 @@ export interface LLM1 {
|
|||
timeout?: Timeout;
|
||||
verify_ssl?: VerifySsl;
|
||||
ca_bundle_path?: CaBundlePath;
|
||||
proxy?: Proxy;
|
||||
prompt_templates?: PromptTemplates;
|
||||
api_key?: ApiKey;
|
||||
[k: string]: unknown;
|
||||
|
|
|
|||
13
extension/schema/Models.d.ts
vendored
13
extension/schema/Models.d.ts
vendored
|
|
@ -42,23 +42,25 @@ export type VerifySsl = boolean;
|
|||
* Path to a custom CA bundle to use when making the HTTP request
|
||||
*/
|
||||
export type CaBundlePath = string;
|
||||
/**
|
||||
* Proxy URL to use when making the HTTP request
|
||||
*/
|
||||
export type Proxy = string;
|
||||
/**
|
||||
* The API key for the LLM provider.
|
||||
*/
|
||||
export type ApiKey = string;
|
||||
export type Unused = LLM[];
|
||||
export type Saved = LLM[];
|
||||
|
||||
/**
|
||||
* Main class that holds the current model configuration
|
||||
*/
|
||||
export interface Models1 {
|
||||
default: LLM;
|
||||
small?: LLM;
|
||||
medium?: LLM;
|
||||
large?: LLM;
|
||||
summarize?: LLM;
|
||||
edit?: LLM;
|
||||
chat?: LLM;
|
||||
unused?: Unused;
|
||||
saved?: Saved;
|
||||
sdk?: ContinueSDK;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
|
|
@ -72,6 +74,7 @@ export interface LLM {
|
|||
timeout?: Timeout;
|
||||
verify_ssl?: VerifySsl;
|
||||
ca_bundle_path?: CaBundlePath;
|
||||
proxy?: Proxy;
|
||||
prompt_templates?: PromptTemplates;
|
||||
api_key?: ApiKey;
|
||||
[k: string]: unknown;
|
||||
|
|
|
|||
|
|
@ -70,10 +70,11 @@ class IdeProtocolClient {
|
|||
});
|
||||
messenger.onMessage((messageType, data, messenger) => {
|
||||
this.handleMessage(messageType, data, messenger).catch((err) => {
|
||||
console.log("Error handling message: ", err);
|
||||
vscode.window
|
||||
.showErrorMessage(
|
||||
`Error handling message (${messageType}) from Continue server: ` +
|
||||
err.message,
|
||||
err,
|
||||
"View Logs"
|
||||
)
|
||||
.then((selection) => {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,10 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["name", "arguments"]
|
||||
"required": [
|
||||
"name",
|
||||
"arguments"
|
||||
]
|
||||
},
|
||||
"ChatMessage": {
|
||||
"title": "ChatMessage",
|
||||
|
|
@ -23,7 +26,12 @@
|
|||
"properties": {
|
||||
"role": {
|
||||
"title": "Role",
|
||||
"enum": ["assistant", "user", "system", "function"],
|
||||
"enum": [
|
||||
"assistant",
|
||||
"user",
|
||||
"system",
|
||||
"function"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"content": {
|
||||
|
|
@ -42,7 +50,10 @@
|
|||
"$ref": "#/definitions/FunctionCall"
|
||||
}
|
||||
},
|
||||
"required": ["role", "summary"]
|
||||
"required": [
|
||||
"role",
|
||||
"summary"
|
||||
]
|
||||
},
|
||||
"Step": {
|
||||
"title": "Step",
|
||||
|
|
@ -139,6 +150,11 @@
|
|||
"description": "Path to a custom CA bundle to use when making the HTTP request",
|
||||
"type": "string"
|
||||
},
|
||||
"proxy": {
|
||||
"title": "Proxy",
|
||||
"description": "Proxy URL to use when making the HTTP request",
|
||||
"type": "string"
|
||||
},
|
||||
"prompt_templates": {
|
||||
"title": "Prompt Templates",
|
||||
"description": "A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \"edit\" key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation. See the documentation for more information.",
|
||||
|
|
@ -151,7 +167,9 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["model"]
|
||||
"required": [
|
||||
"model"
|
||||
]
|
||||
},
|
||||
"src__continuedev__core__models__ContinueSDK": {
|
||||
"title": "ContinueSDK",
|
||||
|
|
@ -166,13 +184,7 @@
|
|||
"default": {
|
||||
"$ref": "#/definitions/LLM"
|
||||
},
|
||||
"small": {
|
||||
"$ref": "#/definitions/LLM"
|
||||
},
|
||||
"medium": {
|
||||
"$ref": "#/definitions/LLM"
|
||||
},
|
||||
"large": {
|
||||
"summarize": {
|
||||
"$ref": "#/definitions/LLM"
|
||||
},
|
||||
"edit": {
|
||||
|
|
@ -181,8 +193,8 @@
|
|||
"chat": {
|
||||
"$ref": "#/definitions/LLM"
|
||||
},
|
||||
"unused": {
|
||||
"title": "Unused",
|
||||
"saved": {
|
||||
"title": "Saved",
|
||||
"default": [],
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
|
@ -193,7 +205,9 @@
|
|||
"$ref": "#/definitions/src__continuedev__core__models__ContinueSDK"
|
||||
}
|
||||
},
|
||||
"required": ["default"]
|
||||
"required": [
|
||||
"default"
|
||||
]
|
||||
},
|
||||
"CustomCommand": {
|
||||
"title": "CustomCommand",
|
||||
|
|
@ -212,7 +226,11 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["name", "prompt", "description"]
|
||||
"required": [
|
||||
"name",
|
||||
"prompt",
|
||||
"description"
|
||||
]
|
||||
},
|
||||
"SlashCommand": {
|
||||
"title": "SlashCommand",
|
||||
|
|
@ -235,7 +253,11 @@
|
|||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": ["name", "description", "step"]
|
||||
"required": [
|
||||
"name",
|
||||
"description",
|
||||
"step"
|
||||
]
|
||||
},
|
||||
"Policy": {
|
||||
"title": "Policy",
|
||||
|
|
@ -263,7 +285,10 @@
|
|||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["provider_title", "item_id"]
|
||||
"required": [
|
||||
"provider_title",
|
||||
"item_id"
|
||||
]
|
||||
},
|
||||
"ContextItemDescription": {
|
||||
"title": "ContextItemDescription",
|
||||
|
|
@ -282,7 +307,11 @@
|
|||
"$ref": "#/definitions/ContextItemId"
|
||||
}
|
||||
},
|
||||
"required": ["name", "description", "id"]
|
||||
"required": [
|
||||
"name",
|
||||
"description",
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"ContextItem": {
|
||||
"title": "ContextItem",
|
||||
|
|
@ -307,7 +336,10 @@
|
|||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": ["description", "content"]
|
||||
"required": [
|
||||
"description",
|
||||
"content"
|
||||
]
|
||||
},
|
||||
"ContextProvider": {
|
||||
"title": "ContextProvider",
|
||||
|
|
@ -359,7 +391,12 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"required": ["title", "display_title", "description", "dynamic"]
|
||||
"required": [
|
||||
"title",
|
||||
"display_title",
|
||||
"description",
|
||||
"dynamic"
|
||||
]
|
||||
},
|
||||
"src__continuedev__core__config__ContinueConfig": {
|
||||
"title": "ContinueConfig",
|
||||
|
|
@ -403,13 +440,13 @@
|
|||
"timeout": 300,
|
||||
"verify_ssl": null,
|
||||
"ca_bundle_path": null,
|
||||
"proxy": null,
|
||||
"prompt_templates": {},
|
||||
"api_key": null,
|
||||
"llm": null,
|
||||
"class_name": "OpenAIFreeTrial"
|
||||
},
|
||||
"small": null,
|
||||
"medium": {
|
||||
"summarize": {
|
||||
"title": null,
|
||||
"system_message": null,
|
||||
"context_length": 2048,
|
||||
|
|
@ -418,15 +455,15 @@
|
|||
"timeout": 300,
|
||||
"verify_ssl": null,
|
||||
"ca_bundle_path": null,
|
||||
"proxy": null,
|
||||
"prompt_templates": {},
|
||||
"api_key": null,
|
||||
"llm": null,
|
||||
"class_name": "OpenAIFreeTrial"
|
||||
},
|
||||
"large": null,
|
||||
"edit": null,
|
||||
"chat": null,
|
||||
"unused": []
|
||||
"saved": []
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
|
|
@ -516,4 +553,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -101,85 +101,6 @@
|
|||
"type": "object",
|
||||
"properties": {}
|
||||
},
|
||||
"HistoryNode": {
|
||||
"title": "HistoryNode",
|
||||
"description": "A point in history, a list of which make up History",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"step": {
|
||||
"$ref": "#/definitions/Step"
|
||||
},
|
||||
"observation": {
|
||||
"$ref": "#/definitions/Observation"
|
||||
},
|
||||
"depth": {
|
||||
"title": "Depth",
|
||||
"type": "integer"
|
||||
},
|
||||
"deleted": {
|
||||
"title": "Deleted",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"active": {
|
||||
"title": "Active",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"logs": {
|
||||
"title": "Logs",
|
||||
"default": [],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"step",
|
||||
"depth"
|
||||
]
|
||||
},
|
||||
"History": {
|
||||
"title": "History",
|
||||
"description": "A history of steps taken and their results",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"timeline": {
|
||||
"title": "Timeline",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/HistoryNode"
|
||||
}
|
||||
},
|
||||
"current_index": {
|
||||
"title": "Current Index",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"timeline",
|
||||
"current_index"
|
||||
]
|
||||
},
|
||||
"SlashCommandDescription": {
|
||||
"title": "SlashCommandDescription",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"title": "Name",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"title": "Description",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"description"
|
||||
]
|
||||
},
|
||||
"ContextItemId": {
|
||||
"title": "ContextItemId",
|
||||
"description": "A ContextItemId is a unique identifier for a ContextItem.",
|
||||
|
|
@ -250,6 +171,93 @@
|
|||
"content"
|
||||
]
|
||||
},
|
||||
"HistoryNode": {
|
||||
"title": "HistoryNode",
|
||||
"description": "A point in history, a list of which make up History",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"step": {
|
||||
"$ref": "#/definitions/Step"
|
||||
},
|
||||
"observation": {
|
||||
"$ref": "#/definitions/Observation"
|
||||
},
|
||||
"depth": {
|
||||
"title": "Depth",
|
||||
"type": "integer"
|
||||
},
|
||||
"deleted": {
|
||||
"title": "Deleted",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"active": {
|
||||
"title": "Active",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"logs": {
|
||||
"title": "Logs",
|
||||
"default": [],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"context_used": {
|
||||
"title": "Context Used",
|
||||
"default": [],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/ContextItem"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"step",
|
||||
"depth"
|
||||
]
|
||||
},
|
||||
"History": {
|
||||
"title": "History",
|
||||
"description": "A history of steps taken and their results",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"timeline": {
|
||||
"title": "Timeline",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/HistoryNode"
|
||||
}
|
||||
},
|
||||
"current_index": {
|
||||
"title": "Current Index",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"timeline",
|
||||
"current_index"
|
||||
]
|
||||
},
|
||||
"SlashCommandDescription": {
|
||||
"title": "SlashCommandDescription",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"title": "Name",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"title": "Description",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"description"
|
||||
]
|
||||
},
|
||||
"SessionInfo": {
|
||||
"title": "SessionInfo",
|
||||
"type": "object",
|
||||
|
|
@ -385,6 +393,10 @@
|
|||
"items": {
|
||||
"$ref": "#/definitions/ContextProviderDescription"
|
||||
}
|
||||
},
|
||||
"meilisearch_url": {
|
||||
"title": "Meilisearch Url",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -101,6 +101,76 @@
|
|||
"type": "object",
|
||||
"properties": {}
|
||||
},
|
||||
"ContextItemId": {
|
||||
"title": "ContextItemId",
|
||||
"description": "A ContextItemId is a unique identifier for a ContextItem.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"provider_title": {
|
||||
"title": "Provider Title",
|
||||
"type": "string"
|
||||
},
|
||||
"item_id": {
|
||||
"title": "Item Id",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"provider_title",
|
||||
"item_id"
|
||||
]
|
||||
},
|
||||
"ContextItemDescription": {
|
||||
"title": "ContextItemDescription",
|
||||
"description": "A ContextItemDescription is a description of a ContextItem that is displayed to the user when they type '@'.\n\nThe id can be used to retrieve the ContextItem from the ContextManager.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"title": "Name",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"title": "Description",
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"$ref": "#/definitions/ContextItemId"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"description",
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"ContextItem": {
|
||||
"title": "ContextItem",
|
||||
"description": "A ContextItem is a single item that is stored in the ContextManager.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"description": {
|
||||
"$ref": "#/definitions/ContextItemDescription"
|
||||
},
|
||||
"content": {
|
||||
"title": "Content",
|
||||
"type": "string"
|
||||
},
|
||||
"editing": {
|
||||
"title": "Editing",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"editable": {
|
||||
"title": "Editable",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"description",
|
||||
"content"
|
||||
]
|
||||
},
|
||||
"HistoryNode": {
|
||||
"title": "HistoryNode",
|
||||
"description": "A point in history, a list of which make up History",
|
||||
|
|
@ -133,6 +203,14 @@
|
|||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"context_used": {
|
||||
"title": "Context Used",
|
||||
"default": [],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/ContextItem"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -101,6 +101,76 @@
|
|||
"type": "object",
|
||||
"properties": {}
|
||||
},
|
||||
"ContextItemId": {
|
||||
"title": "ContextItemId",
|
||||
"description": "A ContextItemId is a unique identifier for a ContextItem.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"provider_title": {
|
||||
"title": "Provider Title",
|
||||
"type": "string"
|
||||
},
|
||||
"item_id": {
|
||||
"title": "Item Id",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"provider_title",
|
||||
"item_id"
|
||||
]
|
||||
},
|
||||
"ContextItemDescription": {
|
||||
"title": "ContextItemDescription",
|
||||
"description": "A ContextItemDescription is a description of a ContextItem that is displayed to the user when they type '@'.\n\nThe id can be used to retrieve the ContextItem from the ContextManager.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"title": "Name",
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"title": "Description",
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"$ref": "#/definitions/ContextItemId"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"description",
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"ContextItem": {
|
||||
"title": "ContextItem",
|
||||
"description": "A ContextItem is a single item that is stored in the ContextManager.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"description": {
|
||||
"$ref": "#/definitions/ContextItemDescription"
|
||||
},
|
||||
"content": {
|
||||
"title": "Content",
|
||||
"type": "string"
|
||||
},
|
||||
"editing": {
|
||||
"title": "Editing",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"editable": {
|
||||
"title": "Editable",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"description",
|
||||
"content"
|
||||
]
|
||||
},
|
||||
"src__continuedev__core__main__HistoryNode": {
|
||||
"title": "HistoryNode",
|
||||
"description": "A point in history, a list of which make up History",
|
||||
|
|
@ -133,6 +203,14 @@
|
|||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"context_used": {
|
||||
"title": "Context Used",
|
||||
"default": [],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/ContextItem"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -56,6 +56,11 @@
|
|||
"description": "Path to a custom CA bundle to use when making the HTTP request",
|
||||
"type": "string"
|
||||
},
|
||||
"proxy": {
|
||||
"title": "Proxy",
|
||||
"description": "Proxy URL to use when making the HTTP request",
|
||||
"type": "string"
|
||||
},
|
||||
"prompt_templates": {
|
||||
"title": "Prompt Templates",
|
||||
"description": "A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \"edit\" key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation. See the documentation for more information.",
|
||||
|
|
|
|||
|
|
@ -56,6 +56,11 @@
|
|||
"description": "Path to a custom CA bundle to use when making the HTTP request",
|
||||
"type": "string"
|
||||
},
|
||||
"proxy": {
|
||||
"title": "Proxy",
|
||||
"description": "Proxy URL to use when making the HTTP request",
|
||||
"type": "string"
|
||||
},
|
||||
"prompt_templates": {
|
||||
"title": "Prompt Templates",
|
||||
"description": "A dictionary of prompt templates that can be used to customize the behavior of the LLM in certain situations. For example, set the \"edit\" key in order to change the prompt that is used for the /edit slash command. Each value in the dictionary is a string templated in mustache syntax, and filled in at runtime with the variables specific to the situation. See the documentation for more information.",
|
||||
|
|
@ -85,13 +90,7 @@
|
|||
"default": {
|
||||
"$ref": "#/definitions/LLM"
|
||||
},
|
||||
"small": {
|
||||
"$ref": "#/definitions/LLM"
|
||||
},
|
||||
"medium": {
|
||||
"$ref": "#/definitions/LLM"
|
||||
},
|
||||
"large": {
|
||||
"summarize": {
|
||||
"$ref": "#/definitions/LLM"
|
||||
},
|
||||
"edit": {
|
||||
|
|
@ -100,8 +99,8 @@
|
|||
"chat": {
|
||||
"$ref": "#/definitions/LLM"
|
||||
},
|
||||
"unused": {
|
||||
"title": "Unused",
|
||||
"saved": {
|
||||
"title": "Saved",
|
||||
"default": [],
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue