Modules and capabilities·/docs/effects-and-offline

Effects, device plugins, and native SDKs

Pure state transitions never perform I/O directly. Instead, reducers return typed EffectReq commands executed by the host, and receive correlated EffectResp events back into the state machine.

First-party plugin packages

These packages expose typed Lean APIs. Query the host's capabilities before offering a feature such as camera capture, biometrics or on-device inference. Availability depends on the target and device.

Plugin package
Capability ID
Capabilities
lakeport-plugin-transport
dev.lakeport.transport
HTTP/1.1 & HTTP/2, SSE streams, WebSockets, binary & multipart FormData, upload/download progress, cookie jars
lakeport-plugin-storage
dev.lakeport.storage
OS Keychain / Android Keystore secure credentials, local SQLite databases, typed file & key-value persistence
lakeport-plugin-media-device
dev.lakeport.media-device
Camera capture, audio/video playback, 2D canvas, and embedded WebView adapters
lakeport-plugin-device-platform
dev.lakeport.device-platform
Runtime permissions, biometrics, geolocation, haptics, native share sheets, deep links, and push/local notifications
lakeport-plugin-on-device-ai
dev.lakeport.on-device-ai
Typed host bridge for local on-device inference

Declarative native SDK dependencies

Plugins and apps declare native third-party SDKs, permissions, and entitlements in lakeport.json (schema lakeport.native-deps/2):

•
Android (Maven/AAR): Set android.resolver to "gradle" to resolve the dependency graph with Gradle. The built-in resolver also handles basic Maven POMs. Lakeport stages the artifacts and merges Android manifests.
•
iOS & macOS (SwiftPM & XCFramework): Set ios.resolver or macos.resolver to "swiftpm" to resolve dependencies with SwiftPM. Lakeport pins resolved revisions, selects XCFramework slices, stages resources and merges Apple metadata.
•
Linux & Windows: Resolves pkg-config system libraries and stages SHA-256-verified bundled .so and .dll files.
•
Reproducible lockfile (lakeport.native.lock): Pins every resolved native artifact by SHA-256 and verifies digests during lakeport build.

Offline outbox & pure-Lean JSON/XML

packages/lakeport-effects/src/LakeportEffects/Outbox.lean models durable client send queues keyed by (channelId, clientMsgId):

•
Outbox.enqueue guarantees no duplicate key enters the queue.
•
markReqUnknown marks timed-out requests as unknownOutcome so retries reuse the same idempotency key rather than assuming failure meant the server saw nothing.

Pair Outbox with lakeport-json and lakeport-xml pure-Lean parsers and exhaustive schema unions (see ) to keep network boundaries strictly typed.