117 Commits

Author SHA1 Message Date
Harrison @ Movenis
ad2302694d web: keep the Transfers button visible while idle (#118)
Co-authored-by: harrisonk0 <238985628+harrisonk0@users.noreply.github.com>
2026-11-30 23:46:14 +01:00
Pooya Parsa
3ef745b6d1 web: add a Kubernetes app: k3s in the Debian guest, running a single-node cluster with an nginx sample or joining one; apps can need a number of CPUs (the app needs 2: the SMP kernel) 2026-11-30 14:25:37 +01:00
pi0x
d7b538a7a3 sdk: name virgl.wasm in the web entry so that bundlers emit it: Vite and Rolldown copied virgl.mjs as an asset without the virgl.wasm it loads next to itself, so createKernel({ gl }) failed on the guest's first GL use; the entry hands the URL to the module (locateFile), and gl.wasm does the same for a gl.module of your own (#108)
Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-11-30 11:17:04 +01:00
Pooya Parsa
6f3b27b94d web: add a Camera app (Media): the camera's H.264 decoded on VA-API in an mpv window (low-latency, untimed, sized to the desktop; 720, 1080 and raw options), and mic.sh, the microphone as a waveform with a level meter; apps can need the camera (?cam=0 disables the tile) 2026-11-29 23:29:45 +00:00
Pooya Parsa
fef3d85844 web: do not report the browser's ResizeObserver loop notice as a page error (a Wayland app's new size resizing its window raised it as a toast, or a fatal error during boot) 2026-11-29 22:11:14 +00:00
Pooya Parsa
6bde669dbd Let the guest's Chromium decode video on VA-API: the Chromium app installs libva (libva2, libva-drm2), which chromium loads but does not depend on, and /etc/chromium.d/kw-wayland names guest GL's render node with --hardware-video-device-path where libva's DRM backend is installed 2026-11-29 21:31:20 +00:00
Pooya Parsa
e8f60af86a web: redesign the top bar's right side as applets, each a status item with its own panel that opens on hover or click: CPU, Memory, Disk, Network (with Tailscale, a mode row and a sketch of the traffic's path), Ports, Display (the theme and the GPU), Sound and media (with a live microphone and camera indicator), Bluetooth, Serial, USB and Transfers (with the clipboard); bigger spacing, icons on a plate over the wallpaper, glassy popovers, and a Kernel log that opens at its bottom 2026-11-29 19:27:49 +00:00
Pooya Parsa
d8e442a641 Keep the page's data disk in OPFS in worker mode: OpfsDisk (8 MiB extent files), the SDK's backend option for the data disk, a one-way migration from IndexedDB, a storage quota block and a free Disk size in Settings, and a question in a second tab instead of an in-memory copy 2026-11-29 17:37:06 +00:00
Pooya Parsa
c76f9d239d guest: add kwhotplug, which opens hot-plugged USB device nodes to the image's user, and drop the page's own chmod 2026-11-29 16:20:21 +00:00
Pooya Parsa
495fe30a91 Add guest USB on WebUSB: kwusb (a USB host controller whose transfers the host serves, with usbfs and the FTDI, CP210x, CH341 and PL2303 serial drivers), the SDK's usb option and vm.usb with a fake test device, and a USB devices section in the page's Settings 2026-11-29 15:43:56 +00:00
Pooya Parsa
42b91da2a8 Add guest Bluetooth on Web Bluetooth: kwbt (an HCI transport, hci0 while a controller is attached), the SDK's bluetooth option and vm.bluetooth with an emulated LE controller, Bluetooth and Serial ports sections in the page's Settings with Terminal buttons, and the Bluetooth and Serial Monitor launcher apps 2026-11-29 15:22:20 +00:00
Pooya Parsa
ab334389af Add guest serial ports on Web Serial: kwserial (/dev/ttyACM0..3), the SDK's serial option and vm.serial, Connect in the page's Settings and from a toast, and the Thonny and GTKTerm launcher apps 2026-11-29 13:31:16 +00:00
Pooya Parsa
ed872875f2 Fetch a distro image's warm set only once the guest reads in it, and leave apt's srcpkgcache.bin out of Debian's 2026-11-29 12:29:20 +00:00
Pooya Parsa
a9c8aef517 js: add Tailscale exit nodes, and rework the page's Tailscale settings
With net.tailscale.exitNode (--tailscale-exit-node, setExitNode() at run
time) a tailnet device that offers 0.0.0.0/0 takes all the guest's other
IPv4 traffic and its DNS in place of the backend; while it is not usable
that traffic is refused. WireGuard's source check is now the longest
prefix across peers. The page lists the tailnet's devices, picks the
exit node from a select box in Settings and the top bar panel, and shows
a set-up node's status and live controls apart from the setup form. The
README gains a section on joining a tailnet.
2026-11-29 11:16:22 +00:00
Pooya Parsa
4b713a5aed Merge branch 'main' into tailscale 2026-11-29 10:24:54 +00:00
Pooya Parsa
1b229902b2 Add a guest microphone and camera: kwsnd capture, kwcam (V4L2, raw and host-encoded H.264), and camera frames named to the kwva encoder
Microphone: kwsnd gains a capture substream fed by the host (SDK option
soundIn, the page's Microphone setting and ?mic=0, the CLI's
--sound-in-wav and --sound-in).

Camera: kwcam is a V4L2 capture device (/dev/video0) fed by the host: I420,
NV12 and YUYV at 320x240 to 1280x720, and H.264 encoded by the host's
WebCodecs encoder where it has one, with bitrate, GOP and key frame
controls (SDK option camera, the page's Camera setting and ?cam=0, the
CLI's --camera). The base's rc writes the udev database entry of
/dev/video*, so programs that list cameras through libudev find it.

kwva (protocol 5): an encode whose input surface is a camera buffer's
dma-buf names the frame to the host instead of sending its pixels, and
pixels an app writes into an exported surface reach the host (put).
2026-11-29 10:23:01 +00:00
Pooya Parsa
b9db51200e web: drop window errors from scripts not of the page's origin (a browser's wallet or an extension), which could fail the boot 2026-11-28 22:31:25 +00:00
Pooya Parsa
d382f7fa9b js: add a pure-JS Tailscale network device (work in progress)
The guest joins a tailnet from Node or the page: ts2021 control over
WebSocket, DERP relays, WireGuard and the packet filter in JS, loaded as
a separate chunk only when the option is used. SDK net option, CLI
--tailscale* flags and a page panel. Relay only; exit nodes, IPv6 and
real peer traffic are not covered yet.
2026-11-28 22:06:18 +00:00
Pooya Parsa
df6d726178 web: build the docs origin when it is used, not at module load, which ran before docs.ts set DOCS_URL (circular import) 2026-11-28 21:41:54 +00:00
Adam H
0c92b2370c web: Light / Dark / Auto theme (#53)
* web: add a terminal colour theme option (Auto, Dark, Light)

* web: add an option to turn off the Terminal window's see-through glass

* web: default the terminal colours to Auto

* web: add a page colour theme option (Auto, Dark, Light)

* web: give the chrome's materials in style.css a light variant

* web: give the components' chrome classes a light variant

* web: follow the theme in the charts, the alerts' caution badge and the Docs window

* web: fix the light theme's Dock glyphs, Resume card veil and Browser toolbar hover

* web: read the shown theme from the store and type the option field names

* web: darken the light theme's faint and error colours to 4.5:1 on tints

* web: give the light terminal mid-tone colours that read under black text

* web: lighten the light terminal's green, yellow and cyan for black text on them

* web: use the dark terminal's green in the light terminal

* web: give the light terminal's green, yellow and cyan 4.5:1 on white, as its red, blue and magenta

* web: give the light theme a white status bar on iOS

* web: make the Docs window opaque

* web: post a theme change to the Docs window instead of reloading it

* docs: upgrade undocs nightly, for the Docs window's theme messages

---------

Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-11-28 22:34:15 +01:00
pi0x
fd557430f1 web: take the page's default Wisp servers from KW_WISP at build time (#73)
The project's Wisp server accepts only the page's own origins, so a page
built and served elsewhere had no network unless every load named a
server with ?wisp=. KW_WISP=<url>[,<url>...] sets the default list
instead (vite.config.ts defines __KW_WISP__, net.ts makes it
DEFAULT_WISP_SERVERS); a relative URL such as /wisp/ is on the page's own
origin, over ws: or wss:. ?wisp= still overrides it, the Network option's
note says whose server the default is, and without KW_WISP the page is
unchanged.

Co-authored-by: Pooya Parsa <pooya@pi0.io>
Co-authored-by: Swaroop Patil <swarooppatil850@gmail.com>
2026-11-28 21:36:02 +01:00
Pooya Parsa
d4f31f8494 web: add a FilmCraft app to the launcher's Media folder: the video editor's aarch64 AppImage, fetched by the page from the mirror's copy of the GitHub release and extracted once, on guest Vulkan 2026-11-28 19:23:52 +00:00
chungchihhan
6a6a0e396c Enable Docker IPv4 bridge networking in Debian guests (#59)
* Enable Docker IPv4 bridge networking in Debian guests

* kernel: leave out the netfilter and bridge defaults Docker does not use

NETFILTER_INGRESS and NETFILTER_EGRESS (hooks for nft's netdev family,
which is not built), NF_CT_PROTO_SCTP and BRIDGE_IGMP_SNOOPING come on
by default with the options the Docker bridge needs; turning them off
saves 78,289 bytes of vmlinux32.wasm (25,917 bytes gzip). Re-export the
series: 0049, 0052 and 0055 carried index lines for the old
kw_defconfig.

* kernel: fix the conntrack hash size at 1024 buckets

Built-in conntrack allocates its hash table and the NAT bysource table,
which takes the same size, at boot also without rules, sized from RAM:
512 KiB each above 1 GiB, as on the page's 2 GiB default. A new generic
patch adds NF_CONNTRACK_HASHSIZE; kw_defconfig sets it to 1024, 8 KiB
per table, with nf_conntrack_max 8192. A 2 GiB guest keeps about 940 KiB
more free after boot.

---------

Co-authored-by: Pooya Parsa <pooya@pi0.io>
2026-11-28 20:04:04 +01:00
shi-wang
d6249de8de README: name the Wisp proxy the page uses by default (#60)
* README: name the Wisp proxy the page uses by default

The paragraph only said "a Wisp proxy", which leaves the reader to assume it
is their own. Name the default endpoint, say what it sees of a guest's
traffic, and keep the ?wisp= escape hatch in the same paragraph.

Refs #3

* Apply suggestion from @pi0

* Options: say whose Wisp server the default choice is

The Network section offered "Wisp" without saying that it is this project's
server and that the guest's traffic goes through it. One line under the choice
says both, next to the custom-servers field that replaces it.

---------

Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2026-11-28 19:35:54 +01:00
Pooya Parsa
d80c033106 net: drop the default Wisp server from the SDK
The SDK named the project's Wisp server (DEFAULT_WISP_SERVERS), and the
Node entry sent Origin: http://localhost to pass that server's allow
list (NODE_WISP_HEADERS). The server accepts only the page's origins,
so both are gone: wispBackend() takes the caller's server, and Node
sends handshake headers only when `headers` asks for them. The page
keeps wss://wisp.unkernel.dev:6680/ as its own default (web/src/net.ts).

The live Wisp test takes its server from UNKERNEL_TEST_WISP.
2026-11-27 22:24:02 +00:00
Pooya Parsa
287e41464f net: document Wisp's limits, add a lookup option, move to wisp.unkernel.dev
The README and the SDK docs now say what a guest sees over Wisp: no
half-close (a client that waits for the server to see end of file
hangs), placeholder addresses for every name, no connect
acknowledgement. wispBackend() takes a `lookup` resolver for real
addresses, and its fake address table now evicts the least recently
used name instead of wrapping. The default server is
wss://wisp.unkernel.dev:6680/.

The live Wisp test waited for its marker anywhere in the screen, so the
shell's echo of the command satisfied it; it now waits for the marker at
the start of a line.

Refs #44
2026-11-27 22:15:52 +00:00
Pooya Parsa
0d4be496af web: add llms.txt 2026-11-27 21:44:35 +00:00
Pooya Parsa
b9b962c3ca web: link the docs for agents 2026-11-27 21:37:40 +00:00
Pooya Parsa
fd78ca9ad0 docs: serve cross-origin isolated, so the page's Docs window embeds them in every browser 2026-11-27 21:34:12 +00:00
Pooya Parsa
b803bdd0a5 web: add docs app 2026-11-27 21:23:34 +00:00
Pooya Parsa
e86777e0c5 web: drop the release copy: a release is always loaded from the mirror
A release build (and a dev server without a local build) downloads only
the release's page.json; the copy in web/kernel/release/ with its checks,
the GL and Vulkan downloads and KW_MIRROR=0 are gone. A release without
page.json is refused with what to do.
2026-11-27 16:20:33 +00:00
Pooya Parsa
08af7d9fe2 web: load the kernels, renderers and distro images from the release mirror
A page build with a release that carries page.json downloads only that
and points the page at mirror.unkernel.dev's copy of the release assets
(CORS, Range, immutable); nothing is copied into the output. The release
workflow now also publishes a gzipped copy of every .wasm, which the SDK
gunzips when a body starts with gzip's magic (the mirror sends files as
they are).
2026-11-27 16:10:47 +00:00
Pooya Parsa
3b71fa5637 ci: publish assets as artifacts 2026-11-27 15:35:45 +00:00
Pooya Parsa
fd204d3130 web: add a Steam app to the Games folder: Valve's native aarch64 client (the Steam Frame's, unsupported elsewhere) as windows of the page through xwl.sh; steam.sh takes the client binary out of the package Valve's linuxarm64 manifest names (SHA-256 checked), makes the ~/.steam links, starts the client again after it updated itself or gave up on its first update, and runs the UI unpinned on fewer than three CPUs; the packages are what the client's binaries need; for games (x86) it puts a script in place of the FEX tool's emulator that leaves them to box64, and adds a compatibility tool that does the same (neither has run a game: box64 0.3.4's 32-bit mode lacks libc functions Steam's library needs) 2026-11-26 00:44:09 +00:00
Pooya Parsa
39cf306b5b guest, web: show X apps' windows as windows of the page through xwayland-satellite: the Debian image carries Fedora 43's aarch64 build (glibc 2.34 at most; pinned from Koji, taken out of the RPM by tools/rpmfile.py) with libxcb-cursor0 and libfontconfig1 (4.3 MiB more erofs, the same 4 MiB boot prefetch), and wland 0.1.0-261125-0023837 on both sides, whose relay holds X display :1 (:0 is the KMS Xorg's) and starts satellite for the first X client on its scale-1 socket, so X apps that know no DPI come out the right size on HiDPI; Wayland shells get DISPLAY from the relay where Xwayland is installed, and the relay runs with the distro's PATH; the Xwayland wrapper adds -shm without libEGL (rootless Xwayland's glamor aborted in libepoxy); the launcher's xwl.sh runs satellite by default (the image's, else Fedora's RPM fetched once), on the scale-1 socket where there is one, so X11, XPaint and the D3D12 demos are rootless and Xfce alone stays rootful (XWL_ROOTFUL) 2026-11-26 00:16:39 +00:00
Pooya Parsa
235955c313 web: fetch VLC through the page's mirror: the daily build's index and packages from /ppa and the libraries from /ports first, then the upstreams over plain http (Launchpad's https answers half of the requests with 503), with the index checked against the PPA's pinned signing key (sqv); a bundle's file can name a CORS mirror, which getFiles() tries before Wisp 2026-11-25 15:30:46 +00:00
Pooya Parsa
46eb0c8314 web: pin only Terminal and Settings in the Dock by default, on desktops and phones (the launcher's groups, glmark2 and Galculator are no longer pinned); the static first paint's Dock has the two in that order 2026-11-25 15:03:29 +00:00
Pooya Parsa
3f7bb3849b web: free the Mac's select all and Ctrl-A: on Apple devices the shortcut prefix is ⌘J (it was Ctrl-A and ⌘A), so ⌘A selects all and Ctrl-A always reaches the guest; Ctrl-C in a terminal there sends ^C also with text selected, and keys pressed with ⌘ in the Display window are released when ⌘ comes up (browsers send no keyup for them); elsewhere Ctrl-A in a text field of the page with text in it is select all 2026-11-25 14:28:57 +00:00
Pooya Parsa
9b4b9d0878 web: add Zed to the Tools folder: its own aarch64 build (1.29.3, 82 MiB, SHA-256 checked) fetched in the guest on first run and unpacked as zed.dev/install.sh does (GitHub sends no CORS headers; the page's mirror is asked first), started with --foreground on guest Vulkan, with Zed's own Open and Save As pickers in a new settings file (the guest has no desktop portal) 2026-11-25 14:11:34 +00:00
Pooya Parsa
c78039944a web: add VLC and mpv to the Media folder: VLC 4 (VideoLAN's daily build with its libraries from Ubuntu, unpacked under ~/.apps/vlc; the page fetches the libraries as an app's bundle, many files at once, pushed in batches) and mpv set up for guest VA-API (--vo=dmabuf-wayland, video-sync=desync, the builtin scripts off) 2026-11-25 13:09:11 +00:00
Pooya Parsa
1f0648d812 va: guest VA-API on the browser's WebCodecs (kwva): a libva driver in the base's kw layer sends each picture over vsock to a VideoDecoder or VideoEncoder on the page (createKernel({ va }), on by default on Debian, ?va=0); it decodes VP9, H.264, AV1 and HEVC (HEVC not yet run in a browser), encodes VP9, reads pictures back as exact NV12, exports surfaces as dmabufs of virtio-gpu resources and draws a decoded VideoFrame into a BGRX surface on the GPU (mpv --hwdec=vaapi --vo=dmabuf-wayland: 1080p H.264 at 30 fps on an M4 Pro) 2026-11-25 13:09:05 +00:00
Pooya Parsa
f6d7a4ee18 web: fx (local model) runs fx with FX_PERMISSION_MODE=full-access (no questions before tool calls; the caller's mode stays) and leaves a thinking model's reasoning on (THINK=0 turns it off) 2026-11-24 22:08:35 +00:00
Pooya Parsa
48f4732df5 web: Ollama and fx (local model) offer the registry's quantized tags (Qwen3 0.6B and 1.7B the defaults, no fp16 entries) and the llama.cpp, Ollama and fx apps drop the hints that quantized models abort 2026-11-24 21:21:48 +00:00
Pooya Parsa
5a4ba76d79 js: export the page's Web Audio sink as createAudioOut() from unkernel/web (#17)
web/src/audio.ts becomes js/web/audio.ts. It creates no AudioContext
before the page has had a gesture, holds the latest 10 s of what plays
until then (a clip that has ended plays whole, a stream joins live), and
has state, onChange, muted, resume() and close() for a page's control.
test/audio.test.ts runs the worklet and the sink without a browser.

Closes #17
2026-11-24 20:41:32 +00:00
Pooya Parsa
0f4029e7ae web: hide the Dock and darken the top bar while a window is maximized, and make the Dock a lower full-width bar in compact mode 2026-11-24 19:30:45 +00:00
Pooya Parsa
560dec5336 web: add a resource widget to the desktop, drop the meters' hover popover, and move the photo credit to the page's corner 2026-11-24 18:38:23 +00:00
Pooya Parsa
0da40f0a35 gl: let a WebGL error drop one call instead of putting the guest's context in error (#27)
virglrenderer builds with -Dcheck-gl-errors=false and patch 0019: a host GL error is logged and counted (stats.glErrors) and the context goes on; GL_OUT_OF_MEMORY stays fatal.
2026-11-24 18:12:50 +00:00
Pooya Parsa
b7479ee19b web: give apt's status lines their own descriptor in install.sh, so that package scripts keep their stdout (#26) 2026-11-24 17:19:49 +00:00
Pooya Parsa
951bb8e5dd kernel: let kwsnd periods go down to 2 ms, in a buffer of 10 ms or more (#22)
The shortest period and tick drop from 5 ms to 2 ms for programs that
ask for low latency. A buffer is 10 ms or more as before (two 5 ms
periods), and a late tick still hands over up to 15 ms' worth when ticks
are shorter than 5 ms, so a short period tolerates the same host stall.
Programs that leave the period to alsa-lib, plain aplay, OSS without
SETFRAGMENT and requests of 256 frames or more negotiate what they did;
snd_pcm_set_params() with a latency under 20 ms now gets four periods of
2.5 to 3.75 ms (measured on Node, 2026-11-24).

Co-authored-by: Adam Meghji <566793+adammeghji@users.noreply.github.com>
2026-11-24 16:25:03 +00:00
Pooya Parsa
e615c1a0bf vk: flush only the mapped ranges a submit can touch and signal fences at submit when nothing is read back (Qwen2.5 0.5B decode overhead 1588 to 41 ms per token without GPU work), a 4 GiB device-only heap apart from the host-visible one (KWVK_HEAP_MB) and maxMemoryAllocationSize from WebGPU's limits, uniform and push-constant blocks WGSL cannot lay out repacked as vec4<u32> words so Firefox and Safari take ggml's rope shaders, division by a constant zero rewritten, validation with WebGPU's capabilities only, the adapter in the device name with the words Ollama reads as Metal, CUDA or ROCm spelled apart (KWVK_DEVICE_NAME); web: Ollama and fx (local model) ask which model (SmolLM2 with a tool template, Qwen2.5 1.5B, Llama 3.2 1B, Qwen3.5 0.8B added), TEMP and THINK options (fx at temperature 0, thinking off), a free-space check before a model download, the server restarted when GPU discovery times out 2026-11-24 14:09:09 +00:00