-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
61 lines (58 loc) · 2.88 KB
/
Copy pathCargo.toml
File metadata and controls
61 lines (58 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
[package]
name = "imagecli"
version = "0.1.0"
edition = "2021"
description = "通用多 provider 图像/视频生成 CLI"
license = "MIT"
[dependencies]
# 异步运行时, 只开需要的特性以减小编译面
# io-std + io-util: MCP server 走 stdio, 需要 tokio 的 stdin/stdout 与 AsyncBufRead/Write 扩展
tokio = { version = "1", features = ["rt-multi-thread", "macros", "fs", "time", "sync", "process", "io-std", "io-util"] }
# HTTP 客户端, 用 rustls 避免依赖系统 openssl; json 特性用于直接收发 JSON
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "json", "stream"] }
# 命令行解析, derive 风格
clap = { version = "4", features = ["derive"] }
# 序列化/反序列化
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# 错误处理: anyhow 用于应用层, thiserror 用于库内错误类型
anyhow = "1"
thiserror = "2"
# 异步 trait
async-trait = "0.1"
# 系统钥匙串(密钥回退存储)见文件末尾的 target-specific 依赖:
# 按平台选原生后端(Linux keyutils / Windows 凭据管理器 / macOS 钥匙串), 保证跨平台编译
# 金额/成本估算用定点十进制, 绝不用 f64
rust_decimal = "1"
# 随机数, 用于轮询退避的 jitter
rand = "0.8"
# future 工具, 用于并发 join
futures = "0.3"
# SQLite 持久化任务状态。bundled: 静态编译 sqlite, 保持单二进制, 不依赖系统 libsqlite
rusqlite = { version = "0.31", features = ["bundled"] }
# 跨平台标准目录(XDG data dir), 用于定位 ~/.local/share/imagecli/jobs.db
directories = "5"
# base64 编解码: Gemini 产物是 base64 inline 字节, 需解码后落盘
base64 = "0.22"
# 交互式终端选择器(/model 式菜单), 仅在 stdout 是 TTY 时使用; 无 TTY 降级为列表
dialoguer = { version = "0.11", default-features = false }
# 默认配置(默认 provider/model)持久化, 与 key 分离, 落 ~/.config/imagecli/config.toml
toml = "0.8"
# HMAC-SHA256: 可灵 HS256 JWT 签名 与 即梦火山 V4 签名 同为 HMAC-SHA256, 一套覆盖两家
hmac = "0.12"
sha2 = "0.10"
# 十六进制编解码: 火山 V4 签名的 payload 哈希、各级签名结果需 hex 串
hex = "0.4"
[dev-dependencies]
# 测试时需要的额外能力(当前主要用 tokio 宏)
tokio = { version = "1", features = ["rt", "macros"] }
# 系统钥匙串: 按平台选原生后端, 保证 Windows / macOS / Linux 都能编译
# Linux: 内核 keyutils(纯 Rust, 不依赖 dbus/openssl)
[target.'cfg(target_os = "linux")'.dependencies]
keyring = { version = "3", default-features = false, features = ["linux-native"] }
# Windows: 凭据管理器(Windows Credential Manager)
[target.'cfg(target_os = "windows")'.dependencies]
keyring = { version = "3", default-features = false, features = ["windows-native"] }
# macOS: 钥匙串(Keychain)
[target.'cfg(target_os = "macos")'.dependencies]
keyring = { version = "3", default-features = false, features = ["apple-native"] }