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