Files
agent/app
kicer 3806071698 公网临时链接图片改 inline 返回:点开直接看图,不再一律下载
/p/<id> 原先不分类型一律 attachment(为安卓封装壳的 DownloadManager 兜底),图片外链点开只会进下载器;read_file 读图也走这个端点,用户点开来只能下载、看不到图。

- download-send.js 抽出 contentDisposition(type),新增 inlineImageType / sendInlineImage
- 图片显式给 image/* + X-Content-Type-Options: nosniff + inline;缓存仍 no-store(/p/ 是短命 bearer 链)
- 按扩展名判定:png/jpg/jpeg/webp/gif/bmp/tif/tiff/avif/ico/svg,不读文件头做嗅探
- SVG 额外加 CSP: sandbox(匿名同源端点,直接打开不能执行内嵌脚本;img 引用不受影响)
- inline 走 dotfiles:allow,保证 read_file 的 .imgcache/ 压缩产物能取到
- 其余类型(PDF/Office/zip/HTML 等)保持 attachment,下载语义与安卓兜底不变
- README「公网临时链接」补响应头说明
2026-11-11 07:31:02 +08:00
..
2026-09-20 19:24:50 +08:00
2026-10-20 14:57:12 +08:00

agent-core

agent 仓库的 core 服务:Express + SQLite + 静态 H5 前端。

对外能力、部署与配置见仓库根 ../README.md。

本地运行

cd app
npm install
cp config.example.yml config.yml
# 本地调试时把 workspace_root / data_root 改到仓库内可写目录
AGENT_CONFIG=./config.yml node server/server.js

默认监听 8090。platforms 可以留空,启动后到设置页添加模型并重启。

关键文件

文件 职责
server/server.js 装配配置、DB、SSE、路由与启动顺序
server/engine.js 会话、模型池、Agent 主循环、压缩、标题、日记收口
server/llm.js 消息组装与上游流式调用
server/tools/executor.js 内置工具与路径沙箱
server/tools/definitions.json 内置工具 schema
server/routes/ HTTP API
server/public/ 前端(无构建,按序加载脚本)