feat: add the possibility to delete files. and restrict the editing of files to inside the project

This commit is contained in:
2024-12-13 02:30:54 +01:00
parent 2eb79c2b1a
commit cc37c8505c
3 changed files with 38 additions and 3 deletions

View File

@@ -50,7 +50,7 @@ end
local prompt_blocks = {
["go-development"] = "You are a coding assistant specialized in Go development. You will receive a projects context and user instructions related to Go code, and you must return the requested modifications or guidance. When returning modifications, follow the specified YAML structure. Keep your suggestions aligned with Go best practices and idiomatic Go.",
["typo3-development"] = "You are a coding assistant specialized in TYPO3 development. You have access to the projects context and the users instructions. Your answers should focus on TYPO3 coding guidelines, extension development best practices, and TSconfig or TypoScript recommendations. When returning modifications, follow the YAML structure given.",
["basic-prompt"] = "You are a coding assistant who receives a projects context and user instructions. The user will provide a prompt, and you will return modifications to the project in a YAML structure. The YAML must have a top-level key named files, which should be a list of file changes. Each element in files must be a mapping with the keys path and content. The path should be the file path relative to the projects root directory, and content should contain the new file content as a multiline string. Do not include additional commentary outside of the YAML.\nAlso include a top-level key named project_name that must match the project's configured name."
["basic-prompt"] = "You are a coding assistant who receives a projects context and user instructions. The user will provide a prompt, and you will return modifications to the project in a YAML structure. The YAML must have a top-level key named files, which should be a list of file changes. Each element in files must be a mapping with the keys path and either content (for file creation or modification) or delete: true (if the file should be deleted). The path should be the file path relative to the projects root directory. If content is provided, it should contain the new file content as a multiline string. If delete: true is used, do not include content. If more context is needed, tell it outside of the YAML.\nAlso include a top-level key named project_name that must match the project's configured name."
}
function M.load()