Skip to main content

node_app_api/
lib.rs

1//! Node-App API - Shared types and C ABI definitions
2//!
3//! This crate provides shared types used by:
4//! - The host backend (NodeAppManager, NativeLoader, BunLoader)
5//! - Native app SDKs (Rust, Go, C, Zig via C ABI)
6//! - Scripted app SDKs (TypeScript/JavaScript via IPC)
7
8pub mod context;
9pub mod ffi;
10pub mod types;
11
12// Re-exports for convenience
13pub use context::NodeAppContext;
14pub use ffi::{FfiResult, NodeAppEntryFn, NodeAppMetadata, NodeAppVTable, NODE_APP_ENTRY_SYMBOL};
15pub use types::{
16    AppEvent, AppRequest, AppResponse, Capabilities, CapabilityExample, CapabilityRequest,
17    CapabilityResponse, NodeAppInfo, ProvidedCapability,
18};
19
20/// API version for compatibility checking between host and native apps.
21/// Host and app must have matching API_VERSION to load successfully.
22pub const API_VERSION: u32 = 1;