Commit Graph
7 Commits
Author SHA1 Message Date
coso 0c357c8bf1 feat: add security middleware, rate limiting, auth, encryption, conversation management
Borrowed patterns from ZeroClaw:
- server/middleware/security: request body size limit + timeout layer
- server/middleware/rate_limit: sliding window rate limiter per client IP
- server/middleware/idempotency: idempotency key store for duplicate prevention
- server/auth/pairing: pairing code auth with brute force protection
- core/sanitizer: credential sanitizer with 9 builtin patterns
- core/router/hint_router: message prefix hint routing ([reasoning], [fast])
- processor/conversation_manager: conversation history trimming
- processor/conversation_summarizer: LLM-based conversation summarization
- credential/encryption: ChaCha20-Poly1305 AEAD encryption for API keys
2026-02-18 14:58:51 +08:00
coso 8da33ec9a0 release: bump version to 0.64.0 2026-02-12 20:30:57 +08:00
cosoandClaude Opus 4.6 b14dbe8271 feat: 实现 Agent 调度器系统
实现完整的 Agent 任务调度系统,支持定时任务、批量处理和后台持续运行。

## 新增功能

### 1. proxycast-scheduler Crate
- 创建独立的调度器 crate
- 实现 SchedulerTrait 接口
- 支持任务 CRUD 操作
- 任务持久化到 SQLite

### 2. 数据模型
- ScheduledTask: 调度任务结构
- TaskStatus: 任务状态枚举 (Pending, Running, Completed, Failed, Cancelled)
- TaskFilter: 任务查询过滤器

### 3. AgentScheduler
- 实现调度器核心逻辑
- 支持任务创建、查询、更新、删除
- 支持到期任务查询
- 自动状态管理

### 4. AgentExecutor
- 实现任务执行器
- 通过 CredentialBridge 自动选择凭证
- 支持多种任务类型:
  - agent_chat: Agent 对话任务
  - batch_process: 批量处理任务
  - scheduled_report: 定时报告任务
- 自动标记凭证健康状态

### 5. SchedulerService (Heartbeat Loop)
- 实现心跳循环服务
- 每 30 秒轮询到期任务
- 自动执行到期任务
- 支持优雅启动和关闭 (CancellationToken)
- 集成到 Tauri setup

### 6. 数据库集成
- 创建 scheduled_tasks 表
- 添加索引 (status, scheduled_at, provider_type)
- 自动初始化表结构

## 技术实现

- 使用 tokio::spawn 启动后台任务
- 使用 tokio::time::interval 实现定时轮询
- 使用 tokio::select! 监听取消信号
- 完整的错误处理和日志记录
- 所有模块包含单元测试

## 文件清单

新增:
- src-tauri/crates/scheduler/Cargo.toml
- src-tauri/crates/scheduler/src/lib.rs
- src-tauri/crates/scheduler/src/types.rs
- src-tauri/crates/scheduler/src/dao.rs
- src-tauri/crates/scheduler/src/scheduler.rs
- src-tauri/crates/scheduler/src/executor.rs
- src-tauri/src/app/scheduler_service.rs

修改:
- src-tauri/Cargo.toml (添加 scheduler 依赖)
- src-tauri/src/app/mod.rs (导出 scheduler_service)
- src-tauri/src/app/setup.rs (集成调度器服务)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-09 21:47:52 +08:00
coso 19e14c0f4c refactor: 拆分 crate 架构 - models/providers/config/middleware/plugin 迁移到子 crate
- proxycast-core: models, data, logger, errors, backends, connect, session_files,
  orchestrator, session(rate_limit/sticky), config, middleware, plugin
- proxycast-providers: providers, converter, streaming, translator, stream,
  session(SessionManager/signature_store)
- 主 crate 保留 Tauri 业务逻辑,通过 re-export 保持 API 兼容
- 版本号升级到 0.60.0
- 移除已删除的 useFlowEvents hook 导出
- 移除已废弃的 flow_monitor 端到端测试
2026-02-08 03:19:44 +08:00
cosoandWarp 174ae555db perf: 优化 CI 构建时间 v0.57.0
- whisper-rs 改为可选依赖 (local-whisper feature)
- 禁用 LTO (CARGO_PROFILE_RELEASE_LTO=off)
- 增加 codegen-units 到 32
- 移除构建后清理步骤
- 统一内容创作系统增强

Co-Authored-By: Warp <agent@warp.dev>
2026-02-04 20:34:49 +08:00
coso 2a7ed06d21 chore: bump version to 0.48.4 2026-01-30 01:31:09 +08:00
cosoandClaude Opus 4.5 769709a467 feat(stage-1): 删除 OAuth 插件 UI 组件
删除内容:
- 删除 OAuthPluginTab.tsx - OAuth 插件标签页
- 删除 OAuthPluginContainer.tsx - 插件容器组件
- 从 ProviderPoolPage 移除 "OAuth 插件" 标签按钮
- 移除 CategoryType 中的 "plugins" 类型
- 更新 index.ts 导出,移除已删除组件的引用

保留内容:
- ClaudeOAuthForm.tsx - 被内置 OAuth 表单使用
- OAuthUrlDisplay.tsx - 被内置 OAuth 表单使用
- 所有内置 OAuth 凭证管理功能

验证:
- TypeScript 编译通过,无错误
- 前端代码结构完整

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 23:43:53 +08:00