From 9e33c214ffeeef10afb7e6cb86a94c405358b776 Mon Sep 17 00:00:00 2001 From: Andrew Charneski Date: Wed, 25 Sep 2024 10:02:53 -0400 Subject: [PATCH] 1.6.5 (#188) * 1.6.5 * 1.6.5 --- build.gradle.kts | 58 +- .../simiacryptus/aicoder/actions/tooltips.md | 1335 +++++++++++++++++ gradle.properties | 2 +- .../aicoder/actions/generic/CodeChatAction.kt | 13 +- .../actions/generic/CommandAutofixAction.kt | 9 + .../actions/generic/CreateImageAction.kt | 8 + .../aicoder/actions/generic/DiffChatAction.kt | 13 +- .../generic/DocumentDataExtractorAction.kt | 12 +- .../DocumentDataExtractorConfigDialog.kt | 2 +- .../generic/GenerateDocumentationAction.kt | 83 +- .../actions/generic/GenericChatAction.kt | 8 + .../actions/generic/MassPatchAction.kt | 8 + .../actions/generic/MultiCodeChatAction.kt | 73 +- .../actions/generic/MultiDiffChatAction.kt | 8 + .../actions/generic/MultiStepPatchAction.kt | 8 + .../actions/generic/PlanAheadAction.kt | 10 +- .../aicoder/actions/generic/PlanChatAction.kt | 10 +- .../aicoder/actions/generic/PrePlanAction.kt | 10 +- ...TypescriptWebDevelopmentAssistantAction.kt | 8 + .../actions/generic/SaveAsQueryIndexAction.kt | 4 +- .../actions/generic/SessionProxyApp.kt | 11 + .../actions/generic/ShellCommandAction.kt | 8 + .../actions/generic/SimpleCommandAction.kt | 8 + .../generic/WebDevelopmentAssistantAction.kt | 8 + .../actions/git/ChatWithCommitAction.kt | 13 +- .../actions/git/ChatWithCommitDiffAction.kt | 13 +- .../git/ChatWithWorkingCopyDiffAction.kt | 13 +- .../actions/git/ReplicateCommitAction.kt | 8 + .../actions/problems/AnalyzeProblemAction.kt | 13 +- .../actions/test/TestResultAutofixAction.kt | 13 +- .../aicoder/util/CodeChatSocketManager.kt | 6 +- src/main/resources/META-INF/plugin.xml | 102 +- 32 files changed, 1742 insertions(+), 156 deletions(-) create mode 100644 docs/src/main/kotlin/com/github/simiacryptus/aicoder/actions/tooltips.md diff --git a/build.gradle.kts b/build.gradle.kts index e045011b..5ba652d6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,7 @@ -import org.jetbrains.changelog.Changelog +import org.jetbrains.changelog.Changelog import org.jetbrains.changelog.markdownToHTML +import org.jetbrains.dokka.gradle.DokkaTask +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile fun properties(key: String) = providers.gradleProperty(key).get() fun environment(key: String) = providers.environmentVariable(key).get() @@ -11,6 +13,7 @@ fun environment(key: String) = providers.environmentVariable(key).get() id("org.jetbrains.changelog") version "2.2.0" id("org.jetbrains.qodana") version "2023.2.1" id("org.jetbrains.kotlinx.kover") version "0.7.4" + id("org.jetbrains.dokka") version "1.9.10" } group = "com.github.simiacryptus" @@ -26,7 +29,7 @@ version = properties("pluginVersion") val kotlin_version = "2.0.20" // This line can be removed if not used elsewhere val jetty_version = "11.0.24" val slf4j_version = "2.0.16" -val skyenet_version = "1.2.4" +val skyenet_version = "1.2.5" val remoterobot_version = "0.11.21" val jackson_version = "2.17.2" @@ -106,6 +109,57 @@ tasks.named("processResources") { jvmToolchain(17) } tasks { + val dokkaHtml by getting(DokkaTask::class) { + outputDirectory.set(file("docs/api")) + } + + register("copyReadmeToSite") { + from("README.md") + into("docs") + } + register("copyChangelogToSite") { + from("CHANGELOG.md") + into("docs") + } + + register("generateProjectInfo") { + doLast { + file("docs/project-info.md").writeText(""" + # Project Information + - Group: $group + - Version: $version + - Kotlin Version: $kotlin_version + - Jetty Version: $jetty_version + - SLF4J Version: $slf4j_version + For more details, please check the [README](README.md) and [CHANGELOG](CHANGELOG.md). + """.trimIndent()) + } + } + register("generateIndex") { + doLast { + file("docs/index.md").writeText(""" + # ${properties("pluginName")} + Welcome to the documentation site for ${properties("pluginName")}. + ## Quick Links + - [Project Information](project-info.md) + - [README](README.md) + - [Changelog](CHANGELOG.md) + - [API Documentation](api/index.html) + For more details about the project, please explore the links above. + """.trimIndent()) + } + } + + register("buildProjectWebsite") { + dependsOn(dokkaHtml, "copyReadmeToSite", "copyChangelogToSite", "generateProjectInfo", "generateIndex") + doLast { + println("Project website built in the 'docs' directory.") + } + } + withType { + kotlinOptions.jvmTarget = "17" + } + compileKotlin { compilerOptions { javaParameters = true diff --git a/docs/src/main/kotlin/com/github/simiacryptus/aicoder/actions/tooltips.md b/docs/src/main/kotlin/com/github/simiacryptus/aicoder/actions/tooltips.md new file mode 100644 index 00000000..b73d5aad --- /dev/null +++ b/docs/src/main/kotlin/com/github/simiacryptus/aicoder/actions/tooltips.md @@ -0,0 +1,1335 @@ +# BaseAction.kt + +Here's a detailed description for a tooltip for the BaseAction class: + +"BaseAction: A foundational abstract class for IntelliJ IDEA plugin actions. + +Key features: + +- Integrates with IdeaChatClient and IdeaOpenAIClient for AI-powered functionality +- Provides access to ChatClient and OpenAIClient APIs +- Implements action update logic for enabling/disabling in the UI +- Handles action performance with error logging +- Supports custom action names, descriptions, and icons +- Includes built-in logging and UI error reporting + +This class serves as a base for creating specialized actions in the AI Coder plugin, offering a consistent framework for +AI-assisted coding features and user interface interactions within the IntelliJ IDEA environment." + +This description summarizes the main features and purpose of the BaseAction class, highlighting its role in the AI Coder +plugin and its integration with AI services. It's suitable for use as a detailed tooltip in the user interface. + +# ApplyPatchAction.kt + +Here's a detailed description for the ApplyPatchAction that can be used as a tooltip in the UI: + +"Apply Patch to Current File + +This action allows you to apply a patch to the currently selected file in your project. A patch is a set of instructions +that describe changes to be made to a file's content. + +When triggered: + +1. You'll be prompted to enter the patch content in a multi-line input dialog. +2. The patch will be applied to the selected file using an iterative patch algorithm. +3. The file's content will be updated with the changes specified in the patch. + +Use this action when you want to quickly apply pre-defined changes to a file without manually editing it. This is +particularly useful for applying fixes, updates, or modifications shared by team members or generated by automated +tools. + +Note: Ensure that the patch content is correctly formatted and compatible with the target file to avoid unexpected +results. It's recommended to have a backup of your file before applying significant patches." + +This description provides a comprehensive overview of the action's functionality, its use case, and a cautionary note +for users, making it suitable for an informative tooltip. + +# code\DescribeAction.kt + +Here's a detailed description for the DescribeAction that could be used as a tooltip in the UI: + +"Describe Code Action + +This action analyzes the selected code and generates a human-readable description of its functionality. It uses AI to +interpret the code and provide a concise explanation. + +Features: + +- Works with any programming language +- Adapts to the current project's language settings +- Supports both single-line and multi-line code selections +- Automatically formats the description as a comment in the appropriate style for the language +- Preserves the original code indentation +- Wraps long descriptions to maintain readability + +The generated description is inserted as a comment above the selected code, helping to improve code documentation and +readability. This is particularly useful for understanding complex code snippets, legacy code, or when onboarding new +team members. + +The description is generated in the human language specified in the app settings, allowing for multilingual +documentation support. + +Note: The quality and accuracy of the description may vary depending on the complexity of the code and the AI model's +capabilities." + +This description provides a comprehensive overview of the DescribeAction's functionality, highlighting its key features +and benefits, which should help users understand when and how to use this action effectively. + +# code\CustomEditAction.kt + +Here's a detailed description to use as a tooltip for the CustomEditAction: + +"Custom Edit Action + +This action allows you to perform custom edits on selected code using AI-powered natural language instructions. + +Key features: + +1. Accepts user-defined instructions for code modification +2. Supports multiple programming languages +3. Utilizes advanced language models for intelligent code editing +4. Preserves code context and structure +5. Handles both small snippets and larger code blocks + +Usage: + +1. Select the code you want to edit +2. Trigger the action and enter your instruction (e.g., 'Add error handling', 'Optimize for performance') +3. The AI will process your request and suggest edits + +This tool is ideal for quick code refactoring, adding features, or improving code quality based on natural language +input. It adapts to various coding styles and project-specific requirements. + +Note: The effectiveness of the edit depends on the clarity of your instruction and the context of the selected code." + +This description provides a comprehensive overview of the CustomEditAction, highlighting its key features, usage +instructions, and potential applications, making it informative and useful for users encountering this action in the UI. + +# code\PasteAction.kt + +Here's a detailed description for a tooltip for the PasteAction: + +"Smart Paste: Intelligently converts and pastes clipboard content + +This action enhances the standard paste functionality by automatically detecting and converting the clipboard content to +match the current file's programming language. It uses AI to: + +1. Retrieve text from the system clipboard +2. Automatically detect the source language of the clipboard content +3. Convert the code to the target language (based on the current file type) +4. Insert the converted code at the cursor position or replace the selected text + +Ideal for quickly adapting code snippets from other languages or sources. Supports most programming languages, but not +plain text files. The action is only enabled when compatible text content is available in the clipboard." + +This description provides a comprehensive overview of the action's functionality, highlighting its key features and use +cases, which should help users understand when and how to use this smart paste feature effectively. + +# code\RecentCodeEditsAction.kt + +Here's a detailed description for the RecentCodeEditsAction that can be used as a tooltip in the UI: + +"Recent Code Edits Action + +This action provides quick access to your most recently used custom code edit instructions. It dynamically generates a +list of sub-actions based on your editing history. + +Features: + +- Displays a menu of your most frequently used custom edit instructions +- Each sub-action is numbered for easy keyboard access +- Only available when text is selected in a code file (not plain text) +- Utilizes your personal editing history to improve workflow efficiency + +Usage: + +1. Select code in your editor +2. Activate this action to see your recent custom edits +3. Choose a previous instruction to apply it to your current selection + +This action helps streamline your coding process by allowing quick reuse of complex or frequently used edit +instructions, saving time and reducing repetitive tasks." + +This description explains the purpose of the action, its key features, how to use it, and the benefits it provides to +the user. + +# code\RedoLast.kt + +Here's a detailed description for the RedoLast action that can be used as a tooltip in the UI: + +"Redo Last AI Coder Action + +This action allows you to quickly repeat the most recent AI Coder operation performed in the current editor. It's +particularly useful when you want to apply the same AI-assisted edit to multiple locations or when you accidentally undo +an AI Coder action. + +Key features: +• Repeats the last AI Coder action without needing to go through the initial setup +• Works specifically with the current editor's document +• Automatically disabled if no previous AI Coder action is available to redo + +Usage: + +1. Ensure you're in an editor where you've previously used an AI Coder action +2. Invoke this action through the editor context menu or assigned shortcut +3. The last AI Coder operation will be instantly reapplied + +Note: This action is context-sensitive and will only be enabled if there's a valid AI Coder action to redo for the +current document." + +# dev\LineFilterChatAction.kt + +Here's a detailed description for a tooltip for the LineFilterChatAction: + +"Open an AI-powered code chat interface for the selected code or entire file. + +This action launches a specialized chat window that allows you to interact with an AI assistant about the code in your +current editor. The AI is provided with the full context of your code, including line numbers for precise referencing. + +Features: + +- Analyzes code in the current file or selection +- Supports multiple programming languages +- Allows referencing specific lines of code in the chat +- Uses markdown formatting for clear communication +- Renders AI responses with proper code formatting + +Ideal for: + +- Code review and analysis +- Asking questions about specific code sections +- Getting explanations of complex logic +- Brainstorming improvements or refactoring ideas + +The chat interface opens in your default web browser, providing a seamless experience for discussing your code with an +AI assistant." + +This description provides a comprehensive overview of the action's functionality, highlighting its key features and +potential use cases, which should help users understand the purpose and benefits of using this action. + +# dev\PrintTreeAction.kt + +Here's a detailed description for the PrintTreeAction that can be used as a tooltip in the UI: + +"Print PSI Tree Structure + +This developer action prints the tree structure of the current PSI (Program Structure Interface) file to the log. It +provides a hierarchical view of the file's syntax elements, helping developers understand and debug the internal +representation of code within the IntelliJ platform. + +Usage: + +1. Enable 'Developer Actions' in the AI Coder plugin settings. +2. Open the desired file in the editor. +3. Right-click to open the context menu. +4. Select 'Print PSI Tree' from the menu. + +The tree structure will be logged, showing the relationships between different PSI elements. This can be particularly +useful for plugin developers or those working with IntelliJ's PSI system. + +Note: This action is only available when 'Developer Actions' are enabled in the plugin settings." + +# generic\CodeChatAction.kt + +Here's a detailed description for a tooltip for the CodeChatAction: + +"Open an interactive Code Chat session for the current file or selection. + +This action launches a web-based chat interface tailored to the code you're working on. It allows you to: + +1. Discuss and analyze your code with an AI assistant +2. Get explanations, suggestions, and improvements for your code +3. Ask questions about specific parts of your code +4. Receive language-specific guidance based on the file type + +The chat uses the selected text or entire file content, and considers the programming language and filename for context. +It opens in your default web browser, providing a seamless experience for code-related conversations and assistance." + +This description provides a comprehensive overview of the CodeChatAction's functionality, highlighting its key features +and benefits for users. + +# FileContextAction.kt + +Here's a detailed description for a tooltip for the FileContextAction: + +"FileContextAction: A versatile action that operates on selected files or folders in your project. + +Key features: + +- Supports both individual files and directories +- Processes selections based on project context +- Generates new files as a result of the action +- Automatically opens newly created files in the editor +- Implements redo functionality for easy reversal +- Runs asynchronously to prevent UI freezing +- Configurable through getConfig method +- Supports development-only actions + +This action provides a framework for file-based operations, allowing for custom processing of selected files or folders +within the project structure. It handles file system interactions, UI updates, and error management, making it ideal for +complex file manipulation tasks in IntelliJ IDEA plugins. + +Note: The specific behavior of this action depends on its implementation in subclasses." + +This description provides a comprehensive overview of the FileContextAction's capabilities and functionality, suitable +for an informative tooltip in the UI. + +# generic\CommandAutofixAction.kt + +Here's a detailed description that could be used as a tooltip for the CommandAutofixAction: + +"Command Autofix Action + +This action allows you to run a system command and automatically fix any issues that arise. It's particularly useful for +automating build processes, running tests, or executing any command-line tool within your project. + +Key features: + +1. Customizable command execution: Choose any executable and specify arguments. +2. Flexible working directory: Set the directory where the command will run. +3. Intelligent error handling: Optionally patch issues based on exit codes (non-zero, zero, or any). +4. Additional instructions: Provide extra context or guidelines for the AI to consider when fixing issues. +5. Auto-apply option: Automatically apply suggested fixes without manual intervention. + +The action opens a web interface where you can interact with the AI assistant to review and refine the suggested fixes. +This powerful tool combines the efficiency of command-line operations with AI-driven problem-solving to streamline your +development workflow." + +This description provides an overview of the action's functionality, highlights its key features, and explains how it +can benefit the user in their development process. + +# generic\CreateFileFromDescriptionAction.kt + +Here's a detailed description to use as a tooltip for the CreateFileFromDescriptionAction: + +"Create a new file based on a natural language description. This action generates a file with appropriate content and +suggests a suitable location within your project structure. Simply provide a brief description of the desired file, and +the AI will interpret your requirements to create a new file with relevant code or content. The action intelligently +determines the file path, avoiding conflicts with existing files, and automatically creates necessary directories. Ideal +for quickly adding new components, utilities, or documentation to your project without manually setting up the file +structure." + +This tooltip description covers the key features and benefits of the action, including: + +1. Creating a file from a natural language description +2. AI-powered content generation +3. Intelligent file path suggestion +4. Automatic directory creation +5. Conflict avoidance with existing files +6. Ease of use for quickly adding new project components + +# generic\DiffChatAction.kt + +Here's a detailed description for a tooltip for the DiffChatAction: + +"Initiates an AI-assisted code review and modification session using a diff-based chat interface. This action opens a +specialized chat window where you can discuss and refine code changes with an AI assistant. The AI provides suggestions +in a diff format, allowing for precise code modifications. + +Key features: + +1. Supports selected code or entire file content +2. Uses language-specific context for more accurate suggestions +3. Presents code changes in an easy-to-read diff format +4. Allows direct application of suggested changes to the editor +5. Integrates with the project's development environment + +Ideal for code refactoring, bug fixing, and collaborative coding sessions with AI assistance. The diff-based approach +ensures clear visualization of proposed changes, making it easier to review and implement improvements to your code." + +This description provides a comprehensive overview of the DiffChatAction's functionality and benefits, suitable for use +as an informative tooltip in the UI. + +# generic\DocumentDataExtractorAction.kt + +Here's a detailed description for a tooltip for the DocumentDataExtractorAction: + +"Extract and analyze data from PDF, TXT, MD, or HTML documents. This action processes the selected file, extracting key +information and generating structured data. It uses advanced AI techniques to parse the document, identify important +elements, and present the results in an interactive web interface. Ideal for quickly summarizing long documents, +extracting tables and figures, or converting unstructured text into structured data. Configure extraction settings +before processing to tailor the output to your needs. Results are displayed in a new browser window for easy viewing and +further analysis." + +This tooltip provides a concise yet comprehensive overview of the action's functionality, supported file types, and the +user experience, making it informative for users considering whether to use this action on their selected document. + +# generic\CreateImageAction.kt + +Here's a detailed description to use as a tooltip for the CreateImageAction: + +"Generate AI-powered images based on your code context + +This action creates custom images inspired by your selected code files or project structure. It uses advanced AI models +to interpret your codebase and produce relevant visual representations. + +Key features: +• Analyzes selected files or entire project structure +• Generates images that reflect code concepts and architecture +• Supports multiple image formats (PNG, JPG) +• Allows for interactive refinement through chat-like interface +• Saves generated images in your project directory + +Ideal for: +• Visualizing code architecture and relationships +• Creating diagrams or illustrations for documentation +• Generating visual aids for presentations or explanations +• Exploring creative interpretations of your codebase + +The generated images aim to provide unique, code-specific visualizations to enhance understanding and communication of +your project's structure and concepts." + +This description provides a comprehensive overview of the action's functionality, highlighting its key features and +potential use cases. It's detailed enough to give users a clear understanding of what the action does while staying +concise enough for a tooltip. + +# generic\DocumentDataExtractorConfigDialog.kt + +Here's a detailed description that could be used as a tooltip for the Document Data Extractor Configuration action: + +"Configure settings for the Document Data Extractor tool. This dialog allows you to customize various parameters for +processing and extracting data from documents: + +- DPI: Set the dots per inch for image processing. +- Max Pages: Limit the number of pages to process. +- Output Format: Specify the desired format for extracted data. +- Pages Per Batch: Define how many pages to process in each batch. +- Show Images: Toggle whether to display images during processing. +- Save Image Files: Choose to save extracted images as separate files. +- Save Text Files: Option to save extracted text as individual files. +- Save Final JSON: Decide whether to save the final output as a JSON file. + +These settings allow you to fine-tune the extraction process based on your document type and desired output. Adjust them +to optimize performance and results for your specific use case." + +This description provides a comprehensive overview of the configuration options available in the dialog, explaining each +setting's purpose and how it affects the document data extraction process. It's informative enough to help users +understand the purpose of each option while being concise enough to fit in a tooltip. + +# generic\GenericChatAction.kt + +Here's a detailed description for a tooltip for the GenericChatAction: + +"Launch a customizable AI-powered chat interface for code-related discussions and assistance. This action opens a new +browser window with a chat session, allowing you to interact with an AI model tailored for coding tasks. The chat uses +the configured smart model and can be customized with specific system and user interface prompts. Ideal for getting help +with coding questions, discussing implementation ideas, or exploring programming concepts in a conversational format." + +This tooltip provides a concise yet informative overview of the GenericChatAction's functionality, highlighting its key +features and use cases. + +# generic\GenerateRelatedFileAction.kt + +Here's a detailed description to use in the UI for a tooltip for the GenerateRelatedFileAction: + +"Generate Related File + +This action creates a new file that is related to the currently selected file in your project. It uses AI to analyze the +selected file and generate new content based on your instructions. + +Key features: + +1. Generates a new file with content related to the selected file +2. Allows you to specify custom instructions for file generation +3. Automatically suggests an appropriate file name and location +4. Handles naming conflicts by appending a unique index to the file name +5. Opens the newly created file in the editor + +Usage: + +1. Select a single file in your project +2. Trigger this action +3. Enter your instructions for generating the related file (e.g., 'Create test cases') +4. Confirm to generate and open the new file + +This tool is useful for quickly creating complementary files such as test cases, documentation, or alternative +implementations based on existing code. It leverages AI to understand your project structure and coding patterns, saving +you time and effort in file creation and boilerplate code writing." + +# generic\GenerateDocumentationAction.kt + +Here's a detailed description to use as a tooltip for the GenerateDocumentationAction: + +"Generate comprehensive documentation for your project or selected files. + +This action allows you to: + +1. Choose specific files or entire directories for documentation generation +2. Provide custom AI instructions to tailor the documentation style and content +3. Generate a single compiled document or individual documentation files +4. Specify custom output locations for the generated documentation + +The AI will analyze your code, project structure, and follow your instructions to create user-friendly documentation. +This can include overviews, function descriptions, usage examples, and more. + +Ideal for: + +- Creating user manuals +- Generating API documentation +- Producing internal development guides +- Updating existing documentation with recent code changes + +Note: The quality and relevance of the generated documentation depend on the clarity of your instructions and the AI +model's capabilities." + +This description provides a comprehensive overview of the action's functionality, its use cases, and key features, +making it suitable for a detailed tooltip in the UI. + +# generic\MultiCodeChatAction.kt + +Here's a detailed description for a tooltip for the MultiCodeChatAction: + +"Multi-File Code Chat + +Initiates an AI-assisted chat session for multiple code files. This action allows you to: + +1. Select multiple files or folders in your project +2. Automatically summarize the selected code +3. Open a web-based chat interface +4. Discuss and modify the code with AI assistance +5. Apply suggested changes directly to your files + +Features: + +- Supports various file types and languages +- Provides a summary of selected files with token counts +- Uses GPT-4 for intelligent code understanding and suggestions +- Allows for iterative discussions and code revisions +- Offers direct links to apply changes to your project files + +Ideal for code reviews, refactoring, and getting AI assistance on complex, multi-file coding tasks." + +This description provides a comprehensive overview of the action's functionality, highlighting its key features and use +cases, which would be helpful for users when they hover over the action in the UI. + +# generic\MultiDiffChatAction.kt + +Here's a detailed description for a tooltip for the MultiDiffChatAction: + +``` +Multi-File Diff Chat + +Initiates an AI-assisted code review and modification session for multiple files simultaneously. This action: + +1. Selects files from your current project context +2. Opens a web-based chat interface +3. Allows you to discuss and modify multiple files in one conversation +4. Provides AI-generated code suggestions as diff patches +5. Offers one-click application of suggested changes + +Perfect for: +- Refactoring across multiple files +- Implementing feature requests affecting several components +- Conducting comprehensive code reviews +- Exploring potential code improvements project-wide + +The AI assistant considers the entire codebase context when providing suggestions, ensuring coherent and project-aware modifications. +``` + +This description provides a concise yet comprehensive overview of the MultiDiffChatAction's functionality, highlighting +its key features and use cases. It's designed to give users a clear understanding of what to expect when they trigger +this action. + +# generic\MassPatchAction.kt + +Here's a detailed description that could be used as a tooltip for the MassPatchAction: + +``` +Mass Patch Action + +This action allows you to apply AI-generated modifications across multiple files in your project simultaneously. It's particularly useful for large-scale code refactoring, documentation updates, or implementing consistent changes across your codebase. + +Key features: +1. File Selection: Choose which files to include in the mass patch operation. +2. AI Instruction: Provide a custom instruction for the AI to follow when modifying the files. +3. Interactive UI: Review and apply changes through a user-friendly interface. +4. Diff View: See proposed changes in a familiar diff format for easy review. +5. Selective Application: Apply changes selectively on a per-file basis. + +How it works: +1. Select a directory or multiple files in your project. +2. Enter an instruction for the AI (e.g., "Update all function comments to follow JSDoc format"). +3. Review the AI-generated patches for each file in a web-based interface. +4. Approve or reject changes for individual files. +5. Apply the approved changes to your project. + +This action leverages advanced language models to intelligently modify your code based on your instructions, saving time and ensuring consistency across your project. + +Note: Always review AI-generated changes carefully before applying them to your codebase. +``` + +This description provides a comprehensive overview of the MassPatchAction, highlighting its key features, how it works, +and its benefits. It also includes a note about reviewing AI-generated changes, which is important for maintaining code +quality and security. + +# generic\MultiStepPatchAction.kt + +Here's a detailed description for a tooltip for the MultiStepPatchAction: + +"Multi-Step Project Modification Assistant + +This action launches an AI-powered assistant to help you make complex, multi-step modifications to your project. It +analyzes your selected files and project structure, then breaks down your requested changes into a series of manageable +tasks. + +Key features: + +1. Intelligent task breakdown: Converts your high-level request into a list of specific, actionable tasks. +2. File-aware modifications: Identifies and targets relevant files for each task. +3. Interactive planning: Allows you to review and refine the proposed task list before implementation. +4. Automated code patching: Generates code patches in diff format for each task. +5. Visual diff review: Presents changes with syntax highlighting for easy review. +6. One-click apply: Lets you apply changes directly from the interface. + +Ideal for complex refactoring, feature additions, or large-scale code modifications across multiple files. This tool +streamlines the process of making sweeping changes to your codebase while maintaining control and oversight at each +step." + +This description provides a comprehensive overview of the action's functionality, highlighting its key features and +benefits to the user. It's detailed enough to give users a clear understanding of what the action does, yet concise +enough to fit in a tooltip or short description field in the UI. + +# generic\PlanAheadAction.kt + +Here's a detailed description for a tooltip for the PlanAheadAction: + +"Plan Ahead: Interactive Task Planning and Execution + +This action opens an advanced task planning and execution interface, allowing you to: + +1. Define complex tasks or project goals +2. Generate step-by-step plans using AI +3. Execute commands in your project's environment +4. Analyze results and adjust plans dynamically + +Features: + +- Customizable AI model settings +- Supports both Windows (PowerShell) and Unix-based (Bash) systems +- Integrates with your project's file structure +- Opens in a web browser for a rich, interactive experience + +Ideal for breaking down large tasks, exploring implementation strategies, and guiding development processes. Enhance +your productivity by leveraging AI to plan and execute your coding tasks efficiently." + +This description provides a comprehensive overview of the action's functionality, highlighting its key features and +benefits to the user. + +# generic\PlanAheadConfigDialog.kt + +Here's a detailed description that could be used as a tooltip for the PlanAheadConfigDialog action: + +"Configure advanced settings for the Plan Ahead feature. This dialog allows you to fine-tune the AI-assisted planning +process: + +1. Adjust the temperature slider to control the creativity and randomness of AI responses. +2. Enable or disable specific task types and assign different AI models to each task. +3. Toggle auto-apply fixes for automated issue resolution. +4. Manage a list of executable commands for auto-fixing, including adding new commands and editing existing ones. + +Use this dialog to customize the Plan Ahead feature to best suit your project's needs and your preferred workflow. The +settings here will influence how the AI generates, analyzes, and implements plans for your codebase." + +This description provides an overview of the main features available in the dialog, helping users understand the purpose +and capabilities of the PlanAheadConfigDialog action. + +# generic\PlanChatAction.kt + +Here's a detailed description for a tooltip for the PlanChatAction: + +"Open an interactive planning chat interface for your project + +This action launches a powerful AI-assisted planning tool that helps you: + +• Develop and refine project plans +• Break down complex tasks into manageable steps +• Generate and execute shell commands for your project +• Adapt to your project's specific environment and needs + +Features: + +- Uses AI models for planning and parsing +- Integrates with your project's file system +- Supports both Windows (PowerShell) and Unix-based (Bash) systems +- Customizable settings for AI model, working directory, and more +- Opens in your default web browser for a seamless experience + +Perfect for project managers, developers, and anyone looking to streamline their workflow and improve project +organization." + +This description provides a comprehensive overview of the PlanChatAction's functionality, highlighting its key features +and benefits to potential users. + +# generic\PrePlanAction.kt + +Here's a detailed description for a tooltip for the PrePlanAction: + +"Pre-Plan Task Action + +This action allows you to initiate a pre-planned task execution using AI assistance. It guides you through the following +steps: + +1. Enter a JSON input for TaskBreakdownWithPrompt, which defines the task structure and initial prompts. +2. Fill in any template variables in the JSON input through a dynamic form. +3. Configure advanced planning settings, including AI models, execution environment, and parameters. +4. Launch a web-based interface for the PlanAheadApp, which provides an interactive environment to: + - Review and refine the task breakdown + - Generate and execute steps to complete the task + - Monitor progress and results + +This action is ideal for complex, multi-step tasks that benefit from AI-assisted planning and execution. It integrates +with your project's file system and can execute commands in your development environment. + +Note: This action requires proper configuration of AI models and may open an external web browser for the interactive +interface." + +This description provides a comprehensive overview of the PrePlanAction's functionality, workflow, and benefits, +suitable for an informative tooltip in the UI. + +# generic\SaveAsQueryIndexAction.kt + +Here's a detailed description for the SaveAsQueryIndexAction that can be used as a tooltip in the UI: + +"Convert selected parsed JSON files to a binary index format for efficient querying. + +This action allows you to select multiple JSON files (with .parsed.json extension) and convert them into a single binary +index file. The resulting file is optimized for quick searching and retrieval of document information. + +Steps: + +1. Select one or more .parsed.json files in the project view. +2. Activate this action to start the conversion process. +3. Choose an output directory for the resulting index file. +4. Wait for the background task to complete the conversion. + +The output file will be named 'document.index.data' and placed in the selected directory. This index can be used for +fast document lookups and searches in applications that support this format. + +Note: This action is only enabled when valid .parsed.json files are selected." + +# generic\ReactTypescriptWebDevelopmentAssistantAction.kt + +Here's a detailed description for a tooltip for the ReactTypescriptWebDevelopmentAssistantAction: + +"Launch an AI-powered web development assistant for React and TypeScript projects. This tool helps you: + +1. Design project architecture based on your requirements +2. Generate skeleton HTML, CSS, TypeScript, and image files +3. Implement React components and application logic +4. Perform code reviews and suggest improvements +5. Refine and iterate on your codebase + +The assistant uses advanced language models to understand your project needs, create initial implementations, and +provide ongoing development support. It can handle full-stack web development tasks, from UI design to backend +integration. + +Features: + +- Interactive development process with AI guidance +- Automatic generation of project structure and files +- Code review and optimization suggestions +- Support for HTML, CSS, TypeScript, and image assets +- Integration with your IDE for seamless development + +Ideal for quickly prototyping web applications, learning React and TypeScript, or accelerating your development +workflow. Simply describe your project, and let the AI assistant help you bring it to life!" + +This description provides a comprehensive overview of the action's capabilities, highlighting its key features and +benefits for potential users. It's detailed enough to give users a clear understanding of what the tool does while being +concise enough to fit in a tooltip or short description field. + +# generic\SessionProxyApp.kt + +Here's a detailed description that could be used as a tooltip for the SessionProxyServer action: + +"SessionProxyServer: A specialized ApplicationServer for AI-assisted coding. + +This server acts as a proxy, managing sessions for an AI Coding Assistant application. It provides a customized +interface without a menubar, focusing on a single, non-sticky input for user interactions. + +Key features: + +- Handles user sessions and authentication +- Dynamically creates new sessions based on user and session data +- Manages chat servers and socket managers for different sessions +- Provides a centralized point for AI-assisted coding interactions + +This server is designed to streamline the process of AI-assisted coding by efficiently managing user sessions and +routing them to appropriate chat or agent interfaces. It offers a flexible architecture that can adapt to various AI +coding assistance scenarios." + +This description provides an overview of the SessionProxyServer's purpose and key functionalities, which should help +users understand its role in the AI Coding Assistant application. + +# generic\ShellCommandAction.kt + +Here's a detailed description for a tooltip for the ShellCommandAction: + +"Execute Shell Commands in Selected Directory + +This action allows you to run shell commands in a selected project directory using an AI-powered interface. It opens a +chat-like environment where you can input commands and receive executed results. + +Features: + +- Automatically detects and uses the appropriate shell (PowerShell for Windows, Bash for others) +- Executes commands in the context of the selected directory +- Provides an interactive AI agent to interpret and execute your commands +- Displays command output and handles errors gracefully +- Offers options to revise or accept the executed commands + +Usage: + +1. Select a directory in your project +2. Trigger this action +3. A new browser window will open with the shell command interface +4. Enter your desired commands and interact with the AI agent + +Note: Ensure you have the necessary permissions to execute commands in the selected directory. Use with caution, as +shell commands can modify your system." + +This description provides a comprehensive overview of the action's functionality, key features, usage instructions, and +a cautionary note, making it suitable for an informative tooltip in the UI. + +# generic\SimpleCommandAction.kt + +Here's a detailed description for a tooltip for the SimpleCommandAction: + +"Execute a custom AI-assisted coding task + +This action opens an interactive AI assistant that can help with various coding tasks across your project. It analyzes +your project structure, selected files, and user input to perform intelligent code modifications. + +Features: + +- Analyzes project structure and relevant files +- Handles complex coding tasks based on natural language input +- Generates code patches in diff format for easy review and application +- Supports creating new files when necessary +- Provides smart file searching based on content +- Offers a web-based interface for extended interaction + +Use this for tasks like refactoring, bug fixing, adding features, or getting coding assistance tailored to your project +context. The AI will consider your project structure and relevant files to provide accurate and context-aware +solutions." + +This description provides a comprehensive overview of the action's capabilities and use cases, suitable for an +informative tooltip in the UI. + +# git\ChatWithCommitAction.kt + +Here's a detailed description for a tooltip for the ChatWithCommitAction: + +"Chat with Commit Changes + +This action allows you to interact with an AI assistant about the changes in a selected Git commit. It compares the +selected revision with the current working copy and generates a detailed diff of the changes. + +Key features: + +1. Analyzes changes across multiple files in the commit +2. Handles binary files, added files, and deleted files +3. Generates a formatted diff for text-based changes +4. Opens an interactive chat session with an AI assistant +5. Provides context-aware responses based on the commit changes + +Use this action to: + +- Understand complex changes in a commit +- Get explanations about code modifications +- Discuss potential improvements or issues in the changes +- Receive suggestions related to the commit's content + +The chat opens in your default web browser, allowing for a seamless conversation about the commit changes." + +This description provides a comprehensive overview of the action's functionality and benefits, suitable for an +informative tooltip in the UI. + +# generic\WebDevelopmentAssistantAction.kt + +Here's a detailed description to use in the UI for a tooltip for the WebDevelopmentAssistantAction: + +"Launch an AI-powered Web Development Assistant + +This action opens an interactive web-based interface to help you develop web applications. It utilizes advanced AI +models to assist with various aspects of web development: + +1. Architecture Planning: Translates your ideas into a detailed web application architecture. +2. File Generation: Creates HTML, CSS, JavaScript, and image files based on the planned architecture. +3. Code Writing: Generates initial code for each file type, tailored to your project requirements. +4. Code Review: Analyzes the generated code, suggests improvements, and fixes potential bugs. +5. Iterative Refinement: Allows for multiple rounds of code improvement and customization. + +Features: + +- Uses GPT-4 for intelligent code generation and analysis +- Supports HTML, CSS, JavaScript, and image file creation +- Provides a tabbed interface for easy navigation between files +- Offers code highlighting for better readability +- Allows for interactive discussions and revisions of the generated content +- Integrates with your project's file system for seamless file management + +This tool is ideal for quickly prototyping web applications, getting started with new web projects, or exploring +AI-assisted web development techniques. It combines the power of large language models with practical web development +workflows to enhance your productivity and creativity." + +This description provides a comprehensive overview of the WebDevelopmentAssistantAction's capabilities and benefits, +suitable for a detailed tooltip in the UI. + +# git\ChatWithCommitDiffAction.kt + +Here's a detailed description for a tooltip for the ChatWithCommitDiffAction: + +"Compare and Chat with Commit Diff + +This action allows you to view and discuss the changes between a selected commit and the current HEAD of your Git +repository. It performs the following steps: + +1. Retrieves the diff between the selected commit and the current HEAD. +2. Opens a new chat session in your default web browser. +3. Initializes the chat with the commit diff as context. + +Use this feature to: + +- Analyze code changes in a collaborative environment +- Discuss implementation details with team members +- Get AI-assisted explanations of complex changes +- Review historical changes in your codebase + +The chat interface supports natural language interactions, allowing you to ask questions, seek clarifications, or +request explanations about the displayed diff. This tool combines the power of version control insights with AI-driven +code comprehension to enhance your development workflow. + +Note: This action is only available in Git-managed projects and requires a selected commit for comparison." + +# git\ChatWithWorkingCopyDiffAction.kt + +Here's a detailed description for a tooltip for the ChatWithWorkingCopyDiffAction: + +"Compare and Chat with Working Copy Changes + +This action compares the current working copy with the HEAD commit in your Git repository and opens a chat interface to +discuss the differences. + +Key features: + +1. Automatically detects Git repositories in your project +2. Generates a diff between HEAD and the working copy +3. Opens a specialized chat interface for discussing code changes +4. Uses AI-powered assistance to help analyze and understand the diff +5. Supports syntax highlighting for better readability + +Use this action when you want to: + +- Review and discuss uncommitted changes in your working copy +- Get AI-assisted insights on your recent modifications +- Collaborate with team members on work-in-progress code +- Prepare for code reviews by analyzing your changes + +Note: This action requires an active Git repository and uncommitted changes in your working copy to function properly." + +This tooltip provides a comprehensive overview of the action's functionality, its key features, and common use cases, +helping users understand when and how to use this action effectively. + +# git\ReplicateCommitAction.kt + +Here's a detailed description for a tooltip for the ReplicateCommitAction: + +"Replicate and Adapt Commit Changes + +This action allows you to replicate and adapt changes from a previous commit to implement new features or fix issues. It +provides an interactive interface to: + +1. Analyze the selected files and commit changes +2. Generate a summary of the project structure +3. Plan tasks based on the commit diff and user request +4. Suggest code modifications across multiple files + +Key features: + +- Intelligent task planning based on commit history and user input +- Code-aware suggestions for implementing changes +- Interactive diff application with file previews +- Supports complex multi-file changes and new file creation +- Integrates with your project's structure and Git history + +Use this action when you want to apply similar changes as a previous commit, but with modifications to suit new +requirements or fix related issues. It's particularly useful for complex refactoring tasks or feature implementations +that span multiple files." + +This description provides a comprehensive overview of the action's functionality, highlighting its key features and use +cases. It's detailed enough to give users a clear understanding of when and how to use this action effectively. + +# legacy\AppendTextWithChatAction.kt + +Here's a detailed description for a tooltip for the AppendTextWithChatAction: + +"Append Text with AI Chat + +This action uses AI to intelligently append text to your current selection. It sends your selected text to an AI model, +which then generates additional content that naturally continues from where you left off. + +Key features: + +1. Seamless continuation: The AI attempts to match the style and context of your existing text. +2. Customizable: Uses your configured smart model and temperature settings. +3. Flexible: Works with any text selection, regardless of language or content type. +4. Non-destructive: Adds to your existing text without modifying the original selection. + +Perfect for: + +- Expanding on ideas or concepts +- Generating additional paragraphs for documents +- Continuing code snippets or comments +- Brainstorming sessions + +Note: This is a legacy action. Enable legacy actions in settings to use." + +# legacy\CommentsAction.kt + +Here's a detailed description for a tooltip for the CommentsAction: + +"Add Explanatory Comments + +This action automatically adds inline comments to your selected code, explaining each line's functionality. It uses AI +to analyze the code and generate relevant explanations. + +Features: +• Works with multiple programming languages +• Adds comments in your preferred human language +• Preserves original code structure +• Helps improve code readability and understanding + +Usage: + +1. Select the code you want to comment +2. Trigger this action +3. AI-generated comments will be inserted for each line + +Note: This is a legacy action and may be disabled in settings." + +This tooltip provides a concise overview of the action's purpose, key features, and usage instructions, helping users +understand how to use it effectively. + +# legacy\DocAction.kt + +Here's a detailed description for the DocAction that can be used as a tooltip in the UI: + +"Generate Documentation for Code Block + +This action automatically creates detailed documentation for the selected code block. It uses AI to analyze the code and +produce appropriate documentation in the language's native style (e.g., KDoc for Kotlin, JavaDoc for Java). + +Features: + +- Supports multiple programming languages +- Generates documentation prefix for the selected code +- Uses the language's specific documentation style (e.g., KDoc, JavaDoc) +- Preserves existing code indentation +- Intelligently selects the entire code block if partial selection is made + +Usage: + +1. Select a code block or place your cursor within a code element +2. Trigger this action +3. AI-generated documentation will be inserted above the code + +Note: This action is part of legacy features and its availability depends on your plugin settings." + +This description provides a comprehensive overview of the DocAction's functionality, highlighting its key features and +usage instructions, which should help users understand and effectively use this action. + +# legacy\ImplementStubAction.kt + +Here's a detailed description for a tooltip for the ImplementStubAction: + +"Implement Stub Action + +This action automatically implements stub code for selected method declarations or class stubs. It uses AI-powered code +generation to create a basic implementation based on the selected code snippet. + +Key features: + +1. Works with various programming languages (except plain text) +2. Analyzes the context of the selected code for better results +3. Generates code that matches the coding style of the surrounding context +4. Supports customizable human language output + +Usage: + +1. Select a method declaration or class stub +2. Invoke the action +3. The AI will generate an implementation, replacing the selected stub + +Note: This action is part of the legacy features and can be enabled/disabled in the plugin settings." + +This description provides a comprehensive overview of the ImplementStubAction, highlighting its purpose, key features, +and usage instructions, which would be helpful for users when they hover over the action in the UI. + +# legacy\RenameVariablesAction.kt + +Here's a detailed description for a tooltip for the RenameVariablesAction: + +"Intelligently suggests and applies variable renaming in your code. + +This action analyzes the selected code snippet and proposes more meaningful or appropriate names for variables based on +their context and usage. It uses AI to understand the code's purpose and generate suggestions that improve code +readability and maintainability. + +Features: + +- Supports multiple programming languages +- Considers coding best practices and conventions +- Allows you to choose which renaming suggestions to apply +- Preserves code functionality while enhancing clarity + +Use this action to quickly refactor variable names, making your code more self-explanatory and easier to understand for +both you and your team members. It's particularly useful for cleaning up legacy code or improving hastily written +sections. + +Note: This is a legacy action and may be disabled in your current settings." + +This description provides a comprehensive overview of the action's functionality, benefits, and use cases, suitable for +an informative tooltip in the UI. + +# legacy\ReplaceWithSuggestionsAction.kt + +Here's a detailed description for a tooltip for the ReplaceWithSuggestionsAction: + +"Replace selected text with AI-generated suggestions + +This action uses AI to generate contextually relevant suggestions to replace the selected text. It considers the +surrounding content to provide appropriate alternatives. + +How it works: + +1. Analyzes the text before and after your selection +2. Uses AI to generate multiple suggestions that fit the context +3. Presents a list of options for you to choose from + +Ideal for: + +- Refining wording or phrasing +- Exploring alternative expressions +- Enhancing creativity in writing + +Note: This action is part of legacy features and may be disabled in settings. + +Tip: Adjust the AI model and temperature in settings for different suggestion styles." + +This description provides a concise overview of the action's functionality, its process, use cases, and additional +helpful information for users. + +# legacy\InsertImplementationAction.kt + +Here's a detailed description for the InsertImplementationAction that could be used as a tooltip in the UI: + +"Insert Implementation Action + +This action intelligently generates and inserts code implementations based on comments or selected text. It's designed +to: + +1. Analyze the current context, including the selected text, surrounding code, and nearby comments. +2. Interpret the selected text or nearest comment as a specification for implementation. +3. Use AI to generate appropriate code that matches the specification. +4. Insert the generated code below the selected text or comment. + +Key features: + +- Works with various programming languages (excluding plain text and Markdown). +- Considers the current file's context for more accurate implementations. +- Can expand on brief comments or detailed specifications. +- Maintains proper indentation when inserting code. + +Usage: +Select a comment or text describing the desired functionality, then trigger this action. The AI will generate and insert +an implementation based on your selection and the surrounding code context. + +Note: This action is part of the legacy feature set and may be disabled in the app settings." + +This description provides a comprehensive overview of the action's functionality, its key features, and how to use it, +which should help users understand its purpose and operation when they see it in the UI. + +# legacy\VoiceToTextAction.kt + +Here's a detailed description for a tooltip for the VoiceToTextAction: + +"Voice-to-Text Dictation + +This action enables real-time voice dictation directly into your editor. It records audio from your microphone, +processes it in the background, and converts it to text using advanced speech recognition. + +Features: + +- Live dictation: Speak and see your words appear in real-time +- Continuous recording: Keeps listening until you close the status dialog +- Context-aware: Uses previous text to improve transcription accuracy +- Selection-aware: Can insert text at cursor or replace selected text + +Usage: + +1. Invoke the action +2. Start speaking when the status dialog appears +3. Close the dialog to stop recording and finalize the dictation + +Note: Requires a working microphone and internet connection for speech recognition. This feature is part of the legacy +actions and may be disabled in settings." + +This tooltip provides a comprehensive overview of the action's functionality, key features, usage instructions, and +important notes, helping users understand and effectively use the Voice-to-Text feature. + +# OpenWebPageAction.kt + +Here's a detailed description to use as a tooltip for the OpenWebPageAction: + +"Open AI Coder Web Page + +This action opens the official AI Coder web page in your default browser. It provides quick access to additional +resources, documentation, and updates related to the AI Coder plugin. + +When clicked, this action will: + +1. Check if desktop browsing is supported on your system +2. If supported, it will launch your default web browser +3. Navigate to http://apps.simiacrypt.us/ + +This is useful for: + +- Accessing the latest documentation +- Checking for updates or new features +- Finding support resources +- Exploring other AI-assisted coding tools + +Note: This action requires an active internet connection and a compatible default web browser on your system." + +This description provides a comprehensive overview of what the action does, how it works, and why it might be useful to +users, making it suitable for a detailed tooltip in the UI. + +# markdown\MarkdownListAction.kt + +Here's a detailed description for a tooltip for the MarkdownListAction: + +"Extend Markdown List + +This action intelligently expands an existing Markdown list by generating new, contextually relevant list items. It +works on both bulleted and numbered lists, preserving the original list style. + +Features: + +- Analyzes the existing list items to understand the context +- Generates new items that maintain the theme and style of the original list +- Supports various list formats including checkboxes (- [ ]), dashes (-), asterisks (*), and numbered lists (1.) +- Preserves indentation of the original list +- Doubles the number of items in the list + +Usage: + +1. Place your cursor within a Markdown list +2. Trigger this action to automatically append new, relevant items to the end of the list + +Note: This action is only available in Markdown files and when the cursor is within a valid Markdown list structure." + +This description provides a comprehensive overview of the action's functionality, highlighting its key features and +usage instructions, which should help users understand how and when to use this action effectively. + +# markdown\MarkdownImplementActionGroup.kt + +Here's a detailed description for the MarkdownImplementActionGroup that could be used as a tooltip in the UI: + +"Convert selected Markdown text into executable code snippets + +This action allows you to transform natural language descriptions or pseudocode written in Markdown into actual code +snippets in various programming languages. It uses AI to interpret the selected text and generate corresponding code. + +Features: + +- Supports multiple programming languages including SQL, Java, C++, Python, JavaScript, and many more +- Automatically detects the intent of the selected text +- Generates syntactically correct code based on the chosen language +- Inserts the generated code as a properly formatted code block in your Markdown document + +Usage: + +1. Select the text in your Markdown file that describes the code you want to implement +2. Choose this action from the menu +3. Select the target programming language from the submenu +4. The AI will generate the code and insert it as a new code block + +This tool is ideal for quickly prototyping ideas, creating documentation with examples, or translating high-level +concepts into actual code implementations." + +# problems\AnalyzeProblemAction.kt + +Here's a detailed description for a tooltip for the AnalyzeProblemAction: + +"Analyze Problem and Suggest Fixes + +This action provides an in-depth analysis of the selected problem in your code and suggests potential fixes. It performs +the following steps: + +1. Gathers detailed information about the problem, including file path, problem description, file type, and the specific + line of code causing the issue. +2. Analyzes the project structure and relevant file contents. +3. Uses AI to identify distinct errors and determine which files need to be fixed or are related to the problem. +4. For each identified error, it: + - Examines the content of relevant files + - Generates suggested fixes using AI + - Presents the fixes as code patches in diff format +5. Opens a new browser window with an interactive session where you can: + - View the analysis results + - See suggested fixes for each error + - Apply patches directly to your code + +This tool is particularly useful for complex issues or when you're unsure how to approach a problem. It leverages AI to +provide context-aware solutions tailored to your specific codebase." + +This description provides a comprehensive overview of the action's functionality, highlighting its key features and +benefits to the user. + +# SelectionAction.kt + +Here's a detailed description for a tooltip for the SelectionAction class: + +"SelectionAction: A versatile base class for actions that operate on selected text or code in the editor. + +Key features: + +- Automatically handles text selection, including empty selections +- Supports custom selection targeting and editing +- Integrates with the PSI (Program Structure Interface) for context-aware operations +- Provides language-specific support and validation +- Allows for configuration and customization through subclassing + +This action intelligently processes the selected text or the current line if no selection is made. It considers the +programming language, indentation, and surrounding code context to perform its operation. The action can be further +customized by overriding methods such as processSelection, isLanguageSupported, and getConfig. + +Subclasses of SelectionAction can implement various code manipulation tasks, such as refactoring, code generation, or +applying AI-assisted transformations to the selected code." + +This description provides a comprehensive overview of the SelectionAction class, highlighting its key features and +flexibility, which would be useful for developers looking to understand or use this action in their IDE. + +# test\TestResultAutofixAction.kt + +Here's a detailed description for a tooltip for the TestResultAutofixAction: + +"Analyze and Autofix Test Failures + +This action automatically analyzes failed test results and suggests potential fixes. It performs the following steps: + +1. Extracts detailed information about the failed test, including test name, duration, error message, and stack trace. +2. Analyzes the project structure to understand the context of the failure. +3. Uses AI to identify distinct errors and predict which files need to be fixed or reviewed. +4. Generates suggested code patches in diff format for each identified error. +5. Provides an interactive interface to review and apply the suggested fixes. + +This tool is designed to streamline the debugging process by offering intelligent, context-aware suggestions for +resolving test failures. It's particularly useful for complex errors or when dealing with unfamiliar parts of the +codebase. + +Note: While the AI provides helpful suggestions, always review the proposed changes carefully before applying them to +your code." + +This description provides a comprehensive overview of the action's functionality, highlighting its key features and +benefits, while also including a cautionary note about reviewing AI-generated suggestions. \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index ae154481..2f1cf0bd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ pluginName=intellij-aicoder pluginRepositoryUrl=https://github.com/SimiaCryptus/intellij-aicoder -pluginVersion=1.6.4 +pluginVersion=1.6.5 jvmArgs=-Xmx8g org.gradle.jvmargs=-Xmx8g diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/CodeChatAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/CodeChatAction.kt index dadc851c..372d3b0a 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/CodeChatAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/CodeChatAction.kt @@ -14,6 +14,7 @@ import com.intellij.openapi.actionSystem.CommonDataKeys import com.intellij.openapi.fileEditor.FileDocumentManager import com.simiacryptus.skyenet.core.platform.ApplicationServices import com.simiacryptus.skyenet.core.platform.StorageInterface +import com.simiacryptus.skyenet.webui.application.AppInfoData import com.simiacryptus.skyenet.webui.application.ApplicationServer import org.slf4j.LoggerFactory import java.awt.Desktop @@ -38,12 +39,12 @@ class CodeChatAction : BaseAction() { model = AppSettingsState.instance.smartModel.chatModel(), storage = ApplicationServices.dataStorageFactory(AppSettingsState.instance.pluginHome) ) - ApplicationServer.sessionAppInfoMap[session.toString()] = mapOf( - "applicationName" to "Code Chat", - "singleInput" to false, - "stickyInput" to true, - "loadImages" to false, - "showMenubar" to false, + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = false, + stickyInput = true, + loadImages = false, + showMenubar = false ) val server = AppServer.getServer(e.project) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/CommandAutofixAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/CommandAutofixAction.kt index 6d594414..b142cb16 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/CommandAutofixAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/CommandAutofixAction.kt @@ -13,6 +13,8 @@ import com.intellij.openapi.ui.DialogWrapper import com.simiacryptus.skyenet.apps.general.CmdPatchApp import com.simiacryptus.skyenet.apps.general.PatchApp import com.simiacryptus.skyenet.core.platform.StorageInterface +import com.simiacryptus.skyenet.webui.application.AppInfoData +import com.simiacryptus.skyenet.webui.application.ApplicationServer import org.slf4j.LoggerFactory import java.awt.BorderLayout import java.awt.Desktop @@ -37,6 +39,13 @@ class CommandAutofixAction : BaseAction() { val session = StorageInterface.newGlobalID() val patchApp = CmdPatchApp(root, session, settings, api, virtualFiles?.map { it.toFile }?.toTypedArray(), AppSettingsState.instance.defaultSmartModel()) SessionProxyServer.chats[session] = patchApp + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) val server = AppServer.getServer(event.project) Thread { Thread.sleep(500) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/CreateImageAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/CreateImageAction.kt index cdd5a385..f406d768 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/CreateImageAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/CreateImageAction.kt @@ -25,6 +25,7 @@ import com.simiacryptus.skyenet.core.util.getModuleRootForFile import com.simiacryptus.skyenet.webui.application.ApplicationInterface import com.simiacryptus.skyenet.webui.application.ApplicationServer import com.simiacryptus.skyenet.util.MarkdownUtil.renderMarkdown +import com.simiacryptus.skyenet.webui.application.AppInfoData import org.slf4j.LoggerFactory import java.awt.Desktop import java.io.ByteArrayOutputStream @@ -78,6 +79,13 @@ class CreateImageAction : BaseAction() { } SessionProxyServer.chats[session] = PatchApp(event, root.toFile(), ::codeSummary) + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) val server = AppServer.getServer(event.project) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DiffChatAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DiffChatAction.kt index 9aabb99f..112a185a 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DiffChatAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DiffChatAction.kt @@ -20,6 +20,7 @@ import com.simiacryptus.skyenet.webui.application.ApplicationInterface import com.simiacryptus.skyenet.webui.application.ApplicationServer import com.simiacryptus.skyenet.webui.session.SessionTask import com.simiacryptus.skyenet.util.MarkdownUtil.renderMarkdown +import com.simiacryptus.skyenet.webui.application.AppInfoData import org.intellij.lang.annotations.Language import org.slf4j.LoggerFactory import java.awt.Desktop @@ -49,12 +50,12 @@ class DiffChatAction : BaseAction() { selectionStart = 0 selectionEnd = rawText.length } - ApplicationServer.sessionAppInfoMap[session.toString()] = mapOf( - "applicationName" to "Code Chat", - "singleInput" to false, - "stickyInput" to true, - "loadImages" to false, - "showMenubar" to false, + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = false, + stickyInput = true, + loadImages = false, + showMenubar = false ) SessionProxyServer.agents[session] = object : CodeChatSocketManager( session = session, diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DocumentDataExtractorAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DocumentDataExtractorAction.kt index fdce3818..50fd5767 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DocumentDataExtractorAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DocumentDataExtractorAction.kt @@ -5,13 +5,14 @@ import com.github.simiacryptus.aicoder.actions.BaseAction import com.github.simiacryptus.aicoder.util.UITools import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent -import com.simiacryptus.skyenet.apps.general.DocumentParserApp +import com.simiacryptus.skyenet.apps.parsers.DocumentParserApp import com.simiacryptus.skyenet.core.platform.StorageInterface import com.simiacryptus.skyenet.core.platform.file.DataStorage import org.slf4j.LoggerFactory import java.awt.Desktop -import com.intellij.openapi.ui.DialogWrapper import com.simiacryptus.skyenet.core.platform.Session +import com.simiacryptus.skyenet.webui.application.AppInfoData +import com.simiacryptus.skyenet.webui.application.ApplicationServer import java.io.File class DocumentDataExtractorAction : BaseAction() { @@ -61,6 +62,13 @@ class DocumentDataExtractorAction : BaseAction() { } SessionProxyServer.chats[session] = documentParserApp + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) val server = AppServer.getServer(e.project) Thread { Thread.sleep(500) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DocumentDataExtractorConfigDialog.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DocumentDataExtractorConfigDialog.kt index c6a1bbfd..257b27eb 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DocumentDataExtractorConfigDialog.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DocumentDataExtractorConfigDialog.kt @@ -4,7 +4,7 @@ import com.intellij.openapi.project.Project import com.intellij.openapi.ui.DialogWrapper import com.intellij.ui.components.JBCheckBox import com.intellij.ui.components.JBTextField -import com.simiacryptus.skyenet.apps.general.DocumentParserApp +import com.simiacryptus.skyenet.apps.parsers.DocumentParserApp import javax.swing.* class DocumentDataExtractorConfigDialog( diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/GenerateDocumentationAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/GenerateDocumentationAction.kt index 6a7cb90f..166aa536 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/GenerateDocumentationAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/GenerateDocumentationAction.kt @@ -30,6 +30,7 @@ import java.nio.file.Path import java.util.concurrent.Executors import java.util.concurrent.Future import java.util.concurrent.TimeUnit +import java.util.concurrent.TimeoutException import javax.swing.* @@ -128,31 +129,45 @@ class GenerateDocumentationAction : FileContextAction> { path -> executorService.submit { - val fileContent = - IOUtils.toString(FileInputStream(path.toFile()), "UTF-8") ?: return@submit null - val transformContent = transformContent(path, fileContent, transformationMessage) - if (config?.settings?.singleOutputFile == true) { - markdownContent.append("# ${selectedFolder.relativize(path)}\n\n") - markdownContent.append(transformContent.replace("(?s)(?= maxRetries) { + log.error("Failed to process file after $maxRetries attempts: $path", e) + return@submit null + } + log.warn("Error processing file: $path. Retrying (attempt $retries)", e) + Thread.sleep(1000L * retries) // Exponential backoff + } } - path + null } }.toTypedArray().map { future -> try { - future.get() + future.get(2, TimeUnit.MINUTES) // Set a timeout for each file processing } catch (e: Exception) { - log.warn("Error processing file", e) - return@map null + when (e) { + is TimeoutException -> log.error("File processing timed out", e) + else -> log.error("Error processing file", e) + } + null } }.filterNotNull() if (config?.settings?.singleOutputFile == true) { @@ -168,6 +183,34 @@ class GenerateDocumentationAction : FileContextAction listOf(codeSummary(), it) } - Discussable( - task = task, - userMessage = { userMessage }, - heading = renderMarkdown(userMessage), - initialResponse = { it: String -> mainActor.answer(toInput(it), api = api) }, - outputFn = { design: String -> - var markdown = ui.socketManager?.addApplyFileDiffLinks( - root = root.toPath(), - response = design, - handle = { newCodeMap -> - newCodeMap.forEach { (path, newCode) -> - task.complete("$path Updated") - } - }, - ui = ui, - api = api, - ) - """
${renderMarkdown(markdown!!)}
""" - }, + Retryable( ui = ui, - reviseResponse = { userMessages: List> -> - mainActor.respond( - messages = (userMessages.map { ApiModel.ChatMessage(it.second, it.first.toContentList()) } - .toTypedArray()), - input = toInput(userMessage), - api = api - ) + task = task, + process = { content -> + val design = mainActor.answer(toInput(userMessage), api = api) + """ + |
+ |${renderMarkdown(codeSummary())} + |
+ | + |
${renderMarkdown( + ui.socketManager?.addApplyFileDiffLinks( + root = root.toPath(), + response = design, + handle = { newCodeMap -> + newCodeMap.forEach { (path, newCode) -> + content.append("$path Updated") + } + }, + ui = ui, + api = api, + )!! + )}
+ """.trimMargin() + }, - atomicRef = AtomicReference(), - semaphore = Semaphore(0), - ).call() + ) } } @@ -175,4 +174,4 @@ class MultiCodeChatAction : BaseAction() { private val log = LoggerFactory.getLogger(MultiDiffChatAction::class.java) } -} +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/MultiDiffChatAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/MultiDiffChatAction.kt index 8108b68e..bc4bbcf1 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/MultiDiffChatAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/MultiDiffChatAction.kt @@ -25,6 +25,7 @@ import com.simiacryptus.skyenet.core.util.getModuleRootForFile import com.simiacryptus.skyenet.webui.application.ApplicationInterface import com.simiacryptus.skyenet.webui.application.ApplicationServer import com.simiacryptus.skyenet.util.MarkdownUtil.renderMarkdown +import com.simiacryptus.skyenet.webui.application.AppInfoData import org.slf4j.LoggerFactory import java.awt.Desktop import java.io.File @@ -50,6 +51,13 @@ class MultiDiffChatAction : BaseAction() { val session = StorageInterface.newGlobalID() SessionProxyServer.chats[session] = PatchApp(root.toFile(), initialFiles) + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) val server = AppServer.getServer(event.project) Thread { diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/MultiStepPatchAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/MultiStepPatchAction.kt index bac80bf6..9491d083 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/MultiStepPatchAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/MultiStepPatchAction.kt @@ -29,6 +29,7 @@ import com.simiacryptus.skyenet.core.util.commonRoot import com.simiacryptus.skyenet.webui.application.ApplicationInterface import com.simiacryptus.skyenet.webui.application.ApplicationServer import com.simiacryptus.skyenet.util.MarkdownUtil.renderMarkdown +import com.simiacryptus.skyenet.webui.application.AppInfoData import org.slf4j.LoggerFactory import java.awt.Desktop import java.io.File @@ -49,6 +50,13 @@ class MultiStepPatchAction : BaseAction() { DataStorage.sessionPaths[session] = selectedFile.toFile } SessionProxyServer.chats[session] = AutoDevApp(event = e) + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) val server = AppServer.getServer(e.project) Thread { diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PlanAheadAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PlanAheadAction.kt index c15ceaf5..9d1a3dc3 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PlanAheadAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PlanAheadAction.kt @@ -12,6 +12,8 @@ import com.simiacryptus.skyenet.apps.plan.PlanSettings import com.simiacryptus.skyenet.core.platform.StorageInterface import com.simiacryptus.skyenet.core.platform.file.DataStorage import com.simiacryptus.skyenet.core.util.getModuleRootForFile +import com.simiacryptus.skyenet.webui.application.AppInfoData +import com.simiacryptus.skyenet.webui.application.ApplicationServer import org.slf4j.LoggerFactory import java.awt.Desktop import kotlin.collections.set @@ -53,13 +55,19 @@ class PlanAheadAction : BaseAction() { parsingModel = AppSettingsState.instance.defaultFastModel(), ) SessionProxyServer.chats[session] = PlanAheadApp( - rootFile = root, planSettings = planSettings, model = AppSettingsState.instance.defaultSmartModel(), parsingModel = AppSettingsState.instance.defaultFastModel(), showMenubar = false, api = api, ) + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) val server = AppServer.getServer(e.project) openBrowser(server, session.toString()) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PlanChatAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PlanChatAction.kt index a97c237f..0a48eed2 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PlanChatAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PlanChatAction.kt @@ -12,6 +12,8 @@ import com.simiacryptus.skyenet.apps.plan.PlanSettings import com.simiacryptus.skyenet.core.platform.StorageInterface import com.simiacryptus.skyenet.core.platform.file.DataStorage import com.simiacryptus.skyenet.core.util.getModuleRootForFile +import com.simiacryptus.skyenet.webui.application.AppInfoData +import com.simiacryptus.skyenet.webui.application.ApplicationServer import org.slf4j.LoggerFactory import java.awt.Desktop import kotlin.collections.set @@ -42,7 +44,6 @@ class PlanChatAction : BaseAction() { ) DataStorage.sessionPaths[session] = root SessionProxyServer.chats[session] = PlanChatApp( - rootFile = root, planSettings = dialog.settings.copy( env = mapOf(), workingDir = root.absolutePath, @@ -57,6 +58,13 @@ class PlanChatAction : BaseAction() { showMenubar = false, api = api, ) + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) val server = AppServer.getServer(e.project) openBrowser(server, session.toString()) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PrePlanAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PrePlanAction.kt index 50366e25..6bdc4ccc 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PrePlanAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/PrePlanAction.kt @@ -17,6 +17,8 @@ import com.simiacryptus.skyenet.apps.plan.PlanUtil.isWindows import com.simiacryptus.skyenet.core.platform.StorageInterface import com.simiacryptus.skyenet.core.platform.file.DataStorage import com.simiacryptus.skyenet.core.util.getModuleRootForFile +import com.simiacryptus.skyenet.webui.application.AppInfoData +import com.simiacryptus.skyenet.webui.application.ApplicationServer import org.slf4j.LoggerFactory import java.awt.Desktop import java.awt.GridBagConstraints @@ -66,7 +68,6 @@ class PrePlanAction : BaseAction() { it.settings } SessionProxyServer.chats[session] = PlanAheadApp( - rootFile = root, planSettings = planSettings, model = AppSettingsState.instance.defaultSmartModel(), parsingModel = AppSettingsState.instance.defaultFastModel(), @@ -74,6 +75,13 @@ class PrePlanAction : BaseAction() { initialPlan = taskBreakdownWithPrompt, api = api, ) + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) val server = AppServer.getServer(e.project) openBrowser(server, session.toString()) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/ReactTypescriptWebDevelopmentAssistantAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/ReactTypescriptWebDevelopmentAssistantAction.kt index c1fad84a..f65e0618 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/ReactTypescriptWebDevelopmentAssistantAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/ReactTypescriptWebDevelopmentAssistantAction.kt @@ -31,6 +31,7 @@ import com.simiacryptus.skyenet.webui.application.ApplicationInterface import com.simiacryptus.skyenet.webui.application.ApplicationServer import com.simiacryptus.skyenet.webui.session.SessionTask import com.simiacryptus.skyenet.util.MarkdownUtil.renderMarkdown +import com.simiacryptus.skyenet.webui.application.AppInfoData import org.slf4j.LoggerFactory import java.awt.Desktop import java.io.ByteArrayOutputStream @@ -56,6 +57,13 @@ class ReactTypescriptWebDevelopmentAssistantAction : BaseAction() { DataStorage.sessionPaths[session] = selectedFile.toFile } SessionProxyServer.chats[session] = WebDevApp(root = selectedFile) + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) val server = AppServer.getServer(e.project) Thread { diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SaveAsQueryIndexAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SaveAsQueryIndexAction.kt index 93540d25..afb14cc3 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SaveAsQueryIndexAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SaveAsQueryIndexAction.kt @@ -11,8 +11,8 @@ import com.intellij.openapi.progress.ProgressIndicator import com.intellij.openapi.progress.ProgressManager import com.intellij.openapi.progress.Task import com.intellij.openapi.vfs.VirtualFile -import com.simiacryptus.skyenet.apps.general.parsers.DefaultParsingModel -import com.simiacryptus.skyenet.apps.general.parsers.DocumentRecord.Companion.saveAsBinary +import com.simiacryptus.skyenet.apps.parsers.DefaultParsingModel +import com.simiacryptus.skyenet.apps.parsers.DocumentRecord.Companion.saveAsBinary import org.slf4j.LoggerFactory import java.io.File import java.util.concurrent.Executors diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SessionProxyApp.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SessionProxyApp.kt index 8650a7db..7215f546 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SessionProxyApp.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SessionProxyApp.kt @@ -2,6 +2,7 @@ package com.github.simiacryptus.aicoder.actions.generic import com.simiacryptus.skyenet.core.platform.Session import com.simiacryptus.skyenet.core.platform.User +import com.simiacryptus.skyenet.webui.application.AppInfoData import com.simiacryptus.skyenet.webui.application.ApplicationServer import com.simiacryptus.skyenet.webui.chat.ChatServer import com.simiacryptus.skyenet.webui.session.SocketManager @@ -13,6 +14,16 @@ class SessionProxyServer : ApplicationServer( ) { override val singleInput = true override val stickyInput = false + override fun appInfo(session: Session) = appInfoMap.getOrPut(session) { + AppInfoData( + applicationName = applicationName, + singleInput = singleInput, + stickyInput = stickyInput, + loadImages = false, + showMenubar = showMenubar + ) + }.toMap() + override fun newSession(user: User?, session: Session) = chats[session]?.newSession(user, session) ?: agents[session]!! diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/ShellCommandAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/ShellCommandAction.kt index b52de436..6a8591b7 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/ShellCommandAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/ShellCommandAction.kt @@ -22,6 +22,7 @@ import com.simiacryptus.skyenet.core.platform.Session import com.simiacryptus.skyenet.core.platform.StorageInterface import com.simiacryptus.skyenet.core.platform.User import com.simiacryptus.skyenet.interpreter.ProcessInterpreter +import com.simiacryptus.skyenet.webui.application.AppInfoData import com.simiacryptus.skyenet.webui.application.ApplicationInterface import com.simiacryptus.skyenet.webui.application.ApplicationServer import com.simiacryptus.skyenet.webui.application.ApplicationSocketManager @@ -48,6 +49,13 @@ class ShellCommandAction : BaseAction() { return } val session = StorageInterface.newGlobalID() + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) SessionProxyServer.chats[session] = object : ApplicationServer( applicationName = "Shell Agent", path = "/shellAgent", diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SimpleCommandAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SimpleCommandAction.kt index dd9954be..c839b230 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SimpleCommandAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/SimpleCommandAction.kt @@ -28,6 +28,7 @@ import com.simiacryptus.skyenet.webui.application.ApplicationInterface import com.simiacryptus.skyenet.webui.application.ApplicationServer import com.simiacryptus.skyenet.webui.session.SessionTask import com.simiacryptus.skyenet.util.MarkdownUtil.renderMarkdown +import com.simiacryptus.skyenet.webui.application.AppInfoData import org.slf4j.LoggerFactory import java.awt.Desktop import java.io.File @@ -55,6 +56,13 @@ class SimpleCommandAction : BaseAction() { val session = StorageInterface.newGlobalID() val patchApp = createPatchApp(root.toFile(), session, settings, virtualFiles) SessionProxyServer.chats[session] = patchApp + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) val server = AppServer.getServer(event.project) openBrowserWithDelay(server.server.uri.resolve("/#$session")) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/WebDevelopmentAssistantAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/WebDevelopmentAssistantAction.kt index 74f87496..943407e8 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/WebDevelopmentAssistantAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/WebDevelopmentAssistantAction.kt @@ -31,6 +31,7 @@ import com.simiacryptus.skyenet.webui.application.ApplicationInterface import com.simiacryptus.skyenet.webui.application.ApplicationServer import com.simiacryptus.skyenet.webui.session.SessionTask import com.simiacryptus.skyenet.util.MarkdownUtil.renderMarkdown +import com.simiacryptus.skyenet.webui.application.AppInfoData import org.slf4j.LoggerFactory import java.awt.Desktop import java.io.ByteArrayOutputStream @@ -55,6 +56,13 @@ class WebDevelopmentAssistantAction : BaseAction() { DataStorage.sessionPaths[session] = selectedFile.toFile } SessionProxyServer.chats[session] = WebDevApp(root = selectedFile) + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) val server = AppServer.getServer(e.project) Thread { diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ChatWithCommitAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ChatWithCommitAction.kt index 9ab942f0..e90b9834 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ChatWithCommitAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ChatWithCommitAction.kt @@ -16,6 +16,7 @@ import com.intellij.openapi.vfs.VirtualFile import com.simiacryptus.diff.IterativePatchUtil import com.simiacryptus.skyenet.core.platform.ApplicationServices import com.simiacryptus.skyenet.core.platform.StorageInterface +import com.simiacryptus.skyenet.webui.application.AppInfoData import com.simiacryptus.skyenet.webui.application.ApplicationServer import java.io.File import java.awt.Desktop @@ -78,12 +79,12 @@ class ChatWithCommitAction : AnAction() { model = AppSettingsState.instance.smartModel.chatModel(), storage = ApplicationServices.dataStorageFactory(AppSettingsState.instance.pluginHome) ) - ApplicationServer.sessionAppInfoMap[session.toString()] = mapOf( - "applicationName" to "Commit Chat", - "singleInput" to false, - "stickyInput" to true, - "loadImages" to false, - "showMenubar" to false, + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = false, + stickyInput = true, + loadImages = false, + showMenubar = false ) val server = AppServer.getServer(e.project) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ChatWithCommitDiffAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ChatWithCommitDiffAction.kt index 11a05227..3c2e2785 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ChatWithCommitDiffAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ChatWithCommitDiffAction.kt @@ -14,6 +14,7 @@ import com.intellij.openapi.vcs.changes.TextRevisionNumber import com.intellij.openapi.vcs.history.VcsRevisionNumber import com.simiacryptus.skyenet.core.platform.ApplicationServices import com.simiacryptus.skyenet.core.platform.StorageInterface +import com.simiacryptus.skyenet.webui.application.AppInfoData import com.simiacryptus.skyenet.webui.application.ApplicationServer import git4idea.GitVcs import git4idea.commands.Git @@ -58,12 +59,12 @@ class ChatWithCommitDiffAction : AnAction() { model = AppSettingsState.instance.smartModel.chatModel(), storage = ApplicationServices.dataStorageFactory(AppSettingsState.instance.pluginHome) ) - ApplicationServer.sessionAppInfoMap[session.toString()] = mapOf( - "applicationName" to "Commit Chat", - "singleInput" to false, - "stickyInput" to true, - "loadImages" to false, - "showMenubar" to false, + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = false, + stickyInput = true, + loadImages = false, + showMenubar = false ) val server = AppServer.getServer(e.project) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ChatWithWorkingCopyDiffAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ChatWithWorkingCopyDiffAction.kt index 1e786c81..51e4bd0a 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ChatWithWorkingCopyDiffAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ChatWithWorkingCopyDiffAction.kt @@ -12,6 +12,7 @@ import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.vcs.VcsDataKeys import com.simiacryptus.skyenet.core.platform.ApplicationServices import com.simiacryptus.skyenet.core.platform.StorageInterface +import com.simiacryptus.skyenet.webui.application.AppInfoData import com.simiacryptus.skyenet.webui.application.ApplicationServer import git4idea.GitVcs import git4idea.commands.Git @@ -54,12 +55,12 @@ class ChatWithWorkingCopyDiffAction : AnAction() { model = AppSettingsState.instance.smartModel.chatModel(), storage = ApplicationServices.dataStorageFactory(AppSettingsState.instance.pluginHome) ) - ApplicationServer.sessionAppInfoMap[session.toString()] = mapOf( - "applicationName" to "Working Copy Diff Chat", - "singleInput" to false, - "stickyInput" to true, - "loadImages" to false, - "showMenubar" to false, + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = false, + stickyInput = true, + loadImages = false, + showMenubar = false ) val server = AppServer.getServer(e.project) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ReplicateCommitAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ReplicateCommitAction.kt index 570261cf..2b83466f 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ReplicateCommitAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/git/ReplicateCommitAction.kt @@ -31,6 +31,7 @@ import com.simiacryptus.skyenet.webui.application.ApplicationInterface import com.simiacryptus.skyenet.webui.application.ApplicationServer import com.simiacryptus.skyenet.webui.session.SessionTask import com.simiacryptus.skyenet.util.MarkdownUtil.renderMarkdown +import com.simiacryptus.skyenet.webui.application.AppInfoData import org.slf4j.LoggerFactory import java.awt.Desktop import java.io.File @@ -94,6 +95,13 @@ class ReplicateCommitAction : BaseAction() { } } SessionProxyServer.chats[session] = patchApp + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = true, + stickyInput = false, + loadImages = false, + showMenubar = false + ) } catch (e: Throwable) { log.warn("Error opening browser", e) } diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/problems/AnalyzeProblemAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/problems/AnalyzeProblemAction.kt index 0666b13d..13b64239 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/problems/AnalyzeProblemAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/problems/AnalyzeProblemAction.kt @@ -36,6 +36,7 @@ import com.simiacryptus.skyenet.webui.application.ApplicationSocketManager import com.simiacryptus.skyenet.webui.session.SessionTask import com.simiacryptus.skyenet.webui.session.SocketManager import com.simiacryptus.skyenet.util.MarkdownUtil.renderMarkdown +import com.simiacryptus.skyenet.webui.application.AppInfoData import java.awt.Desktop import javax.swing.JOptionPane @@ -93,12 +94,12 @@ class AnalyzeProblemAction : AnAction() { private fun openAnalysisSession(project: Project, problemInfo: String, gitRoot: VirtualFile?) { val session = StorageInterface.newGlobalID() SessionProxyServer.chats[session] = ProblemAnalysisApp(session, problemInfo, gitRoot) - ApplicationServer.sessionAppInfoMap[session.toString()] = mapOf( - "applicationName" to "Problem Analysis", - "singleInput" to false, - "stickyInput" to true, - "loadImages" to false, - "showMenubar" to false, + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = false, + stickyInput = true, + loadImages = false, + showMenubar = false ) val server = AppServer.getServer(project) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/test/TestResultAutofixAction.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/test/TestResultAutofixAction.kt index 84d9eaf0..e8053886 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/test/TestResultAutofixAction.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/test/TestResultAutofixAction.kt @@ -28,6 +28,7 @@ import com.simiacryptus.skyenet.webui.application.ApplicationSocketManager import com.simiacryptus.skyenet.webui.session.SessionTask import com.simiacryptus.skyenet.webui.session.SocketManager import com.simiacryptus.skyenet.util.MarkdownUtil.renderMarkdown +import com.simiacryptus.skyenet.webui.application.AppInfoData import org.jetbrains.annotations.NotNull import java.awt.Desktop import java.io.File @@ -154,12 +155,12 @@ class TestResultAutofixAction : BaseAction() { private fun openAutofixWithTestResult(e: AnActionEvent, testInfo: String, projectStructure: String) { val session = StorageInterface.newGlobalID() SessionProxyServer.chats[session] = TestResultAutofixApp(session, testInfo, e.project?.basePath, projectStructure) - ApplicationServer.sessionAppInfoMap[session.toString()] = mapOf( - "applicationName" to "Test Result Autofix", - "singleInput" to false, - "stickyInput" to true, - "loadImages" to false, - "showMenubar" to false, + ApplicationServer.appInfoMap[session] = AppInfoData( + applicationName = "Code Chat", + singleInput = false, + stickyInput = true, + loadImages = false, + showMenubar = false ) val server = AppServer.getServer(e.project) diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/util/CodeChatSocketManager.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/util/CodeChatSocketManager.kt index cc73b887..d6c7a93f 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/util/CodeChatSocketManager.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/util/CodeChatSocketManager.kt @@ -24,7 +24,7 @@ open class CodeChatSocketManager( |# `$filename` | |```$language - |${/*StringEscapeUtils.escapeHtml4*/(codeSelection)/*.indent(" ")*/} + |$codeSelection |``` """.trimMargin().trim(), systemPrompt = """ @@ -33,9 +33,7 @@ open class CodeChatSocketManager( |You will be answering questions about the following code located in `$filename`: | |```$language - |${ - codeSelection/*.indent(" ")*/ - }} + |$codeSelection |``` | |Responses may use markdown formatting, including code blocks. diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 79d3d611..499c7646 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -3,7 +3,7 @@ com.github.simiacryptus.intellijopenaicodeassist AI Coding Assistant SimiaCryptus Software - AI-Powered + Code Tools com.intellij.modules.platform com.intellij.modules.lang Git4Idea @@ -24,6 +24,7 @@ + + description="Opens the Simiacryptus Apps web page in your default browser, providing access to additional resources and documentation"> + description="Initiate an interactive session to discuss and apply patches to your code, with intelligent suggestions for modifications"> + description="Start an interactive dialogue about your selected code, offering insights, explanations, and suggestions for improvements"> + text="Coding Assistant Chat" + description="Initiate a general-purpose chat session to discuss coding concepts, get assistance with programming tasks, or explore software development ideas"> + description="Intelligent task planning and execution tool for breaking down complex coding tasks into manageable steps"> + description="Interactive session for project planning, task breakdown, and development strategy discussions"> + description="Convert selected parsed JSON files into an optimized binary index for efficient querying and data retrieval"> + description="Set up a structured task planning session with customizable parameters and execution environment"> + description="Break down complex code modifications into a series of manageable steps, with intelligent suggestions for each stage"> + description="Analyze and generate patches for multiple files simultaneously, considering the broader project context"> + description="Intelligent analysis and automatic resolution of build or test errors, with customizable fix suggestions"> + description="Comprehensive tool for extracting and analyzing text and images from various document formats (PDF, TXT, MD, HTML)"> + description="Execute custom coding tasks with intelligent assistance, analyzing project structure and context"> + description="Intelligently apply a provided patch to the selected file, with automatic conflict resolution and error handling"> + description="Initiate an interactive dialogue session to discuss and analyze multiple code files simultaneously"> + description="Generate visual representations of code structure, algorithms, or data flow based on selected code or project files"> + description="Automatically generate comprehensive documentation for selected files or entire project, with customizable output formats"> + description="Analyze and generate patches for multiple selected files, with intelligent suggestions for code modifications"> + description="Intelligently create a new file related to the selected one, suggesting appropriate content and file location"> + description="Create a new file with appropriate content based on a natural language description, intelligently determining file type and location"> + description="Comprehensive tool for web application development, assisting with file generation, code writing, and project structure"> @@ -188,7 +189,7 @@ @@ -196,7 +197,7 @@ + description="Intelligently extend Markdown lists by generating contextually relevant new items"> @@ -204,19 +205,22 @@ + description="Smart paste functionality that automatically detects and converts clipboard content to match the current file's programming language"> - - + + + + description="Quickly repeat the most recent intelligent coding operation in the current editor"> - + + + @@ -237,9 +241,10 @@ description="Add doc comments"> - - + + + + + + - + + + + + + - + + + - - - + + + - + + + - - + + + - - + +