Common API
fcommon provides the small shared primitives used across all Fiddlesticks crates.
It intentionally stays minimal so higher layers can share identifiers, metadata, and async signatures without taking on heavy dependencies.
What lives here
SessionId: strongly-typed session identifierTraceId: strongly-typed trace identifierMetadataMap:HashMap<String, String>for portable metadataBoxFuture<'a, T>: standard boxed async future aliasGenerationOptions: shared generation controls (temperature,max_tokens,stream)Registry<K, V>: small generic map-backed registry helper
Add dependency
[]
= { = "../fcommon" }
API usage
IDs and metadata
use ;
let session_id = from;
let trace_id = new;
let mut metadata = new;
metadata.insert;
assert_eq!;
assert_eq!;
Shared async contract
use BoxFuture;
Shared generation options
use GenerationOptions;
let options = default
.with_temperature
.with_max_tokens
.enable_streaming;
assert!;
Design notes
- Keep this crate stable and dependency-light.
- Put cross-cutting primitives here only when multiple crates need them.
- Avoid domain logic in
fcommon; domain behavior belongs in higher layers.