genaicode 0.14.1 → 0.15.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 -18
- package/dist/ai-service/ai-studio.js +88 -32
- package/dist/ai-service/ai-studio.js.map +1 -1
- package/dist/ai-service/anthropic.js +87 -45
- package/dist/ai-service/anthropic.js.map +1 -1
- package/dist/ai-service/common-types.d.ts +36 -3
- package/dist/ai-service/common-types.js +0 -2
- package/dist/ai-service/common-types.js.map +1 -1
- package/dist/ai-service/common.js +0 -2
- package/dist/ai-service/common.js.map +1 -1
- package/dist/ai-service/files-api.d.ts +33 -0
- package/dist/ai-service/files-api.js +239 -0
- package/dist/ai-service/files-api.js.map +1 -0
- package/dist/ai-service/github-models.js +0 -2
- package/dist/ai-service/github-models.js.map +1 -1
- package/dist/ai-service/local-llm.js +0 -4
- package/dist/ai-service/local-llm.js.map +1 -1
- package/dist/ai-service/openai-responses.js +62 -16
- package/dist/ai-service/openai-responses.js.map +1 -1
- package/dist/ai-service/openai.js +157 -54
- package/dist/ai-service/openai.js.map +1 -1
- package/dist/ai-service/service-configurations-types.d.ts +0 -1
- package/dist/ai-service/service-configurations.js +19 -20
- package/dist/ai-service/service-configurations.js.map +1 -1
- package/dist/ai-service/vertex-ai.js +2 -1
- package/dist/ai-service/vertex-ai.js.map +1 -1
- package/dist/cli/cli-params.js +2 -2
- package/dist/cli/cli-params.js.map +1 -1
- package/dist/files/file-id-utils.js +1 -1
- package/dist/files/file-id-utils.js.map +1 -1
- package/dist/files/read-files.js +10 -6
- package/dist/files/read-files.js.map +1 -1
- package/dist/files/source-code-types.d.ts +9 -5
- package/dist/files/source-code-utils.d.ts +2 -1
- package/dist/files/source-code-utils.js +30 -12
- package/dist/files/source-code-utils.js.map +1 -1
- package/dist/files/summary-cache.d.ts +6 -4
- package/dist/files/summary-cache.js +3 -2
- package/dist/files/summary-cache.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main/codegen-types.d.ts +2 -2
- package/dist/main/common/content-bus-types.d.ts +14 -0
- package/dist/main/common/content-bus.d.ts +3 -1
- package/dist/main/common/content-bus.js +28 -3
- package/dist/main/common/content-bus.js.map +1 -1
- package/dist/main/common/user-actions.d.ts +1 -1
- package/dist/main/config-types.d.ts +0 -3
- package/dist/main/config-types.js.map +1 -1
- package/dist/main/config.js +1 -1
- package/dist/main/config.js.map +1 -1
- package/dist/main/plugin-loader.d.ts +1 -1
- package/dist/main/ui/backend/endpoints/compress-context-endpoint.d.ts +1 -0
- package/dist/main/ui/backend/endpoints/compress-context-endpoint.js +18 -0
- package/dist/main/ui/backend/endpoints/compress-context-endpoint.js.map +1 -0
- package/dist/main/ui/backend/endpoints/config-endpoint.js +1 -1
- package/dist/main/ui/backend/endpoints/config-endpoint.js.map +1 -1
- package/dist/main/ui/backend/endpoints/context-endpoint.js +102 -0
- package/dist/main/ui/backend/endpoints/context-endpoint.js.map +1 -1
- package/dist/main/ui/backend/endpoints/edit-message-endpoint.js +9 -6
- package/dist/main/ui/backend/endpoints/edit-message-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/endpoints/interrupt-execution-endpoint.js +1 -1
- package/dist/main/ui/backend/endpoints/interrupt-execution-endpoint.js.map +1 -1
- package/dist/main/ui/backend/service.d.ts +68 -7
- package/dist/main/ui/backend/service.js +301 -28
- package/dist/main/ui/backend/service.js.map +1 -1
- package/dist/main/ui/codegen-ui.js +2 -2
- package/dist/main/ui/codegen-ui.js.map +1 -1
- package/dist/main/ui/common/api-types.d.ts +6 -2
- package/dist/main/ui/common/api-types.js.map +1 -1
- package/dist/main/ui/frontend/assets/index-DAM_kJhM.js +3445 -0
- package/dist/main/ui/frontend/index.html +1 -1
- package/dist/prompt/context-utils.d.ts +7 -0
- package/dist/prompt/context-utils.js +33 -0
- package/dist/prompt/context-utils.js.map +1 -0
- package/dist/prompt/function-calling.js +4 -5
- package/dist/prompt/function-calling.js.map +1 -1
- package/dist/prompt/function-defs/code-execution.d.ts +7 -0
- package/dist/prompt/function-defs/code-execution.js +27 -0
- package/dist/prompt/function-defs/code-execution.js.map +1 -0
- package/dist/prompt/function-defs/conversation-graph.d.ts +1 -1
- package/dist/prompt/function-defs/conversation-graph.js +1 -1
- package/dist/prompt/function-defs/conversation-graph.js.map +1 -1
- package/dist/prompt/function-defs/get-source-code.js +3 -3
- package/dist/prompt/function-defs/iterate.d.ts +20 -0
- package/dist/prompt/function-defs/iterate.js +373 -0
- package/dist/prompt/function-defs/iterate.js.map +1 -0
- package/dist/prompt/function-defs/set-summaries.js +6 -2
- package/dist/prompt/function-defs/set-summaries.js.map +1 -1
- package/dist/prompt/limits.js +1 -1
- package/dist/prompt/prompt-service.js +13 -10
- package/dist/prompt/prompt-service.js.map +1 -1
- package/dist/prompt/source-code-optimize.d.ts +2 -0
- package/dist/prompt/source-code-optimize.js +27 -0
- package/dist/prompt/source-code-optimize.js.map +1 -0
- package/dist/prompt/steps/step-ask-question/step-ask-question.js +7 -1
- package/dist/prompt/steps/step-ask-question/step-ask-question.js.map +1 -1
- package/dist/prompt/steps/step-codegen-planning.js +6 -2
- package/dist/prompt/steps/step-codegen-planning.js.map +1 -1
- package/dist/prompt/steps/step-context-compression.js +5 -0
- package/dist/prompt/steps/step-context-compression.js.map +1 -1
- package/dist/prompt/steps/step-context-optimization.js +6 -3
- package/dist/prompt/steps/step-context-optimization.js.map +1 -1
- package/dist/prompt/steps/step-iterate/handlers/container-task/command-execution-loop.d.ts +7 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/command-execution-loop.js +301 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/command-execution-loop.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/complete-task.d.ts +4 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/complete-task.js +49 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/complete-task.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/copy-from-container.d.ts +4 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/copy-from-container.js +190 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/copy-from-container.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/copy-to-container.d.ts +4 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/copy-to-container.js +139 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/copy-to-container.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/edit-file.d.ts +10 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/edit-file.js +93 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/edit-file.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/fail-task.d.ts +4 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/fail-task.js +72 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/fail-task.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/gain-knowledge.d.ts +10 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/gain-knowledge.js +125 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/gain-knowledge.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/interrupt-controller.d.ts +19 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/interrupt-controller.js +33 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/interrupt-controller.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/query-knowledge.d.ts +8 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/query-knowledge.js +85 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/query-knowledge.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/request-secret.d.ts +6 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/request-secret.js +122 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/request-secret.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/run-command.d.ts +7 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/run-command.js +146 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/run-command.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/send-message.d.ts +4 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/send-message.js +56 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/send-message.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/set-execution-plan.d.ts +4 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/set-execution-plan.js +56 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/set-execution-plan.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/update-execution-plan.d.ts +4 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/update-execution-plan.js +39 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/update-execution-plan.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/view-file.d.ts +10 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/view-file.js +95 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/view-file.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/web-search.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/web-search.js +96 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/web-search.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/wrap-context.d.ts +4 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/wrap-context.js +123 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/commands/wrap-context.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/container-commands-registry.d.ts +11 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/container-commands-registry.js +50 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/container-commands-registry.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/container-commands-types.d.ts +28 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/container-commands-types.js +2 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/container-commands-types.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/container-task-orchestrator.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/container-task-orchestrator.js +202 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/container-task-orchestrator.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/utils/docker-check.d.ts +4 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/utils/docker-check.js +15 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/utils/docker-check.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/utils/docker-utils.d.ts +50 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/utils/docker-utils.js +358 -0
- package/dist/prompt/steps/step-iterate/handlers/container-task/utils/docker-utils.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/file-request-utils.d.ts +47 -0
- package/dist/prompt/steps/step-iterate/handlers/file-request-utils.js +114 -0
- package/dist/prompt/steps/step-iterate/handlers/file-request-utils.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-code-execution.d.ts +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-code-execution.js +133 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-code-execution.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-code-generation.d.ts +4 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-code-generation.js +177 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-code-generation.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-compound-action.d.ts +20 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-compound-action.js +305 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-compound-action.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-confirm-code-generation.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-confirm-code-generation.js +40 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-confirm-code-generation.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-context-compression.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-context-compression.js +35 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-context-compression.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-context-optimization.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-context-optimization.js +34 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-context-optimization.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-conversation-graph.d.ts +11 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-conversation-graph.js +503 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-conversation-graph.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-create-file.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-create-file.js +159 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-create-file.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-end-conversation.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-end-conversation.js +30 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-end-conversation.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-explore-external-directories.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-explore-external-directories.js +280 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-explore-external-directories.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-genaicode-help.d.ts +8 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-genaicode-help.js +105 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-genaicode-help.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-generate-image.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-generate-image.js +110 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-generate-image.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-perform-analysis.d.ts +6 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-perform-analysis.js +110 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-perform-analysis.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-project-command.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-project-command.js +280 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-project-command.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-pull-app-context.d.ts +9 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-pull-app-context.js +94 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-pull-app-context.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-pull-console-logs.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-pull-console-logs.js +174 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-pull-console-logs.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-push-app-context.d.ts +9 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-push-app-context.js +104 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-push-app-context.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-read-external-files.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-read-external-files.js +149 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-read-external-files.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-reasoning-inference.d.ts +7 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-reasoning-inference.js +119 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-reasoning-inference.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-remove-files-from-context.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-remove-files-from-context.js +100 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-remove-files-from-context.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-request-files-content.d.ts +8 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-request-files-content.js +146 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-request-files-content.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-request-files-fragments.d.ts +8 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-request-files-fragments.js +197 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-request-files-fragments.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-request-git-context.d.ts +3 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-request-git-context.js +251 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-request-git-context.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-request-permissions.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-request-permissions.js +83 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-request-permissions.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-run-bash-command.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-run-bash-command.js +185 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-run-bash-command.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-run-container-task.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-run-container-task.js +7 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-run-container-task.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-search-code.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-search-code.js +96 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-search-code.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-send-message.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-send-message.js +21 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-send-message.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-structured-question.d.ts +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-structured-question.js +72 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-structured-question.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-update-file.d.ts +2 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-update-file.js +161 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-update-file.js.map +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-web-search.d.ts +1 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-web-search.js +85 -0
- package/dist/prompt/steps/step-iterate/handlers/handle-web-search.js.map +1 -0
- package/dist/prompt/steps/step-iterate/iterate-handler.d.ts +4 -0
- package/dist/prompt/steps/step-iterate/iterate-handler.js +14 -0
- package/dist/prompt/steps/step-iterate/iterate-handler.js.map +1 -0
- package/dist/prompt/steps/step-iterate/step-iterate-handlers.d.ts +3 -0
- package/dist/prompt/steps/step-iterate/step-iterate-handlers.js +5 -0
- package/dist/prompt/steps/step-iterate/step-iterate-handlers.js.map +1 -0
- package/dist/prompt/steps/step-iterate/step-iterate-types.d.ts +255 -0
- package/dist/prompt/steps/step-iterate/step-iterate-types.js +2 -0
- package/dist/prompt/steps/step-iterate/step-iterate-types.js.map +1 -0
- package/dist/prompt/steps/step-iterate/step-iterate.d.ts +37 -0
- package/dist/prompt/steps/step-iterate/step-iterate.js +132 -0
- package/dist/prompt/steps/step-iterate/step-iterate.js.map +1 -0
- package/dist/prompt/steps/step-summarization.js +9 -19
- package/dist/prompt/steps/step-summarization.js.map +1 -1
- package/dist/prompt/systemprompt.js +93 -168
- package/dist/prompt/systemprompt.js.map +1 -1
- package/dist/prompt/token-estimator.js +1 -1
- package/dist/prompt/token-estimator.js.map +1 -1
- package/dist/vite-genaicode/console-interceptor.d.ts +19 -6
- package/dist/vite-genaicode/console-interceptor.js +45 -13
- package/dist/vite-genaicode/console-interceptor.js.map +1 -1
- package/dist/vite-genaicode/vite-genaicode-frontend.js +1 -1
- package/dist/vite-genaicode/vite-genaicode-frontend.js.map +1 -1
- package/package.json +7 -6
- package/dist/main/ui/frontend/assets/index-5-emJmrg.js +0 -2881
package/dist/prompt/steps/step-iterate/handlers/container-task/commands/query-knowledge.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-knowledge.js","sourceRoot":"","sources":["../../../../../../../src/prompt/steps/step-iterate/handlers/container-task/commands/query-knowledge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAA4B,MAAM,8CAA8C,CAAC;AAEhH,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAErF,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAE/E,MAAM,CAAC,MAAM,iBAAiB,GAAgB;IAC5C,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,kLAAkL;IACpL,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0DAA0D;aACxE;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6DAA6D;aAC3E;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC;KACnC;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,KAA8B;IACvE,MAAM,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACvE,MAAM,IAAI,GAAG,YAAY,CAAC,IAA0B,CAAC;IAErD,I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} from '../../../../../../ai-service/common-types.js';
|
|
2
|
+
import { CommandHandlerBaseProps, CommandHandlerResult } from '../container-commands-types.js';
|
|
3
|
+
export declare const requestSecretDef: FunctionDef;
|
|
4
|
+
export declare function sanitizePrompt(prompt: PromptItem[]): PromptItem[];
|
|
5
|
+
export declare function registerSecret(secret: string): void;
|
|
6
|
+
export declare function handleRequestSecret(props: CommandHandlerBaseProps): Promise<CommandHandlerResult>;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { putAssistantMessage, putContainerLog, putSystemMessage } from '../../../../../../main/common/content-bus.js';
|
|
3
|
+
import { askUserForSecret } from '../../../../../../main/common/user-actions.js';
|
|
4
|
+
import { executeCommand } from '../utils/docker-utils.js';
|
|
5
|
+
export const requestSecretDef = {
|
|
6
|
+
name: 'requestSecret',
|
|
7
|
+
description: 'Requests a secret value from the user (e.g., API key). The value is then written to a specified file path inside the container. The secret value itself is NOT added to the conversation history for security.',
|
|
8
|
+
parameters: {
|
|
9
|
+
type: 'object',
|
|
10
|
+
properties: {
|
|
11
|
+
reasoning: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
description: 'Explanation of why this secret is needed for the task.',
|
|
14
|
+
},
|
|
15
|
+
key: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: 'A short, descriptive name for the secret being requested (e.g., "OPENAI_API_KEY").',
|
|
18
|
+
},
|
|
19
|
+
description: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'A user-friendly message explaining what secret is needed (e.g., "Please enter your OpenAI API key.").',
|
|
22
|
+
},
|
|
23
|
+
destinationFilePath: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: 'The absolute path inside the container where the secret should be saved (e.g., "/root/.config/openai/credentials").',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
required: ['reasoning', 'key', 'description', 'destinationFilePath'],
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const secretsRegistry = [];
|
|
32
|
+
export function sanitizePrompt(prompt) {
|
|
33
|
+
let json = JSON.stringify(prompt);
|
|
34
|
+
for (const secret of secretsRegistry) {
|
|
35
|
+
const escapedSecret = secret.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
36
|
+
const regex = new RegExp(escapedSecret, 'g');
|
|
37
|
+
json = json.replace(regex, '[REDACTED]');
|
|
38
|
+
}
|
|
39
|
+
return JSON.parse(json);
|
|
40
|
+
}
|
|
41
|
+
export function registerSecret(secret) {
|
|
42
|
+
if (!secretsRegistry.includes(secret)) {
|
|
43
|
+
secretsRegistry.push(secret);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export async function handleRequestSecret(props) {
|
|
47
|
+
const { actionResult, taskExecutionPrompt, container } = props;
|
|
48
|
+
const args = actionResult.args;
|
|
49
|
+
const { reasoning, key, description, destinationFilePath } = args;
|
|
50
|
+
putContainerLog('info', `Requesting secret: ${reasoning}`, args, 'command');
|
|
51
|
+
const secretValue = await askUserForSecret(description);
|
|
52
|
+
putAssistantMessage(description);
|
|
53
|
+
if (secretValue) {
|
|
54
|
+
putSystemMessage('Secret received. Writing to container...');
|
|
55
|
+
registerSecret(secretValue);
|
|
56
|
+
try {
|
|
57
|
+
const dirname = path.dirname(destinationFilePath);
|
|
58
|
+
const mkdirResult = await executeCommand(container, '/bin/sh', `mkdir -p "${dirname}"`, undefined, '/');
|
|
59
|
+
if (mkdirResult.exitCode !== 0) {
|
|
60
|
+
throw new Error(`Failed to create directory ${dirname}: ${mkdirResult.output}`);
|
|
61
|
+
}
|
|
62
|
+
const command = `tee "${destinationFilePath}"`;
|
|
63
|
+
const result = await executeCommand(container, '/bin/sh', command, secretValue, '/');
|
|
64
|
+
if (result.exitCode !== 0) {
|
|
65
|
+
throw new Error(`Failed to write secret to file: ${result.output}`);
|
|
66
|
+
}
|
|
67
|
+
putContainerLog('success', `Secret "${key}" received and saved to ${destinationFilePath}.`);
|
|
68
|
+
taskExecutionPrompt.push({
|
|
69
|
+
type: 'assistant',
|
|
70
|
+
text: `Requesting secret with reasoning: ${reasoning}`,
|
|
71
|
+
functionCalls: [actionResult],
|
|
72
|
+
}, {
|
|
73
|
+
type: 'user',
|
|
74
|
+
functionResponses: [
|
|
75
|
+
{
|
|
76
|
+
name: actionResult.name,
|
|
77
|
+
call_id: actionResult.id || undefined,
|
|
78
|
+
content: `Secret for key "${key}" has been provided by the user and saved to ${destinationFilePath}.`,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
85
|
+
putContainerLog('error', `Failed to save secret for key "${key}": ${errorMessage}`);
|
|
86
|
+
taskExecutionPrompt.push({
|
|
87
|
+
type: 'assistant',
|
|
88
|
+
text: `Requesting secret with reasoning: ${reasoning}`,
|
|
89
|
+
functionCalls: [actionResult],
|
|
90
|
+
}, {
|
|
91
|
+
type: 'user',
|
|
92
|
+
functionResponses: [
|
|
93
|
+
{
|
|
94
|
+
name: actionResult.name,
|
|
95
|
+
call_id: actionResult.id || undefined,
|
|
96
|
+
content: `Failed to save secret for key "${key}": ${errorMessage}`,
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
putSystemMessage('User cancelled providing the secret.');
|
|
104
|
+
putContainerLog('warn', `User did not provide secret for key "${key}".`);
|
|
105
|
+
taskExecutionPrompt.push({
|
|
106
|
+
type: 'assistant',
|
|
107
|
+
text: `Requesting secret with reasoning: ${reasoning}`,
|
|
108
|
+
functionCalls: [actionResult],
|
|
109
|
+
}, {
|
|
110
|
+
type: 'user',
|
|
111
|
+
functionResponses: [
|
|
112
|
+
{
|
|
113
|
+
name: actionResult.name,
|
|
114
|
+
call_id: actionResult.id || undefined,
|
|
115
|
+
content: `User cancelled providing secret for key "${key}".`,
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return { shouldBreakOuter: false, commandsExecutedIncrement: 1 };
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=request-secret.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-secret.js","sourceRoot":"","sources":["../../../../../../../src/prompt/steps/step-iterate/handlers/container-task/commands/request-secret.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACtH,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,MAAM,CAAC,MAAM,gBAAgB,GAAgB;IAC3C,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,gNAAgN;IAClN,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wDAAwD;aACtE;YACD,GAAG,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oFAAoF;aAClG;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,uGAAuG;aAC1G;YACD,mBAAmB,EAAE;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,qHAAqH;aACxH;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,qBAAqB,CAAC;KACrE;CACF,CAAC;AASF,MAAM,eAAe,GAAa,EAAE,CAAC;AAErC,MAAM,UAAU,cAAc,CAAC,MAAoB;IACjD,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;QACrC,MAAM,aAAa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C,SAAS,EAAE;gBACtD,aAAa,EAAE,CAAC,YAAY,CAAC;aAC9B,EACD;gBACE,IAAI,EAAE,MAAM;gBACZ,iBAAiB,EAAE;oBACjB;wBACE,IAAI,EAAE,YAAY,CAAC,IAAI;wBACvB,OAAO,EAAE,YAAY,CAAC,EAAE,IAAI,SAAS;wBACrC,OAAO,EAAE,kCAAkC,GAAG,MAAM,YAAY,EAAE;qBACnE;iBACF;aACF,CACF,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,CAAC;QACN,gBAAgB,CAAC,sCAAsC,CAAC,CAAC;QACzD,eAAe,CAAC,MAAM,EAAE,wCAAwC,GAAG,IAAI,CAAC,CAAC;QACzE,mBAAmB,CAAC,IAAI,CACtB;YACE,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,qCAAqC,SAAS,EAAE;YACtD,aAAa,EAAE,CAAC,YAAY,CAAC;SAC9B,EACD;YACE,IAAI,EAAE,MAAM;YACZ,iBAAiB,EAAE;gBACjB;oBACE,IAAI,EAAE,YAAY,CAAC,IAAI;oBACvB,OAAO,EAAE,YAAY,CAAC,EAAE,IAAI,SAAS;oBACrC,OAAO,EAAE,4CAA4C,GAAG,IAAI;iBAC7D;aACF;SACF,CACF,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAAC,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FunctionDef } from '../../../../../../ai-service/common-types.js';
|
|
2
|
+
import { CommandHandlerBaseProps, CommandHandlerResult } from '../container-commands-types.js';
|
|
3
|
+
export declare const runCommandDef: FunctionDef;
|
|
4
|
+
export interface HandleRunCommandProps extends CommandHandlerBaseProps {
|
|
5
|
+
maxOutputLength: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function handleRunCommand(props: HandleRunCommandProps): Promise<CommandHandlerResult>;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { putContainerLog } from '../../../../../../main/common/content-bus.js';
|
|
2
|
+
import { executeCommand } from '../utils/docker-utils.js';
|
|
3
|
+
import { abortController as globalAbortController } from '../../../../../../main/common/abort-controller.js';
|
|
4
|
+
import { onInterruptRequested } from './interrupt-controller.js';
|
|
5
|
+
export const runCommandDef = {
|
|
6
|
+
name: 'runCommand',
|
|
7
|
+
description: `Execute a shell command in the Docker container in non-interactive mode using docker exec. It will do equivalent of /bin/bash -c "command" (or /bin/sh -c "command").
|
|
8
|
+
IMPORTANT:
|
|
9
|
+
- The shell by default is using /bin/sh - take this into account when running commands.
|
|
10
|
+
- The command will block you until it completes, so consider using a non-blocking approach if needed.
|
|
11
|
+
- Ensure you are going to run command in non interactive mode, so that it will not block waiting for input, which will not come.
|
|
12
|
+
- For complex/long input you should prefer \`stdin\` over command-line arguments. For example instead of echo \`some long text\`, you can put the long text in the \`stdin\` field, and then use it in the command like this: \`cat | some_command\`.
|
|
13
|
+
- State of shell is not persistent across commands, so you need to set up the environment each time (think how to do it effectively).
|
|
14
|
+
`,
|
|
15
|
+
parameters: {
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
reasoning: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'Explanation of why this command is needed for the task.',
|
|
21
|
+
},
|
|
22
|
+
shell: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
description: 'The shell to use for executing the command. CAUTION: some docker images do not have bash pre-installed! Bash should be the preferred shell.',
|
|
25
|
+
enum: ['bash', '/bin/sh'],
|
|
26
|
+
},
|
|
27
|
+
command: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'The shell command to execute in the container. Command must be 256 characters or less. If there is a need for a longer command, consider using a script file, and consider using `stdin` to pass the script contents.',
|
|
30
|
+
maxLength: 256,
|
|
31
|
+
},
|
|
32
|
+
stdin: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
description: 'Input to provide to the command via stdin. Equivalent of `echo <stdin> | <command>`. Very good for long inputs, better than passing as command-line arguments in the command string parameter.',
|
|
35
|
+
},
|
|
36
|
+
truncMode: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'Mode for truncating command output (e.g., "start", "end").',
|
|
39
|
+
enum: ['start', 'end'],
|
|
40
|
+
},
|
|
41
|
+
timeout: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
description: 'How long to wait for the command to complete.',
|
|
44
|
+
enum: ['10sec', '30sec', '1min', '2min', '5min', '10min', '15min'],
|
|
45
|
+
},
|
|
46
|
+
workingDir: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'Working directory (ALREADY EXISTING) inside the container to run the command in. This MUST be an absolute path.',
|
|
49
|
+
minLength: 1,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
required: ['reasoning', 'shell', 'command', 'stdin', 'workingDir', 'truncMode', 'timeout'],
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
export async function handleRunCommand(props) {
|
|
56
|
+
const { actionResult, taskExecutionPrompt, container, maxOutputLength } = props;
|
|
57
|
+
const args = actionResult.args;
|
|
58
|
+
const { shell, command, workingDir, reasoning, stdin, truncMode, timeout } = args;
|
|
59
|
+
putContainerLog('info', `Executing command: ${reasoning}`, args, 'command');
|
|
60
|
+
const localController = new AbortController();
|
|
61
|
+
const onGlobalAbort = () => localController.abort();
|
|
62
|
+
globalAbortController?.signal.addEventListener('abort', onGlobalAbort);
|
|
63
|
+
let abortTimeout;
|
|
64
|
+
let output = '';
|
|
65
|
+
let exitCode = 0;
|
|
66
|
+
const clearInterruptListener = onInterruptRequested(() => localController.abort());
|
|
67
|
+
try {
|
|
68
|
+
const timeoutSeconds = parseTimeout(timeout);
|
|
69
|
+
abortTimeout = setTimeout(() => localController.abort(), timeoutSeconds * 1000);
|
|
70
|
+
const result = await executeCommand(container, shell, command, stdin, workingDir, localController.signal);
|
|
71
|
+
output = result.output;
|
|
72
|
+
exitCode = result.exitCode;
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
const errMessage = e instanceof Error ? e.message : String(e);
|
|
76
|
+
putContainerLog('error', 'An error occurred while executing the command', { error: errMessage });
|
|
77
|
+
taskExecutionPrompt.push({
|
|
78
|
+
type: 'assistant',
|
|
79
|
+
text: `Executing command with reasoning: ${reasoning}`,
|
|
80
|
+
functionCalls: [actionResult],
|
|
81
|
+
}, {
|
|
82
|
+
type: 'user',
|
|
83
|
+
functionResponses: [
|
|
84
|
+
{
|
|
85
|
+
name: actionResult.name,
|
|
86
|
+
call_id: actionResult.id || undefined,
|
|
87
|
+
content: `Command execution failed: ${errMessage}`,
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
});
|
|
91
|
+
return { shouldBreakOuter: false, commandsExecutedIncrement: 1 };
|
|
92
|
+
}
|
|
93
|
+
finally {
|
|
94
|
+
clearTimeout(abortTimeout);
|
|
95
|
+
globalAbortController?.signal.removeEventListener('abort', onGlobalAbort);
|
|
96
|
+
clearInterruptListener();
|
|
97
|
+
}
|
|
98
|
+
let managedOutput = output;
|
|
99
|
+
if (output.length > maxOutputLength) {
|
|
100
|
+
if (truncMode === 'start') {
|
|
101
|
+
managedOutput = output.slice(0, maxOutputLength) + '\n\n[... output truncated for context management ...]';
|
|
102
|
+
}
|
|
103
|
+
else if (truncMode === 'end') {
|
|
104
|
+
managedOutput = '[... output truncated for context management ...]' + output.slice(-maxOutputLength);
|
|
105
|
+
}
|
|
106
|
+
putContainerLog('warn', `Command output truncated (${output.length} -> ${managedOutput.length} chars)`);
|
|
107
|
+
}
|
|
108
|
+
putContainerLog('info', 'Command executed', { command, managedOutput, exitCode }, 'command');
|
|
109
|
+
taskExecutionPrompt.push({
|
|
110
|
+
type: 'assistant',
|
|
111
|
+
text: `Executing command with reasoning: ${reasoning}`,
|
|
112
|
+
functionCalls: [actionResult],
|
|
113
|
+
}, {
|
|
114
|
+
type: 'user',
|
|
115
|
+
functionResponses: [
|
|
116
|
+
{
|
|
117
|
+
name: actionResult.name,
|
|
118
|
+
call_id: actionResult.id || undefined,
|
|
119
|
+
content: `Command executed successfully.\n\nOutput:\n${managedOutput}\n\nExit Code: ${exitCode}`,
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
});
|
|
123
|
+
return { shouldBreakOuter: false, commandsExecutedIncrement: 1 };
|
|
124
|
+
}
|
|
125
|
+
// Parse timeout values
|
|
126
|
+
function parseTimeout(timeout) {
|
|
127
|
+
switch (timeout) {
|
|
128
|
+
case '10sec':
|
|
129
|
+
return 10;
|
|
130
|
+
case '30sec':
|
|
131
|
+
return 30;
|
|
132
|
+
case '1min':
|
|
133
|
+
return 60;
|
|
134
|
+
case '2min':
|
|
135
|
+
return 120;
|
|
136
|
+
case '5min':
|
|
137
|
+
return 300;
|
|
138
|
+
case '10min':
|
|
139
|
+
return 600;
|
|
140
|
+
case '15min':
|
|
141
|
+
return 900;
|
|
142
|
+
default:
|
|
143
|
+
throw new Error(`Unknown timeout value: ${timeout}`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=run-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-command.js","sourceRoot":"","sources":["../../../../../../../src/prompt/steps/step-iterate/handlers/container-task/commands/run-command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,CAAC,MAAM,aAAa,GAAgB;IACxC,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE;;;;;;;GAOZ;IACD,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yDAAyD;aACvE;YAC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BACvB,OAAO,EAAE,YAAY,CAAC,EAAE,IAAI,SAAS;gBACrC,OAAO,EAAE,8CAA8C,aAAa,kBAAkB,QAAQ,EAAE;aACjG;SACF;KACF,CACF,CAAC;IAEF,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAAC,EAAE,CAAC;AACnE,CAAC;AAED,uBAAuB;AACvB,SAAS,YAAY,CAAC,OAAkC;IACtD,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO;YACV,OAAO,EAAE,CAAC;QACZ,KAAK,OAAO;YACV,OAAO,EAAE,CAAC;QACZ,KAAK,MAAM;YACT,OAAO,EAAE,CAAC;QACZ,KAAK,MAAM;YACT,OAAO,GAAG,CAAC;QACb,KAAK,MAAM;YACT,OAAO,GAAG,CAAC;QACb,KAAK,OAAO;YACV,OAAO,GAAG,CAAC;QACb,KAAK,OAAO;YACV,OAAO,GAAG,CAAC;QACb;YACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FunctionDef } from '../../../../../../ai-service/common-types.js';
|
|
2
|
+
import { CommandHandlerBaseProps, CommandHandlerResult } from '../container-commands-types.js';
|
|
3
|
+
export declare const sendMessageDef: FunctionDef;
|
|
4
|
+
export declare function handleSendMessage(props: Pick<CommandHandlerBaseProps, 'actionResult' | 'taskExecutionPrompt' | 'options'>): Promise<CommandHandlerResult>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { putAssistantMessage, putUserMessage } from '../../../../../../main/common/content-bus.js';
|
|
2
|
+
import { askUserForInput } from '../../../../../../main/common/user-actions.js';
|
|
3
|
+
export const sendMessageDef = {
|
|
4
|
+
name: 'sendMessage',
|
|
5
|
+
description: 'Send a message to the user, either to inform them about something, or ask them a question, or answer their question.',
|
|
6
|
+
parameters: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
message: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
description: 'The message to send to the user.',
|
|
12
|
+
},
|
|
13
|
+
waitForUserResponse: {
|
|
14
|
+
type: 'boolean',
|
|
15
|
+
description: 'Whether the message is a question, and user input is expected.',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
required: ['message', 'waitForUserResponse'],
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export async function handleSendMessage(props) {
|
|
22
|
+
const { actionResult, taskExecutionPrompt, options } = props;
|
|
23
|
+
const args = actionResult.args;
|
|
24
|
+
taskExecutionPrompt.push({
|
|
25
|
+
type: 'assistant',
|
|
26
|
+
functionCalls: [actionResult],
|
|
27
|
+
});
|
|
28
|
+
putAssistantMessage(args.message);
|
|
29
|
+
if (args.waitForUserResponse) {
|
|
30
|
+
const response = await askUserForInput('Your answer', '', options, true);
|
|
31
|
+
putUserMessage(response.answer);
|
|
32
|
+
taskExecutionPrompt.push({
|
|
33
|
+
type: 'user',
|
|
34
|
+
text: response.answer,
|
|
35
|
+
functionResponses: [
|
|
36
|
+
{
|
|
37
|
+
name: actionResult.name,
|
|
38
|
+
call_id: actionResult.id || undefined,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
taskExecutionPrompt.push({
|
|
45
|
+
type: 'user',
|
|
46
|
+
functionResponses: [
|
|
47
|
+
{
|
|
48
|
+
name: actionResult.name,
|
|
49
|
+
call_id: actionResult.id || undefined,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return { shouldBreakOuter: false, commandsExecutedIncrement: 0 };
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=send-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-message.js","sourceRoot":"","sources":["../../../../../../../src/prompt/steps/step-iterate/handlers/container-task/commands/send-message.ts"],"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SAAS;iBACtC;aACF;SACF,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,mBAAmB,CAAC,IAAI,CAAC;YACvB,IAAI,EAAE,MAAM;YACZ,iBAAiB,EAAE;gBACjB;oBACE,IAAI,EAAE,YAAY,CAAC,IAAI;oBACvB,OAAO,EAAE,YAAY,CAAC,EAAE,IAAI,SAAS;iBACtC;aACF;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAAC,EAAE,CAAC;AACnE,CAAC"}
|
package/dist/prompt/steps/step-iterate/handlers/container-task/commands/set-execution-plan.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FunctionDef } from '../../../../../../ai-service/common-types.js';
|
|
2
|
+
import { CommandHandlerBaseProps, CommandHandlerResult } from '../container-commands-types.js';
|
|
3
|
+
export declare const setExecutionPlanDef: FunctionDef;
|
|
4
|
+
export declare function handleSetExecutionPlan(props: Pick<CommandHandlerBaseProps, 'actionResult' | 'taskExecutionPrompt'>): Promise<CommandHandlerResult>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { putContainerLog } from '../../../../../../main/common/content-bus.js';
|
|
2
|
+
import { updateExecutionPlanDef } from './update-execution-plan.js';
|
|
3
|
+
export const setExecutionPlanDef = {
|
|
4
|
+
name: 'setExecutionPlan',
|
|
5
|
+
description: 'Record a concise execution plan to follow in subsequent steps.',
|
|
6
|
+
parameters: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
plan: {
|
|
10
|
+
type: 'array',
|
|
11
|
+
description: 'The steps of the execution plan. This is the latest most up to date version of the plan, which takes into account all prior context and findings.',
|
|
12
|
+
items: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
description: 'A single step in the execution plan.',
|
|
15
|
+
properties: {
|
|
16
|
+
id: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
description: 'A unique identifier for this step.',
|
|
19
|
+
},
|
|
20
|
+
description: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
description: 'A brief description of this step.',
|
|
23
|
+
},
|
|
24
|
+
dependsOn: {
|
|
25
|
+
type: 'array',
|
|
26
|
+
description: 'The IDs of the steps that this step depends on.',
|
|
27
|
+
items: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
state: updateExecutionPlanDef.parameters.properties.state,
|
|
32
|
+
statusUpdate: updateExecutionPlanDef.parameters.properties.statusUpdate,
|
|
33
|
+
},
|
|
34
|
+
required: ['id', 'description', 'dependsOn'],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
required: ['plan'],
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
export async function handleSetExecutionPlan(props) {
|
|
42
|
+
const { actionResult, taskExecutionPrompt } = props;
|
|
43
|
+
const args = actionResult.args;
|
|
44
|
+
putContainerLog('info', '📝 Execution plan recorded.', args);
|
|
45
|
+
taskExecutionPrompt.push({
|
|
46
|
+
type: 'assistant',
|
|
47
|
+
text: 'Setting execution plan.',
|
|
48
|
+
functionCalls: [actionResult],
|
|
49
|
+
}, {
|
|
50
|
+
type: 'user',
|
|
51
|
+
text: 'Please follow the execution plan carefully.',
|
|
52
|
+
functionResponses: [{ name: actionResult.name, call_id: actionResult.id || undefined }],
|
|
53
|
+
});
|
|
54
|
+
return { shouldBreakOuter: false, commandsExecutedIncrement: 0 };
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=set-execution-plan.js.map
|
package/dist/prompt/steps/step-iterate/handlers/container-task/commands/set-execution-plan.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-execution-plan.js","sourceRoot":"","sources":["../../../../../../../src/prompt/steps/step-iterate/handlers/container-task/commands/set-execution-plan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAE/E,OAAO,EAAE,s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YAAY,CAAC;KAC9B,EACD;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,6CAA6C;QACnD,iBAAiB,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,IAAI,SAAS,EAAE,CAAC;KACxF,CACF,CAAC;IACF,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAAC,EAAE,CAAC;AACnE,CAAC"}
|
package/dist/prompt/steps/step-iterate/handlers/container-task/commands/update-execution-plan.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FunctionDef } from '../../../../../../ai-service/common-types.js';
|
|
2
|
+
import { CommandHandlerBaseProps, CommandHandlerResult } from '../container-commands-types.js';
|
|
3
|
+
export declare const updateExecutionPlanDef: FunctionDef;
|
|
4
|
+
export declare function handleUpdateExecutionPlan(props: Pick<CommandHandlerBaseProps, 'actionResult' | 'taskExecutionPrompt'>): Promise<CommandHandlerResult>;
|
package/dist/prompt/steps/step-iterate/handlers/container-task/commands/update-execution-plan.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { putContainerLog } from '../../../../../../main/common/content-bus.js';
|
|
2
|
+
export const updateExecutionPlanDef = {
|
|
3
|
+
name: 'updateExecutionPlan',
|
|
4
|
+
description: 'Update progress/status against the previously set execution plan.',
|
|
5
|
+
parameters: {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
id: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
description: 'The ID of the step to update.',
|
|
11
|
+
},
|
|
12
|
+
statusUpdate: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'The updated status of the step.',
|
|
15
|
+
},
|
|
16
|
+
state: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
description: 'The state of the step, e.g., "pending", "in-progress", "completed", "failed", "skipped".',
|
|
19
|
+
enum: ['pending', 'in-progress', 'completed', 'failed', 'skipped'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
required: ['id', 'statusUpdate', 'state'],
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
export async function handleUpdateExecutionPlan(props) {
|
|
26
|
+
const { actionResult, taskExecutionPrompt } = props;
|
|
27
|
+
const args = actionResult.args;
|
|
28
|
+
putContainerLog('info', '📈 Execution plan updated.', args);
|
|
29
|
+
taskExecutionPrompt.push({
|
|
30
|
+
type: 'assistant',
|
|
31
|
+
text: `Updating execution plan for step ${args.id}.`,
|
|
32
|
+
functionCalls: [actionResult],
|
|
33
|
+
}, {
|
|
34
|
+
type: 'user',
|
|
35
|
+
functionResponses: [{ name: actionResult.name, call_id: actionResult.id || undefined }],
|
|
36
|
+
});
|
|
37
|
+
return { shouldBreakOuter: false, commandsExecutedIncrement: 0 };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=update-execution-plan.js.map
|
package/dist/prompt/steps/step-iterate/handlers/container-task/commands/update-execution-plan.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-execution-plan.js","sourceRoot":"","sources":["../../../../../../../src/prompt/steps/step-iterate/handlers/container-task/commands/update-execution-plan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAG/E,MAAM,CAAC,MAAM,sBAAsB,GAAgB;IACjD,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,mEAAmE;IAChF,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,EAAE,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+BAA+B;aAC7C;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aAC/C;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0FAA0F;gBACvG,IAAI,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,CAAC;aACnE;SACF;QACD,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC;KAC1C;CACF,CAAC;AAQF,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,KAA4E;IAE5E,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,GAAG,KAAK,CAAC;IACpD,MAAM,IAAI,GAAG,YAAY,CAAC,IAA+B,CAAC;IAC1D,eAAe,CAAC,MAAM,EAAE,4BAA4B,EAAE,IAAI,CAAC,CAAC;IAC5D,mBAAmB,CAAC,IAAI,CACtB;QACE,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,oCAAoC,IAAI,CAAC,EAAE,GAAG;QACpD,aAAa,EAAE,CAAC,YAAY,CAAC;KAC9B,EACD;QACE,IAAI,EAAE,MAAM;QACZ,iBAAiB,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,IAAI,SAAS,EAAE,CAAC;KACxF,CACF,CAAC;IACF,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAAC,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FunctionDef } from '../../../../../../ai-service/common-types.js';
|
|
2
|
+
import { CommandHandlerBaseProps, CommandHandlerResult } from '../container-commands-types.js';
|
|
3
|
+
export declare const viewFileDef: FunctionDef;
|
|
4
|
+
export type ViewFileArgs = {
|
|
5
|
+
reasoning: string;
|
|
6
|
+
filePath: string;
|
|
7
|
+
startLine?: number;
|
|
8
|
+
endLine?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function handleViewFile(props: CommandHandlerBaseProps): Promise<CommandHandlerResult>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { putContainerLog } from '../../../../../../main/common/content-bus.js';
|
|
2
|
+
import { getFileContentFromContainer, executeCommand } from '../utils/docker-utils.js';
|
|
3
|
+
export const viewFileDef = {
|
|
4
|
+
name: 'viewFile',
|
|
5
|
+
description: 'View a text file or list directory contents inside the container. You can view the full file or a specific range of lines.',
|
|
6
|
+
parameters: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
reasoning: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
description: 'Explanation of why this path needs to be viewed.',
|
|
12
|
+
},
|
|
13
|
+
filePath: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'The absolute path to the file or directory inside the container.',
|
|
16
|
+
},
|
|
17
|
+
startLine: {
|
|
18
|
+
type: 'number',
|
|
19
|
+
description: 'The starting line number to view (1-indexed). Only applicable for files.',
|
|
20
|
+
},
|
|
21
|
+
endLine: {
|
|
22
|
+
type: 'number',
|
|
23
|
+
description: 'The ending line number to view (1-indexed). Only applicable for files.',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: ['reasoning', 'filePath'],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export async function handleViewFile(props) {
|
|
30
|
+
const { actionResult, taskExecutionPrompt, container } = props;
|
|
31
|
+
const args = actionResult.args;
|
|
32
|
+
const { reasoning, filePath, startLine, endLine } = args;
|
|
33
|
+
putContainerLog('info', `Viewing path: ${reasoning}`, args, 'command');
|
|
34
|
+
try {
|
|
35
|
+
const dirCheck = await executeCommand(container, '/bin/sh', `test -d "${filePath}"`, '', '/');
|
|
36
|
+
let finalContent;
|
|
37
|
+
if (dirCheck.exitCode === 0) {
|
|
38
|
+
if (startLine || endLine) {
|
|
39
|
+
throw new Error('startLine and endLine parameters are not applicable for directories.');
|
|
40
|
+
}
|
|
41
|
+
const { output, exitCode } = await executeCommand(container, '/bin/sh', `ls -la "${filePath}"`, '', '/');
|
|
42
|
+
if (exitCode !== 0) {
|
|
43
|
+
throw new Error(`Failed to list directory contents for ${filePath}: ${output}`);
|
|
44
|
+
}
|
|
45
|
+
finalContent = `Directory listing for ${filePath}:\n\n${output}`;
|
|
46
|
+
putContainerLog('info', `Successfully listed directory ${filePath}`, { filePath }, 'command');
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
let content = await getFileContentFromContainer(container, filePath);
|
|
50
|
+
const lines = content.split('\n');
|
|
51
|
+
let resultMessage = `File content of ${filePath}:\n\n`;
|
|
52
|
+
if (startLine || endLine) {
|
|
53
|
+
const start = startLine ? startLine - 1 : 0;
|
|
54
|
+
const end = endLine ? endLine : lines.length;
|
|
55
|
+
const slicedLines = lines.slice(start, end);
|
|
56
|
+
content = slicedLines.join('\n');
|
|
57
|
+
resultMessage = `File content of ${filePath} from line ${startLine || 1} to ${endLine || lines.length}:\n\n`;
|
|
58
|
+
}
|
|
59
|
+
finalContent = resultMessage + content;
|
|
60
|
+
putContainerLog('info', `Successfully viewed file ${filePath}`, { filePath }, 'command');
|
|
61
|
+
}
|
|
62
|
+
taskExecutionPrompt.push({
|
|
63
|
+
type: 'assistant',
|
|
64
|
+
functionCalls: [actionResult],
|
|
65
|
+
}, {
|
|
66
|
+
type: 'user',
|
|
67
|
+
functionResponses: [
|
|
68
|
+
{
|
|
69
|
+
name: actionResult.name,
|
|
70
|
+
call_id: actionResult.id,
|
|
71
|
+
content: finalContent,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
const errMessage = e instanceof Error ? e.message : String(e);
|
|
78
|
+
putContainerLog('error', 'An error occurred while viewing the path', { error: errMessage });
|
|
79
|
+
taskExecutionPrompt.push({
|
|
80
|
+
type: 'assistant',
|
|
81
|
+
functionCalls: [actionResult],
|
|
82
|
+
}, {
|
|
83
|
+
type: 'user',
|
|
84
|
+
functionResponses: [
|
|
85
|
+
{
|
|
86
|
+
name: actionResult.name,
|
|
87
|
+
call_id: actionResult.id,
|
|
88
|
+
content: `View path failed: ${errMessage}`,
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return { commandsExecutedIncrement: 1 };
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=view-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-file.js","sourceRoot":"","sources":["../../../../../../../src/prompt/steps/step-iterate/handlers/container-task/commands/view-file.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAGvF,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,4HAA4H;IAC9H,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kDAAkD;aAChE;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kEAAkE;aAChF;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0EAA0E;aACxF;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wEAAwE;aACtF;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC;KACpC;CACF,CAAC;AASF,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAA8B;IACjE,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC/D,MAAM,IAAI,GAAG,YAAY,CAAC,IAAoB,CAAC;IAC/C,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAEzD,eAAe,CAAC,MAAM,EAAE,iBAAiB,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAEvE,IAAI,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