[package]
name = "obelisk"
description = "Deterministic workflow engine"
readme = "README.md"

authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[dependencies]
concepts.workspace = true
db-sqlite.workspace = true
db-postgres.workspace = true
executor.workspace = true
grpc.workspace = true
utils.workspace = true
val-json.workspace = true
wasm-workers.workspace = true

anyhow.workspace = true
async-trait.workspace = true
axum-accept.workspace = true
axum.workspace = true
bytes.workspace = true
cfg-if.workspace = true
chrono.workspace = true
clap.workspace = true
config.workspace = true
const_format.workspace = true
derive_more.workspace = true
directories.workspace = true
docker_credential.workspace = true
futures-util.workspace = true
hashbrown.workspace = true
http.workspace = true
humantime_fmt.workspace = true
itertools.workspace = true
oci-client.workspace = true
oci-wasm.workspace = true
prost-wkt-types.workspace = true
prost.workspace = true
rand.workspace = true
schemars.workspace = true
serde_json.workspace = true
serde_with.workspace = true
serde.workspace = true
sha2.workspace = true
strum.workspace = true
thiserror.workspace = true
tokio-stream.workspace = true
tokio.workspace = true
toml.workspace = true
tonic = { workspace = true, default-features = true, features = [
    "zstd",
    "gzip",
    "tls-native-roots",
] }
tonic-prost.workspace = true
tonic-reflection.workspace = true
tonic-web.workspace = true
tower-http.workspace = true
tower.workspace = true
tracing-appender.workspace = true
tracing-subscriber.workspace = true
tracing.workspace = true
wasmtime.workspace = true

# Optional deps:

## otlp
opentelemetry = { workspace = true, optional = true }
opentelemetry_sdk = { workspace = true, optional = true }
opentelemetry-otlp = { workspace = true, optional = true }
opentelemetry-semantic-conventions = { workspace = true, optional = true }
tracing-opentelemetry.workspace = true

## tokio-console
console-subscriber = { workspace = true, optional = true }

[dev-dependencies]
rstest.workspace = true

[[bin]]
name = "obelisk"
path = "src/main.rs"

[features]
tokio-console = ["dep:console-subscriber"]
otlp = [
    "dep:opentelemetry",
    "dep:opentelemetry_sdk",
    "dep:opentelemetry-otlp",
    "dep:opentelemetry-semantic-conventions",
]
default = ["otlp"]

[lints]
workspace = true

[workspace]
resolver = "2"
members = [
    "crates/bench",
    "crates/testing/component-builder",
    "crates/concepts",
    "crates/db-mem",
    "crates/db-postgres",
    "crates/db-sqlite",
    "crates/executor",
    "crates/grpc",
    "crates/testing/db-tests",
    "crates/testing/db-macro",
    "crates/testing/test-programs/dir/activity",
    "crates/testing/test-programs/dir/activity/builder",
    "crates/testing/test-programs/fibo/activity",
    "crates/testing/test-programs/fibo/activity/builder",
    "crates/testing/test-programs/fibo/webhook",
    "crates/testing/test-programs/fibo/webhook/builder",
    "crates/testing/test-programs/fibo/workflow",
    "crates/testing/test-programs/fibo/workflow/builder",
    "crates/testing/test-programs/fibo/workflow-outer",
    "crates/testing/test-programs/fibo/workflow-outer/builder",
    "crates/testing/test-programs/http/activity",
    "crates/testing/test-programs/http/activity/builder",
    "crates/testing/test-programs/http/workflow",
    "crates/testing/test-programs/http/workflow/builder",
    "crates/testing/test-programs/process/activity",
    "crates/testing/test-programs/process/activity/builder",
    "crates/testing/test-programs/serde/activity",
    "crates/testing/test-programs/serde/activity/builder",
    "crates/testing/test-programs/serde/workflow",
    "crates/testing/test-programs/serde/workflow/builder",
    "crates/testing/test-programs/sleep/activity",
    "crates/testing/test-programs/sleep/activity/builder",
    "crates/testing/test-programs/sleep/webhook",
    "crates/testing/test-programs/sleep/webhook/builder",
    "crates/testing/test-programs/sleep/workflow",
    "crates/testing/test-programs/sleep/workflow/builder",
    "crates/testing/test-programs/stub/activity",
    "crates/testing/test-programs/stub/activity/builder",
    "crates/testing/test-programs/stub/workflow",
    "crates/testing/test-programs/stub/workflow/builder",
    "crates/testing/test-utils",
    "crates/utils",
    "crates/val-json",
    "crates/wasm-workers",
]

[workspace.package]
version = "0.32.1"
license = "AGPL-3.0-only"
repository = "https://github.com/obeli-sk/obelisk"
authors = ["Project Developers"]
edition = "2024"
rust-version = "1.91.0"

[workspace.dependencies]
concepts = { package = "obeli-sk-concepts", path = "crates/concepts", version = "0.32.1" }
db-mem = { path = "crates/db-mem" }
db-postgres = { package = "obeli-sk-db-postgres", path = "crates/db-postgres", version = "0.32.1" }
db-sqlite = { package = "obeli-sk-db-sqlite", path = "crates/db-sqlite", version = "0.32.1" }
db-tests = { package = "obeli-db-tests", path = "crates/testing/db-tests" }
executor = { package = "obeli-sk-executor", path = "crates/executor", version = "0.32.1" }
grpc = { package = "obeli-sk-grpc", path = "crates/grpc", version = "0.32.1" }
obelisk-component-builder = { path = "crates/testing/component-builder", features = [
    "genrs",
] }
test-db-macro = { path = "crates/testing/db-macro" }
test-programs-dir-activity-builder = { path = "crates/testing/test-programs/dir/activity/builder" }
test-programs-fibo-activity-builder = { path = "crates/testing/test-programs/fibo/activity/builder" }
test-programs-fibo-webhook-builder = { path = "crates/testing/test-programs/fibo/webhook/builder" }
test-programs-fibo-workflow-builder = { path = "crates/testing/test-programs/fibo/workflow/builder" }
test-programs-http-get-activity-builder = { path = "crates/testing/test-programs/http/activity/builder" }
test-programs-http-get-workflow-builder = { path = "crates/testing/test-programs/http/workflow/builder" }
test-programs-process-activity-builder = { path = "crates/testing/test-programs/process/activity/builder" }
test-programs-serde-activity-builder = { path = "crates/testing/test-programs/serde/activity/builder" }
test-programs-serde-workflow-builder = { path = "crates/testing/test-programs/serde/workflow/builder" }
test-programs-sleep-activity-builder = { path = "crates/testing/test-programs/sleep/activity/builder" }
test-programs-sleep-workflow-builder = { path = "crates/testing/test-programs/sleep/workflow/builder" }
test-programs-stub-activity-builder = { path = "crates/testing/test-programs/stub/activity/builder" }
test-programs-stub-workflow-builder = { path = "crates/testing/test-programs/stub/workflow/builder" }
test-utils = { path = "crates/testing/test-utils" }
utils = { package = "obeli-sk-utils", path = "crates/utils", version = "0.32.1" }
val-json = { package = "obeli-sk-val-json", path = "crates/val-json", version = "0.32.1" }
wasm-workers = { package = "obeli-sk-wasm-workers", path = "crates/wasm-workers", version = "0.32.1" }

anyhow = { version = "1.0", features = ["backtrace"] }
axum = { version = "0.8.8", features = ["http2"] }
axum-accept = "0.0.5"
directories = "6.0"
arbitrary = { version = "1.4.2", features = ["derive"] }
assert_matches = "1.5.0"
async-trait = "0.1"
bytes = "1.11"
cargo_metadata = "0.23"
cfg-if = "1.0.4"
chrono = { version = "0.4.42", features = ["arbitrary", "serde"] }
clap = { version = "4.5.53", features = ["derive"] }
config = { version = "0.15.19", default-features = false, features = [
    "toml",
    "preserve_order",
    "async",
    "convert-case",
] }
console-subscriber = "0.5.0"
const_format = "0.2.35"
criterion = "0.8"
crossterm = "0.29.0"
deadpool-postgres = "0.14.1"
derive_more = { version = "2.1.1", features = [
    "debug",
    "deref",
    "display",
    "from_str",
    "into",
] }
derive-where = "1.6.0"
divan = { version = "3.0.5", package = "codspeed-divan-compat" }
docker_credential = "1.3.2"
futures = { version = "0.3.31", default-features = false }
futures-concurrency = "7.6.3"
futures-util = "0.3.31"
fxhash = "0.2.1"
getrandom = "0.3"
hashbrown = { version = "0.16.1", features = ["serde"] }
hdrhistogram = "7.5.4"
http = "1.4.0"
http-body-util = "0.1"
humantime_fmt = { version = "0.1.0", features = ["with-chrono"] }
hyper = "1.8.1"
hyper-util = { version = "0.1", features = ["tokio"] }
id-arena = "2.2.1"
indexmap = { version = "2.12", features = ["serde"] }
insta = { version = "1.45.0", features = ["json"] }
itertools = "0.14"
lazy_static = "1.5"
libc = "0.2.178"
oci-client = { version = "0.15.0", default-features = false, features = [
    "rustls-tls",
] }
oci-wasm = { version = "0.3.0", default-features = false, features = [ # Dependent on matching oci-client
    "rustls-tls",
] }
tokio-postgres = { version = "0.7.15", features = ["with-chrono-0_4", "with-serde_json-1"] }
prost = "0.14.1"
prost-wkt-types = "0.7"
quote = "1"
rand = "0.9"
reqwest = { version = "0.12", default-features = false, features = [
    "json",
    "rustls-tls",
] }
route-recognizer = "0.3.1"
rstest = "0.26"
rusqlite = { version = "0.38.0", features = [
    "bundled",
    "chrono",
    "serde_json",
] }
schemars = "1.2.0"
semver = "1.0.27"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.147"
serde_with = "3.16.1"
sha2 = "0.10.9"
syn = { version = "2", features = ["full"] }
strum = { version = "0.27.2", features = ["derive"] }
tempfile = "3.24"
thiserror = "2.0"
tokio = { version = "1", features = [
    "fs",
    "io-util",
    "macros",
    "process",
    "rt-multi-thread",
    "rt",
    "signal",
    "sync",
    "time",
    "tracing",
] }
tokio-stream = "0.1.17"
toml = { version = "0.9.10", features = ["preserve_order"] }
tonic = { version = "0.14.2", default-features = false }
tonic-prost = "0.14.2"
tonic-reflection = "0.14.2"
tonic-prost-build = "0.14.2"
tonic-web = "0.14.2"
tower = "0.5.2"
tower-http = { version = "0.6.8", features = ["trace", "cors"] }
tracing = { version = "0.1", features = ["log"] }
tracing-appender = "0.2.4"
tracing-subscriber = { version = "0.3.22", features = ["env-filter", "json"] }
ulid = { version = "=1.1.4", features = ["serde"] }
url = "2.5.7"
wiremock = "0.6"

# wasmtime
wasmtime = { version = "40.0.0", features = ["memory-protection-keys"] }
wasmtime-wasi = "40.0.0"
wasmtime-wasi-io = "40.0.0"
wasmtime-wasi-http = "40.0.0"
wasmtime-environ = "40.0.0"
# wasm-tools
wast = "243.0.0"
wit-parser = "0.243.0"
wasmparser = "0.243.0"
wit-component = "0.243.0"

# testing components
wasip2 = "1.0.1"
wit-bindgen = "0.50.0"
wstd = "0.6.3"

# otlp
opentelemetry = "0.31.0"
opentelemetry-http = "0.31.0"
opentelemetry_sdk = { version = "0.31.0", features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.31.0", features = [
    "tls",
    "tls-roots",
    "grpc-tonic",
] }
opentelemetry-semantic-conventions = "0.31.0"
tracing-opentelemetry = "0.32"

[workspace.lints]
# lower the priority to allow overriding later
clippy.all = { level = "deny", priority = -1 }
# lower the priority to allow overriding later
clippy.dbg_macro = "deny"
# lower the priority to allow overriding later
clippy.pedantic = { level = "deny", priority = -1 }
# lower the priority to allow overriding later
clippy.explicit_deref_methods = "allow" # Lots of false positives.
# lower the priority to allow overriding later
clippy.missing_errors_doc = "allow" # Allow missing docs for now
# lower the priority to allow overriding later
clippy.missing_panics_doc = "allow" # Allow missing docs for now
# lower the priority to allow overriding later
clippy.trivially_copy_pass_by_ref = "allow" # Lots of false positives.
# lower the priority to allow overriding later
clippy.module_name_repetitions = "allow"
# Vec::from_iter is more readable than collect::<Vec<_>>
clippy.from_iter_instead_of_collect = "allow"
# Happy path should be first no matter the condition.
clippy.if_not_else = "allow"
# Keep paths surrounded with quotes
clippy.unnecessary_debug_formatting = "allow"
clippy.too_many_lines = "allow"
clippy.map_unwrap_or = "allow" # More readable than .map_or_else with reverse parameters.

[workspace.lints.rust]
unexpected_cfgs = "deny"
unknown_lints = "deny"

[profile.release]
overflow-checks = true
opt-level = "s"
codegen-units = 1
lto = "fat"
strip = "debuginfo"

[profile.release_wasm]
inherits = "release"
opt-level = "s"
debug = "line-tables-only"
strip = "none"

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/obelisk-{ target }.tar.gz"
pkg-fmt = "tgz"

[profile.dev]
debug = "line-tables-only"
