Skip to main content

lean_rs_worker_parent/
lib.rs

1//! Parent-side supervisor for the `lean-rs` worker process boundary.
2//!
3//! [`LeanWorker`] is the public process-boundary supervisor. It hides child
4//! spawning, pipe management, protocol framing, child exit parsing, and
5//! cleanup behind a small lifecycle API. Sessions, capability builders, and
6//! the local worker pool sit on top of it. The wire types it speaks come
7//! from [`lean_rs_worker_protocol`] and are re-exported on this crate's
8//! public surface so callers do not need a second crate dependency for the
9//! common path.
10//!
11//! This crate does not link `libleanshared`. The worker child runtime that
12//! does is published separately as [`lean-rs-worker-child`](https://docs.rs/lean-rs-worker-child).
13
14mod capability;
15mod planning;
16mod pool;
17mod session;
18mod supervisor;
19
20pub use capability::{
21    LeanWorkerBootstrapCheck, LeanWorkerBootstrapDiagnosticCode, LeanWorkerBootstrapReport,
22    LeanWorkerBootstrapSeverity, LeanWorkerCapability, LeanWorkerCapabilityBuilder, LeanWorkerChild,
23    LeanWorkerHostHandle, LeanWorkerHostHandleBuilder,
24};
25pub use planning::{
26    LeanWorkerBatchFingerprint, LeanWorkerImportPlanConfig, LeanWorkerImportPlanError, LeanWorkerImportPlanner,
27    LeanWorkerModuleWork, LeanWorkerPlanMetadataExpectation, LeanWorkerPlannedBatch,
28};
29pub use pool::{
30    LeanWorkerPool, LeanWorkerPoolConfig, LeanWorkerPoolSnapshot, LeanWorkerRestartPolicyClass, LeanWorkerSessionKey,
31    LeanWorkerSessionLease,
32};
33pub use session::{
34    LeanWorkerCancellationToken, LeanWorkerDataRow, LeanWorkerDataSink, LeanWorkerDiagnosticEvent,
35    LeanWorkerDiagnosticSink, LeanWorkerJsonCommand, LeanWorkerProgressEvent, LeanWorkerProgressSink,
36    LeanWorkerRuntimeMetadata, LeanWorkerSession, LeanWorkerSessionConfig, LeanWorkerStreamSummary,
37    LeanWorkerStreamingCommand, LeanWorkerTypedDataRow, LeanWorkerTypedDataSink, LeanWorkerTypedStreamSummary,
38};
39pub use supervisor::{
40    LEAN_WORKER_REQUEST_TIMEOUT_DEFAULT, LEAN_WORKER_REQUEST_TIMEOUT_LONG_RUNNING, LeanWorker, LeanWorkerConfig,
41    LeanWorkerError, LeanWorkerExit, LeanWorkerRestartPolicy, LeanWorkerRestartReason, LeanWorkerStats,
42    LeanWorkerStatus,
43};
44
45// Curated re-exports of the wire types that appear on this crate's public
46// API. Callers can depend on `lean-rs-worker-parent` alone for the common
47// path; `lean-rs-worker-protocol` remains independently consumable for peers
48// that drive the wire format (alternative transports, fuzz harnesses,
49// recorders).
50#[doc(inline)]
51pub use lean_rs_worker_protocol::types::{
52    LeanWorkerCapabilityFact, LeanWorkerCapabilityMetadata, LeanWorkerCommandMetadata, LeanWorkerDeclarationFilter,
53    LeanWorkerDeclarationRow, LeanWorkerDiagnostic, LeanWorkerDoctorDiagnostic, LeanWorkerDoctorReport,
54    LeanWorkerDoctorSeverity, LeanWorkerElabFailure, LeanWorkerElabOptions, LeanWorkerElabResult,
55    LeanWorkerGoalAtResult, LeanWorkerKernelResult, LeanWorkerKernelStatus, LeanWorkerKernelSummary,
56    LeanWorkerMetaResult, LeanWorkerMetaTransparency, LeanWorkerModuleQuery, LeanWorkerModuleQueryOutcome,
57    LeanWorkerModuleQueryResult, LeanWorkerModuleSourceSpan, LeanWorkerNameRef, LeanWorkerReferencesResult,
58    LeanWorkerRendered, LeanWorkerRenderedInfo, LeanWorkerRendering, LeanWorkerSourceRange, LeanWorkerTypeAtResult,
59};