Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
d2e5c0f
new: 修改返回和侧栏折叠
LYOfficial Nov 26, 2025
2bec180
fix:边栏展开图标bug
LYOfficial Nov 26, 2025
2cadc79
update web
LYOfficial Nov 29, 2025
5a09d56
update: 移除无用代码
LYOfficial Nov 30, 2025
76642ea
update: 更新硅基流动
LYOfficial Nov 30, 2025
1c0f8d9
update: 支持更多models
LYOfficial Nov 30, 2025
4426852
update: 新增清除所有缓存功能
LYOfficial Nov 30, 2025
f04bd17
fix: 移除无关代码
LYOfficial Nov 30, 2025
3dc5ca2
update to v1.3.0
LYOfficial Dec 1, 2025
2a98a4e
fix workflows
LYOfficial Dec 1, 2025
2d602cb
fix linux and windows workflow
LYOfficial Dec 1, 2025
3cd5c42
Update release.yml
LYOfficial Dec 1, 2025
7b68a78
Update LICENSE
LYOfficial Dec 1, 2025
3398824
update web
LYOfficial Dec 1, 2025
1a83ba0
Update README.md
LYOfficial Dec 1, 2025
cceac83
update: 移除滚动条,优化模型设置
LYOfficial Dec 1, 2025
debec89
update: 自定义窗口顶栏
LYOfficial Dec 2, 2025
2253f13
fix: 修复首页和工具页的组件位置错乱
LYOfficial Dec 2, 2025
cd0373d
fix: 修复了夜间模式仍有浅色的问题
LYOfficial Dec 2, 2025
87b90a3
update to v1.3.1
LYOfficial Dec 2, 2025
f312baf
update: 独立“分析结果”页面
LYOfficial Dec 2, 2025
56cd5b0
update: 重置设置页
LYOfficial Dec 2, 2025
016a9c5
update: 优化模型设置页面,优化路径选择
LYOfficial Dec 2, 2025
bb7c71b
update: 新增免费模型
LYOfficial Dec 3, 2025
38e1ecc
fix: 修复测试链接问题
LYOfficial Dec 3, 2025
e5fa378
update: 优化Thingking模型显示
LYOfficial Dec 3, 2025
0cf8d30
update to v1.3.2
LYOfficial Dec 3, 2025
e620cbd
fix: 免费模型测试链接
LYOfficial Dec 3, 2025
ba651af
Update Cargo.lock
LYOfficial Dec 3, 2025
d952cb2
Update README.md
LYOfficial Dec 3, 2025
c97bb92
Update README.md
LYOfficial Dec 3, 2025
427ff24
Update lib.rs
LYOfficial Dec 3, 2025
227a5de
update: add English README
LYOfficial Dec 3, 2025
c787460
fix: 解决免费模型无法使用问题
LYOfficial Dec 3, 2025
ff1245c
update: 支持星河大模型,新增可用模型彩色显示
LYOfficial Dec 4, 2025
f149160
update: 新增默认模型,新增免费模型标签
LYOfficial Dec 4, 2025
42176aa
fix:修复导出
LYOfficial Dec 7, 2025
56d3fda
feat: 二次审校功能
LYOfficial Dec 7, 2025
d16f0aa
feat: 优化新设置栏格式
LYOfficial Dec 7, 2025
1aa6ee0
fix: 修复一些长公式无法渲染的问题
LYOfficial Dec 7, 2025
7525593
feat: 更改分析导出默认文件名
LYOfficial Dec 7, 2025
9d2e491
feat: 新增自动保存
LYOfficial Dec 7, 2025
2b45414
Update README.md
LYOfficial Dec 7, 2025
f845292
Update README.md
LYOfficial Dec 7, 2025
2afb8a8
update to v1.3.3
LYOfficial Dec 7, 2025
a16e69f
update README
LYOfficial Dec 7, 2025
00e8530
Update README.md
LYOfficial Dec 9, 2025
539dba6
feat: 优化提示词
LYOfficial Jan 16, 2026
49f08d0
feat: 优化夜间模式输入框和模型选择颜色
LYOfficial Jan 16, 2026
36672b7
feat: 支持.xlsx .xls输入
LYOfficial Jan 16, 2026
f4bbdea
Add files via upload
jhl-hk Feb 9, 2026
19b366c
Add special thanks section to README
jhl-hk Feb 9, 2026
390051c
feat: i18n
jhl-hk Feb 26, 2026
050d1d9
Update CNAME
LYOfficial Apr 17, 2026
1de0ca0
Update package-lock.json
LYOfficial May 2, 2026
e3983a0
fix: 版本大调,对齐所有npm模块,解决了构建报错
LYOfficial May 2, 2026
d395d0d
feat: 采用非流请求大幅优化测试时间
LYOfficial May 3, 2026
7cbe7f5
feat: 为模型添加了logo标识
LYOfficial May 3, 2026
0723770
feat:更新全平台模型
LYOfficial May 3, 2026
473275e
feat: 添加Openrouter并本地化logo
LYOfficial May 3, 2026
ea1f731
fix:修复夜间模式亮色显示的bug
LYOfficial May 3, 2026
16db687
feat:补齐 openrouter 的 store 默认与清理映射
LYOfficial May 3, 2026
a60662a
feat: 手动更新聚合平台的模型
LYOfficial May 3, 2026
bf15201
feat:迭代更新,采用智能体工作流安排文档输出
LYOfficial May 5, 2026
f7e025a
feat: 新增知识库,采用RAG架构分析
LYOfficial May 5, 2026
01661bf
feat: 删除本地部署方案,采用api调用解析pdf
LYOfficial May 8, 2026
ed27899
feat: 完善了完整RAG提取架构
LYOfficial May 11, 2026
0387e86
feat:采用分段上传
LYOfficial May 12, 2026
712f915
fix: 修复链接跳转问题
LYOfficial May 12, 2026
4e21ab8
feat: 优化了Embedding模型的读取
LYOfficial May 12, 2026
730b3db
feat: 采用S3桶储存文件读取
LYOfficial May 13, 2026
441df25
fix: 修复前端相关问题
LYOfficial May 13, 2026
f666a62
feat:真正实现了对pdf图片的提取
LYOfficial May 13, 2026
bf06b31
feat: 真正实现图片输出
LYOfficial May 13, 2026
4e3b3d3
test: 注释S3+easyyun流程代码
LYOfficial May 13, 2026
3abd1f1
feat: 清空无关代码,减少轮询压力
LYOfficial May 13, 2026
39eb40e
feat: 优化批次轮询
LYOfficial May 14, 2026
5785610
feat: update workflow
LYOfficial May 14, 2026
7e61b0e
Initial plan
Copilot May 15, 2026
3e8cca1
Merge pull request #9 from LYOfficial/copilot/fix-release-workflow-fo…
LYOfficial May 15, 2026
d4e3b23
Initial plan
Copilot May 15, 2026
a9c4df9
fix: stabilize release tauri build target in CI
Copilot May 15, 2026
0ebd5a7
refactor: simplify build target assignment
Copilot May 15, 2026
43425f2
refactor: support string or list build target override
Copilot May 15, 2026
767f77b
refactor: clarify CI build target parsing
Copilot May 15, 2026
deb603f
Merge pull request #10 from LYOfficial/copilot/fix-release-workflow-e…
LYOfficial May 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release
on:
workflow_dispatch:

jobs:
release:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-22.04, windows-latest]
runs-on: ${{ matrix.platform }}
environment: Build Release
env:
VITE_ONEDOCS_API_URL: ${{ secrets.ONEDOCS_API_URL }}
VITE_ONEDOCS_API_KEY: ${{ secrets.ONEDOCS_API_KEY }}
VITE_SILICONFLOW_TOKEN: ${{ secrets.SILICONFLOW_TOKEN }}
VITE_BUILD_TARGET: esnext

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies (Ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: Install frontend dependencies
run: npm ci

- name: Build the app
run: npm run tauri build

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: OneDocs-${{ matrix.platform }}
path: |
src-tauri/target/release/bundle/msi/*.msi
src-tauri/target/release/bundle/nsis/*.exe
src-tauri/target/release/bundle/dmg/*.dmg
src-tauri/target/release/bundle/deb/*.deb
src-tauri/target/release/bundle/appimage/*.AppImage
if-no-files-found: warn
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ dist-ssr
package-lock.json
src-tauri/Cargo.toml
src-tauri/Cargo.toml
.env
41 changes: 41 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Repository Guidelines

## Project Structure & Module Organization
- `src/`: React + TypeScript front end (core app). Key areas include `components/`, `pages/`, `services/`, `store/`, `hooks/`, `utils/`, and `styles/`.
- `src-tauri/`: Tauri (Rust) desktop shell and configuration.
- `docs/`: Static docs/site assets.
- `dist/`: Build output (generated).
- `index.html`, `vite.config.ts`, `tsconfig*.json`: Vite and TypeScript setup.

## Build, Test, and Development Commands
- `npm install`: Install Node dependencies.
- `npm run dev`: Start the Vite web dev server.
- `npm run build`: Type-check (`tsc`) and build the web app.
- `npm run preview`: Preview the production web build.
- `npm run tauri:dev`: Run the desktop app in dev mode (requires Rust + Tauri toolchain).
- `npm run tauri:build`: Build desktop app bundles.

## Coding Style & Naming Conventions
- TypeScript + React with `.tsx` for UI, `.ts` for logic.
- Use 2-space indentation, single quotes, and semicolons (match existing files like `src/main.tsx`).
- Prefer `PascalCase` for React components and `camelCase` for functions/variables.
- Keep CSS in `src/styles/` and reuse existing class naming patterns.

## Testing Guidelines
- No automated test framework is configured in this repo.
- If you add tests, document the framework and add a script in `package.json`.
- For now, validate changes manually:
- Web UI: `npm run dev`
- Desktop: `npm run tauri:dev`

## Commit & Pull Request Guidelines
- Commit history shows a mix of `feat:`-style prefixes and simple imperatives (e.g., “Update README”). Either is acceptable; keep messages short and specific.
- PRs should include:
- A clear summary of changes and the motivation.
- Steps to validate (commands and expected results).
- Screenshots or screen recordings for UI changes.
- Linked issues or feature requests when applicable.

## Configuration & Secrets
- API keys are entered in the app UI; do not hardcode secrets.
- If new env vars are added, document them in `README_EN.md` and keep defaults safe.
875 changes: 674 additions & 201 deletions LICENSE

Large diffs are not rendered by default.

203 changes: 191 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
![OneDocs](https://socialify.git.ci/LYOfficial/OneDocs/image?description=1&font=KoHo&forks=1&issues=1&language=1&logo=https%3A%2F%2Foss.1n.hk%2Flyofficial%2Fimages%2Ficon.png&name=1&owner=1&pattern=Plus&pulls=1&stargazers=1&theme=Auto)

<p align="center">
<a href="./README.md">中文简体</a> | <a href="./README_EN.md">English</a>
</p>

<p align="center">
<img src="https://oss.1n.hk/lyofficial/images/onedocs/milestone2.svg" alt="milestone2" height="54" /> <a href="https://www.producthunt.com/products/onedocs?embed=true&utm_source=badge-featured&utm_medium=badge&utm_source=badge-onedocs" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1045456&theme=light&t=1765113607287" alt="OneDocs - A&#0032;single&#0032;text&#0044;&#0032;all&#0032;is&#0032;known&#0046; | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
</p>


# OneDocs

> A Single Text, All is Known.
Expand All @@ -13,13 +22,28 @@
**文章千卷,一览而知。智慧之器,助君析文明理。**

OneDocs者,一文亦闻也,乃集诸多智能提示之力,助君速览文档精髓,无论新闻要览、数据解析,抑或学科要点,皆可一键明了。
## 测试截图

![介绍页](https://oss.1n.hk/image/up/02d537a812ec13ab1afe9c7934a81e5a.png)
## 项目介绍
当今数据时代,各行各业有各种文档需要我们阅读和分析,有每日新鲜的新闻报告、工作场景的数据表格、学习生活中的课件文档……各种文档中**有精华亦有糟粕**,人力阅读和筛选会**占用大量的时间**,有没有什么工具能**将那些无用内容筛去**,像学霸笔记那样**将精华内容整理分析**方便我们阅读和学习呢?

于是我做了这个AI工具,**OneDocs**,给它起了个好听的中文名「**一文亦闻**」,结合文件分析、大模型应用和输出格式规范化,对用户上传的文件进行解构分析,去除无用内容,整理成知识手册。希望用户能通过大模型的力量,通过一个个简单的文档了解事情的本质,学习和进步。

目前软件支持**PDF**文档格式,支持**40+模型**选择,支持**Windows/macOS/Linux跨平台**使用,基本满足各类用户使用需求。且软件为本地下载使用,无文件上传,不会造成文件和API Key泄露。

软件功能主要有四种:

- **要闻概览**——新闻要点梳理
- **罗森析数**——数据内容分析
- **理工速知**——理工课件整理
- **文采丰呈**——文科课件整理

![应用页](https://oss.1n.hk/image/up/8fa2905efe5922ce320d6744d734ec8d.png)
分析后的结果可以预览、复制Markdown源码和导出下载,亦可以同时分析多文件进行合并下载。

![源码页](https://oss.1n.hk/image/up/3c639cb78d434110f31b450f57de117d.png)
## 软件截图

<img src="http://oss.1n.hk/lyofficial/images/onedocs/onedocs1.png" alt="OneDocs" height="320"/><img src="http://oss.1n.hk/lyofficial/images/onedocs/onedocs2.png" alt="OneDocs" height="320"/>
<img src="http://oss.1n.hk/lyofficial/images/onedocs/onedocs3.png" alt="OneDocs" height="320"/><img src="http://oss.1n.hk/lyofficial/images/onedocs/onedocs4.png" alt="OneDocs" height="320"/>
<img src="http://oss.1n.hk/lyofficial/images/onedocs/onedocs5.png" alt="OneDocs" height="320"/><img src="http://oss.1n.hk/lyofficial/images/onedocs/onedocs6.png" alt="OneDocs" height="320"/>


## 使用方法
Expand Down Expand Up @@ -60,31 +84,186 @@ OneDocs者,一文亦闻也,乃集诸多智能提示之力,助君速览文
要参与开发和部署这个项目,请先克隆本仓库:

```bash
git clone https://github.com/LYOfficial/OneDocs.git
git clone https://github.com/LYOfficial/OneDocs.git
```

安装Rust: https://rust-lang.org/zh-CN/tools/install/
### 环境要求

- Node.js(推荐 LTS)+ npm
- Rust + Tauri CLI(桌面端开发必须)
- macOS 用户可用以下方式安装 Rust:https://rust-lang.org/zh-CN/tools/install/

```bash
# MacOS 用户选择
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

### Tauri 版本说明(重要)

在部分镜像源环境(如 `ustc`)下,Tauri Rust crate 可用版本会落后于 npm 包最新版本。
为避免 `tauri-runtime` / `tauri-runtime-wry` 版本冲突,请固定使用当前仓库已验证可运行的版本组合,并使用**精确版本**(不要使用 `^`):

- npm:
- `@tauri-apps/api = 2.6.0`
- `@tauri-apps/cli = 2.6.0`
- `@tauri-apps/plugin-dialog = 2.3.0`
- `@tauri-apps/plugin-fs = 2.4.0`
- `@tauri-apps/plugin-shell = 2.3.0`
- Rust(`src-tauri/Cargo.toml`):
- `tauri = =2.6.0`
- `tauri-build = =2.6.0`
- `tauri-runtime = =2.9.2`
- `tauri-plugin-dialog = =2.3.0`
- `tauri-plugin-fs = =2.4.0`
- `tauri-plugin-shell = =2.3.0`

如需升级 Tauri,请保持 npm 与 Rust 端**同一代版本**并重新验证 `npm run tauri:dev`。

启动开发服务器:
### 启动与构建

```bash
npm install
npm run tauri dev
npm install

# Web 前端(Vite)
npm run dev

# Desktop(Tauri)
npm run tauri:dev
```

构建
构建发行版

```bash
npm run tauri build
# Web 前端
npm run build

# Desktop(Tauri)
npm run tauri:build
```

### 项目结构(核心)

- src/:React + TypeScript 前端主应用
- components/:通用组件(上传、结果、模型选择、设置面板等)
- pages/:页面入口(Landing / Analysis / AnalysisResult / Settings)
- hooks/:核心业务 Hook(析文流程)
- services/:API 与 Tauri 调用封装
- store/:全局状态(Zustand + persist)
- utils/:文档解析、Markdown/LaTeX 渲染
- config/:模型提供商、提示词配置、功能信息
- i18n/:多语言资源
- styles/:全局与组件样式
- src-tauri/:Tauri 桌面端(Rust)
- src/main.rs:Tauri 入口与命令注册
- src/lib.rs:请求转发与 API 调用
- docs/:静态站点资源
- dist/:构建输出(自动生成)

### 运行流程与构成

1. 用户选择文档与功能(FunctionSelector / FileUpload)
2. DocumentProcessor 将文件解析为纯文本
3. useAnalysis 组装提示词,调用 APIService
4. APIService 通过 Tauri invoke 调用 Rust 层请求
5. Rust 使用 reqwest 访问模型 API,将结果返回前端
6. Zustand 保存结果并由 ResultDisplay 渲染、导出或复制

### 功能与提示词

提示词配置位于 config/prompts/index.ts,对应四类功能:

- 要闻概览(news)
- 罗森析数(data)
- 理工速知(science,支持可选格式复查)
- 文采丰呈(liberal)

### 模型与提供商(当前内置)

模型配置位于 config/providers.ts,支持官方与第三方 API、以及本地模型服务:

- OneDocs:Qwen2.5-7B、Qwen3-8B、GLM-4-9B、GLM-Z1-9B 0414、GLM-4.1V-9B Thinking、GLM-4-9B 0414、DeepSeek-R1 Qwen3-8B、GLM-4-Flash
- OpenAI:gpt-4o、gpt-4o-mini、gpt-4、gpt-3.5-turbo
- Anthropic:Claude 3.5 Sonnet/Haiku、Claude 3 Opus/Sonnet
- Google Gemini:gemini-3-pro、2.5-pro、2.5-flash、1.5-pro、1.5-flash
- Moonshot:moonshot-v1-8k/32k/128k
- 智谱 GLM:glm-4-flash/flashx/plus/0520/long/4v-plus
- DeepSeek:deepseek-chat、deepseek-reasoner
- Ollama(本地):llama3.2、qwen2.5、gemma2、mistral
- LM Studio(本地):local-model
- 兼容平台:优云智算、302.AI、小马算力、硅基流动、星河大模型、PPIO、ModelScope、OneAPI

> 也可在设置中添加自定义模型(Custom Provider + 自定义模型名)。

### 技术栈

| 层级 | 技术 |
|------|------|
| 前端框架 | React 19 + TypeScript |
| 桌面端 | Tauri v2(Rust) |
| 构建工具 | Vite 7 |
| 状态管理 | Zustand 5 |
| PDF 解析 | pdfjs-dist v5(前端文本提取)+ lopdf(Rust 端图片提取) |
| 渲染 | marked(Markdown)+ KaTeX(LaTeX) |
| 国际化 | i18next + react-i18next |

### 文档解析与限制

- 支持:PDF
- 最大文件体积:30 MB(FILE_SIZE_LIMIT)
- 解析位于 utils/documentProcessor.ts(基于 pdfjs),图片提取位于 Rust 端(lopdf)

## 贡献指南

我们热烈欢迎每一位开发者的贡献!

- 在开始前,请确保已阅读 [开发](#开发) 部分的环境要求与版本说明。
- 欢迎通过 [Pull Request](https://github.com/LYOfficial/OneDocs/pulls) 或 [GitHub Issues](https://github.com/LYOfficial/OneDocs/issues) 分享您的想法与改进。
- 提交 PR 时,请包含:变更摘要、验证步骤、UI 变更的截图或录屏。
- Commit 信息请保持简明扼要,可使用 `feat:` / `fix:` / `docs:` 等前缀。

## 版权声明

版权所有 © 2024-2026 LYOfficial。

本项目基于 [GNU 通用公共许可证 v3.0](https://github.com/LYOfficial/OneDocs/blob/main/LICENSE) 发布。

## 鸣谢

衷心感谢以下开源项目,OneDocs 的开发离不开它们:

- [Tauri](https://github.com/tauri-apps/tauri) — 跨平台桌面应用框架
- [lopdf](https://github.com/J-F-Liu/lopdf) — Rust PDF 处理库,用于图片提取
- [pdfjs-dist](https://github.com/nicbarker/pdfjs-dist) — PDF 文本解析
- [React](https://github.com/facebook/react) — 用户界面构建库
- [marked](https://github.com/markedjs/marked) — Markdown 解析器
- [KaTeX](https://github.com/KaTeX/KaTeX) — LaTeX 数学公式渲染
- [Zustand](https://github.com/pmndrs/zustand) — 轻量状态管理
- [i18next](https://github.com/i18next/i18next) — 国际化框架

## 联系我们

- 邮箱:coldregion@qq.com
- GitHub Issues:[提交问题](https://github.com/LYOfficial/OneDocs/issues)
- Wiki:[OneDocs Wiki](https://github.com/LYOfficial/OneDocs/wiki)

### 环境变量(可选)

如果要内置 OneDocs 服务的 Base URL / API Key,可设置:

- VITE_ONEDOCS_API_URL
- VITE_ONEDOCS_API_KEY


## 作者

- [@LYOfficial ](https://github.com/LYOfficial/) 主要开发,项目主管。
- [@JHL-HK](https://github.com/JHL-HK) 部分重构,图床提供。

## 特别鸣谢

> 糖方科技提供苹果软件签名

![candyrectangle](https://github.com/LYOfficial/OneDocs/blob/f4bbdea5317f82ac7f734599fc54346ea4b85e1b/candyrectangle.png)

## Star 里程图

[![Star History Chart](https://api.star-history.com/svg?repos=LYOfficial/OneDocs&type=date&legend=top-left)](https://www.star-history.com/#LYOfficial/OneDocs&type=date&legend=top-left)
Loading
Loading