Skip to main content

appcore_ui/
lib.rs

1// =============================================================================
2//        #######
3//     ###       ###     F: lib.rs
4//    ##   ## ##   ##    P: AppCore-Runtime
5//         ## ##
6//                       C: 2026/10/13 00:00:00 by dnettoRaw
7//    ##   ## ##   ##    U: 2026/10/13 00:00:00 by dnettoRaw
8//      ###########      S: 0.1.0-beta.1
9// =============================================================================
10
11//! Versioned, bounded UI boundaries; deployment owns hosting and authorization.
12#![deny(missing_docs)]
13#![deny(unsafe_code)]
14mod error;
15mod json_budget;
16mod limits;
17mod protocol;
18mod validation;
19/// Existing Runtime API request contracts, unchanged by the UI bridge.
20pub use appcore_api::{CommandRequest, QueryRequest};
21pub use error::{UiError, UiResult};
22pub use limits::UiLimits;
23pub use protocol::{UiActionV1, UiConnectionState, UiRequestV1, UI_PROTOCOL_V1};
24pub use validation::decode_ui_request_v1;
25
26mod backend;
27mod reply;
28mod subscriptions;
29mod surface;
30mod surface_state;
31/// Existing capability contracts and policy owner reused by the bridge.
32pub use appcore_capabilities as capabilities;
33/// Existing versioned manifest identity types.
34pub use appcore_contracts as contracts;
35/// Existing foundational Runtime identity and capability types.
36pub use appcore_core as core;
37pub use backend::{UiBackend, UiBackendFuture, UiCaller, UiCancellation, UiGrant, UiInvocationV1};
38pub use reply::{UiEventV1, UiOutcomeV1, UiReplyV1};
39pub use subscriptions::UiPublishReport;
40pub use surface::{UiSurface, UiSurfaceSnapshot, UiTopicBinding};
41
42mod runtime_dispatch;
43pub use runtime_dispatch::UiRuntimeDispatch;
44
45/// Function-based element construction, independent of platform rendering.
46pub mod elements;
47mod native_page;
48pub use native_page::{
49    UiNativeNodeV1, UiNativePage, UiNativePageV1, UiNativeValue, UiRectangle, UI_NATIVE_PAGE_V1,
50};
51
52#[cfg(all(feature = "native-macos", target_os = "macos"))]
53#[allow(unsafe_code)]
54mod macos_callbacks;
55#[cfg(all(feature = "native-macos", target_os = "macos"))]
56#[allow(unsafe_code)]
57mod macos_window;
58#[cfg(all(feature = "native-macos", target_os = "macos"))]
59pub use macos_window::{UiNativeActivation, UiNativeApplication, UiNativeWindow};
60
61mod web_bundle;
62pub use web_bundle::{UiWebAsset, UiWebBundle, UiWebMedia, UiWebResource};
63
64#[cfg(all(feature = "web-macos", target_os = "macos"))]
65#[allow(unsafe_code)]
66mod macos_web_handler;
67#[cfg(all(feature = "web-macos", target_os = "macos"))]
68#[allow(unsafe_code)]
69mod macos_web_window;
70#[cfg(all(feature = "web-macos", target_os = "macos"))]
71pub use macos_web_window::UiWebWindow;
72
73#[cfg(all(feature = "web-macos", target_os = "macos"))]
74#[allow(unsafe_code)]
75mod macos_web_bridge;
76
77#[cfg(all(feature = "native-macos", target_os = "macos"))]
78#[allow(unsafe_code)]
79mod macos_controls;
80
81#[cfg(any(test, all(feature = "native-macos", target_os = "macos")))]
82mod event_pump;
83
84#[cfg(all(feature = "web-macos", target_os = "macos"))]
85#[allow(unsafe_code)]
86mod macos_web_view;