Commit Graph
410 Commits
Author SHA1 Message Date
t8y2 0fa9964799 fix: add installMcpServer stub to http.ts 2026-06-13 20:34:28 +08:00
Vergil Lai 799d20a2cf 添加 Manticore Search 支持 (#1145)
* 添加 Manticore Search 支持

* 更新 Manticore Search 文档
2026-06-13 20:23:36 +08:00
t8y2 6c57169162 feat(mcp): add one-click install/upgrade button 2026-06-13 20:05:46 +08:00
LC 2d98b9fdd2 feat(sqlite): add database backup action
* feat(sqlite): add database backup action

* fix(sqlite): sanitize default backup file name
2026-06-13 18:39:12 +08:00
t8y2 0b9aef1ca8 feat(settings): split driver store paths 2026-06-13 17:27:58 +08:00
t8y2 d974ad5533 feat(settings): add custom driver store path with migration 2026-06-13 16:54:04 +08:00
t8y2 d091b0db85 feat(sidebar): reveal local db file in OS file manager 2026-06-13 16:00:47 +08:00
t8y2 30afcb8e69 fix(sidebar): page large table groups 2026-06-13 13:40:36 +08:00
t8y2 2ec8ed1523 feat(sidebar): locate query table from cursor 2026-06-13 12:45:00 +08:00
二丫讲梵 6f804266fc feat(sidebar): remap connection IDs in imported sidebar layouts
Thanks @eryajf for the contribution! Close #1121
2026-06-12 22:41:42 +08:00
t8y2 0d63fcd3a3 fix(oracle): avoid rowid for view data 2026-06-12 21:02:32 +08:00
skyler abacac3c07 feat(ai): agent loop Phase 2 — SQL execution tools, risk classification, and streaming tool calls
feat(ai): agent loop Phase 2 — SQL execution tools, risk classification, and streaming tool calls
2026-06-12 19:56:36 +08:00
t8y2 484658c6b7 feat(ai): streaming probe for connection test with latency measurement 2026-06-12 19:29:55 +08:00
t8y2 fa4dbb9104 feat(completion): cache foreign key metadata 2026-06-12 19:27:16 +08:00
t8y2 60632ccfe3 feat(completion): expand sql semantic completion 2026-06-12 19:15:46 +08:00
t8y2 d0a009751a feat(completion): improve sql completion ranking 2026-06-12 18:52:34 +08:00
runstone 40f0f98540 Merge branch 'main' of https://github.com/Abeautifulsnow/dbx into feat/ai-agent-loop-phase1 2026-06-12 18:52:05 +08:00
t8y2 3e63ad1405 fix(completion): keep labels visible in popup 2026-06-12 18:39:13 +08:00
t8y2 6570e88e4a feat(completion): rank table acronym matches 2026-06-12 18:38:56 +08:00
runstone 7df7fd9235 feat(ai): add tool result collapsible UI and fix agent mode prompt
AiAssistant.vue:
- Tool call steps now support click-to-expand/collapse for SQL args
  and results (expandedSteps set); chevron rotates on open
- Remove fixed-open result display (was always visible, no toggle)
- Max result height raised to 48 (max-h-48) with scroll

ai.ts (buildModePromptLines agent branch):
- Replace vague "prioritize SQL" hint with explicit tool-use
  instruction: must call execute_query, not just emit SQL text
- List available tools (list_tables, get_columns, execute_query,
  get_sample_data) so LLM knows what it can call
- Clarify allowed statement types for execute_query
2026-06-12 18:27:28 +08:00
runstone 100124da3e feat(ai): Phase 2 SQL 风险分类 + Agent 模式工具调用结果渲染
后端:
  - 新增 sql_risk.rs:基于 sqlparser AST 的 SQL 风险分类(ReadOnly/Write/Ddl/Transaction)
  - agent_tools.rs:新增 execute_query 和 get_sample_data 工具,写操作/DDL 被风险分类阻止
  - agent_loop.rs:支持 is_agent_mode 参数,Agent 模式下暴露全部工具,Ask 模式仅暴露只读工具
  - agent_loop/web/tauri:mode 参数全链路传递(前端→HTTP→Tauri→Rust)

  前端:
  - AiAgentStepItem 接口扩展:toolName/toolArgs/toolResult/isError 字段
  - AiAssistant.vue:工具调用结果实时+最终渲染,SQL 查询结果/错误信息展示
  - ai.ts/http.ts/tauri.ts:mode 参数透传到后端
2026-06-12 17:42:23 +08:00
polempandSam ef5ed05ae7 feat(schema-diff): professional DDL diff view with deployment-aware colors and custom themes (#1112)
Co-authored-by: Sam <14344444@@qq.com>
2026-06-12 17:14:05 +08:00
t8y2 250da6e7cb fix(mysql): generate index COMMENT clause and enable index_comment capability 2026-06-12 16:56:20 +08:00
t8y2 edf9dd88e3 feat(agent): unify oracle driver 2026-06-12 16:34:42 +08:00
Abeautifulsnow 082e3bb4eb feat(ai): add agent tool calling loop 2026-06-12 13:18:36 +08:00
runstone 84a9fd6a0f Merge branch 'main' of https://github.com/Abeautifulsnow/dbx into feat/ai-agent-loop-phase1 2026-06-12 12:52:03 +08:00
t8y2 a858a6bd18 feat(mysql): edit foreign keys and triggers 2026-06-12 12:29:46 +08:00
runstone 453169ae45 Merge branch 'main' of https://github.com/Abeautifulsnow/dbx into feat/ai-agent-loop-phase1 2026-06-12 12:00:47 +08:00
runstone 2d75667b9a feat(ai): upgrade agent loop tool calling to true SSE streaming
Move tool calling from non-streaming (complete) API calls to real
streaming SSE, so text, reasoning, and tool call arguments all arrive
incrementally — users see the AI think and act in real time.

- Extract ~370 lines of non-streaming tool-call functions from
  agent_loop.rs (call_with_tools, call_openai_with_tools,
  call_claude_with_tools, call_gemini_with_tools) and replace with
  a single ai::stream_with_tools() dispatch call.

- Add streaming-with-tools infrastructure to ai.rs (~550 lines):
  - StreamToolEvent enum: Chunk, ToolCallStart, ToolCallDelta,
    ToolCallComplete — provider-agnostic, feeds into the
    StreamingToolCallAccumulator
  - stream_claude_with_tools(): parse SSE content_block_start/delta/
    stop events, incremental input_json_delta for tool arguments
  - stream_openai_with_tools(): parse SSE delta.tool_calls with
    incremental function.arguments
  - stream_gemini_with_tools(): parse SSE functionCall (Gemini
    sends complete objects, not deltas — emit as one chunk)
  - Cancellation support via tokio::select! in every streaming loop
  - Extended timeout for reasoning models (600s vs 120s)

- StreamingToolCallAccumulator: collect partial tool call fragments
  from streaming deltas, then deserialize into complete ToolCall
  objects in index order once the stream ends.
2026-06-12 11:43:09 +08:00
t8y2 a4bd62005b feat(redis): add all search mode 2026-06-12 11:32:56 +08:00
t8y2 a84ba4903e fix(chart): improve query chart axis selection 2026-06-12 10:34:37 +08:00
runstone 91f1206783 Merge branch 'main' of https://github.com/Abeautifulsnow/dbx into feat/ai-agent-loop-phase1 2026-06-12 08:48:50 +08:00
t8y2 b18f837b50 fix(editor): improve completion popup overflow 2026-06-12 01:20:11 +08:00
t8y2 4f71bcbff8 fix(connection): extend agent connect timeout 2026-06-12 01:12:06 +08:00
haipengno1 7de0de2313 实现 Redis 的查询功能 2026-06-12 00:20:17 +08:00
t8y2 3640541222 fix(ci): update nested layout and grid tests 2026-06-11 22:55:24 +08:00
t8y2 c9d655324d fix(editor): preserve IME composition in comments 2026-06-11 22:55:16 +08:00
t8y2 a017e04d4c feat(structure): auto name new indexes 2026-06-11 22:40:10 +08:00
t8y2 57d03c2f08 feat(sidebar): support nested groups 2026-06-11 22:35:00 +08:00
t8y2 c7fb855000 fix(jdbc): simplify driver selection and table edits 2026-06-11 22:13:27 +08:00
t8y2 70f7b464b7 feat(jdbc): install drivers from Maven bundles 2026-06-11 21:41:37 +08:00
t8y2 bd3585f057 fix: draw selected cell left border for first visible column in canvas mode 2026-06-11 19:35:08 +08:00
t8y2 7923f4915e fix(elasticsearch): apply document filters in browser 2026-06-11 18:56:38 +08:00
t8y2 3f25a69d23 feat(mysql): add unsigned integer types to column type options 2026-06-11 18:34:51 +08:00
runstone 9ab41795d6 @
feat(ai): add agent loop with tool calling, fix connection routing and Gemini compatibility

## 背景说明
将 dbx AI 助手从单次 SQL 文本生成器升级为具备 tool calling 的数据库 Agent。
Phase 1 实现 Agent Loop 框架 + 只读工具(list_tables、get_columns)。
参考:Pi agent-core,.trellis/tasks/06-11-feat-ai-agent-loop-tool-calling-upgrade

## 修改内容
- 新增 agent_loop.rs:Agent Loop 核心,支持 OpenAI/Claude/Gemini Provider 的 tool calling,最大 10 轮,Ollama 自动降级为 text-only
- 新增 agent_tools.rs:read_only_tools (list_tables, get_columns) 的工具定义与执行器
- 新增 agent_events.rs:AgentEvent/ToolCall/ToolResult/ToolDefinition 类型定义
- 修改 ai.rs:AiMessage 新增 tool_call_id 字段
- 修改 lib.rs:注册 agent_events、agent_loop、agent_tools 模块
- 修改 routes/ai.rs & commands/ai.rs:新增 ai_agent_stream SSE 端点
- 修改 tauri.ts & http.ts:新增 AgentEvent 类型与 aiAgentStream 函数
- 修改 api.ts:注册 aiAgentStream 转发
- 修改 ai.ts:新增 runAgentStream,AiContext 增加 connectionId 字段
- 修改 AiAssistant.vue:接入 runAgentStream,解析 AgentEvent 渲染工具调用步骤
- 修改 en.ts / zh-CN.ts:新增 agentSteps 国际化文案

## 修复的问题
- [#I01] connectionName 误传为 connectionId → add connectionId to AiContext
- [#I02] agent loop 取消操作无效 → add cancel checks before each turn
- [#C01] TODO 缺少 issue 引用 → add PRD reference to TODO
- [#C02] stream_with_tools 命名不准确 → add clarifying doc comment
- [#C03] Gemini functionResponse.name 解析错误 → fix tool_call_id format and extraction

## 测试建议
- execute_get_columns:合法表名/空表名/SQL 注入字符拒绝
- call_openai_with_tools:空 choices/空 tool_calls/非 JSON arguments
- call_gemini_with_tools:空 candidates/parts 无 functionCall
- runAgentStream:有效 connectionId 正常调用
@
2026-06-11 18:27:24 +08:00
t8y2 26d714909e feat(elasticsearch): model indices as first-class nodes 2026-06-11 12:52:47 +08:00
t8y2 521a3021c4 fix(clickhouse): load table index metadata 2026-06-11 12:23:28 +08:00
t8y2 6f15fa303c feat: support empty redis key separator for flat key display 2026-06-11 11:28:43 +08:00
SuLea-IT 89aa315a2d Merge pull request #1037
Thanks!
2026-06-11 11:12:05 +08:00
t8y2 2b7264a531 feat: data grid search also matches column names 2026-06-11 11:08:51 +08:00