genaicode 0.8.6 → 0.9.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/dist/ai-service/ai-studio.d.ts +2 -3
- package/dist/ai-service/ai-studio.js +55 -27
- package/dist/ai-service/ai-studio.js.map +1 -1
- package/dist/ai-service/anthropic.d.ts +2 -3
- package/dist/ai-service/anthropic.js +24 -8
- package/dist/ai-service/anthropic.js.map +1 -1
- package/dist/{src/ai-service/common.d.ts → ai-service/common-types.d.ts} +24 -26
- package/dist/ai-service/common-types.js +10 -0
- package/dist/ai-service/common-types.js.map +1 -0
- package/dist/ai-service/common.d.ts +3 -55
- package/dist/ai-service/common.js +16 -4
- package/dist/ai-service/common.js.map +1 -1
- package/dist/ai-service/dall-e.d.ts +2 -9
- package/dist/ai-service/dall-e.js +4 -11
- package/dist/ai-service/dall-e.js.map +1 -1
- package/dist/ai-service/openai.d.ts +15 -4
- package/dist/ai-service/openai.js +45 -20
- package/dist/ai-service/openai.js.map +1 -1
- package/dist/ai-service/service-configurations-types.d.ts +55 -0
- package/dist/ai-service/service-configurations-types.js +6 -0
- package/dist/ai-service/service-configurations-types.js.map +1 -0
- package/dist/ai-service/service-configurations.d.ts +3 -2
- package/dist/ai-service/service-configurations.js +5 -0
- package/dist/ai-service/service-configurations.js.map +1 -1
- package/dist/ai-service/unescape-function-call.d.ts +1 -1
- package/dist/ai-service/vertex-ai-claude.d.ts +2 -2
- package/dist/ai-service/vertex-ai-claude.js +22 -8
- package/dist/ai-service/vertex-ai-claude.js.map +1 -1
- package/dist/ai-service/vertex-ai-imagen.d.ts +2 -9
- package/dist/ai-service/vertex-ai-imagen.js +4 -11
- package/dist/ai-service/vertex-ai-imagen.js.map +1 -1
- package/dist/ai-service/vertex-ai.d.ts +2 -3
- package/dist/ai-service/vertex-ai.js +17 -12
- package/dist/ai-service/vertex-ai.js.map +1 -1
- package/dist/cli/cli-params.d.ts +1 -1
- package/dist/cli/cli-params.js +1 -1
- package/dist/cli/cli-params.js.map +1 -1
- package/dist/files/read-files.d.ts +1 -28
- package/dist/files/read-files.js +1 -1
- package/dist/files/read-files.js.map +1 -1
- package/dist/files/source-code-tree.d.ts +3 -1
- package/dist/files/source-code-tree.js.map +1 -1
- package/dist/files/source-code-types.d.ts +26 -0
- package/dist/files/source-code-types.js +2 -0
- package/dist/files/source-code-types.js.map +1 -0
- package/dist/files/summary-cache.d.ts +20 -0
- package/dist/files/summary-cache.js +15 -0
- package/dist/files/summary-cache.js.map +1 -0
- package/dist/files/update-files.d.ts +1 -1
- package/dist/help-docs/genaicode-help-document.d.ts +1 -0
- package/dist/help-docs/genaicode-help-document.js +286 -0
- package/dist/help-docs/genaicode-help-document.js.map +1 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/main/codegen-types.d.ts +12 -10
- package/dist/main/codegen-utils.d.ts +1 -1
- package/dist/main/codegen.d.ts +4 -3
- package/dist/main/codegen.js.map +1 -1
- package/dist/main/codegen.test-utils.d.ts +1 -1
- package/dist/main/common/abort-controller.d.ts +2 -0
- package/dist/main/common/abort-controller.js +5 -0
- package/dist/main/common/abort-controller.js.map +1 -0
- package/dist/main/common/app-context-bus.d.ts +11 -0
- package/dist/main/common/app-context-bus.js +29 -0
- package/dist/main/common/app-context-bus.js.map +1 -0
- package/dist/main/common/content-bus-types.d.ts +1 -1
- package/dist/main/common/content-bus.d.ts +1 -1
- package/dist/main/common/cost-collector.d.ts +3 -2
- package/dist/main/common/cost-collector.js +3 -3
- package/dist/main/common/cost-collector.js.map +1 -1
- package/dist/main/common/user-actions.d.ts +3 -3
- package/dist/main/common/user-actions.js +17 -8
- package/dist/main/common/user-actions.js.map +1 -1
- package/dist/main/config-schema.js +10 -0
- package/dist/main/config-schema.js.map +1 -1
- package/dist/main/config-types.d.ts +22 -16
- package/dist/main/interactive/codegen-worker.d.ts +0 -1
- package/dist/main/interactive/codegen-worker.js +4 -3
- package/dist/main/interactive/codegen-worker.js.map +1 -1
- package/dist/main/interactive/select-ai-service.d.ts +1 -1
- package/dist/main/plugin-loader.d.ts +5 -3
- package/dist/main/plugin-loader.js.map +1 -1
- package/dist/main/ui/backend/endpoints/context-endpoint.js +67 -0
- package/dist/main/ui/backend/endpoints/context-endpoint.js.map +1 -0
- package/dist/main/ui/backend/endpoints/generate-content-endpoint.js +2 -1
- package/dist/main/ui/backend/endpoints/generate-content-endpoint.js.map +1 -1
- package/dist/main/ui/backend/endpoints/index.d.ts +1 -0
- package/dist/main/ui/backend/endpoints/index.js +1 -0
- package/dist/main/ui/backend/endpoints/index.js.map +1 -1
- package/dist/main/ui/backend/server.d.ts +2 -1
- package/dist/main/ui/backend/server.js +2 -1
- package/dist/main/ui/backend/server.js.map +1 -1
- package/dist/main/ui/backend/service.d.ts +29 -4
- package/dist/main/ui/backend/service.js +41 -3
- package/dist/main/ui/backend/service.js.map +1 -1
- package/dist/main/ui/codegen-ui.d.ts +5 -1
- package/dist/main/ui/codegen-ui.js +10 -1
- package/dist/main/ui/codegen-ui.js.map +1 -1
- package/dist/main/ui/common/api-types.d.ts +4 -51
- package/dist/main/ui/frontend/assets/favicon-DvroFOpS.png +0 -0
- package/dist/main/ui/frontend/assets/index-DfiFNFf2.js +1771 -0
- package/dist/main/ui/frontend/assets/wolf-bark-Bl17CX4O.mp3 +0 -0
- package/dist/main/ui/frontend/index.html +2 -2
- package/dist/operations/create-directory/create-directory-def.d.ts +1 -1
- package/dist/operations/create-file/create-file-def.d.ts +1 -1
- package/dist/operations/create-file/create-file-def.js +2 -1
- package/dist/operations/create-file/create-file-def.js.map +1 -1
- package/dist/operations/delete-file/delete-file-def.d.ts +1 -1
- package/dist/operations/download-file/download-file-def.d.ts +1 -1
- package/dist/operations/imgly-remove-background/imgly-remove-background-def.d.ts +1 -1
- package/dist/operations/move-file/move-file-def.d.ts +1 -1
- package/dist/operations/patch-file/patch-file-def.d.ts +1 -1
- package/dist/operations/patch-file/patch-file-def.js +2 -1
- package/dist/operations/patch-file/patch-file-def.js.map +1 -1
- package/dist/operations/resize-image/resize-image-def.d.ts +1 -1
- package/dist/operations/split-image/split-image-def.d.ts +1 -1
- package/dist/operations/update-file/update-file-def.d.ts +1 -1
- package/dist/operations/update-file/update-file-def.js +2 -1
- package/dist/operations/update-file/update-file-def.js.map +1 -1
- package/dist/prompt/ai-service-fallback.d.ts +4 -3
- package/dist/prompt/ai-service-fallback.js +10 -58
- package/dist/prompt/ai-service-fallback.js.map +1 -1
- package/dist/prompt/function-calling-validate.d.ts +2 -2
- package/dist/prompt/function-calling-validate.js +4 -5
- package/dist/prompt/function-calling-validate.js.map +1 -1
- package/dist/prompt/function-calling.d.ts +1 -1
- package/dist/prompt/function-calling.js +12 -2
- package/dist/prompt/function-calling.js.map +1 -1
- package/dist/prompt/function-defs/analysis-result.d.ts +7 -0
- package/dist/prompt/function-defs/analysis-result.js +24 -0
- package/dist/prompt/function-defs/analysis-result.js.map +1 -0
- package/dist/prompt/function-defs/ask-question.d.ts +3 -2
- package/dist/prompt/function-defs/ask-question.js +93 -81
- package/dist/prompt/function-defs/ask-question.js.map +1 -1
- package/dist/prompt/function-defs/codegen-planning.d.ts +1 -1
- package/dist/prompt/function-defs/codegen-planning.js +11 -1
- package/dist/prompt/function-defs/codegen-planning.js.map +1 -1
- package/dist/prompt/function-defs/codegen-summary.d.ts +1 -1
- package/dist/prompt/function-defs/codegen-summary.js +19 -10
- package/dist/prompt/function-defs/codegen-summary.js.map +1 -1
- package/dist/prompt/function-defs/explanation.d.ts +1 -1
- package/dist/prompt/function-defs/genaicode-help.d.ts +6 -0
- package/dist/prompt/function-defs/genaicode-help.js +23 -0
- package/dist/prompt/function-defs/genaicode-help.js.map +1 -0
- package/dist/prompt/function-defs/generate-image.d.ts +1 -1
- package/dist/prompt/function-defs/get-image-assets.d.ts +1 -1
- package/dist/prompt/function-defs/get-source-code.d.ts +1 -1
- package/dist/prompt/function-defs/optimize-context.d.ts +1 -1
- package/dist/prompt/function-defs/optimize-context.js +1 -1
- package/dist/prompt/function-defs/optimize-context.js.map +1 -1
- package/dist/prompt/function-defs/perform-analysis.d.ts +8 -0
- package/dist/prompt/function-defs/perform-analysis.js +28 -0
- package/dist/prompt/function-defs/perform-analysis.js.map +1 -0
- package/dist/prompt/function-defs/read-history.d.ts +1 -1
- package/dist/prompt/function-defs/reasoning-inference.d.ts +3 -0
- package/dist/prompt/function-defs/reasoning-inference.js +39 -0
- package/dist/prompt/function-defs/reasoning-inference.js.map +1 -0
- package/dist/prompt/function-defs/set-summaries.d.ts +1 -1
- package/dist/prompt/function-defs/update-history.d.ts +1 -1
- package/dist/prompt/limits.js +1 -1
- package/dist/prompt/prompt-service.d.ts +5 -2
- package/dist/prompt/prompt-service.js +1 -2
- package/dist/prompt/prompt-service.js.map +1 -1
- package/dist/prompt/prompt-service.test-utils.d.ts +2 -2
- package/dist/prompt/prompt-service.test-utils.js +2 -1
- package/dist/prompt/prompt-service.test-utils.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 +11 -9
- 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.js +1 -5
- 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 +1 -5
- package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/genaicode-help-document.d.ts +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/genaicode-help-document.js +251 -0
- package/dist/prompt/steps/step-ask-question/handlers/genaicode-help-document.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.js +157 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-end-conversation.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/{cancel-code-generation.js → handle-end-conversation.js} +2 -2
- package/dist/prompt/steps/step-ask-question/handlers/handle-end-conversation.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.d.ts +8 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.js +91 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-generate-image.d.ts +2 -0
- package/dist/prompt/steps/step-ask-question/handlers/{handle-send-message-with-image.js → handle-generate-image.js} +28 -29
- package/dist/prompt/steps/step-ask-question/handlers/handle-generate-image.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.d.ts +6 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.js +99 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.d.ts +9 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.js +90 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.d.ts +9 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.js +91 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.d.ts +7 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.js +87 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.js +4 -4
- 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 -4
- 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 +92 -61
- package/dist/prompt/steps/step-ask-question/handlers/handle-update-file.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js +2 -1
- 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 +7 -1
- package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js +42 -42
- 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.js +3 -2
- package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js.map +1 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts +75 -6
- package/dist/prompt/steps/step-ask-question/step-ask-question.d.ts +5 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question.js +30 -13
- package/dist/prompt/steps/step-ask-question/step-ask-question.js.map +1 -1
- package/dist/prompt/steps/step-codegen-planning.d.ts +2 -1
- package/dist/prompt/steps/step-codegen-planning.js +2 -1
- package/dist/prompt/steps/step-codegen-planning.js.map +1 -1
- package/dist/prompt/steps/step-context-optimization.d.ts +2 -1
- package/dist/prompt/steps/step-context-optimization.js +5 -7
- 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.js +3 -0
- package/dist/prompt/steps/step-ensure-context.js.map +1 -1
- package/dist/prompt/steps/step-generate-codegen-summary-prompt.d.ts +2 -0
- package/dist/prompt/steps/step-generate-codegen-summary-prompt.js +133 -0
- package/dist/prompt/steps/step-generate-codegen-summary-prompt.js.map +1 -0
- package/dist/prompt/steps/step-generate-codegen-summary.d.ts +6 -3
- package/dist/prompt/steps/step-generate-codegen-summary.js +14 -2
- package/dist/prompt/steps/step-generate-codegen-summary.js.map +1 -1
- package/dist/prompt/steps/step-generate-image.d.ts +2 -1
- package/dist/prompt/steps/step-generate-image.js +4 -2
- package/dist/prompt/steps/step-generate-image.js.map +1 -1
- package/dist/prompt/steps/step-generate-summary.d.ts +2 -1
- package/dist/prompt/steps/step-generate-summary.js +3 -2
- package/dist/prompt/steps/step-generate-summary.js.map +1 -1
- package/dist/prompt/steps/step-history-update.d.ts +2 -1
- package/dist/prompt/steps/step-history-update.js +9 -1
- package/dist/prompt/steps/step-history-update.js.map +1 -1
- package/dist/prompt/steps/step-process-file-updates.d.ts +7 -3
- package/dist/prompt/steps/step-process-file-updates.js +9 -7
- package/dist/prompt/steps/step-process-file-updates.js.map +1 -1
- package/dist/prompt/steps/step-summarization.d.ts +2 -6
- package/dist/prompt/steps/step-summarization.js +11 -15
- package/dist/prompt/steps/step-summarization.js.map +1 -1
- package/dist/prompt/steps/step-validate-recover.d.ts +4 -2
- package/dist/prompt/steps/step-validate-recover.js +8 -6
- package/dist/prompt/steps/step-validate-recover.js.map +1 -1
- package/dist/prompt/steps/step-verify-patch.d.ts +4 -1
- package/dist/prompt/steps/step-verify-patch.js +15 -2
- package/dist/prompt/steps/step-verify-patch.js.map +1 -1
- package/dist/prompt/steps/steps-types.d.ts +0 -14
- package/dist/prompt/steps/steps-types.js.map +1 -1
- package/dist/prompt/steps/steps-utils.d.ts +1 -1
- package/dist/prompt/systemprompt.d.ts +1 -1
- package/dist/prompt/systemprompt.js +40 -11
- package/dist/prompt/systemprompt.js.map +1 -1
- package/dist/{eval → prompt-debug}/current-prompt-plugin.d.ts +1 -1
- package/dist/{eval → prompt-debug}/current-prompt-plugin.js +1 -1
- package/dist/prompt-debug/current-prompt-plugin.js.map +1 -0
- package/dist/vite-genaicode/vite-genaicode-context.d.ts +31 -0
- package/dist/vite-genaicode/vite-genaicode-context.js +120 -0
- package/dist/vite-genaicode/vite-genaicode-context.js.map +1 -0
- package/dist/vite-genaicode/vite-genaicode-frontend.js +206 -30
- package/dist/vite-genaicode/vite-genaicode-frontend.js.map +1 -1
- package/dist/vite-genaicode/vite-genaicode-plugin.d.ts +1 -0
- package/dist/vite-genaicode/vite-genaicode-plugin.js +22 -9
- package/dist/vite-genaicode/vite-genaicode-plugin.js.map +1 -1
- package/dist/vite-genaicode/vite-genaicode-types.d.ts +26 -0
- package/dist/vite-genaicode/vite-genaicode-types.js +11 -0
- package/dist/vite-genaicode/vite-genaicode-types.js.map +1 -0
- package/package.json +10 -3
- package/dist/ai-service/ai-studio.d.ts.map +0 -1
- package/dist/ai-service/anthropic.d.ts.map +0 -1
- package/dist/ai-service/chat-gpt.d.ts +0 -7
- package/dist/ai-service/chat-gpt.d.ts.map +0 -1
- package/dist/ai-service/chat-gpt.js +0 -174
- package/dist/ai-service/chat-gpt.js.map +0 -1
- package/dist/ai-service/common.d.ts.map +0 -1
- package/dist/ai-service/common.test.js +0 -86
- package/dist/ai-service/common.test.js.map +0 -1
- package/dist/ai-service/dall-e.d.ts.map +0 -1
- package/dist/ai-service/unescape-function-call.d.ts.map +0 -1
- package/dist/ai-service/unescape-function-call.test.d.ts +0 -1
- package/dist/ai-service/unescape-function-call.test.js +0 -18
- package/dist/ai-service/unescape-function-call.test.js.map +0 -1
- package/dist/ai-service/vertex-ai-claude.d.ts.map +0 -1
- package/dist/ai-service/vertex-ai-imagen.d.ts.map +0 -1
- package/dist/ai-service/vertex-ai.d.ts.map +0 -1
- package/dist/cli/cli-options.d.ts.map +0 -1
- package/dist/cli/cli-options.test.d.ts +0 -1
- package/dist/cli/cli-options.test.js +0 -34
- package/dist/cli/cli-options.test.js.map +0 -1
- package/dist/cli/cli-params.d.ts.map +0 -1
- package/dist/cli/cli-params.test.d.ts +0 -1
- package/dist/cli/cli-params.test.js +0 -38
- package/dist/cli/cli-params.test.js.map +0 -1
- package/dist/cli/service-autodetect.d.ts.map +0 -1
- package/dist/cli/service-autodetect.test.d.ts +0 -1
- package/dist/cli/service-autodetect.test.js +0 -38
- package/dist/cli/service-autodetect.test.js.map +0 -1
- package/dist/cli/validate-cli-params.d.ts.map +0 -1
- package/dist/cli/validate-cli-params.test.d.ts +0 -1
- package/dist/cli/validate-cli-params.test.js +0 -106
- package/dist/cli/validate-cli-params.test.js.map +0 -1
- package/dist/eval/codegen-summary.test.d.ts +0 -1
- package/dist/eval/codegen-summary.test.js +0 -93
- package/dist/eval/codegen-summary.test.js.map +0 -1
- package/dist/eval/current-prompt-plugin.js.map +0 -1
- package/dist/eval/data/current-prompt.d.ts +0 -149
- package/dist/eval/data/current-prompt.js +0 -314
- package/dist/eval/data/current-prompt.js.map +0 -1
- package/dist/eval/data/prompt-assistant-image.d.ts +0 -49
- package/dist/eval/data/prompt-assistant-image.js +0 -67
- package/dist/eval/data/prompt-assistant-image.js.map +0 -1
- package/dist/eval/data/prompt3.d.ts +0 -34
- package/dist/eval/data/prompt3.js +0 -71
- package/dist/eval/data/prompt3.js.map +0 -1
- package/dist/eval/prompt-debug.test.d.ts +0 -1
- package/dist/eval/prompt-debug.test.js +0 -93
- package/dist/eval/prompt-debug.test.js.map +0 -1
- package/dist/eval/prompt2.d.ts +0 -34
- package/dist/eval/prompt2.js +0 -125
- package/dist/eval/prompt2.js.map +0 -1
- package/dist/examples/genaicode_plugins/fake_ai_service.d.ts +0 -3
- package/dist/examples/genaicode_plugins/fake_ai_service.js +0 -11
- package/dist/examples/genaicode_plugins/fake_ai_service.js.map +0 -1
- package/dist/examples/genaicode_plugins/grok_ai_service.d.ts +0 -3
- package/dist/examples/genaicode_plugins/grok_ai_service.js +0 -153
- package/dist/examples/genaicode_plugins/grok_ai_service.js.map +0 -1
- package/dist/examples/genaicode_plugins/nonsense_operation.d.ts +0 -3
- package/dist/examples/genaicode_plugins/nonsense_operation.js +0 -23
- package/dist/examples/genaicode_plugins/nonsense_operation.js.map +0 -1
- package/dist/files/cache-file.d.ts.map +0 -1
- package/dist/files/file-utils.d.ts.map +0 -1
- package/dist/files/file-utils.test.d.ts +0 -1
- package/dist/files/file-utils.test.js +0 -18
- package/dist/files/file-utils.test.js.map +0 -1
- package/dist/files/find-files.d.ts.map +0 -1
- package/dist/files/path-utils.d.ts.map +0 -1
- package/dist/files/read-files.d.ts.map +0 -1
- package/dist/files/read-files.test.d.ts +0 -1
- package/dist/files/read-files.test.js +0 -95
- package/dist/files/read-files.test.js.map +0 -1
- package/dist/files/search-files.d.ts.map +0 -1
- package/dist/files/source-code-tree.d.ts.map +0 -1
- package/dist/files/temp-buffer.d.ts.map +0 -1
- package/dist/files/update-files.d.ts.map +0 -1
- package/dist/images/ensure-alpha.d.ts.map +0 -1
- package/dist/images/imgly-remove-background.d.ts.map +0 -1
- package/dist/images/resize-image.d.ts.map +0 -1
- package/dist/images/split-image.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/main/codegen-non-interactive.d.ts.map +0 -1
- package/dist/main/codegen-types.d.ts.map +0 -1
- package/dist/main/codegen-utils.d.ts.map +0 -1
- package/dist/main/codegen.ai-services.test.d.ts +0 -3
- package/dist/main/codegen.ai-services.test.js +0 -198
- package/dist/main/codegen.ai-services.test.js.map +0 -1
- package/dist/main/codegen.cli-options.test.d.ts +0 -3
- package/dist/main/codegen.cli-options.test.js +0 -171
- package/dist/main/codegen.cli-options.test.js.map +0 -1
- package/dist/main/codegen.d.ts.map +0 -1
- package/dist/main/codegen.image-generation.test.d.ts +0 -3
- package/dist/main/codegen.image-generation.test.js +0 -187
- package/dist/main/codegen.image-generation.test.js.map +0 -1
- package/dist/main/codegen.test-utils.d.ts.map +0 -1
- package/dist/main/codegen.test.d.ts +0 -3
- package/dist/main/codegen.test.js +0 -307
- package/dist/main/codegen.test.js.map +0 -1
- package/dist/main/common/content-bus-types.d.ts.map +0 -1
- package/dist/main/common/content-bus.d.ts.map +0 -1
- package/dist/main/common/cost-collector.d.ts.map +0 -1
- package/dist/main/common/user-actions.d.ts.map +0 -1
- package/dist/main/config-lib.d.ts.map +0 -1
- package/dist/main/config-lib.test.d.ts +0 -1
- package/dist/main/config-lib.test.js +0 -64
- package/dist/main/config-lib.test.js.map +0 -1
- package/dist/main/config.d.ts.map +0 -1
- package/dist/main/interactive/codegen-interactive.d.ts.map +0 -1
- package/dist/main/interactive/codegen-interactive.test.d.ts +0 -5
- package/dist/main/interactive/codegen-interactive.test.js +0 -73
- package/dist/main/interactive/codegen-interactive.test.js.map +0 -1
- package/dist/main/interactive/codegen-worker.d.ts.map +0 -1
- package/dist/main/interactive/common.d.ts.map +0 -1
- package/dist/main/interactive/configure.d.ts.map +0 -1
- package/dist/main/interactive/error-handling.d.ts.map +0 -1
- package/dist/main/interactive/help.d.ts.map +0 -1
- package/dist/main/interactive/process-comments.d.ts +0 -2
- package/dist/main/interactive/process-comments.js +0 -39
- package/dist/main/interactive/process-comments.js.map +0 -1
- package/dist/main/interactive/select-ai-service.d.ts.map +0 -1
- package/dist/main/interactive/task-file.d.ts.map +0 -1
- package/dist/main/interactive/text-prompt.d.ts.map +0 -1
- package/dist/main/interactive/user-action-handlers.d.ts.map +0 -1
- package/dist/main/interactive/user-interrupt.d.ts.map +0 -1
- package/dist/main/plugin-loader.d.ts.map +0 -1
- package/dist/main/ui/backend/api-utils.d.ts.map +0 -1
- package/dist/main/ui/backend/api.d.ts.map +0 -1
- package/dist/main/ui/backend/server.d.ts.map +0 -1
- package/dist/main/ui/backend/service.d.ts.map +0 -1
- package/dist/main/ui/codegen-ui.d.ts.map +0 -1
- package/dist/main/ui/common/api-types.d.ts.map +0 -1
- package/dist/main/ui/frontend/assets/index-BAAQr5b1.js +0 -1747
- package/dist/main/ui/user-action-handlers.d.ts.map +0 -1
- package/dist/operations/create-directory/create-directory-def.d.ts.map +0 -1
- package/dist/operations/create-directory/create-directory-executor.d.ts.map +0 -1
- package/dist/operations/create-file/create-file-def.d.ts.map +0 -1
- package/dist/operations/create-file/create-file-executor.d.ts.map +0 -1
- package/dist/operations/delete-file/delete-file-def.d.ts.map +0 -1
- package/dist/operations/delete-file/delete-file-executor.d.ts.map +0 -1
- package/dist/operations/download-file/download-file-def.d.ts.map +0 -1
- package/dist/operations/download-file/download-file-executor.d.ts.map +0 -1
- package/dist/operations/imgly-remove-background/imgly-remove-background-def.d.ts.map +0 -1
- package/dist/operations/imgly-remove-background/imgly-remove-background-executor.d.ts.map +0 -1
- package/dist/operations/move-file/move-file-def.d.ts.map +0 -1
- package/dist/operations/move-file/move-file-executor.d.ts.map +0 -1
- package/dist/operations/operations-index.d.ts.map +0 -1
- package/dist/operations/patch-file/patch-file-def.d.ts.map +0 -1
- package/dist/operations/patch-file/patch-file-executor.d.ts.map +0 -1
- package/dist/operations/resize-image/resize-image-def.d.ts.map +0 -1
- package/dist/operations/resize-image/resize-image-executor.d.ts.map +0 -1
- package/dist/operations/split-image/split-image-def.d.ts.map +0 -1
- package/dist/operations/split-image/split-image-executor.d.ts.map +0 -1
- package/dist/operations/update-file/update-file-def.d.ts.map +0 -1
- package/dist/operations/update-file/update-file-executor.d.ts.map +0 -1
- package/dist/project-profiles/detection.d.ts.map +0 -1
- package/dist/project-profiles/index.d.ts.map +0 -1
- package/dist/project-profiles/profiles/golang.d.ts.map +0 -1
- package/dist/project-profiles/profiles/java-maven.d.ts.map +0 -1
- package/dist/project-profiles/profiles/javascript-npm.d.ts.map +0 -1
- package/dist/project-profiles/profiles/javascript-react.d.ts.map +0 -1
- package/dist/project-profiles/profiles/python-django.d.ts.map +0 -1
- package/dist/project-profiles/types.d.ts.map +0 -1
- package/dist/prompt/ai-service-fallback.d.ts.map +0 -1
- package/dist/prompt/function-calling-validate.d.ts.map +0 -1
- package/dist/prompt/function-calling.d.ts.map +0 -1
- package/dist/prompt/function-defs/ask-question-reflect.d.ts +0 -2
- package/dist/prompt/function-defs/ask-question-reflect.js +0 -21
- package/dist/prompt/function-defs/ask-question-reflect.js.map +0 -1
- package/dist/prompt/function-defs/ask-question.d.ts.map +0 -1
- package/dist/prompt/function-defs/codegen-planning.d.ts.map +0 -1
- package/dist/prompt/function-defs/codegen-summary.d.ts.map +0 -1
- package/dist/prompt/function-defs/create-directory.d.ts +0 -21
- package/dist/prompt/function-defs/create-directory.js +0 -22
- package/dist/prompt/function-defs/create-directory.js.map +0 -1
- package/dist/prompt/function-defs/create-file.d.ts +0 -25
- package/dist/prompt/function-defs/create-file.js +0 -26
- package/dist/prompt/function-defs/create-file.js.map +0 -1
- package/dist/prompt/function-defs/delete-file.d.ts +0 -21
- package/dist/prompt/function-defs/delete-file.js +0 -22
- package/dist/prompt/function-defs/delete-file.js.map +0 -1
- package/dist/prompt/function-defs/download-file.d.ts +0 -25
- package/dist/prompt/function-defs/download-file.js +0 -26
- package/dist/prompt/function-defs/download-file.js.map +0 -1
- package/dist/prompt/function-defs/explanation.d.ts.map +0 -1
- package/dist/prompt/function-defs/generate-image.d.ts.map +0 -1
- package/dist/prompt/function-defs/get-image-assets.d.ts.map +0 -1
- package/dist/prompt/function-defs/get-source-code.d.ts.map +0 -1
- package/dist/prompt/function-defs/imgly-remove-background.d.ts +0 -25
- package/dist/prompt/function-defs/imgly-remove-background.js +0 -26
- package/dist/prompt/function-defs/imgly-remove-background.js.map +0 -1
- package/dist/prompt/function-defs/move-file.d.ts +0 -25
- package/dist/prompt/function-defs/move-file.js +0 -26
- package/dist/prompt/function-defs/move-file.js.map +0 -1
- package/dist/prompt/function-defs/optimize-context.d.ts.map +0 -1
- package/dist/prompt/function-defs/patch-file.d.ts +0 -25
- package/dist/prompt/function-defs/patch-file.js +0 -39
- package/dist/prompt/function-defs/patch-file.js.map +0 -1
- package/dist/prompt/function-defs/read-history.d.ts.map +0 -1
- package/dist/prompt/function-defs/resize-image.d.ts +0 -36
- package/dist/prompt/function-defs/resize-image.js +0 -37
- package/dist/prompt/function-defs/resize-image.js.map +0 -1
- package/dist/prompt/function-defs/set-summaries.d.ts.map +0 -1
- package/dist/prompt/function-defs/split-image.d.ts +0 -57
- package/dist/prompt/function-defs/split-image.js +0 -46
- package/dist/prompt/function-defs/split-image.js.map +0 -1
- package/dist/prompt/function-defs/update-file.d.ts +0 -25
- package/dist/prompt/function-defs/update-file.js +0 -26
- package/dist/prompt/function-defs/update-file.js.map +0 -1
- package/dist/prompt/function-defs/update-history.d.ts.map +0 -1
- package/dist/prompt/limits.d.ts.map +0 -1
- package/dist/prompt/limits.test.d.ts +0 -1
- package/dist/prompt/limits.test.js +0 -35
- package/dist/prompt/limits.test.js.map +0 -1
- package/dist/prompt/prompt-codegen.d.ts.map +0 -1
- package/dist/prompt/prompt-codegen.test.d.ts +0 -1
- package/dist/prompt/prompt-codegen.test.js +0 -92
- package/dist/prompt/prompt-codegen.test.js.map +0 -1
- package/dist/prompt/prompt-consts.d.ts +0 -1
- package/dist/prompt/prompt-consts.js +0 -2
- package/dist/prompt/prompt-consts.js.map +0 -1
- package/dist/prompt/prompt-service-ask-question.test.d.ts +0 -4
- package/dist/prompt/prompt-service-ask-question.test.js +0 -162
- package/dist/prompt/prompt-service-ask-question.test.js.map +0 -1
- package/dist/prompt/prompt-service.ai-services.test.d.ts +0 -1
- package/dist/prompt/prompt-service.ai-services.test.js +0 -149
- package/dist/prompt/prompt-service.ai-services.test.js.map +0 -1
- package/dist/prompt/prompt-service.context-optimization.test.d.ts +0 -1
- package/dist/prompt/prompt-service.context-optimization.test.js +0 -212
- package/dist/prompt/prompt-service.context-optimization.test.js.map +0 -1
- package/dist/prompt/prompt-service.d.ts.map +0 -1
- package/dist/prompt/prompt-service.image-handling.test.d.ts +0 -1
- package/dist/prompt/prompt-service.image-handling.test.js +0 -212
- package/dist/prompt/prompt-service.image-handling.test.js.map +0 -1
- package/dist/prompt/prompt-service.test-utils.d.ts.map +0 -1
- package/dist/prompt/prompt-service.test.d.ts +0 -2
- package/dist/prompt/prompt-service.test.js +0 -629
- package/dist/prompt/prompt-service.test.js.map +0 -1
- package/dist/prompt/prompt-service.validation-recovery.test.d.ts +0 -1
- package/dist/prompt/prompt-service.validation-recovery.test.js +0 -263
- package/dist/prompt/prompt-service.validation-recovery.test.js.map +0 -1
- package/dist/prompt/static-prompts.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.d.ts +0 -2
- package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/code-generation.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/context-optimization.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/default-action.d.ts +0 -2
- package/dist/prompt/steps/step-ask-question/handlers/default-action.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/default-action.js +0 -15
- package/dist/prompt/steps/step-ask-question/handlers/default-action.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.d.ts +0 -2
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.js +0 -86
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer.d.ts +0 -2
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer.js +0 -20
- package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.d.ts +0 -2
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.d.ts.map +0 -1
- 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 +0 -2
- package/dist/prompt/steps/step-ask-question/handlers/handler-utils.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/lint.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/request-files-content.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/request-permissions.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.d.ts +0 -2
- package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.js +0 -16
- package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.d.ts +0 -0
- package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.js +0 -2
- package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.d.ts +0 -4
- package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.js +0 -92
- package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.js.map +0 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question.d.ts.map +0 -1
- package/dist/prompt/steps/step-ask-question-handlers.d.ts +0 -10
- package/dist/prompt/steps/step-ask-question-handlers.js +0 -257
- package/dist/prompt/steps/step-ask-question-handlers.js.map +0 -1
- package/dist/prompt/steps/step-ask-question-reflect.d.ts +0 -4
- package/dist/prompt/steps/step-ask-question-reflect.js +0 -48
- package/dist/prompt/steps/step-ask-question-reflect.js.map +0 -1
- package/dist/prompt/steps/step-ask-question-types.d.ts +0 -55
- package/dist/prompt/steps/step-ask-question-types.js +0 -2
- package/dist/prompt/steps/step-ask-question-types.js.map +0 -1
- package/dist/prompt/steps/step-ask-question.d.ts +0 -6
- package/dist/prompt/steps/step-ask-question.js +0 -80
- package/dist/prompt/steps/step-ask-question.js.map +0 -1
- package/dist/prompt/steps/step-codegen-planning.d.ts.map +0 -1
- package/dist/prompt/steps/step-codegen-summary.d.ts +0 -7
- package/dist/prompt/steps/step-codegen-summary.d.ts.map +0 -1
- package/dist/prompt/steps/step-codegen-summary.js +0 -106
- package/dist/prompt/steps/step-codegen-summary.js.map +0 -1
- package/dist/prompt/steps/step-codegen-summary.test.d.ts +0 -1
- package/dist/prompt/steps/step-codegen-summary.test.js +0 -136
- package/dist/prompt/steps/step-codegen-summary.test.js.map +0 -1
- package/dist/prompt/steps/step-context-optimization.d.ts.map +0 -1
- package/dist/prompt/steps/step-context-optimization.test.d.ts +0 -2
- package/dist/prompt/steps/step-context-optimization.test.js +0 -475
- package/dist/prompt/steps/step-context-optimization.test.js.map +0 -1
- package/dist/prompt/steps/step-ensure-context.d.ts.map +0 -1
- package/dist/prompt/steps/step-ensure-context.test.d.ts +0 -1
- package/dist/prompt/steps/step-ensure-context.test.js +0 -326
- package/dist/prompt/steps/step-ensure-context.test.js.map +0 -1
- package/dist/prompt/steps/step-generate-image.d.ts.map +0 -1
- package/dist/prompt/steps/step-generate-summary.d.ts.map +0 -1
- package/dist/prompt/steps/step-history-update.d.ts.map +0 -1
- package/dist/prompt/steps/step-summarization.d.ts.map +0 -1
- package/dist/prompt/steps/step-validate-recover.d.ts.map +0 -1
- package/dist/prompt/steps/step-verify-patch.d.ts.map +0 -1
- package/dist/prompt/steps/steps-types.d.ts.map +0 -1
- package/dist/prompt/steps/steps-utils.d.ts.map +0 -1
- package/dist/prompt/systemprompt.d.ts.map +0 -1
- package/dist/prompt/systemprompt.test.d.ts +0 -3
- package/dist/prompt/systemprompt.test.js +0 -42
- package/dist/prompt/systemprompt.test.js.map +0 -1
- package/dist/prompt/token-estimator.d.ts.map +0 -1
- package/dist/src/ai-service/ai-studio.d.ts +0 -6
- package/dist/src/ai-service/ai-studio.js +0 -190
- package/dist/src/ai-service/ai-studio.js.map +0 -1
- package/dist/src/ai-service/anthropic.d.ts +0 -6
- package/dist/src/ai-service/anthropic.js +0 -150
- package/dist/src/ai-service/anthropic.js.map +0 -1
- package/dist/src/ai-service/chat-gpt.d.ts +0 -5
- package/dist/src/ai-service/chat-gpt.js +0 -146
- package/dist/src/ai-service/chat-gpt.js.map +0 -1
- package/dist/src/ai-service/common.js +0 -38
- package/dist/src/ai-service/common.js.map +0 -1
- package/dist/src/ai-service/common.test.d.ts +0 -1
- package/dist/src/ai-service/common.test.js +0 -86
- package/dist/src/ai-service/common.test.js.map +0 -1
- package/dist/src/ai-service/dall-e.d.ts +0 -14
- package/dist/src/ai-service/dall-e.js +0 -50
- package/dist/src/ai-service/dall-e.js.map +0 -1
- package/dist/src/ai-service/unescape-function-call.d.ts +0 -7
- package/dist/src/ai-service/unescape-function-call.js +0 -59
- package/dist/src/ai-service/unescape-function-call.js.map +0 -1
- package/dist/src/ai-service/unescape-function-call.test.d.ts +0 -1
- package/dist/src/ai-service/unescape-function-call.test.js +0 -18
- package/dist/src/ai-service/unescape-function-call.test.js.map +0 -1
- package/dist/src/ai-service/vertex-ai-claude.d.ts +0 -5
- package/dist/src/ai-service/vertex-ai-claude.js +0 -104
- package/dist/src/ai-service/vertex-ai-claude.js.map +0 -1
- package/dist/src/ai-service/vertex-ai-imagen.d.ts +0 -14
- package/dist/src/ai-service/vertex-ai-imagen.js +0 -77
- package/dist/src/ai-service/vertex-ai-imagen.js.map +0 -1
- package/dist/src/ai-service/vertex-ai.d.ts +0 -6
- package/dist/src/ai-service/vertex-ai.js +0 -202
- package/dist/src/ai-service/vertex-ai.js.map +0 -1
- package/dist/src/cli/cli-options.d.ts +0 -10
- package/dist/src/cli/cli-options.js +0 -132
- package/dist/src/cli/cli-options.js.map +0 -1
- package/dist/src/cli/cli-options.test.d.ts +0 -1
- package/dist/src/cli/cli-options.test.js +0 -34
- package/dist/src/cli/cli-options.test.js.map +0 -1
- package/dist/src/cli/cli-params.d.ts +0 -32
- package/dist/src/cli/cli-params.js +0 -106
- package/dist/src/cli/cli-params.js.map +0 -1
- package/dist/src/cli/cli-params.test.d.ts +0 -1
- package/dist/src/cli/cli-params.test.js +0 -38
- package/dist/src/cli/cli-params.test.js.map +0 -1
- package/dist/src/cli/service-autodetect.d.ts +0 -2
- package/dist/src/cli/service-autodetect.js +0 -17
- package/dist/src/cli/service-autodetect.js.map +0 -1
- package/dist/src/cli/service-autodetect.test.d.ts +0 -1
- package/dist/src/cli/service-autodetect.test.js +0 -38
- package/dist/src/cli/service-autodetect.test.js.map +0 -1
- package/dist/src/cli/validate-cli-params.d.ts +0 -18
- package/dist/src/cli/validate-cli-params.js +0 -145
- package/dist/src/cli/validate-cli-params.js.map +0 -1
- package/dist/src/cli/validate-cli-params.test.d.ts +0 -1
- package/dist/src/cli/validate-cli-params.test.js +0 -106
- package/dist/src/cli/validate-cli-params.test.js.map +0 -1
- package/dist/src/files/cache-file.d.ts +0 -3
- package/dist/src/files/cache-file.js +0 -36
- package/dist/src/files/cache-file.js.map +0 -1
- package/dist/src/files/file-utils.d.ts +0 -2
- package/dist/src/files/file-utils.js +0 -7
- package/dist/src/files/file-utils.js.map +0 -1
- package/dist/src/files/file-utils.test.d.ts +0 -1
- package/dist/src/files/file-utils.test.js +0 -18
- package/dist/src/files/file-utils.test.js.map +0 -1
- package/dist/src/files/find-files.d.ts +0 -9
- package/dist/src/files/find-files.js +0 -81
- package/dist/src/files/find-files.js.map +0 -1
- package/dist/src/files/path-utils.d.ts +0 -1
- package/dist/src/files/path-utils.js +0 -12
- package/dist/src/files/path-utils.js.map +0 -1
- package/dist/src/files/read-files.d.ts +0 -21
- package/dist/src/files/read-files.js +0 -68
- package/dist/src/files/read-files.js.map +0 -1
- package/dist/src/files/read-files.test.d.ts +0 -1
- package/dist/src/files/read-files.test.js +0 -89
- package/dist/src/files/read-files.test.js.map +0 -1
- package/dist/src/files/temp-buffer.d.ts +0 -2
- package/dist/src/files/temp-buffer.js +0 -12
- package/dist/src/files/temp-buffer.js.map +0 -1
- package/dist/src/files/update-files.d.ts +0 -6
- package/dist/src/files/update-files.js +0 -19
- package/dist/src/files/update-files.js.map +0 -1
- package/dist/src/images/ensure-alpha.d.ts +0 -1
- package/dist/src/images/ensure-alpha.js +0 -5
- package/dist/src/images/ensure-alpha.js.map +0 -1
- package/dist/src/images/imgly-remove-background.d.ts +0 -2
- package/dist/src/images/imgly-remove-background.js +0 -21
- package/dist/src/images/imgly-remove-background.js.map +0 -1
- package/dist/src/images/resize-image.d.ts +0 -19
- package/dist/src/images/resize-image.js +0 -22
- package/dist/src/images/resize-image.js.map +0 -1
- package/dist/src/images/split-image.d.ts +0 -18
- package/dist/src/images/split-image.js +0 -25
- package/dist/src/images/split-image.js.map +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.js +0 -3
- package/dist/src/index.js.map +0 -1
- package/dist/src/main/codegen-types.d.ts +0 -58
- package/dist/src/main/codegen-types.js +0 -2
- package/dist/src/main/codegen-types.js.map +0 -1
- package/dist/src/main/codegen-utils.d.ts +0 -3
- package/dist/src/main/codegen-utils.js +0 -18
- package/dist/src/main/codegen-utils.js.map +0 -1
- package/dist/src/main/codegen.d.ts +0 -4
- package/dist/src/main/codegen.js +0 -201
- package/dist/src/main/codegen.js.map +0 -1
- package/dist/src/main/codegen.test.d.ts +0 -3
- package/dist/src/main/codegen.test.js +0 -288
- package/dist/src/main/codegen.test.js.map +0 -1
- package/dist/src/main/common/content-bus-types.d.ts +0 -21
- package/dist/src/main/common/content-bus-types.js +0 -11
- package/dist/src/main/common/content-bus-types.js.map +0 -1
- package/dist/src/main/common/content-bus.d.ts +0 -10
- package/dist/src/main/common/content-bus.js +0 -39
- package/dist/src/main/common/content-bus.js.map +0 -1
- package/dist/src/main/common/cost-collector.d.ts +0 -11
- package/dist/src/main/common/cost-collector.js +0 -90
- package/dist/src/main/common/cost-collector.js.map +0 -1
- package/dist/src/main/common/user-actions.d.ts +0 -19
- package/dist/src/main/common/user-actions.js +0 -30
- package/dist/src/main/common/user-actions.js.map +0 -1
- package/dist/src/main/config-lib.d.ts +0 -36
- package/dist/src/main/config-lib.js +0 -51
- package/dist/src/main/config-lib.js.map +0 -1
- package/dist/src/main/config-lib.test.d.ts +0 -1
- package/dist/src/main/config-lib.test.js +0 -64
- package/dist/src/main/config-lib.test.js.map +0 -1
- package/dist/src/main/config.d.ts +0 -7
- package/dist/src/main/config.js +0 -51
- package/dist/src/main/config.js.map +0 -1
- package/dist/src/main/interactive/codegen-interactive.d.ts +0 -2
- package/dist/src/main/interactive/codegen-interactive.js +0 -61
- package/dist/src/main/interactive/codegen-interactive.js.map +0 -1
- package/dist/src/main/interactive/codegen-interactive.test.d.ts +0 -5
- package/dist/src/main/interactive/codegen-interactive.test.js +0 -79
- package/dist/src/main/interactive/codegen-interactive.test.js.map +0 -1
- package/dist/src/main/interactive/codegen-worker.d.ts +0 -3
- package/dist/src/main/interactive/codegen-worker.js +0 -54
- package/dist/src/main/interactive/codegen-worker.js.map +0 -1
- package/dist/src/main/interactive/common.d.ts +0 -5
- package/dist/src/main/interactive/common.js +0 -51
- package/dist/src/main/interactive/common.js.map +0 -1
- package/dist/src/main/interactive/configure.d.ts +0 -2
- package/dist/src/main/interactive/configure.js +0 -99
- package/dist/src/main/interactive/configure.js.map +0 -1
- package/dist/src/main/interactive/error-handling.d.ts +0 -1
- package/dist/src/main/interactive/error-handling.js +0 -43
- package/dist/src/main/interactive/error-handling.js.map +0 -1
- package/dist/src/main/interactive/help.d.ts +0 -1
- package/dist/src/main/interactive/help.js +0 -22
- package/dist/src/main/interactive/help.js.map +0 -1
- package/dist/src/main/interactive/process-comments.d.ts +0 -2
- package/dist/src/main/interactive/process-comments.js +0 -39
- package/dist/src/main/interactive/process-comments.js.map +0 -1
- package/dist/src/main/interactive/select-ai-service.d.ts +0 -2
- package/dist/src/main/interactive/select-ai-service.js +0 -27
- package/dist/src/main/interactive/select-ai-service.js.map +0 -1
- package/dist/src/main/interactive/task-file.d.ts +0 -2
- package/dist/src/main/interactive/task-file.js +0 -35
- package/dist/src/main/interactive/task-file.js.map +0 -1
- package/dist/src/main/interactive/text-prompt.d.ts +0 -2
- package/dist/src/main/interactive/text-prompt.js +0 -18
- package/dist/src/main/interactive/text-prompt.js.map +0 -1
- package/dist/src/main/interactive/user-action-handlers.d.ts +0 -1
- package/dist/src/main/interactive/user-action-handlers.js +0 -13
- package/dist/src/main/interactive/user-action-handlers.js.map +0 -1
- package/dist/src/main/interactive/user-interrupt.d.ts +0 -1
- package/dist/src/main/interactive/user-interrupt.js +0 -36
- package/dist/src/main/interactive/user-interrupt.js.map +0 -1
- package/dist/src/main/plugin-loader.d.ts +0 -6
- package/dist/src/main/plugin-loader.js +0 -40
- package/dist/src/main/plugin-loader.js.map +0 -1
- package/dist/src/main/ui/backend/api-utils.d.ts +0 -2
- package/dist/src/main/ui/backend/api-utils.js +0 -18
- package/dist/src/main/ui/backend/api-utils.js.map +0 -1
- package/dist/src/main/ui/backend/api.d.ts +0 -2
- package/dist/src/main/ui/backend/api.js +0 -210
- package/dist/src/main/ui/backend/api.js.map +0 -1
- package/dist/src/main/ui/backend/server.d.ts +0 -7
- package/dist/src/main/ui/backend/server.js +0 -83
- package/dist/src/main/ui/backend/server.js.map +0 -1
- package/dist/src/main/ui/backend/service.d.ts +0 -44
- package/dist/src/main/ui/backend/service.js +0 -171
- package/dist/src/main/ui/backend/service.js.map +0 -1
- package/dist/src/main/ui/codegen-ui.d.ts +0 -2
- package/dist/src/main/ui/codegen-ui.js +0 -13
- package/dist/src/main/ui/codegen-ui.js.map +0 -1
- package/dist/src/main/ui/common/api-types.d.ts +0 -20
- package/dist/src/main/ui/common/api-types.js +0 -2
- package/dist/src/main/ui/common/api-types.js.map +0 -1
- package/dist/src/main/ui/user-action-handlers.d.ts +0 -2
- package/dist/src/main/ui/user-action-handlers.js +0 -14
- package/dist/src/main/ui/user-action-handlers.js.map +0 -1
- package/dist/src/operations/create-directory/create-directory-def.d.ts +0 -9
- package/dist/src/operations/create-directory/create-directory-def.js +0 -22
- package/dist/src/operations/create-directory/create-directory-def.js.map +0 -1
- package/dist/src/operations/create-directory/create-directory-executor.d.ts +0 -6
- package/dist/src/operations/create-directory/create-directory-executor.js +0 -22
- package/dist/src/operations/create-directory/create-directory-executor.js.map +0 -1
- package/dist/src/operations/create-file/create-file-def.d.ts +0 -10
- package/dist/src/operations/create-file/create-file-def.js +0 -26
- package/dist/src/operations/create-file/create-file-def.js.map +0 -1
- package/dist/src/operations/create-file/create-file-executor.d.ts +0 -6
- package/dist/src/operations/create-file/create-file-executor.js +0 -27
- package/dist/src/operations/create-file/create-file-executor.js.map +0 -1
- package/dist/src/operations/delete-file/delete-file-def.d.ts +0 -9
- package/dist/src/operations/delete-file/delete-file-def.js +0 -22
- package/dist/src/operations/delete-file/delete-file-def.js.map +0 -1
- package/dist/src/operations/delete-file/delete-file-executor.d.ts +0 -6
- package/dist/src/operations/delete-file/delete-file-executor.js +0 -23
- package/dist/src/operations/delete-file/delete-file-executor.js.map +0 -1
- package/dist/src/operations/download-file/download-file-def.d.ts +0 -10
- package/dist/src/operations/download-file/download-file-def.js +0 -26
- package/dist/src/operations/download-file/download-file-def.js.map +0 -1
- package/dist/src/operations/download-file/download-file-executor.d.ts +0 -6
- package/dist/src/operations/download-file/download-file-executor.js +0 -44
- package/dist/src/operations/download-file/download-file-executor.js.map +0 -1
- package/dist/src/operations/imgly-remove-background/imgly-remove-background-def.d.ts +0 -10
- package/dist/src/operations/imgly-remove-background/imgly-remove-background-def.js +0 -26
- package/dist/src/operations/imgly-remove-background/imgly-remove-background-def.js.map +0 -1
- package/dist/src/operations/imgly-remove-background/imgly-remove-background-executor.d.ts +0 -6
- package/dist/src/operations/imgly-remove-background/imgly-remove-background-executor.js +0 -40
- package/dist/src/operations/imgly-remove-background/imgly-remove-background-executor.js.map +0 -1
- package/dist/src/operations/move-file/move-file-def.d.ts +0 -10
- package/dist/src/operations/move-file/move-file-def.js +0 -26
- package/dist/src/operations/move-file/move-file-def.js.map +0 -1
- package/dist/src/operations/move-file/move-file-executor.d.ts +0 -6
- package/dist/src/operations/move-file/move-file-executor.js +0 -29
- package/dist/src/operations/move-file/move-file-executor.js.map +0 -1
- package/dist/src/operations/operations-index.d.ts +0 -3
- package/dist/src/operations/operations-index.js +0 -33
- package/dist/src/operations/operations-index.js.map +0 -1
- package/dist/src/operations/patch-file/patch-file-def.d.ts +0 -10
- package/dist/src/operations/patch-file/patch-file-def.js +0 -39
- package/dist/src/operations/patch-file/patch-file-def.js.map +0 -1
- package/dist/src/operations/patch-file/patch-file-executor.d.ts +0 -5
- package/dist/src/operations/patch-file/patch-file-executor.js +0 -26
- package/dist/src/operations/patch-file/patch-file-executor.js.map +0 -1
- package/dist/src/operations/resize-image/resize-image-def.d.ts +0 -13
- package/dist/src/operations/resize-image/resize-image-def.js +0 -37
- package/dist/src/operations/resize-image/resize-image-def.js.map +0 -1
- package/dist/src/operations/resize-image/resize-image-executor.d.ts +0 -5
- package/dist/src/operations/resize-image/resize-image-executor.js +0 -30
- package/dist/src/operations/resize-image/resize-image-executor.js.map +0 -1
- package/dist/src/operations/split-image/split-image-def.d.ts +0 -18
- package/dist/src/operations/split-image/split-image-def.js +0 -46
- package/dist/src/operations/split-image/split-image-def.js.map +0 -1
- package/dist/src/operations/split-image/split-image-executor.d.ts +0 -6
- package/dist/src/operations/split-image/split-image-executor.js +0 -51
- package/dist/src/operations/split-image/split-image-executor.js.map +0 -1
- package/dist/src/operations/update-file/update-file-def.d.ts +0 -10
- package/dist/src/operations/update-file/update-file-def.js +0 -26
- package/dist/src/operations/update-file/update-file-def.js.map +0 -1
- package/dist/src/operations/update-file/update-file-executor.d.ts +0 -5
- package/dist/src/operations/update-file/update-file-executor.js +0 -22
- package/dist/src/operations/update-file/update-file-executor.js.map +0 -1
- package/dist/src/prompt/ai-service-fallback.d.ts +0 -3
- package/dist/src/prompt/ai-service-fallback.js +0 -84
- package/dist/src/prompt/ai-service-fallback.js.map +0 -1
- package/dist/src/prompt/function-calling-validate.d.ts +0 -3
- package/dist/src/prompt/function-calling-validate.js +0 -99
- package/dist/src/prompt/function-calling-validate.js.map +0 -1
- package/dist/src/prompt/function-calling.d.ts +0 -5
- package/dist/src/prompt/function-calling.js +0 -43
- package/dist/src/prompt/function-calling.js.map +0 -1
- package/dist/src/prompt/function-defs/ask-question-reflect.d.ts +0 -2
- package/dist/src/prompt/function-defs/ask-question-reflect.js +0 -21
- package/dist/src/prompt/function-defs/ask-question-reflect.js.map +0 -1
- package/dist/src/prompt/function-defs/ask-question.d.ts +0 -8
- package/dist/src/prompt/function-defs/ask-question.js +0 -100
- package/dist/src/prompt/function-defs/ask-question.js.map +0 -1
- package/dist/src/prompt/function-defs/codegen-summary.d.ts +0 -5
- package/dist/src/prompt/function-defs/codegen-summary.js +0 -82
- package/dist/src/prompt/function-defs/codegen-summary.js.map +0 -1
- package/dist/src/prompt/function-defs/explanation.d.ts +0 -5
- package/dist/src/prompt/function-defs/explanation.js +0 -18
- package/dist/src/prompt/function-defs/explanation.js.map +0 -1
- package/dist/src/prompt/function-defs/generate-image.d.ts +0 -5
- package/dist/src/prompt/function-defs/generate-image.js +0 -42
- package/dist/src/prompt/function-defs/generate-image.js.map +0 -1
- package/dist/src/prompt/function-defs/get-image-assets.d.ts +0 -5
- package/dist/src/prompt/function-defs/get-image-assets.js +0 -21
- package/dist/src/prompt/function-defs/get-image-assets.js.map +0 -1
- package/dist/src/prompt/function-defs/get-source-code.d.ts +0 -5
- package/dist/src/prompt/function-defs/get-source-code.js +0 -22
- package/dist/src/prompt/function-defs/get-source-code.js.map +0 -1
- package/dist/src/prompt/function-defs/optimize-context.d.ts +0 -5
- package/dist/src/prompt/function-defs/optimize-context.js +0 -47
- package/dist/src/prompt/function-defs/optimize-context.js.map +0 -1
- package/dist/src/prompt/function-defs/read-history.d.ts +0 -2
- package/dist/src/prompt/function-defs/read-history.js +0 -14
- package/dist/src/prompt/function-defs/read-history.js.map +0 -1
- package/dist/src/prompt/function-defs/set-summaries.d.ts +0 -5
- package/dist/src/prompt/function-defs/set-summaries.js +0 -32
- package/dist/src/prompt/function-defs/set-summaries.js.map +0 -1
- package/dist/src/prompt/function-defs/update-history.d.ts +0 -5
- package/dist/src/prompt/function-defs/update-history.js +0 -22
- package/dist/src/prompt/function-defs/update-history.js.map +0 -1
- package/dist/src/prompt/limits.d.ts +0 -3
- package/dist/src/prompt/limits.js +0 -21
- package/dist/src/prompt/limits.js.map +0 -1
- package/dist/src/prompt/limits.test.d.ts +0 -1
- package/dist/src/prompt/limits.test.js +0 -35
- package/dist/src/prompt/limits.test.js.map +0 -1
- package/dist/src/prompt/prompt-codegen.d.ts +0 -9
- package/dist/src/prompt/prompt-codegen.js +0 -117
- package/dist/src/prompt/prompt-codegen.js.map +0 -1
- package/dist/src/prompt/prompt-codegen.test.d.ts +0 -1
- package/dist/src/prompt/prompt-codegen.test.js +0 -98
- package/dist/src/prompt/prompt-codegen.test.js.map +0 -1
- package/dist/src/prompt/prompt-consts.d.ts +0 -1
- package/dist/src/prompt/prompt-consts.js +0 -2
- package/dist/src/prompt/prompt-consts.js.map +0 -1
- package/dist/src/prompt/prompt-service-ask-question.test.d.ts +0 -4
- package/dist/src/prompt/prompt-service-ask-question.test.js +0 -215
- package/dist/src/prompt/prompt-service-ask-question.test.js.map +0 -1
- package/dist/src/prompt/prompt-service.d.ts +0 -5
- package/dist/src/prompt/prompt-service.js +0 -214
- package/dist/src/prompt/prompt-service.js.map +0 -1
- package/dist/src/prompt/prompt-service.test.d.ts +0 -2
- package/dist/src/prompt/prompt-service.test.js +0 -553
- package/dist/src/prompt/prompt-service.test.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.d.ts +0 -2
- package/dist/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.js +0 -16
- package/dist/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.d.ts +0 -2
- package/dist/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.js +0 -37
- package/dist/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/handlers/context-optimization.d.ts +0 -2
- package/dist/src/prompt/steps/step-ask-question/handlers/context-optimization.js +0 -36
- package/dist/src/prompt/steps/step-ask-question/handlers/context-optimization.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/handlers/default-action.d.ts +0 -2
- package/dist/src/prompt/steps/step-ask-question/handlers/default-action.js +0 -18
- package/dist/src/prompt/steps/step-ask-question/handlers/default-action.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/handlers/handle-request-answer.d.ts +0 -2
- package/dist/src/prompt/steps/step-ask-question/handlers/handle-request-answer.js +0 -20
- package/dist/src/prompt/steps/step-ask-question/handlers/handle-request-answer.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.d.ts +0 -2
- package/dist/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.js +0 -43
- package/dist/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/handlers/request-files-content.d.ts +0 -2
- package/dist/src/prompt/steps/step-ask-question/handlers/request-files-content.js +0 -49
- package/dist/src/prompt/steps/step-ask-question/handlers/request-files-content.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/handlers/request-permissions.d.ts +0 -2
- package/dist/src/prompt/steps/step-ask-question/handlers/request-permissions.js +0 -46
- package/dist/src/prompt/steps/step-ask-question/handlers/request-permissions.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/handlers/start-code-generation.d.ts +0 -2
- package/dist/src/prompt/steps/step-ask-question/handlers/start-code-generation.js +0 -16
- package/dist/src/prompt/steps/step-ask-question/handlers/start-code-generation.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/step-ask-question-handlers.d.ts +0 -0
- package/dist/src/prompt/steps/step-ask-question/step-ask-question-handlers.js +0 -2
- package/dist/src/prompt/steps/step-ask-question/step-ask-question-handlers.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/step-ask-question-reflect.d.ts +0 -4
- package/dist/src/prompt/steps/step-ask-question/step-ask-question-reflect.js +0 -91
- package/dist/src/prompt/steps/step-ask-question/step-ask-question-reflect.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/step-ask-question-types.d.ts +0 -55
- package/dist/src/prompt/steps/step-ask-question/step-ask-question-types.js +0 -2
- package/dist/src/prompt/steps/step-ask-question/step-ask-question-types.js.map +0 -1
- package/dist/src/prompt/steps/step-ask-question/step-ask-question.d.ts +0 -6
- package/dist/src/prompt/steps/step-ask-question/step-ask-question.js +0 -88
- package/dist/src/prompt/steps/step-ask-question/step-ask-question.js.map +0 -1
- package/dist/src/prompt/steps/step-context-optimization.d.ts +0 -4
- package/dist/src/prompt/steps/step-context-optimization.js +0 -200
- package/dist/src/prompt/steps/step-context-optimization.js.map +0 -1
- package/dist/src/prompt/steps/step-generate-image.d.ts +0 -2
- package/dist/src/prompt/steps/step-generate-image.js +0 -29
- package/dist/src/prompt/steps/step-generate-image.js.map +0 -1
- package/dist/src/prompt/steps/step-generate-summary.d.ts +0 -3
- package/dist/src/prompt/steps/step-generate-summary.js +0 -41
- package/dist/src/prompt/steps/step-generate-summary.js.map +0 -1
- package/dist/src/prompt/steps/step-history-update.d.ts +0 -5
- package/dist/src/prompt/steps/step-history-update.js +0 -54
- package/dist/src/prompt/steps/step-history-update.js.map +0 -1
- package/dist/src/prompt/steps/step-summarization.d.ts +0 -8
- package/dist/src/prompt/steps/step-summarization.js +0 -75
- package/dist/src/prompt/steps/step-summarization.js.map +0 -1
- package/dist/src/prompt/steps/step-validate-recover.d.ts +0 -2
- package/dist/src/prompt/steps/step-validate-recover.js +0 -51
- package/dist/src/prompt/steps/step-validate-recover.js.map +0 -1
- package/dist/src/prompt/steps/step-verify-patch.d.ts +0 -6
- package/dist/src/prompt/steps/step-verify-patch.js +0 -34
- package/dist/src/prompt/steps/step-verify-patch.js.map +0 -1
- package/dist/src/prompt/steps/steps-types.d.ts +0 -16
- package/dist/src/prompt/steps/steps-types.js +0 -6
- package/dist/src/prompt/steps/steps-types.js.map +0 -1
- package/dist/src/prompt/steps/steps-utils.d.ts +0 -7
- package/dist/src/prompt/steps/steps-utils.js +0 -11
- package/dist/src/prompt/steps/steps-utils.js.map +0 -1
- package/dist/src/prompt/systemprompt.d.ts +0 -3
- package/dist/src/prompt/systemprompt.js +0 -209
- package/dist/src/prompt/systemprompt.js.map +0 -1
- package/dist/src/prompt/systemprompt.test.d.ts +0 -3
- package/dist/src/prompt/systemprompt.test.js +0 -43
- package/dist/src/prompt/systemprompt.test.js.map +0 -1
- package/dist/src/prompt/token-estimator.d.ts +0 -8
- package/dist/src/prompt/token-estimator.js +0 -31
- package/dist/src/prompt/token-estimator.js.map +0 -1
- package/dist/src/vite-genaicode/vite-genaicode-frontend.d.ts +0 -1
- package/dist/src/vite-genaicode/vite-genaicode-frontend.js +0 -142
- package/dist/src/vite-genaicode/vite-genaicode-frontend.js.map +0 -1
- package/dist/src/vite-genaicode/vite-genaicode-plugin.d.ts +0 -7
- package/dist/src/vite-genaicode/vite-genaicode-plugin.js +0 -40
- package/dist/src/vite-genaicode/vite-genaicode-plugin.js.map +0 -1
- package/dist/vite-genaicode/vite-genaicode-frontend.d.ts.map +0 -1
- package/dist/vite-genaicode/vite-genaicode-plugin.d.ts.map +0 -1
- /package/dist/{ai-service/common.test.d.ts → main/ui/backend/endpoints/context-endpoint.d.ts} +0 -0
|
@@ -1,629 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
|
-
import { promptService } from './prompt-service.js';
|
|
3
|
-
import * as aiStudio from '../ai-service/ai-studio.js';
|
|
4
|
-
import * as vertexAi from '../ai-service/vertex-ai.js';
|
|
5
|
-
import * as vertexAiClaude from '../ai-service/vertex-ai-claude.js';
|
|
6
|
-
import * as chatGpt from '../ai-service/chat-gpt.js';
|
|
7
|
-
import * as anthropic from '../ai-service/anthropic.js';
|
|
8
|
-
import * as cliParams from '../cli/cli-params.js';
|
|
9
|
-
import fs from 'fs';
|
|
10
|
-
import * as diff from 'diff';
|
|
11
|
-
import mime from 'mime-types';
|
|
12
|
-
import '../files/cache-file.js';
|
|
13
|
-
import { getImageAssets } from '../files/read-files.js';
|
|
14
|
-
import '../files/find-files.js';
|
|
15
|
-
import * as dalleService from '../ai-service/dall-e.js';
|
|
16
|
-
import * as vertexAiImagen from '../ai-service/vertex-ai-imagen.js';
|
|
17
|
-
import { getCodeGenPrompt } from './prompt-codegen.js';
|
|
18
|
-
vi.mock('../ai-service/vertex-ai-claude.js', () => ({ generateContent: vi.fn() }));
|
|
19
|
-
vi.mock('../ai-service/vertex-ai.js', () => ({ generateContent: vi.fn() }));
|
|
20
|
-
vi.mock('../ai-service/chat-gpt.js', () => ({ generateContent: vi.fn() }));
|
|
21
|
-
vi.mock('../ai-service/anthropic.js', () => ({ generateContent: vi.fn() }));
|
|
22
|
-
vi.mock('../cli/cli-params.js', () => ({
|
|
23
|
-
disableExplanations: true,
|
|
24
|
-
explicitPrompt: false,
|
|
25
|
-
allowFileCreate: false,
|
|
26
|
-
allowFileDelete: false,
|
|
27
|
-
allowDirectoryCreate: false,
|
|
28
|
-
allowFileMove: false,
|
|
29
|
-
verbosePrompt: false,
|
|
30
|
-
disableContextOptimization: true,
|
|
31
|
-
vision: false,
|
|
32
|
-
imagen: false,
|
|
33
|
-
temperature: 0.7,
|
|
34
|
-
cheap: false,
|
|
35
|
-
askQuestion: false,
|
|
36
|
-
}));
|
|
37
|
-
vi.mock('fs');
|
|
38
|
-
vi.mock('diff');
|
|
39
|
-
vi.mock('mime-types');
|
|
40
|
-
vi.mock('../ai-service/dall-e.js', () => ({ generateImage: vi.fn() }));
|
|
41
|
-
vi.mock('../ai-service/vertex-ai-imagen.js', () => ({ generateImage: vi.fn() }));
|
|
42
|
-
vi.mock('../files/cache-file.js');
|
|
43
|
-
// Mock find-files module
|
|
44
|
-
vi.mock('../files/find-files.js', () => ({
|
|
45
|
-
getSourceFiles: () => [],
|
|
46
|
-
getImageAssetFiles: () => [],
|
|
47
|
-
}));
|
|
48
|
-
// Mock read-files module
|
|
49
|
-
vi.mock('../files/read-files.js', () => ({
|
|
50
|
-
getSourceCode: () => ({}),
|
|
51
|
-
getImageAssets: vi.fn(() => ({})),
|
|
52
|
-
}));
|
|
53
|
-
vi.mock('../main/config.js', () => ({
|
|
54
|
-
rootDir: '/mocked/root/dir',
|
|
55
|
-
rcConfig: {
|
|
56
|
-
rootDir: '/mocked/root/dir',
|
|
57
|
-
extensions: ['.js', '.ts', '.tsx', '.jsx'],
|
|
58
|
-
},
|
|
59
|
-
importantContext: {},
|
|
60
|
-
}));
|
|
61
|
-
const GENERATE_CONTENT_FNS = {
|
|
62
|
-
'vertex-ai-claude': vertexAiClaude.generateContent,
|
|
63
|
-
'vertex-ai': vertexAi.generateContent,
|
|
64
|
-
'ai-studio': aiStudio.generateContent,
|
|
65
|
-
anthropic: anthropic.generateContent,
|
|
66
|
-
'chat-gpt': chatGpt.generateContent,
|
|
67
|
-
};
|
|
68
|
-
const GENERATE_IMAGE_FNS = {
|
|
69
|
-
'dall-e': dalleService.generateImage,
|
|
70
|
-
'vertex-ai': vertexAiImagen.generateImage,
|
|
71
|
-
};
|
|
72
|
-
describe('promptService', () => {
|
|
73
|
-
beforeEach(() => {
|
|
74
|
-
vi.resetAllMocks();
|
|
75
|
-
vi.mocked(cliParams).dryRun = false;
|
|
76
|
-
vi.mocked(cliParams).vision = false;
|
|
77
|
-
vi.mocked(cliParams).imagen = undefined;
|
|
78
|
-
vi.mocked(cliParams).disableContextOptimization = false;
|
|
79
|
-
vi.mocked(cliParams).explicitPrompt = 'testx';
|
|
80
|
-
});
|
|
81
|
-
it('should process the codegen summary and return the result with Vertex AI', async () => {
|
|
82
|
-
vi.mocked(cliParams).aiService = 'vertex-ai';
|
|
83
|
-
const mockFunctionCalls = [
|
|
84
|
-
{ name: 'updateFile', args: { filePath: 'test.js', newContent: 'console.log("Hello");' } },
|
|
85
|
-
];
|
|
86
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockFunctionCalls);
|
|
87
|
-
const result = await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
88
|
-
askQuestion: false,
|
|
89
|
-
disableContextOptimization: true,
|
|
90
|
-
explicitPrompt: 'testx',
|
|
91
|
-
aiService: 'vertex-ai',
|
|
92
|
-
}));
|
|
93
|
-
expect(result).toEqual(mockFunctionCalls);
|
|
94
|
-
expect(vertexAi.generateContent).toHaveBeenCalled();
|
|
95
|
-
});
|
|
96
|
-
it('should process the codegen summary and return the result with ChatGPT', async () => {
|
|
97
|
-
vi.mocked(cliParams).aiService = 'chat-gpt';
|
|
98
|
-
const mockFunctionCalls = [{ name: 'createFile', args: { filePath: 'new.js', newContent: 'const x = 5;' } }];
|
|
99
|
-
vi.mocked(chatGpt.generateContent).mockResolvedValueOnce(mockFunctionCalls);
|
|
100
|
-
const result = await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
101
|
-
askQuestion: false,
|
|
102
|
-
disableContextOptimization: true,
|
|
103
|
-
explicitPrompt: 'testx',
|
|
104
|
-
aiService: 'chat-gpt',
|
|
105
|
-
}));
|
|
106
|
-
expect(result).toEqual(mockFunctionCalls);
|
|
107
|
-
expect(chatGpt.generateContent).toHaveBeenCalled();
|
|
108
|
-
});
|
|
109
|
-
it('should process the codegen summary and return the result with Anthropic', async () => {
|
|
110
|
-
vi.mocked(cliParams).aiService = 'anthropic';
|
|
111
|
-
const mockFunctionCalls = [{ name: 'deleteFile', args: { filePath: 'obsolete.js' } }];
|
|
112
|
-
vi.mocked(anthropic.generateContent).mockResolvedValueOnce(mockFunctionCalls);
|
|
113
|
-
const result = await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
114
|
-
askQuestion: false,
|
|
115
|
-
disableContextOptimization: true,
|
|
116
|
-
explicitPrompt: 'testx',
|
|
117
|
-
aiService: 'anthropic',
|
|
118
|
-
}));
|
|
119
|
-
expect(result).toEqual(mockFunctionCalls);
|
|
120
|
-
expect(anthropic.generateContent).toHaveBeenCalled();
|
|
121
|
-
});
|
|
122
|
-
it('should not update files in dry run mode', async () => {
|
|
123
|
-
vi.mocked(cliParams).aiService = 'vertex-ai';
|
|
124
|
-
vi.mocked(cliParams).dryRun = true;
|
|
125
|
-
const mockFunctionCalls = [
|
|
126
|
-
{ name: 'updateFile', args: { filePath: 'test.js', newContent: 'console.log("Dry run");' } },
|
|
127
|
-
];
|
|
128
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockFunctionCalls);
|
|
129
|
-
const result = await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
130
|
-
askQuestion: false,
|
|
131
|
-
disableContextOptimization: true,
|
|
132
|
-
explicitPrompt: 'testx',
|
|
133
|
-
aiService: 'vertex-ai',
|
|
134
|
-
}));
|
|
135
|
-
expect(result).toEqual(mockFunctionCalls);
|
|
136
|
-
expect(vertexAi.generateContent).toHaveBeenCalled();
|
|
137
|
-
});
|
|
138
|
-
it('should handle invalid patchFile call and retry without patchFile function', async () => {
|
|
139
|
-
vi.mocked(cliParams).aiService = 'vertex-ai';
|
|
140
|
-
const mockCodegenSummary = [
|
|
141
|
-
{
|
|
142
|
-
name: 'codegenSummary',
|
|
143
|
-
args: {
|
|
144
|
-
fileUpdates: [{ filePath: '/mocked/root/dir/test.js', updateToolName: 'patchFile', prompt: 'Generate file' }],
|
|
145
|
-
contextPaths: [],
|
|
146
|
-
explanation: 'Mock summary',
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
];
|
|
150
|
-
const mockInvalidPatchCall = [
|
|
151
|
-
{
|
|
152
|
-
name: 'patchFile',
|
|
153
|
-
args: {
|
|
154
|
-
filePath: '/mocked/root/dir/test.js',
|
|
155
|
-
patch: 'invalid patch',
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
];
|
|
159
|
-
const mockValidUpdateCall = [
|
|
160
|
-
{
|
|
161
|
-
name: 'updateFile',
|
|
162
|
-
args: {
|
|
163
|
-
filePath: '/mocked/root/dir/test.js',
|
|
164
|
-
newContent: 'console.log("Updated content");',
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
];
|
|
168
|
-
// Mock the first call to return the codegen summary
|
|
169
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockCodegenSummary);
|
|
170
|
-
// Mock the second call to return an invalid patch
|
|
171
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockInvalidPatchCall);
|
|
172
|
-
// Mock the third call (retry) to return a valid update
|
|
173
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockValidUpdateCall);
|
|
174
|
-
// Mock fs.readFileSync to return some content
|
|
175
|
-
vi.mocked(fs.readFileSync).mockReturnValue('Original content');
|
|
176
|
-
// Mock diff.applyPatch to fail for the invalid patch
|
|
177
|
-
vi.mocked(diff.applyPatch).mockReturnValue(false);
|
|
178
|
-
const result = await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
179
|
-
askQuestion: false,
|
|
180
|
-
disableContextOptimization: true,
|
|
181
|
-
explicitPrompt: 'testx',
|
|
182
|
-
aiService: 'vertex-ai',
|
|
183
|
-
}));
|
|
184
|
-
expect(vertexAi.generateContent).toHaveBeenCalledTimes(3);
|
|
185
|
-
expect(fs.readFileSync).toHaveBeenCalledWith('/mocked/root/dir/test.js', 'utf-8');
|
|
186
|
-
expect(diff.applyPatch).toHaveBeenCalledWith('Original content', 'invalid patch');
|
|
187
|
-
expect(result).toEqual(mockValidUpdateCall);
|
|
188
|
-
});
|
|
189
|
-
it('should include image assets when vision flag is true', async () => {
|
|
190
|
-
vi.mocked(cliParams).aiService = 'chat-gpt';
|
|
191
|
-
vi.mocked(cliParams).vision = true;
|
|
192
|
-
const mockImageAssets = {
|
|
193
|
-
'/path/to/image1.png': { width: 100, height: 100, mimeType: 'image/png' },
|
|
194
|
-
'/path/to/image2.jpg': { width: 200, height: 200, mimeType: 'image/png' },
|
|
195
|
-
};
|
|
196
|
-
const mockFunctionCalls = [
|
|
197
|
-
{ name: 'updateFile', args: { filePath: 'test.js', newContent: 'console.log("Vision test");' } },
|
|
198
|
-
];
|
|
199
|
-
vi.mocked(getImageAssets).mockReturnValue(mockImageAssets);
|
|
200
|
-
vi.mocked(chatGpt.generateContent).mockResolvedValueOnce(mockFunctionCalls);
|
|
201
|
-
await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
202
|
-
askQuestion: false,
|
|
203
|
-
disableContextOptimization: true,
|
|
204
|
-
explicitPrompt: 'testx',
|
|
205
|
-
aiService: 'chat-gpt',
|
|
206
|
-
vision: true,
|
|
207
|
-
}));
|
|
208
|
-
expect(chatGpt.generateContent).toHaveBeenCalled();
|
|
209
|
-
const calls = vi.mocked(chatGpt.generateContent).mock.calls[0];
|
|
210
|
-
expect(calls[0]).toEqual(expect.arrayContaining([
|
|
211
|
-
expect.objectContaining({
|
|
212
|
-
type: 'user',
|
|
213
|
-
text: expect.stringContaining('Hello, GenAIcode'),
|
|
214
|
-
}),
|
|
215
|
-
expect.objectContaining({
|
|
216
|
-
type: 'assistant',
|
|
217
|
-
text: expect.stringContaining('I guess you have a task for me'),
|
|
218
|
-
}),
|
|
219
|
-
expect.objectContaining({
|
|
220
|
-
type: 'user',
|
|
221
|
-
functionResponses: expect.arrayContaining([
|
|
222
|
-
{ name: 'getImageAssets', content: JSON.stringify(mockImageAssets) },
|
|
223
|
-
]),
|
|
224
|
-
}),
|
|
225
|
-
]));
|
|
226
|
-
});
|
|
227
|
-
it('should include image data in the prompt when processing files with vision', async () => {
|
|
228
|
-
vi.mocked(cliParams).aiService = 'chat-gpt';
|
|
229
|
-
vi.mocked(cliParams).vision = true;
|
|
230
|
-
const mockCodegenSummary = [
|
|
231
|
-
{
|
|
232
|
-
name: 'codegenSummary',
|
|
233
|
-
args: {
|
|
234
|
-
fileUpdates: [
|
|
235
|
-
{
|
|
236
|
-
filePath: '/mocked/root/dir/test.js',
|
|
237
|
-
updateToolName: 'updateFile',
|
|
238
|
-
contextImageAssets: ['/mocked/root/dir/image1.png', '/mocked/root/dir/image2.jpg'],
|
|
239
|
-
prompt: 'Generate file update',
|
|
240
|
-
},
|
|
241
|
-
],
|
|
242
|
-
contextPaths: [],
|
|
243
|
-
explanation: 'Mock summary',
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
|
-
];
|
|
247
|
-
const mockUpdateCall = [
|
|
248
|
-
{
|
|
249
|
-
name: 'updateFile',
|
|
250
|
-
args: {
|
|
251
|
-
filePath: '/mocked/root/dir/test.js',
|
|
252
|
-
newContent: 'console.log("Updated with vision");',
|
|
253
|
-
},
|
|
254
|
-
},
|
|
255
|
-
];
|
|
256
|
-
vi.mocked(chatGpt.generateContent).mockResolvedValueOnce(mockCodegenSummary);
|
|
257
|
-
vi.mocked(chatGpt.generateContent).mockResolvedValueOnce(mockUpdateCall);
|
|
258
|
-
vi.mocked(fs.readFileSync).mockImplementation((path) => `mock-base64-data-for-${path}`);
|
|
259
|
-
vi.mocked(mime.lookup).mockImplementation((path) => (path.endsWith('.png') ? 'image/png' : 'image/jpeg'));
|
|
260
|
-
await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
261
|
-
askQuestion: false,
|
|
262
|
-
disableContextOptimization: true,
|
|
263
|
-
explicitPrompt: 'testx',
|
|
264
|
-
aiService: 'chat-gpt',
|
|
265
|
-
vision: true,
|
|
266
|
-
}));
|
|
267
|
-
expect(chatGpt.generateContent).toHaveBeenCalledTimes(2);
|
|
268
|
-
const secondCall = vi.mocked(chatGpt.generateContent).mock.calls[1];
|
|
269
|
-
expect(secondCall[0]).toEqual(expect.arrayContaining([
|
|
270
|
-
expect.objectContaining({
|
|
271
|
-
type: 'user',
|
|
272
|
-
text: expect.stringContaining('Generate file update'),
|
|
273
|
-
images: [
|
|
274
|
-
{
|
|
275
|
-
path: '/mocked/root/dir/image1.png',
|
|
276
|
-
base64url: 'mock-base64-data-for-/mocked/root/dir/image1.png',
|
|
277
|
-
mediaType: 'image/png',
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
path: '/mocked/root/dir/image2.jpg',
|
|
281
|
-
base64url: 'mock-base64-data-for-/mocked/root/dir/image2.jpg',
|
|
282
|
-
mediaType: 'image/jpeg',
|
|
283
|
-
},
|
|
284
|
-
],
|
|
285
|
-
}),
|
|
286
|
-
]));
|
|
287
|
-
});
|
|
288
|
-
it('should not include image assets when vision flag is false', async () => {
|
|
289
|
-
vi.mocked(cliParams).aiService = 'chat-gpt';
|
|
290
|
-
vi.mocked(cliParams).vision = false;
|
|
291
|
-
const mockFunctionCalls = [
|
|
292
|
-
{ name: 'updateFile', args: { filePath: 'test.js', newContent: 'console.log("No vision test");' } },
|
|
293
|
-
];
|
|
294
|
-
vi.mocked(chatGpt.generateContent).mockResolvedValueOnce(mockFunctionCalls);
|
|
295
|
-
await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
296
|
-
askQuestion: false,
|
|
297
|
-
disableContextOptimization: true,
|
|
298
|
-
explicitPrompt: 'testx',
|
|
299
|
-
aiService: 'chat-gpt',
|
|
300
|
-
}));
|
|
301
|
-
expect(chatGpt.generateContent).toHaveBeenCalled();
|
|
302
|
-
const calls = vi.mocked(chatGpt.generateContent).mock.calls[0];
|
|
303
|
-
expect(calls[0]).not.toEqual(expect.arrayContaining([
|
|
304
|
-
expect.objectContaining({
|
|
305
|
-
type: 'user',
|
|
306
|
-
text: expect.stringContaining('I should also provide you with a summary of application image assets'),
|
|
307
|
-
}),
|
|
308
|
-
]));
|
|
309
|
-
});
|
|
310
|
-
it('should handle context optimization', async () => {
|
|
311
|
-
vi.mocked(cliParams).aiService = 'vertex-ai';
|
|
312
|
-
const mockCodegenSummary = [
|
|
313
|
-
{
|
|
314
|
-
name: 'codegenSummary',
|
|
315
|
-
args: {
|
|
316
|
-
fileUpdates: [
|
|
317
|
-
{ filePath: '/mocked/root/dir/test.js', updateToolName: 'updateFile', prompt: 'Generate file' },
|
|
318
|
-
],
|
|
319
|
-
contextPaths: ['/mocked/root/dir/context1.js', '/mocked/root/dir/context2.js'],
|
|
320
|
-
explanation: 'Mock summary with context',
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
|
-
];
|
|
324
|
-
const mockUpdateCall = [
|
|
325
|
-
{
|
|
326
|
-
name: 'updateFile',
|
|
327
|
-
args: {
|
|
328
|
-
filePath: '/mocked/root/dir/test.js',
|
|
329
|
-
newContent: 'console.log("Updated with context");',
|
|
330
|
-
},
|
|
331
|
-
},
|
|
332
|
-
];
|
|
333
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockCodegenSummary);
|
|
334
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockUpdateCall);
|
|
335
|
-
await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
336
|
-
askQuestion: false,
|
|
337
|
-
disableContextOptimization: true,
|
|
338
|
-
explicitPrompt: 'testx',
|
|
339
|
-
aiService: 'vertex-ai',
|
|
340
|
-
}));
|
|
341
|
-
expect(vertexAi.generateContent).toHaveBeenCalledTimes(2);
|
|
342
|
-
const firstCall = vi.mocked(vertexAi.generateContent).mock.calls[0];
|
|
343
|
-
expect(firstCall[0]).toEqual(expect.arrayContaining([
|
|
344
|
-
expect.objectContaining({
|
|
345
|
-
type: 'user',
|
|
346
|
-
functionResponses: [
|
|
347
|
-
expect.objectContaining({
|
|
348
|
-
name: 'getSourceCode',
|
|
349
|
-
content: expect.any(String),
|
|
350
|
-
}),
|
|
351
|
-
],
|
|
352
|
-
}),
|
|
353
|
-
]));
|
|
354
|
-
});
|
|
355
|
-
it('should handle disableContextOptimization flag', async () => {
|
|
356
|
-
vi.mocked(cliParams).aiService = 'vertex-ai';
|
|
357
|
-
vi.mocked(cliParams).disableContextOptimization = true;
|
|
358
|
-
const mockCodegenSummary = [
|
|
359
|
-
{
|
|
360
|
-
name: 'codegenSummary',
|
|
361
|
-
args: {
|
|
362
|
-
fileUpdates: [
|
|
363
|
-
{ filePath: '/mocked/root/dir/test.js', updateToolName: 'updateFile', prompt: 'Generate file' },
|
|
364
|
-
],
|
|
365
|
-
contextPaths: ['/mocked/root/dir/context1.js', '/mocked/root/dir/context2.js'],
|
|
366
|
-
explanation: 'Mock summary without context optimization',
|
|
367
|
-
},
|
|
368
|
-
},
|
|
369
|
-
];
|
|
370
|
-
const mockUpdateCall = [
|
|
371
|
-
{
|
|
372
|
-
name: 'updateFile',
|
|
373
|
-
args: {
|
|
374
|
-
filePath: '/mocked/root/dir/test.js',
|
|
375
|
-
newContent: 'console.log("Updated without context optimization");',
|
|
376
|
-
},
|
|
377
|
-
},
|
|
378
|
-
];
|
|
379
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockCodegenSummary);
|
|
380
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockUpdateCall);
|
|
381
|
-
await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
382
|
-
askQuestion: false,
|
|
383
|
-
disableContextOptimization: true,
|
|
384
|
-
explicitPrompt: 'testx',
|
|
385
|
-
aiService: 'vertex-ai',
|
|
386
|
-
}));
|
|
387
|
-
expect(vertexAi.generateContent).toHaveBeenCalledTimes(2);
|
|
388
|
-
const firstCall = vi.mocked(vertexAi.generateContent).mock.calls[0];
|
|
389
|
-
expect(firstCall[0]).not.toEqual(expect.arrayContaining([
|
|
390
|
-
expect.objectContaining({
|
|
391
|
-
type: 'user',
|
|
392
|
-
functionResponses: [
|
|
393
|
-
expect.objectContaining({
|
|
394
|
-
name: 'getSourceCode',
|
|
395
|
-
content: expect.stringContaining('context1.js'),
|
|
396
|
-
}),
|
|
397
|
-
],
|
|
398
|
-
}),
|
|
399
|
-
]));
|
|
400
|
-
});
|
|
401
|
-
it('should handle image generation requests', async () => {
|
|
402
|
-
vi.mocked(cliParams).aiService = 'vertex-ai';
|
|
403
|
-
vi.mocked(cliParams).imagen = 'dall-e';
|
|
404
|
-
const mockCodegenSummary = [
|
|
405
|
-
{
|
|
406
|
-
name: 'codegenSummary',
|
|
407
|
-
args: {
|
|
408
|
-
fileUpdates: [
|
|
409
|
-
{ filePath: '/mocked/root/dir/image.png', updateToolName: 'generateImage', prompt: 'Generate file' },
|
|
410
|
-
],
|
|
411
|
-
contextPaths: [],
|
|
412
|
-
explanation: 'Mock summary with image generation',
|
|
413
|
-
},
|
|
414
|
-
},
|
|
415
|
-
];
|
|
416
|
-
const mockGenerateImageCall = [
|
|
417
|
-
{
|
|
418
|
-
name: 'generateImage',
|
|
419
|
-
args: {
|
|
420
|
-
prompt: 'A test image',
|
|
421
|
-
filePath: '/mocked/root/dir/image.png',
|
|
422
|
-
width: 256,
|
|
423
|
-
height: 256,
|
|
424
|
-
},
|
|
425
|
-
},
|
|
426
|
-
];
|
|
427
|
-
const mockDownloadFileCall = [
|
|
428
|
-
{
|
|
429
|
-
name: 'downloadFile',
|
|
430
|
-
args: {
|
|
431
|
-
filePath: '/mocked/root/dir/image.png',
|
|
432
|
-
explanation: 'Downloading generated image',
|
|
433
|
-
downloadUrl: 'https://example.com/generated-image.png',
|
|
434
|
-
},
|
|
435
|
-
},
|
|
436
|
-
];
|
|
437
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockCodegenSummary);
|
|
438
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockGenerateImageCall);
|
|
439
|
-
vi.mocked(dalleService.generateImage).mockResolvedValue('https://example.com/generated-image.png');
|
|
440
|
-
const result = await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
441
|
-
askQuestion: false,
|
|
442
|
-
disableContextOptimization: true,
|
|
443
|
-
explicitPrompt: 'testx',
|
|
444
|
-
aiService: 'vertex-ai',
|
|
445
|
-
imagen: 'dall-e',
|
|
446
|
-
}));
|
|
447
|
-
expect(vertexAi.generateContent).toHaveBeenCalledTimes(2);
|
|
448
|
-
expect(dalleService.generateImage).toHaveBeenCalledWith('A test image', undefined, { width: 256, height: 256 }, false);
|
|
449
|
-
expect(result).toEqual(expect.arrayContaining(mockDownloadFileCall));
|
|
450
|
-
});
|
|
451
|
-
it('should handle image generation failure', async () => {
|
|
452
|
-
vi.mocked(cliParams).aiService = 'vertex-ai';
|
|
453
|
-
vi.mocked(cliParams).imagen = 'dall-e';
|
|
454
|
-
const mockCodegenSummary = [
|
|
455
|
-
{
|
|
456
|
-
name: 'codegenSummary',
|
|
457
|
-
args: {
|
|
458
|
-
fileUpdates: [
|
|
459
|
-
{ filePath: '/mocked/root/dir/image.png', updateToolName: 'generateImage', prompt: 'Generate file' },
|
|
460
|
-
],
|
|
461
|
-
contextPaths: [],
|
|
462
|
-
explanation: 'Mock summary with image generation failure',
|
|
463
|
-
},
|
|
464
|
-
},
|
|
465
|
-
];
|
|
466
|
-
const mockGenerateImageCall = [
|
|
467
|
-
{
|
|
468
|
-
name: 'generateImage',
|
|
469
|
-
args: {
|
|
470
|
-
prompt: 'A test image',
|
|
471
|
-
filePath: '/mocked/root/dir/image.png',
|
|
472
|
-
width: 256,
|
|
473
|
-
height: 256,
|
|
474
|
-
},
|
|
475
|
-
},
|
|
476
|
-
];
|
|
477
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockCodegenSummary);
|
|
478
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockGenerateImageCall);
|
|
479
|
-
vi.mocked(dalleService.generateImage).mockRejectedValue(new Error('Image generation failed'));
|
|
480
|
-
const result = await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
481
|
-
askQuestion: false,
|
|
482
|
-
disableContextOptimization: true,
|
|
483
|
-
explicitPrompt: 'testx',
|
|
484
|
-
aiService: 'vertex-ai',
|
|
485
|
-
imagen: 'dall-e',
|
|
486
|
-
}));
|
|
487
|
-
expect(vertexAi.generateContent).toHaveBeenCalledTimes(2);
|
|
488
|
-
expect(dalleService.generateImage).toHaveBeenCalledWith('A test image', undefined, { width: 256, height: 256 }, false);
|
|
489
|
-
expect(result).toEqual(expect.arrayContaining([
|
|
490
|
-
expect.objectContaining({
|
|
491
|
-
name: 'explanation',
|
|
492
|
-
args: {
|
|
493
|
-
text: expect.stringContaining('Failed to generate image: Image generation failed'),
|
|
494
|
-
},
|
|
495
|
-
}),
|
|
496
|
-
]));
|
|
497
|
-
});
|
|
498
|
-
it('should handle unexpected response without codegen summary', async () => {
|
|
499
|
-
vi.mocked(cliParams).aiService = 'vertex-ai';
|
|
500
|
-
const mockUnexpectedResponse = [
|
|
501
|
-
{
|
|
502
|
-
name: 'updateFile',
|
|
503
|
-
args: {
|
|
504
|
-
filePath: '/mocked/root/dir/test.js',
|
|
505
|
-
newContent: 'console.log("Unexpected response");',
|
|
506
|
-
},
|
|
507
|
-
},
|
|
508
|
-
];
|
|
509
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockUnexpectedResponse);
|
|
510
|
-
const result = await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
511
|
-
askQuestion: false,
|
|
512
|
-
disableContextOptimization: true,
|
|
513
|
-
explicitPrompt: 'testx',
|
|
514
|
-
aiService: 'vertex-ai',
|
|
515
|
-
}));
|
|
516
|
-
expect(vertexAi.generateContent).toHaveBeenCalledTimes(1);
|
|
517
|
-
expect(result).toEqual(mockUnexpectedResponse);
|
|
518
|
-
});
|
|
519
|
-
describe('validateAndRecoverSingleResult', () => {
|
|
520
|
-
it('should successfully recover from an invalid function call', async () => {
|
|
521
|
-
vi.mocked(cliParams).aiService = 'vertex-ai';
|
|
522
|
-
const mockInvalidCall = [
|
|
523
|
-
{
|
|
524
|
-
name: 'codegenSummary',
|
|
525
|
-
args: {
|
|
526
|
-
files: [{ filePath: '/mocked/root/dir/test.js', updateToolName: 'updateFile' }],
|
|
527
|
-
contextPaths: [],
|
|
528
|
-
explanation: 'Mock summary',
|
|
529
|
-
},
|
|
530
|
-
},
|
|
531
|
-
];
|
|
532
|
-
const mockValidCall = [
|
|
533
|
-
{
|
|
534
|
-
name: 'codegenSummary',
|
|
535
|
-
args: {
|
|
536
|
-
fileUpdates: [
|
|
537
|
-
{ filePath: '/mocked/root/dir/test.js', updateToolName: 'updateFile', prompt: 'Generate file' },
|
|
538
|
-
],
|
|
539
|
-
contextPaths: [],
|
|
540
|
-
explanation: 'Mock summary',
|
|
541
|
-
},
|
|
542
|
-
},
|
|
543
|
-
];
|
|
544
|
-
vi.mocked(vertexAi.generateContent)
|
|
545
|
-
.mockResolvedValueOnce(mockInvalidCall)
|
|
546
|
-
.mockResolvedValueOnce(mockValidCall)
|
|
547
|
-
.mockResolvedValueOnce([
|
|
548
|
-
{
|
|
549
|
-
name: 'updateFile',
|
|
550
|
-
args: {
|
|
551
|
-
filePath: '/mocked/root/dir/test.js',
|
|
552
|
-
newContent: 'console.log("Unexpected response");',
|
|
553
|
-
},
|
|
554
|
-
},
|
|
555
|
-
]);
|
|
556
|
-
const result = await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
557
|
-
askQuestion: false,
|
|
558
|
-
disableContextOptimization: true,
|
|
559
|
-
explicitPrompt: 'testx',
|
|
560
|
-
aiService: 'vertex-ai',
|
|
561
|
-
}));
|
|
562
|
-
expect(vertexAi.generateContent).toHaveBeenCalledTimes(3);
|
|
563
|
-
expect(result).toEqual([
|
|
564
|
-
{
|
|
565
|
-
args: {
|
|
566
|
-
filePath: '/mocked/root/dir/test.js',
|
|
567
|
-
newContent: 'console.log("Unexpected response");',
|
|
568
|
-
},
|
|
569
|
-
name: 'updateFile',
|
|
570
|
-
},
|
|
571
|
-
]);
|
|
572
|
-
});
|
|
573
|
-
it('should handle unsuccessful recovery', async () => {
|
|
574
|
-
vi.mocked(cliParams).aiService = 'vertex-ai';
|
|
575
|
-
const mockInvalidCall = [
|
|
576
|
-
{
|
|
577
|
-
name: 'updateFile',
|
|
578
|
-
args: { filePath: '/mocked/root/dir/test.js', invalidArg: 'This should not be here' },
|
|
579
|
-
},
|
|
580
|
-
];
|
|
581
|
-
vi.mocked(vertexAi.generateContent)
|
|
582
|
-
.mockResolvedValueOnce([
|
|
583
|
-
{
|
|
584
|
-
name: 'codegenSummary',
|
|
585
|
-
args: {
|
|
586
|
-
fileUpdates: [
|
|
587
|
-
{ filePath: '/mocked/root/dir/test.js', updateToolName: 'patchFile', prompt: 'Generate file' },
|
|
588
|
-
],
|
|
589
|
-
contextPaths: [],
|
|
590
|
-
explanation: 'Mock summary',
|
|
591
|
-
},
|
|
592
|
-
},
|
|
593
|
-
])
|
|
594
|
-
.mockResolvedValueOnce(mockInvalidCall)
|
|
595
|
-
.mockResolvedValueOnce(mockInvalidCall)
|
|
596
|
-
.mockResolvedValueOnce(mockInvalidCall); // Second call also returns invalid result
|
|
597
|
-
await expect(promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
598
|
-
askQuestion: false,
|
|
599
|
-
disableContextOptimization: true,
|
|
600
|
-
explicitPrompt: 'testx',
|
|
601
|
-
aiService: 'vertex-ai',
|
|
602
|
-
}))).rejects.toThrow('Recovery failed');
|
|
603
|
-
expect(vertexAi.generateContent).toHaveBeenCalledTimes(4);
|
|
604
|
-
});
|
|
605
|
-
it('should not attempt recovery for multiple valid function calls', async () => {
|
|
606
|
-
vi.mocked(cliParams).aiService = 'vertex-ai';
|
|
607
|
-
const mockValidCalls = [
|
|
608
|
-
{
|
|
609
|
-
name: 'updateFile',
|
|
610
|
-
args: { filePath: 'test1.js', newContent: 'console.log("File 1");' },
|
|
611
|
-
},
|
|
612
|
-
{
|
|
613
|
-
name: 'updateFile',
|
|
614
|
-
args: { filePath: 'test2.js', newContent: 'console.log("File 2");' },
|
|
615
|
-
},
|
|
616
|
-
];
|
|
617
|
-
vi.mocked(vertexAi.generateContent).mockResolvedValueOnce(mockValidCalls);
|
|
618
|
-
const result = await promptService(GENERATE_CONTENT_FNS, GENERATE_IMAGE_FNS, getCodeGenPrompt({
|
|
619
|
-
askQuestion: false,
|
|
620
|
-
disableContextOptimization: true,
|
|
621
|
-
explicitPrompt: 'testx',
|
|
622
|
-
aiService: 'vertex-ai',
|
|
623
|
-
}));
|
|
624
|
-
expect(vertexAi.generateContent).toHaveBeenCalledTimes(1);
|
|
625
|
-
expect(result).toEqual(mockValidCalls);
|
|
626
|
-
});
|
|
627
|
-
});
|
|
628
|
-
});
|
|
629
|
-
//# sourceMappingURL=prompt-service.test.js.map
|