[package]
name = "temporalio-common"
version = "0.1.0"
edition = "2024"
authors = ["Temporal Technologies Inc. <sdk@temporal.io>"]
license-file = { workspace = true }
description = "Common functionality for the Temporal SDK Core, Client, and Rust SDK"
homepage = "https://temporal.io/"
repository = "https://github.com/temporalio/sdk-core"
keywords = ["temporal", "workflow"]
categories = ["development-tools"]
exclude = ["protos/*/.github/*"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
history_builders = ["rand"]
otel = ["dep:opentelemetry", "dep:opentelemetry_sdk", "dep:opentelemetry-otlp"]
prometheus = [
  "dep:prometheus",
  "dep:hyper",
  "dep:hyper-util",
  "dep:http-body-util",
  "dep:tokio",
]
envconfig = ["dep:toml", "dep:dirs"]
serde_serialize = []
test-utilities = ["history_builders"]
core-based-sdk = [
  "otel",
  "prometheus",
  "envconfig",
  "dep:ringbuf",
  "dep:futures-channel",
]

[dependencies]
anyhow = "1.0"
async-trait = "0.1"
base64 = "0.22"
bon = { workspace = true }
crc32fast = "1"
dirs = { version = "6.0", optional = true }
derive_more = { workspace = true }
erased-serde = "0.4"
futures = "0.3"
futures-channel = { version = "0.3", default-features = false, features = [
  "std",
], optional = true }
http-body-util = { version = "0.1", optional = true }
hyper = { version = "1.7", optional = true }
hyper-util = { version = "0.1", features = [
  "server",
  "http1",
  "http2",
  "tokio",
], optional = true }
opentelemetry = { workspace = true, features = ["metrics"], optional = true }
opentelemetry_sdk = { version = "0.31", features = [
  "rt-tokio",
  "metrics",
  "spec_unstable_metrics_views",
], optional = true }
opentelemetry-otlp = { version = "0.31", features = [
  "tokio",
  "metrics",
  "tls",
  "http-proto",
  "grpc-tonic",
], optional = true }
parking_lot = { version = "0.12", features = ["send_guard"] }
prometheus = { version = "0.14", optional = true, default-features = false }
prost = { workspace = true }
prost-wkt = "0.7"
prost-types = { workspace = true }
rand = { version = "0.9", optional = true }
ringbuf = { version = "0.4", optional = true }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = { workspace = true }
tokio = { version = "1.47", features = [], optional = true }
toml = { version = "0.9", optional = true }
tonic = { workspace = true }
tonic-prost = { workspace = true }
tracing = "0.1"
# TODO [rust-sdk-branch]: Is it reasonable to make this optional?
tracing-subscriber = { version = "0.3", default-features = false, features = [
  "parking_lot",
  "env-filter",
  "registry",
  "ansi",
] }
tracing-core = "0.1"
url = "2.5"
uuid = { version = "1.18", features = ["v4"] }
pbjson = { workspace = true }
pbjson-types = { workspace = true }

[build-dependencies]
prost = { workspace = true }
prost-types = "0.14"
tonic-prost-build = { workspace = true }
pbjson-build = { workspace = true }

[lints]
workspace = true

[dev-dependencies]
futures-util = { version = "0.3", default-features = false }
tempfile = "3.21"
tokio = { version = "1.47", features = ["macros", "rt"] }
