#![forbid(unsafe_code)]
#![warn(missing_docs)]
extern crate self as elicitation;
mod client;
mod communicator;
mod mcp_wrapper; mod server;
mod collections;
mod complete;
mod containers;
mod default_style;
mod error;
pub mod type_spec;
pub mod verification;
pub mod type_graph;
pub mod prompt_tree;
pub use prompt_tree::{
AssembledPrompt, ElicitPromptTree, PromptKind, PromptTree, collect_assembled_prompts,
};
#[cfg(feature = "cli")]
pub mod cli;
pub mod contracts;
pub mod emit_code;
pub mod kani_compose;
pub mod mcp;
mod paradigm;
mod primitives;
mod proxy;
pub mod style;
pub mod tool;
mod tool_registry;
mod verified_workflow;
#[macro_use]
mod router_macro;
#[macro_use]
mod newtype_macro;
#[macro_use]
mod newtype_methods_macro;
#[macro_use]
mod select_trenchcoat_macro;
mod traits;
mod elicit_json;
pub use elicit_json::ElicitJson;
pub mod plugin;
mod plugin_registry;
pub use plugin::{
DescriptorPlugin, ElicitPlugin, NoContext, PluginContext, PluginToolRegistration,
StatefulPlugin, ToolDescriptor, make_descriptor, make_descriptor_ctx,
};
pub use plugin_registry::{PluginRegistry, Toolchain};
pub mod dynamic;
pub use dynamic::{
AnyToolFactory, AnyToolSlot, ContextualFactory, DynamicToolDescriptor, DynamicToolRegistry,
ToolFactoryRegistration, TypedSlot,
};
#[cfg(feature = "serde_json")]
mod value_impl;
#[cfg(any(feature = "chrono", feature = "time", feature = "jiff"))]
mod datetime_common;
#[cfg(feature = "chrono")]
pub mod datetime_chrono;
#[cfg(feature = "time")]
pub mod datetime_time;
#[cfg(feature = "jiff")]
pub mod datetime_jiff;
#[cfg(feature = "rand")]
pub mod rand_rng;
mod elicitation_style;
pub use error::{ElicitError, ElicitErrorKind, ElicitResult, JsonError, RmcpError, ServiceError};
pub use verification::types::ValidationError;
pub use client::ElicitClient;
pub use communicator::{ElicitCommunicator, ElicitationContext, StyleContext};
pub use mcp_wrapper::ElicitToolOutput;
pub use server::ElicitServer;
pub use elicitation_style::StyleMarker;
#[cfg(not(creusot))]
pub use traits::{
ElicitBuilder, ElicitIntrospect, Elicitation, ElicitationPattern, Generator, PatternDetails,
Prompt, TypeMetadata, VariantMetadata,
};
#[cfg(creusot)]
pub use traits::{
ElicitIntrospect, Elicitation, ElicitationPattern, Generator, PatternDetails, Prompt,
TypeMetadata, VariantMetadata,
};
#[cfg(feature = "graph")]
pub use type_graph::{
DotRenderer, GraphEdge, GraphNode, GraphRenderer, MermaidDirection, MermaidRenderer, NodeKind,
TypeGraph, TypeGraphError, TypeGraphPlugin,
};
pub use type_graph::{TypeGraphKey, all_graphable_types, lookup_type_graph};
pub use type_spec::{
ElicitSpec, SpecCategory, SpecCategoryBuilder, SpecEntry, SpecEntryBuilder, TypeSpec,
TypeSpecBuilder, TypeSpecInventoryKey, lookup_type_spec, lookup_type_spec_by_id,
type_spec_plugin::TypeSpecPlugin,
};
pub use contracts::{
And, Established, FormalMethod, Implies, InVariant, Is, KaniVariantConstruction,
KaniVariantState, Prop, ProvableFrom, Refines, VerifiedStateMachine, VerifiedTransition, both,
downcast, fst, snd,
};
#[cfg(kani)]
pub use kani_compose::KaniCompose;
pub use complete::ElicitComplete;
pub use verified_workflow::VerifiedWorkflow;
pub use tool::{Tool, True, both_tools, then};
pub use tool_registry::{ElicitToolDescriptor, collect_all_elicit_tools};
pub use paradigm::{Affirm, Authorize, FieldInfo, Filter, Select, Survey};
pub use proxy::ElicitProxy;
pub use collections::ChoiceSet;
pub use rmcp;
#[doc(hidden)]
pub use futures;
#[doc(hidden)]
pub use serde_json;
#[doc(hidden)]
pub use paste;
#[doc(hidden)]
pub use inventory;
#[doc(hidden)]
pub use async_trait;
#[doc(hidden)]
pub use proc_macro2;
#[doc(hidden)]
pub use quote;
pub use elicitation_derive::{Elicit, ElicitPlugin, elicit_tool, formal_method};
pub use elicitation_derive::Prop;
pub use elicitation_derive::VerifiedStateMachine;
pub use elicitation_derive::KaniVariantState;
pub use elicitation_derive::KaniCompose;
pub use elicitation_derive::ToCodeLiteral;
pub use verification::Contract;
#[cfg(kani)]
pub use verification::kani::kani_vec;
pub use verification::types::{
ArcNonNull,
ArcSatisfies,
ArrayAllSatisfy,
BTreeMapNonEmpty,
BTreeSetNonEmpty,
BoolFalse,
BoolTrue,
BoxNonNull,
BoxSatisfies,
CharAlphabetic,
CharAlphanumeric,
CharNumeric,
DurationNonZero,
DurationPositive,
F32Finite,
F32NonNegative,
F32Positive,
F64Finite,
F64NonNegative,
F64Positive,
HashMapNonEmpty,
HashSetNonEmpty,
I8NonNegative,
I8NonZero,
I8NonZeroStyle,
I8Positive,
I8Range,
I8RangeStyle,
I16NonNegative,
I16NonZero,
I16NonZeroStyle,
I16Positive,
I16Range,
I16RangeStyle,
I32NonNegative,
I32NonZero,
I32Positive,
I32Range,
I32RangeStyle,
I64NonNegative,
I64NonZero,
I64Positive,
I64Range,
I64RangeStyle,
I128NonNegative,
I128NonZero,
I128Positive,
I128Range,
I128RangeStyle,
IpPrivate,
IpPublic,
IpV4,
IpV6,
Ipv4Loopback,
Ipv6Loopback,
IsizeNonNegative,
IsizeNonZero,
IsizePositive,
IsizeRange,
IsizeRangeStyle,
LinkedListNonEmpty,
OptionSome,
PathBufExists,
PathBufIsDir,
PathBufIsFile,
PathBufReadable,
RcNonNull,
RcSatisfies,
ResultOk,
StringNonEmpty,
Tuple2,
Tuple3,
Tuple4,
U8NonZero,
U8Positive,
U8Range,
U8RangeStyle,
U16NonZero,
U16Positive,
U16Range,
U16RangeStyle,
U32NonZero,
U32Positive,
U32Range,
U32RangeStyle,
U64NonZero,
U64Positive,
U64Range,
U64RangeStyle,
U128NonZero,
U128Positive,
U128Range,
U128RangeStyle,
UsizeNonZero,
UsizePositive,
UsizeRange,
UsizeRangeStyle,
VecAllSatisfy,
VecDequeNonEmpty,
VecNonEmpty,
};
#[cfg(feature = "uuid")]
pub use verification::types::{UuidNonNil, UuidV4};
#[cfg(feature = "uuid")]
pub use primitives::uuid::{UuidGenerationMode, UuidGenerator};
pub use primitives::systemtime::{SystemTimeGenerationMode, SystemTimeGenerator};
pub use primitives::duration::{DurationGenerationMode, DurationGenerator};
pub use primitives::StringStyle;
pub use primitives::unit_structs::{Formatter, Parser, Validator};
pub use primitives::errors::{IoErrorGenerationMode, IoErrorGenerator};
#[cfg(feature = "serde_json")]
pub use primitives::errors::{JsonErrorGenerationMode, JsonErrorGenerator};
#[cfg(feature = "chrono")]
pub use datetime_chrono::{
DateTimeUtcGenerationMode, DateTimeUtcGenerator, NaiveDateTimeGenerationMode,
NaiveDateTimeGenerator,
};
#[cfg(feature = "time")]
pub use datetime_time::{
InstantGenerationMode, InstantGenerator, OffsetDateTimeGenerationMode, OffsetDateTimeGenerator,
};
#[cfg(feature = "jiff")]
pub use datetime_jiff::{TimestampGenerationMode, TimestampGenerator};
#[cfg(feature = "chrono")]
pub use verification::types::{DateTimeUtcAfter, DateTimeUtcBefore, NaiveDateTimeAfter};
#[cfg(feature = "time")]
pub use verification::types::{OffsetDateTimeAfter, OffsetDateTimeBefore};
#[cfg(feature = "jiff")]
pub use verification::types::{TimestampAfter, TimestampBefore};
#[cfg(feature = "serde_json")]
pub use verification::types::{ValueArray, ValueNonNull, ValueObject};
#[cfg(feature = "url")]
pub use verification::types::{UrlCanBeBase, UrlHttp, UrlHttps, UrlValid, UrlWithHost};
#[cfg(feature = "regex")]
pub use verification::types::{
RegexCaseInsensitive, RegexMultiline, RegexSetNonEmpty, RegexSetValid, RegexValid,
};
pub use verification::mechanisms::{
AffirmReturnsBoolean, InputNonEmpty, MechanismWithType, NumericReturnsValid,
SurveyReturnsValidVariant, TextReturnsNonEmpty, TextReturnsString,
};
#[cfg(feature = "reqwest")]
pub use primitives::http::{
ClientStyle, HeaderMapStyle, MethodStyle, RequestBuilderStyle, ResponseStyle, StatusCodeStyle,
VersionStyle,
};
#[cfg(feature = "reqwest")]
pub use verification::types::StatusCodeValid;
#[cfg(feature = "clap-types")]
pub use primitives::clap_types::{
ArgActionStyle, ArgGroupStyle, ArgStyle, ColorChoiceStyle, CommandStyle, ErrorKindStyle,
IdStyle, PossibleValueStyle, ValueHintStyle, ValueRangeStyle, ValueSourceStyle,
};
#[cfg(feature = "sqlx-types")]
pub use primitives::sqlx_types::{
AnyQueryResultStyle, AnyTypeInfoStyle, ColumnDescriptorStyle, ColumnEntryStyle, RowDataStyle,
};
#[cfg(feature = "sqlx-types")]
pub use primitives::sqlx_types::{
AnyTypeInfoKindStyle, ColumnValueStyle, DriverKindStyle, SqlTypeKindStyle, SqlxErrorKindStyle,
};
#[cfg(feature = "sqlx-types")]
pub use primitives::sqlx_types::{
ColumnDescriptor, ColumnEntry, ColumnValue, DriverKind, RowData, SqlTypeKind,
};
#[cfg(feature = "accesskit")]
pub use primitives::accesskit_types::{
ActionStyle, AriaCurrentStyle, AutoCompleteStyle, HasPopupStyle, InvalidStyle, ListStyleStyle,
LiveStyle, OrientationStyle, RoleStyle, ScrollHintStyle, ScrollUnitStyle, SortDirectionStyle,
TextAlignStyle, TextDecorationStyleStyle, TextDirectionStyle, ToggledStyle,
VerticalOffsetStyle,
};
#[cfg(feature = "egui-types")]
pub use primitives::egui_types::{
AlignSelect,
AlignStyle,
CursorIconSelect,
CursorIconStyle,
DirectionSelect,
DirectionStyle,
EguiColor32,
EguiColor32Style,
EguiCornerRadius,
EguiCornerRadiusStyle,
EguiFontId,
EguiFontIdStyle,
EguiMargin,
EguiMarginStyle,
EguiPos2,
EguiPos2Style,
EguiRect,
EguiRectStyle,
EguiShadow,
EguiShadowStyle,
EguiStroke,
EguiStrokeStyle,
EguiVec2,
EguiVec2Style,
FontFamilySelect,
FontFamilyStyle,
KeySelect,
KeyStyle,
OrderSelect,
OrderStyle,
PointerButtonSelect,
PointerButtonStyle,
TextStyleSelect,
TextStyleStyle,
TextWrapModeSelect,
TextWrapModeStyle,
TextureFilterSelect,
TextureFilterStyle,
TextureWrapModeSelect,
TextureWrapModeStyle,
ThemePreferenceSelect,
ThemePreferenceStyle,
ThemeSelect,
ThemeStyle,
TouchPhaseSelect,
TouchPhaseStyle,
UiKindSelect,
UiKindStyle,
WidgetTypeSelect,
WidgetTypeStyle,
};
#[cfg(feature = "ratatui")]
pub use primitives::ratatui_types::{
AlignmentSelect,
AlignmentStyle,
BorderTypeSelect,
BorderTypeStyle,
BordersSelect,
ColorSelect,
ColorStyle,
RatatuiDirectionSelect,
RatatuiDirectionStyle,
RatatuiMargin,
RatatuiMarginStyle,
RatatuiPadding,
RatatuiPaddingStyle,
RatatuiStyle,
RatatuiStyleStyle,
ScrollbarOrientationSelect,
};
#[cfg(feature = "geo-types")]
pub use primitives::geo_types::{
GeoCoord, GeoCoordStyle, GeoGeometry, GeoGeometryCollection, GeoGeometryCollectionStyle,
GeoGeometryStyle, GeoLine, GeoLineString, GeoLineStringStyle, GeoLineStyle, GeoMultiLineString,
GeoMultiLineStringStyle, GeoMultiPoint, GeoMultiPointStyle, GeoMultiPolygon,
GeoMultiPolygonStyle, GeoPoint, GeoPointStyle, GeoPolygon, GeoPolygonStyle, GeoRect,
GeoRectStyle, GeoTriangle, GeoTriangleStyle,
};
#[cfg(feature = "georaster-types")]
pub use primitives::georaster_types::{
GeoRasterCoordinateStyle, GeoRasterImageInfoStyle, GeoRasterRasterValueStyle,
TiffColorTypeStyle, TiffPhotometricInterpretationStyle, TiffPlanarConfigurationStyle,
};
#[cfg(feature = "proj-types")]
pub use primitives::proj_types::{ProjArea, ProjAreaStyle};
#[cfg(feature = "rstar-types")]
pub use primitives::rstar_types::{
RstarAabb, RstarAabbStyle, RstarLine, RstarLineStyle, RstarRectangle, RstarRectangleStyle,
};
#[cfg(feature = "geojson-types")]
pub use primitives::geojson_types::{
GeoJsonFeatureCollectionStyle, GeoJsonFeatureStyle, GeoJsonGeometryStyle,
GeoJsonGeometryValueStyle, GeoJsonIdStyle, GeoJsonStyle,
};
#[cfg(feature = "wkt-types")]
pub use primitives::wkt_types::{
WktCoord, WktCoordStyle, WktGeom, WktGeomStyle, WktGeometryCollection,
WktGeometryCollectionStyle, WktLineString, WktLineStringStyle, WktMultiLineString,
WktMultiLineStringStyle, WktMultiPoint, WktMultiPointStyle, WktMultiPolygon,
WktMultiPolygonStyle, WktPoint, WktPointStyle, WktPolygon, WktPolygonStyle, WktString,
WktStringStyle,
};
#[cfg(feature = "wkb-types")]
pub use primitives::wkb_types::{
WkbBytes, WkbBytesStyle, WkbDimension, WkbDimensionStyle, WkbEndianness, WkbEndiannessStyle,
WkbGeometryType, WkbGeometryTypeStyle, WkbWriteOptions, WkbWriteOptionsStyle,
};
#[cfg(feature = "winit-types")]
pub use primitives::winit_types::{
WinitCursorIconSelect, WinitElementStateSelect, WinitKeyCodeSelect, WinitLogicalPosition,
WinitLogicalSize, WinitMouseButtonSelect, WinitPhysicalSize, WinitThemeSelect,
WinitTouchPhaseSelect, WinitWindowAttributes, WinitWindowLevelSelect,
};
#[cfg(feature = "wgpu-types")]
pub use primitives::wgpu_types::{
WgpuAddressMode, WgpuBackend, WgpuBlendFactor, WgpuBlendOperation, WgpuBufferUsages, WgpuColor,
WgpuColorWrites, WgpuCompareFunctionSelect, WgpuCompositeAlphaMode, WgpuExtent3d, WgpuFace,
WgpuFilterMode, WgpuFrontFace, WgpuIndexFormat, WgpuOrigin3d, WgpuPolygonMode,
WgpuPowerPreference, WgpuPresentMode, WgpuPrimitiveTopology, WgpuSamplerBorderColor,
WgpuShaderStages, WgpuStencilOperation, WgpuTextureDimension, WgpuTextureFormat,
WgpuTextureUsages, WgpuTextureViewDimension, WgpuVertexFormat, WgpuVertexStepMode,
};
#[cfg(feature = "egui-winit-types")]
pub use primitives::{EguiWinitDescriptor, EguiWinitRenderer, EguiWinitTheme};
#[cfg(feature = "geo")]
pub mod geo_algorithms;
#[cfg(feature = "geo")]
pub use geo_algorithms::*;
#[cfg(feature = "palette")]
pub use primitives::palette_types::{PaletteSrgb, PaletteSrgbStyle};
#[cfg(feature = "tower-types")]
pub use primitives::tower_types::{
TowerAndThenHandle, TowerAndThenLayer, TowerBalance, TowerBalanceHandle,
TowerBoxCloneServiceConfig, TowerBoxCloneServiceHandle, TowerBoxServiceConfig,
TowerBoxServiceHandle, TowerBufferHandle, TowerBufferLayer, TowerCatchPanicLayer, TowerClosed,
TowerCompressionLayer, TowerConcurrencyLimitHandle, TowerConcurrencyLimitLayer, TowerCorsLayer,
TowerDecompressionLayer, TowerElapsed, TowerExponentialBackoffMaker, TowerFilterHandle,
TowerFilterLayer, TowerHttpServiceHandle, TowerHttpTimeoutLayer, TowerLayerKind,
TowerLayerKindStyle, TowerLoadShedHandle, TowerLoadShedLayer, TowerMapErrHandle,
TowerMapErrLayer, TowerMapRequestHandle, TowerMapRequestLayer, TowerMapResponseHandle,
TowerMapResponseLayer, TowerMapResultHandle, TowerMapResultLayer, TowerNormalizePathLayer,
TowerOverloaded, TowerPeakEwma, TowerPeakEwmaHandle, TowerPendingRequests,
TowerPendingRequestsHandle, TowerPropagateHeaderLayer, TowerRate, TowerRateLimitHandle,
TowerRateLimitLayer, TowerRetryHandle, TowerRetryLayer, TowerServiceBuilder,
TowerServiceBuilderHandle, TowerServiceBuilderStyle, TowerServiceError,
TowerSetRequestHeaderLayer, TowerSetResponseHeaderLayer, TowerSetSensitiveRequestHeadersLayer,
TowerSetSensitiveResponseHeadersLayer, TowerSetStatusLayer, TowerSpawnReadyLayer, TowerSteer,
TowerSteerHandle, TowerThenHandle, TowerThenLayer, TowerTimeoutHandle, TowerTimeoutLayer,
TowerTpsBudget, TowerTraceLayer, TowerValidateRequestHeaderLayer,
};
#[cfg(feature = "axum-types")]
pub use primitives::axum_types::{
AxumDbSlot, AxumExtractorEntry, AxumExtractorKind, AxumHandlerDescriptor, AxumHttpMethod,
AxumResponseDescriptor, AxumResponseKind, AxumRouteEntry, AxumRouterDescriptor,
AxumServeDescriptor,
};
#[cfg(feature = "polars-types")]
pub use primitives::{
PolarsDType, PolarsJoinType, PolarsPipelineDescriptor, PolarsPipelineOp, PolarsPipelineStep,
};
#[cfg(feature = "uom-types")]
pub use primitives::{UomFormula, UomQuantityKind, UomStep, UomUnitSystem};
#[cfg(feature = "leptos-types")]
pub use primitives::{
LeptosAppDescriptor, LeptosAxumDescriptor, LeptosAxumMode, LeptosClientMode,
LeptosComponentDescriptor, LeptosCustomRouteDescriptor, LeptosDisplayMode, LeptosHtmlTag,
LeptosMode, LeptosPropDescriptor, LeptosResponseHeaderDescriptor, LeptosRouteDescriptor,
LeptosViewNode,
};
#[cfg(feature = "bevy-types")]
pub use primitives::bevy_types::{
affine::{BevyAffine2, BevyAffine3A, BevyDAffine2, BevyDAffine3},
animation::BevyRepeatAnimation,
atmosphere::{BevyAtmosphere, BevyFalloff, BevyPhaseFunction, BevyScatteringTerm},
audio::{BevyPlaybackMode, BevyPlaybackSettings, BevyVolume},
camera::{BevyOrthographicProjection, BevyPerspectiveProjection, BevyScalingMode},
color::BevyColor,
input::{
BevyButtonState, BevyGamepadAxis, BevyGamepadButton, BevyKeyCode, BevyMouseButton,
BevyTouchPhase,
},
mat::BevyMat3A,
pbr::{
BevyAmbientLight, BevyDirectionalLight, BevyPointLight, BevySpotLight, BevyStandardMaterial,
},
picking::{BevyPickable, BevyPickingInteraction},
quat::{BevyDQuat, BevyQuat},
ray::{BevyDir2, BevyDir3, BevyDir3A, BevyLine2d, BevyLine3d, BevyRay2d, BevyRay3d},
render_enums::{BevyAlphaMode, BevyTonemapping},
shapes::{
BevyAnnulus, BevyArc2d, BevyCircularSector, BevyCircularSegment, BevyCone,
BevyConicalFrustum, BevyCuboid, BevyCylinder, BevyEllipse, BevyPlane2d, BevyPlane3d,
BevyRectangle, BevyRegularPolygon, BevyRhombus, BevySegment2d, BevyTetrahedron, BevyTorus,
BevyTriangle2d,
},
sprite::{BevyAnchor, BevySpriteConfig, BevySpriteScalingMode},
text::{BevyFontSmoothing, BevyJustify, BevyLineBreak, BevyTextFont, BevyTextLayout},
time::BevyTimer,
transform::{BevyGlobalTransform, BevyTransform},
ui::{
BevyAlignContent, BevyAlignItems, BevyAlignSelf, BevyBorderRadius, BevyBoxSizing,
BevyDisplay, BevyFlexDirection, BevyFlexWrap, BevyJustifyContent, BevyJustifyItems,
BevyJustifySelf, BevyOverflowAxis, BevyOverflowClipBox, BevyPositionType, BevyUiRect,
BevyVal,
},
vec::BevyVec3A,
window::{
BevyMonitorSelection, BevyPresentMode, BevyWindowLevel, BevyWindowMode,
BevyWindowResolution, BevyWindowTheme,
},
};
#[cfg(all(feature = "bevy-types", not(feature = "wgpu-types")))]
pub use primitives::bevy_types::render_enums::{BevyFace, BevyFrontFace, BevyPrimitiveTopology};
#[cfg(feature = "redb-types")]
pub use primitives::redb_types::{
CacheStats as RedbCacheStats, DatabaseStats as RedbDatabaseStats, Durability as RedbDurability,
TableStats as RedbTableStats, TypeName as RedbTypeName,
};
#[cfg(feature = "csv-types")]
pub use primitives::csv_types::{
CsvByteRecord, CsvErrorKind, CsvPosition, CsvQuoteStyle, CsvStringRecord, CsvTerminator,
CsvTrim,
};
#[cfg(feature = "toml-types")]
pub use primitives::toml_types::{
TomlDate, TomlDatetime, TomlDeError, TomlOffset, TomlSerError, TomlTime, TomlValue,
};