genaicode 0.10.0 → 0.10.2
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/dist/ai-service/ai-studio.js +69 -70
- package/dist/ai-service/ai-studio.js.map +1 -1
- package/dist/ai-service/common-types.d.ts +1 -0
- package/dist/ai-service/common.js +3 -0
- package/dist/ai-service/common.js.map +1 -1
- package/dist/help-docs/genaicode-help-document.d.ts +1 -1
- package/dist/help-docs/genaicode-help-document.js +1 -0
- package/dist/help-docs/genaicode-help-document.js.map +1 -1
- package/dist/main/common/user-actions.d.ts +1 -1
- package/dist/main/config-types.d.ts +1 -0
- package/dist/main/config.js +8 -1
- package/dist/main/config.js.map +1 -1
- package/dist/main/ui/common/api-types.d.ts +25 -0
- package/dist/main/ui/frontend/assets/index-DWyCD84H.js +2015 -0
- package/dist/main/ui/frontend/index.html +1 -1
- package/dist/prompt/function-calling-validate.d.ts +2 -1
- package/dist/prompt/function-calling-validate.js +2 -2
- package/dist/prompt/function-calling-validate.js.map +1 -1
- package/dist/prompt/function-calling.js +5 -2
- package/dist/prompt/function-calling.js.map +1 -1
- package/dist/prompt/function-defs/ask-question.d.ts +1 -0
- package/dist/prompt/function-defs/ask-question.js +33 -1
- package/dist/prompt/function-defs/ask-question.js.map +1 -1
- package/dist/prompt/function-defs/compound-action-list.d.ts +7 -0
- package/dist/prompt/function-defs/compound-action-list.js +38 -0
- package/dist/prompt/function-defs/compound-action-list.js.map +1 -0
- package/dist/prompt/function-defs/compound-action.d.ts +2 -0
- package/dist/prompt/function-defs/compound-action.js +43 -0
- package/dist/prompt/function-defs/compound-action.js.map +1 -0
- package/dist/prompt/function-defs/conversation-graph.d.ts +6 -6
- package/dist/prompt/limits.js +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-compound-action.d.ts +20 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-compound-action.js +253 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-compound-action.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-conversation-graph.d.ts +6 -7
- package/dist/prompt/steps/step-ask-question/handlers/handle-conversation-graph.js +406 -178
- package/dist/prompt/steps/step-ask-question/handlers/handle-conversation-graph.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-explore-external-directories.js +4 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-explore-external-directories.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-read-external-files.js +5 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-read-external-files.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-git-context.d.ts +3 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-git-context.js +184 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-git-context.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-update-file.js +8 -12
- package/dist/prompt/steps/step-ask-question/handlers/handle-update-file.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts +25 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/step-ask-question.js +2 -0
- package/dist/prompt/steps/step-ask-question/step-ask-question.js.map +1 -1
- package/dist/prompt/steps/step-validate-recover.js +3 -3
- package/dist/prompt/steps/step-validate-recover.js.map +1 -1
- package/dist/prompt/systemprompt.d.ts +1 -1
- package/dist/prompt/systemprompt.js +7 -2
- package/dist/prompt/systemprompt.js.map +1 -1
- package/package.json +4 -3
- package/dist/main/ui/frontend/assets/index-BlVGo0E6.js +0 -1902
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { verifySystemPromptLimit } from './limits.js';
|
|
2
2
|
/** Generates a system prompt with the codegen prompt merged */
|
|
3
|
-
export function getSystemPrompt({ rootDir, importantContext }, options) {
|
|
3
|
+
export function getSystemPrompt({ rootDir, importantContext, featuresEnabled }, options) {
|
|
4
4
|
const { verbose, askQuestion, interactive, ui, allowFileCreate, allowFileDelete, allowDirectoryCreate, allowFileMove, vision, imagen, } = options;
|
|
5
|
+
const gitContextEnabled = featuresEnabled?.gitContext !== false;
|
|
5
6
|
console.log('Generate system prompt');
|
|
6
7
|
// IMPORTANT: Please avoid increasing the length of the system prompt.
|
|
7
8
|
let systemPrompt = `## Who are you?
|
|
@@ -38,7 +39,8 @@ Please limit any changes to the root directory of my application, which is \`${r
|
|
|
38
39
|
- ${allowDirectoryCreate ? 'You are allowed to create new directories.' : `Do not create new directories.`}
|
|
39
40
|
- ${allowFileMove ? 'You are allowed to move files.' : 'Do not move files.'}
|
|
40
41
|
- ${vision ? 'You are allowed to analyze image assets.' : 'Do not analyze image assets.'}
|
|
41
|
-
- ${imagen ? 'You are allowed to generate images.' : 'You are not allowed to generate images.'}
|
|
42
|
+
- ${imagen ? 'You are allowed to generate images.' : 'You are not allowed to generate images.'}
|
|
43
|
+
`;
|
|
42
44
|
if (askQuestion && (interactive || ui)) {
|
|
43
45
|
systemPrompt += `## Asking Questions And Conversing
|
|
44
46
|
You have the ability to have a conversation with me to clarify requirements, seek permissions, or request additional context.
|
|
@@ -90,6 +92,8 @@ Example use cases of action types:
|
|
|
90
92
|
- The user needs help with GenAIcode itself, encountered a problem, or needs guidance -> **genaicodeHelp**
|
|
91
93
|
- Perform inference on a AI model with reasoning capabilities -> **reasoningInference**
|
|
92
94
|
- Complex, multi-step conversations that require **planning** and structured flow, wnen implementing complex features or handling tasks that involve multiple decisions and steps -> **conversationGraph**
|
|
95
|
+
- Need to execute multiple distinct file operations (create, update, delete, move) or image manipulations as a batch, based on a user request that implies multiple simple, predefined actions -> **compoundAction**
|
|
96
|
+
${gitContextEnabled ? '- Need to access Git information such as commit history, file changes, or blame data to understand code evolution or authorship -> **requestGitContext**' : ''}
|
|
93
97
|
|
|
94
98
|
### Efficient File Content Requests
|
|
95
99
|
|
|
@@ -133,6 +137,7 @@ It is ** VERY IMPORTANT ** to follow the conversation flow to ensure a smooth an
|
|
|
133
137
|
- **IMPORTANT: Always check if a file exists before using createFile.** Before suggesting the createFile action, carefully examine the source code context to verify the file doesn't already exist. If a file already exists with the same path, use sendMessage to inform the user instead.
|
|
134
138
|
- When using \`reasoningInference\` action type to perform reasoning inference, in first step tell the user what you are going to do, and in the second step provide the results of the reasoning inference.
|
|
135
139
|
- When calling \`reasoningInference\` function, always provide a detailed prompt that includes the problem statement, context, constraints, assumptions, and solution. This will help the reasoning model to provide more accurate predictions. REMEMBER: The reasoning model will only consider the prompt and will not have access to any other context, so if you think something is important, include its full content in the context items.
|
|
140
|
+
- Distinguish \`compoundAction\` from \`confirmCodeGeneration\`: Use \`compoundAction\` for batching multiple *simple, predefined manipulations* specified by the user. Use \`confirmCodeGeneration\` for implementing features or complex changes requiring analysis and potentially complex logic generation.
|
|
136
141
|
|
|
137
142
|
## GenAIcode configuration
|
|
138
143
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systemprompt.js","sourceRoot":"","sources":["../../src/prompt/systemprompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAItD,+DAA+D;AAC/D,MAAM,UAAU,eAAe,CAC7B,EAAE,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"systemprompt.js","sourceRoot":"","sources":["../../src/prompt/systemprompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAItD,+DAA+D;AAC/D,MAAM,UAAU,eAAe,CAC7B,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAsE,EAClH,OAA0C;IAE1C,MAAM,EACJ,OAAO,EACP,WAAW,EACX,WAAW,EACX,EAAE,EACF,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,MAAM,EACN,MAAM,GACP,GAAG,OAAO,CAAC;IAEZ,MAAM,iBAAiB,GAAG,eAAe,EAAE,UAAU,KAAK,KAAK,CAAC;IAEhE,OAAO,C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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "genaicode",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"author": "Grzegorz Tańczyk",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"styled-components": "^6.1.13",
|
|
84
84
|
"ts-node": "^10.9.2",
|
|
85
85
|
"typescript": "^5.0.0",
|
|
86
|
-
"vite": "^6.
|
|
86
|
+
"vite": "^6.3.4",
|
|
87
87
|
"vite-plugin-checker": "^0.8.0",
|
|
88
88
|
"vitest": "^3.0.7"
|
|
89
89
|
},
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@fontsource/press-start-2p": "^5.1.0",
|
|
94
94
|
"@google-cloud/aiplatform": "^3.34.0",
|
|
95
95
|
"@google-cloud/vertexai": "^1.9.2",
|
|
96
|
-
"@google/
|
|
96
|
+
"@google/genai": "^0.10.0",
|
|
97
97
|
"@imgly/background-removal-node": "^1.4.5",
|
|
98
98
|
"@inquirer/prompts": "^5.3.8",
|
|
99
99
|
"@types/diff": "^5.2.1",
|
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
"openai": "^4.77.0",
|
|
115
115
|
"please-upgrade-node": "^3.2.0",
|
|
116
116
|
"sharp": "^0.33.4",
|
|
117
|
+
"simple-git": "^3.27.0",
|
|
117
118
|
"xml2js": "^0.6.2"
|
|
118
119
|
},
|
|
119
120
|
"lint-staged": {
|