Skip to content

armgit / dbx

Public Imported from GitHub
0

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。

feat(agent): safety check display

Abeautifulsnowec28005f20e6
diff --git a/apps/desktop/src/components/editor/AiAssistant.vue b/apps/desktop/src/components/editor/AiAssistant.vue
index 79dce39c03..69ef3110b3 100644
--- a/apps/desktop/src/components/editor/AiAssistant.vue
+++ b/apps/desktop/src/components/editor/AiAssistant.vue
@@ -346,10 +346,14 @@ function agentEventToStep(event: AgentEvent, index: number): AiAgentStepItem | u
if (event.type !== "tool_call_start" && event.type !== "tool_call_end") return undefined;
+ const isExecuteQuery = event.tool_name === "execute_query";
+ const labelKey = event.type === "tool_call_start" ? "ai.agentSteps.callingTool" : isExecuteQuery ? (event.is_error ? "ai.agentSteps.executeBlocked" : "ai.agentSteps.executeSafe") : event.is_error ? "ai.agentSteps.toolError" : "ai.agentSteps.toolDone";
+ const tone = (event.type === "tool_call_start" ? "active" : event.is_error ? "danger" : "success") as AiAgentStepTone;
+
return {
key: `${event.tool_call_id || ""}-${event.type}`,
- labelKey: event.type === "tool_call_start" ? "ai.agentSteps.callingTool" : event.is_error ? "ai.agentSteps.toolError" : "ai.agentSteps.toolDone",
- tone: (event.type === "tool_call_start" ? "active" : event.is_error ? "danger" : "success") as AiAgentStepTone,
+ labelKey,
+ tone,
titleKey: undefined,
titleParams: { tool: event.tool_name || "" },
toolName: event.tool_name,
diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.ts
index de2a1f6435..e9a2a56402 100644
--- a/apps/desktop/src/i18n/locales/en.ts
+++ b/apps/desktop/src/i18n/locales/en.ts
@@ -986,6 +986,8 @@
callingTool: "Calling tool...",
toolDone: "Tool completed",
toolError: "Tool error",
+ executeSafe: "Safety check passed · Executed",
+ executeBlocked: "Blocked by safety check",
contextCompacted: "Context compressed",
},
agentStepTitles: {
diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.ts
index 8d8049deb1..856d376c7f 100644
--- a/apps/desktop/src/i18n/locales/it.ts
+++ b/apps/desktop/src/i18n/locales/it.ts
@@ -933,6 +933,8 @@
callingTool: "Chiamata strumento...",
toolDone: "Strumento completato",
toolError: "Errore strumento",
+ executeSafe: "Controllo di sicurezza superato · Eseguito",
+ executeBlocked: "Bloccato dal controllo di sicurezza",
contextCompacted: "Contesto compresso",
},
agentStepTitles: {
diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.ts
index 836372a03e..f87ff0c53c 100644
--- a/apps/desktop/src/i18n/locales/ja.ts
+++ b/apps/desktop/src/i18n/locales/ja.ts
@@ -983,6 +983,8 @@ export default {
callingTool: "ツールを呼び出し中...",
toolDone: "ツール完了",
toolError: "ツールエラー",
+ executeSafe: "安全チェック通過 · 実行済み",
+ executeBlocked: "安全チェックによりブロック",
contextCompacted: "コンテキストを圧縮しました",
},
agentStepTitles: {
diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.ts
index d30cbe2f6a..02222be97a 100644
--- a/apps/desktop/src/i18n/locales/pt-BR.ts
+++ b/apps/desktop/src/i18n/locales/pt-BR.ts
@@ -933,6 +933,8 @@
callingTool: "Chamando ferramenta...",
toolDone: "Ferramenta concluída",
toolError: "Erro da ferramenta",
+ executeSafe: "Verificação de segurança aprovada · Executado",
+ executeBlocked: "Bloqueado pela verificação de segurança",
contextCompacted: "Contexto compactado",
},
agentStepTitles: {
diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.ts
index e1e99f5147..a33bc00e19 100644
--- a/apps/desktop/src/i18n/locales/zh-CN.ts
+++ b/apps/desktop/src/i18n/locales/zh-CN.ts
@@ -985,6 +985,8 @@
callingTool: "正在调用工具...",
toolDone: "工具调用完成",
toolError: "工具调用出错",
+ executeSafe: "安全检查通过 · 已执行",
+ executeBlocked: "安全检查拦截",
contextCompacted: "上下文已压缩",
},
agentStepTitles: {
diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.ts
index d2f322be67..123fab08f6 100644
--- a/apps/desktop/src/i18n/locales/zh-TW.ts
+++ b/apps/desktop/src/i18n/locales/zh-TW.ts
@@ -912,6 +912,8 @@
callingTool: "正在調用工具...",
toolDone: "工具調用完成",
toolError: "工具調用出錯",
+ executeSafe: "安全檢查通過 · 已執行",
+ executeBlocked: "安全檢查攔截",
contextCompacted: "上下文已壓縮",
},
agentStepTitles: {