Merge pull request #11 from continuedev/syntactic-sugar
Syntactic sugar
This commit is contained in:
commit
5ef9950b3b
35 changed files with 2525 additions and 638 deletions
180
continuedev/src/continuedev/core/agent.py
Normal file
180
continuedev/src/continuedev/core/agent.py
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
import traceback
|
||||
import time
|
||||
from typing import Callable, Coroutine, List
|
||||
from ..models.filesystem_edit import FileEditWithFullContents
|
||||
from ..libs.llm import LLM
|
||||
from .observation import Observation
|
||||
from ..server.ide_protocol import AbstractIdeProtocolServer
|
||||
from ..libs.util.queue import AsyncSubscriptionQueue
|
||||
from ..models.main import ContinueBaseModel
|
||||
from .main import Policy, History, FullState, Step, HistoryNode
|
||||
from ..libs.steps.core.core import ReversibleStep, ManualEditStep, UserInputStep
|
||||
from .sdk import ContinueSDK
|
||||
|
||||
|
||||
class Agent(ContinueBaseModel):
|
||||
llm: LLM
|
||||
policy: Policy
|
||||
ide: AbstractIdeProtocolServer
|
||||
history: History = History.from_empty()
|
||||
continue_sdk: "ContinueSDK"
|
||||
_on_update_callbacks: List[Callable[[FullState], None]] = []
|
||||
|
||||
_active: bool = False
|
||||
_should_halt: bool = False
|
||||
_main_user_input_queue: List[str] = []
|
||||
|
||||
_user_input_queue = AsyncSubscriptionQueue()
|
||||
|
||||
class Config:
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
def get_full_state(self) -> FullState:
|
||||
return FullState(history=self.history, active=self._active, user_input_queue=self._main_user_input_queue)
|
||||
|
||||
def on_update(self, callback: Callable[["FullState"], None]):
|
||||
"""Subscribe to changes to state"""
|
||||
self._on_update_callbacks.append(callback)
|
||||
|
||||
def update_subscribers(self):
|
||||
full_state = self.get_full_state()
|
||||
for callback in self._on_update_callbacks:
|
||||
callback(full_state)
|
||||
|
||||
def __get_step_params(self, step: "Step"):
|
||||
return ContinueSDK(agent=self, llm=self.llm.with_system_message(step.system_message))
|
||||
|
||||
def give_user_input(self, input: str, index: int):
|
||||
self._user_input_queue.post(index, input)
|
||||
|
||||
async def wait_for_user_input(self) -> str:
|
||||
self._active = False
|
||||
self.update_subscribers()
|
||||
await self._user_input_queue.get(self.history.current_index)
|
||||
self._active = True
|
||||
self.update_subscribers()
|
||||
|
||||
_manual_edits_buffer: List[FileEditWithFullContents] = []
|
||||
|
||||
async def reverse_to_index(self, index: int):
|
||||
try:
|
||||
while self.history.get_current_index() >= index:
|
||||
current_step = self.history.get_current().step
|
||||
self.history.step_back()
|
||||
if issubclass(current_step.__class__, ReversibleStep):
|
||||
await current_step.reverse(self.__get_step_params(current_step))
|
||||
|
||||
self.update_subscribers()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def handle_manual_edits(self, edits: List[FileEditWithFullContents]):
|
||||
for edit in edits:
|
||||
self._manual_edits_buffer.append(edit)
|
||||
# TODO: You're storing a lot of unecessary data here. Can compress into EditDiffs on the spot, and merge.
|
||||
# self._manual_edits_buffer = merge_file_edit(self._manual_edits_buffer, edit)
|
||||
|
||||
def handle_traceback(self, traceback: str):
|
||||
raise NotImplementedError
|
||||
|
||||
_step_depth: int = 0
|
||||
|
||||
async def _run_singular_step(self, step: "Step", is_future_step: bool = False) -> Coroutine[Observation, None, None]:
|
||||
if not is_future_step:
|
||||
# Check manual edits buffer, clear out if needed by creating a ManualEditStep
|
||||
if len(self._manual_edits_buffer) > 0:
|
||||
manualEditsStep = ManualEditStep.from_sequence(
|
||||
self._manual_edits_buffer)
|
||||
self._manual_edits_buffer = []
|
||||
await self._run_singular_step(manualEditsStep)
|
||||
|
||||
# Update history - do this first so we get top-first tree ordering
|
||||
self.history.add_node(HistoryNode(
|
||||
step=step, observation=None, depth=self._step_depth))
|
||||
|
||||
# Run step
|
||||
self._step_depth += 1
|
||||
observation = await step(self.__get_step_params(step))
|
||||
self._step_depth -= 1
|
||||
|
||||
# Add observation to history
|
||||
self.history.get_current().observation = observation
|
||||
|
||||
# Update its description
|
||||
step._set_description(await step.describe(self.llm))
|
||||
|
||||
# Call all subscribed callbacks
|
||||
self.update_subscribers()
|
||||
|
||||
return observation
|
||||
|
||||
async def run_from_step(self, step: "Step"):
|
||||
# if self._active:
|
||||
# raise RuntimeError("Agent is already running")
|
||||
self._active = True
|
||||
|
||||
next_step = step
|
||||
is_future_step = False
|
||||
while not (next_step is None or self._should_halt):
|
||||
try:
|
||||
if is_future_step:
|
||||
# If future step, then we are replaying and need to delete the step from history so it can be replaced
|
||||
self.history.remove_current_and_substeps()
|
||||
|
||||
observation = await self._run_singular_step(next_step, is_future_step)
|
||||
if next_step := self.policy.next(self.history):
|
||||
is_future_step = False
|
||||
elif next_step := self.history.take_next_step():
|
||||
is_future_step = True
|
||||
else:
|
||||
next_step = None
|
||||
|
||||
except Exception as e:
|
||||
print(
|
||||
f"Error while running step: \n{''.join(traceback.format_tb(e.__traceback__))}\n{e}")
|
||||
next_step = None
|
||||
|
||||
self._active = False
|
||||
|
||||
# Doing this so active can make it to the frontend after steps are done. But want better state syncing tools
|
||||
for callback in self._on_update_callbacks:
|
||||
callback(None)
|
||||
|
||||
async def run_from_observation(self, observation: Observation):
|
||||
next_step = self.policy.next(self.history)
|
||||
await self.run_from_step(next_step)
|
||||
|
||||
async def run_policy(self):
|
||||
first_step = self.policy.next(self.history)
|
||||
await self.run_from_step(first_step)
|
||||
|
||||
async def _request_halt(self):
|
||||
if self._active:
|
||||
self._should_halt = True
|
||||
while self._active:
|
||||
time.sleep(0.1)
|
||||
self._should_halt = False
|
||||
return None
|
||||
|
||||
async def accept_user_input(self, user_input: str):
|
||||
self._main_user_input_queue.append(user_input)
|
||||
self.update_subscribers()
|
||||
|
||||
if len(self._main_user_input_queue) > 1:
|
||||
return
|
||||
|
||||
# await self._request_halt()
|
||||
# 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)
|
||||
self.update_subscribers()
|
||||
await self.run_from_step(UserInputStep(user_input=user_input))
|
||||
|
||||
while len(self._main_user_input_queue) > 0:
|
||||
await self.run_from_step(UserInputStep(
|
||||
user_input=self._main_user_input_queue.pop(0)))
|
||||
|
||||
async def accept_refinement_input(self, user_input: str, index: int):
|
||||
await self._request_halt()
|
||||
await self.reverse_to_index(index)
|
||||
await self.run_from_step(UserInputStep(user_input=user_input))
|
||||
7
continuedev/src/continuedev/core/env.py
Normal file
7
continuedev/src/continuedev/core/env.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from dotenv import load_dotenv
|
||||
import os
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
openai_api_key = os.getenv("OPENAI_API_KEY")
|
||||
148
continuedev/src/continuedev/core/main.py
Normal file
148
continuedev/src/continuedev/core/main.py
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
from typing import Callable, Coroutine, Dict, Generator, List, Tuple, Union
|
||||
|
||||
from ..models.main import ContinueBaseModel
|
||||
from pydantic import validator
|
||||
from ..libs.llm import LLM
|
||||
from .observation import Observation
|
||||
|
||||
|
||||
class HistoryNode(ContinueBaseModel):
|
||||
"""A point in history, a list of which make up History"""
|
||||
step: "Step"
|
||||
observation: Union[Observation, None]
|
||||
depth: int
|
||||
|
||||
|
||||
class History(ContinueBaseModel):
|
||||
"""A history of steps taken and their results"""
|
||||
timeline: List[HistoryNode]
|
||||
current_index: int
|
||||
|
||||
def add_node(self, node: HistoryNode):
|
||||
self.timeline.insert(self.current_index + 1, node)
|
||||
self.current_index += 1
|
||||
|
||||
def get_current(self) -> Union[HistoryNode, None]:
|
||||
if self.current_index < 0:
|
||||
return None
|
||||
return self.timeline[self.current_index]
|
||||
|
||||
def remove_current_and_substeps(self):
|
||||
self.timeline.pop(self.current_index)
|
||||
while self.get_current() is not None and self.get_current().depth > 0:
|
||||
self.timeline.pop(self.current_index)
|
||||
|
||||
def take_next_step(self) -> Union["Step", None]:
|
||||
if self.has_future():
|
||||
self.current_index += 1
|
||||
current_state = self.get_current()
|
||||
if current_state is None:
|
||||
return None
|
||||
return current_state.step
|
||||
return None
|
||||
|
||||
def get_current_index(self) -> int:
|
||||
return self.current_index
|
||||
|
||||
def has_future(self) -> bool:
|
||||
return self.current_index < len(self.timeline) - 1
|
||||
|
||||
def step_back(self):
|
||||
self.current_index -= 1
|
||||
|
||||
def last_observation(self) -> Union[Observation, None]:
|
||||
state = self.get_current()
|
||||
if state is None:
|
||||
return None
|
||||
return state.observation
|
||||
|
||||
@classmethod
|
||||
def from_empty(cls):
|
||||
return cls(timeline=[], current_index=-1)
|
||||
|
||||
|
||||
class FullState(ContinueBaseModel):
|
||||
"""A full state of the program, including the history"""
|
||||
history: History
|
||||
active: bool
|
||||
user_input_queue: List[str]
|
||||
|
||||
|
||||
class ContinueSDK:
|
||||
pass
|
||||
|
||||
|
||||
class SequentialStep:
|
||||
pass
|
||||
|
||||
|
||||
class Policy(ContinueBaseModel):
|
||||
"""A rule that determines which step to take next"""
|
||||
|
||||
# Note that history is mutable, kinda sus
|
||||
def next(self, history: History = History.from_empty()) -> "Step":
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class Step(ContinueBaseModel):
|
||||
name: str = None
|
||||
hide: bool = False
|
||||
_description: Union[str, None] = None
|
||||
|
||||
system_message: Union[str, None] = None
|
||||
|
||||
class Config:
|
||||
copy_on_model_validation = False
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
if self._description is not None:
|
||||
return self._description
|
||||
return "Running step: " + self.name
|
||||
|
||||
def _set_description(self, description: str):
|
||||
self._description = description
|
||||
|
||||
def dict(self, *args, **kwargs):
|
||||
d = super().dict(*args, **kwargs)
|
||||
if self._description is not None:
|
||||
d["description"] = self._description
|
||||
else:
|
||||
d["description"] = self.name
|
||||
return d
|
||||
|
||||
@validator("name", pre=True, always=True)
|
||||
def name_is_class_name(cls, name):
|
||||
if name is None:
|
||||
return cls.__name__
|
||||
return name
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
raise NotImplementedError
|
||||
|
||||
async def __call__(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
return await self.run(sdk)
|
||||
|
||||
def __rshift__(self, other: "Step"):
|
||||
steps = []
|
||||
if isinstance(self, SequentialStep):
|
||||
steps = self.steps
|
||||
else:
|
||||
steps.append(self)
|
||||
if isinstance(other, SequentialStep):
|
||||
steps += other.steps
|
||||
else:
|
||||
steps.append(other)
|
||||
return SequentialStep(steps=steps)
|
||||
|
||||
|
||||
class ValidatorObservation(Observation):
|
||||
passed: bool
|
||||
observation: Observation
|
||||
|
||||
|
||||
class Validator(Step):
|
||||
def run(self, sdk: ContinueSDK) -> ValidatorObservation:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
HistoryNode.update_forward_refs()
|
||||
|
|
@ -1,11 +1,13 @@
|
|||
from typing import List, Tuple, Type
|
||||
|
||||
from .steps.ty import CreatePipelineStep
|
||||
from .core import Step, Validator, Policy, History
|
||||
from ..models.main import ContinueBaseModel
|
||||
|
||||
from ..libs.steps.ty import CreatePipelineStep
|
||||
from .main import Step, Validator, History, Policy
|
||||
from .observation import Observation, TracebackObservation, UserInputObservation
|
||||
from .steps.main import EditCodeStep, EditHighlightedCodeStep, SolveTracebackStep, RunCodeStep, FasterEditHighlightedCodeStep
|
||||
from .steps.nate import WritePytestsStep, CreateTableStep
|
||||
from .steps.chroma import AnswerQuestionChroma, EditFileChroma
|
||||
from ..libs.steps.main import EditHighlightedCodeStep, SolveTracebackStep, RunCodeStep
|
||||
from ..libs.steps.nate import WritePytestsStep, CreateTableStep
|
||||
from ..libs.steps.chroma import AnswerQuestionChroma, EditFileChroma
|
||||
|
||||
|
||||
class DemoPolicy(Policy):
|
||||
62
continuedev/src/continuedev/core/sdk.py
Normal file
62
continuedev/src/continuedev/core/sdk.py
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
from typing import Coroutine, Union
|
||||
from ..models.filesystem_edit import FileSystemEdit
|
||||
from ..models.filesystem import RangeInFile
|
||||
from ..libs.llm import LLM
|
||||
from .observation import Observation
|
||||
from ..server.ide_protocol import AbstractIdeProtocolServer
|
||||
from .main import History, Step
|
||||
from ..libs.steps.core.core import *
|
||||
|
||||
|
||||
class Agent:
|
||||
pass
|
||||
|
||||
|
||||
class ContinueSDKSteps:
|
||||
def __init__(self, sdk: "ContinueSDK"):
|
||||
self.sdk = sdk
|
||||
|
||||
|
||||
class ContinueSDK:
|
||||
"""The SDK provided as parameters to a step"""
|
||||
llm: LLM
|
||||
ide: AbstractIdeProtocolServer
|
||||
steps: ContinueSDKSteps
|
||||
__agent: Agent
|
||||
|
||||
def __init__(self, agent: Agent, llm: Union[LLM, None] = None):
|
||||
if llm is None:
|
||||
self.llm = agent.llm
|
||||
else:
|
||||
self.llm = llm
|
||||
self.ide = agent.ide
|
||||
self.__agent = agent
|
||||
self.steps = ContinueSDKSteps(self)
|
||||
|
||||
@property
|
||||
def history(self) -> History:
|
||||
return self.__agent.history
|
||||
|
||||
async def run_step(self, step: Step) -> Coroutine[Observation, None, None]:
|
||||
return await self.__agent._run_singular_step(step)
|
||||
|
||||
async def apply_filesystem_edit(self, edit: FileSystemEdit):
|
||||
await self.run_step(FileSystemEditStep(edit=edit))
|
||||
|
||||
async def wait_for_user_input(self) -> str:
|
||||
return await self.__agent.wait_for_user_input()
|
||||
|
||||
async def wait_for_user_confirmation(self, prompt: str):
|
||||
return await self.run_step(WaitForUserConfirmationStep(prompt=prompt))
|
||||
|
||||
async def run(self, commands: List[str] | str, cwd: str = None):
|
||||
commands = commands if isinstance(commands, List) else [commands]
|
||||
return self.run_step(ShellCommandsStep(commands=commands, cwd=cwd))
|
||||
|
||||
async def edit_file(self, filename: str, prompt: str):
|
||||
await self.ide.setFileOpen(filename)
|
||||
contents = await self.ide.readFile(filename)
|
||||
await self.run_step(EditCodeStep(
|
||||
range_in_files=[RangeInFile.from_entire_file(filename, contents)],
|
||||
prompt=f'Here is the code before:\n\n{{code}}\n\nHere is the user request:\n\n{prompt}\n\nHere is the code edited to perfectly solve the user request:\n\n'
|
||||
))
|
||||
|
|
@ -1,423 +0,0 @@
|
|||
import traceback
|
||||
import time
|
||||
from typing import Callable, Coroutine, Dict, Generator, List, Tuple, Union
|
||||
from ..models.filesystem_edit import EditDiff, FileEdit, FileEditWithFullContents, FileSystemEdit
|
||||
from ..models.filesystem import FileSystem
|
||||
from pydantic import BaseModel, parse_file_as, validator
|
||||
from .llm import LLM
|
||||
from .observation import Observation, UserInputObservation
|
||||
from ..server.ide_protocol import AbstractIdeProtocolServer
|
||||
from .util.queue import AsyncSubscriptionQueue
|
||||
|
||||
|
||||
class ContinueBaseModel(BaseModel):
|
||||
class Config:
|
||||
underscore_attrs_are_private = True
|
||||
|
||||
|
||||
class HistoryNode(ContinueBaseModel):
|
||||
"""A point in history, a list of which make up History"""
|
||||
step: "Step"
|
||||
observation: Union[Observation, None]
|
||||
depth: int
|
||||
|
||||
|
||||
class History(ContinueBaseModel):
|
||||
"""A history of steps taken and their results"""
|
||||
timeline: List[HistoryNode]
|
||||
current_index: int
|
||||
|
||||
def add_node(self, node: HistoryNode):
|
||||
self.timeline.insert(self.current_index + 1, node)
|
||||
self.current_index += 1
|
||||
|
||||
def get_current(self) -> Union[HistoryNode, None]:
|
||||
if self.current_index < 0:
|
||||
return None
|
||||
return self.timeline[self.current_index]
|
||||
|
||||
def remove_current_and_substeps(self):
|
||||
self.timeline.pop(self.current_index)
|
||||
while self.get_current() is not None and self.get_current().depth > 0:
|
||||
self.timeline.pop(self.current_index)
|
||||
|
||||
def take_next_step(self) -> Union["Step", None]:
|
||||
if self.has_future():
|
||||
self.current_index += 1
|
||||
current_state = self.get_current()
|
||||
if current_state is None:
|
||||
return None
|
||||
return current_state.step
|
||||
return None
|
||||
|
||||
def get_current_index(self) -> int:
|
||||
return self.current_index
|
||||
|
||||
def has_future(self) -> bool:
|
||||
return self.current_index < len(self.timeline) - 1
|
||||
|
||||
def step_back(self):
|
||||
self.current_index -= 1
|
||||
|
||||
def last_observation(self) -> Union[Observation, None]:
|
||||
state = self.get_current()
|
||||
if state is None:
|
||||
return None
|
||||
return state.observation
|
||||
|
||||
@classmethod
|
||||
def from_empty(cls):
|
||||
return cls(timeline=[], current_index=-1)
|
||||
|
||||
|
||||
class FullState(ContinueBaseModel):
|
||||
"""A full state of the program, including the history"""
|
||||
history: History
|
||||
active: bool
|
||||
user_input_queue: List[str]
|
||||
|
||||
|
||||
class Policy(ContinueBaseModel):
|
||||
"""A rule that determines which step to take next"""
|
||||
|
||||
# Note that history is mutable, kinda sus
|
||||
def next(self, history: History = History.from_empty()) -> "Step":
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class ContinueSDK:
|
||||
"""The SDK provided as parameters to a step"""
|
||||
llm: LLM
|
||||
ide: AbstractIdeProtocolServer
|
||||
__agent: "Agent"
|
||||
|
||||
def __init__(self, agent: "Agent", llm: Union[LLM, None] = None):
|
||||
if llm is None:
|
||||
self.llm = agent.llm
|
||||
else:
|
||||
self.llm = llm
|
||||
self.ide = agent.ide
|
||||
self.__agent = agent
|
||||
|
||||
@property
|
||||
def history(self) -> History:
|
||||
return self.__agent.history
|
||||
|
||||
async def run_step(self, step: "Step") -> Coroutine[Observation, None, None]:
|
||||
return await self.__agent._run_singular_step(step)
|
||||
|
||||
async def apply_filesystem_edit(self, edit: FileSystemEdit):
|
||||
await self.run_step(FileSystemEditStep(edit=edit))
|
||||
|
||||
async def wait_for_user_input(self) -> str:
|
||||
return await self.__agent.wait_for_user_input()
|
||||
|
||||
|
||||
class Agent(ContinueBaseModel):
|
||||
llm: LLM
|
||||
policy: Policy
|
||||
ide: AbstractIdeProtocolServer
|
||||
history: History = History.from_empty()
|
||||
_on_update_callbacks: List[Callable[["FullState"], None]] = []
|
||||
|
||||
_active: bool = False
|
||||
_should_halt: bool = False
|
||||
_main_user_input_queue: List[str] = []
|
||||
|
||||
_user_input_queue = AsyncSubscriptionQueue()
|
||||
|
||||
class Config:
|
||||
arbitrary_types_allowed = True
|
||||
|
||||
def get_full_state(self) -> FullState:
|
||||
return FullState(history=self.history, active=self._active, user_input_queue=self._main_user_input_queue)
|
||||
|
||||
def on_update(self, callback: Callable[["FullState"], None]):
|
||||
"""Subscribe to changes to state"""
|
||||
self._on_update_callbacks.append(callback)
|
||||
|
||||
def update_subscribers(self):
|
||||
full_state = self.get_full_state()
|
||||
for callback in self._on_update_callbacks:
|
||||
callback(full_state)
|
||||
|
||||
def __get_step_params(self, step: "Step"):
|
||||
return ContinueSDK(agent=self, llm=self.llm.with_system_message(step.system_message))
|
||||
|
||||
def give_user_input(self, input: str, index: int):
|
||||
self._user_input_queue.post(index, input)
|
||||
|
||||
async def wait_for_user_input(self) -> str:
|
||||
self._active = False
|
||||
self.update_subscribers()
|
||||
await self._user_input_queue.get(self.history.current_index)
|
||||
self._active = True
|
||||
self.update_subscribers()
|
||||
|
||||
_manual_edits_buffer: List[FileEditWithFullContents] = []
|
||||
|
||||
async def reverse_to_index(self, index: int):
|
||||
try:
|
||||
while self.history.get_current_index() >= index:
|
||||
current_step = self.history.get_current().step
|
||||
self.history.step_back()
|
||||
if issubclass(current_step.__class__, ReversibleStep):
|
||||
await current_step.reverse(self.__get_step_params(current_step))
|
||||
|
||||
self.update_subscribers()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def handle_manual_edits(self, edits: List[FileEditWithFullContents]):
|
||||
for edit in edits:
|
||||
self._manual_edits_buffer.append(edit)
|
||||
# TODO: You're storing a lot of unecessary data here. Can compress into EditDiffs on the spot, and merge.
|
||||
# self._manual_edits_buffer = merge_file_edit(self._manual_edits_buffer, edit)
|
||||
|
||||
def handle_traceback(self, traceback: str):
|
||||
raise NotImplementedError
|
||||
|
||||
_step_depth: int = 0
|
||||
|
||||
async def _run_singular_step(self, step: "Step", is_future_step: bool = False) -> Coroutine[Observation, None, None]:
|
||||
if not is_future_step:
|
||||
# Check manual edits buffer, clear out if needed by creating a ManualEditStep
|
||||
if len(self._manual_edits_buffer) > 0:
|
||||
manualEditsStep = ManualEditStep.from_sequence(
|
||||
self._manual_edits_buffer)
|
||||
self._manual_edits_buffer = []
|
||||
await self._run_singular_step(manualEditsStep)
|
||||
|
||||
# Update history - do this first so we get top-first tree ordering
|
||||
self.history.add_node(HistoryNode(
|
||||
step=step, observation=None, depth=self._step_depth))
|
||||
|
||||
# Run step
|
||||
self._step_depth += 1
|
||||
observation = await step(self.__get_step_params(step))
|
||||
self._step_depth -= 1
|
||||
|
||||
# Add observation to history
|
||||
self.history.get_current().observation = observation
|
||||
|
||||
# Update its description
|
||||
step._set_description(await step.describe(self.llm))
|
||||
|
||||
# Call all subscribed callbacks
|
||||
self.update_subscribers()
|
||||
|
||||
return observation
|
||||
|
||||
async def run_from_step(self, step: "Step"):
|
||||
# if self._active:
|
||||
# raise RuntimeError("Agent is already running")
|
||||
self._active = True
|
||||
|
||||
next_step = step
|
||||
is_future_step = False
|
||||
while not (next_step is None or self._should_halt):
|
||||
try:
|
||||
if is_future_step:
|
||||
# If future step, then we are replaying and need to delete the step from history so it can be replaced
|
||||
self.history.remove_current_and_substeps()
|
||||
|
||||
observation = await self._run_singular_step(next_step, is_future_step)
|
||||
if next_step := self.policy.next(self.history):
|
||||
is_future_step = False
|
||||
elif next_step := self.history.take_next_step():
|
||||
is_future_step = True
|
||||
else:
|
||||
next_step = None
|
||||
|
||||
except Exception as e:
|
||||
print(
|
||||
f"Error while running step: \n{''.join(traceback.format_tb(e.__traceback__))}\n{e}")
|
||||
next_step = None
|
||||
|
||||
self._active = False
|
||||
|
||||
# Doing this so active can make it to the frontend after steps are done. But want better state syncing tools
|
||||
for callback in self._on_update_callbacks:
|
||||
callback(None)
|
||||
|
||||
async def run_from_observation(self, observation: Observation):
|
||||
next_step = self.policy.next(self.history)
|
||||
await self.run_from_step(next_step)
|
||||
|
||||
async def run_policy(self):
|
||||
first_step = self.policy.next(self.history)
|
||||
await self.run_from_step(first_step)
|
||||
|
||||
async def _request_halt(self):
|
||||
if self._active:
|
||||
self._should_halt = True
|
||||
while self._active:
|
||||
time.sleep(0.1)
|
||||
self._should_halt = False
|
||||
return None
|
||||
|
||||
async def accept_user_input(self, user_input: str):
|
||||
self._main_user_input_queue.append(user_input)
|
||||
self.update_subscribers()
|
||||
|
||||
if len(self._main_user_input_queue) > 1:
|
||||
return
|
||||
|
||||
# await self._request_halt()
|
||||
# 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)
|
||||
self.update_subscribers()
|
||||
await self.run_from_step(UserInputStep(user_input=user_input))
|
||||
|
||||
while len(self._main_user_input_queue) > 0:
|
||||
await self.run_from_step(UserInputStep(
|
||||
user_input=self._main_user_input_queue.pop(0)))
|
||||
|
||||
async def accept_refinement_input(self, user_input: str, index: int):
|
||||
await self._request_halt()
|
||||
await self.reverse_to_index(index)
|
||||
await self.run_from_step(UserInputStep(user_input=user_input))
|
||||
|
||||
|
||||
class Step(ContinueBaseModel):
|
||||
name: str = None
|
||||
hide: bool = False
|
||||
_description: Union[str, None] = None
|
||||
|
||||
system_message: Union[str, None] = None
|
||||
|
||||
class Config:
|
||||
copy_on_model_validation = False
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
if self._description is not None:
|
||||
return self._description
|
||||
return "Running step: " + self.name
|
||||
|
||||
def _set_description(self, description: str):
|
||||
self._description = description
|
||||
|
||||
def dict(self, *args, **kwargs):
|
||||
d = super().dict(*args, **kwargs)
|
||||
if self._description is not None:
|
||||
d["description"] = self._description
|
||||
else:
|
||||
d["description"] = self.name
|
||||
return d
|
||||
|
||||
@validator("name", pre=True, always=True)
|
||||
def name_is_class_name(cls, name):
|
||||
if name is None:
|
||||
return cls.__name__
|
||||
return name
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
raise NotImplementedError
|
||||
|
||||
async def __call__(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
return await self.run(sdk)
|
||||
|
||||
def __rshift__(self, other: "Step"):
|
||||
steps = []
|
||||
if isinstance(self, SequentialStep):
|
||||
steps = self.steps
|
||||
else:
|
||||
steps.append(self)
|
||||
if isinstance(other, SequentialStep):
|
||||
steps += other.steps
|
||||
else:
|
||||
steps.append(other)
|
||||
return SequentialStep(steps=steps)
|
||||
|
||||
|
||||
class SequentialStep(Step):
|
||||
steps: list[Step]
|
||||
hide: bool = True
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
for step in self.steps:
|
||||
observation = await sdk.run_step(step)
|
||||
return observation
|
||||
|
||||
|
||||
class ReversibleStep(Step):
|
||||
async def reverse(self, sdk: ContinueSDK):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class FileSystemEditStep(ReversibleStep):
|
||||
edit: FileSystemEdit
|
||||
_diff: Union[EditDiff, None] = None
|
||||
|
||||
hide: bool = True
|
||||
|
||||
async def run(self, sdk: "ContinueSDK") -> Coroutine[Observation, None, None]:
|
||||
self._diff = await sdk.ide.applyFileSystemEdit(self.edit)
|
||||
return None
|
||||
|
||||
async def reverse(self, sdk: "ContinueSDK"):
|
||||
await sdk.ide.applyFileSystemEdit(self._diff.backward)
|
||||
# Where and when should file saves happen?
|
||||
|
||||
|
||||
class ManualEditStep(ReversibleStep):
|
||||
edit_diff: EditDiff
|
||||
hide: bool = True
|
||||
|
||||
hide: bool = True
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return "Manual edit step"
|
||||
# TODO - only handling FileEdit here, but need all other types of FileSystemEdits
|
||||
# Also requires the merge_file_edit function
|
||||
# return llm.complete(dedent(f"""This code was replaced:
|
||||
|
||||
# {self.edit_diff.backward.replacement}
|
||||
|
||||
# With this code:
|
||||
|
||||
# {self.edit_diff.forward.replacement}
|
||||
|
||||
# Maximally concise summary of changes in bullet points (can use markdown):
|
||||
# """))
|
||||
|
||||
@classmethod
|
||||
def from_sequence(cls, edits: List[FileEditWithFullContents]) -> "ManualEditStep":
|
||||
diffs = []
|
||||
for edit in edits:
|
||||
_, diff = FileSystem.apply_edit_to_str(
|
||||
edit.fileContents, edit.fileEdit)
|
||||
diffs.append(diff)
|
||||
return cls(edit_diff=EditDiff.from_sequence(diffs))
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
return None
|
||||
|
||||
async def reverse(self, sdk: ContinueSDK):
|
||||
await sdk.ide.applyFileSystemEdit(self.edit_diff.backward)
|
||||
|
||||
|
||||
class UserInputStep(Step):
|
||||
user_input: str
|
||||
name: str = "User Input"
|
||||
hide: bool = True
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return self.user_input
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[UserInputObservation, None, None]:
|
||||
return UserInputObservation(user_input=self.user_input)
|
||||
|
||||
|
||||
class ValidatorObservation(Observation):
|
||||
passed: bool
|
||||
observation: Observation
|
||||
|
||||
|
||||
class Validator(Step):
|
||||
def run(self, sdk: ContinueSDK) -> ValidatorObservation:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
HistoryNode.update_forward_refs()
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
from textwrap import dedent
|
||||
from typing import Coroutine, Union
|
||||
from ...models.filesystem_edit import AddDirectory, AddFile
|
||||
from ..observation import Observation, TextObservation
|
||||
from ..core import Step, ContinueSDK
|
||||
from .main import EditCodeStep, EditFileStep, RunCommandStep, WaitForUserConfirmationStep
|
||||
from ...core.observation import Observation, TextObservation
|
||||
from ...core.main import Step, ContinueSDK
|
||||
from .core.core import EditFileStep
|
||||
from ..chroma.query import query_codebase_index
|
||||
from .main import EditFileStep
|
||||
from .core.core import EditFileStep
|
||||
|
||||
|
||||
class AnswerQuestionChroma(Step):
|
||||
|
|
|
|||
216
continuedev/src/continuedev/libs/steps/core/core.py
Normal file
216
continuedev/src/continuedev/libs/steps/core/core.py
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
# These steps are depended upon by ContinueSDK
|
||||
import subprocess
|
||||
from textwrap import dedent
|
||||
from typing import Coroutine, List, Union
|
||||
from ...llm.prompt_utils import MarkdownStyleEncoderDecoder
|
||||
|
||||
from ...util.traceback_parsers import parse_python_traceback
|
||||
|
||||
from ....models.filesystem_edit import EditDiff, FileEditWithFullContents, FileSystemEdit
|
||||
from ....models.filesystem import FileSystem, RangeInFile, RangeInFileWithContents
|
||||
from ...llm import LLM
|
||||
from ....core.observation import Observation, TextObservation, TracebackObservation, UserInputObservation
|
||||
from ....core.main import Step
|
||||
|
||||
|
||||
class ContinueSDK:
|
||||
pass
|
||||
|
||||
|
||||
class SequentialStep(Step):
|
||||
steps: list[Step]
|
||||
hide: bool = True
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
for step in self.steps:
|
||||
observation = await sdk.run_step(step)
|
||||
return observation
|
||||
|
||||
|
||||
class ReversibleStep(Step):
|
||||
async def reverse(self, sdk: ContinueSDK):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class FileSystemEditStep(ReversibleStep):
|
||||
edit: FileSystemEdit
|
||||
_diff: Union[EditDiff, None] = None
|
||||
|
||||
hide: bool = True
|
||||
|
||||
async def run(self, sdk: "ContinueSDK") -> Coroutine[Observation, None, None]:
|
||||
self._diff = await sdk.ide.applyFileSystemEdit(self.edit)
|
||||
return None
|
||||
|
||||
async def reverse(self, sdk: "ContinueSDK"):
|
||||
await sdk.ide.applyFileSystemEdit(self._diff.backward)
|
||||
# Where and when should file saves happen?
|
||||
|
||||
|
||||
def ShellCommandsStep(Step):
|
||||
cmds: List[str]
|
||||
cwd: str | None = None
|
||||
name: str = "Run Shell Commands"
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return "\n".join(self.cmds)
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
cwd = await sdk.ide.getWorkspaceDirectory() if self.cwd is None else self.cwd
|
||||
|
||||
process = subprocess.Popen(
|
||||
'/bin/bash', stdin=subprocess.PIPE, stdout=subprocess.PIPE, cwd=cwd)
|
||||
|
||||
stdin_input = "\n".join(self.cmds)
|
||||
out, err = process.communicate(stdin_input.encode())
|
||||
|
||||
# If it fails, return the error
|
||||
if err is not None and err != "":
|
||||
return TextObservation(text=err)
|
||||
|
||||
return None
|
||||
|
||||
|
||||
class EditCodeStep(Step):
|
||||
# Might make an even more specific atomic step, which is "apply file edit"
|
||||
range_in_files: List[RangeInFile]
|
||||
prompt: str # String with {code} somewhere
|
||||
name: str = "Edit code"
|
||||
|
||||
_edit_diffs: Union[List[EditDiff], None] = None
|
||||
_prompt: Union[str, None] = None
|
||||
_completion: Union[str, None] = None
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
if self._edit_diffs is None:
|
||||
return "Editing files: " + ", ".join(map(lambda rif: rif.filepath, self.range_in_files))
|
||||
elif len(self._edit_diffs) == 0:
|
||||
return "No edits made"
|
||||
else:
|
||||
return llm.complete(dedent(f"""{self._prompt}{self._completion}
|
||||
|
||||
Maximally concise summary of changes in bullet points (can use markdown):
|
||||
"""))
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
rif_with_contents = []
|
||||
for range_in_file in self.range_in_files:
|
||||
file_contents = await sdk.ide.readRangeInFile(range_in_file)
|
||||
rif_with_contents.append(
|
||||
RangeInFileWithContents.from_range_in_file(range_in_file, file_contents))
|
||||
enc_dec = MarkdownStyleEncoderDecoder(rif_with_contents)
|
||||
code_string = enc_dec.encode()
|
||||
prompt = self.prompt.format(code=code_string)
|
||||
|
||||
completion = sdk.llm.complete(prompt)
|
||||
|
||||
# Temporarily doing this to generate description.
|
||||
self._prompt = prompt
|
||||
self._completion = completion
|
||||
|
||||
file_edits = enc_dec.decode(completion)
|
||||
|
||||
self._edit_diffs = []
|
||||
for file_edit in file_edits:
|
||||
diff = await sdk.apply_filesystem_edit(file_edit)
|
||||
self._edit_diffs.append(diff)
|
||||
|
||||
for filepath in set([file_edit.filepath for file_edit in file_edits]):
|
||||
await sdk.ide.saveFile(filepath)
|
||||
await sdk.ide.setFileOpen(filepath)
|
||||
|
||||
return None
|
||||
|
||||
|
||||
class EditFileStep(Step):
|
||||
filepath: str
|
||||
prompt: str
|
||||
hide: bool = True
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return "Editing file: " + self.filepath
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
file_contents = await sdk.ide.readFile(self.filepath)
|
||||
await sdk.run_step(EditCodeStep(
|
||||
range_in_files=[RangeInFile.from_entire_file(
|
||||
self.filepath, file_contents)],
|
||||
prompt=self.prompt
|
||||
))
|
||||
|
||||
|
||||
class ManualEditStep(ReversibleStep):
|
||||
edit_diff: EditDiff
|
||||
hide: bool = True
|
||||
|
||||
hide: bool = True
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return "Manual edit step"
|
||||
# TODO - only handling FileEdit here, but need all other types of FileSystemEdits
|
||||
# Also requires the merge_file_edit function
|
||||
# return llm.complete(dedent(f"""This code was replaced:
|
||||
|
||||
# {self.edit_diff.backward.replacement}
|
||||
|
||||
# With this code:
|
||||
|
||||
# {self.edit_diff.forward.replacement}
|
||||
|
||||
# Maximally concise summary of changes in bullet points (can use markdown):
|
||||
# """))
|
||||
|
||||
@classmethod
|
||||
def from_sequence(cls, edits: List[FileEditWithFullContents]) -> "ManualEditStep":
|
||||
diffs = []
|
||||
for edit in edits:
|
||||
_, diff = FileSystem.apply_edit_to_str(
|
||||
edit.fileContents, edit.fileEdit)
|
||||
diffs.append(diff)
|
||||
return cls(edit_diff=EditDiff.from_sequence(diffs))
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
return None
|
||||
|
||||
async def reverse(self, sdk: ContinueSDK):
|
||||
await sdk.ide.applyFileSystemEdit(self.edit_diff.backward)
|
||||
|
||||
|
||||
class UserInputStep(Step):
|
||||
user_input: str
|
||||
name: str = "User Input"
|
||||
hide: bool = True
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return self.user_input
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[UserInputObservation, None, None]:
|
||||
return UserInputObservation(user_input=self.user_input)
|
||||
|
||||
|
||||
class WaitForUserInputStep(Step):
|
||||
prompt: str
|
||||
name: str = "Waiting for user input"
|
||||
|
||||
_description: Union[str, None] = None
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return self.prompt
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
self._description = self.prompt
|
||||
resp = await sdk.wait_for_user_input()
|
||||
return TextObservation(text=resp)
|
||||
|
||||
|
||||
class WaitForUserConfirmationStep(Step):
|
||||
prompt: str
|
||||
name: str = "Waiting for user confirmation"
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return self.prompt
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
self._description = self.prompt
|
||||
resp = await sdk.wait_for_user_input()
|
||||
return TextObservation(text=resp)
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
from ...core import ContinueSDK, Step
|
||||
from ....core.sdk import ContinueSDK
|
||||
from ....core.main import Step
|
||||
|
||||
|
||||
class ImplementAbstractMethodStep(Step):
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from textwrap import dedent
|
||||
from ....models.filesystem_edit import AddFile
|
||||
from ...core import Step, ContinueSDK
|
||||
from ....core.main import Step
|
||||
from ....core.sdk import ContinueSDK
|
||||
from ..main import WaitForUserInputStep
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
from textwrap import dedent
|
||||
from ....models.filesystem_edit import AddFile
|
||||
from ...core import Step, ContinueSDK
|
||||
from ..main import WaitForUserInputStep, EditFileStep
|
||||
from ....core.main import Step
|
||||
from ....core.sdk import ContinueSDK
|
||||
from ..core.core import EditFileStep
|
||||
|
||||
|
||||
class EditReduxStateStep(Step):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from textwrap import dedent
|
||||
from ...core import Step, ContinueSDK
|
||||
from ....core.main import Step
|
||||
from ....core.sdk import ContinueSDK
|
||||
|
||||
|
||||
class CreateTableStep(Step):
|
||||
|
|
|
|||
|
|
@ -1,18 +1,39 @@
|
|||
import time
|
||||
from typing import Callable, Coroutine, List, Union
|
||||
|
||||
from ..util.traceback_parsers import parse_python_traceback
|
||||
from ..llm import LLM
|
||||
from ...models.main import Traceback, Range
|
||||
from ...models.filesystem_edit import EditDiff, FileEdit
|
||||
from ...models.filesystem import RangeInFile, RangeInFileWithContents
|
||||
from ..observation import Observation, TextObservation
|
||||
from ...core.observation import Observation, TextObservation, TracebackObservation
|
||||
from ..llm.prompt_utils import MarkdownStyleEncoderDecoder
|
||||
from textwrap import dedent
|
||||
from ..core import History, Policy, Step, ContinueSDK, Observation
|
||||
from ...core.main import History, Policy, Step, ContinueSDK, Observation
|
||||
import subprocess
|
||||
from ..util.traceback_parsers import parse_python_traceback
|
||||
from ..observation import TracebackObservation
|
||||
import json
|
||||
from .core.core import EditCodeStep
|
||||
|
||||
|
||||
class RunCodeStep(Step):
|
||||
cmd: str
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return f"Ran command: `{self.cmd}`"
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
result = subprocess.run(
|
||||
self.cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdout = result.stdout.decode("utf-8")
|
||||
stderr = result.stderr.decode("utf-8")
|
||||
print(stdout, stderr)
|
||||
|
||||
# If it fails, return the error
|
||||
tb = parse_python_traceback(stdout) or parse_python_traceback(stderr)
|
||||
if tb:
|
||||
return TracebackObservation(traceback=tb)
|
||||
else:
|
||||
self.hide = True
|
||||
return None
|
||||
|
||||
|
||||
class RunPolicyUntilDoneStep(Step):
|
||||
|
|
@ -51,124 +72,6 @@ class RunCommandStep(Step):
|
|||
return TextObservation(text=stdout)
|
||||
|
||||
|
||||
class WaitForUserInputStep(Step):
|
||||
prompt: str
|
||||
name: str = "Waiting for user input"
|
||||
|
||||
_description: Union[str, None] = None
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return self.prompt
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
self._description = self.prompt
|
||||
resp = await sdk.wait_for_user_input()
|
||||
return TextObservation(text=resp)
|
||||
|
||||
|
||||
class WaitForUserConfirmationStep(Step):
|
||||
prompt: str
|
||||
name: str = "Waiting for user confirmation"
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return self.prompt
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
self._description = self.prompt
|
||||
resp = await sdk.wait_for_user_input()
|
||||
return TextObservation(text=resp)
|
||||
|
||||
|
||||
class RunCodeStep(Step):
|
||||
cmd: str
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return f"Ran command: `{self.cmd}`"
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
result = subprocess.run(
|
||||
self.cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdout = result.stdout.decode("utf-8")
|
||||
stderr = result.stderr.decode("utf-8")
|
||||
print(stdout, stderr)
|
||||
|
||||
# If it fails, return the error
|
||||
tb = parse_python_traceback(stdout) or parse_python_traceback(stderr)
|
||||
if tb:
|
||||
return TracebackObservation(traceback=tb)
|
||||
else:
|
||||
self.hide = True
|
||||
return None
|
||||
|
||||
|
||||
class EditCodeStep(Step):
|
||||
# Might make an even more specific atomic step, which is "apply file edit"
|
||||
range_in_files: List[RangeInFile]
|
||||
prompt: str # String with {code} somewhere
|
||||
name: str = "Edit code"
|
||||
|
||||
_edit_diffs: Union[List[EditDiff], None] = None
|
||||
_prompt: Union[str, None] = None
|
||||
_completion: Union[str, None] = None
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
if self._edit_diffs is None:
|
||||
return "Editing files: " + ", ".join(map(lambda rif: rif.filepath, self.range_in_files))
|
||||
elif len(self._edit_diffs) == 0:
|
||||
return "No edits made"
|
||||
else:
|
||||
return llm.complete(dedent(f"""{self._prompt}{self._completion}
|
||||
|
||||
Maximally concise summary of changes in bullet points (can use markdown):
|
||||
"""))
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
rif_with_contents = []
|
||||
for range_in_file in self.range_in_files:
|
||||
file_contents = await sdk.ide.readRangeInFile(range_in_file)
|
||||
rif_with_contents.append(
|
||||
RangeInFileWithContents.from_range_in_file(range_in_file, file_contents))
|
||||
enc_dec = MarkdownStyleEncoderDecoder(rif_with_contents)
|
||||
code_string = enc_dec.encode()
|
||||
prompt = self.prompt.format(code=code_string)
|
||||
|
||||
completion = sdk.llm.complete(prompt)
|
||||
|
||||
# Temporarily doing this to generate description.
|
||||
self._prompt = prompt
|
||||
self._completion = completion
|
||||
|
||||
file_edits = enc_dec.decode(completion)
|
||||
|
||||
self._edit_diffs = []
|
||||
for file_edit in file_edits:
|
||||
diff = await sdk.apply_filesystem_edit(file_edit)
|
||||
self._edit_diffs.append(diff)
|
||||
|
||||
for filepath in set([file_edit.filepath for file_edit in file_edits]):
|
||||
await sdk.ide.saveFile(filepath)
|
||||
await sdk.ide.setFileOpen(filepath)
|
||||
|
||||
return None
|
||||
|
||||
|
||||
class EditFileStep(Step):
|
||||
filepath: str
|
||||
prompt: str
|
||||
hide: bool = True
|
||||
|
||||
async def describe(self, llm: LLM) -> Coroutine[str, None, None]:
|
||||
return "Editing file: " + self.filepath
|
||||
|
||||
async def run(self, sdk: ContinueSDK) -> Coroutine[Observation, None, None]:
|
||||
file_contents = await sdk.ide.readFile(self.filepath)
|
||||
await sdk.run_step(EditCodeStep(
|
||||
range_in_files=[RangeInFile.from_entire_file(
|
||||
self.filepath, file_contents)],
|
||||
prompt=self.prompt
|
||||
))
|
||||
|
||||
|
||||
class FasterEditHighlightedCodeStep(Step):
|
||||
user_input: str
|
||||
hide = True
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
from ...models.filesystem import RangeInFile
|
||||
from .main import EditCodeStep, RunCommandStep
|
||||
from ..core import Step
|
||||
from ...core.main import Step
|
||||
|
||||
|
||||
class MigrationStep(Step):
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
import asyncio
|
||||
from textwrap import dedent
|
||||
import time
|
||||
from typing import Coroutine, Union
|
||||
|
||||
from ...models.main import Range
|
||||
from ...models.filesystem import RangeInFile
|
||||
from ...models.filesystem_edit import AddDirectory, AddFile
|
||||
from ..observation import Observation, TextObservation
|
||||
from ..core import Step, ContinueSDK
|
||||
from .main import EditCodeStep, EditFileStep, RunCommandStep, WaitForUserConfirmationStep
|
||||
from ...core.observation import Observation, TextObservation
|
||||
from ...core.main import Step, ContinueSDK
|
||||
from .main import RunCommandStep
|
||||
from .core.core import WaitForUserConfirmationStep, EditCodeStep, EditFileStep
|
||||
import os
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from textwrap import dedent
|
||||
from ...models.filesystem_edit import AddDirectory, AddFile
|
||||
from ..core import Step, ContinueSDK
|
||||
from ...core.main import Step, ContinueSDK
|
||||
import os
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@ import subprocess
|
|||
from ...models.main import Position, Range
|
||||
from ...models.filesystem import RangeInFile
|
||||
from ...models.filesystem_edit import AddDirectory, AddFile, FileEdit
|
||||
from ..observation import DictObservation
|
||||
from ..core import History, Step, ContinueSDK, Policy
|
||||
from .main import EditCodeStep, RunCommandStep, WaitForUserInputStep, WaitForUserConfirmationStep
|
||||
from ...core.observation import DictObservation
|
||||
from ...core.main import History, Step, Policy
|
||||
from ...core.sdk import ContinueSDK
|
||||
from .main import RunCommandStep
|
||||
from ..steps.core.core import EditCodeStep, WaitForUserConfirmationStep, WaitForUserInputStep
|
||||
|
||||
source_name = "weather_api"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from .main import *
|
||||
from .filesystem import RangeInFile, FileEdit
|
||||
from .filesystem_edit import FileEditWithFullContents
|
||||
from ..core.main import History, HistoryNode
|
||||
from pydantic import schema_json_of
|
||||
import os
|
||||
|
||||
|
|
@ -10,6 +11,8 @@ MODELS_TO_GENERATE = [
|
|||
RangeInFile, FileEdit
|
||||
] + [
|
||||
FileEditWithFullContents
|
||||
] + [
|
||||
History, HistoryNode
|
||||
]
|
||||
|
||||
RENAMES = {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ from pydantic import BaseModel, root_validator
|
|||
from functools import total_ordering
|
||||
|
||||
|
||||
class ContinueBaseModel(BaseModel):
|
||||
class Config:
|
||||
underscore_attrs_are_private = True
|
||||
|
||||
|
||||
@total_ordering
|
||||
class Position(BaseModel):
|
||||
line: int
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
from plugins import policy
|
||||
from ....libs.observation import Observation
|
||||
from ....libs.steps import Step
|
||||
from ....libs.core import History
|
||||
from ....core.main import History, Step
|
||||
|
||||
|
||||
class AlternatingPolicy:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
from typing import Coroutine
|
||||
import pluggy
|
||||
from ...libs.core import ContinueSDK, Step, Observation
|
||||
from ...core.main import Step
|
||||
from ...core.observation import Observation
|
||||
from ...core.sdk import ContinueSDK
|
||||
|
||||
hookspec = pluggy.HookspecMarker("continue.step")
|
||||
|
||||
|
|
|
|||
|
|
@ -5,21 +5,18 @@ from pydantic import BaseModel
|
|||
from uvicorn.main import Server
|
||||
|
||||
from ..models.filesystem_edit import FileEditWithFullContents
|
||||
from ..libs.policy import DemoPolicy
|
||||
from ..libs.core import Agent, FullState, History, Step
|
||||
from ..core.policy import DemoPolicy
|
||||
from ..core.main import FullState, History, Step
|
||||
from ..core.agent import Agent
|
||||
from ..libs.steps.nate import ImplementAbstractMethodStep
|
||||
from ..libs.observation import Observation
|
||||
from dotenv import load_dotenv
|
||||
from ..core.observation import Observation
|
||||
from ..libs.llm.openai import OpenAI
|
||||
from .ide_protocol import AbstractIdeProtocolServer
|
||||
import os
|
||||
from ..core.env import openai_api_key
|
||||
import asyncio
|
||||
import nest_asyncio
|
||||
nest_asyncio.apply()
|
||||
|
||||
load_dotenv()
|
||||
openai_api_key = os.getenv("OPENAI_API_KEY")
|
||||
|
||||
router = APIRouter(prefix="/notebook", tags=["notebook"])
|
||||
|
||||
# Graceful shutdown by closing websockets
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
.vscode/**
|
||||
.vscode-test/**
|
||||
build/**
|
||||
src/**
|
||||
.gitignore
|
||||
.yarnrc
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
/*******************************************************
|
||||
* Copyright (C) 2023 Continue <nate@continue.dev>
|
||||
*
|
||||
* All rights reserved.
|
||||
*******************************************************/
|
||||
Copyright 2023 Continue
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
|
@ -1,36 +1,17 @@
|
|||
# continue
|
||||
# Continue
|
||||
|
||||
Bug report to fix in 1/10th the time.
|
||||
Automate software development at the level of tasks, instead of tab-autocompletions. With Continue, you can make large edits with natural language, ask questions of your codebase, and run custom recipes built with our open-source Python library.
|
||||
|
||||
Our debugging assistant automatically handles tedious portions of the debugging process, such as:
|
||||
|
||||
- Fault localization
|
||||
- Enumerating potential error sources
|
||||
- Generating fixes
|
||||
- Pulling in outside context
|
||||
- Following data flows
|
||||
- Parsing tracebacks
|
||||
- Generate unit tests
|
||||
- Generate docstrings
|
||||
Get started by opening the command pallet with `cmd+shift+p` and then selecting `Continue: Open Debug Panel`.
|
||||
|
||||
# Features
|
||||
|
||||
### Ask a Question
|
||||
|
||||
`cmd+shift+j` to open up a universal search bar, where you can ask questions of your codebase in natural language.
|
||||
Ask natural language questions of your codebase, like "Where is the entry point to the VS Code extension?"
|
||||
|
||||
### Fault Localization
|
||||
### Edit with Natural Language
|
||||
|
||||
Either manually highlight code snippets you think are suspicious, or let us find them for you.
|
||||
Request an edit to the currently open file, for example: "Add CORS headers to this FastAPI server".
|
||||
|
||||
### Generate a Fix
|
||||
|
||||
Once Continue has code snippets to work with, it can generate a fix. Just click to accept or reject, or make the tweak you need.
|
||||
|
||||
### Stacktrace Parsing
|
||||
|
||||
Any stacktrace that appears in your VSCode terminal will be caught by us so we can immediately begin the debugging process. For small bugs that you might have quickly solved, we'll just speed up the process to be nearly instantaneous.
|
||||
|
||||
### Generate Unit Tests and Docstrings
|
||||
|
||||
Use `cmd+shift+i` to generate a unit test for the function surrounding your cursor position, and `cmd+shift+l` to generate a docstring.
|
||||
### Generate Unit Tests
|
||||
|
|
|
|||
BIN
extension/media/continue-gradient.png
Normal file
BIN
extension/media/continue-gradient.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
578
extension/package-lock.json
generated
578
extension/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"dependencies": {
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
"@reduxjs/toolkit": "^1.9.3",
|
||||
|
|
@ -30,6 +30,7 @@
|
|||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||
"@typescript-eslint/parser": "^5.45.0",
|
||||
"@vscode/test-electron": "^2.2.0",
|
||||
"esbuild": "^0.17.19",
|
||||
"eslint": "^8.28.0",
|
||||
"glob": "^8.0.3",
|
||||
"json-schema-to-typescript": "^12.0.0",
|
||||
|
|
@ -451,6 +452,358 @@
|
|||
"integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz",
|
||||
"integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz",
|
||||
"integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz",
|
||||
"integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz",
|
||||
"integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz",
|
||||
"integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz",
|
||||
"integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz",
|
||||
"integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz",
|
||||
"integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"sunos"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz",
|
||||
"integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/eslintrc": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz",
|
||||
|
|
@ -3217,6 +3570,43 @@
|
|||
"es6-symbol": "^3.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz",
|
||||
"integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"bin": {
|
||||
"esbuild": "bin/esbuild"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/android-arm": "0.17.19",
|
||||
"@esbuild/android-arm64": "0.17.19",
|
||||
"@esbuild/android-x64": "0.17.19",
|
||||
"@esbuild/darwin-arm64": "0.17.19",
|
||||
"@esbuild/darwin-x64": "0.17.19",
|
||||
"@esbuild/freebsd-arm64": "0.17.19",
|
||||
"@esbuild/freebsd-x64": "0.17.19",
|
||||
"@esbuild/linux-arm": "0.17.19",
|
||||
"@esbuild/linux-arm64": "0.17.19",
|
||||
"@esbuild/linux-ia32": "0.17.19",
|
||||
"@esbuild/linux-loong64": "0.17.19",
|
||||
"@esbuild/linux-mips64el": "0.17.19",
|
||||
"@esbuild/linux-ppc64": "0.17.19",
|
||||
"@esbuild/linux-riscv64": "0.17.19",
|
||||
"@esbuild/linux-s390x": "0.17.19",
|
||||
"@esbuild/linux-x64": "0.17.19",
|
||||
"@esbuild/netbsd-x64": "0.17.19",
|
||||
"@esbuild/openbsd-x64": "0.17.19",
|
||||
"@esbuild/sunos-x64": "0.17.19",
|
||||
"@esbuild/win32-arm64": "0.17.19",
|
||||
"@esbuild/win32-ia32": "0.17.19",
|
||||
"@esbuild/win32-x64": "0.17.19"
|
||||
}
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
|
||||
|
|
@ -7734,6 +8124,160 @@
|
|||
"integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==",
|
||||
"peer": true
|
||||
},
|
||||
"@esbuild/android-arm": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz",
|
||||
"integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/android-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/android-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/darwin-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/darwin-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/freebsd-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/freebsd-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/linux-arm": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz",
|
||||
"integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/linux-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/linux-ia32": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz",
|
||||
"integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/linux-loong64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz",
|
||||
"integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/linux-mips64el": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz",
|
||||
"integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/linux-ppc64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz",
|
||||
"integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/linux-riscv64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz",
|
||||
"integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/linux-s390x": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz",
|
||||
"integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/linux-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/netbsd-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/openbsd-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/sunos-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/win32-arm64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz",
|
||||
"integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/win32-ia32": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz",
|
||||
"integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@esbuild/win32-x64": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz",
|
||||
"integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"@eslint/eslintrc": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz",
|
||||
|
|
@ -9817,6 +10361,36 @@
|
|||
"es6-symbol": "^3.1.1"
|
||||
}
|
||||
},
|
||||
"esbuild": {
|
||||
"version": "0.17.19",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz",
|
||||
"integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@esbuild/android-arm": "0.17.19",
|
||||
"@esbuild/android-arm64": "0.17.19",
|
||||
"@esbuild/android-x64": "0.17.19",
|
||||
"@esbuild/darwin-arm64": "0.17.19",
|
||||
"@esbuild/darwin-x64": "0.17.19",
|
||||
"@esbuild/freebsd-arm64": "0.17.19",
|
||||
"@esbuild/freebsd-x64": "0.17.19",
|
||||
"@esbuild/linux-arm": "0.17.19",
|
||||
"@esbuild/linux-arm64": "0.17.19",
|
||||
"@esbuild/linux-ia32": "0.17.19",
|
||||
"@esbuild/linux-loong64": "0.17.19",
|
||||
"@esbuild/linux-mips64el": "0.17.19",
|
||||
"@esbuild/linux-ppc64": "0.17.19",
|
||||
"@esbuild/linux-riscv64": "0.17.19",
|
||||
"@esbuild/linux-s390x": "0.17.19",
|
||||
"@esbuild/linux-x64": "0.17.19",
|
||||
"@esbuild/netbsd-x64": "0.17.19",
|
||||
"@esbuild/openbsd-x64": "0.17.19",
|
||||
"@esbuild/sunos-x64": "0.17.19",
|
||||
"@esbuild/win32-arm64": "0.17.19",
|
||||
"@esbuild/win32-ia32": "0.17.19",
|
||||
"@esbuild/win32-x64": "0.17.19"
|
||||
}
|
||||
},
|
||||
"escalade": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
|
||||
|
|
|
|||
|
|
@ -1,12 +1,20 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"icon": "media/continue-gradient.png",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": ""
|
||||
"url": "https://github.com/continuedev/continue"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/continuedev/continue/issues",
|
||||
"email": "nate@continue.dev"
|
||||
},
|
||||
"homepage": "https://continue.dev",
|
||||
"license": "Apache-2.0",
|
||||
"displayName": "Continue",
|
||||
"description": "Reduce debugging time by 10x",
|
||||
"version": "0.0.1",
|
||||
"pricing": "Free",
|
||||
"description": "Refine code 10x faster",
|
||||
"version": "0.0.2",
|
||||
"publisher": "Continue",
|
||||
"engines": {
|
||||
"vscode": "^1.74.0"
|
||||
|
|
@ -107,21 +115,6 @@
|
|||
}
|
||||
],
|
||||
"keybindings": [
|
||||
{
|
||||
"command": "continue.writeDocstring",
|
||||
"key": "ctrl+alt+l",
|
||||
"mac": "shift+cmd+l"
|
||||
},
|
||||
{
|
||||
"command": "continue.writeUnitTest",
|
||||
"key": "ctrl+alt+i",
|
||||
"mac": "shift+cmd+i"
|
||||
},
|
||||
{
|
||||
"command": "continue.askQuestionFromInput",
|
||||
"key": "ctrl+alt+j",
|
||||
"mac": "shift+cmd+j"
|
||||
},
|
||||
{
|
||||
"command": "continue.suggestionDown",
|
||||
"mac": "shift+ctrl+down",
|
||||
|
|
@ -154,9 +147,13 @@
|
|||
}
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run esbuild-base -- --minify",
|
||||
"esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node",
|
||||
"esbuild": "npm run esbuild-base -- --sourcemap",
|
||||
"esbuild-watch": "npm run esbuild-base -- --sourcemap --watch",
|
||||
"test-compile": "tsc -p ./",
|
||||
"clientgen": "rm -rf src/client/ && npx @openapitools/openapi-generator-cli generate -i ../schema/openapi.json -g typescript-fetch -o src/client/ --additional-properties=supportsES6=true,npmVersion=8.19.2,typescriptThreePlus=true",
|
||||
"typegen": "node scripts/typegen.js",
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"rebuild": "electron-rebuild -v 19.1.8 node-pty",
|
||||
"compile": "tsc -p ./",
|
||||
"watch": "tsc -watch -p ./",
|
||||
|
|
@ -166,7 +163,7 @@
|
|||
"package": "cp ./config/prod_config.json ./config/config.json && npm run compile && mkdir -p ./build && vsce package --out ./build && chmod 777 ./build/continue-0.0.1.vsix && cp ./config/dev_config.json ./config/config.json",
|
||||
"full-package": "cd ../continuedev && poetry build && cp ./dist/continuedev-0.1.0-py3-none-any.whl ../extension/scripts/continuedev-0.1.0-py3-none-any.whl && cd ../extension && npm run typegen && npm run clientgen && cd react-app && npm run build && cd .. && npm run package",
|
||||
"install-extension": "code --install-extension ./build/continue-0.0.1.vsix",
|
||||
"uninstall": "code --uninstall-extension Continue.continue",
|
||||
"uninstall": "code --uninstall-extension .continue",
|
||||
"reinstall": "rm -rf ./build && npm run package && npm run uninstall && npm run install-extension"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
@ -179,6 +176,7 @@
|
|||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||
"@typescript-eslint/parser": "^5.45.0",
|
||||
"@vscode/test-electron": "^2.2.0",
|
||||
"esbuild": "^0.17.19",
|
||||
"eslint": "^8.28.0",
|
||||
"glob": "^8.0.3",
|
||||
"json-schema-to-typescript": "^12.0.0",
|
||||
|
|
|
|||
41
extension/schema/History.d.ts
vendored
Normal file
41
extension/schema/History.d.ts
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/* eslint-disable */
|
||||
/**
|
||||
* This file was automatically generated by json-schema-to-typescript.
|
||||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
||||
* and run json-schema-to-typescript to regenerate this file.
|
||||
*/
|
||||
|
||||
export type History = History1;
|
||||
export type Name = string;
|
||||
export type Hide = boolean;
|
||||
export type SystemMessage = string;
|
||||
export type Depth = number;
|
||||
export type Timeline = HistoryNode[];
|
||||
export type CurrentIndex = number;
|
||||
|
||||
/**
|
||||
* A history of steps taken and their results
|
||||
*/
|
||||
export interface History1 {
|
||||
timeline: Timeline;
|
||||
current_index: CurrentIndex;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* A point in history, a list of which make up History
|
||||
*/
|
||||
export interface HistoryNode {
|
||||
step: Step;
|
||||
observation?: Observation;
|
||||
depth: Depth;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Step {
|
||||
name?: Name;
|
||||
hide?: Hide;
|
||||
system_message?: SystemMessage;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Observation {
|
||||
[k: string]: unknown;
|
||||
}
|
||||
31
extension/schema/HistoryNode.d.ts
vendored
Normal file
31
extension/schema/HistoryNode.d.ts
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/* eslint-disable */
|
||||
/**
|
||||
* This file was automatically generated by json-schema-to-typescript.
|
||||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
||||
* and run json-schema-to-typescript to regenerate this file.
|
||||
*/
|
||||
|
||||
export type HistoryNode = HistoryNode1;
|
||||
export type Name = string;
|
||||
export type Hide = boolean;
|
||||
export type SystemMessage = string;
|
||||
export type Depth = number;
|
||||
|
||||
/**
|
||||
* A point in history, a list of which make up History
|
||||
*/
|
||||
export interface HistoryNode1 {
|
||||
step: Step;
|
||||
observation?: Observation;
|
||||
depth: Depth;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Step {
|
||||
name?: Name;
|
||||
hide?: Hide;
|
||||
system_message?: SystemMessage;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Observation {
|
||||
[k: string]: unknown;
|
||||
}
|
||||
Binary file not shown.
73
schema/json/History.json
Normal file
73
schema/json/History.json
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
{
|
||||
"title": "History",
|
||||
"$ref": "#/definitions/continuedev__src__continuedev__core__main__History",
|
||||
"definitions": {
|
||||
"Step": {
|
||||
"title": "Step",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"title": "Name",
|
||||
"type": "string"
|
||||
},
|
||||
"hide": {
|
||||
"title": "Hide",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"system_message": {
|
||||
"title": "System Message",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Observation": {
|
||||
"title": "Observation",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"step",
|
||||
"depth"
|
||||
]
|
||||
},
|
||||
"continuedev__src__continuedev__core__main__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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
51
schema/json/HistoryNode.json
Normal file
51
schema/json/HistoryNode.json
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"title": "HistoryNode",
|
||||
"$ref": "#/definitions/continuedev__src__continuedev__core__main__HistoryNode",
|
||||
"definitions": {
|
||||
"Step": {
|
||||
"title": "Step",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"title": "Name",
|
||||
"type": "string"
|
||||
},
|
||||
"hide": {
|
||||
"title": "Hide",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"system_message": {
|
||||
"title": "System Message",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Observation": {
|
||||
"title": "Observation",
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
},
|
||||
"continuedev__src__continuedev__core__main__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"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"step",
|
||||
"depth"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
1027
schema/openapi.json
Normal file
1027
schema/openapi.json
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue