ff-sdk 0.11.0

FlowFabric worker SDK — public API for worker authors
Documentation
[package]
name = "ff-sdk"
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true
description = "FlowFabric worker SDK — public API for worker authors"

[features]
# Default feature set — existing consumers observe zero change.
#
# `valkey-default` pulls in the ferriskey-dependent SDK modules
# (`task`, `worker`, `snapshot`, `admin`,
# `engine_error::enrich_dependency_conflict`) + ff-sdk's direct
# optional `ferriskey` dep + the Valkey-specific variants on
# `SdkError`. Turning this OFF (`--no-default-features`) disables the
# ferriskey-dependent SDK surface and removes ferriskey from ff-sdk's
# direct optional deps — RFC-012 §1.3 agnosticism proof: ff-sdk
# compiles as a pure type/config facade over ff-core's
# `EngineBackend` trait without the Valkey transport surfacing.
#
# Issue #171: the `ff-script` ferriskey transitive edge is now also
# gated — `valkey-default` propagates `ff-script/valkey-client` so the
# default build is unchanged, and `--no-default-features` drops
# `ferriskey` from the transitive graph (ff-sdk → ff-script → ferriskey
# is fully optional).
default = ["valkey-default"]

direct-valkey-claim = ["valkey-default"]

# Re-exports of ferriskey feature flags. Consumers opt in on ff-sdk and
# the flag propagates to the underlying ferriskey crate. OFF by default
# — the ~40-crate AWS dep graph does not land in builds that don't need
# it.
iam = ["ferriskey/iam"]

# Pulls in the ferriskey transport + the SDK modules that depend on
# it. Left as an explicit feature (on by default) so
# `--no-default-features` builds can prove the agnosticism contract.
valkey-default = [
    "dep:ferriskey",
    "dep:ff-backend-valkey",
    # RFC-012 feature-gate discipline (#164): the valkey-default-gated
    # modules (`task`, `worker`, `snapshot`, `admin`) call streaming /
    # suspension / budget methods on `EngineBackend`, so those ff-core
    # features must be re-enabled in lockstep with this feature.
    "ff-core/streaming",
    "ff-core/suspension",
    "ff-core/budget",
    # Issue #171: propagate ff-script's ferriskey gate so the default
    # build still sees `ScriptError::Valkey`, the FCALL functions
    # modules, loader, retry, and engine_error_ext::valkey_kind.
    "ff-script/valkey-client",
]

# Client-local layer surface for `EngineBackend`
# (rfcs/drafts/RFC-draft-tower-layer-surface.md). Each built-in layer
# is opt-in; `default = []` for this surface so no hidden cost for
# consumers that do not wrap their backend. Each feature pulls the
# minimal deps its layer needs (no cross-feature implication). See
# `crates/ff-sdk/src/layer/*.rs` for per-layer docs.
layer-tracing = ["dep:async-trait"]
layer-ratelimit = ["dep:async-trait", "dep:governor"]
layer-metrics = ["dep:async-trait"]
layer-circuit-breaker = ["dep:async-trait"]

[dependencies]
# RFC-012 feature-gate discipline (#164, completes #158): default-features
# disabled so ff-sdk's `--no-default-features` build does NOT activate
# ff-core's `streaming` / `suspension` / `budget` gates (which in
# future tranches will add trait methods + types requiring the Valkey
# backend). The `valkey-default` feature re-enables them below for the
# default build.
ff-core = { version = "0.11.0", path = "../ff-core", default-features = false, features = ["core"] }
# Issue #171: ff-script's defaults are empty — the `valkey-client`
# feature (which owns the `ferriskey` dep edge) is activated below by
# the `valkey-default` feature, NOT here. This keeps
# `ff-sdk --no-default-features` free of ferriskey.
ff-script = { workspace = true }
# RFC-012 Stage 1b — ff-sdk's `ClaimedTask` forwards 9 of 12 ops
# through the `EngineBackend` trait. The legacy
# `FlowFabricWorker::connect` path still dials Valkey itself; it
# wraps its own client in a `ValkeyBackend` (via
# `from_client_and_partitions`) so `ClaimedTask` has a backend to
# forward through. Gated on `valkey-default` so the agnosticism
# build (`--no-default-features`) stays backend-free.
ff-backend-valkey = { workspace = true, optional = true }
ferriskey = { workspace = true, optional = true }
tokio = { workspace = true }
tracing = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
# HTTP client for the admin REST surface (FlowFabricAdminClient).
# default-features disabled to drop the native-tls backend; rustls is
# what every other HTTP consumer in this workspace uses (ff-test,
# examples/media-pipeline, examples/coding-agent).
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }

# Optional layer-surface deps (RFC-draft-tower-layer-surface.md).
# Feature-gated so consumers paying the `default = []` path for the
# layer features see zero compile-cost.
async-trait = { workspace = true, optional = true }
governor = { version = "0.7", default-features = false, optional = true, features = ["std"] }

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt", "time"] }