-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCargo.toml
More file actions
156 lines (122 loc) · 4.11 KB
/
Copy pathCargo.toml
File metadata and controls
156 lines (122 loc) · 4.11 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
[package]
name = "charcoal"
version = "0.1.0"
edition = "2021"
description = "Predictive threat detection for Bluesky"
[dependencies]
# CLI
clap = { version = "4", features = ["derive"] }
# Async runtime (required by bsky-sdk)
tokio = { version = "1", features = ["full"] }
# AT Protocol response types (for deserializing public API responses)
atrium-api = "0.25.7"
# HTTP client (for public AT Protocol API, Constellation, and Perspective API)
# `stream` lets download_file write model files chunk-by-chunk instead of
# buffering a whole ~284MB artifact in memory (#233).
reqwest = { version = "0.12", features = ["json", "stream"] }
# Database (SQLite — optional, enabled by the `sqlite` default feature)
rusqlite = { version = "0.38", features = ["bundled"], optional = true }
# Topic extraction
keyword_extraction = "1.5"
stop-words = "0.8"
regex-lite = "0.1"
# Serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# Environment / config
dotenvy = "0.15"
# Async trait support (for ToxicityScorer trait with async methods)
async-trait = "0.1"
# Retry-with-decorrelated-jitter for ToxicityClassifier impls (RunPod/Zentropi).
# Spreads concurrent retries across the backoff window to avoid thundering-herd
# against the upstream during transient failures. thiserror gives RunPodError a
# typed enum so backon's .when() filter matches a variant, not a string message.
backon = { version = "1", default-features = false, features = ["tokio-sleep"] }
thiserror = "2"
# ONNX Runtime for local toxicity model inference
ort = "2.0.0-rc.11"
tokenizers = { version = "0.22", default-features = false, features = ["fancy-regex"] }
# Platform-appropriate directories (for model storage path)
dirs = "6"
# Async stream combinators (transitive dep via bsky-sdk, pinned for buffer_unordered)
futures = "0.3"
# Error handling
anyhow = "1"
# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# Terminal output
colored = "3"
indicatif = "0.17"
# Time handling
chrono = { version = "0.4", features = ["serde"] }
[features]
default = ["sqlite"]
sqlite = ["dep:rusqlite"]
postgres = ["dep:sqlx-core", "dep:sqlx-postgres", "dep:pgvector"]
web = ["dep:axum", "dep:tower-http", "dep:include_dir", "dep:hmac", "dep:sha2", "dep:rand", "dep:hex", "dep:atproto-oauth", "dep:atproto-oauth-axum", "dep:atproto-identity", "dep:base64", "dep:percent-encoding"]
# PostgreSQL support — split crates avoid the sqlx umbrella's transitive
# sqlx-sqlite dependency which conflicts with rusqlite's bundled SQLite.
# _rt-tokio activates the tokio runtime in sqlx-core (required for PgPool).
[dependencies.sqlx-core]
version = "0.8"
default-features = false
features = ["chrono", "json", "_rt-tokio"]
optional = true
[dependencies.sqlx-postgres]
version = "0.8"
default-features = false
features = ["chrono", "json"]
optional = true
[dependencies.pgvector]
version = "0.4"
features = ["sqlx"]
optional = true
[dependencies.axum]
version = "0.8"
optional = true
[dependencies.tower-http]
version = "0.6"
features = ["cors", "trace"]
optional = true
[dependencies.include_dir]
version = "0.7"
optional = true
[dependencies.hmac]
version = "0.12"
optional = true
[dependencies.sha2]
version = "0.10"
optional = true
[dependencies.rand]
version = "0.9"
optional = true
[dependencies.hex]
version = "0.4"
optional = true
# AT Protocol OAuth (required for the web feature — backend-driven OAuth flow)
[dependencies.atproto-oauth]
git = "https://github.com/musicjunkieg/atproto-crates"
rev = "d2457eecc6814e8351486df3a3608542bae848a7"
optional = true
[dependencies.atproto-oauth-axum]
git = "https://github.com/musicjunkieg/atproto-crates"
rev = "d2457eecc6814e8351486df3a3608542bae848a7"
optional = true
[dependencies.atproto-identity]
git = "https://github.com/musicjunkieg/atproto-crates"
rev = "d2457eecc6814e8351486df3a3608542bae848a7"
optional = true
# base64 encoding for DID in session tokens
[dependencies.base64]
version = "0.22"
optional = true
# URL percent-encoding for OAuth redirect URLs
[dependencies.percent-encoding]
version = "2"
optional = true
[dev-dependencies]
tower = "0.5"
tempfile = "3"
serial_test = "3"
wiremock = "0.6"