genaicode 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/ai-service/ai-studio.js +7 -1
- package/dist/ai-service/ai-studio.js.map +1 -1
- package/dist/ai-service/anthropic.js +49 -19
- package/dist/ai-service/anthropic.js.map +1 -1
- package/dist/ai-service/chat-gpt.js +28 -11
- package/dist/ai-service/chat-gpt.js.map +1 -1
- package/dist/ai-service/common.d.ts +5 -4
- package/dist/ai-service/common.js +3 -4
- package/dist/ai-service/common.js.map +1 -1
- package/dist/ai-service/common.test.js +1 -1
- package/dist/ai-service/vertex-ai-claude.js +1 -1
- package/dist/ai-service/vertex-ai-claude.js.map +1 -1
- package/dist/ai-service/vertex-ai.js +7 -1
- package/dist/ai-service/vertex-ai.js.map +1 -1
- package/dist/cli/cli-options.js +0 -12
- package/dist/cli/cli-options.js.map +1 -1
- package/dist/cli/cli-params.d.ts +1 -4
- package/dist/cli/cli-params.js +1 -10
- package/dist/cli/cli-params.js.map +1 -1
- package/dist/cli/validate-cli-params.js +1 -7
- package/dist/cli/validate-cli-params.js.map +1 -1
- package/dist/cli/validate-cli-params.test.js +1 -1
- package/dist/cli/validate-cli-params.test.js.map +1 -1
- package/dist/eval/codegen-summary.test.d.ts +1 -0
- package/dist/eval/codegen-summary.test.js +93 -0
- package/dist/eval/codegen-summary.test.js.map +1 -0
- package/dist/eval/current-prompt-plugin.d.ts +3 -0
- package/dist/eval/current-prompt-plugin.js +10 -0
- package/dist/eval/current-prompt-plugin.js.map +1 -0
- package/dist/eval/data/current-prompt.d.ts +34 -0
- package/dist/eval/data/current-prompt.js +59 -0
- package/dist/eval/data/current-prompt.js.map +1 -0
- package/dist/eval/data/prompt-assistant-image.d.ts +49 -0
- package/dist/eval/data/prompt-assistant-image.js +67 -0
- package/dist/eval/data/prompt-assistant-image.js.map +1 -0
- package/dist/eval/data/prompt3.d.ts +34 -0
- package/dist/eval/data/prompt3.js +71 -0
- package/dist/eval/data/prompt3.js.map +1 -0
- package/dist/eval/prompt-debug.test.d.ts +1 -0
- package/dist/eval/prompt-debug.test.js +76 -0
- package/dist/eval/prompt-debug.test.js.map +1 -0
- package/dist/eval/prompt2.d.ts +34 -0
- package/dist/eval/prompt2.js +125 -0
- package/dist/eval/prompt2.js.map +1 -0
- package/dist/files/read-files.d.ts +29 -6
- package/dist/files/read-files.js +31 -10
- package/dist/files/read-files.js.map +1 -1
- package/dist/files/read-files.test.js +15 -9
- package/dist/files/read-files.test.js.map +1 -1
- package/dist/files/source-code-tree.d.ts +17 -0
- package/dist/files/source-code-tree.js +70 -0
- package/dist/files/source-code-tree.js.map +1 -0
- package/dist/main/codegen-types.d.ts +8 -5
- package/dist/main/codegen.ai-services.test.d.ts +3 -0
- package/dist/main/codegen.ai-services.test.js +198 -0
- package/dist/main/codegen.ai-services.test.js.map +1 -0
- package/dist/main/codegen.cli-options.test.d.ts +3 -0
- package/dist/main/codegen.cli-options.test.js +171 -0
- package/dist/main/codegen.cli-options.test.js.map +1 -0
- package/dist/main/codegen.image-generation.test.d.ts +3 -0
- package/dist/main/codegen.image-generation.test.js +187 -0
- package/dist/main/codegen.image-generation.test.js.map +1 -0
- package/dist/main/codegen.js +2 -5
- package/dist/main/codegen.js.map +1 -1
- package/dist/main/codegen.test-utils.d.ts +81 -0
- package/dist/main/codegen.test-utils.js +88 -0
- package/dist/main/codegen.test-utils.js.map +1 -0
- package/dist/main/codegen.test.js +47 -28
- package/dist/main/codegen.test.js.map +1 -1
- package/dist/main/common/content-bus-types.d.ts +6 -0
- package/dist/main/common/content-bus.d.ts +2 -2
- package/dist/main/common/content-bus.js +3 -1
- package/dist/main/common/content-bus.js.map +1 -1
- package/dist/main/common/user-actions.d.ts +8 -2
- package/dist/main/common/user-actions.js.map +1 -1
- package/dist/main/config-lib.js +20 -2
- package/dist/main/config-lib.js.map +1 -1
- package/dist/main/config.js +4 -28
- package/dist/main/config.js.map +1 -1
- package/dist/main/interactive/codegen-interactive.js +0 -4
- package/dist/main/interactive/codegen-interactive.js.map +1 -1
- package/dist/main/interactive/codegen-interactive.test.js +1 -7
- package/dist/main/interactive/codegen-interactive.test.js.map +1 -1
- package/dist/main/interactive/common.d.ts +1 -1
- package/dist/main/interactive/common.js +0 -2
- package/dist/main/interactive/common.js.map +1 -1
- package/dist/main/interactive/configure.js +0 -2
- package/dist/main/interactive/configure.js.map +1 -1
- package/dist/main/interactive/help.js +0 -2
- package/dist/main/interactive/help.js.map +1 -1
- package/dist/main/interactive/task-file.js +1 -1
- package/dist/main/interactive/task-file.js.map +1 -1
- package/dist/main/interactive/text-prompt.js +1 -1
- package/dist/main/interactive/text-prompt.js.map +1 -1
- package/dist/main/interactive/user-action-handlers.js +4 -2
- package/dist/main/interactive/user-action-handlers.js.map +1 -1
- package/dist/main/plugin-loader.d.ts +7 -1
- package/dist/main/plugin-loader.js +61 -0
- package/dist/main/plugin-loader.js.map +1 -1
- package/dist/main/ui/backend/api.js +9 -3
- package/dist/main/ui/backend/api.js.map +1 -1
- package/dist/main/ui/backend/service.d.ts +2 -1
- package/dist/main/ui/backend/service.js +6 -3
- package/dist/main/ui/backend/service.js.map +1 -1
- package/dist/main/ui/frontend/assets/index-QOcNx5ac.js +812 -0
- package/dist/main/ui/frontend/index.html +1 -1
- package/dist/main/ui/user-action-handlers.js +1 -1
- package/dist/main/ui/user-action-handlers.js.map +1 -1
- package/dist/project-profiles/detection.d.ts +40 -0
- package/dist/project-profiles/detection.js +131 -0
- package/dist/project-profiles/detection.js.map +1 -0
- package/dist/project-profiles/index.d.ts +35 -0
- package/dist/project-profiles/index.js +72 -0
- package/dist/project-profiles/index.js.map +1 -0
- package/dist/project-profiles/profiles/golang.d.ts +65 -0
- package/dist/project-profiles/profiles/golang.js +208 -0
- package/dist/project-profiles/profiles/golang.js.map +1 -0
- package/dist/project-profiles/profiles/java-maven.d.ts +80 -0
- package/dist/project-profiles/profiles/java-maven.js +165 -0
- package/dist/project-profiles/profiles/java-maven.js.map +1 -0
- package/dist/project-profiles/profiles/javascript-npm.d.ts +40 -0
- package/dist/project-profiles/profiles/javascript-npm.js +118 -0
- package/dist/project-profiles/profiles/javascript-npm.js.map +1 -0
- package/dist/project-profiles/profiles/javascript-react.d.ts +46 -0
- package/dist/project-profiles/profiles/javascript-react.js +147 -0
- package/dist/project-profiles/profiles/javascript-react.js.map +1 -0
- package/dist/project-profiles/profiles/python-django.d.ts +58 -0
- package/dist/project-profiles/profiles/python-django.js +200 -0
- package/dist/project-profiles/profiles/python-django.js.map +1 -0
- package/dist/project-profiles/types.d.ts +122 -0
- package/dist/project-profiles/types.js +77 -0
- package/dist/project-profiles/types.js.map +1 -0
- package/dist/prompt/function-calling.js +8 -3
- package/dist/prompt/function-calling.js.map +1 -1
- package/dist/prompt/function-defs/ask-question.d.ts +5 -0
- package/dist/prompt/function-defs/ask-question.js +140 -60
- package/dist/prompt/function-defs/ask-question.js.map +1 -1
- package/dist/prompt/function-defs/codegen-planning.d.ts +8 -0
- package/dist/prompt/function-defs/codegen-planning.js +50 -0
- package/dist/prompt/function-defs/codegen-planning.js.map +1 -0
- package/dist/prompt/function-defs/codegen-summary.js +2 -2
- package/dist/prompt/function-defs/codegen-summary.js.map +1 -1
- package/dist/prompt/function-defs/get-source-code.js +32 -2
- package/dist/prompt/function-defs/get-source-code.js.map +1 -1
- package/dist/prompt/function-defs/optimize-context.js +35 -12
- package/dist/prompt/function-defs/optimize-context.js.map +1 -1
- package/dist/prompt/function-defs/set-summaries.js +20 -1
- package/dist/prompt/function-defs/set-summaries.js.map +1 -1
- package/dist/prompt/limits.js +2 -2
- package/dist/prompt/limits.js.map +1 -1
- package/dist/prompt/limits.test.js +3 -3
- package/dist/prompt/limits.test.js.map +1 -1
- package/dist/prompt/prompt-codegen.js +7 -79
- package/dist/prompt/prompt-codegen.js.map +1 -1
- package/dist/prompt/prompt-codegen.test.js +8 -14
- package/dist/prompt/prompt-codegen.test.js.map +1 -1
- package/dist/prompt/prompt-service-ask-question.test.js +27 -80
- package/dist/prompt/prompt-service-ask-question.test.js.map +1 -1
- package/dist/prompt/prompt-service.ai-services.test.d.ts +1 -0
- package/dist/prompt/prompt-service.ai-services.test.js +149 -0
- package/dist/prompt/prompt-service.ai-services.test.js.map +1 -0
- package/dist/prompt/prompt-service.context-optimization.test.d.ts +1 -0
- package/dist/prompt/prompt-service.context-optimization.test.js +212 -0
- package/dist/prompt/prompt-service.context-optimization.test.js.map +1 -0
- package/dist/prompt/prompt-service.image-handling.test.d.ts +1 -0
- package/dist/prompt/prompt-service.image-handling.test.js +212 -0
- package/dist/prompt/prompt-service.image-handling.test.js.map +1 -0
- package/dist/prompt/prompt-service.js +41 -127
- package/dist/prompt/prompt-service.js.map +1 -1
- package/dist/prompt/prompt-service.test-utils.d.ts +66 -0
- package/dist/prompt/prompt-service.test-utils.js +169 -0
- package/dist/prompt/prompt-service.test-utils.js.map +1 -0
- package/dist/prompt/prompt-service.test.js +96 -20
- package/dist/prompt/prompt-service.test.js.map +1 -1
- package/dist/prompt/prompt-service.validation-recovery.test.d.ts +1 -0
- package/dist/prompt/prompt-service.validation-recovery.test.js +263 -0
- package/dist/prompt/prompt-service.validation-recovery.test.js.map +1 -0
- package/dist/prompt/static-prompts.d.ts +16 -0
- package/dist/prompt/static-prompts.js +22 -0
- package/dist/prompt/static-prompts.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.js +1 -3
- package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/code-generation.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/code-generation.js +58 -0
- package/dist/prompt/steps/step-ask-question/handlers/code-generation.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.d.ts +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.js +8 -7
- package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js +6 -6
- package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/default-action.js +1 -4
- package/dist/prompt/steps/step-ask-question/handlers/default-action.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.js +86 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.js +97 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.js +20 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handler-utils.d.ts +0 -0
- package/dist/prompt/steps/step-ask-question/handlers/handler-utils.js +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handler-utils.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.d.ts +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js +57 -15
- package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/request-files-content.d.ts +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js +109 -12
- package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/request-permissions.d.ts +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js +48 -26
- package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.js +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.js +1 -0
- package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts +25 -21
- package/dist/prompt/steps/step-ask-question/step-ask-question.d.ts +2 -5
- package/dist/prompt/steps/step-ask-question/step-ask-question.js +36 -33
- package/dist/prompt/steps/step-ask-question/step-ask-question.js.map +1 -1
- package/dist/prompt/steps/step-codegen-planning.d.ts +10 -0
- package/dist/prompt/steps/step-codegen-planning.js +69 -0
- package/dist/prompt/steps/step-codegen-planning.js.map +1 -0
- package/dist/prompt/steps/step-codegen-summary.d.ts +7 -0
- package/dist/prompt/steps/step-codegen-summary.js +106 -0
- package/dist/prompt/steps/step-codegen-summary.js.map +1 -0
- package/dist/prompt/steps/step-codegen-summary.test.d.ts +1 -0
- package/dist/prompt/steps/step-codegen-summary.test.js +136 -0
- package/dist/prompt/steps/step-codegen-summary.test.js.map +1 -0
- package/dist/prompt/steps/step-context-optimization.js +243 -126
- package/dist/prompt/steps/step-context-optimization.js.map +1 -1
- package/dist/prompt/steps/step-context-optimization.test.d.ts +2 -0
- package/dist/prompt/steps/step-context-optimization.test.js +475 -0
- package/dist/prompt/steps/step-context-optimization.test.js.map +1 -0
- package/dist/prompt/steps/step-ensure-context.d.ts +15 -0
- package/dist/prompt/steps/step-ensure-context.js +102 -0
- package/dist/prompt/steps/step-ensure-context.js.map +1 -0
- package/dist/prompt/steps/step-ensure-context.test.d.ts +1 -0
- package/dist/prompt/steps/step-ensure-context.test.js +242 -0
- package/dist/prompt/steps/step-ensure-context.test.js.map +1 -0
- package/dist/prompt/steps/step-generate-image.d.ts +8 -1
- package/dist/prompt/steps/step-generate-image.js +1 -0
- package/dist/prompt/steps/step-generate-image.js.map +1 -1
- package/dist/prompt/steps/step-summarization.d.ts +2 -2
- package/dist/prompt/steps/step-summarization.js +45 -9
- package/dist/prompt/steps/step-summarization.js.map +1 -1
- package/dist/prompt/steps/step-validate-recover.js +24 -15
- package/dist/prompt/steps/step-validate-recover.js.map +1 -1
- package/dist/prompt/steps/steps-types.d.ts +2 -0
- package/dist/prompt/steps/steps-types.js.map +1 -1
- package/dist/prompt/systemprompt.d.ts +2 -2
- package/dist/prompt/systemprompt.js +74 -176
- package/dist/prompt/systemprompt.js.map +1 -1
- package/dist/prompt/systemprompt.test.js +4 -5
- package/dist/prompt/systemprompt.test.js.map +1 -1
- package/dist/vite-genaicode/vite-genaicode-plugin.js +0 -2
- package/dist/vite-genaicode/vite-genaicode-plugin.js.map +1 -1
- package/package.json +6 -2
- package/dist/main/ui/frontend/assets/index-Dk_qaEQg.js +0 -782
|
@@ -1,203 +1,101 @@
|
|
|
1
|
-
import { CODEGEN_TRIGGER } from './prompt-consts.js';
|
|
2
1
|
import { verifySystemPromptLimit } from './limits.js';
|
|
3
|
-
import { rcConfig } from '../main/config.js';
|
|
4
|
-
/** Generates a system prompt */
|
|
5
|
-
export function getSystemPrompt(
|
|
2
|
+
import { rcConfig, importantContext } from '../main/config.js';
|
|
3
|
+
/** Generates a system prompt with the codegen prompt merged */
|
|
4
|
+
export function getSystemPrompt(options) {
|
|
5
|
+
const { verbose, askQuestion, interactive, ui, allowFileCreate, allowFileDelete, allowDirectoryCreate, allowFileMove, vision, imagen, } = options;
|
|
6
6
|
console.log('Generate system prompt');
|
|
7
|
-
// IMPORTANT: Please avoid increasing length of the system prompt.
|
|
8
|
-
let systemPrompt =
|
|
9
|
-
You are GenAIcode, a code generation assistant tasked with helping me implement my ideas into my application's source code.
|
|
10
|
-
|
|
11
|
-
You can generate new code or modify existing code based on the instructions I provide.
|
|
12
|
-
|
|
13
|
-
Instructions may be given directly via messages, through files, or using the ${CODEGEN_TRIGGER} comment in the code.
|
|
7
|
+
// IMPORTANT: Please avoid increasing the length of the system prompt.
|
|
8
|
+
let systemPrompt = `## Who are you?
|
|
14
9
|
|
|
10
|
+
You are GenAIcode, a code generation assistant tasked with helping me implement my ideas into my application's source code.
|
|
15
11
|
You should parse my application source code and then suggest changes using appropriate tools.
|
|
16
|
-
|
|
17
|
-
## Main responsibilities
|
|
18
|
-
|
|
19
|
-
Your responsibilities include:
|
|
20
|
-
|
|
21
|
-
1. **Analyzing the Task**: Understand the requirements based on the provided instructions and code.
|
|
22
|
-
|
|
23
|
-
2. **Asking clarifying questions**: Before proposing any updates, make sure that you understand the task, and seek clarification if needed by calling the \`askQuestion\` function with the appropriate arguments.
|
|
24
|
-
|
|
25
|
-
3. **Summarizing Proposed Updates**: Once the decision is to make code changes, summarize the planned updates by calling the \`codegenSummary\` function with the appropriate arguments.
|
|
26
|
-
|
|
27
|
-
- Ensure that you include:
|
|
28
|
-
- **\`explanation\`**: A brief description of the planned changes or reasoning for no changes.
|
|
29
|
-
- **\`fileUpdates\`**: A list of proposed file updates, each with required properties:
|
|
30
|
-
- **\`path\`**: Absolute file path to be updated.
|
|
31
|
-
- **\`updateToolName\`**: The tool to be used for the update (e.g., \`createFile\`, \`updateFile\`).
|
|
32
|
-
- **\`prompt\`**: A detailed prompt summarizing the planned changes for this file.
|
|
33
|
-
- **\`contextPaths\`**: A list of file paths that should be used as context for the code generation requests.
|
|
34
|
-
|
|
35
|
-
4. **Generating Code**: After the summary is approved, proceed to generate or modify code as needed.
|
|
36
|
-
|
|
37
|
-
5. **Context Optimization**: Manage and optimize context during code generation tasks by using the \`contextOptimization\` actionType. This involves generating a prompt to guide the LLM in determining which parts of the context are most relevant to keep. Utilize the \`contextOptimization\` property to provide specific guidance and enhance efficiency.
|
|
38
|
-
|
|
39
|
-
- **Effective Utilization**: Clearly define the goals of context optimization before initiating it. Use examples like focusing on specific modules or reducing irrelevant dependencies.
|
|
40
|
-
- **Step-by-Step Guidance**: Outline the steps to maintain a relevant and minimized context, such as identifying key files, removing unnecessary data, and continuously reassessing context relevance.
|
|
41
|
-
|
|
42
|
-
6. **Recognizing User Intent to End Interaction**: Pay close attention to the user's messages and interpret their intent, especially when they indicate a desire to end the conversation or cancel the process. Don't rely solely on specific phrases, but rather on the overall meaning and context of the user's input.
|
|
43
|
-
|
|
44
|
-
- If you believe the user intends to end the interaction, use the \`askQuestion\` function with the \`actionType\` set to \`cancelCodeGeneration\`.
|
|
45
|
-
- Be responsive to various ways a user might express their intention to stop, such as saying goodbye, expressing satisfaction with the current progress, or directly stating they want to end the session.
|
|
46
|
-
|
|
47
12
|
Please limit any changes to the root directory of my application, which is \`${rcConfig.rootDir}\`.
|
|
48
13
|
|
|
49
|
-
## Important Guidelines
|
|
50
|
-
|
|
51
|
-
- **Use Absolute Paths**: Always use absolute file paths exactly as
|
|
52
|
-
|
|
53
|
-
- **
|
|
54
|
-
|
|
55
|
-
- **
|
|
56
|
-
|
|
57
|
-
- **
|
|
58
|
-
|
|
59
|
-
- **
|
|
60
|
-
|
|
61
|
-
- **
|
|
62
|
-
|
|
63
|
-
- **
|
|
64
|
-
|
|
65
|
-
- **
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
- **Dependencies**: Use this feature to trace through file dependencies when necessary, but avoid going too deep if it's not directly relevant to the task.
|
|
80
|
-
|
|
81
|
-
- **Privacy and Security**: Remember that some files may contain sensitive information. Only request files that you expect to be directly related to the code you're working on.
|
|
82
|
-
|
|
83
|
-
- **Iterative Requests**: If you find you need more context after reviewing initially requested files, it's okay to make additional requests. However, try to anticipate your needs to minimize the number of requests.
|
|
84
|
-
|
|
85
|
-
By using this feature effectively, you can provide more accurate and context-aware code generation, leading to higher quality results.
|
|
86
|
-
|
|
87
|
-
## Context Reduction During Conversations
|
|
88
|
-
|
|
89
|
-
To optimize token usage and improve conversation efficiency, you have the ability to reduce context during askQuestion conversations. This feature allows you to remove unnecessary information from the conversation context, particularly file contents that are no longer relevant. Here are some guidelines for using this capability:
|
|
90
|
-
|
|
91
|
-
- **Assess Relevance**: Continuously evaluate the relevance of the current context to the ongoing conversation and task at hand.
|
|
92
|
-
|
|
93
|
-
- **Identify Unnecessary Content**: Determine which file contents or other contextual information are no longer needed for the current conversation or upcoming code generation tasks.
|
|
94
|
-
|
|
95
|
-
- **Request Context Reduction**: When you identify that certain context can be safely removed, use the \`askQuestion\` function with the \`actionType\` parameter set to \`removeFilesFromContext\`.
|
|
96
|
-
|
|
97
|
-
- **Specify Removable Content**: When requesting context reduction, clearly indicate which file contents can be removed from the conversation context by providing an array of absolute file paths in the \`removeFilesFromContext\` parameter.
|
|
98
|
-
|
|
99
|
-
- **Maintain Essential Information**: Ensure that you retain any critical information necessary for completing the task or maintaining the conversation's coherence.
|
|
100
|
-
|
|
101
|
-
- **Gradual Reduction**: If unsure about removing large amounts of context at once, consider a gradual approach, removing less critical information first and reassessing as the conversation progresses.
|
|
102
|
-
|
|
103
|
-
- **Explain Your Decisions**: When requesting context reduction, briefly explain your reasoning to help the user understand why certain information is no longer needed.
|
|
104
|
-
|
|
105
|
-
By effectively managing and reducing context during conversations, you can help optimize token usage, reduce the likelihood of hitting rate limits, and maintain a more focused and efficient interaction.
|
|
106
|
-
|
|
107
|
-
## Usage of actionType in askQuestion function
|
|
108
|
-
|
|
109
|
-
When using the \`askQuestion\` function, choose the appropriate \`actionType\` based on these principles:
|
|
110
|
-
|
|
111
|
-
1. **requestAnswer**: Use for general information, clarifications, user preferences, or high-level concepts that don't require specific code.
|
|
112
|
-
Example: "Could you clarify what you mean by 'optimize performance'?"
|
|
113
|
-
|
|
114
|
-
2. **requestFilesContent**: Use this actionType specifically when specific code snippets or file contents are needed to proceed effectively. Always ensure you are using this actionType when the task involves accessing file contents.
|
|
115
|
-
Example: "I need to see the content of \`app.js\` to help debug the issue."
|
|
116
|
-
|
|
117
|
-
Key distinctions:
|
|
118
|
-
- Use \`requestAnswer\` when the query is answerable without code, seeks opinions/preferences, or deals with conceptual information.
|
|
119
|
-
- Use \`requestFilesContent\` when you need to see actual code, review user's code, access configuration files, or diagnose code-specific errors.
|
|
120
|
-
|
|
121
|
-
Always be specific in your requests, avoid unnecessary code requests, and clarify why the information or code is needed.
|
|
122
|
-
|
|
123
|
-
3. **requestPermissions**: Use this when you need additional permissions to perform certain actions (e.g., create files, delete files, etc.).
|
|
124
|
-
4. **removeFilesFromContext**: Use this when you want to remove unnecessary file contents from the conversation context to optimize token usage.
|
|
125
|
-
|
|
126
|
-
Example: "I've finished analyzing the 'utils.ts' file and won't need it for further tasks. I'll remove it from the context to optimize our conversation."
|
|
127
|
-
5. **confirmCodeGeneration**: Use this when you believe it's time to start generating or modifying code, but you want to confirm with the user first.
|
|
128
|
-
Example: "Based on our discussion, I think we're ready to start implementing the new feature. Shall I proceed with code generation?"
|
|
129
|
-
6. **startCodeGeneration**: Use this only after receiving confirmation (either through confirmCodeGeneration or explicit user instruction) that you should begin generating or modifying code.
|
|
130
|
-
7. **cancelCodeGeneration**: Use this if you determine that code generation should be stopped or if the user indicates they want to cancel the current task.
|
|
131
|
-
8. **contextOptimization**: Use this to manage and optimize context during code generation tasks. Generate a prompt using the \`contextOptimization\` property to guide the LLM in determining which parts of the context are most relevant to keep.
|
|
132
|
-
|
|
133
|
-
## Handling Analysis Requests
|
|
134
|
-
|
|
135
|
-
It's important to distinguish between analysis requests and code generation triggers. Analysis requests should not automatically lead to code generation.
|
|
136
|
-
|
|
137
|
-
- When asked to analyze something (e.g., "analyze this function", "what do you think about this code?"), use the \`requestAnswer\` actionType to provide your analysis or ask for more information if needed.
|
|
138
|
-
- Only transition to \`confirmCodeGeneration\` or \`startCodeGeneration\` when there's a clear indication that code changes are required and agreed upon.
|
|
139
|
-
|
|
140
|
-
Example of handling an analysis request:
|
|
141
|
-
|
|
142
|
-
User: "Can you analyze the performCalculation function?"
|
|
143
|
-
Assistant: (uses askQuestion with actionType: requestAnswer)
|
|
144
|
-
"Certainly! I'll analyze the performCalculation function for you. To do this effectively, I'll need to see its implementation. I'll request the content of the file containing this function now."
|
|
145
|
-
|
|
146
|
-
Remember, the goal is to maintain a conversation and provide thorough analysis before jumping into code generation. Always err on the side of asking for clarification rather than making assumptions that could lead to premature or unnecessary code changes.
|
|
147
|
-
|
|
148
|
-
- ** Usage of most important functions **:
|
|
149
|
-
|
|
150
|
-
- **\`askQuestion\` Function**: If you need more information or clarification, or if you need to request permissions or file contents, use the \`askQuestion\` function.
|
|
151
|
-
|
|
152
|
-
- **\`codegenSummary\` Function**: Before proceeding with code generation, summarize the proposed updates by calling the \`codegenSummary\` function with the appropriate arguments.
|
|
153
|
-
|
|
154
|
-
- **\`optimizeContext\` Function**: When optimizing the context for code generation, analyze the source code, and provide a list of files which are relevant to to the user prompt.
|
|
155
|
-
|
|
156
|
-
- **Please remember:**
|
|
157
|
-
|
|
158
|
-
- When calling functions, provide the arguments as a JSON object without extra text.
|
|
159
|
-
- Do not include JSON strings within the JSON object; the data should be properly structured.
|
|
160
|
-
- Follow the provided function schemas exactly.
|
|
14
|
+
## Important Guidelines
|
|
15
|
+
|
|
16
|
+
- **Use Absolute Paths**: Always use absolute file paths exactly as provided.
|
|
17
|
+
- **Return Working Code**: Aim to return fully functional code.
|
|
18
|
+
- **Avoid Incomplete Code Snippets**: Do not include commented-out fragments like \`// ... (keep other existing functions)\`.
|
|
19
|
+
- **Handle Large Files Appropriately**: For large files, prefer to use the \`patchFile\` function.
|
|
20
|
+
- **Suggest File Splitting When Relevant**: Suggest splitting large files if it improves maintainability.
|
|
21
|
+
- **Verify Permissions**: Ensure you have the necessary permissions before proceeding.
|
|
22
|
+
- **Error Handling**: If instructions are unclear, consider failing the task with an explanation.
|
|
23
|
+
- **Produce Necessary Code Only**: Do not generate unnecessary code.
|
|
24
|
+
- **Request Context When Needed**: Ask for sufficient context paths in the code generation summary.
|
|
25
|
+
- **Perform Dependency Analysis**: Always analyze the task thoroughly to identify all files that need to be updated, including dependencies and related modules.
|
|
26
|
+
- **Comprehensive File Updates**: Ensure that all relevant files are included in the \`fileUpdates\` list when proposing changes.
|
|
27
|
+
- **Perform Thorough Analysis**: Before generating code, always perform a comprehensive analysis of the task, identifying all affected files and dependencies.
|
|
28
|
+
- **Communicate Planned Changes**: Summarize the planned changes and list all files to be updated. Seek user confirmation before proceeding.
|
|
29
|
+
- **Consider Dependencies**: Include any dependent files that might require updates to ensure the codebase remains consistent.
|
|
30
|
+
- **Avoid Unnecessary Permission Requests**: Do not request permissions that you already have.
|
|
31
|
+
|
|
32
|
+
## Your permissions
|
|
33
|
+
|
|
34
|
+
- You are allowed to modify files.
|
|
35
|
+
- ${allowFileCreate ? 'You are allowed to create new files.' : 'Do not create new files.'}
|
|
36
|
+
- ${allowFileDelete
|
|
37
|
+
? 'You are allowed to delete files; in such cases, add an empty string as content.'
|
|
38
|
+
: 'Do not delete files.'}
|
|
39
|
+
- ${allowDirectoryCreate ? 'You are allowed to create new directories.' : `Do not create new directories.`}
|
|
40
|
+
- ${allowFileMove ? 'You are allowed to move files.' : 'Do not move files.'}
|
|
41
|
+
- ${vision ? 'You are allowed to analyze image assets.' : 'Do not analyze image assets.'}
|
|
42
|
+
- ${imagen ? 'You are allowed to generate images.' : 'You are not allowed to generate images.'}
|
|
161
43
|
`;
|
|
162
44
|
if (askQuestion && (interactive || ui)) {
|
|
163
|
-
systemPrompt +=
|
|
164
|
-
You have the ability to
|
|
45
|
+
systemPrompt += `## Asking Questions And Conversing
|
|
46
|
+
You have the ability to have a conversation with me to clarify requirements, seek permissions, or request additional context.
|
|
47
|
+
Use this feature wisely to gather crucial information that would help you better understand the task or provide more accurate code generation.
|
|
165
48
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
To ask a question, use the \`askQuestion\` function. This function allows you to:
|
|
49
|
+
To have conversation with me use the \`askQuestion\` function. This function allows you to:
|
|
169
50
|
|
|
170
51
|
- **Express Your Thoughts**: Inform me about your considerations or concerns regarding the task.
|
|
171
|
-
|
|
52
|
+
- **Share Analysis**: Provide insights or analysis based on the task requirements.
|
|
172
53
|
- **Seek Clarification**: Ask questions or provide suggestions to ensure you fully understand the requirements.
|
|
54
|
+
- **Request File Access**: If certain files are important but haven't been provided, request access to their content.
|
|
55
|
+
- **Request Permissions**: If you need permissions for operations that were initially restricted, you may request them.
|
|
56
|
+
- **Generate an image**: If you want to express your thoughts through an image, you can request image generation.
|
|
173
57
|
|
|
174
|
-
|
|
58
|
+
### Efficient File Content Requests
|
|
175
59
|
|
|
176
|
-
|
|
60
|
+
You can request the content of legitimate files within the project without interrupting the user. This allows you to gather more context when needed.
|
|
177
61
|
|
|
178
|
-
- **
|
|
62
|
+
- **Judicious Use**: Only request files directly relevant to the task.
|
|
63
|
+
- **Relevance**: Consider if the file content is truly necessary.
|
|
64
|
+
- **Large Files**: Be cautious when requesting large files.
|
|
65
|
+
- **Dependencies**: Trace through file dependencies when necessary.
|
|
66
|
+
- **Privacy and Security**: Be mindful of sensitive information.
|
|
67
|
+
- **Iterative Requests**: Anticipate your needs to minimize the number of requests.
|
|
179
68
|
|
|
180
|
-
|
|
69
|
+
# Typical Conversation Flow
|
|
181
70
|
|
|
182
|
-
|
|
71
|
+
It is ** VERY IMPORTANT ** to follow the conversation flow to ensure a smooth and efficient code generation process. Here is a typical conversation flow:
|
|
183
72
|
|
|
184
|
-
|
|
73
|
+
1. I provide you with source code and context.
|
|
74
|
+
2. Then I tell you what I want to achieve, either in detail or sometimes very briefly.
|
|
75
|
+
3. We do a conversation, until we reach a point where you have all the information you need, and we either continue to next step or stop the conversation.
|
|
76
|
+
4. You propose to start code generation (actionType: confirmCodeGeneration)
|
|
77
|
+
5. I confirm that you can proceed (or reject and we go back to step 3)
|
|
78
|
+
6. You generate the code changes summary
|
|
79
|
+
7. Then you generate code change for each file
|
|
80
|
+
8. I apply code changes, and the conversation ends.
|
|
185
81
|
|
|
186
|
-
|
|
82
|
+
## Conversation Flow Best Practices
|
|
187
83
|
|
|
188
|
-
-
|
|
84
|
+
- If the user wants to stop the conversation, you should respect that and stop the conversation (actionType: cancelCodeGeneration).
|
|
189
85
|
|
|
190
|
-
|
|
86
|
+
## Common pitfalls to avoid
|
|
191
87
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
- **Reduce Context When Appropriate**:
|
|
195
|
-
|
|
196
|
-
- If you determine that certain file contents or other contextual information are no longer necessary for the conversation or upcoming tasks, use the \`removeFilesFromContext\` parameter in the \`askQuestion\` function to request context reduction.
|
|
197
|
-
|
|
198
|
-
- Clearly specify which information can be safely removed from the context to optimize token usage and improve conversation efficiency.
|
|
88
|
+
It is **VERY IMPORTANT** to not make the following mistakes:
|
|
199
89
|
|
|
90
|
+
- Assistant wants to start code generation while the conversation is still ongoing.
|
|
91
|
+
- Assistant says that it starts analysis, but it does not provide any analysis.
|
|
92
|
+
- Assistant says something like "please wait", instead of providing a meaningful response.
|
|
93
|
+
- Assistant starts code generation without requesting missing permissions.
|
|
200
94
|
`;
|
|
95
|
+
}
|
|
96
|
+
if (importantContext.textPrompts && importantContext.textPrompts.length > 0) {
|
|
97
|
+
systemPrompt += `## Important Context
|
|
98
|
+
${importantContext.textPrompts.join('\n')}`;
|
|
201
99
|
}
|
|
202
100
|
if (verbose) {
|
|
203
101
|
console.log('System prompt:');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systemprompt.js","sourceRoot":"","sources":["../../src/prompt/systemprompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"systemprompt.js","sourceRoot":"","sources":["../../src/prompt/systemprompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG/D,+DAA+D;AAC/D,MAAM,UAAU,eAAe,CAAC,OAAuB;IACrD,MAAM,EACJ,OAAO,EACP,WAAW,EACX,WAAW,EACX,EAAE,EACF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,8 +5,6 @@ import '../files/find-files.js';
|
|
|
5
5
|
import '../main/config.js';
|
|
6
6
|
vi.mock('../cli/cli-params.js', () => ({
|
|
7
7
|
disableExplanations: true,
|
|
8
|
-
considerAllFiles: false,
|
|
9
|
-
dependencyTree: false,
|
|
10
8
|
explicitPrompt: false,
|
|
11
9
|
allowFileCreate: false,
|
|
12
10
|
allowFileDelete: false,
|
|
@@ -20,21 +18,22 @@ vi.mock('../files/find-files.js', () => ({
|
|
|
20
18
|
}));
|
|
21
19
|
vi.mock('../main/config.js', () => ({
|
|
22
20
|
rcConfig: { rootDir: '/mocked/root/dir' },
|
|
21
|
+
importantContext: {},
|
|
23
22
|
}));
|
|
24
23
|
describe('getSystemPrompt', () => {
|
|
25
24
|
beforeEach(() => {
|
|
26
25
|
vi.clearAllMocks();
|
|
27
26
|
});
|
|
28
27
|
it('generates correct system prompt', () => {
|
|
29
|
-
const systemPrompt = getSystemPrompt({ aiService: 'vertex-ai' });
|
|
28
|
+
const systemPrompt = getSystemPrompt({ aiService: 'vertex-ai', askQuestion: false });
|
|
30
29
|
expect(systemPrompt).toContain('You are GenAIcode, a code generation assistant');
|
|
31
|
-
expect(systemPrompt).toContain('You
|
|
30
|
+
expect(systemPrompt).toContain('You should parse my application source code');
|
|
32
31
|
expect(systemPrompt).toContain('Please limit any changes to the root directory of my application, which is `/mocked/root/dir`');
|
|
33
32
|
expect(systemPrompt).toContain('absolute file paths exactly');
|
|
34
33
|
});
|
|
35
34
|
it('verifies system prompt limit', () => {
|
|
36
35
|
const consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
|
|
37
|
-
getSystemPrompt({ aiService: 'vertex-ai', verbose: true });
|
|
36
|
+
getSystemPrompt({ aiService: 'vertex-ai', verbose: true, askQuestion: false });
|
|
38
37
|
expect(consoleSpy).toHaveBeenCalledWith('System prompt:');
|
|
39
38
|
expect(consoleSpy).toHaveBeenCalledWith(expect.stringContaining('You are GenAIcode, a code generation assistant'));
|
|
40
39
|
consoleSpy.mockRestore();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systemprompt.test.js","sourceRoot":"","sources":["../../src/prompt/systemprompt.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,sBAAsB,CAAC;AAC9B,OAAO,wBAAwB,CAAC;AAChC,OAAO,mBAAmB,CAAC;AAE3B,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC;IACrC,mBAAmB,EAAE,IAAI;IACzB,
|
|
1
|
+
{"version":3,"file":"systemprompt.test.js","sourceRoot":"","sources":["../../src/prompt/systemprompt.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,sBAAsB,CAAC;AAC9B,OAAO,wBAAwB,CAAC;AAChC,OAAO,mBAAmB,CAAC;AAE3B,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC;IACrC,mBAAmB,EAAE,IAAI;IACzB,cAAc,EAAE,KAAK;IACrB,eAAe,EAAE,KAAK;IACtB,eAAe,EAAE,KAAK;IACtB,oBAAoB,EAAE,KAAK;IAC3B,aAAa,EAAE,KAAK;IACpB,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE,CAAC,CAAC;IACvC,cAAc,EAAE,EAAE,CAAC,EAAE,EAAE;CACxB,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,IAAI,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B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -19,7 +19,6 @@ export default function viteGenaicode(options) {
|
|
|
19
19
|
uiFrameAncestors: ['http://localhost:' + port],
|
|
20
20
|
aiService: stringToAiServiceType(serviceAutoDetect()),
|
|
21
21
|
isDev: false,
|
|
22
|
-
considerAllFiles: false,
|
|
23
22
|
allowFileCreate: true,
|
|
24
23
|
allowFileDelete: true,
|
|
25
24
|
allowDirectoryCreate: true,
|
|
@@ -29,7 +28,6 @@ export default function viteGenaicode(options) {
|
|
|
29
28
|
requireExplanations: true,
|
|
30
29
|
askQuestion: true,
|
|
31
30
|
historyEnabled: true,
|
|
32
|
-
selfReflectionEnabled: true,
|
|
33
31
|
conversationSummaryEnabled: true,
|
|
34
32
|
...options,
|
|
35
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-genaicode-plugin.js","sourceRoot":"","sources":["../../src/vite-genaicode/vite-genaicode-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAI/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,IAAI,OAAO,GAAG,KAAK,CAAC;AAEpB,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,OAAiC;IACrE,KAAK,UAAU,KAAK,CAAC,IAAY;QAC/B,IAAI,OAAO;YAAE,OAAO;QAEpB,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAA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EAAE,CAAC;YACrD,KAAK,EAAE,KAAK;YAEZ,eAAe,EAAE,IAAI;YACrB,eAAe,EAAE,IAAI;YACrB,oBAAoB,EAAE,IAAI;YAC1B,aAAa,EAAE,IAAI;YACnB,MAAM,EAAE,IAAI;YAEZ,WAAW,EAAE,GAAG;YAChB,mBAAmB,EAAE,IAAI;YACzB,WAAW,EAAE,IAAI;YACjB,cAAc,EAAE,IAAI;YAEpB,0BAA0B,EAAE,IAAI;YAEhC,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED,MAAM,eAAe,GAAG,oBAAoB,CAAC;IAE7C,OAAO;QACL,IAAI,EAAE,gBAAgB;QAEtB,eAAe,CAAC,MAAqB;YACnC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;gBACxC,KAAK,CAAE,MAAM,CAAC,UAAW,CAAC,OAAO,EAAkB,CAAC,IAAI,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;QACL,CAAC;QAED,kBAAkB,CAAC,IAAY;YAC7B,OAAO,IAAI,CAAC,OAAO,CACjB,SAAS,EACT,uEAAuE,cAAc,aAAa,CACnG,CAAC;QACJ,CAAC;QAED,SAAS,CAAC,EAAU;YAClB,IAAI,EAAE,KAAK,eAAe,EAAE,CAAC;gBAC3B,OAAO,SAAS,GAAG,6BAA6B,CAAC;YACnD,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "genaicode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"author": "Grzegorz Tańczyk",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"ui": "node ./bin/genaicode.cjs --ui",
|
|
43
43
|
"lint": "eslint . --ext js,ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
44
44
|
"test": "vitest --config vitest.unit.config.ts",
|
|
45
|
+
"test:ci": "vitest run --config vitest.unit.config.ts --reporter=json",
|
|
45
46
|
"test:e2e": "vitest --config vitest.e2e.config.ts",
|
|
46
47
|
"coverage": "vitest run --coverage",
|
|
47
48
|
"prepare": "husky install || true",
|
|
@@ -57,7 +58,9 @@
|
|
|
57
58
|
"@types/multer": "^1.4.12",
|
|
58
59
|
"@types/react": "^18.3.5",
|
|
59
60
|
"@types/react-dom": "^18.3.0",
|
|
61
|
+
"@types/xml2js": "^0.4.14",
|
|
60
62
|
"@typescript-eslint/eslint-plugin": "^7.17.0",
|
|
63
|
+
"@uiw/react-json-view": "^2.0.0-alpha.30",
|
|
61
64
|
"@vitejs/plugin-react": "^4.3.1",
|
|
62
65
|
"@vitest/coverage-v8": "^2.0.5",
|
|
63
66
|
"axios": "^1.7.7",
|
|
@@ -103,7 +106,8 @@
|
|
|
103
106
|
"multer": "^1.4.5-lts.1",
|
|
104
107
|
"openai": "^4.67.1",
|
|
105
108
|
"please-upgrade-node": "^3.2.0",
|
|
106
|
-
"sharp": "^0.33.4"
|
|
109
|
+
"sharp": "^0.33.4",
|
|
110
|
+
"xml2js": "^0.6.2"
|
|
107
111
|
},
|
|
108
112
|
"lint-staged": {
|
|
109
113
|
"*.{js,ts,css,md}": "prettier --write"
|