Repository navigation
feat(chatdb): add ChatDB agent for text-to-SQL interactions - #509
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThis PR introduces a comprehensive Text2SQL (ChatDB) Agent feature enabling natural language to SQL conversion with schema linking, multi-database support, SQL validation/revision, and optional visualization. It adds new AgentType.CHAT_DB with corresponding UI components, core agent implementations, NLP tokenization, database infrastructure, platform-specific SQL validators, and a multiplatform data source repository with SQLDelight persistence. Changes
Sequence DiagramsequenceDiagram
participant User as User
participant UI as ChatDB UI
participant VM as ChatDBViewModel
participant Agent as ChatDBAgent
participant Executor as ChatDBAgentExecutor
participant SchemaLinker as SchemaLinker
participant LLM as LLM Service
participant Validator as SQL Validator
participant Reviser as SqlReviseAgent
participant DB as Database
User->>UI: Enter natural language query
UI->>VM: sendMessage(text)
VM->>Agent: execute(ChatDBTask)
Agent->>Executor: execute(task)
rect rgb(200, 220, 255)
Note over Executor,DB: Schema Linking Phase
Executor->>SchemaLinker: link(query, schema)
SchemaLinker->>SchemaLinker: extractKeywords(query)
SchemaLinker->>DB: (optional) fetch schema context
SchemaLinker-->>Executor: SchemaLinkingResult
Executor->>VM: renderChatDBStep(SCHEMA_LINKING, SUCCESS)
end
rect rgb(200, 255, 220)
Note over Executor,LLM: SQL Generation Phase
Executor->>Executor: buildInitialUserMessage(task, schema)
Executor->>LLM: generateSQL(systemPrompt, userMessage)
LLM-->>Executor: response with SQL
Executor->>Executor: extractSqlFromResponse(response)
Executor->>VM: renderChatDBStep(GENERATE_SQL, SUCCESS)
end
rect rgb(255, 240, 200)
Note over Executor,Validator: Validation & Revision Phase
Executor->>Validator: validate(sql)
alt SQL Invalid
Executor->>Reviser: execute(SqlRevisionInput)
Reviser->>LLM: askLLMForRevision(context)
LLM-->>Reviser: revised sql
Reviser->>Validator: validate(revisedSql)
Validator-->>Reviser: result
Reviser-->>Executor: revised sql or error
Executor->>VM: renderChatDBStep(REVISE_SQL, SUCCESS)
else SQL Valid
Executor->>VM: renderChatDBStep(VALIDATE_SQL, SUCCESS)
end
end
rect rgb(255, 220, 220)
Note over Executor,DB: Execution Phase
Executor->>DB: executeQuery(sql)
DB-->>Executor: QueryResult
Executor->>VM: renderChatDBStep(EXECUTE_SQL, SUCCESS)
end
rect rgb(220, 220, 255)
Note over Executor,LLM: Visualization Phase (optional)
alt generateVisualization flag
Executor->>Executor: buildTableContext(result)
Executor->>LLM: generateVisualization(data)
LLM-->>Executor: PlotDSL code
Executor->>VM: renderChatDBStep(GENERATE_VISUALIZATION, SUCCESS)
end
end
Executor-->>Agent: ChatDBResult
Agent-->>VM: ToolResult.AgentResult
VM->>UI: update state with result
UI->>User: Display SQL, results, visualization
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
augment review |
| if (match != null && currentConnection != null) { | ||
| val sql = match.groupValues[1].trim() | ||
| try { | ||
| val result = currentConnection!!.executeQuery(sql) |
There was a problem hiding this comment.
Consider enforcing read-only execution before running LLM-generated SQL; currently any SQL inside the code fence will be executed, which risks destructive statements despite the prompt guidance. Add a validation (e.g., ensure it starts with SELECT and contains no write/DDL keywords) before calling executeQuery.
🤖 Was this useful? React with 👍 or 👎
| dataSources = state.dataSources.filter { it.id != id }, | ||
| selectedDataSourceId = if (state.selectedDataSourceId == id) null else state.selectedDataSourceId | ||
| ) | ||
| if (state.selectedDataSourceId == id) { |
There was a problem hiding this comment.
The check for state.selectedDataSourceId == id happens after you set it to null, so disconnect() won’t run when deleting the currently selected source; check before updating state or cache the previous selection to ensure the connection is closed. This avoids leaking an open DB connection (also relates to resource cleanup) (Guideline: no_memory_leaks).
🤖 Was this useful? React with 👍 or 👎
| @Composable | ||
| fun ChatDBPage( | ||
| workspace: Workspace, | ||
| llmService: KoogLLMService?, |
There was a problem hiding this comment.
llmService parameter is currently unused; the ViewModel creates its own instance instead. Consider threading the provided llmService through to avoid duplicate initialization and ensure consistent configuration.
🤖 Was this useful? React with 👍 or 👎
There was a problem hiding this comment.
Actionable comments posted: 9
🧹 Nitpick comments (10)
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt (1)
256-263: Consider extracting duplicated icon mapping logic.The same
AgentType -> Iconmapping appears in three places now (desktop tab, mobile header, mobile submenu). Consider extracting a shared helper function to reduce duplication and ensure consistency.// In AutoDevComposeIcons.kt or a shared location fun AgentType.toIcon(): ImageVector = when (this) { AgentType.REMOTE -> AutoDevComposeIcons.Cloud AgentType.CODE_REVIEW -> AutoDevComposeIcons.RateReview AgentType.KNOWLEDGE -> AutoDevComposeIcons.Article AgentType.CODING -> AutoDevComposeIcons.Code AgentType.LOCAL_CHAT -> AutoDevComposeIcons.Chat AgentType.CHAT_DB -> AutoDevComposeIcons.Database }mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt (2)
23-23: Unused import.
Platformis imported but not used in this file. Consider removing it to keep imports clean.-import cc.unitmesh.agent.Platform
151-152: Consider handling Connecting and Error states explicitly.The empty
elsebranch silently ignoresConnectionStatus.ConnectingandConnectionStatus.Errorstates. While these may be handled elsewhere, the user may benefit from visual feedback in the chat pane during these states (e.g., a "Connecting..." indicator or error message banner).mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigDialog.kt (1)
212-213: Consider providing validation feedback to users.Currently, the Save button is simply disabled when validation fails. Users may not understand why they can't save. Consider showing inline error messages or validation hints for required fields.
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourcePanel.kt (2)
231-245: Consider adding delete confirmation.The delete action executes immediately without confirmation. Users could accidentally delete data source configurations. Consider showing a confirmation dialog before deletion.
283-290: CircularProgressIndicator color may not be visible on disabled button.The indicator uses
MaterialTheme.colorScheme.onPrimary, but the button is disabled, which typically reduces the container color opacity. The indicator might be hard to see. Consider usingMaterialTheme.colorScheme.onSurfaceor the primary color instead.CircularProgressIndicator( modifier = Modifier.size(16.dp), strokeWidth = 2.dp, - color = MaterialTheme.colorScheme.onPrimary + color = MaterialTheme.colorScheme.primary )mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/model/DataSourceModels.kt (2)
16-23: Silent fallback to MYSQL may cause confusion.
fromStringsilently returnsMYSQLwhen no match is found. This could mask data corruption or configuration errors. Consider throwing an exception or returning null to make failures explicit.companion object { - fun fromString(value: String): DatabaseDialect { - return entries.find { + fun fromString(value: String): DatabaseDialect? { + return entries.find { it.name.equals(value, ignoreCase = true) || it.displayName.equals(value, ignoreCase = true) - } ?: MYSQL + } } }Alternatively, if a default is preferred, add logging or documentation:
fun fromString(value: String): DatabaseDialect { return entries.find { ... } ?: MYSQL.also { /* log warning about unknown dialect */ } }
30-35: Default port doesn't match dialect default.The default
port = 3306is hardcoded, but this doesn't match all dialects (e.g., PostgreSQL uses 5432). Whiledialect.defaultPortexists, the class default could mislead. This is minor since the dialog updates the port when dialect changes.mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt (2)
64-66: Use structured logging instead of println.
printlnis not suitable for production logging. Consider using a proper logging framework that supports log levels and structured output.} catch (e: Exception) { - println("[ChatDB] Failed to initialize LLM service: ${e.message}") + // TODO: Use proper logging framework + // logger.error("[ChatDB] Failed to initialize LLM service", e) }
198-199: Pass system prompt as a separate message instead of concatenating with user input.The
streamPromptmethod acceptshistoryMessages: List<Message>which supports proper message roles viaMessageRole.SYSTEM. Instead of concatenating the system prompt with the user text (userPrompt = "$systemPrompt\n\nUser: $text"), pass it as a separate message:service.streamPrompt( userPrompt = text, historyMessages = listOf(Message(role = MessageRole.SYSTEM, content = systemPrompt)), compileDevIns = false ).collect { chunk -> // ... }This allows the LLM to properly distinguish system instructions from user queries, following the standard message role pattern already implemented in
KoogLLMService.buildPrompt.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.kt(4 hunks)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentChatInterface.kt(1 hunks)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentInterfaceRouter.kt(2 hunks)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBPage.kt(1 hunks)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt(1 hunks)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt(1 hunks)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigDialog.kt(1 hunks)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourcePanel.kt(1 hunks)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/model/DataSourceModels.kt(1 hunks)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt(1 hunks)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt(2 hunks)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/icons/AutoDevComposeIcons.kt(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.kt
📄 CodeRabbit inference engine (AGENTS.md)
**/*.kt: Useexpect/actualpattern for platform-specific code (for example:Platformimplementations)
Use concrete classes (not interfaces) andPromise(notFlow) for @JsExport annotations
Avoid emoji and UTF-8 characters in WASM code
When modifyingCodingAgentRenderer, update ALL implementations:DefaultCodingAgentRenderer,ComposeRenderer,JewelRenderer,ServerSideRenderer, andJsRendererAdapterin Kotlin
When modifyingCodingAgentRenderer, update JVM CLI implementations:CodingCliRendererandConsoleRenderer
UseAutoDevColorsorMaterialTheme.colorSchemefor Compose styling
Files:
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigDialog.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourcePanel.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBPage.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/model/DataSourceModels.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentInterfaceRouter.ktmpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentChatInterface.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/icons/AutoDevComposeIcons.kt
**/*.{kt,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never use hardcoded colors - always use design tokens from the design system
Files:
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigDialog.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourcePanel.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBPage.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/model/DataSourceModels.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentInterfaceRouter.ktmpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentChatInterface.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/icons/AutoDevComposeIcons.kt
🧠 Learnings (3)
📚 Learning: 2025-12-07T08:40:10.850Z
Learnt from: CR
Repo: phodal/auto-dev PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-07T08:40:10.850Z
Learning: Applies to mpp-vscode/src/**/*.ts : When modifying `CodingAgentRenderer`, update VSCode implementations: `mpp-vscode/src/bridge/mpp-core.ts` and `mpp-vscode/src/providers/chat-view.ts`
Applied to files:
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentInterfaceRouter.ktmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentChatInterface.kt
📚 Learning: 2025-12-07T08:40:10.850Z
Learnt from: CR
Repo: phodal/auto-dev PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-07T08:40:10.850Z
Learning: Applies to **/*.kt : When modifying `CodingAgentRenderer`, update ALL implementations: `DefaultCodingAgentRenderer`, `ComposeRenderer`, `JewelRenderer`, `ServerSideRenderer`, and `JsRendererAdapter` in Kotlin
Applied to files:
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentChatInterface.kt
📚 Learning: 2025-12-07T08:40:10.850Z
Learnt from: CR
Repo: phodal/auto-dev PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-07T08:40:10.850Z
Learning: Applies to **/*.kt : When modifying `CodingAgentRenderer`, update JVM CLI implementations: `CodingCliRenderer` and `ConsoleRenderer`
Applied to files:
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentChatInterface.kt
🧬 Code graph analysis (3)
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt (2)
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt (1)
AgentMessageList(31-158)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt (1)
sendMessage(177-221)
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBPage.kt (3)
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourcePanel.kt (1)
DataSourcePanel(23-82)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt (1)
ChatDBChatPane(33-78)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigDialog.kt (1)
DataSourceConfigDialog(23-221)
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentInterfaceRouter.kt (1)
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBPage.kt (1)
ChatDBPage(22-126)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Agent
- GitHub Check: Test mpp-core (KMP)
- GitHub Check: Build
🔇 Additional comments (19)
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/icons/AutoDevComposeIcons.kt (1)
116-118: LGTM!The new
DatabaseandSchemaicon aliases are well-placed under a clear category comment and follow the established pattern of mapping to Material icons. UsingStoragefor database andTableChartfor schema are semantically appropriate choices.mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt (1)
283-290: LGTM!The
CHAT_DBicon mapping is consistent with other agent type mappings in thewhenexpression. Uses the design tokenAutoDevComposeIcons.Databaseas per coding guidelines.mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt (1)
221-228: LGTM!The
CHAT_DBicon mapping is correctly added for the Agent Type header display, consistent with the desktop implementation.mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentInterfaceRouter.kt (1)
6-9: LGTM on new imports.The imports for
ChatDBPageandWorkspaceare necessary for the new routing logic.mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.kt (3)
35-38: LGTM!The
CHAT_DBenum constant is well-documented and follows the established pattern. The KDoc clearly describes its purpose for text-to-SQL interactions.
45-52: LGTM on display name mapping.The
getDisplayName()extension correctly returns "ChatDB" for the new agent type, maintaining consistency with the feature naming throughout the PR.
54-65: LGTM on string parsing.The
fromString()method handles both "chatdb" and "database" as valid inputs forCHAT_DB, providing flexibility for different input sources.mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt (2)
264-271: Keyboard handling looks correct.Enter sends the message, Shift+Enter allows newlines. The implementation correctly prevents send when shift is pressed.
33-78: Well-structured composable layout.The ChatDBChatPane follows good Compose patterns with clear separation of concerns: status banner, message area with welcome overlay, and input area. The use of
MaterialTheme.colorSchemethroughout adheres to the design system guidelines.mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigDialog.kt (2)
155-170: Password field implementation looks good.The password field correctly uses
PasswordVisualTransformationwith a visibility toggle. Not trimming the password value (line 207) is the correct behavior.
199-210: The empty ID is properly handled by the viewModel layer. WhenDataSourceConfigDialogpassesid = ""toonSave, it callsviewModel.addDataSource(), which generates a unique UUID before storing:id = if (config.id.isBlank()) Uuid.random().toString() else config.id. This ensures no empty IDs reach the LazyColumn, which useskey = { it.id }for recomposition. The design correctly separates concerns: UI layer doesn't generate IDs; viewModel ensures uniqueness before state updates.mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBPage.kt (2)
128-168: SchemaInfoDialog implementation is clean and functional.The dialog properly handles null schema, limits display to 10 tables with an overflow indicator, and uses Material theme styling correctly. Good implementation.
31-31: No issue:llmServiceis not a constructor parameter.The
ChatDBViewModelconstructor intentionally takes only theworkspaceparameter. ThellmServiceis initialized internally via theinitializeLLMService()method in theinitblock, which loads configuration fromConfigManagerand creates the service asynchronously. ThesendMessage()function properly handles the case where the service is null and displays a user-friendly error message (lines 185-190).Likely an incorrect or invalid review comment.
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourcePanel.kt (1)
23-82: Well-structured panel component.The DataSourcePanel follows good practices with clear separation into private composables (DataSourceHeader, SearchField, DataSourceItem, ConnectionControls). Using
key = { it.id }in LazyColumn ensures efficient recomposition. The component correctly usesMaterialTheme.colorSchemefor all colors per the coding guidelines.mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/model/DataSourceModels.kt (2)
92-105: Good use of sealed classes for type-safe state modeling.
ValidationResultandConnectionStatusare well-designed sealed classes that provide exhaustive pattern matching and clear state representation. This is idiomatic Kotlin.
144-167: ChatDBState is well-structured.The state class correctly uses derived properties for
selectedDataSourceandfilteredDataSources. For small to moderate data source lists, the on-access computation is acceptable. If performance becomes an issue with large lists, these could be cached.mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt (3)
118-139: L
Summary
This PR adds a new ChatDB agent type for text-to-SQL interactions, allowing users to connect to databases and use natural language to query them.
Changes
New Files
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBPage.kt- Main page with split layoutmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt- ViewModel for managing data sources and chatmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourcePanel.kt- Left panel for data source managementmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigDialog.kt- Dialog for adding/editing data sourcesmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt- Right panel for chat interactionsmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/model/DataSourceModels.kt- Data models for data sourcesModified Files
mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.kt- Added CHAT_DB agent typempp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentInterfaceRouter.kt- Added routing for ChatDBmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentChatInterface.kt- Added CHAT_DB to when expressionmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt- Added CHAT_DB iconmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt- Added CHAT_DB iconmpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/icons/AutoDevComposeIcons.kt- Added Database and Schema iconsFeatures
Screenshots
(UI implementation - screenshots can be added after testing)
Closes #508
Summary by CodeRabbit
Release Notes
New Features
Enhancements
Style
✏️ Tip: You can customize this high-level summary in your review settings.