genaicode 0.9.6 → 0.10.1
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.d.ts +1 -1
- package/dist/ai-service/ai-studio.js +114 -31
- package/dist/ai-service/ai-studio.js.map +1 -1
- package/dist/ai-service/anthropic.js +64 -28
- package/dist/ai-service/anthropic.js.map +1 -1
- package/dist/ai-service/common-types.d.ts +28 -7
- package/dist/ai-service/local-llm.d.ts +6 -0
- package/dist/ai-service/local-llm.js +77 -0
- package/dist/ai-service/local-llm.js.map +1 -0
- package/dist/ai-service/openai.d.ts +3 -13
- package/dist/ai-service/openai.js +107 -51
- package/dist/ai-service/openai.js.map +1 -1
- package/dist/ai-service/service-configurations-types.d.ts +14 -4
- package/dist/ai-service/service-configurations-types.js +0 -4
- package/dist/ai-service/service-configurations-types.js.map +1 -1
- package/dist/ai-service/service-configurations.d.ts +9 -1
- package/dist/ai-service/service-configurations.js +108 -12
- package/dist/ai-service/service-configurations.js.map +1 -1
- package/dist/ai-service/vertex-ai-claude.d.ts +1 -1
- package/dist/ai-service/vertex-ai-claude.js +80 -39
- package/dist/ai-service/vertex-ai-claude.js.map +1 -1
- package/dist/ai-service/vertex-ai.d.ts +1 -1
- package/dist/ai-service/vertex-ai.js +261 -155
- package/dist/ai-service/vertex-ai.js.map +1 -1
- package/dist/cli/cli-options.js +1 -1
- package/dist/cli/cli-options.js.map +1 -1
- package/dist/cli/validate-cli-params.js +1 -1
- package/dist/cli/validate-cli-params.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/codegen-utils.js +9 -1
- package/dist/main/codegen-utils.js.map +1 -1
- package/dist/main/codegen.js +2 -0
- package/dist/main/codegen.js.map +1 -1
- package/dist/main/common/user-actions.d.ts +2 -0
- package/dist/main/common/user-actions.js.map +1 -1
- package/dist/main/config-schema.js +16 -0
- package/dist/main/config-schema.js.map +1 -1
- package/dist/main/config-types.d.ts +16 -0
- package/dist/main/config.js +9 -1
- package/dist/main/config.js.map +1 -1
- package/dist/main/interactive/select-ai-service.js +1 -0
- package/dist/main/interactive/select-ai-service.js.map +1 -1
- package/dist/main/plugin-loader.d.ts +1 -2
- package/dist/main/plugin-loader.js.map +1 -1
- package/dist/main/ui/backend/endpoints/question-endpoint.js +34 -3
- package/dist/main/ui/backend/endpoints/question-endpoint.js.map +1 -1
- package/dist/main/ui/backend/service.d.ts +6 -5
- package/dist/main/ui/backend/service.js +54 -17
- package/dist/main/ui/backend/service.js.map +1 -1
- package/dist/main/ui/common/api-types.d.ts +1 -0
- package/dist/main/ui/frontend/assets/index-C7n3IQsE.js +1896 -0
- package/dist/main/ui/frontend/index.html +1 -1
- package/dist/project-profiles/types.d.ts +1 -1
- package/dist/project-profiles/types.js +1 -1
- package/dist/project-profiles/types.js.map +1 -1
- package/dist/prompt/function-calling.js +8 -1
- 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 +38 -4
- package/dist/prompt/function-defs/ask-question.js.map +1 -1
- package/dist/prompt/function-defs/conversation-summary.d.ts +2 -0
- package/dist/prompt/function-defs/conversation-summary.js +15 -0
- package/dist/prompt/function-defs/conversation-summary.js.map +1 -0
- package/dist/prompt/function-defs/explore-external-directories.d.ts +16 -0
- package/dist/prompt/function-defs/explore-external-directories.js +48 -0
- package/dist/prompt/function-defs/explore-external-directories.js.map +1 -0
- package/dist/prompt/function-defs/read-external-files.d.ts +9 -0
- package/dist/prompt/function-defs/read-external-files.js +30 -0
- package/dist/prompt/function-defs/read-external-files.js.map +1 -0
- package/dist/prompt/limits.js +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-code-generation.js +23 -18
- package/dist/prompt/steps/step-ask-question/handlers/handle-code-generation.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-conversation-graph.js +60 -28
- package/dist/prompt/steps/step-ask-question/handlers/handle-conversation-graph.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.js +76 -73
- package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-end-conversation.js +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-end-conversation.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-explore-external-directories.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-explore-external-directories.js +277 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-explore-external-directories.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.js +13 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-generate-image.js +13 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-generate-image.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-lint.d.ts +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-lint.js +54 -61
- package/dist/prompt/steps/step-ask-question/handlers/handle-lint.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.js +22 -10
- package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.js +13 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.js +13 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-read-external-files.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-read-external-files.js +144 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-read-external-files.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.js +27 -6
- package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-remove-files-from-context.js +13 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-remove-files-from-context.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-files-content.js +14 -5
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-files-content.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-files-fragments.js +26 -2
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-files-fragments.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 +182 -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-request-permissions.js +13 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-permissions.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.js +14 -2
- package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.js +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-update-file.js +59 -60
- 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-handlers.js +4 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts +11 -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 +14 -7
- package/dist/prompt/steps/step-ask-question/step-ask-question.js.map +1 -1
- package/dist/prompt/steps/step-codegen-planning.js +14 -5
- package/dist/prompt/steps/step-codegen-planning.js.map +1 -1
- package/dist/prompt/steps/step-context-compression.js +14 -5
- package/dist/prompt/steps/step-context-compression.js.map +1 -1
- package/dist/prompt/steps/step-context-optimization.js +10 -5
- package/dist/prompt/steps/step-context-optimization.js.map +1 -1
- package/dist/prompt/steps/step-generate-codegen-summary.js +14 -5
- package/dist/prompt/steps/step-generate-codegen-summary.js.map +1 -1
- package/dist/prompt/steps/step-generate-summary.d.ts +6 -0
- package/dist/prompt/steps/step-generate-summary.js +36 -16
- package/dist/prompt/steps/step-generate-summary.js.map +1 -1
- package/dist/prompt/steps/step-history-update.js +14 -5
- package/dist/prompt/steps/step-history-update.js.map +1 -1
- package/dist/prompt/steps/step-process-file-updates.js +10 -5
- package/dist/prompt/steps/step-process-file-updates.js.map +1 -1
- package/dist/prompt/steps/step-summarization.js +14 -2
- package/dist/prompt/steps/step-summarization.js.map +1 -1
- package/dist/prompt/steps/step-validate-recover.d.ts +2 -4
- package/dist/prompt/steps/step-validate-recover.js +18 -9
- package/dist/prompt/steps/step-validate-recover.js.map +1 -1
- package/dist/prompt/steps/step-verify-patch.js +14 -5
- package/dist/prompt/steps/step-verify-patch.js.map +1 -1
- package/dist/prompt/systemprompt.d.ts +1 -1
- package/dist/prompt/systemprompt.js +10 -5
- package/dist/prompt/systemprompt.js.map +1 -1
- package/package.json +5 -4
- package/dist/main/ui/frontend/assets/index-DI1ngpa2.js +0 -1840
- package/dist/prompt/steps/step-ask-question/handlers/code-generation.d.ts +0 -4
- package/dist/prompt/steps/step-ask-question/handlers/code-generation.js +0 -167
- package/dist/prompt/steps/step-ask-question/handlers/code-generation.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.d.ts +0 -2
- package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.js +0 -34
- package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/context-optimization.d.ts +0 -2
- package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js +0 -32
- package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/genaicode-help-document.d.ts +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/genaicode-help-document.js +0 -251
- package/dist/prompt/steps/step-ask-question/handlers/genaicode-help-document.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/lint.d.ts +0 -6
- package/dist/prompt/steps/step-ask-question/handlers/lint.js +0 -103
- package/dist/prompt/steps/step-ask-question/handlers/lint.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.d.ts +0 -2
- package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js +0 -82
- package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/request-files-content.d.ts +0 -8
- package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js +0 -179
- package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/request-permissions.d.ts +0 -2
- package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js +0 -69
- package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js.map +0 -1
|
@@ -16,13 +16,22 @@ export async function executeStepVerifyPatch({ filePath, patch, explanation }, g
|
|
|
16
16
|
// Rerun content generation without patchFile function
|
|
17
17
|
const partialRequest = [
|
|
18
18
|
prompt,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
{
|
|
20
|
+
functionDefs,
|
|
21
|
+
requiredFunctionName: 'updateFile',
|
|
22
|
+
temperature,
|
|
23
|
+
modelType: cheap ? ModelType.CHEAP : ModelType.DEFAULT,
|
|
24
|
+
expectedResponseType: {
|
|
25
|
+
text: false,
|
|
26
|
+
functionCall: true,
|
|
27
|
+
media: false,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
23
30
|
options,
|
|
24
31
|
];
|
|
25
|
-
const partialResult = await generateContentFn(...partialRequest)
|
|
32
|
+
const partialResult = (await generateContentFn(...partialRequest))
|
|
33
|
+
.filter((item) => item.type === 'functionCall')
|
|
34
|
+
.map((item) => item.functionCall);
|
|
26
35
|
const getSourceCodeCall = partialResult.find((call) => call.name === 'getSourceCode');
|
|
27
36
|
if (getSourceCodeCall) {
|
|
28
37
|
throw new Error('Unexpected getSourceCode: ' + JSON.stringify(getSourceCodeCall));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-verify-patch.js","sourceRoot":"","sources":["../../../src/prompt/steps/step-verify-patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAM7B,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAG7D,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAA4D,EAC1F,iBAA0C,EAC1C,MAAoB,EACpB,YAA2B,EAC3B,WAAmB,EACnB,KAAc,EACd,OAAuB;IAEvB,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,QAAQ,CAAC,CAAC;IAEzD,IAAI,cAAc,GAAqB,KAAK,CAAC;IAC7C,MAAM,cAAc,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAE1D,IAAI,CAAC;QACH,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,kCAAkC,QAAQ,wCAAwC,CAAC,CAAC;QAEhG,sDAAsD;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,EAAE,KAAK;iBACb;aACF;YACD,OAAO;SACR,CAAC;QACF,MAAM,aAAa,GAAG,CAAC,MAAM,iBAAiB,CAAC,GAAG,cAAc,CAAC,CAAC;aAC/D,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC;aAC9C,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEpC,MAAM,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC;QAEtF,IAAI,iBAAiB,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC;QACpF,CAAC;QACD,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,EAAE,CAAC;YAC5D,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAC3C,OAAO;YACL;gBACE,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE;aAC/F;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CodegenOptions } from '../main/codegen-types.js';
|
|
2
2
|
import { RcConfig } from '../main/config-types.js';
|
|
3
3
|
/** Generates a system prompt with the codegen prompt merged */
|
|
4
|
-
export declare function getSystemPrompt({ rootDir, importantContext }: Pick<RcConfig, 'rootDir' | 'importantContext'>, options: Omit<CodegenOptions, 'aiService'>): string;
|
|
4
|
+
export declare function getSystemPrompt({ rootDir, importantContext, featuresEnabled }: Pick<RcConfig, 'rootDir' | 'importantContext' | 'featuresEnabled'>, options: Omit<CodegenOptions, 'aiService'>): string;
|
|
@@ -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.
|
|
@@ -64,7 +66,7 @@ Also additional actions can be added by plugins, and their names will be prefixe
|
|
|
64
66
|
### How askQuestion process works
|
|
65
67
|
|
|
66
68
|
1. You receive a conversation history
|
|
67
|
-
2. You call the \`askQuestion\` function, which
|
|
69
|
+
2. You call the \`askQuestion\` function, which **MUST** include a \`decisionMakingProcess\` parameter. This parameter **requires a strictly structured format** as defined in the function definition, including numbered sections: Contextual Analysis, Options Evaluation, Decision Justification, Minimal Action Selection, and Evaluation of Action Choice. **Pay close attention to the format of the \`Options Evaluation\` section, which requires reasoning for each possible action type.**
|
|
68
70
|
3. You receive conversation history with the askQuestion function call added.
|
|
69
71
|
4. You can call the action handler based on the action type.
|
|
70
72
|
5. User will receive the response from the action handler.
|
|
@@ -73,6 +75,8 @@ Example use cases of action types:
|
|
|
73
75
|
|
|
74
76
|
- Have a conversation with the user, provide direct answers to questions, share immediate observations **based on direct inspection**, provide feedback etc. -> **sendMessage**
|
|
75
77
|
- Need access to some files contents, which exist in the project, but content was not provided for them (have only summary, content is null) -> **requestFilesContent**
|
|
78
|
+
- Need to access the *content* of a specific configuration file outside the project, like \`/etc/hosts\` or a specific log file -> **readExternalFiles**
|
|
79
|
+
- Need to get a *list of files* in an external directory like \`/var/log\` to understand available log files before reading their content, or to find files based on certain criteria within a directory -> **exploreExternalDirectories**
|
|
76
80
|
- Small change in one file that exists already is needed, and conversation should continue -> **updateFile**
|
|
77
81
|
- You want to create one new file during the conversation, and then continue the conversation -> **createFile**
|
|
78
82
|
- The conclusion of the conversation is to perform an implementation -> **confirmCodeGeneration**
|
|
@@ -87,7 +91,8 @@ Example use cases of action types:
|
|
|
87
91
|
- End the conversation -> **endConversation**
|
|
88
92
|
- The user needs help with GenAIcode itself, encountered a problem, or needs guidance -> **genaicodeHelp**
|
|
89
93
|
- Perform inference on a AI model with reasoning capabilities -> **reasoningInference**
|
|
90
|
-
-
|
|
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
|
+
${gitContextEnabled ? '- Need to access Git information such as commit history, file changes, or blame data to understand code evolution or authorship -> **requestGitContext**' : ''}
|
|
91
96
|
|
|
92
97
|
### Efficient File Content Requests
|
|
93
98
|
|
|
@@ -128,7 +133,7 @@ It is ** VERY IMPORTANT ** to follow the conversation flow to ensure a smooth an
|
|
|
128
133
|
- When writing content of \`message\` parameter in the \`askQuestion\` function, always direct it to the user, not to the assistant. For example, instead of "User is asking for...", use "You are asking for...".
|
|
129
134
|
- Try to tell the user what is going to happen next, what they should expect, and what they should do next. For example, "I will now generate the code changes summary. Please confirm if you are ready to proceed.".
|
|
130
135
|
- Do not refer to \`actionType\` parameter name or values in the message content. For example, instead of "I will now generate the code changes summary. Please confirm if you are ready to proceed with actionType: confirmCodeGeneration.", use "I will now generate the code changes summary. Please confirm if you are ready to proceed.".
|
|
131
|
-
-
|
|
136
|
+
- **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.
|
|
132
137
|
- 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.
|
|
133
138
|
- 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.
|
|
134
139
|
|
|
@@ -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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AAE,CAAC;IAC/F,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC5B,CAAC;IAED,uBAAuB,CAAC,YAAY,CAAC,CAAC;IAEtC,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "genaicode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"author": "Grzegorz Tańczyk",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@vitejs/plugin-react": "^4.3.4",
|
|
70
70
|
"@vitest/coverage-v8": "^3.0.7",
|
|
71
71
|
"@vitest/ui": "^3.0.7",
|
|
72
|
-
"axios": "^1.
|
|
72
|
+
"axios": "^1.8.2",
|
|
73
73
|
"eslint": "^8.54.0",
|
|
74
74
|
"eslint-config-prettier": "^9.0.0",
|
|
75
75
|
"eslint-plugin-import": "^2.29.0",
|
|
@@ -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.2.
|
|
86
|
+
"vite": "^6.2.6",
|
|
87
87
|
"vite-plugin-checker": "^0.8.0",
|
|
88
88
|
"vitest": "^3.0.7"
|
|
89
89
|
},
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"find-cache-dir": "^5.0.0",
|
|
107
107
|
"glob-regex": "^0.3.2",
|
|
108
108
|
"helmet": "^7.1.0",
|
|
109
|
-
"image-size": "^1.
|
|
109
|
+
"image-size": "^1.2.1",
|
|
110
110
|
"inquirer-file-selector": "^0.4.0",
|
|
111
111
|
"jsonschema": "^1.4.1",
|
|
112
112
|
"mime-types": "^2.1.35",
|
|
@@ -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": {
|