Skip to content

Commit 11b86f6

Browse files
authored
1.4.6 (#159)
* 1.4.6 * Update WebDevelopmentAssistantAction.kt * Update build.gradle.kts * misc ui * update descriptions * Update plugin.xml * ui updates * 1.5.0 * docs * Update PlanAheadAction.kt * wip * open page action * wip * Update MultiDiffChatAction.kt * Update WebDevelopmentAssistantAction.kt * Update WebDevelopmentAssistantAction.kt * wip * Update MultiStepPatchAction.kt * Update MultiStepPatchAction.kt
1 parent 5cdd394 commit 11b86f6

20 files changed

+844
-1085
lines changed

README.md

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# **AI Coding Assistant: The Ultimate IntelliJ Plugin for Developers**
1+
# 🚀 AI Coding Assistant: The Ultimate IntelliJ Plugin for Developers 🌟
22

33
![Build](https://github.com/SimiaCryptus/intellij-aicoder/workflows/Build/badge.svg)
44
[![Version](https://img.shields.io/jetbrains/plugin/v/20724-ai-coding-assistant.svg)](https://plugins.jetbrains.com/plugin/20724-ai-coding-assistant)
@@ -10,11 +10,11 @@ Are you a developer looking to supercharge your coding workflow? Look no further
1010
game-changing IntelliJ plugin that harnesses the power of cutting-edge Language Model APIs to revolutionize the way you
1111
code!
1212

13-
## **Key Features**
13+
## 🌟 Key Features
1414

1515
* 🌐 **Extensive API Support**: AI Coding Assistant seamlessly integrates with a wide range of leading LLM APIs,
1616
including [OpenAI](https://platform.openai.com/), [AWS Bedrock](https://console.aws.amazon.com/bedrock/), [Anthropic](https://api.anthropic.com/v1), [Google](https://generativelanguage.googleapis.com/), [Groq](https://console.groq.com/), [Perplexity AI](https://www.perplexity.ai/),
17-
and [ModelsLab](https://modelslab.com/dashboard/). Get your API keys and unlock a world of possibilities!
17+
and [ModelsLab](https://modelslab.com/dashboard/). 🔑 Get your API keys and unlock a world of possibilities!
1818

1919
* 💸 **No Membership Fees**: While API access is typically paid, AI Coding Assistant charges no base fee. You only pay
2020
for what you use, giving you complete control over your expenses.
@@ -25,7 +25,7 @@ code!
2525
* 🎛️ **Intuitive Toolbar UI**: Easily configure temperature/model settings and monitor your current token count with AI
2626
Coding Assistant's sleek, intuitive toolbar UI.
2727

28-
* 🔍 **API Request Management**: Intercept, edit, and log API requests with ease, giving you granular control over your
28+
* 🔍 **API Request Management**: 🎛️ Intercept, edit, and log API requests with ease, giving you granular control over your
2929
plugin's behavior.
3030

3131
## **Installation & Setup**
@@ -36,33 +36,26 @@ Getting started with AI Coding Assistant is a breeze:
3636
2. Input your token(s) into the appropriate field(s) in the plugin's settings panel.
3737
3. Start coding smarter, not harder!
3838

39-
## **Unleash Your Coding Potential**
39+
## 🚀 Unleash Your Coding Potential
4040

4141
AI Coding Assistant offers a suite of powerful actions designed to streamline your coding process. Access these
4242
game-changing features via the context menu within your editor or project view:
4343

44-
* 💬 **DiffChatAction & MultiDiffChatAction**: Collaborate effortlessly with AI-powered chat sessions that generate and
45-
apply code diffs across single or multiple files.
44+
* 💬 **Code & Patch Chat**: Discuss code, generate, and apply code patches.
4645

47-
* 🚀 **MultiStepPatchAction**: Transform user directives into actionable development tasks and code modifications, automating
48-
key aspects of your workflow.
46+
* 🚀 **Planning with AI Agents**: Transform user directives into complex sequences of actionable development tasks, executed by an AI agent system
4947

50-
* 📊 **mermaid.js Integration**: Visualize your code and ideas with stunning diagrams generated using the mermaid.js
51-
library.
48+
* 📊 **Markdown and Mermaid.js**: Visualize your code and ideas with stunning diagrams generated using markdown with the mermaid.js library.
5249

53-
* 📝 **Plaintext, Code, and Markdown Actions**: From text processing and code editing to Markdown enhancements, AI Coding
54-
Assistant has you covered.
55-
56-
* 🛠️ **Developer-Mode Actions**: Access debugging tools, experimental features, and more with our developer-mode
57-
actions.
50+
* 📝 **Plaintext, Coding, and Markdown Actions**: 💪 From text processing to code editing, AI Coding Assistant has you covered.
5851

5952
## **Join the AI Coding Revolution**
6053

6154
Ready to take your coding to the next level? Install AI Coding Assistant today and experience the future of software
6255
development. With our powerful features, extensive API support, and user-friendly interface, you'll wonder how you ever
6356
coded without it!
6457

65-
🌟 Boost your productivity, unleash your creativity, and code smarter with AI Coding Assistant – the ultimate IntelliJ
58+
🚀 Boost your productivity, unleash your creativity, and code smarter with AI Coding Assistant – the ultimate IntelliJ
6659
plugin for developers. 🌟
6760

6861
*Please note that AI Coding Assistant is not affiliated with OpenAI, JetBrains, or any other corporation or

build.gradle.kts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
import org.jetbrains.changelog.Changelog
1+
import org.jetbrains.changelog.Changelog
32
import org.jetbrains.changelog.markdownToHTML
43

54
fun properties(key: String) = providers.gradleProperty(key).get()
@@ -26,7 +25,7 @@ repositories {
2625
val kotlin_version = "2.0.0-Beta5"
2726
val jetty_version = "11.0.18"
2827
val slf4j_version = "2.0.9"
29-
val skyenet_version = "1.0.65"
28+
val skyenet_version = "1.0.66"
3029
val remoterobot_version = "0.11.21"
3130
val jackson_version = "2.17.0"
3231

@@ -41,7 +40,7 @@ dependencies {
4140
exclude(group = "org.jetbrains.kotlin", module = "")
4241
}
4342

44-
implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.0.54")
43+
implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.0.55")
4544
{
4645
exclude(group = "org.jetbrains.kotlin", module = "")
4746
}
@@ -76,11 +75,16 @@ dependencies {
7675
implementation(group = "org.eclipse.jetty.websocket", name = "websocket-servlet", version = jetty_version)
7776

7877
implementation(group = "org.slf4j", name = "slf4j-api", version = slf4j_version)
79-
testImplementation(group = "org.slf4j", name = "slf4j-simple", version = slf4j_version)
78+
runtimeOnly(group = "org.slf4j", name = "slf4j-simple", version = slf4j_version)
8079

8180
testImplementation(group = "com.intellij.remoterobot", name = "remote-robot", version = remoterobot_version)
8281
testImplementation(group = "com.intellij.remoterobot", name = "remote-fixtures", version = remoterobot_version)
83-
testImplementation(group = "com.intellij.remoterobot", name = "robot-server-plugin", version = remoterobot_version, ext = "zip")
82+
testImplementation(
83+
group = "com.intellij.remoterobot",
84+
name = "robot-server-plugin",
85+
version = remoterobot_version,
86+
ext = "zip"
87+
)
8488

8589
testImplementation(group = "com.squareup.okhttp3", name = "okhttp", version = "4.12.0")
8690

@@ -179,10 +183,12 @@ intellij {
179183
pluginName.set(properties("pluginName"))
180184
version.set(properties("platformVersion"))
181185
type.set(properties("platformType"))
182-
plugins.set(listOf(
183-
"com.intellij.java",
184-
"org.jetbrains.kotlin",
185-
))
186+
plugins.set(
187+
listOf(
188+
"com.intellij.java",
189+
"org.jetbrains.kotlin",
190+
)
191+
)
186192
}
187193

188194
changelog {
@@ -199,5 +205,4 @@ qodana {
199205

200206
//kover.xmlReport {
201207
// onCheck.set(true)
202-
//}
203-
208+
//}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pluginName=intellij-aicoder
22
pluginRepositoryUrl=https://github.com/SimiaCryptus/intellij-aicoder
3-
pluginVersion=1.4.5
3+
pluginVersion=1.5.0
44

55
jvmArgs=-Xmx8g
66
org.gradle.jvmargs=-Xmx8g
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.github.simiacryptus.aicoder.actions
2+
3+
import com.intellij.openapi.actionSystem.AnAction
4+
import com.intellij.openapi.actionSystem.AnActionEvent
5+
import java.awt.Desktop
6+
import java.net.URI
7+
8+
class OpenWebPageAction : AnAction() {
9+
override fun actionPerformed(event: AnActionEvent) {
10+
if (Desktop.isDesktopSupported()) {
11+
val desktop = Desktop.getDesktop()
12+
if (desktop.isSupported(Desktop.Action.BROWSE)) {
13+
desktop.browse(URI("http://apps.simiacrypt.us/"))
14+
}
15+
}
16+
}
17+
}

src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/DiffChatAction.kt

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import com.simiacryptus.skyenet.webui.chat.ChatServer
2323
import com.simiacryptus.skyenet.webui.session.SessionTask
2424
import com.simiacryptus.skyenet.webui.session.SocketManager
2525
import com.simiacryptus.skyenet.webui.util.MarkdownUtil.renderMarkdown
26+
import org.intellij.lang.annotations.Language
2627
import org.slf4j.LoggerFactory
2728
import java.awt.Desktop
2829
import java.io.File
@@ -62,26 +63,46 @@ class DiffChatAction : BaseAction() {
6263
storage = ApplicationServices.dataStorageFactory(root)
6364
) {
6465
override val systemPrompt: String
66+
@Language("Markdown")
6567
get() = super.systemPrompt + """
66-
Please provide code modifications in the following diff format within triple-backtick diff code blocks. Each diff block should be preceded by a header that identifies the file being modified.
67-
68-
The diff format rules are as follows:
69-
- Use '-' at the beginning of a line to indicate a deletion.
70-
- Use '+' at the beginning of a line to indicate an addition.
71-
- Include 2 lines of context before and after every change to help identify the location of the change.
72-
- If a line is part of the original code and hasn't been modified, simply include it without '+' or '-'.
73-
- Lines starting with "@@" or "---" or "+++" are treated as headers and are ignored.
74-
75-
Example:
76-
77-
### Path/To/YourFile.ext
78-
```diff
79-
- This line will be removed.
80-
+ This line will be added.
81-
```
82-
83-
Note: The diff should accurately reflect the changes to be made to the code, including sufficient context to ensure the modifications can be correctly applied.
84-
""".trimIndent()
68+
|Please provide code modifications in the following diff format within triple-backtick diff code blocks. Each diff block should be preceded by a header that identifies the file being modified.
69+
|
70+
|The diff format rules are as follows:
71+
|- Use '-' at the beginning of a line to indicate a deletion.
72+
|- Use '+' at the beginning of a line to indicate an addition.
73+
|- Include 2 lines of context before and after every change to help identify the location of the change.
74+
|- If a line is part of the original code and hasn't been modified, simply include it without '+' or '-'.
75+
|- Lines starting with "@@" or "---" or "+++" are treated as headers and are ignored.
76+
|
77+
|Example:
78+
|
79+
|Here are the patches:
80+
|
81+
|### src/utils/exampleUtils.js
82+
|```diff
83+
| // Utility functions for example feature
84+
| const b = 2;
85+
| function exampleFunction() {
86+
|- return b + 1;
87+
|+ return b + 2;
88+
| }
89+
|```
90+
|
91+
|### tests/exampleUtils.test.js
92+
|```diff
93+
| // Unit tests for exampleUtils
94+
| const assert = require('assert');
95+
| const { exampleFunction } = require('../src/utils/exampleUtils');
96+
|
97+
| describe('exampleFunction', () => {
98+
|- it('should return 3', () => {
99+
|+ it('should return 4', () => {
100+
| assert.equal(exampleFunction(), 3);
101+
| });
102+
| });
103+
|```
104+
105+
""".trimMargin()
85106

86107
val ui by lazy { ApplicationInterface(this) }
87108
override fun renderResponse(response: String, task: SessionTask) = """<div>${
@@ -126,7 +147,7 @@ class DiffChatAction : BaseAction() {
126147
private fun initApp(server: AppServer, path: String): ChatServer {
127148
server.appRegistry[path]?.let { return it }
128149
val socketServer = object : ApplicationServer(
129-
applicationName = "Code Chat",
150+
applicationName = "Patch Chat",
130151
path = path,
131152
showMenubar = false,
132153
) {

src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/GenerateRelatedFileAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import javax.swing.JTextArea
2626
class GenerateRelatedFileAction : FileContextAction<GenerateRelatedFileAction.Settings>() {
2727
override fun getActionUpdateThread() = ActionUpdateThread.BGT
2828
override fun isEnabled(event: AnActionEvent): Boolean {
29-
if (UITools.getSelectedFile(event)?.isDirectory == true) return false
29+
if (UITools.getSelectedFiles(event).size != 1) return false
3030
return super.isEnabled(event)
3131
}
3232

src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/GenericChatAction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class GenericChatAction : BaseAction() {
6666
private fun initApp(server: AppServer, path: String): ChatServer {
6767
server.appRegistry[path]?.let { return it }
6868
val socketServer = object : ApplicationServer(
69-
applicationName = "Code Chat",
69+
applicationName = "AI Chat",
7070
path = path,
7171
showMenubar = false,
7272
) {

src/main/kotlin/com/github/simiacryptus/aicoder/actions/generic/MultiDiffChatAction.kt

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package com.github.simiacryptus.aicoder.actions.generic
22

3-
import com.github.simiacryptus.aicoder.actions.BaseAction
43
import com.github.simiacryptus.aicoder.AppServer
4+
import com.github.simiacryptus.aicoder.actions.BaseAction
55
import com.github.simiacryptus.aicoder.config.AppSettingsState
66
import com.github.simiacryptus.aicoder.config.AppSettingsState.Companion.chatModel
7-
import com.github.simiacryptus.aicoder.util.ComputerLanguage
87
import com.github.simiacryptus.aicoder.util.UITools
98
import com.github.simiacryptus.diff.addApplyFileDiffLinks
109
import com.intellij.openapi.actionSystem.ActionUpdateThread
1110
import com.intellij.openapi.actionSystem.AnActionEvent
1211
import com.intellij.openapi.actionSystem.PlatformDataKeys
12+
import com.simiacryptus.jopenai.GPT4Tokenizer
1313
import com.simiacryptus.skyenet.core.platform.ApplicationServices
1414
import com.simiacryptus.skyenet.core.platform.Session
1515
import com.simiacryptus.skyenet.core.platform.StorageInterface
@@ -63,12 +63,19 @@ class MultiDiffChatAction : BaseAction() {
6363
//DataStorage.sessionPaths[session] = root.toFile()
6464

6565
val codeSummary = codeSummary()
66+
val codex = GPT4Tokenizer(false)
6667
agents[session] = object : ChatSocketManager(
6768
session = session,
6869
model = AppSettingsState.instance.smartModel.chatModel(),
6970
userInterfacePrompt = """
7071
|
71-
|$codeSummary
72+
|${
73+
codeFiles.entries.joinToString("\n\n") { (path, code) ->
74+
"""
75+
|* $path - ${ codex.estimateTokenCount(code) } tokens
76+
""".trimMargin()
77+
}
78+
}
7279
|
7380
""".trimMargin().trim(),
7481
systemPrompt = """
@@ -85,15 +92,31 @@ class MultiDiffChatAction : BaseAction() {
8592
|
8693
|Example:
8794
|
88-
|Explanation text
95+
|Here are the patches:
8996
|
90-
|### scripts/filename.js
97+
|### src/utils/exampleUtils.js
9198
|```diff
92-
|- const b = 2;
93-
|+ const a = 1;
99+
| // Utility functions for example feature
100+
| const b = 2;
101+
| function exampleFunction() {
102+
|- return b + 1;
103+
|+ return b + 2;
104+
| }
94105
|```
95106
|
96-
|Continued text
107+
|### tests/exampleUtils.test.js
108+
|```diff
109+
| // Unit tests for exampleUtils
110+
| const assert = require('assert');
111+
| const { exampleFunction } = require('../src/utils/exampleUtils');
112+
|
113+
| describe('exampleFunction', () => {
114+
|- it('should return 3', () => {
115+
|+ it('should return 4', () => {
116+
| assert.equal(exampleFunction(), 3);
117+
| });
118+
| });
119+
|```
97120
""".trimMargin(),
98121
api = api,
99122
applicationClass = ApplicationServer::class.java,
@@ -139,7 +162,7 @@ class MultiDiffChatAction : BaseAction() {
139162
private fun initApp(server: AppServer, path: String): ChatServer {
140163
server.appRegistry[path]?.let { return it }
141164
val socketServer = object : ApplicationServer(
142-
applicationName = "Multi-file Diff Chat",
165+
applicationName = "Multi-file Patch Chat",
143166
path = path,
144167
showMenubar = false,
145168
) {

0 commit comments

Comments
 (0)