diff --git a/.idea/modules.xml b/.idea/modules.xml index c0a1ad5fd1e4..26341c6265e5 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -49,14 +49,16 @@ + + + + - - @@ -88,8 +90,6 @@ - - @@ -953,6 +953,7 @@ + @@ -991,9 +992,9 @@ - + - + @@ -1013,6 +1014,8 @@ + + @@ -1027,6 +1030,11 @@ + + + + + @@ -1078,9 +1086,12 @@ + + + @@ -1156,6 +1167,7 @@ + @@ -1197,6 +1209,8 @@ + + @@ -1254,6 +1268,7 @@ + @@ -1484,6 +1499,7 @@ + @@ -1605,10 +1621,16 @@ - - - - + + + + + + + + + + @@ -1693,6 +1715,7 @@ + @@ -1734,6 +1757,11 @@ + + + + + @@ -1789,6 +1817,7 @@ + @@ -1816,6 +1845,7 @@ + @@ -1869,6 +1899,8 @@ + + @@ -1883,10 +1915,13 @@ + + + @@ -1907,6 +1942,8 @@ + + @@ -1963,6 +2000,7 @@ + @@ -2113,7 +2151,6 @@ - diff --git a/plugins/agent-workbench/engine/BUILD.bazel b/plugins/agent-workbench/engine/BUILD.bazel index 6b5f15fe0db6..09812407f491 100644 --- a/plugins/agent-workbench/engine/BUILD.bazel +++ b/plugins/agent-workbench/engine/BUILD.bazel @@ -30,8 +30,6 @@ jvm_library( "@lib//:kotlin-stdlib", "//libraries/kotlinx/serialization/core", "//libraries/kotlinx/serialization/json", - "//libraries/markdown", - "//platform/analysis-api:analysis", "//platform/util/concurrency", "//platform/core-api:core", "//platform/core-ui", @@ -44,7 +42,7 @@ jvm_library( "//plugins/agent-workbench/lib-agent/core", "//plugins/agent-workbench/prompt/core", "//plugins/agent-workbench/lib-agent/sessions-core:ai-agent-sessions-core", - "//plugins/agent-workbench/thread-view:agent-workbench-thread-view", + "//plugins/agent-workbench/chat", ], ) @@ -62,8 +60,6 @@ jvm_library( ":engine", "//libraries/kotlinx/serialization/core:core_test_lib", "//libraries/kotlinx/serialization/json:json_test_lib", - "//libraries/markdown:markdown_test_lib", - "//platform/analysis-api:analysis_test_lib", "//platform/util/concurrency:concurrency_test_lib", "//platform/core-api:core_test_lib", "//platform/core-ui:core-ui_test_lib", @@ -76,7 +72,7 @@ jvm_library( "//plugins/agent-workbench/lib-agent/core:core_test_lib", "//plugins/agent-workbench/prompt/core:core_test_lib", "//plugins/agent-workbench/lib-agent/sessions-core:ai-agent-sessions-core_test_lib", - "//plugins/agent-workbench/thread-view:agent-workbench-thread-view_test_lib", + "//plugins/agent-workbench/chat:chat_test_lib", ], ) ### auto-generated section `build intellij.agent.workbench.engine` end @@ -132,8 +128,6 @@ jvm_library( "//platform/core-api:core_test_lib", "//platform/util", "//platform/util:util_test_lib", - "//plugins/agent-workbench/lib-agent/sessions-core:ai-agent-sessions-core", - "//plugins/agent-workbench/lib-agent/sessions-core:ai-agent-sessions-core_test_lib", "//libraries/junit5", "//libraries/junit5:junit5_test_lib", "//libraries/assertj-core", diff --git a/plugins/agent-workbench/engine/intellij.agent.workbench.engine.iml b/plugins/agent-workbench/engine/intellij.agent.workbench.engine.iml index 2226566bc349..1d7f9499cfdb 100644 --- a/plugins/agent-workbench/engine/intellij.agent.workbench.engine.iml +++ b/plugins/agent-workbench/engine/intellij.agent.workbench.engine.iml @@ -9,12 +9,14 @@ - - + + - $KOTLIN_BUNDLED$/lib/kotlinx-serialization-compiler-plugin.jar + + $KOTLIN_BUNDLED$/lib/kotlinx-serialization-compiler-plugin.jar + @@ -25,29 +27,27 @@ - + + + - + + + - + - - - - + - - - - - - - - + + + + + \ No newline at end of file diff --git a/plugins/agent-workbench/engine/resources/intellij.agent.workbench.engine.xml b/plugins/agent-workbench/engine/resources/intellij.agent.workbench.engine.xml index 14fb3ecd72c7..0d1491ae3d8e 100644 --- a/plugins/agent-workbench/engine/resources/intellij.agent.workbench.engine.xml +++ b/plugins/agent-workbench/engine/resources/intellij.agent.workbench.engine.xml @@ -5,7 +5,7 @@ - + @@ -23,6 +23,14 @@ dynamic="true"/> + + + + + - get() = EngineChangeBus.changes.map { change -> - toSourceUpdateEvent( - store = EngineProjectService.storeForPath(change.projectPath), - projectPath = change.projectPath, - threadId = change.threadId, - ) + get() = EngineChangeBus.changes.map { + AgentSessionSourceUpdateEvent.threadsChanged() } - override suspend fun listThreads(path: String, openProject: Project?): List { - if (openProject != null) { - val tracker = EngineUnreadTracker.getInstance(openProject) - return surfacedThreads(EngineProjectService.getInstance(openProject).eventStore) { tracker.isUnread(it) } - } + override suspend fun listThreadsFromOpenProject(path: String, project: Project): List { + val tracker = EngineUnreadTracker.getInstance(project) + return surfacedThreads(EngineProjectService.getInstance(project).eventStore) { tracker.isUnread(it) } + } + + override suspend fun listThreadsFromClosedProject(path: String): List { // No project instance -> no live unread state; restored threads are never badged. return surfacedThreads(EngineProjectService.storeForPath(path)) { false } } @@ -75,24 +70,6 @@ internal class EngineSessionSource : AgentSessionSource, AgentSessionUpdateSourc .map { toThread(it, unread(it.thread.id)) } } - private fun toSourceUpdateEvent( - store: EventStore, - projectPath: String, - threadId: ThreadId, - ): AgentSessionSourceUpdateEvent { - val projection = store.projection(threadId) - return AgentSessionSourceUpdateEvent.threadsChanged( - scopedPaths = setOf(projectPath), - threadIds = setOf(threadId.value), - presentationUpdatesByThreadId = mapOf( - threadId.value to AgentSessionThreadPresentationUpdate( - title = projection.thread.title.ifBlank { threadId.value }, - updatedAt = projection.thread.updatedAt, - ) - ), - ) - } - override suspend fun loadThreadOutline(path: String, threadId: String, subAgentId: String?): AgentSessionThreadOutline { val projection = EngineProjectService.storeForPath(path).projection(ThreadId(threadId)) val items = projection.transcript.map { entry -> @@ -120,7 +97,7 @@ internal class EngineSessionSource : AgentSessionSource, AgentSessionUpdateSourc updatedAt = thread.updatedAt, archived = false, // A live, unseen agent reply gets the attention badge; otherwise fall back to the status mapping. - activityReport = AgentThreadActivityReport(if (unread) AgentThreadActivity.NEEDS_INPUT else mapActivity(thread.status)), + activity = if (unread) AgentThreadActivity.NEEDS_INPUT else mapActivity(thread.status), provider = provider, ) } @@ -142,7 +119,7 @@ internal class EngineSessionSource : AgentSessionSource, AgentSessionUpdateSourc else -> AgentSessionOutlineItemKind.METADATA } is ThreadToolCall, is ThreadCommand -> AgentSessionOutlineItemKind.TOOL_CALL - is ThreadPlan, is ThreadFileDiff, is ThreadContextCompaction, is ThreadActionPrompt -> AgentSessionOutlineItemKind.METADATA + is ThreadPlan, is ThreadFileDiff, is ThreadContextCompaction -> AgentSessionOutlineItemKind.METADATA } private fun outlineTitle(entry: ThreadTranscriptEntry): String = when (entry) { @@ -152,7 +129,6 @@ internal class EngineSessionSource : AgentSessionSource, AgentSessionUpdateSourc is ThreadPlan -> entry.title ?: entry.id is ThreadFileDiff -> entry.title ?: entry.path ?: entry.id is ThreadContextCompaction -> entry.title ?: entry.id - is ThreadActionPrompt -> entry.title } private fun outlinePreview(entry: ThreadTranscriptEntry): String = when (entry) { @@ -162,6 +138,5 @@ internal class EngineSessionSource : AgentSessionSource, AgentSessionUpdateSourc is ThreadPlan -> entry.items.joinToString(separator = "\n") { it.title } is ThreadFileDiff -> entry.newText.orEmpty() is ThreadContextCompaction -> entry.summary.orEmpty() - is ThreadActionPrompt -> entry.message ?: entry.buttons.joinToString(separator = "\n") { it.text } } } diff --git a/plugins/agent-workbench/plugin/plugin-content.yaml b/plugins/agent-workbench/plugin/plugin-content.yaml index 3a8916db4fe7..9595affca83b 100644 --- a/plugins/agent-workbench/plugin/plugin-content.yaml +++ b/plugins/agent-workbench/plugin/plugin-content.yaml @@ -1,6 +1,12 @@ - name: lib/agent-workbench-plugin.jar modules: - name: intellij.agent.workbench.plugin +- name: lib/modules/intellij.agent.workbench.acp.jar + contentModules: + - name: intellij.agent.workbench.acp +- name: lib/modules/intellij.agent.workbench.acp.runtime.jar + contentModules: + - name: intellij.agent.workbench.acp.runtime - name: lib/modules/intellij.agent.workbench.ai.code.review.integration.jar contentModules: - name: intellij.agent.workbench.ai.code.review.integration @@ -47,6 +53,9 @@ - name: $MAVEN_REPOSITORY$/io/modelcontextprotocol/kotlin-sdk-server-jvm/0/kotlin-sdk-server-jvm-0.jar - name: $MAVEN_REPOSITORY$/io/modelcontextprotocol/kotlin-sdk-core-jvm/0/kotlin-sdk-core-jvm-0.jar reason: <- intellij.agent.workbench.container.mcp +- name: lib/modules/intellij.agent.workbench.engine.jar + contentModules: + - name: intellij.agent.workbench.engine - name: lib/modules/intellij.agent.workbench.pi.awb.jar contentModules: - name: intellij.agent.workbench.pi.awb