MDeX-2.0.0
v2.0.0
首个 AI 辅助大版本:采用「编辑区」与「对话区」双栏浮层,支持多轮对话。改写类指令实时流至编辑区(带 diff 高亮),问答类内容进对话区;支持应用到选区或在光标处插入。AI 为可选功能,应用默认保持离线。
First AI-assisted release: Introduces a two-pane overlay (Edit zone + Chat zone) with multi-turn conversation. Rewrite instructions stream into the Edit zone (with diff highlighting), while Q&A goes to the Chat zone; apply to selections or insert at the cursor. AI is strictly opt-in; the app remains offline by default.
新增 / Features
- 统一多轮 AI 对话(编辑区 + 对话区):选中文本或定位光标后,可通过
⌘/Ctrl+J、工具栏 ✨ 图标或右键菜单唤出 AI 浮层。浮层分为双栏:编辑区用于展示改写版本(与原文 diff 对比高亮,支持「应用到文档」「在光标处插入」及 ↶↷ 撤销/重做);对话区用于展示多轮对话流。改写类指令实时流至编辑区,问答类指令进入对话区——AI 会通过EDIT:前缀自动判断并进行路由。
Unified multi-turn AI dialog (Edit + Chat panes): Select text or place the cursor, then open via⌘/Ctrl+J, the ✨ toolbar icon, or right-click. The overlay is split into an Edit zone (showing the current rewrite with diff highlighting; includes Apply to document, Insert at cursor, and undo/redo) and a Chat zone (for multi-turn threads). Rewrite instructions stream into the Edit zone, while Q&A goes to the Chat zone — the AI self-routes via anEDIT:prefix. - 无选区模式与路由兜底:未选中文本直接唤出时,默认为「在光标处生成并插入」,并以蓝色光标竖条标示插入位置。若 AI 路由误判,可一键点击「→用作编辑区内容」,将对话区的任意回复快速转移至编辑区。
No-selection mode & routing fallback: Opening without a selection defaults to "generate and insert at cursor," marked by a blue caret bar. If the AI misroutes, any chat reply can be moved into the Edit zone with a single click as a fallback. - 兼容 OpenAI 与 Anthropic 双协议:端点、模型、温度及 API Key 均保存在本地(
localStorage,不纳入会话备份)。网络请求仅通过 Rust 的reqwest库进行,前端 CSP 维持禁网状态。支持流式 SSE 响应、Esc 键随时取消以及清晰易读的错误提示。
OpenAI-compatible + Anthropic dual protocols: Endpoint, model, temperature, and API key are stored locally (localStorage, excluded from session backups). Networking is handled exclusively via Rust'sreqwest, keeping the frontend CSP network-blocking. Supports streaming SSE, Esc to cancel, and human-readable error messages. - AI 浮层渲染增强:对话区的 AI 回复支持完整 Markdown 渲染(包含 KaTeX 公式与 Mermaid 图表)。编辑区支持「源码/渲染」视图切换及 ↶↷ 撤销/重做。当选中部分公式时,渲染时会自动补齐缺失的
$或$$(仅作用于渲染过程,不修改源文本)。
Enhanced AI pane rendering: Chat replies render full Markdown (including KaTeX math and Mermaid diagrams). The Edit zone toggles between source-diff and rendered preview with ↶/↷ undo/redo. Partial formula selections auto-balance missing$or$$during rendering only (source text remains untouched). - 文档与快捷键:帮助说明已结构化(分为「隐私与数据安全」和「AI」两部分,支持 17 种语言);
⌘/Ctrl + J快捷键已收录至帮助文档及 README 的快捷键表格中。
Docs & shortcuts: Restructured help intro (Privacy & Data Safety / AI sections, 17 languages);⌘/Ctrl + Jadded to the help and README shortcut tables.
工程性 / Engineering
- 后端重构
ai_rewrite/ai_cancel:新增history参数以支持多轮对话;采用自适应 system prompt(通过EDIT:前缀实现改写与问答的分流);流式字节缓冲按行切分,解决中文跨 TCP 分块导致的乱码问题;使用reqwest配合 rustls-tls,移除对系统 OpenSSL 的依赖。
Backendai_rewrite/ai_cancel: Now acceptshistoryfor multi-turn context; features an adaptive system prompt (EDIT:prefix routes rewrites vs. Q&A); byte-buffer line-splitting prevents CJK mojibake across TCP chunks; utilizesreqwestwith rustls-tls (no system OpenSSL dependency). - 版本号正式升至 2.0.0。
Version bumped to 2.0.0.