Skip to content

Commit 1399b02

Browse files
committed
feat(sketch): add SketchRunContext and SketchToolchain #257
Introduce `SketchRunContext` data class to encapsulate context for sketch execution, including file, workspace, and user input details. Add `SketchToolchain` enum to define available tools for sketch operations.
1 parent 57c0c78 commit 1399b02

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package cc.unitmesh.devti.sketch.run
2+
3+
import com.intellij.openapi.vfs.VirtualFile
4+
5+
data class SketchRunContext(
6+
// Current File
7+
@JvmField val file: VirtualFile,
8+
/// related files
9+
@JvmField val userSelectFile: List<VirtualFile>,
10+
/// ast related files
11+
@JvmField val astRelatedFiles: List<VirtualFile>,
12+
// The absolute path of the USER's workspace
13+
@JvmField val workspace: String,
14+
// The USER's OS
15+
@JvmField val os: String,
16+
// The current time in YYYY-MM-DD HH:MM:SS format
17+
@JvmField val time: String,
18+
/// The USER's requirements
19+
@JvmField val input: String,
20+
) {
21+
22+
}
23+
24+
/**
25+
* todo use [cc.unitmesh.devti.language.compiler.exec.InsCommand] to run the sketch
26+
*/
27+
enum class SketchToolchain(val toolName: String, val description: String) {
28+
RELATED_CODE("RelatedCode", "Find related code snippets across your codebase"),
29+
30+
/// similar code search
31+
SIMILAR_CODE("SimilarCode", "Find similar code snippets based on semantic search"),
32+
33+
/// text search
34+
GREP_SEARCH("GrepSearch", "Search for a specified pattern within files"),
35+
36+
/// `Find`
37+
FIND("Find", "Search for files and directories using glob patterns"),
38+
39+
/// TREE DIR
40+
TREE_DIR("TreeDir", "List files and directories in a tree-like structure"),
41+
42+
/// VIEW FILE
43+
VIEW_FILE("ViewFile", "View the contents of a file"),
44+
45+
/// VIEW SYMBOL
46+
VIEW_SYMBOL("ViewSymbol", "View file by symbol, like package, class, function, etc."),
47+
48+
/// WRITE TO FILE
49+
WRITE_FILE("WriteFile", "Write to a file"),
50+
51+
/// RUN COMMAND
52+
RUN_COMMAND("RunCommand", "Run a command in the terminal"),
53+
}

0 commit comments

Comments
 (0)