Files
iAs/Cargo.toml
T
wunianxiao 23c7fbac62 feat: 为全部 39 个 Rust 源文件添加系统性中文注释
为整个项目添加了详尽的中文文档注释,覆盖所有模块:

入口与架构:
- main.rs — 架构图、数据流、4 个关键设计决策
- cli.rs — 所有 CLI 子命令中文化
- Cargo.toml — 每个依赖的作用说明
- channel/mod.rs — 渠道标识设计意图

核心守护进程与消息队列:
- daemon.rs — 三消费者架构图、审批流
- queue/* — 公平轮转算法、路由调度架构

LLM 层:
- types.rs — Role/Message/ToolCall 等每个字段含义
- provider.rs — Provider trait 设计 + SSE 解析
- conversation.rs — 工具循环流程图、摘要机制
- deepseek.rs — API 请求格式

上下文管理:
- context/types.rs — ChatSession 消息生命周期
- context/builder.rs — Token 预算管理策略
- context/tools.rs — MemoryStore 双写策略

工具系统:
- tools/mod.rs — 两层元工具架构图
- tools/approval.rs — 审批流程
- tools/definitions.rs — 声明式工具三要素
- tools/subprocess.rs — 执行流程 + 缓存策略

数据库与状态:
- db/* — 5 张表用途、回退策略
- state.rs — 文件存储回退方案
- scheduler.rs — SKIP LOCKED 防重复

已废弃模块:
- ipc.rs — 旧 UDS 协议
- worker.rs — 旧 vs 新架构对比
2026-06-09 20:52:24 +08:00

58 lines
2.9 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[package]
name = "iAs"
version = "0.1.0"
edition = "2024"
description = "微信 AI 智能助手 — 通过 DeepSeek LLM 实现 AI 自动回复"
[dependencies]
# ── 异步运行时 ──
tokio = { version = "1.0", features = ["full"] } # 异步运行时核心
# ── HTTP 客户端 ──
reqwest = { version = "0.12", features = ["json", "stream", "gzip"] } # HTTP 请求(微信 API + DeepSeek API + 工具调用)
# ── 序列化 ──
serde = { version = "1.0", features = ["derive"] } # 序列化/反序列化
serde_json = "1.0" # JSON 处理
# ── 环境变量加载 ──
dotenvy = "0.15" # .env 文件加载
# ── CLI 参数解析 ──
clap = { version = "4", features = ["derive"] } # 命令行参数解析
# ── 终端交互 ──
rustyline = "14.0" # REPL 行编辑
dialoguer = "0.12.0" # 终端交互对话框
console = "0.16.3" # 终端控制
# ── UUID ──
uuid = { version = "1", features = ["v4", "serde"] } # 唯一标识符
# ── 时间处理 ──
chrono = { version = "0.4", features = ["serde"] } # 日期时间
# ── 加密与签名 ──
base64 = "0.22" # Base64 编码
sha2 = "0.10" # SHA-256 哈希(审批码)
hex = "0.4" # 十六进制
rand = "0.9" # 随机数
ed25519-dalek = { version = "2", features = ["pem"] } # Ed25519 JWT 签名(和风天气 API
# ── 日志 ──
tracing = "0.1" # 结构化日志
tracing-subscriber = { version = "0.3", features = ["env-filter"] } # 日志输出
tracing-appender = "0.2.5" # 文件日志(日滚)
# ── 二维码 ──
qrcode = "0.14" # 二维码生成
image = "0.25" # 图片处理
# ── 异步 trait ──
async-trait = "0.1" # 异步 trait 支持
# ── 流式处理 ──
futures-util = "0.3" # 流式处理工具
# ── 数据库 ──
sqlx = { version = "0.8.6", features = ["runtime-tokio-native-tls", "postgres", "uuid", "chrono", "derive", "migrate"] } # PostgreSQL
# ── 文件系统 ──
dirs = "6.0.0" # 系统目录路径
# ── HTML 解析 ──
scraper = "0.27.0" # HTML 解析(fetch_page 工具)
[[bin]]
name = "ias"
path = "src/main.rs"
[[bin]]
name = "ias-auth"
path = "src/bin/ias-auth.rs"