-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathCargo.toml
More file actions
145 lines (136 loc) · 6.61 KB
/
Copy pathCargo.toml
File metadata and controls
145 lines (136 loc) · 6.61 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
[workspace]
members = [
"crates/tinychannels-bus",
"crates/tinychannels-module",
"crates/tinychannels-runtime",
]
default-members = [
".",
"crates/tinychannels-bus",
"crates/tinychannels-module",
"crates/tinychannels-runtime",
]
# The bus is a submodule with its own workspace; it is a path dependency of the
# module crate, not a member here.
exclude = ["vendor/tinybus"]
resolver = "3"
[patch.crates-io]
tinybus = { path = "vendor/tinybus/crates/tinybus" }
tinybus-module = { path = "vendor/tinybus/crates/tinybus-module" }
[workspace.package]
# Releases update this sole workspace version before packaging every crate.
version = "0.1.10"
[package]
name = "tinychannels"
version.workspace = true
edition = "2024"
# Not published to a package registry. Every consumer takes this repository as
# a git submodule and a path dependency, and the loadable module is delivered as
# a release artifact pinned by its SHA-256 digest rather than a crate.
# `publish = false` makes that a property of the manifest instead of a
# convention someone has to remember, so
# an accidental `cargo publish` fails locally rather than claiming a name on
# crates.io that cannot be taken back.
publish = false
license = "GPL-3.0-only"
description = "Pluggable channel and messaging primitives for OpenHuman harness communication."
repository = "https://github.com/tinyhumansai/tinychannels"
readme = "README.md"
keywords = ["messaging", "channels", "openhuman", "harness"]
categories = ["asynchronous", "api-bindings"]
[features]
default = []
# Retained so downstreams that request it keep resolving; the relay WebSocket
# transport module is still gated on this cfg. `tokio-tungstenite` and
# `tokio/net` are now unconditional dependencies (the ported channel providers
# use them directly), so this feature no longer needs to pull them in.
relay-websocket = []
# SMTP send only (`EmailChannel::new` + `send_message` / `build_*_message`).
#
# Split out of `email` because sending and receiving have very different costs
# and very different consumers. A host that only ever *delivers* mail — OpenHuman
# emails a generated podcast as an attachment and never reads a mailbox — needs
# `lettre` and nothing else. Bundling the two meant that host also linked the
# IMAP receive stack, 13 crates it could never call, and once the channel
# providers move into the `tinychannels` bus module that would have been the
# whole of the shed the move was supposed to buy.
#
# This carries no `Channel` impl: a send-only build cannot `listen`, so
# advertising the trait would promise a half-working channel.
email-send = ["dep:lettre"]
# Full email provider (`providers::email_channel`) — IMAP receive + SMTP send.
# Off by default: it is the single heaviest provider in the crate, pulling the
# lettre/async-imap/mail-parser stack. Downstreams that expose an email channel
# opt in; downstreams that only send want `email-send` above.
email = ["email-send", "dep:async-imap", "dep:mail-parser"]
# Lark/Feishu provider (`providers::lark`) — runs its own axum webhook receiver
# and decodes protobuf events, so it owns both `axum` (5 crates) and `prost`
# (4 crates). Off by default for the same reason.
lark = ["dep:axum", "dep:prost"]
# WhatsApp Web (multi-device) provider — pulls the native whatsapp-rust stack.
# Off by default; the OpenHuman `whatsapp-web` feature forwards to this one.
whatsapp-web = [
"dep:whatsapp-rust",
"dep:whatsapp-rust-tokio-transport",
"dep:whatsapp-rust-ureq-http-client",
"dep:wacore",
]
[dependencies]
# The transport-free vocabulary shared with every TinyChannels host. The
# provider stack below is the implementation of that contract; a host that
# only names channel types depends on the bus crate alone.
# Pure path, no version requirement: neither crate is published, so a
# version here would only ever be used by a `cargo publish` that cannot
# happen, while still needing to be bumped in lockstep by every release.
tinychannels-bus = { path = "crates/tinychannels-bus" }
tinychannels-runtime = { path = "crates/tinychannels-runtime" }
anyhow = "1"
async-trait = "0.1"
base64 = "0.23"
chrono = { version = "0.4", features = ["serde"] }
directories = "6"
futures = "0.3"
futures-util = { version = "0.3", default-features = false, features = ["sink", "std"] }
hex = "0.4"
hmac = "0.13"
parking_lot = "0.12"
prost = { version = "0.14", optional = true }
rand = "0.10"
reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "rustls-tls", "stream"] }
rusqlite = { version = "0.40", features = ["bundled"] }
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "logging", "tls12"] }
rustls-pki-types = "1.14.0"
schemars = { version = "1", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sha1 = "0.11"
sha2 = "0.11"
thiserror = "2"
tokio = { version = "1", default-features = false, features = ["fs", "io-util", "macros", "net", "process", "rt", "sync", "time"] }
tokio-rustls = { version = "0.26.4", default-features = false, features = ["ring", "logging", "tls12"] }
tokio-tungstenite = { version = "0.29", default-features = false, features = ["connect", "rustls-tls-webpki-roots"] }
tracing = "0.1"
url = "2"
urlencoding = "2.1"
uuid = { version = "1", features = ["v4"] }
webpki-roots = "1.0.6"
# Email channel (SMTP + IMAP).
async-imap = { version = "0.11", default-features = false, features = ["runtime-tokio"], optional = true }
lettre = { version = "0.11.22", default-features = false, features = ["builder", "smtp-transport", "rustls-tls", "tokio1-rustls-tls"], optional = true }
mail-parser = { version = "0.11.2", optional = true }
# Lark/Feishu webhook (HTTP receive mode).
axum = { version = "0.8", default-features = false, features = ["http1", "json", "tokio", "query", "ws", "macros"], optional = true }
# WhatsApp Web provider (behind the `whatsapp-web` feature).
serde-big-array = { version = "0.5", optional = true }
whatsapp-rust = { version = "0.7", optional = true, default-features = false, features = ["tokio-runtime"] }
whatsapp-rust-tokio-transport = { version = "0.7", optional = true, default-features = false }
whatsapp-rust-ureq-http-client = { version = "0.7", optional = true }
wacore = { version = "0.7", optional = true, default-features = false }
[dev-dependencies]
# Dual-declared: the optional dependency above belongs to the `lark` provider,
# but `providers/discord/api_tests.rs` spins an axum mock server to test the
# Discord REST client — unrelated to Lark, and it must build with `lark` off.
axum = { version = "0.8", default-features = false, features = ["http1", "json", "tokio", "query", "ws", "macros"] }
tempfile = "3"
toml = "1"
wiremock = "0.6"