Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
acharneski committed May 24, 2024
1 parent 3793d25 commit 9abb6bb
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 19 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repositories {
val kotlin_version = "2.0.0-Beta5"
val jetty_version = "11.0.18"
val slf4j_version = "2.0.9"
val skyenet_version = "1.0.72"
val skyenet_version = "1.0.73"
val remoterobot_version = "0.11.21"
val jackson_version = "2.17.0"

Expand All @@ -40,7 +40,7 @@ dependencies {
exclude(group = "org.jetbrains.kotlin", module = "")
}

implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.0.56")
implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.0.57")
{
exclude(group = "org.jetbrains.kotlin", module = "")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import com.simiacryptus.skyenet.webui.session.SocketManager
import com.simiacryptus.skyenet.webui.util.MarkdownUtil.renderMarkdown
import org.slf4j.LoggerFactory
import java.awt.Desktop
import java.io.File

class LineFilterChatAction : BaseAction() {
override fun getActionUpdateThread() = ActionUpdateThread.BGT
Expand Down Expand Up @@ -74,7 +73,7 @@ class LineFilterChatAction : BaseAction() {
""".trimMargin(),
api = api,
applicationClass = ApplicationServer::class.java,
storage = ApplicationServices.dataStorageFactory(root),
storage = ApplicationServices.dataStorageFactory(AppSettingsState.instance.pluginHome),
) {
override fun canWrite(user: User?): Boolean = true
override fun renderResponse(response: String, task: SessionTask): String {
Expand Down Expand Up @@ -109,7 +108,6 @@ class LineFilterChatAction : BaseAction() {
companion object {
private val log = LoggerFactory.getLogger(LineFilterChatAction::class.java)
private val agents = mutableMapOf<Session, SocketManager>()
val root: File get() = File(AppSettingsState.instance.pluginHome, "code_chat")
private fun initApp(server: AppServer, path: String): ChatServer {
server.appRegistry[path]?.let { return it }
val socketServer = object : ApplicationServer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import com.simiacryptus.skyenet.webui.chat.ChatServer
import com.simiacryptus.skyenet.webui.session.SocketManager
import org.slf4j.LoggerFactory
import java.awt.Desktop
import java.io.File

class CodeChatAction : BaseAction() {
override fun getActionUpdateThread() = ActionUpdateThread.BGT
Expand All @@ -39,7 +38,7 @@ class CodeChatAction : BaseAction() {
filename = filename,
api = api,
model = AppSettingsState.instance.smartModel.chatModel(),
storage = ApplicationServices.dataStorageFactory(root)
storage = ApplicationServices.dataStorageFactory(AppSettingsState.instance.pluginHome)
)

val server = AppServer.getServer(e.project)
Expand All @@ -61,7 +60,6 @@ class CodeChatAction : BaseAction() {
companion object {
private val log = LoggerFactory.getLogger(CodeChatAction::class.java)
private val agents = mutableMapOf<Session, SocketManager>()
val root: File get() = File(AppSettingsState.instance.pluginHome, "code_chat")
private fun initApp(server: AppServer, path: String): ChatServer {
server.appRegistry[path]?.let { return it }
val socketServer = object : ApplicationServer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import com.simiacryptus.skyenet.webui.util.MarkdownUtil.renderMarkdown
import org.intellij.lang.annotations.Language
import org.slf4j.LoggerFactory
import java.awt.Desktop
import java.io.File

class DiffChatAction : BaseAction() {
override fun getActionUpdateThread() = ActionUpdateThread.BGT
Expand Down Expand Up @@ -60,7 +59,7 @@ class DiffChatAction : BaseAction() {
filename = filename,
api = api,
model = AppSettingsState.instance.smartModel.chatModel(),
storage = ApplicationServices.dataStorageFactory(root)
storage = ApplicationServices.dataStorageFactory(AppSettingsState.instance.pluginHome)
) {
override val systemPrompt: String
@Language("Markdown")
Expand Down Expand Up @@ -143,7 +142,6 @@ class DiffChatAction : BaseAction() {
companion object {
private val log = LoggerFactory.getLogger(DiffChatAction::class.java)
private val agents = mutableMapOf<Session, SocketManager>()
val root: File get() = File(AppSettingsState.instance.pluginHome, "code_chat")
private fun initApp(server: AppServer, path: String): ChatServer {
server.appRegistry[path]?.let { return it }
val socketServer = object : ApplicationServer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@ import com.github.simiacryptus.aicoder.AppServer
import com.github.simiacryptus.aicoder.actions.BaseAction
import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.github.simiacryptus.aicoder.config.AppSettingsState.Companion.chatModel
import com.github.simiacryptus.aicoder.util.CodeChatSocketManager
import com.github.simiacryptus.aicoder.util.ComputerLanguage
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
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.Session
import com.simiacryptus.skyenet.core.platform.StorageInterface
Expand All @@ -20,7 +16,6 @@ import com.simiacryptus.skyenet.webui.chat.ChatSocketManager
import com.simiacryptus.skyenet.webui.session.SocketManager
import org.slf4j.LoggerFactory
import java.awt.Desktop
import java.io.File

class GenericChatAction : BaseAction() {
override fun getActionUpdateThread() = ActionUpdateThread.BGT
Expand All @@ -39,7 +34,7 @@ class GenericChatAction : BaseAction() {
userInterfacePrompt = userInterfacePrompt,
systemPrompt = systemPrompt,
api = api,
storage = ApplicationServices.dataStorageFactory(root),
storage = ApplicationServices.dataStorageFactory(AppSettingsState.instance.pluginHome),
applicationClass = ApplicationServer::class.java,
)

Expand All @@ -62,7 +57,6 @@ class GenericChatAction : BaseAction() {
companion object {
private val log = LoggerFactory.getLogger(CodeChatAction::class.java)
private val agents = mutableMapOf<Session, SocketManager>()
val root: File get() = File(AppSettingsState.instance.pluginHome, "code_chat")
private fun initApp(server: AppServer, path: String): ChatServer {
server.appRegistry[path]?.let { return it }
val socketServer = object : ApplicationServer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MultiStepPatchAction : BaseAction() {

override fun handle(e: AnActionEvent) {
val session = StorageInterface.newGlobalID()
val storage = ApplicationServices.dataStorageFactory(DiffChatAction.root) as DataStorage?
val storage = ApplicationServices.dataStorageFactory(AppSettingsState.instance.pluginHome) as DataStorage?
val selectedFile = UITools.getSelectedFolder(e)
if (null != storage && null != selectedFile) {
DataStorage.sessionPaths[session] = selectedFile.toFile
Expand Down

0 comments on commit 9abb6bb

Please sign in to comment.