25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
refactor(ai): remove action type selector, let AI auto-detect intent
t8y2626c9c6049ae
diff --git a/src/components/editor/AiAssistant.vue b/src/components/editor/AiAssistant.vueindex ead7571b03..737cd13219 100644--- a/src/components/editor/AiAssistant.vue+++ b/src/components/editor/AiAssistant.vue@@ -16,7 +16,7 @@ import {import { Label } from "@/components/ui/label";import { ScrollArea } from "@/components/ui/scroll-area";import { useSettingsStore, type AiProvider } from "@/stores/settingsStore";-import { buildAiContext, extractSql, runAiAction, type AiAction } from "@/lib/ai";+import { buildAiContext, extractSql, runAiAction } from "@/lib/ai";import type { AiMessage } from "@/lib/tauri";import type { ConnectionConfig, QueryTab } from "@/types/database";@@ -26,7 +26,6 @@ const settings = useSettingsStore();interface ChatMessage {role: "user" | "assistant";content: string;- action?: AiAction;}const props = defineProps<{@@ -39,7 +38,6 @@ const emit = defineEmits<{close: [];}>();-const action = ref<AiAction>("generate");const prompt = ref("");const messages = ref<ChatMessage[]>([]);const isGenerating = ref(false);@@ -57,15 +55,6 @@ const providerDefaults: Record<AiProvider, { endpoint: string; model: string }>custom: { endpoint: "", model: "" },};-const actionLabels: Record<AiAction, string> = {- generate: "ai.actions.generate",- explain: "ai.actions.explain",- optimize: "ai.actions.optimize",- fix: "ai.actions.fix",- convert: "ai.actions.convert",- sampleData: "ai.actions.sampleData",-};-function openSettings() {tempProvider.value = settings.aiConfig.provider;tempApiKey.value = settings.aiConfig.apiKey;@@ -107,7 +96,7 @@ async function send() {return;}- messages.value.push({ role: "user", content: text, action: action.value });+ messages.value.push({ role: "user", content: text });prompt.value = "";scrollToBottom();@@ -120,7 +109,7 @@ async function send() {}));const result = await runAiAction({config: settings.aiConfig,- action: action.value,+ action: "generate",instruction: text,context,}, history);@@ -215,20 +204,10 @@ function formatMessageContent(text: string): string {<div class="border-t p-2"><div class="flex items-center gap-1.5">- <Select :model-value="action" @update:model-value="(v: any) => action = v">- <SelectTrigger class="h-7 w-24 text-[10px] shrink-0">- <SelectValue />- </SelectTrigger>- <SelectContent>- <SelectItem v-for="(label, key) in actionLabels" :key="key" :value="key">- {{ t(label) }}- </SelectItem>- </SelectContent>- </Select><Inputv-model="prompt"class="h-7 flex-1 text-xs"- :placeholder="t(`ai.placeholders.${action}`)"+ :placeholder="t('ai.placeholder')":disabled="isGenerating"@keydown.enter="send"/>