WEFT_OS/crates/weft-runtime/wit/weft-app.wit
Marco Allegretti 4d0089a107 feat: appd IPC relay, WIT interfaces, UI kit, gesture routing, and CI hardening
- weft-appd: per-session IPC socket paths; bidirectional Wasm-HTML JSON relay
  via spawn_ipc_relay; SO_PEERCRED UID check on Unix socket connections;
  PanelGesture request and NavigationGesture broadcast for compositor gestures
- weft-runtime: weft:app/ipc, weft:app/fetch, weft:app/notifications WIT
  interfaces; IpcState non-blocking Unix socket host functions; ureq-backed
  net:fetch host function (net-fetch feature); notify-send notifications host
- weft-file-portal: spawn a thread per accepted connection for concurrent access
- weft-app-shell: weft-system:// URL translation; WEFT UI Kit UserScript
  injection; resolve_weft_system_url helper
- weft-servo-shell: forward compositor navigation gestures to weft-appd
  WebSocket as PanelGesture; WEFT UI Kit UserScript injection
- infra/shell: weft-ui-kit.js with 11 custom elements (weft-button, weft-card,
  weft-dialog, weft-icon, weft-list, weft-list-item, weft-menu, weft-menu-item,
  weft-progress, weft-input, weft-label); system-ui.html handles
  NAVIGATION_GESTURE messages and dispatches weft:navigation-gesture CustomEvent
- infra/systemd: add missing env vars to weft-appd.service; correct
  servo-shell.service binary path and system-ui.html argument
- .github/workflows/ci.yml: exclude weft-servo-shell and weft-app-shell from
  cross-platform job; add them to linux-only job with libsystemd-dev dependency
2026-03-12 12:49:45 +01:00

52 lines
1.8 KiB
Text

package weft:app@0.1.0;
/// Host interface that a WEFT app component imports to signal lifecycle events.
interface notify {
/// Signal to the runtime that the application has finished initialising
/// and is ready to serve requests. The runtime forwards this signal to
/// the session supervisor (appd), which transitions the session to the
/// Running state.
ready: func();
}
/// Host interface for bidirectional IPC between the Wasm component and the
/// HTML front-end served by weft-app-shell. Messages are JSON strings.
interface ipc {
/// Send a payload to the HTML front-end. Returns an error string if the
/// channel is not connected or the write fails.
send: func(payload: string) -> result<_, string>;
/// Return the next pending payload from the HTML front-end, or none if
/// no message is currently available. Non-blocking.
recv: func() -> option<string>;
}
/// Host interface for outbound HTTP requests. Requires the net:fetch
/// capability to be declared in wapp.toml.
interface fetch {
record response {
status: u16,
content-type: string,
body: list<u8>,
}
/// Perform a synchronous HTTP request. method is GET, POST, etc.
/// headers is a list of (name, value) pairs. body is the request body.
fetch: func(
url: string,
method: string,
headers: list<tuple<string, string>>,
body: option<list<u8>>,
) -> result<response, string>;
}
/// Host interface for sending desktop notifications. Requires the
/// sys:notifications capability to be declared in wapp.toml.
interface notifications {
/// Send a desktop notification. icon is an optional XDG icon name.
notify: func(
title: string,
body: string,
icon: option<string>,
) -> result<_, string>;
}