Skip to content

Add VS Code OS desktop shell extension - #5

Merged
danisss9 merged 3 commits into
mainfrom
claude/vscode-oscore-extension-8ns3lr
Aug 6, 2026
Merged

danisss9 merged 3 commits into
mainfrom
claude/vscode-oscore-extension-8ns3lr

Conversation

@danisss9

@danisss9 danisss9 commented Aug 6, 2026

Copy link
Copy Markdown
Owner

This PR adds VsCodeOsCore, a comprehensive desktop shell extension that transforms VS Code into a complete operating system interface. The extension provides system tray functionality, power management, task monitoring, file exploration, and several mini-applications.

Summary

The extension implements a full desktop shell experience within VS Code, including:

  • System Tray: Status bar items for power, clock, battery, volume, network, and now-playing information
  • Flyout Panels: Six context-sensitive panels (power menu, calendar, quick settings, volume mixer, network picker, music player) that appear as cards anchored to the bottom-right
  • Task Manager: Process monitoring with CPU/memory metrics and system statistics
  • File Explorer: Full filesystem browser with grid/list views and file operations
  • Mini-Apps: Calculator, Notepad, Paint, Screenshot tool, and Voice Recorder

Key Changes

  • Extension Host (extension/src/): Core extension logic including:

    • System integration modules for audio, battery, backlight, Bluetooth, display, network, MPRIS, power, and process monitoring
    • Webview panel management for all UI components
    • Status bar tray implementation
    • File explorer with native file operations
  • Webview UIs (extension/media/src/): Browser-based interfaces for:

    • Flyout panels with real-time system state updates
    • Task manager with sortable process table and system meters
    • File explorer with breadcrumb navigation and file operations
    • Mini-apps (calculator with expression parser, paint canvas, notepad, screenshot, voice recorder)
  • Styling (extension/media/css/vscodeos.css): Comprehensive theming that respects VS Code's color scheme with custom CSS variables

  • System Integration:

    • /proc and /sys filesystem reading for process and system statistics
    • NetworkManager (nmcli) integration for network management
    • MPRIS protocol support for media player control
    • PipeWire/PulseAudio audio control
    • systemd/polkit for power operations
    • udev rules for backlight control without privilege escalation
  • Build System: esbuild configuration to bundle extension host (Node/CJS) and webview code (browser/IIFE) separately

  • Package Configuration: Updated both x86_64 and ARM64 package lists to include required dependencies (bluez, chromium, etc.)

Notable Implementation Details

  • No eval() in calculator: Uses a shunting-yard algorithm to safely evaluate expressions without CSP violations
  • Efficient system sampling: Reads /proc directly instead of spawning ps/top for each sample
  • Secure command execution: All external commands use execFile without shell mode to prevent injection attacks
  • Webview security: Strict CSP with per-load nonces, no inline scripts
  • Responsive UI: Flyouts animate in, sliders throttle updates, calendar ticks independently
  • Desktop-like behavior: Reusable webview panels that reveal existing instances rather than stacking tabs

https://claude.ai/code/session_01MQheV7d9dNqz8WSxo43cLk

claude added 3 commits August 6, 2026 14:54
VS Code OS boots straight into VS Code with no desktop environment, which
until now meant there was no way to shut the machine down, see the time,
change the volume, join a network, look at what is running, or open a file
that is not text. Everything had to go through the integrated terminal.

This adds extension/, a TypeScript VS Code extension that supplies the
missing desktop:

  * a tray at the right end of the status bar - now playing, battery,
    volume, network, clock and date, and the power button in the corner;
  * flyouts for power, calendar, quick settings, the volume mixer, the
    network picker and the music player;
  * a Task Manager in the activity bar, with processes, per-core CPU,
    memory, load, uptime and thermals, read from /proc;
  * a graphical file explorer;
  * an MPRIS music player with launchers for Spotify Web and YouTube Music;
  * a browser launcher, and Calculator, Notepad, Paint, Screenshot and
    Voice Recorder.

The shell ships as a *built-in* extension rather than a Marketplace one.
Both builds stage it at /usr/share/vscodeos/extensions and
vscodeos-install-extensions copies it into VS Code's own
resources/app/extensions, which is a plain directory scan with no
extensions.json and no engine check - so an editor update can never decide
the desktop is incompatible and disable it. That update does replace the
whole app tree, so vscodeos-update-code re-runs the installer afterwards.

The bundle is architecture-neutral JavaScript, so CI builds it once in a new
`extension` job and hands both image jobs the same artifact through
VSCODEOS_EXTENSION_PREBUILT. The release job now filters its artifact
download to VSCodeOS-*, so the bundle is not published as a release asset.

Packages added to both images: chromium (Edge is AUR-only on Arch and has no
ARM64 Linux build at all, so it could never have shipped on the Pi; the
launcher still prefers microsoft-edge-stable when it is installed), plus
playerctl, scrot, bluez and bluez-utils. Roughly 200 MiB on the ISO against
~400 MiB of headroom under the 2 GiB release-asset limit.

Two grants make the shell work without a polkit agent, which the kiosk
session has nowhere to draw: 49-vscodeos.rules for power and NetworkManager,
and a udev rule making the backlight writable by the `video` group.

The status bar setting is load-bearing: the notifications bell registers at
a priority no extension can outrank, so the skel settings move notifications
to the top right to free the bottom-right corner for the power button.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MQheV7d9dNqz8WSxo43cLk
Running the sys/ layer against this machine's /proc and against nmcli and
wpctl fixtures checked out - RSS and CPU match `ps`, escaped colons in SSIDs
survive, wpctl's box-drawing tree parses. The calculator did not.

Negation was rewritten as "0 − x", which is correct at the start of an
expression and wrong everywhere after it:

    5 − −3   ->  5 − 0 − 3  =  2   (should be 8)
    2 × −3   ->  2 × 0 − 3  = -3   (should be -6)

and the ± key emitted an ASCII hyphen, which fell through the tokenizer's
prefix handling entirely, so ±5 + 3 was an error rather than -2.

Negation is now a real unary operator carried on the operator stack, and
ASCII hyphens are normalised to the typographic minus the keypad shows.

The failure messages went with it: "Error: undefined" reads like a
JavaScript value, which is the last thing it should read like inside a code
editor. Division by zero and the root or log of a negative now say
"Undefined", overflow says "Overflow", and callers ask isError() instead of
matching on the message text - the check the two call sites were doing by
hand, and would have got wrong.

The evaluator moves to media/src/lib/calc.ts so it can be tested without a
DOM. extension/test/ covers it and the formatters with node:test - 45 cases,
no framework to install - and CI runs typecheck and tests before either
image build starts. Narrow coverage on purpose: everything else here talks
to /proc, nmcli or the VS Code API and is verified by running it. This is
the part where a mistake is invisible.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MQheV7d9dNqz8WSxo43cLk
The workflow only fired on v* tags, so a pull request got no checks at all -
the extension's typecheck, its tests and its bundle build first ran when
someone cut a release, which is the worst moment to find out any of them
broke.

Pull requests now run the `extension` job and nothing else. It is a couple
of minutes on ubuntu-latest and it is the only part of a build that can fail
on a code mistake rather than on a mirror, a runner or a package that moved;
the two image jobs are two-hour builds producing gigabyte artifacts, and
gating every PR on those would cost a great deal to learn very little.

`version` is skipped on pull requests too - nothing a PR runs needs a
version, and a check that only echoes one is noise on the PR page.

Concurrency now cancels superseded runs on pull requests only. A supplanted
PR check is wasted minutes; a release build must never be cancelled out from
under a tag.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MQheV7d9dNqz8WSxo43cLk
@danisss9
danisss9 merged commit 843bbf9 into main Aug 6, 2026
5 checks passed
@danisss9
danisss9 deleted the claude/vscode-oscore-extension-8ns3lr branch August 6, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants