1mod application;
7pub mod bridge;
8mod manifest;
9pub mod protocol;
10pub mod providers;
11mod runtime;
12#[cfg(feature = "sqlite")]
13mod sqlite_store;
14
15pub use application::{
16 AgentDefinition, AgentProvider, CancellationToken, EffectExecution, EndpointDefinition,
17 InvocationData, InvocationEvent, InvocationEventKind, InvocationHandle, InvocationInput,
18 InvocationOutput, InvocationPoll, InvocationStatus, InvocationTraceEvent, MemoryRuntimeStore,
19 ProviderEventSink, ProviderFuture, ProviderRequest, ProviderResponse, RuntimeError,
20 RuntimeSession, RuntimeStore, VifuRuntime,
21};
22pub use bridge::{
23 RuntimeBridge, RuntimeBridgeCancelParams, RuntimeBridgeError, RuntimeBridgeHelloParams,
24 RuntimeBridgeHelloPayload, RuntimeBridgeInvocationEvent, RuntimeBridgeInvokePayload,
25 RUNTIME_BRIDGE_CANCELLED_EVENT, RUNTIME_BRIDGE_CANCEL_METHOD, RUNTIME_BRIDGE_COMPLETED_EVENT,
26 RUNTIME_BRIDGE_FAILED_EVENT, RUNTIME_BRIDGE_HELLO_METHOD, RUNTIME_BRIDGE_INVOKE_METHOD,
27 RUNTIME_BRIDGE_OUTPUT_DELTA_EVENT, RUNTIME_BRIDGE_STARTED_EVENT,
28 VIFU_RUNTIME_BRIDGE_PROTOCOL_VERSION,
29};
30pub use manifest::{
31 LocalProviderBinding, ProviderRequirement, RuntimeManifest, RuntimeRelease, RuntimeTraceRecord,
32 RUNTIME_MANIFEST_SCHEMA_VERSION,
33};
34pub use protocol::{
35 decode_protocol_frame, encode_protocol_frame, ErrorShape, EventFrame, EventFrameType,
36 ProtocolFrame, RequestFrame, RequestFrameType, ResponseFrame, ResponseFrameType, StateVersion,
37 MAX_PROTOCOL_FRAME_BYTES,
38};
39pub use providers::{HttpCapabilityProvider, HttpCapabilityRoute};
40pub use runtime::{
41 EffectRequest, EffectRequestQueue, EffectResult, EffectResultQueue, HeadlessRuntime,
42 RuntimeAdvance, RuntimeCommand, RuntimeCommandQueue, RuntimeEvent, RuntimeEventQueue,
43 RuntimeSchedule, RuntimeSnapshot, RuntimeState, VifuRuntimePlugin,
44};
45#[cfg(feature = "sqlite")]
46pub use sqlite_store::SqliteRuntimeStore;
47
48pub(crate) fn unix_time_ms() -> u64 {
49 std::time::SystemTime::now()
50 .duration_since(std::time::UNIX_EPOCH)
51 .map_or(0, |duration| {
52 u64::try_from(duration.as_millis()).unwrap_or(u64::MAX)
53 })
54}
55
56pub mod prelude {
57 pub use bevy_app::{App, Plugin};
60 pub use bevy_ecs::prelude::*;
61 pub use serde_json::{json, Value};
62
63 pub use crate::{
64 AgentDefinition, AgentProvider, CancellationToken, EffectExecution, EffectRequest,
65 EffectRequestQueue, EffectResult, EffectResultQueue, EndpointDefinition, HeadlessRuntime,
66 HttpCapabilityProvider, HttpCapabilityRoute, InvocationData, InvocationEvent,
67 InvocationEventKind, InvocationHandle, InvocationInput, InvocationOutput, InvocationPoll,
68 InvocationStatus, InvocationTraceEvent, MemoryRuntimeStore, ProviderEventSink,
69 ProviderFuture, ProviderRequest, ProviderRequirement, ProviderResponse, RuntimeAdvance,
70 RuntimeBridge, RuntimeBridgeError, RuntimeCommand, RuntimeCommandQueue, RuntimeError,
71 RuntimeEvent, RuntimeEventQueue, RuntimeManifest, RuntimeRelease, RuntimeSchedule,
72 RuntimeSession, RuntimeSnapshot, RuntimeState, RuntimeStore, RuntimeTraceRecord,
73 VifuRuntime, VifuRuntimePlugin,
74 };
75}