Commit Graph

280 Commits

Author SHA1 Message Date
caoxiaozhu
e53c0aa5d1 test(backend): update service tests
- test_orchestrator_service.py: update orchestrator service tests
- test_settings_persistence.py: update settings persistence tests
- test_user_agent_service.py: update user agent service tests
2026-05-12 06:37:59 +00:00
caoxiaozhu
e416818ae2 feat(backend): update orchestrator endpoint
- endpoints/orchestrator.py: update orchestrator API endpoint with new features
2026-05-12 06:36:58 +00:00
caoxiaozhu
01df3452fd refactor(backend): update and add service layers
- services/ontology.py: update ontology service
- services/orchestrator.py: update orchestrator service
- services/user_agent.py: update user agent service
- services/settings.py: update settings service
- services/expense_claims.py: update expense claims service
- services/agent_conversations.py: add new agent conversations service
2026-05-12 06:36:09 +00:00
caoxiaozhu
a6a28ba865 refactor(backend): update data schemas
- schemas/orchestrator.py: update orchestrator schemas
- schemas/settings.py: update settings schemas
- schemas/user_agent.py: update user agent schemas
2026-05-12 06:35:17 +00:00
caoxiaozhu
665a744a43 feat(backend): update database models and add agent_conversation
- base.py: update database base configuration
- models/__init__.py: update models exports
- models/system_setting.py: update system setting model
- models/agent_conversation.py: add new agent conversation model
2026-05-12 06:34:36 +00:00
caoxiaozhu
8227e0ab5c docs(agent-week-plan): update weekly plan documents
- MASTER_TODO.md: update master todo list
- day_3_semantic_ontology_mvp.md: update semantic ontology tasks
- day_4_orchestrator_runtime.md: update orchestrator runtime tasks
- day_5_user_agent_mvp.md: update user agent tasks
2026-05-12 06:33:55 +00:00
caoxiaozhu
d81ac10894 chore(server): update server start script dependencies check
- server_start.sh: add multipart to dependencies check for file upload support
2026-05-12 03:07:09 +00:00
caoxiaozhu
035be110b6 feat(web): add OCR service and update travel reimbursement view
- web/src/services/ocr.js: add OCR service API client
- web/src/views/scripts/TravelReimbursementCreateView.js: update travel form script with OCR integration
2026-05-12 03:05:51 +00:00
caoxiaozhu
a3f3421ebc test(server): add OCR endpoint and service tests
New tests:
- server/tests/test_ocr_endpoints.py: OCR API endpoint tests
- server/tests/test_ocr_service.py: OCR service unit tests

Updated tests:
- server/tests/test_openapi_schema.py: update OpenAPI schema tests
- server/tests/test_orchestrator_service.py: update orchestrator service tests
2026-05-12 03:05:05 +00:00
caoxiaozhu
fb23a6976a feat(server): add OCR invoice processing functionality
New endpoints:
- server/src/app/api/v1/endpoints/ocr.py: OCR API endpoints for invoice scanning

New schemas:
- server/src/app/schemas/ocr.py: OCR request/response data schemas

New services:
- server/src/app/services/ocr.py: OCR processing business logic
- server/src/app/services/expense_claims.py: expense claims management service

Scripts:
- server/scripts/bootstrap_paddleocr_mobile.sh: PaddleOCR mobile setup script
- server/scripts/paddle_ocr_worker.py: PaddleOCR worker process
2026-05-12 03:04:10 +00:00
caoxiaozhu
ca29025063 refactor(backend): update services and register OCR router
- router.py: register ocr_router with OCR tag
- ontology.py: update ontology service logic
- orchestrator.py: update orchestrator service logic
- user_agent.py: update user agent schema and service
- schemas/user_agent.py: update user agent data schemas
2026-05-12 03:03:15 +00:00
caoxiaozhu
33826929ba chore(server): update backend configuration files
- pyproject.toml: update project dependencies and metadata
- config.py: update application configuration settings
- openapi.py: update OpenAPI documentation
2026-05-12 03:01:24 +00:00
caoxiaozhu
4792b5074f docs(agent-week-plan): update master todo and daily plan docs
- MASTER_TODO.md: update master todo list for current sprint
- day_3_semantic_ontology_mvp.md: update semantic ontology tasks
- day_4_orchestrator_runtime.md: update orchestrator runtime tasks
- day_5_user_agent_mvp.md: update user agent tasks

chore: add server/.venv-ocr312 to .gitignore
2026-05-12 03:00:54 +00:00
caoxiaozhu
434944abc3 feat(web): add ontology and orchestrator service modules
- web/src/services/ontology.js: ontology service API client
- web/src/services/orchestrator.js: orchestrator service API client
2026-05-12 01:28:38 +00:00
caoxiaozhu
93b1a5e746 feat(web): update Vue components and composables
- PersonalWorkbench.vue: update personal workbench component
- useAppShell.js: update app shell composable
- useChat.js: update chat composable with new features
- AppShellRouteView.vue: update route view
- ChatView.vue: update chat view with enhanced UI
- TravelReimbursementCreateView.vue: update travel reimbursement form
- ChatView.js: update chat view script logic
- TravelReimbursementCreateView.js: update travel form script logic
2026-05-12 01:27:49 +00:00
caoxiaozhu
e3548dfaba style(web): update chat and travel reimbursement styles
- chat-view.css: update chat view styling
- travel-reimbursement-create-view.css: update travel reimbursement form styles
2026-05-12 01:26:56 +00:00
caoxiaozhu
441e27145d refactor(backend): register ontology and orchestrator routers
- router.py: import and register ontology_router and orchestrator_router
- openapi.py: add ontology and orchestrator tags to OpenAPI documentation
- agent_runs.py: extend agent runs service with additional functionality
- test_openapi_schema.py: update OpenAPI schema tests
2026-05-12 01:26:13 +00:00
caoxiaozhu
22d47cbf2b feat(backend): add ontology and orchestrator API endpoints
New endpoints:
- server/src/app/api/v1/endpoints/ontology.py: ontology API
- server/src/app/api/v1/endpoints/orchestrator.py: orchestrator API

New schemas:
- server/src/app/schemas/ontology.py: ontology data schemas
- server/src/app/schemas/orchestrator.py: orchestrator data schemas
- server/src/app/schemas/user_agent.py: user agent data schemas

New services:
- server/src/app/services/ontology.py: ontology business logic
- server/src/app/services/orchestrator.py: orchestrator business logic
- server/src/app/services/runtime_chat.py: runtime chat service
- server/src/app/services/user_agent.py: user agent service

New tests:
- server/tests/test_ontology_service.py
- server/tests/test_orchestrator_service.py
- server/tests/test_user_agent_service.py
2026-05-12 01:24:39 +00:00
caoxiaozhu
19da459bb3 docs(agent-week-plan-html): update HTML plan documents
- Update day-1.html to day-7.html: update daily plan content
- Update index.html: refresh week plan index page
2026-05-12 01:23:33 +00:00
caoxiaozhu
ba28627f11 docs(agent-week-plan): update weekly execution plan documents
- Update 00_README.md: refresh week plan overview and structure
- Update MASTER_TODO.md: update master todo list for new week
- Update day_1_foundation_models.md: expand foundation models tasks
- Update day_2_rule_center_integration.md: add rule center integration tasks
- Update day_3_semantic_ontology_mvp.md: add semantic ontology tasks
- Update day_4_orchestrator_runtime.md: add orchestrator runtime tasks
- Update day_5_user_agent_mvp.md: add user agent tasks
- Update day_6_hermes_mvp.md: add hermes agent tasks
- Update day_7_hardening_demo_acceptance.md: add hardening tasks
2026-05-12 01:22:38 +00:00
caoxiaozhu
9b88ee2901 docs(agent-plan): update architecture docs and remove weekly_execution_details
- Update 00_README.md: refresh architecture overview
- Update 02_semantic_ontology.md: expand semantic layer design
- Update 04_orchestrator_and_runtime_flow.md: add runtime flow details
- Update 05_development_roadmap.md: refine milestone timeline
- Update 06_data_contracts_and_governance.md: add contract specifications
- Update 10_evaluation_and_testset.md: add evaluation framework
- Update 11_ocr_invoice_architecture.md: enhance OCR architecture
- Update 14_financial_document_canonical_model.md: complete model design
- Remove weekly_execution_details/: deprecated in favor of agent week plan
2026-05-12 01:20:53 +00:00
caoxiaozhu
0b63be2d39 style(audit): simplify asset list interactions 2026-05-11 06:33:46 +00:00
caoxiaozhu
83286712e5 docs(agent-plan): record day 2 rule center completion 2026-05-11 06:32:49 +00:00
caoxiaozhu
e9eeb2e41d feat(audit): connect rule center to live asset APIs 2026-05-11 06:32:38 +00:00
caoxiaozhu
9b39df6277 chore(skill): add split commit and push workflow 2026-05-11 06:31:08 +00:00
caoxiaozhu
321dd6fdaf feat: 完善后端 API OpenAPI 文档与统一错误响应 schema 2026-05-11 05:18:16 +00:00
caoxiaozhu
b2beeaa136 feat: deliver agent foundation day 1 2026-05-11 03:51:24 +00:00
caoxiaozhu
f738b6cdd4 feat: 重构 AuditView 支持规则/技能分类,新增 Agent 开发文档 2026-05-11 01:53:30 +00:00
caoxiaozhu
0c6ac50b31 feat: 优化 AuditView 样式与交互细节 2026-05-09 16:16:56 +00:00
caoxiaozhu
683c75f364 feat: 重构 AuditView 支持 Skills/MCP/定时任务三种类型管理 2026-05-09 15:46:16 +00:00
caoxiaozhu
da6f0e2589 fix: 修正 Hermite 同步逻辑与模型优先级配置 2026-05-09 09:21:00 +00:00
caoxiaozhu
694ee42781 feat: 添加 Hermite 同步服务与导航优化 2026-05-09 09:14:04 +00:00
caoxiaozhu
6d91528b7c feat: 添加 Docker 环境轮询监听支持并优化渲染设置卡片样式 2026-05-09 08:25:54 +00:00
caoxiaozhu
4fbd313f35 feat: 支持 ONLYOFFICE 持久化配置管理
- 添加 SettingsRenderForm schema 和 renderForm 字段
- 实现数据库 schema 自动迁移(onlyoffice_enabled, onlyoffice_public_url, onlyoffice_jwt_secret_encrypted)
- 新增 resolve_onlyoffice_settings() 函数支持运行时配置解析
- 知识库服务改用数据库配置替代运行时配置
- 前端添加文件渲染配置页面,支持 JWT 密钥管理
- 完善相关测试覆盖
2026-05-09 08:02:01 +00:00
caoxiaozhu
94122fd34b feat: 完善知识库预览功能与配置管理优化 2026-05-09 07:29:49 +00:00
caoxiaozhu
d9133193e8 feat: 完善知识库、策略预览与OnlyOffice集成,增强后端启动依赖检查 2026-05-09 05:59:46 +00:00
1d3ac5c2e0 feat: docker-compose 添加 volumes 映射和 SSH 登录自动进入 /app 目录 2026-05-09 12:58:44 +08:00
2a202153cc feat: 添加 docker-compose 配置支持 SSH 和 vite proxy 2026-05-09 12:47:20 +08:00
caoxiaozhu
d9ffa9ce2c feat: 完善知识库、策略预览与OnlyOffice集成
## 配置与环境
- .env.example: 更新环境变量配置
- docker-compose.yml: 完善Docker编排配置
- docker/README.md: 更新Docker文档

## 后端知识库模块
- endpoints/knowledge.py: 增强知识库API端点
- schemas/knowledge.py: 扩展知识库数据模型
- services/knowledge.py: 完善知识库业务逻辑
- config.py: 优化配置管理
- storage/knowledge/.index.json: 更新知识库索引

## 前端功能
- api.js: 完善API服务层
- knowledge.js: 优化知识库服务
- onlyoffice.js: 新增OnlyOffice文档服务集成
- TopBar.vue: 优化顶部导航栏
- PoliciesView.vue: 完善策略视图
- AppShellRouteView.vue: 新增应用外壳路由视图
- views/scripts/PoliciesView.js: 优化策略脚本
- policiesPreviewFormatters.js: 新增策略预览格式化工具

## 样式
- policies-view.css: 完善策略页样式

## 测试
- api-request.test.mjs: API请求测试
- onlyoffice-service.test.mjs: OnlyOffice服务测试
- policies-preview-formatters.test.mjs: 策略预览格式化测试
2026-05-09 04:25:30 +00:00
caoxiaozhu
619281afc3 feat: 完善系统配置、安全增强与知识库功能
- .env.example: API基础路径改为相对路径 /api/v1,支持代理转发
- README.md: 完善项目结构与启动说明文档
- docker-compose.yml: 新增Docker编排配置,支持容器化部署
- docker/: 新增Docker部署相关文档与配置

- server_start.sh: 重构启动脚本,添加容器环境检测、隔离虚拟环境路径、环境变量覆盖机制
- deps.py: 完善API依赖注入,增强权限验证逻辑
- admin_secret.py: 优化管理员密钥加密存储与验证
- config.py: 扩展配置管理,支持多环境变量绑定
- security.py: 增强安全模块,完善加密与认证机制
- db/base.py: 优化数据库基础架构与连接管理
- main.py: 更新应用入口,整合新模块路由
- models/: 完善系统模型配置,支持模型设置持久化
- repositories/settings.py: 优化设置仓储层,增强数据持久化
- services/settings.py: 重构设置服务,精简代码结构
- router.py: 更新API路由配置

- endpoints/knowledge.py: 新增知识库API端点
- schemas/knowledge.py: 新增知识库数据模型
- services/knowledge.py: 新增知识库业务逻辑
- storage/knowledge/.index.json: 知识库索引存储

- api.js: 完善API服务层,增强错误处理
- bootstrap.js: 优化前端初始化与引导流程
- useSetupView.js / useSystemState.js: 重构组合式函数
- TopBar.vue: 优化顶部导航栏组件
- SettingsView.vue: 重构设置页面UI,增强用户体验
- SetupView.vue / SetupRouteView.vue: 完善引导流程页面
- PoliciesView.vue: 优化策略视图组件
- vite.config.js: 更新Vite构建配置
- web_start.sh: 完善前端启动脚本
- views/scripts/: 优化各业务视图JS逻辑

- settings-view.css: 重构设置页面样式
- setup-view.css: 完善引导页样式
- policies-view.css: 优化策略页样式

- test_auth_service.py: 完善认证服务测试
- test_settings_persistence.py: 增强设置持久化测试
- document/: 新增开发文档与工作日志
2026-05-09 03:04:40 +00:00
c2315f68dc fix: 修复 Docker 部署 API 地址与数据库连接问题 2026-05-09 09:29:34 +08:00
86568660a4 feat: 重构模型配置存储与 API Key 加密管理
主要修改点:

1. 遗留密码格式兼容 (server/src/app/core/admin_secret.py)
   - 新增 legacy_admin_secret_to_password_hash(): 将旧版 admin secret 记录转换为标准 scrypt 哈希格式

2. Scrypt 密码验证增强 (server/src/app/core/security.py)
   - verify_password(): 新增 scrypt$ 前缀检测,分流到专用验证函数
   - 新增 verify_scrypt_password(): 解析 scrypt$ 格式哈希并验证

3. 模型配置存储重构 (server/src/app/models/system_model_setting.py)
   - 新增 SystemModelSetting 模型(slot 为 PK)
   - 字段: slot, provider, model_name, endpoint, capability, priority, enabled, api_key_encrypted, created_at, updated_at

4. Settings Repository 扩展 (server/src/app/repositories/settings.py)
   - 新增 get_model_settings(): 获取所有模型配置
   - 新增 get_model_setting(slot): 按 slot 获取单个模型配置

5. Settings Service 重构 (server/src/app/services/settings.py)
   - 新增 ModelSlotConfig dataclass: 封装单个模型槽位的配置属性
   - 新增 MODEL_SLOT_CONFIGS 字典: main/backup/vlm/embedding 四个槽位配置
   - 重构 save_model_settings(): 批量保存模型配置到 SystemModelSetting 表
   - 新增 load_model_settings(): 从 SystemModelSetting 表加载所有模型配置
   - read_settings(): 整合 legacy secrets 与新的 SystemModelSetting 表数据
   - write_settings(): 拆分 model secrets 到 SystemModelSetting 表
   - decrypt_model_secret(): 新增从数据库读取加密的 API Key

6. 数据库模型注册 (server/src/app/db/base.py)
   - 注册 SystemModelSetting 模型

7. 前端 API URL 智能解析 (web/src/services/api.js)
   - 新增 isLoopbackHost(): 判断是否为回环地址
   - 新增 resolveBrowserReachableApiBaseUrl(): 当后端配置为回环地址但浏览器非回环时,自动替换为浏览器 host
   - 改进错误信息: "无法连接 FastAPI 后端服务,请确认后端已启动且浏览器可访问后端端口。"

8. 前端 Session 导航增强 (web/src/composables/useSystemState.js)
   - installSessionNavigation(): 调用 fetchBootstrapState 后设置运行时 API Base URL

9. Settings 视图增强 (web/src/views/SettingsView.vue)
   - API Key 输入框: 新增 @focus="clearModelSecretMask('xxx')" 清除遮罩
   - 新增 .secret-bound-state 提示: 显示"已从数据库加密加载,测试会使用已保存密钥"

10. Settings 脚本增强 (web/src/views/scripts/SettingsView.js)
    - 新增 clearModelSecretMask(slot): 清除指定槽位的 API Key 遮罩状态

11. CSS 样式 (web/src/assets/styles/views/settings-view.css)
    - 新增 .secret-bound-state 样式: 显示数据库已加载密钥的提示样式
2026-05-08 11:14:04 +08:00
c5486dd3d3 feat: 启用后端自动启动与 Setup 引导流程增强
主要修改点:

1. 网络绑定扩展至 Server
   - .env.example: SERVER_HOST/VITE_SERVER_HOST 从 127.0.0.1 改为 0.0.0.0
   - server/src/app/core/config.py: 默认 app_host 从 127.0.0.1 改为 0.0.0.0

2. 启动脚本重构(重命名以区分职责)
   - server/start.sh → server/server_start.sh
   - web/start.sh → web/web_start.sh
   - 根目录 start.sh: 更新调用路径(./start.sh → ./server_start.sh, ./web_start.sh)
   - 根目录 start.sh: 新增 setup_ready() 检测函数
   - 根目录 start.sh: server_probe_host() 支持 0.0.0.0 探测转换为 127.0.0.1
   - 根目录 start.sh: start_setup_web() 新增 X_FINANCIAL_FORCE_SETUP=true

3. API URL 动态化 (web/src/services/api.js)
   - 从 localStorage 持久化读取 API Base URL
   - 新增 setRuntimeApiBaseUrl() / getRuntimeApiBaseUrl() 导出函数
   - buildUrl() 改用运行时 runtimeApiBaseUrl

4. 浏览器 Host 智能解析 (web/vite.config.js)
   - 新增 resolveBrowserApiHost(): 根据 server_host/web_host 配置决定浏览器端使用的 API Host
   - buildApiBaseUrl() 改用 resolveBrowserApiHost()
   - 新增后端启动状态管理: backendStartState / cloneBackendStartState() / updateBackendStep()
   - 后端启动分 5 步追踪: config → deps → server → health → done
   - 新增 backendStartPromise 避免重复启动

5. Setup 表单逻辑增强 (web/src/composables/useSetupView.js)
   - 新增 shouldExposeServerHost(): 判断浏览器 host 是否非本地
   - 新增 resolveInitialServerHost(): 当浏览器访问且 server_host 为本地时暴露 0.0.0.0
   - buildPayload(): 根据 shouldExposeServerHost() 自动将 127.0.0.1/localhost 转为 0.0.0.0

6. Bootstrap API 扩展 (web/src/services/bootstrap.js)
   - 新增 startBootstrapBackend(): POST /bootstrap/backend 触发后端启动
   - 新增 fetchBootstrapBackendStatus(): GET /bootstrap/backend 查询后端状态

7. Session 导航增强 (web/src/composables/useSystemState.js)
   - 新增 resolveBrowserApiBaseUrl(): 智能解析浏览器端 API Base URL
   - installSessionNavigation(): 调用 fetchBootstrapState() 同步引导状态
   - 新增 reconcileEntryRoute(): 根据引导状态协调路由
   - VITE_SERVER_HOST 默认值从 127.0.0.1 改为 0.0.0.0

8. Setup 视图增强 (web/src/views/SetupRouteView.vue)
   - 向 SetupView 传递启动进度相关 props: startupCountdownSeconds, startupLog, startupSteps, startupVisible, progressMessage

9. CSS 新增 (web/src/assets/styles/views/setup-view.css)
   - .setup-complete-progress: 进度文字样式
   - .setup-modal-backdrop: 模态框遮罩
   - .setup-startup-modal: 启动模态框容器
   - .setup-startup-head / .setup-startup-body / .setup-startup-spinner: 模态框头部/内容/加载动画
   - .setup-startup-steps / .setup-startup-step: 步骤列表及单个步骤
   - .setup-startup-step.is-running / .is-success / .is-failed: 步骤状态样式
   - .setup-startup-log: 启动日志区域
2026-05-08 10:52:54 +08:00
828e8f5aaf feat: 优化网络绑定配置支持外部访问
主要修改点:
1. 网络绑定调整
   - .env.example: WEB_HOST/VITE_WEB_HOST 从 127.0.0.1 改为 0.0.0.0
   - server/src/app/core/config.py: 默认 web_host 从 127.0.0.1 改为 0.0.0.0
   - web/package.json: Vite 脚本 host 从 127.0.0.1 改为 0.0.0.0
   - web/vite.config.js: normalizeState 中 WEB_HOST 默认值从 127.0.0.1 改为 0.0.0.0

2. CORS 配置扩展
   - .env.example: CORS_ORIGINS 添加 http://0.0.0.0:5173

3. Shell 脚本权限修复
   - server/start.sh, start.sh: 添加可执行权限 (644 -> 755)

4. Setup 表单与验证逻辑简化
   - web/src/composables/useSetupView.js:
     - 新增 readCurrentWebEndpoint() 从 window.location 自动检测当前 web host/port
     - 简化 runtimeInputsReady: 移除 web_host/web_port 必填验证,仅保留 server_host/server_port
     - 简化 buildRuntimeFingerprint(): 移除 web_host/web_port
     - buildPayload() 改用 readCurrentWebEndpoint() 解析 web 配置
   - web/vite.config.js:
     - 新增 resolveRuntimePayload(): 运行时解析 web_host/web_port
     - 移除 validateRuntimePayload() 中的 web_host/web_port 字段验证
     - 移除 testRuntimePorts() 中 web 端口冲突检测逻辑
     - 移除 canReuseCurrentWebPort() 函数

5. CSS 清理
   - web/src/assets/styles/views/setup-view.css: 移除未使用的 .setup-summary-grid 和 .setup-summary-item 样式
2026-05-08 09:27:45 +08:00
adda87a01d feat: add system settings with model connectivity and encrypted storage 2026-05-08 08:56:52 +08:00
e8f3d97d6a feat: add settings page with navigation and access control updates 2026-05-07 15:55:23 +08:00
b8ba0ea6a0 feat: add auth module with login and access control 2026-05-07 14:34:42 +08:00
2d56bc2889 feat: enhance employee CRUD with search, filters, and security module 2026-05-07 13:48:00 +08:00
c00db75c13 feat: add employee management, backend health check, and UI improvements 2026-05-07 11:50:10 +08:00
a5db09f41e docs: update work log with commit details and problem/solution
- Add commit file changes statistics
- Add Problem/Solution sections
- Add What's Done/Not Done sections

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-06 22:29:02 +08:00