背景:v0.5.4 多模态增强(多轮图片记忆 + 总开关 + DeepSeek vision)发布后的 全量全方位复检,重点核查新增功能的跨模块边界。 复检通过项(无回归确认): - 多轮图片记忆 × 五家 adapter:Anthropic(base64 块)/ OpenAI(image_url parts)/ Ollama(纯 base64 数组)/ Agnes / MiMo 均正确处理恢复的历史 images - 多轮图片记忆 × 引擎运行时压缩:摘要请求仅含文本(图片不进摘要调用); toKeep 消息的 images 原样保留;孤立 tool 消息配对逻辑不受影响 - 多轮图片记忆 × 摘要服务:maybeSummarize 用截断文本 transcript,无图片干扰 - history 组装 slice(0,-1) × 图片恢复无冲突(当前消息 images 走独立通道) - 编辑重发/重新生成路径与图片恢复同源(attachments.preview),行为一致 修复项: - P1 token 估算器完全忽略 images(estimateMessagesTokens): 带 10 张图的消息被按纯文本估算。影响:压缩 keepBudget 严重低估 → 压缩后实际 token 仍超 80% 阈值 → 反复触发压缩循环(每轮多一次 LLM 摘要调用);上下文占用显示严重失真。修复:每张图按 1000 tokens 计入 (1024px 压缩图在主流 Provider 约 700~1500 视觉 token,取保守上界) - 文案清理:ChatInput 附件按钮 Tooltip 硬编码"DeepSeek 不支持图片"改为 按拒绝原因区分(开关未开启 vs 当前模型不支持);openai-format.ts 共享层 注释更新(DeepSeek vision 已支持,非 vision 模型才丢弃) 测试(243 → 245 用例): - 新增 token 估算图片用例 ×2:带 images 消息按每张 1000 tokens 计入 / 无 images 字段消息行为不变(向后兼容) 验证: lint 0 / typecheck 双工程 0 / test:electron 245 全过 / build 成功
102 lines
3.1 KiB
JSON
102 lines
3.1 KiB
JSON
{
|
|
"name": "metona-ai-desktop",
|
|
"version": "0.5.5",
|
|
"description": "MetonaAI Desktop — 生产级通用 AI Agent 智能体桌面应用",
|
|
"main": "dist-electron/main/main.js",
|
|
"author": "Metona Team",
|
|
"license": "MIT",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "electron-vite dev",
|
|
"build": "npm run prebuild && electron-vite build && electron-builder",
|
|
"prebuild": "npm dedupe && node -e \"require('fs').rmSync('release',{recursive:true,force:true})\"",
|
|
"build:renderer": "electron-vite build --rendererOnly",
|
|
"build:electron": "tsc -p tsconfig.node.json",
|
|
"preview": "vite preview",
|
|
"lint": "eslint .",
|
|
"lint:fix": "eslint . --fix",
|
|
"format": "prettier --write \"src/**/*.{ts,tsx,css}\" \"electron/**/*.ts\"",
|
|
"typecheck": "tsc --noEmit -p tsconfig.node.json && tsc --noEmit -p tsconfig.web.json",
|
|
"typecheck:node": "tsc -p tsconfig.node.json --noEmit",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"test:electron": "cross-env ELECTRON_RUN_AS_NODE=1 electron node_modules/vitest/vitest.mjs run",
|
|
"prepare": "husky"
|
|
},
|
|
"lint-staged": {
|
|
"electron/**/*.{ts,tsx}": [
|
|
"eslint --fix",
|
|
"prettier --write"
|
|
],
|
|
"src/**/*.{ts,tsx}": [
|
|
"eslint --fix",
|
|
"prettier --write"
|
|
],
|
|
"src/**/*.css": [
|
|
"prettier --write"
|
|
]
|
|
},
|
|
"dependencies": {
|
|
"@emotion/react": "^11.14.0",
|
|
"@emotion/styled": "^11.14.1",
|
|
"@metona-team/metona-toast": "^0.2.1",
|
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
"@mui/icons-material": "^9.1.1",
|
|
"@mui/material": "^9.1.2",
|
|
"better-sqlite3": "^11.9.1",
|
|
"date-fns": "^4.1.0",
|
|
"dotenv": "^17.4.2",
|
|
"electron-log": "^5.3.3",
|
|
"electron-store": "^10.0.1",
|
|
"fuse.js": "^7.1.0",
|
|
"lru-cache": "^11.1.0",
|
|
"nanoid": "^5.1.5",
|
|
"node-html-parser": "^6.1.13",
|
|
"react": "^19.1.0",
|
|
"react-dom": "^19.1.0",
|
|
"react-markdown": "^10.1.0",
|
|
"react-virtuoso": "^4.18.12",
|
|
"rehype-highlight": "^7.0.2",
|
|
"rehype-raw": "^7.0.0",
|
|
"remark-gfm": "^4.0.1",
|
|
"shell-quote": "^1.10.0",
|
|
"zod": "^3.25.67",
|
|
"zustand": "^5.0.5"
|
|
},
|
|
"devDependencies": {
|
|
"@electron-toolkit/preload": "^3.0.1",
|
|
"@electron-toolkit/utils": "^4.0.0",
|
|
"@eslint/js": "^9.39.5",
|
|
"@tailwindcss/typography": "^0.5.16",
|
|
"@tailwindcss/vite": "^4.1.7",
|
|
"@types/better-sqlite3": "^7.6.13",
|
|
"@types/node": "^22.15.29",
|
|
"@types/react": "^19.1.6",
|
|
"@types/react-dom": "^19.1.6",
|
|
"@types/shell-quote": "^1.7.5",
|
|
"@vitejs/plugin-react": "^4.5.2",
|
|
"autoprefixer": "^10.4.21",
|
|
"cross-env": "^10.1.0",
|
|
"electron": "^35.5.1",
|
|
"electron-builder": "^26.0.12",
|
|
"electron-vite": "^3.1.0",
|
|
"eslint": "^9.28.0",
|
|
"husky": "^9.1.7",
|
|
"lint-staged": "^17.3.0",
|
|
"lucide-react": "^0.511.0",
|
|
"postcss": "^8.5.4",
|
|
"prettier": "^3.5.3",
|
|
"tailwindcss": "^4.1.7",
|
|
"typescript": "^5.8.3",
|
|
"typescript-eslint": "^8.67.0",
|
|
"vite": "^6.3.5",
|
|
"vitest": "^3.2.1"
|
|
},
|
|
"allowScripts": {
|
|
"electron@35.7.5": true,
|
|
"better-sqlite3@11.10.0": true,
|
|
"esbuild@0.25.12": true,
|
|
"electron-winstaller@5.4.0": true
|
|
}
|
|
}
|