Claude 46780c399b
CI / test (push) Failing after 20s
Restore the session on login: reopen the windows the last session ended with
- state.edn gets :session [{:app "foot"} {:app "org.gnome.Nautilus" :minimized true}]: the open
  windows by app id, in opening order, with whether each was minimized or maximized. Dialogs
  (xdg_toplevel.set_parent, now tracked by the Wayland server) are left out.
- Written at the end of a session (logout, or the display/window going away) and, against
  crashes, whenever the set of windows changes and then holds for 3 s; that delay also keeps a
  shutdown, where apps die a moment before the compositor, from saving an empty desktop.
- At start (both the native binary and the wasm compositor) each saved app is launched through
  its .desktop file: the app id is matched to the desktop file id, StartupWMClass (now parsed),
  case-insensitively, or by its last dotted part. Restored apps don't count as recent launches.
  A launched app stays in the session until its window shows up (30 s at most), and that window
  gets its minimized/maximized state back; placement is the existing layout mode and per-app
  floating geometry.
- --no-restore, or :restore-session false in state.edn, starts with an empty desktop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hjkHnYqipToGkWFC9P
2026-11-25 18:31:31 +00:00
2026-11-25 17:12:57 +00:00
2026-11-25 17:12:57 +00:00
2026-11-25 17:12:57 +00:00
2026-11-25 17:12:57 +00:00
2026-11-25 17:12:57 +00:00
2026-11-25 17:12:57 +00:00
2026-11-25 17:12:57 +00:00
2026-11-25 17:12:57 +00:00
2026-11-25 17:12:57 +00:00
2026-11-25 17:12:57 +00:00
2026-11-25 10:18:25 -08:00
2026-11-25 17:12:57 +00:00

chandra

A modular, KDE-Plasma-inspired desktop environment where every part is a WebAssembly component (Component Model, WIT interfaces) written in MoonBit, on top of a deliberately tiny trusted host.

launcher open

Headless-Chromium capture of the M0 browser host: the shell, the launcher and the clock are three separate MoonBit components.

Vision

Plasma's strength is its decomposition (shell, widgets, window manager, runner, settings modules, notifications, tray). chandra keeps that decomposition and makes each seam a typed WIT interface with deny-by-default capabilities:

  • the host only owns engine/lifecycle, devices, the capability broker and the render-list rasteriser;
  • everything else is a component: swap the clock for another implementation, swap the whole shell, change the theme, without rebuilding the rest;
  • components draw by returning a render-list (list<draw-op>), never pixels;
  • components can't touch anything their imports + the desktop config don't grant.

Read docs/ARCHITECTURE.md (Plasma→component mapping, host decision, rendering, input, permissions, versioning, roadmap M0–M8) and docs/TOOLCHAIN.md (what works today, exact versions).

Status: M0 (proof of concept)

Works today:

  • WIT package chandra:desktop@0.1.0 (wit/): worlds widget, clock-widget, launcher-widget, panel, shell.
  • Four MoonBit components, each an independently built .wasm component of 24–33 KB: clock-digital, clock-binary (drop-in replacement), launcher (kickoff-like with keyboard search), shell (desktop background + bottom panel layout + theme tokens).
  • Host (host/): Node + browser, jco-transpiled components, capability grants, popup/focus input routing, hot-swap, fault isolation, Canvas2D + ASCII renderers.
  • Tests: 16 MoonBit unit tests (pure logic), 13 host integration tests that instantiate the real components, WIT conformance (wasm-tools component targets), generated-bindings freshness check, wasmtime compile of every component.

Stubbed / not done (see ARCHITECTURE §10): no window manager/compositor, search runner, notifications, settings, tray, session, shortcuts, clipboard, files; launch only logs; host does input hit-testing; fixed-advance text metrics, no real fonts/icons; native wasmtime host is M3; no CPU/fuel limits under jco.

Quickstart

Requirements: Linux x86_64, Node ≥ 20, MoonBit.

export PATH="$HOME/.moon/bin:$PATH"
scripts/setup-toolchain.sh        # wasm-tools, wit-bindgen, wasmtime -> ./.tools (no root)
(cd host && npm ci)               # jco
scripts/build.sh                  # MoonBit -> components -> build/components, build/jco
scripts/test.sh                   # everything CI runs

node host/src/cli.mjs --time 2026-11-24T14:07:00 --click-launcher   # terminal render
node host/serve.mjs 8080                                           # browser host: http://127.0.0.1:8080/
node host/serve.mjs & # then try  ?config=desktop.binary-clock.json  or  ?theme=moon-day

Swap the clock without rebuilding anything else:

node host/src/cli.mjs --config config/desktop.binary-clock.json
scripts/build.sh clock-binary      # builds just that component
# in the browser console: await chandra.swap('clock', 'clock-binary')

Screenshots: see the end of docs/TOOLCHAIN.md.

Layout

wit/                  the WIT package (host-agnostic API)
interface/ world/     generated shared MoonBit bindings (wit-bindgen; committed)
components/<n>/gen/   generated export bindings + hand-written thin stub.mbt
lib/                  pure, unit-tested logic (ui helpers, panel layout, launcher state machine, ...)
host/                 JS host: src/desktop.mjs (core), loaders, renderers, tests, web/ (browser)
config/               desktop configs (grants!), themes, static app list
scripts/              setup-toolchain, gen-bindings, build, test, screenshot
docs/                 ARCHITECTURE, TOOLCHAIN, screenshots

License

Apache-2.0 (see LICENSE).

S
Description
A modular KDE Plasma-like desktop shell in MoonBit where every part is a WebAssembly component
Readme Apache-2.0
15 MiB
0 Stars 1 Watchers 0 Forks
Languages
MoonBit 76.3%
C 13.6%
Python 6.6%
Shell 1.6%
JavaScript 1.1%
Other 0.8%