Skip to content

Commit 5b5fcfa

Browse files
committed
refactor(shell): simplify scratch file creation and update plugin version
- Remove `ScratchFileService.Option.existing_only` from `createScratchFile` call in `ShellInsCommand.kt`. - Update plugin version to `2.0.0-alpha.7` in `gradle.properties`. - Adjust Chinese and English templates for application startup and context gathering in `sketch.vm` files.
1 parent 955716d commit 5b5fcfa

File tree

4 files changed

+9
-19
lines changed

4 files changed

+9
-19
lines changed

core/src/main/resources/genius/en/code/sketch.vm

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ You are helping the USER create a python-based photo storage app. You
5050
have created a routes.py and main.js file, and updated the main.html file.
5151
</user.question>
5252
<you.answer.step1>
53+
// First think step-by-step - describe your plan for what to build in pseudocode, written out in great detail.
5354
// In this step 1, you should analysis the context information is enough or not, if not, you should call DevIn tool
5455
// to get the context information.
5556
// For example:
56-
To help you create a Python-based photo storage application, I need to know more about your codebase. I will generate
57-
tool call code for you to get the necessary context information, please execute it to get the context information.
57+
为了帮助您创建基于 Python 的照片存储应用程序,我需要了解更多关于您的代码库的信息。请允许我调用工具来获取上下文信息。请执行以下 DevIn 代码:
5858
<devin>
5959
/dir:src
6060
/localSearch:.*photo.*
@@ -104,10 +104,9 @@ By creating `routes.py` and `main.js`, I have made our photo application interac
104104
```http
105105
// the http code
106106
```
107-
108-
// step 5, 请用 bash 命令来启动应用程序
107+
// step 5, 启动应用程序
109108
```bash
110-
/shell:start.sh
109+
./gradlew :bootRun
111110
```
112111
// 给出对应的变更信息
113112
<devin>
@@ -124,7 +123,7 @@ feat: add delete blog functionality
124123
优化 SketchRunContext 代码结构
125124
</user.question>
126125
<you.answer.step1>
127-
// 优化 SketchRunContext 代码结构需要根据具体的代码库进行分析,请直接调用工具获取代码库的上下文信息
126+
为了帮助优化 SketchRunContext 代码结构需要根据具体的代码库进行分析,请帮助我调用工具获取代码库的上下文信息,以便于更好地理解代码结构。
128127
<devin> // 请尽可能只用一个 DevIn 代码块来获取上下文信息
129128
/dir:src/main/java
130129
/file:SketchRunContext.java // 使用绝对路径时,一定要从用户那里得到正确的路径
@@ -191,4 +190,4 @@ accordingly and make informed decisions about how to proceed with the task. This
191190
the overall success and accuracy of your work.
192191
</thinking>
193192

194-
Please ensure you have enough context information before you start coding. If the context information is insufficient, please let me know, and I will provide it to you.
193+
请在确保拥有足够的上下文信息后,再开始编码。如果上下文信息不足,请告知我,我将提供给你。

core/src/main/resources/genius/zh/code/sketch.vm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,10 @@ have created a routes.py and main.js file, and updated the main.html file.
107107
```http
108108
// the http code
109109
```
110-
// step 5, 请用 devin 或者纯 bash 命令来启动应用程序
111-
<devin>
112-
/shell:execute
110+
// step 5, 启动应用程序
113111
```bash
114112
./gradlew :bootRun
115113
```
116-
</devin>
117114
// 给出对应的变更信息
118115
<devin>
119116
/commit

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/ShellInsCommand.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,7 @@ class ShellInsCommand(val myProject: Project, private val shellFile: String?, va
4040
override suspend fun execute(): String? {
4141
val virtualFile = if (shellContent != null) {
4242
ScratchRootType.getInstance()
43-
.createScratchFile(
44-
myProject,
45-
"devin-shell-ins.sh",
46-
ShLanguage.INSTANCE,
47-
shellContent,
48-
ScratchFileService.Option.existing_only
49-
)
43+
.createScratchFile(myProject, "devin-shell-ins.sh", ShLanguage.INSTANCE, shellContent)
5044
?: return "$DEVINS_ERROR: Failed to create scratch file for ShellInsCommand"
5145
} else if (shellFile != null) {
5246
myProject.lookupFile(shellFile.trim()) ?: return "$DEVINS_ERROR: File not found: $shellFile"

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pluginGroup = com.phodal.autodev
77
pluginName = AutoDev
88
pluginRepositoryUrl = https://github.com/unit-mesh/auto-dev
99
# SemVer format -> https://semver.org
10-
pluginVersion = 2.0.0-alpha.6
10+
pluginVersion = 2.0.0-alpha.7
1111

1212
# Supported IDEs: idea, pycharm
1313
baseIDE=idea

0 commit comments

Comments
 (0)