Skip to main content

rskit/
lib.rs

1//! `rskit` — production Rust toolkit.
2//!
3//! This crate is a pure facade that re-exports `rskit-*` sub-crates from a
4//! single namespace. It contains no implementation logic.
5//!
6//! Always-on foundation crates:
7//!
8//! | Module | Extra crate |
9//! |--------|-------------|
10//! | `util` | `rskit-util` (domain-free foundation utilities) |
11//! | `errors` | `rskit-errors` (error types and result aliases) |
12//! | `fs` | `rskit-fs` (local filesystem primitives) |
13//! | `config` | `rskit-config` (adapter-oriented config loading) |
14//! | `logging` | `rskit-logging` (`tracing` subscriber setup) |
15//! | `resilience` | `rskit-resilience` (retry, timeout, circuit breaker) |
16//! | `provider` | `rskit-provider` (provider traits and tower bridge) |
17//! | `pipeline` | `rskit-pipeline` (stream operators) |
18//! | `bootstrap` | `rskit-bootstrap` (app lifecycle orchestration) |
19//! | `component` | `rskit-component` (component lifecycle primitives) |
20//! | `worker` | `rskit-worker` (worker pools and typed events) |
21//! | `validation` | `rskit-validation` (field-level validation) |
22//!
23//! Optional feature flags control higher-level modules and adapters:
24//!
25//! | Feature | Extra crate |
26//! |---------|-------------|
27//! | `server` | `rskit-server` (service-facing server abstractions) |
28//! | `grpc`   | `rskit-grpc` (aligned gRPC client/server transport) |
29//! | `encryption` | `rskit-encryption` (encryption helpers) |
30//! | `http`   | `rskit-http` (framework-neutral HTTP abstractions) |
31//! | `httpclient` | `rskit-httpclient` (bounded HTTP client) |
32//! | `auth`   | `rskit-auth` (JWT, OIDC, password) |
33//! | `auth-jwt` | JWT support in `rskit-auth` |
34//! | `auth-oidc` | OIDC support in `rskit-auth` |
35//! | `di`     | `rskit-di` (dependency injection) |
36//! | `database` | `rskit-database` (core + memory backend) |
37//! | `cache`  | `rskit-cache` (core + memory adapter) |
38//! | `cache-fs` | Filesystem cache adapter in `rskit-cache` |
39//! | `cache-redis` | Redis cache adapter |
40//! | `messaging` | `rskit-messaging` (core abstractions + in-memory backend) |
41//! | `messaging-kafka` | `Kafka` messaging adapter |
42//! | `messaging-nats` | NATS messaging adapter |
43//! | `messaging-rabbitmq` | `RabbitMQ` messaging adapter |
44//! | `vectorstore` | `rskit-vectorstore` (core + memory backend) |
45//! | `vectorstore-qdrant` | Qdrant vector store adapter |
46//! | `observability` | `rskit-observability` (OpenTelemetry) |
47//! | `authz`  | `rskit-authz` (RBAC/ABAC) |
48//! | `security` | `rskit-security` (TLS/security configuration) |
49//! | `discovery` | `rskit-discovery` (service discovery) |
50//! | `sse`    | `rskit-sse` (Server-Sent Events) |
51//! | `dag`    | `rskit-dag` (DAG orchestration) |
52//! | `chain`  | `rskit-chain` (sequential execution) |
53//! | `process` | `rskit-process` (subprocess execution) |
54//! | `stateful` | `rskit-stateful` (stateful accumulators) |
55//! | `version` | `rskit-version` (build metadata) |
56//! | `schema` | `rskit-schema` (JSON Schema generation/validation) |
57//! | `hook` | `rskit-hook` (typed event hooks) |
58//! | `genai` | `rskit-ai` (shared `GenAI` vocabulary) |
59//! | `llm`    | `rskit-llm` (LLM providers) |
60//! | `llm-openai` | `OpenAI` LLM adapter |
61//! | `llm-anthropic` | `Anthropic` LLM adapter |
62//! | `llm-ollama` | `Ollama` LLM adapter |
63//! | `llm-gemini` | `Gemini` LLM adapter |
64//! | `embedding` | `rskit-embedding` (embedding abstractions) |
65//! | `inference` | `rskit-inference` (model-serving abstractions) |
66//! | `inference-triton` | Triton inference adapter |
67//! | `inference-vllm` | vLLM inference adapter |
68//! | `inference-tgi` | Hugging Face TGI inference adapter |
69//! | `prompt` | Prompt schema helpers from `rskit-ai` |
70//! | `skill` | `rskit-skill` (skill manifests and registries) |
71//! | `tool` | `rskit-tool` (tool contracts) |
72//! | `agent` | `rskit-agent` (agentic turn-loop engine) |
73//! | `mcp` | `rskit-mcp` (tool registry to Model Context Protocol bridge) |
74//! | `storage` | `rskit-storage` (File I/O, storage) |
75//! | `media`  | `rskit-media` (media types, pipeline) |
76//! | `media-ffmpeg` | `rskit-media-ffmpeg` (`FFmpeg` backend) |
77//! | `media-image`  | `rskit-media-image` (image processing) |
78//! | `media-audio`  | `rskit-media-audio` (pure Rust audio analysis) |
79//! | `media-full` | `FFmpeg` + image + audio backends |
80//! | `storage-s3` | `S3` storage backend |
81//! | `storage-gcs` | GCS storage backend |
82//! | `cli`    | `rskit-cli` (CLI helpers) |
83//! | `git`    | `rskit-git` (Git automation) |
84//! | `dataset` | `rskit-dataset` (dataset collection) |
85//! | `bench`  | `rskit-bench` (ML benchmarking) |
86//! | `full`   | all features |
87//!
88//! Test helpers live in `rskit-testutil` and should be added directly as a
89//! `dev-dependency`; they are intentionally not part of this production facade.
90//!
91//! # Quick start
92//!
93//! ```toml
94//! [dependencies]
95//! rskit-suite = { version = "0.1.0-alpha.1", features = ["full"] }
96//! ```
97
98#![warn(missing_docs)]
99
100// ── Always-on sub-crate facades ──────────────────────────────────────────────
101
102/// Decoupled, domain-free utilities (strings, collections, env, etc).
103pub use rskit_util as util;
104
105/// Error types, `ErrorCode`, `AppError`, `AppResult`.
106pub use rskit_errors as errors;
107
108/// Local filesystem primitives.
109pub use rskit_fs as fs;
110
111/// Adapter-oriented config loading.
112pub use rskit_config as config;
113
114/// `tracing` subscriber setup.
115pub use rskit_logging as logging;
116
117/// Retry, circuit breaker, bulkhead, rate limiter — and tower layers.
118pub use rskit_resilience as resilience;
119
120/// Provider traits + tower bridge.
121pub use rskit_provider as provider;
122
123/// `futures::Stream` extension trait + operators.
124pub use rskit_pipeline as pipeline;
125
126/// App lifecycle orchestration.
127pub use rskit_bootstrap as bootstrap;
128
129/// Component lifecycle primitives: `Component`, `Registry`, health, and state.
130pub use rskit_component as component;
131
132/// Worker pool, `Handler` trait, typed events.
133pub use rskit_worker as worker;
134
135/// Fluent field-level validation.
136pub use rskit_validation as validation;
137
138/// Sequential chain execution utilities.
139#[cfg(feature = "chain")]
140pub use rskit_chain as chain;
141
142/// Safe subprocess execution helpers.
143#[cfg(feature = "process")]
144pub use rskit_process as process;
145
146/// Stateful accumulators and keyed managers.
147#[cfg(feature = "stateful")]
148pub use rskit_stateful as stateful;
149
150/// Build-time version and git metadata.
151#[cfg(feature = "version")]
152pub use rskit_version as version;
153
154/// JSON Schema generation and validation helpers.
155#[cfg(feature = "schema")]
156pub use rskit_schema as schema;
157
158/// Typed event hook registry and event bus primitives.
159#[cfg(feature = "hook")]
160pub use rskit_hook as hook;
161
162// ── Feature-gated sub-crate facades ──────────────────────────────────────────
163
164/// Service-facing server abstractions and lifecycle-managed transports.
165#[cfg(feature = "server")]
166pub use rskit_server as server;
167
168/// Aligned gRPC transport namespace (opt-in via `grpc` feature).
169#[cfg(feature = "grpc")]
170pub use rskit_grpc as grpc;
171
172/// Encryption helpers (opt-in via `encryption` feature).
173#[cfg(feature = "encryption")]
174pub use rskit_encryption as encryption;
175
176/// Framework-neutral HTTP abstractions and Tower adapters.
177#[cfg(feature = "http")]
178pub use rskit_http as http;
179
180/// Async HTTP client with auth, retries, and error handling.
181#[cfg(feature = "httpclient")]
182pub use rskit_httpclient as httpclient;
183
184/// JWT, OIDC, password hashing, and request-context auth helpers.
185#[cfg(feature = "auth")]
186pub use rskit_auth as auth;
187
188/// Lightweight runtime dependency injection container.
189#[cfg(feature = "di")]
190pub use rskit_di as di;
191
192/// Database contracts with in-memory default and adapter registry.
193#[cfg(feature = "database")]
194pub use rskit_database as database;
195
196/// Cache contracts with in-memory default and adapter registry.
197#[cfg(feature = "cache")]
198pub use rskit_cache as cache;
199
200/// Redis cache adapter.
201#[cfg(feature = "cache-redis")]
202pub use rskit_cache_redis as cache_redis;
203
204/// Message broker abstractions and in-memory backend.
205#[cfg(feature = "messaging")]
206pub use rskit_messaging as messaging;
207
208/// Kafka messaging adapter.
209#[cfg(feature = "messaging-kafka")]
210pub use rskit_messaging_kafka as messaging_kafka;
211
212/// NATS messaging adapter.
213#[cfg(feature = "messaging-nats")]
214pub use rskit_messaging_nats as messaging_nats;
215
216/// `RabbitMQ` messaging adapter.
217#[cfg(feature = "messaging-rabbitmq")]
218pub use rskit_messaging_rabbitmq as messaging_rabbitmq;
219
220/// OpenTelemetry tracing, metrics, and context propagation.
221#[cfg(feature = "observability")]
222pub use rskit_observability as observability;
223
224/// RBAC and ABAC authorization engine.
225#[cfg(feature = "authz")]
226pub use rskit_authz as authz;
227
228/// Shared TLS and security configuration.
229#[cfg(feature = "security")]
230pub use rskit_security as security;
231
232/// Service discovery with load balancing strategies.
233#[cfg(feature = "discovery")]
234pub use rskit_discovery as discovery;
235
236/// Server-Sent Events bus with axum integration.
237#[cfg(feature = "sse")]
238pub use rskit_sse as sse;
239
240/// DAG task orchestrator with parallel execution.
241#[cfg(feature = "dag")]
242pub use rskit_dag as dag;
243
244/// Shared `GenAI` vocabulary.
245#[cfg(feature = "genai")]
246pub use rskit_ai as genai;
247
248/// LLM provider abstractions and shared chat/completion contracts.
249#[cfg(feature = "llm")]
250pub use rskit_llm as llm;
251
252/// `OpenAI` LLM adapter.
253#[cfg(feature = "llm-openai")]
254pub use rskit_llm_openai as llm_openai;
255
256/// Anthropic LLM adapter.
257#[cfg(feature = "llm-anthropic")]
258pub use rskit_llm_anthropic as llm_anthropic;
259
260/// Ollama LLM adapter.
261#[cfg(feature = "llm-ollama")]
262pub use rskit_llm_ollama as llm_ollama;
263
264/// Gemini LLM adapter.
265#[cfg(feature = "llm-gemini")]
266pub use rskit_llm_gemini as llm_gemini;
267
268/// Embedding provider abstractions and types.
269#[cfg(feature = "embedding")]
270pub use rskit_embedding as embedding;
271
272/// Model-serving runtime inference abstractions.
273#[cfg(feature = "inference")]
274pub use rskit_inference as inference;
275
276/// Triton `KServe` v2 HTTP inference adapter.
277#[cfg(feature = "inference-triton")]
278pub use rskit_inference_triton as inference_triton;
279
280/// vLLM REST inference adapter.
281#[cfg(feature = "inference-vllm")]
282pub use rskit_inference_vllm as inference_vllm;
283
284/// Hugging Face TGI REST inference adapter.
285#[cfg(feature = "inference-tgi")]
286pub use rskit_inference_tgi as inference_tgi;
287
288/// Prompt templates and output schema contracts.
289#[cfg(feature = "prompt")]
290pub use rskit_ai::prompt;
291
292/// Skill manifests, loaders, registries, and verification contracts.
293#[cfg(feature = "skill")]
294pub use rskit_skill as skill;
295
296/// Tool schemas, callable contracts, and metadata wrappers.
297#[cfg(feature = "tool")]
298pub use rskit_tool as tool;
299
300/// Agentic loop orchestration over providers, tools, and hooks.
301#[cfg(feature = "agent")]
302pub use rskit_agent as agent;
303
304/// Bridge between the rskit tool registry and Model Context Protocol.
305#[cfg(feature = "mcp")]
306pub use rskit_mcp as mcp;
307
308/// File I/O, storage backends, MIME detection, temp files.
309#[cfg(feature = "storage")]
310pub use rskit_storage as storage;
311
312/// Amazon S3 and S3-compatible (`MinIO`, `LocalStack`) storage backend.
313#[cfg(feature = "storage-s3")]
314pub use rskit_storage_s3 as storage_s3;
315
316/// Google Cloud Storage backend.
317#[cfg(feature = "storage-gcs")]
318pub use rskit_storage_gcs as storage_gcs;
319
320/// Vector store contracts with in-memory default and adapter registry.
321#[cfg(feature = "vectorstore")]
322pub use rskit_vectorstore as vectorstore;
323
324/// Qdrant vector store adapter.
325#[cfg(feature = "vectorstore-qdrant")]
326pub use rskit_vectorstore_qdrant as vectorstore_qdrant;
327
328/// Media types, codec/format registry, pipeline builder.
329#[cfg(feature = "media")]
330pub use rskit_media as media;
331
332/// `FFmpeg` CLI backend for video/audio processing.
333#[cfg(feature = "media-ffmpeg")]
334pub use rskit_media_ffmpeg as media_ffmpeg;
335
336/// Native image processing backend using the `image` crate.
337#[cfg(feature = "media-image")]
338pub use rskit_media_image as media_image;
339
340/// Pure Rust audio analysis backend.
341#[cfg(feature = "media-audio")]
342pub use rskit_media_audio as media_audio;
343
344/// CLI helpers: progress bars, cancellation tokens, output formatting.
345#[cfg(feature = "cli")]
346pub use rskit_cli as cli;
347
348/// Git operations: repository management, commits, branches, tags, diffs.
349#[cfg(feature = "git")]
350pub use rskit_git as git;
351
352/// Dataset collection: sources, transforms, targets, manifest caching.
353#[cfg(feature = "dataset")]
354pub use rskit_dataset as dataset;
355
356/// ML benchmarking: evaluators, metrics, reports, visualization.
357#[cfg(feature = "bench")]
358pub use rskit_bench as bench;
359
360// ── Convenience re-exports at root ──────────────────────────────────────────
361
362pub use rskit_bootstrap::{App, AppBuilder};
363pub use rskit_component::{
364    Component, Health, HealthStatus, LazyComponent, Registry, RegistryConfig, State, StopResult,
365};
366pub use rskit_config::{AppConfig, ConfigLoader, ServiceConfig};
367pub use rskit_errors::{AppError, AppResult, ErrorCode};
368pub use rskit_logging::{LoggingGuard, init_logging, init_logging_env};
369pub use rskit_provider::traits::{Provider, RequestResponse, Sink};
370pub use rskit_resilience::{CircuitBreaker, RateLimiter, RetryPolicy};
371pub use rskit_worker::{Handler, Pool, PoolConfig, TaskHandle};