Plugins & Split-Slice Applications
Bark supports optional runtime plugins and encrypted post-login code slices so your application can ship a lightweight pre-login shell and unlock sensitive logic only after user authentication.
Built-In Stigma Speech Recognition Plugin
Enable local Whisper speech recognition across both desktop and browser builds with a single Makefile variable:
BARK_APP_NAME := myapp
BARK_APP_ID := 7100
BARK_PLUGINS := stigma
include ttypt/bark.mk
In your browser index.html, pass data-stigma-parts (or stigma: { partsUrl }) to /bark/runtime/boot.js:
<div id="bud-root"></div>
<script type="module"
src="https://tty.pt/bark/runtime/boot.js"
data-config="/api/bark-config"
data-stigma-parts="/models/parts.json"
data-title="My App"></script>
Bark automatically loads the speech-recognition runtime, wires microphone and remote audio handles, and tears them down cleanly on session expiry or logout.
Encrypted Post-Login Split Slices
Keep your login screen in the base package (BARK_APP_ID) and move all post-login domain logic into an encrypted secondary slice (BARK_SPLIT_SLICE):
BARK_SPLIT_SLICE := 7110:myapp_room:lib7:921
BARK_GATE_SRCS := core/runtime.c core/account.c ui/app.cx ui/gate.cx
BARK_SPLIT_SHARED_SRCS := core/crypto_gate.c
Define the slice interface entry point using <bark/slice.h>:
#include <bark/slice.h>
static void on_room_load(void) { /* initialize room API table */ }
static void on_room_unload(void) { /* wipe slice state */ }
BARK_SLICE_DEFINE(MYAPP_IFACE_ROOM, MYAPP_ROOM_ABI_VER,
&g_room_api, on_room_load, on_room_unload)
Before login, the browser and desktop shell receive only the base gate package. When authentication succeeds, bark_app_upgrade(ctx, user_token) upgrades the entitlement lease, decrypts and maps the secondary slice, and invokes your on_upgrade hook. Calling bark_app_logout(ctx) tears down active state and unloads the slice immediately.