aiti-desktop-widget (desktop overlay shell)
aiti-desktop-widget (desktop overlay shell)
❝ The shell owns the window; the caller owns the content. ❞
A cross-platform (Tauri 2) desktop window shell that knows nothing about captions, floating icons, status cards or desktop pets. It renders an http(s) page (or local HTML) as a frameless, transparent, always-on-top window, optionally click-through or draggable, and exposes a CLI plus a stdin JSONL control channel.
Install
npm install -g @aiti-ai/aiti-desktop-widget
aiti-desktop-widget --helpThe npm package is a launcher. The native binary is a GitHub/Gitee Release asset downloaded on first run by justget — multi-source racing (GitHub → Gitee → gh-proxy mirrors), sha256 verified, cached per version/platform. Linux, Windows and macOS are supported on x64 and arm64.
Standalone build: cargo build --release in integrations/aiti-desktop-widget.
Local / offline install
Pack the launcher from a checkout and pre-seed the native cache (no published Release needed):
cd integrations/aiti-desktop-widget/npm && npm pack
npm install -g ./aiti-ai-aiti-desktop-widget-0.2.0.tgz --ignore-scripts
# Windows: recreate shims if npm skipped them for a local tarball
npm rebuild -g @aiti-ai/aiti-desktop-widgetPut the built binary at <cache>/<version>/<platform>/ and write a checksums.txt line <sha256> <release asset name> next to it; the launcher then runs fully offline. Caches: ~/.cache/aiti-desktop-widget/... (Linux), ~/Library/Caches/aiti-desktop-widget/... (macOS), %LOCALAPPDATA%\aiti-desktop-widget\cache\... (Windows). See the npm README's "Local / offline install" section for details.
Usage
# frameless transparent caption window, click-through
aiti-desktop-widget http://127.0.0.1:8765/caption-bar.html --width 900 --height 140 \
--click-through true
# local HTML served from a loopback origin
aiti-desktop-widget --html ./pet/index.html --root ./pet --width 220 --height 220 --draggable true
# pick a monitor and center on it
aiti-desktop-widget http://127.0.0.1:8765/ --display 1 --center trueThe full CLI/config/control-channel reference lives in the README.
Demo: transparent lyric player
demo/play/play.html is a dependency-free example: audio playback + LRC/SRT/VTT lyrics + current-line highlight + seekable progress + keyboard controls. The card is translucent by default; ?bare=1 removes it for a text-only overlay.
aiti-desktop-widget \
--html '/abs/path/demo/play/play.html?file=assets/aiti-intro.mp3&lyrics=assets/aiti-intro.lrc' \
--width 900 --height 320 --transparent trueParams: file, lyrics (lrc|srt|vtt|subtitle), title, artist, cover, theme=dark|light, bg=transparent|none|color, bare=1, autoplay (default 1, attempts to start on open), layout=auto|card|line, loop=1, volume. At height ≤220px (or layout=line) the page switches to a one-line marquee with the text-width progress fill covering the current lyric (karaoke-style). The sample audio/lyrics are generated with edge-tts + ffmpeg (no third-party audio); run node demo/play/serve.mjs for a local preview.
Page control and one-line autosize (default on)
Loopback pages get page control by default (capabilities/widget-page-control.json + withGlobalTauri): geometry/monitor reads, setSize/setPosition/center, size constraints, startDragging/startResizeDragging, always-on-top/click-through/all-workspaces/skip-taskbar/ shadow/decorations/focusable/title, hide/show/close, fullscreen/maximize, icon/badge/progress, DevTools, plus core:webview, core:app (version/identifier/theme/exit), core:event (listen/emit), core:image (PNG/ICO decoding), core:menu, core:path, core:resources, core:tray and the dialog plugin's native open/save/ask/confirm/message. The capability matches only 127.0.0.1 / localhost; external pages loaded with --allow-remote true cannot invoke it. Cargo.toml enables the matching tray-icon, image-png and image-ico features so pages can really build tray icons, menus and images (~0.8 MB extra binary size). Treat every loopback page as trusted code; trim capabilities/widget-page-control.json if a deployment needs a smaller surface and re-check with node scripts/check-capabilities.mjs (fails on missing or unknown permissions; --fix rewrites the list).
demo/play/play.html in one-line mode (layout=line or height ≤220px) defaults to autosize=1: the window width follows the current lyric while the window center stays fixed; use autosize=0 to keep the caller size. The page updates the min=max constraints before resizing (--resizable false). Dragging is still a DOM data-tauri-drag-region, not a window property.
aiti-dialog: a cross-platform zenity replacement
@aiti-ai/widget-interaction ships an aiti-dialog command that drives this shell:
aiti-dialog confirm --text "Continue?" # exit 0 / 1 / 5
aiti-dialog input --text "Name:" # stdout = text
aiti-dialog choose --options "A,B,C" # stdout = choice
aiti-dialog file --multiple # stdout = absolute paths, one per line
aiti-dialog directory
aiti-dialog notify --text "Done" --timeout 5
aiti-dialog --daemon --port 18095 # long-lived, HTTP/SSE reuse- Exit codes match zenity:
0answered,1cancelled,5timeout (2usage,4runtime). --jsonprints the full host envelope (status/value/comment/tookMs).- The page is only a renderer: pending state, timeout, idempotency and callbacks live in the host, so reloading or reopening the page never loses a request.
- Native file/folder picking uses
tauri-plugin-dialog(dialog:allow-open). - Also available as MCP tools:
widget_confirm/widget_choose/widget_input/widget_presence/widget_notify/widget_cancel, with--httpproxying to a daemon.
Desktop privacy covers use the same adapter's DesktopCover: a separate always-on-top, click-through window inside the capture rect, immune to page reloads. Real-time pixelation lives in video-studio's desktop-mosaic.
Used by aiti-video-studio
Video Studio's desktop overlay caption mode opens a loopback caption page (caption-bar.html?bubble=1) in aiti-desktop-widget and pushes subtitles over SSE. The shell owns transparency/always-on-top/click-through; Video Studio owns the content and its SSE/audio sync. system.caption.style (font size/weight/color/background/radius; background:"transparent" for text-only captions) also flows through the shell.
Lookup order: AITI_WIDGET_BIN → ~/.pi/bin/aiti-desktop-widget → PATH; without a binary, Video Studio falls back to GTK/Chrome captions.
Platform notes
- Linux: WebKitGTK 4.1 + GTK3; on X11 without a compositor transparent areas may render black.
- Windows: WebView2 runtime required (preinstalled on Windows 10/11, including ARM64); the binary is unsigned.
- macOS: minimum 10.15 (Intel) / 11.0 (Apple Silicon);
Info.plistis embedded in__TEXT,__info_plist(ATS localhost exception +LSUIElement), so the bare binary loadshttp://127.0.0.1without an.appbundle; tested on 11.7.
Release
Tag aiti-desktop-widget-vX.Y.Z builds six platform assets + checksums.txt, publishes a GitHub Release, mirrors it to Gitee, and publishes the npm package.