genaicode 0.8.1 → 0.8.3
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 -1
- package/dist/ai-service/ai-studio.d.ts.map +1 -0
- package/dist/ai-service/ai-studio.js +9 -9
- package/dist/ai-service/ai-studio.js.map +1 -1
- package/dist/ai-service/anthropic.d.ts.map +1 -0
- package/dist/ai-service/anthropic.js +171 -162
- package/dist/ai-service/anthropic.js.map +1 -1
- package/dist/ai-service/chat-gpt.d.ts.map +1 -0
- package/dist/ai-service/chat-gpt.js +16 -8
- package/dist/ai-service/chat-gpt.js.map +1 -1
- package/dist/ai-service/common.d.ts.map +1 -0
- package/dist/ai-service/dall-e.d.ts.map +1 -0
- package/dist/ai-service/service-configurations.d.ts +30 -0
- package/dist/ai-service/service-configurations.js +116 -0
- package/dist/ai-service/service-configurations.js.map +1 -0
- package/dist/ai-service/unescape-function-call.d.ts.map +1 -0
- package/dist/ai-service/vertex-ai-claude.d.ts.map +1 -0
- package/dist/ai-service/vertex-ai-claude.js +9 -10
- package/dist/ai-service/vertex-ai-claude.js.map +1 -1
- package/dist/ai-service/vertex-ai-imagen.d.ts.map +1 -0
- package/dist/ai-service/vertex-ai.d.ts.map +1 -0
- package/dist/ai-service/vertex-ai.js +161 -146
- package/dist/ai-service/vertex-ai.js.map +1 -1
- package/dist/cli/cli-options.d.ts.map +1 -0
- package/dist/cli/cli-options.js +0 -4
- package/dist/cli/cli-options.js.map +1 -1
- package/dist/cli/cli-params.d.ts +0 -1
- package/dist/cli/cli-params.d.ts.map +1 -0
- package/dist/cli/cli-params.js +0 -1
- package/dist/cli/cli-params.js.map +1 -1
- package/dist/cli/service-autodetect.d.ts.map +1 -0
- package/dist/cli/validate-cli-params.d.ts.map +1 -0
- package/dist/cli/validate-cli-params.js +0 -1
- package/dist/cli/validate-cli-params.js.map +1 -1
- package/dist/eval/data/current-prompt.d.ts +93 -0
- package/dist/eval/data/current-prompt.js +239 -29
- package/dist/eval/data/current-prompt.js.map +1 -1
- package/dist/eval/prompt-debug.test.js +20 -3
- package/dist/eval/prompt-debug.test.js.map +1 -1
- package/dist/files/cache-file.d.ts.map +1 -0
- package/dist/files/file-utils.d.ts.map +1 -0
- package/dist/files/find-files.d.ts.map +1 -0
- package/dist/files/path-utils.d.ts.map +1 -0
- package/dist/files/read-files.d.ts.map +1 -0
- package/dist/files/search-files.d.ts +53 -0
- package/dist/files/search-files.d.ts.map +1 -0
- package/dist/files/search-files.js +97 -0
- package/dist/files/search-files.js.map +1 -0
- package/dist/files/source-code-tree.d.ts.map +1 -0
- package/dist/files/temp-buffer.d.ts.map +1 -0
- package/dist/files/update-files.d.ts.map +1 -0
- package/dist/images/ensure-alpha.d.ts.map +1 -0
- package/dist/images/imgly-remove-background.d.ts.map +1 -0
- package/dist/images/resize-image.d.ts.map +1 -0
- package/dist/images/split-image.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/main/codegen-non-interactive.d.ts +2 -0
- package/dist/main/codegen-non-interactive.d.ts.map +1 -0
- package/dist/main/codegen-non-interactive.js +20 -0
- package/dist/main/codegen-non-interactive.js.map +1 -0
- package/dist/main/codegen-types.d.ts +5 -2
- package/dist/main/codegen-types.d.ts.map +1 -0
- package/dist/main/codegen-utils.d.ts.map +1 -0
- package/dist/main/codegen.d.ts +4 -2
- package/dist/main/codegen.d.ts.map +1 -0
- package/dist/main/codegen.js +6 -85
- package/dist/main/codegen.js.map +1 -1
- package/dist/main/codegen.test-utils.d.ts +0 -1
- package/dist/main/codegen.test-utils.d.ts.map +1 -0
- package/dist/main/codegen.test-utils.js +0 -1
- package/dist/main/codegen.test-utils.js.map +1 -1
- package/dist/main/common/content-bus-types.d.ts +4 -1
- package/dist/main/common/content-bus-types.d.ts.map +1 -0
- package/dist/main/common/content-bus-types.js +1 -0
- package/dist/main/common/content-bus-types.js.map +1 -1
- package/dist/main/common/content-bus.d.ts +3 -1
- package/dist/main/common/content-bus.d.ts.map +1 -0
- package/dist/main/common/content-bus.js +16 -2
- package/dist/main/common/content-bus.js.map +1 -1
- package/dist/main/common/cost-collector.d.ts.map +1 -0
- package/dist/main/common/user-actions.d.ts.map +1 -0
- package/dist/main/config-lib.d.ts.map +1 -0
- package/dist/main/config.d.ts.map +1 -0
- package/dist/main/interactive/codegen-interactive.d.ts.map +1 -0
- package/dist/main/interactive/codegen-worker.d.ts.map +1 -0
- package/dist/main/interactive/common.d.ts.map +1 -0
- package/dist/main/interactive/configure.d.ts.map +1 -0
- package/dist/main/interactive/configure.js +0 -2
- package/dist/main/interactive/configure.js.map +1 -1
- package/dist/main/interactive/error-handling.d.ts.map +1 -0
- package/dist/main/interactive/help.d.ts.map +1 -0
- package/dist/main/interactive/select-ai-service.d.ts.map +1 -0
- package/dist/main/interactive/task-file.d.ts.map +1 -0
- package/dist/main/interactive/text-prompt.d.ts.map +1 -0
- package/dist/main/interactive/user-action-handlers.d.ts.map +1 -0
- package/dist/main/interactive/user-interrupt.d.ts.map +1 -0
- package/dist/main/plugin-loader.d.ts +5 -1
- package/dist/main/plugin-loader.d.ts.map +1 -0
- package/dist/main/plugin-loader.js.map +1 -1
- package/dist/main/ui/backend/api-utils.d.ts.map +1 -0
- package/dist/main/ui/backend/api.d.ts.map +1 -0
- package/dist/main/ui/backend/api.js +114 -0
- package/dist/main/ui/backend/api.js.map +1 -1
- package/dist/main/ui/backend/server.d.ts.map +1 -0
- package/dist/main/ui/backend/service.d.ts +23 -0
- package/dist/main/ui/backend/service.d.ts.map +1 -0
- package/dist/main/ui/backend/service.js +81 -2
- package/dist/main/ui/backend/service.js.map +1 -1
- package/dist/main/ui/codegen-ui.d.ts.map +1 -0
- package/dist/main/ui/common/api-types.d.ts +96 -0
- package/dist/main/ui/common/api-types.d.ts.map +1 -0
- package/dist/main/ui/frontend/assets/index-jwSqt8cG.js +1337 -0
- package/dist/main/ui/frontend/index.html +1 -1
- package/dist/main/ui/user-action-handlers.d.ts.map +1 -0
- package/dist/operations/create-directory/create-directory-def.d.ts.map +1 -0
- package/dist/operations/create-directory/create-directory-executor.d.ts.map +1 -0
- package/dist/operations/create-file/create-file-def.d.ts.map +1 -0
- package/dist/operations/create-file/create-file-def.js +3 -1
- package/dist/operations/create-file/create-file-def.js.map +1 -1
- package/dist/operations/create-file/create-file-executor.d.ts.map +1 -0
- package/dist/operations/delete-file/delete-file-def.d.ts.map +1 -0
- package/dist/operations/delete-file/delete-file-executor.d.ts.map +1 -0
- package/dist/operations/download-file/download-file-def.d.ts.map +1 -0
- package/dist/operations/download-file/download-file-executor.d.ts.map +1 -0
- package/dist/operations/imgly-remove-background/imgly-remove-background-def.d.ts.map +1 -0
- package/dist/operations/imgly-remove-background/imgly-remove-background-executor.d.ts.map +1 -0
- package/dist/operations/move-file/move-file-def.d.ts.map +1 -0
- package/dist/operations/move-file/move-file-executor.d.ts.map +1 -0
- package/dist/operations/operations-index.d.ts.map +1 -0
- package/dist/operations/patch-file/patch-file-def.d.ts.map +1 -0
- package/dist/operations/patch-file/patch-file-executor.d.ts.map +1 -0
- package/dist/operations/resize-image/resize-image-def.d.ts.map +1 -0
- package/dist/operations/resize-image/resize-image-executor.d.ts.map +1 -0
- package/dist/operations/split-image/split-image-def.d.ts.map +1 -0
- package/dist/operations/split-image/split-image-executor.d.ts.map +1 -0
- package/dist/operations/update-file/update-file-def.d.ts.map +1 -0
- package/dist/operations/update-file/update-file-executor.d.ts.map +1 -0
- package/dist/project-profiles/detection.d.ts.map +1 -0
- package/dist/project-profiles/index.d.ts.map +1 -0
- package/dist/project-profiles/profiles/golang.d.ts.map +1 -0
- package/dist/project-profiles/profiles/java-maven.d.ts.map +1 -0
- package/dist/project-profiles/profiles/javascript-npm.d.ts.map +1 -0
- package/dist/project-profiles/profiles/javascript-react.d.ts.map +1 -0
- package/dist/project-profiles/profiles/python-django.d.ts.map +1 -0
- package/dist/project-profiles/types.d.ts.map +1 -0
- package/dist/prompt/ai-service-fallback.d.ts.map +1 -0
- package/dist/prompt/function-calling-validate.d.ts.map +1 -0
- package/dist/prompt/function-calling.d.ts.map +1 -0
- package/dist/prompt/function-calling.js +2 -1
- package/dist/prompt/function-calling.js.map +1 -1
- package/dist/prompt/function-defs/ask-question.d.ts +2 -1
- package/dist/prompt/function-defs/ask-question.d.ts.map +1 -0
- package/dist/prompt/function-defs/ask-question.js +50 -0
- package/dist/prompt/function-defs/ask-question.js.map +1 -1
- package/dist/prompt/function-defs/codegen-planning.d.ts.map +1 -0
- package/dist/prompt/function-defs/codegen-summary.d.ts.map +1 -0
- package/dist/prompt/function-defs/codegen-summary.js +6 -6
- package/dist/prompt/function-defs/codegen-summary.js.map +1 -1
- package/dist/prompt/function-defs/explanation.d.ts.map +1 -0
- package/dist/prompt/function-defs/generate-image.d.ts.map +1 -0
- package/dist/prompt/function-defs/get-image-assets.d.ts.map +1 -0
- package/dist/prompt/function-defs/get-source-code.d.ts.map +1 -0
- package/dist/prompt/function-defs/optimize-context.d.ts.map +1 -0
- package/dist/prompt/function-defs/optimize-context.js +14 -10
- package/dist/prompt/function-defs/optimize-context.js.map +1 -1
- package/dist/prompt/function-defs/read-history.d.ts.map +1 -0
- package/dist/prompt/function-defs/set-summaries.d.ts.map +1 -0
- package/dist/prompt/function-defs/update-history.d.ts.map +1 -0
- package/dist/prompt/limits.d.ts.map +1 -0
- package/dist/prompt/prompt-codegen.d.ts.map +1 -0
- package/dist/prompt/prompt-service.d.ts.map +1 -0
- package/dist/prompt/prompt-service.js +24 -9
- package/dist/prompt/prompt-service.js.map +1 -1
- package/dist/prompt/prompt-service.test-utils.d.ts.map +1 -0
- package/dist/prompt/static-prompts.d.ts +1 -1
- package/dist/prompt/static-prompts.d.ts.map +1 -0
- package/dist/prompt/static-prompts.js +1 -1
- package/dist/prompt/static-prompts.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/code-generation.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/code-generation.js +98 -22
- package/dist/prompt/steps/step-ask-question/handlers/code-generation.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/context-optimization.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/default-action.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.d.ts +5 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.js +87 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/lint.d.ts +6 -0
- package/dist/prompt/steps/step-ask-question/handlers/lint.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/lint.js +83 -0
- package/dist/prompt/steps/step-ask-question/handlers/lint.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/request-files-content.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js +25 -9
- 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.map +1 -0
- package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts +30 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/step-ask-question.d.ts.map +1 -0
- package/dist/prompt/steps/step-ask-question/step-ask-question.js +9 -2
- package/dist/prompt/steps/step-ask-question/step-ask-question.js.map +1 -1
- package/dist/prompt/steps/step-codegen-planning.d.ts.map +1 -0
- package/dist/prompt/steps/step-codegen-planning.js +8 -2
- package/dist/prompt/steps/step-codegen-planning.js.map +1 -1
- package/dist/prompt/steps/step-codegen-summary.d.ts.map +1 -0
- package/dist/prompt/steps/step-codegen-summary.js.map +1 -1
- package/dist/prompt/steps/step-context-optimization.d.ts.map +1 -0
- package/dist/prompt/steps/step-context-optimization.js +2 -0
- package/dist/prompt/steps/step-context-optimization.js.map +1 -1
- package/dist/prompt/steps/step-ensure-context.d.ts +1 -1
- package/dist/prompt/steps/step-ensure-context.d.ts.map +1 -0
- package/dist/prompt/steps/step-ensure-context.js +29 -15
- package/dist/prompt/steps/step-ensure-context.js.map +1 -1
- package/dist/prompt/steps/step-ensure-context.test.js +94 -10
- package/dist/prompt/steps/step-ensure-context.test.js.map +1 -1
- package/dist/prompt/steps/step-generate-codegen-summary.d.ts +11 -0
- package/dist/prompt/steps/step-generate-codegen-summary.js +51 -0
- package/dist/prompt/steps/step-generate-codegen-summary.js.map +1 -0
- package/dist/prompt/steps/step-generate-image.d.ts.map +1 -0
- package/dist/prompt/steps/step-generate-summary.d.ts.map +1 -0
- package/dist/prompt/steps/step-history-update.d.ts.map +1 -0
- package/dist/prompt/steps/step-process-file-updates.d.ts +8 -0
- package/dist/prompt/steps/step-process-file-updates.js +71 -0
- package/dist/prompt/steps/step-process-file-updates.js.map +1 -0
- package/dist/prompt/steps/step-summarization.d.ts.map +1 -0
- package/dist/prompt/steps/step-validate-recover.d.ts.map +1 -0
- package/dist/prompt/steps/step-verify-patch.d.ts +2 -1
- package/dist/prompt/steps/step-verify-patch.d.ts.map +1 -0
- package/dist/prompt/steps/step-verify-patch.js +2 -2
- package/dist/prompt/steps/step-verify-patch.js.map +1 -1
- package/dist/prompt/steps/steps-types.d.ts.map +1 -0
- package/dist/prompt/steps/steps-utils.d.ts.map +1 -0
- package/dist/prompt/systemprompt.d.ts.map +1 -0
- package/dist/prompt/token-estimator.d.ts.map +1 -0
- package/dist/vite-genaicode/vite-genaicode-frontend.d.ts.map +1 -0
- package/dist/vite-genaicode/vite-genaicode-plugin.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/main/ui/frontend/assets/index-QOcNx5ac.js +0 -812
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import mime from 'mime-types';
|
|
3
|
+
import { validateAndRecoverSingleResult } from './step-validate-recover.js';
|
|
4
|
+
import { putSystemMessage } from '../../main/common/content-bus.js';
|
|
5
|
+
import { executeStepGenerateImage } from './step-generate-image.js';
|
|
6
|
+
import { executeStepVerifyPatch } from './step-verify-patch.js';
|
|
7
|
+
import { getPartialPromptTemplate } from '../static-prompts.js';
|
|
8
|
+
/**
|
|
9
|
+
* Processes file updates from the codegen summary.
|
|
10
|
+
* This is the second part of the original executeStepCodegenSummary function.
|
|
11
|
+
* It handles processing individual file updates, image generation, and patch verification.
|
|
12
|
+
*/
|
|
13
|
+
export async function processFileUpdates(generateContentFn, prompt, functionDefs, options, codegenSummaryRequest, waitIfPaused = () => Promise.resolve(), generateImageFn) {
|
|
14
|
+
const result = [];
|
|
15
|
+
if (!Array.isArray(codegenSummaryRequest.args?.fileUpdates)) {
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
for (const file of codegenSummaryRequest.args.fileUpdates) {
|
|
19
|
+
putSystemMessage('Collecting partial update for: ' + file.filePath + ' using tool: ' + file.updateToolName, file);
|
|
20
|
+
// Check if execution is paused before proceeding
|
|
21
|
+
await waitIfPaused();
|
|
22
|
+
// this is needed, otherwise we will get an error
|
|
23
|
+
if (prompt.slice(-1)[0].type === 'user') {
|
|
24
|
+
prompt.slice(-1)[0].text = file.prompt ?? getPartialPromptTemplate(file.filePath);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
prompt.push({ type: 'user', text: file.prompt ?? getPartialPromptTemplate(file.filePath) });
|
|
28
|
+
}
|
|
29
|
+
if (options.vision && file.contextImageAssets) {
|
|
30
|
+
prompt.slice(-1)[0].images = file.contextImageAssets.map((path) => ({
|
|
31
|
+
path,
|
|
32
|
+
base64url: fs.readFileSync(path, 'base64'),
|
|
33
|
+
mediaType: mime.lookup(path) || '',
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
const partialRequest = [
|
|
37
|
+
prompt,
|
|
38
|
+
functionDefs,
|
|
39
|
+
file.updateToolName,
|
|
40
|
+
file.temperature ?? options.temperature,
|
|
41
|
+
file.cheap === true,
|
|
42
|
+
options,
|
|
43
|
+
];
|
|
44
|
+
let partialResult = await generateContentFn(...partialRequest);
|
|
45
|
+
// Validate if function call is compliant with the schema
|
|
46
|
+
partialResult = await validateAndRecoverSingleResult(partialRequest, partialResult, generateContentFn);
|
|
47
|
+
putSystemMessage('Received partial update', partialResult);
|
|
48
|
+
// Handle image generation requests
|
|
49
|
+
const generateImageCall = partialResult.find((call) => call.name === 'generateImage');
|
|
50
|
+
if (generateImageCall && generateImageFn) {
|
|
51
|
+
partialResult.push(await executeStepGenerateImage(generateImageFn, generateImageCall));
|
|
52
|
+
}
|
|
53
|
+
else if (generateImageCall) {
|
|
54
|
+
console.warn('Image generation requested but generateImageFn not provided');
|
|
55
|
+
}
|
|
56
|
+
// Verify if patchFile is one of the functions called, and test if patch is valid and can be applied successfully
|
|
57
|
+
const patchFileCall = partialResult.find((call) => call.name === 'patchFile');
|
|
58
|
+
if (patchFileCall) {
|
|
59
|
+
partialResult = await executeStepVerifyPatch(patchFileCall.args, generateContentFn, prompt, functionDefs, file.temperature ?? options.temperature, file.cheap === true, options);
|
|
60
|
+
}
|
|
61
|
+
// add the code gen result to the context, as the subsequent code gen may depend on the result
|
|
62
|
+
prompt.push({ type: 'assistant', functionCalls: partialResult }, {
|
|
63
|
+
type: 'user',
|
|
64
|
+
text: 'Update applied.',
|
|
65
|
+
functionResponses: partialResult.map((call) => ({ name: call.name, call_id: call.id })),
|
|
66
|
+
});
|
|
67
|
+
result.push(...partialResult);
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=step-process-file-updates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-process-file-updates.js","sourceRoot":"","sources":["../../../src/prompt/steps/step-process-file-updates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,YAAY,CAAC;AAS9B,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,iBAA0C,EAC1C,MAAoB,EACpB,YAA2B,EAC3B,OAAuB,EACvB,qBAAmC,EACnC,eAAoC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAC3D,eAAuC;IAEvC,MAAM,MAAM,GAAmB,EAAE,CAAC;IAElC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC;QAC5D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1D,gBAAgB,CAAC,iCAAiC,GAAG,IAAI,CAAC,QAAQ,GAAG,eAAe,GAAG,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QAElH,iDAAiD;QACjD,MAAM,YAAY,EAAE,CAAC;QAErB,iDAAiD;QACjD,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACxC,MAAM,CAAC,KAAK,CAAC,CAAC,CA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AuB,EAAiD,MAAM,4BAA4B,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAiD1E,wBAAsB,mBAAmB,CACvC,iBAAiB,EAAE,uBAAuB,EAC1C,UAAU,EAAE,aAAa,EACzB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC,CAQf;AAsED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM;;;cAQ1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-validate-recover.d.ts","sourceRoot":"","sources":["../../../src/prompt/steps/step-validate-recover.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGxG,wBAAsB,8BAA8B,CAClD,CAAC,MAAM,EAAE,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,mBAAmB,EAC9F,MAAM,EAAE,YAAY,EAAE,EACtB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,YAAY,EAAE,CAAC,CA2DzB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PromptItem, FunctionDef, FunctionCall, GenerateContentFunction } from '../../ai-service/common.js';
|
|
2
2
|
import { CodegenOptions } from '../../main/codegen-types.js';
|
|
3
|
-
export declare function executeStepVerifyPatch({ filePath, patch }: {
|
|
3
|
+
export declare function executeStepVerifyPatch({ filePath, patch, explanation }: {
|
|
4
4
|
filePath: string;
|
|
5
5
|
patch: string;
|
|
6
|
+
explanation: string;
|
|
6
7
|
}, generateContentFn: GenerateContentFunction, prompt: PromptItem[], functionDefs: FunctionDef[], temperature: number, cheap: boolean, options: CodegenOptions): Promise<FunctionCall[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-verify-patch.d.ts","sourceRoot":"","sources":["../../../src/prompt/steps/step-verify-patch.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,uBAAuB,EAExB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,wBAAsB,sBAAsB,CAC1C,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACxD,iBAAiB,EAAE,uBAAuB,EAC1C,MAAM,EAAE,UAAU,EAAE,EACpB,YAAY,EAAE,WAAW,EAAE,EAC3B,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,YAAY,EAAE,CAAC,CAkCzB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import * as diff from 'diff';
|
|
3
3
|
import { validateAndRecoverSingleResult } from './step-validate-recover.js';
|
|
4
|
-
export async function executeStepVerifyPatch({ filePath, patch }, generateContentFn, prompt, functionDefs, temperature, cheap, options) {
|
|
4
|
+
export async function executeStepVerifyPatch({ filePath, patch, explanation }, generateContentFn, prompt, functionDefs, temperature, cheap, options) {
|
|
5
5
|
console.log('Verification of patch for file:', filePath);
|
|
6
6
|
let updatedContent = false;
|
|
7
7
|
const currentContent = fs.readFileSync(filePath, 'utf-8');
|
|
@@ -28,7 +28,7 @@ export async function executeStepVerifyPatch({ filePath, patch }, generateConten
|
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
30
|
console.log('Patch verified successfully');
|
|
31
|
-
return [{ name: 'patchFile', args: { filePath, patch } }];
|
|
31
|
+
return [{ name: 'patchFile', args: { filePath, patch, explanation } }];
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
//# sourceMappingURL=step-verify-patch.js.map
|
|
@@ -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;AAQ7B,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAG5E,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,EAAE,QAAQ,EAAE,KAAK,
|
|
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;AAQ7B,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAG5E,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;QACtD,MAAM,cAAc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AAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAC/B,MAAM,EACN;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,cAAc,EAAE,CAAC;CAChC,CACF,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steps-utils.d.ts","sourceRoot":"","sources":["../../../src/prompt/steps/steps-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,EAAE;;;;;SAezD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemprompt.d.ts","sourceRoot":"","sources":["../../src/prompt/systemprompt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,wBAAgB,eAAe,CAAC,OAAO,EAAE,cAAc,UA0HtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-estimator.d.ts","sourceRoot":"","sources":["../../src/prompt/token-estimator.ts"],"names":[],"mappings":"AAOA,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAkBxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-genaicode-frontend.d.ts","sourceRoot":"","sources":["../../src/vite-genaicode/vite-genaicode-frontend.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-genaicode-plugin.d.ts","sourceRoot":"","sources":["../../src/vite-genaicode/vite-genaicode-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAIrC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAS1D,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;;4BAqC3C,aAAa;6BAMZ,MAAM;kBAOjB,MAAM;EAMvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "genaicode",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"author": "Grzegorz Tańczyk",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"coverage": "vitest run --coverage",
|
|
48
48
|
"prepare": "husky install || true",
|
|
49
49
|
"type-check": "tsc --noEmit",
|
|
50
|
-
"build": "tsc && npm run build-frontend",
|
|
50
|
+
"build": "tsc -p tsconfig.build.json && npm run build-frontend",
|
|
51
51
|
"build-frontend": "vite build src/main/ui/frontend",
|
|
52
52
|
"prepublishOnly": "npm run build"
|
|
53
53
|
},
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"@types/styled-components": "^5.1.34",
|
|
96
96
|
"cors": "^2.8.5",
|
|
97
97
|
"diff": "^5.2.0",
|
|
98
|
-
"express": "^4.21.
|
|
98
|
+
"express": "^4.21.2",
|
|
99
99
|
"find-cache-dir": "^5.0.0",
|
|
100
100
|
"glob-regex": "^0.3.2",
|
|
101
101
|
"helmet": "^7.1.0",
|