diff options
Diffstat (limited to 'server/continuedev/plugins/steps/draft/redux.py')
-rw-r--r-- | server/continuedev/plugins/steps/draft/redux.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/server/continuedev/plugins/steps/draft/redux.py b/server/continuedev/plugins/steps/draft/redux.py new file mode 100644 index 00000000..83b5e592 --- /dev/null +++ b/server/continuedev/plugins/steps/draft/redux.py @@ -0,0 +1,50 @@ +from ....core.main import Step +from ....core.sdk import ContinueSDK +from ....core.steps import EditFileStep + + +class EditReduxStateStep(Step): + description: str # e.g. "I want to load data from the weatherapi.com API" + + async def run(self, sdk: ContinueSDK): + # Find the right file to edit + + # RootStore + store_filename = "" + sdk.run_step( + EditFileStep( + filename=store_filename, + prompt=f"Edit the root store to add a new slice for {self.description}", + ) + ) + store_file_contents = await sdk.ide.readFile(store_filename) + + # Selector + selector_filename = "" + sdk.run_step( + EditFileStep( + filepath=selector_filename, + prompt=f"Edit the selector to add a new property for {self.description}. The store looks like this: {store_file_contents}", + ) + ) + + # Reducer + reducer_filename = "" + sdk.run_step( + EditFileStep( + filepath=reducer_filename, + prompt=f"Edit the reducer to add a new property for {self.description}. The store looks like this: {store_file_contents}", + ) + ) + """ + Starts with implementing selector + 1. RootStore + 2. Selector + 3. Reducer or entire slice + + Need to first determine whether this is an: + 1. edit + 2. add new reducer and property in existing slice + 3. add whole new slice + 4. build redux from scratch + """ |