CI / verify (push) Successful in 1m2s
修复: - main.ts 退出释放模型显存改用 getSetting(serverUrl),不再硬编码 127.0.0.1:11434(避免非默认地址时释放请求打到错误端口) - 备份导出/导入并入 localStorage 持久化状态(会话摘要、度量历史、轨迹降级缓存、主题),版本升级到 v2,实现完整备份 - 工具数量改为 getEnabledToolDefinitions().length 动态计算,删除写死"32 个"的硬编码 - 记忆日志区分操作来源:memory:write 透传 reason,标注"新增记忆/替换/删除/清空/TTL 衰减清理/访问统计写回(无新条目)",避免"写了但看不到新记忆"的困惑 可维护性: - 上下文压力逻辑收敛到统一 calculateContextStats,删除 getContextPressureLevel / getTrendAwareCompressThreshold 的重复实现 - 消除 validateToolArgs 同名碰撞(agent-engine 本地版改名 validateToolArgsQuick) - 子代理工具集改用 getEnabledToolDefinitions() 基线,跟随全局启用开关与 Plan 模式 - 抽取 html-utils.ts 纯函数模块(实体解码/HTML→文本/HTML→Markdown/拦截页检测/相关性评分),tool-handlers-system 净减约 190 行重复代码 - 统一静态导入(savePlanTracker/setPlanModeActive/collectDiagnostics/addWrittenFile) - console.* 使用处补充豁免说明(启动/退出/刷盘阶段无渲染进程可推送日志) - run_command 工具描述改为反映可配置执行模式 测试: - 新增 7 个测试文件 + 扩展 2 个,共 273 个测试(原 34 → 273) - 覆盖 agent-engine / agent-safety / context-manager / tool-registry / result-formatter / tool-parsing / memory-service / crypto / build-context / html-utils / utils / tool-handlers-fs - 全部通过 npm run typecheck && npm test && npm run build
86 lines
2.3 KiB
JSON
86 lines
2.3 KiB
JSON
{
|
|
"name": "metona-ollama-desktop",
|
|
"version": "0.17.1",
|
|
"description": "Metona Ollama - TypeScript + Electron 桌面 AI 聊天客户端",
|
|
"main": "dist/main/main.js",
|
|
"author": "thzxx",
|
|
"license": "MIT",
|
|
"scripts": {
|
|
"dev:renderer": "vite build --watch",
|
|
"dev:main": "tsc -p tsconfig.main.json --watch",
|
|
"build:renderer": "vite build",
|
|
"build:main": "tsc -p tsconfig.main.json",
|
|
"build": "npm run build:renderer && npm run build:main",
|
|
"start": "npm run build && electron . --no-sandbox",
|
|
"pack": "npm run build && electron-builder --dir",
|
|
"dist": "npm run build && electron-builder --win",
|
|
"dist:nsis": "npm run build && electron-builder --win nsis",
|
|
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.main.json",
|
|
"test": "vitest run"
|
|
},
|
|
"build": {
|
|
"appId": "com.metona.ollama-desktop",
|
|
"productName": "Metona Ollama",
|
|
"directories": {
|
|
"output": "release"
|
|
},
|
|
"npmRebuild": false,
|
|
"files": [
|
|
"dist/**/*",
|
|
"assets/**/*",
|
|
"!node_modules/**/*",
|
|
"node_modules/sql.js/**/*",
|
|
"node_modules/ffmpeg-static/**/*"
|
|
],
|
|
"asarUnpack": [
|
|
"node_modules/ffmpeg-static/**"
|
|
],
|
|
"extraResources": [
|
|
{
|
|
"from": "node_modules/sql.js/dist/sql-wasm.wasm",
|
|
"to": "sql-wasm.wasm"
|
|
}
|
|
],
|
|
"win": {
|
|
"target": [
|
|
{
|
|
"target": "nsis",
|
|
"arch": [
|
|
"x64"
|
|
]
|
|
}
|
|
],
|
|
"icon": "assets/icons/llama.ico",
|
|
"requestedExecutionLevel": "asInvoker"
|
|
},
|
|
"nsis": {
|
|
"artifactName": "Metona Ollama Setup v${version}.${ext}",
|
|
"oneClick": false,
|
|
"allowToChangeInstallationDirectory": true,
|
|
"createDesktopShortcut": true,
|
|
"createStartMenuShortcut": true,
|
|
"shortcutName": "Metona Ollama",
|
|
"installerIcon": "assets/icons/llama.ico",
|
|
"uninstallerIcon": "assets/icons/llama.ico",
|
|
"installerHeaderIcon": "assets/icons/llama.ico"
|
|
}
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^20.17.0",
|
|
"electron": "^33.4.11",
|
|
"electron-builder": "^25.1.8",
|
|
"typescript": "^5.7.0",
|
|
"vite": "^5.4.0",
|
|
"vitest": "^2.1.9"
|
|
},
|
|
"dependencies": {
|
|
"ffmpeg-static": "^5.2.0",
|
|
"sql.js": "^1.11.0"
|
|
},
|
|
"allowScripts": {
|
|
"electron@33.4.11": true,
|
|
"esbuild@0.21.5": true,
|
|
"ffmpeg-static@5.3.0": true
|
|
}
|
|
}
|