cratefield-runtime-native 0.4.7

Native (tokio) runtime for the Cratefield harness: axum on a TcpListener, reqwest over rustls, Redis ports, in-process cron
Documentation
[package]
name = "cratefield-runtime-native"
description = "Native (tokio) runtime for the Cratefield harness: axum on a TcpListener, reqwest over rustls, Redis ports, in-process cron"
readme = "README.md"
keywords = ["cratefield", "tokio", "axum", "redis", "self-hosted"]
categories = ["web-programming"]
include = ["src/**/*", "README.md"]
version = "0.4.7"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true

[lints]
workspace = true

[features]
# `Native::push_from_env()` (issue #191): the twin of the Cloudflare
# runtime's, assembling the `Push` port from the process environment through
# the same `cratefield_push_wiring::build_push`. Off by default so a
# self-hosted venture that sends no notifications does not compile three push
# adapters.
push = ["dep:cratefield-push-wiring"]

[dependencies]
cratefield-core = { workspace = true }
# Verifies a caller's token against the issuer's key set (issue #153),
# assembled from the environment by `auth_from_env`.
cratefield-auth-client = { workspace = true }
cratefield-push-wiring = { workspace = true, optional = true }
async-trait = { workspace = true }
axum = { workspace = true, features = ["tokio", "http1"] }
http = { workspace = true }
bytes = { workspace = true }
futures-core = { workspace = true }
# `stream::unfold` behind the streamed response body (issue #859): the
# unfold state owns the `reqwest` response and the concurrency permit, and
# both drop with the body — the cancellation contract. wasm-safe, and
# already in every runtime's tree through core's `BoundedHttpClient`.
futures-util = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
time = { workspace = true }
tracing = { workspace = true }

# Native only (issue #19): tokio, reqwest, redis, the cron parser and the
# JSON log subscriber do not compile to wasm, so every dependency that is
# not provably wasm-safe is gated to non-wasm targets (the pattern
# `cratefield-adapter-postgres` uses) and `src/lib.rs` fails the crate fast
# with a clear message on any wasm target.
#
# - reqwest 0.12 (not 0.13): `rustls-tls` pins the ring provider +
#   webpki-roots — no OpenSSL, no aws-lc (0.13's rustls switched to
#   aws-lc-rs by default, which drags a C toolchain).
# - redis 1.x: `tokio-comp` async + `connection-manager` (reconnecting,
#   clone-able). TLS for Redis stays off: the compose example talks plain
#   TCP on the docker network.
# - croner 4: a pure parser (no scheduler of its own); its chrono
#   dependency arrives without the `clock` feature, so `Utc::now` is
#   unreachable through it — "now" always comes from the Clock port.
# - tracing-subscriber: `fmt` + `env-filter`; the built-in JSON formatter
#   cannot redact fields, so the crate ships a custom `FormatEvent`
#   (rules in cratefield-core) and does not need the `json` feature.
[target.'cfg(not(any(target_arch = "wasm32", target_arch = "wasm64")))'.dependencies]
tokio = { workspace = true, features = ["time", "net", "signal", "fs", "sync"] }
# `tokio_util::io::ReaderStream` turns a `tokio::fs::File` into the chunked
# body `Blob::get_stream` returns (issue #586) without buffering it whole.
# The `io` feature only; already in the workspace lockfile through redis.
tokio-util = { version = "0.7.19", features = ["io"] }
reqwest = { version = "0.12.28", default-features = false, features = [
    "rustls-tls",
] }
redis = { version = "1.7.0", default-features = false, features = [
    "tokio-comp",
    "connection-manager",
    "script",
] }
croner = { version = "4.0.0", default-features = false, features = [
    "chrono",
] }
# Types only, for converting the Clock port's reading into the datetime
# croner computes with. default-features = false => no `clock` feature =>
# chrono::Utc::now cannot even compile here (PR #50's lesson, applied
# structurally). Never enters a wasm graph: this section is native-gated.
chrono = { version = "0.4.42", default-features = false }
tracing-subscriber = { version = "0.3.23", default-features = false, features = [
    "fmt",
    "env-filter",
    "std",
] }

[dev-dependencies]
cratefield-adapter-sqlite = { path = "../adapter-sqlite" }
# End-to-end streamed text (issue #859): the real adapters behind a real
# route, over a mock upstream the tests bind on loopback. Path-only (never
# `workspace = true` — see the rule comment at the root `Cargo.toml`):
# `cargo publish` strips a path-only dev-dependency from the packaged
# manifest, the same way the `adapter-sqlite` one above travels.
cratefield-adapter-anthropic = { path = "../adapter-anthropic" }
cratefield-adapter-openai-compatible = { path = "../adapter-openai-compatible" }
# `full_fake_ports`, for proving `clone_ports` carries every port.
cratefield-testing = { path = "../testing" }
tokio = { workspace = true, features = ["test-util"] }
serde_json = { workspace = true }
http = { workspace = true }
bytes = { workspace = true }