Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build-In Workflow DSL for AutoDev #81

Closed
phodal opened this issue Jan 22, 2024 · 0 comments
Closed

Build-In Workflow DSL for AutoDev #81

phodal opened this issue Jan 22, 2024 · 0 comments

Comments

@phodal
Copy link
Member

phodal commented Jan 22, 2024

Dataflow design

  1. Function bootstrap
  2. IO Handing
  3. Transform
  4. Process Calling
  5. output transform
phodal added a commit that referenced this issue Jan 24, 2024
- Added a new file `TaskFlow.kt` in the `cc.unitmesh.devti.flow` package.
- The `TaskFlow` interface defines three methods: `clarify()`, `design(context: Any)`, and `execute()`.
- Modified the `GenSqlFlow.kt` file to implement the `TaskFlow` interface.
- Updated the `clarify()` method to override the interface method.
- Updated the `design(context: Any)` method to override the interface method and added a type cast for the `context` parameter.
- The changes allow `GenSqlFlow` to implement the `TaskFlow` interface and provide the required functionality.
phodal added a commit that referenced this issue Jan 24, 2024
The `GenSqlFlow.kt` file had unnecessary usages of `LLMCoroutineScope.scope(project).runCatching` to add messages and handle errors. These usages were replaced with direct calls to `ui.addMessage` and the error handling was removed. This simplifies the code and removes unnecessary coroutine scope usage.

modify file exts/database/src/main/kotlin/cc/unitmesh/database/flow/GenSqlFlow.kt
 import cc.unitmesh.devti.gui.chat.ChatCodingPanel
 import cc.unitmesh.devti.llms.LLMProvider
 import cc.unitmesh.devti.template.TemplateRender
-import cc.unitmesh.devti.util.LLMCoroutineScope
+import com.intellij.openapi.application.ApplicationManager
 import com.intellij.openapi.diagnostic.logger
 import com.intellij.openapi.project.Project
 import kotlinx.coroutines.runBlocking
     override fun clarify(): String {
         val stepOnePrompt = generateStepOnePrompt(genSqlContext, actions)
-        LLMCoroutineScope.scope(project).runCatching {
-            ui.addMessage(stepOnePrompt, true, stepOnePrompt)
-            ui.addMessage(AutoDevBundle.message("autodev.loading"))
-        }.onFailure {
-            logger.warn("Error: $it")
-        }
+        ui.addMessage(stepOnePrompt, true, stepOnePrompt)
+        ui.addMessage(AutoDevBundle.message("autodev.loading"))
         return runBlocking {
             val prompt = llm.stream(stepOnePrompt, "")
         val tableNames = context as List<String>
         val stepTwoPrompt = generateStepTwoPrompt(genSqlContext, actions, tableNames)
-        LLMCoroutineScope.scope(project).runCatching {
-            ui.addMessage(stepTwoPrompt, true, stepTwoPrompt)
-
phodal added a commit that referenced this issue Jan 24, 2024
The TaskFlow interface in `TaskFlow.kt` has been updated to include documentation and comments for each method. This will improve code readability and provide better understanding of the purpose and functionality of each method. The `clarify()` method now returns a string representing the documentation for the class. The `design()` method now takes a context parameter and returns a string specifying the format for designing the task flow. The `execute()` method now includes a comment explaining its purpose and the expected result of the execution.
phodal added a commit that referenced this issue Jan 24, 2024
#81

- The `TaskFlow` interface has been modified to include a generic type parameter `Tasking`.
- The `design` method in the `TaskFlow` interface now returns a list of `Tasking` objects instead of a string.
- The `GenSqlFlow` class has been updated to implement the modified `TaskFlow` interface with `String` as the generic type parameter.
- The `clarify` and `design` methods in the `GenSqlFlow` class now return a list of strings instead of a single string.
- The `GenSqlTask` class has been modified to handle the updated `design` method in the `GenSqlFlow` class.
phodal added a commit that referenced this issue Jan 24, 2024
This commit removes unused code from the `AutoDevRunProfileState` class in the `AutoDevRunProfileState.kt` file. The `environment` and `configuration` parameters are no longer needed, so they have been removed from the constructor. The `getState` method has been updated to reflect this change.
phodal added a commit that referenced this issue Jan 24, 2024
This commit adds a new parameter `context` to the `execute` method in the `TaskFlow` class. This allows for passing additional information to the method, which can be used during the execution of the flow.
phodal added a commit that referenced this issue Jan 24, 2024
- Added `FrontendFlow` interface to handle the flow of frontend tasks in JavaScript projects.
- Added methods to `FrontendFlow` interface to get routes, components, design system components, sample remote call, and sample state management.
- Added `DsComponent` data class to represent design system components in JavaScript projects.
phodal added a commit that referenced this issue Jan 24, 2024
Add usecases.md and workflow.md files to the docs folder. The usecases.md file contains information about the use cases of the application, while the workflow.md file explains the workflow design rules. The workflow.md file also includes a dataflow design with four steps: functional bootstrap, request transform/data validation, process IPC/RPC calling, and output transform/render. This documentation will provide a better understanding of the application's functionality and workflow.
phodal added a commit that referenced this issue Jan 24, 2024
- Add new section "AutoDev for CRUD (Java)" to auto-crud.md
- Add new section "GenSqlFlow" to gen-sql-flow.md
- Add new section "Common frontend flow" to frontend-flow.md
- Add new functions to FrontendFlow.kt:
  - getPages(): List<DsComponent>
  - getRoutes(): List<String>

These changes enhance the workflow documentation by providing additional information and functionality for CRUD operations in Java, generating SQL scripts, and common frontend development practices.
phodal added a commit that referenced this issue Jan 25, 2024
phodal added a commit that referenced this issue Jan 25, 2024
…rtualFile #81

This commit modifies the ReactFlow.kt file in the javascript module. It replaces the usage of VirtualFile with JSFile for the pages and components lists. Additionally, it adds a new list called configs, which also uses JSFile. The changes were made to improve type safety and code readability.
phodal added a commit that referenced this issue Jan 25, 2024
- Add new file `Sample.tsx` in `javascript/src/test/resources/ts` directory.
- Modify file `JSPsiUtil.kt` in `javascript/src/main/kotlin/cc/unitmesh/ide/javascript/util` directory.
- Modify file `DsComponent.kt` in `javascript/src/main/kotlin/cc/unitmesh/ide/javascript/flow` directory.
- Modify file `ReactAutoPage.kt` in `javascript/src/main/kotlin/cc/unitmesh/ide/javascript/flow` directory.

The changes include adding a new class `MyDocument` in `Sample.tsx`, importing `PsiNameIdentifierOwner` in `JSPsiUtil.kt`, modifying the properties of `DsComponent` data class in `DsComponent.kt`, and adding new logic to extract export elements in `ReactAutoPage.kt`.
phodal added a commit that referenced this issue Jan 25, 2024
- Refactored the `getPages()` method in `ReactAutoPage.tsx` to use a more concise and functional approach.
- Created a new companion object `tsxComponentToComponent()` to handle the conversion of TypeScript components to `DsComponent` objects.
- Removed unnecessary imports and unused code.
- Improved code readability and maintainability.
phodal added a commit that referenced this issue Jan 25, 2024
This commit adds the `ReactUtil` object, which contains functions for extracting React components from JavaScript files. It also includes the corresponding unit test `ReactUtilTest` to ensure the functionality of the `ReactUtil` methods.
phodal added a commit that referenced this issue Jan 25, 2024
Rename the file `ReactUtil.kt` to `ReactPsiUtil.kt` and update all references accordingly. This change was made to provide a more accurate and descriptive name for the utility class that handles React-related operations in JavaScript files. The functionality of the class remains the same. Additionally, the corresponding test file `ReactUtilTest.kt` was also renamed to `ReactPsiUtilTest.kt` to maintain consistency.
phodal added a commit that referenced this issue Jan 25, 2024
- Added the ability to extract function signature and props from TypeScript function expressions and JS functions.
- Updated the `DsComponent` data class to include the new fields `signature` and `props`.
- Modified the `ReactPsiUtilTest` to include assertions for the extracted function signature and props.
phodal added a commit that referenced this issue Jan 25, 2024
… of JSFile #81

- Modify the `ReactAutoPage` class in `ReactAutoPage.kt` to use `DsComponent` instead of `JSFile` for the `pages`, `components`, and `configs` properties.
- Update the `getPages()` and `getComponents()` methods to return a list of `DsComponent` objects instead of `JSFile` objects.
- Add a new private method `buildComponent()` to convert `JSFile` to `DsComponent` based on the language dialect.
- Update the logic in the `virtualFiles.forEach` loop to use the `buildComponent()` method and add the converted components to the respective lists.
- Remove the unused `getRoutes()` method.
- Print the `pages` list for debugging purposes.
phodal added a commit that referenced this issue Jan 25, 2024
Add GenComponentAction and GenComponentFlow classes to handle generating components in JavaScript files. The GenComponentAction class is responsible for initiating the generation process when a specific text is selected in the editor. The GenComponentFlow class handles the flow of generating the component and interacts with the user through a chat coding panel.
phodal added a commit that referenced this issue Jan 25, 2024
This commit renames the file `GenComponentAction.kt` to `GenPageAction.kt` in the `javascript/src/main/kotlin/cc/unitmesh/ide/javascript/actions` directory. The class `GenComponentAction` is renamed to `GenPageAction` as well. This change was made to better reflect the functionality of the class.

The `GenComponentTask` class is also updated to include an additional parameter `autoPage` of type `ReactAutoPage`. This parameter is used in the `run` method of the class.

A new file `src/main/resources/genius/page/page-gen-design.vm` is added. This file contains a template for generating a page design based on user requirements and component information.

The `AutoPageContext` data class is added, which contains properties related to the auto page generation context. The `build` method is added to the companion object of `AutoPageContext` to create an instance of `AutoPageContext` based on a `ReactAutoPage` object.

The `GenComponentFlow` class is updated to use the `AutoPageContext` object as its context. The `clarify` method is updated to generate a step one prompt based on the context. The `design` method is updated to generate a step two prompt based on the page names passed as context.

The `DsComponent` class is updated to include a `format` method that returns a formatted string representation of the component.

The `AutoDevBundle.properties` file is modified to include a new key `frontend.page.generate.clarify` with the value "
phodal added a commit that referenced this issue Jan 26, 2024
Add logger statements to handle null values in ReactPsiUtil and ReactAutoPage files. This will help in identifying and debugging issues related to null values.
phodal added a commit that referenced this issue Jan 26, 2024
- Modify ReactPsiUtil.kt to resolve export aliases and find original elements.
- Modify GenPageAction.kt to use DsComponent instead of String for selectedComponents.
phodal added a commit that referenced this issue Jan 26, 2024
- Import additional classes from `com.intellij.lang.javascript.psi` package.
- Update the logic for retrieving the project path.
- Modify the path extraction logic to remove project path prefix, replace backslashes with forward slashes, and remove leading slash.
- Refactor the code for handling `TypeScriptVariable` and `JSVariable` cases.
phodal added a commit that referenced this issue Jan 26, 2024
Rename the file `GenPageAction.kt` to `AutoPageAction.kt` in the `javascript/src/main/kotlin/cc/unitmesh/ide/javascript/actions/` directory. Also, update the class name from `GenPageAction` to `AutoPageAction`. The corresponding text and family name properties are also updated in the `AutoPageAction` class. Additionally, modify the `AutoDevBundle.properties` file to update the frontend generate and autopage generate messages. Finally, update the `cc.unitmesh.javascript.xml` file to reflect the new class name in the extension configuration.
phodal added a commit that referenced this issue Jan 26, 2024
Add the `AutoPageFlow` and `AutoPageTask` classes to handle the generation of pages in the JavaScript code. These classes are responsible for clarifying the requirements and designing the pages based on the selected components. The `AutoPageFlow` class generates prompts for the user to clarify the requirements and design the pages, while the `AutoPageTask` class runs the flow in the background and updates the progress indicator.
phodal added a commit that referenced this issue Jan 26, 2024
- Renamed `GenSqlAction` to `AutoSqlAction`
- Renamed `GenSqlFlow` to `AutoSqlFlow`
- Renamed `GenSqlTask` to `AutoSqlTask`
- Renamed `GenSqlContext` to `AutoSqlContext`

This commit refactors the names of classes related to SQL generation in the database module. The prefix "Gen" has been replaced with "Auto" to better reflect the functionality of the classes. This change improves code clarity and consistency.
phodal added a commit that referenced this issue Jan 26, 2024
- Update progress indicator messages in AutoCrudAction.kt and AutoDevRunProfileState.kt to use the "autocrud" prefix instead of "devti".
- Update the corresponding message keys in AutoDevBundle.properties to use the "autocrud" prefix instead of "devti".
phodal added a commit that referenced this issue Jan 26, 2024
- Update progress indicator messages in AutoCrudAction.kt and AutoDevRunProfileState.kt to use the "autocrud" prefix instead of "devti".
- Update the corresponding message keys in AutoDevBundle.properties to use the "autocrud" prefix instead of "devti".
phodal added a commit that referenced this issue Jan 26, 2024
- AutoCRUD mode (Java/Kotlin Language only).With DevTi Protocol (like `devti://story/github/1102`) will auto generate Model-Controller-Service-Repository code.
- AutoSQL. Context-aware SQL generation.
- AutoPage. Context-aware Page generation.
- AutoTesting. create unit test intention, auto run unit test and try to fix test.
- Auto Document. Auto generate document.
phodal added a commit that referenced this issue Jan 26, 2024
…napshot #81

This commit adds a new method called `mostPopularFrameworks` to the `JsDependenciesSnapshot` class in the JavaScript codebase. This method filters the `packages` map to include only the most popular packages and excludes any packages starting with "@type". It then maps each entry to a string representation of the package and its version, if available. The resulting list of dependencies is returned. This method is used in the `getMostPopularPackagesContext` function in the `JavaScriptContextProvider` class to retrieve the most popular packages for the chat context.
phodal added a commit that referenced this issue Jan 26, 2024
This commit adds a new method called `language` to the `JsDependenciesSnapshot` class in the JavaScript codebase. The `language` method determines the language and version of the project by checking the presence of a `typescript` dependency in the `package.json` file. If `typescript` is found, the language is set to "TypeScript" and the version is extracted from the dependency. Otherwise, the language is set to "JavaScript" and the version is set to "ES5". This method provides information about the language used in the project.
phodal added a commit that referenced this issue Jan 26, 2024
…#81

Add language and frameworks parameters to the `AutoPageContext.build` function in the `AutoPageContext.kt` file. This allows the function to accept the language and frameworks information from the `JsDependenciesSnapshot` in the `AutoPageAction.kt` file. The language and frameworks are then passed to the `AutoPageContext` object, which is used in the `AutoPageFlow` and `AutoPageTask` classes. This change enables the professional Frontend developer to choose the best components for the user based on the selected language and frameworks.
@phodal phodal closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant