Skip to content

Native macOS app in Swift and SwiftUI (v0.3.0) - #7

Merged
Luna-OS merged 10 commits into
mainfrom
claude/affectionate-shannon-nou7s9
Sep 26, 2026
Merged

Luna-OS merged 10 commits into
mainfrom
claude/affectionate-shannon-nou7s9

Conversation

@Luna-OS

@Luna-OS Luna-OS commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

MoonTask for the Mac as a native app in Swift and SwiftUI, in macos/. It has the night-sky design, the views and the safety rules of the Windows/Linux app, and is built and released in its own CI workflow.

Structure

  • MoonTaskCore (pure Swift): models, process tree / list / apps, sorting, search, formatting, history and safety rules. Ported one to one from src/lib/processes.ts and risk.ts and unit-tested.
  • CDarwin: a thin C layer over libproc, sysctl, Mach host statistics, the routing socket and IOKit. It returns flat structs, so Swift never touches kernel unions.
  • MoonTaskSystem:
    • the sampler for CPU per core, memory as Activity Monitor counts it, processes, disk and network throughput, GPUs (IOAccelerator), volumes and thermal state;
    • process details (command line, environment, open files, sockets);
    • actions that check PID and start time before they run;
    • launchd agents via launchctl.
    • For other users' and system processes, proc_pid_rusage needs root, so their CPU time and memory come from /bin/ps, which may read them.
  • MoonTask (SwiftUI):
    • the sidebar with moon gauges;
    • Overview (moon tiles with sparklines, top lists, This Mac, storage, coming and going);
    • Processes (native table with tree / list / apps, sortable columns, search, owner filter, heat tint, inspector with General / Files / Network / Environment, context menu, confirmations);
    • Performance (Swift Charts with hover read-outs, cores, memory, GPU, disk, network, thermal state);
    • Network, Services (launchd agents: start / stop), Settings.
    • Night theme by default; Day or follow macOS in Settings.

Packaging and release

  • macos/scripts/bundle.sh builds a universal MoonTask.app (Apple silicon + Intel, macOS 14+) with an ad-hoc signature, plus a disk image laid out by dmgbuild. The disk image uses a night-sky background, the app on the left, Applications on the right and a dotted arrow.
  • release.yml has a new build-macos job that attaches MoonTask_<version>_macos_universal.dmg and its checksum to the release.
  • The app is not notarized, so macOS asks once before the first start. The README explains "Open Anyway".

CI

  • The new macos.yml workflow runs swift build, swift test (29 tests: core logic plus real system tests for sampling, process details, acting only on the same process instance, refusing protected processes, and launchctl) and the bundle.
  • It then starts the app for 20 s as a smoke test and takes a screenshot of every section and of the disk image window. The screenshots are uploaded as an artifact.
  • The workflow runs only when macos/ changes, so it never slows down the Tauri CI.

Also

  • README: macOS install notes and a macOS column in the platform table.
  • Version 0.3.0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BeJhPzCrMkk6o5AxqSheiM

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeJhPzCrMkk6o5AxqSheiM
proc_pid_rusage only answers for the user's own processes; /bin/ps may read every process, so MoonTask asks it for the rest (resident memory and CPU time).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeJhPzCrMkk6o5AxqSheiM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeJhPzCrMkk6o5AxqSheiM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeJhPzCrMkk6o5AxqSheiM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeJhPzCrMkk6o5AxqSheiM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeJhPzCrMkk6o5AxqSheiM
…column; version 0.3.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeJhPzCrMkk6o5AxqSheiM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeJhPzCrMkk6o5AxqSheiM
@Luna-OS Luna-OS changed the title Native macOS app in Swift and SwiftUI Native macOS app in Swift and SwiftUI (v0.3.0) Sep 26, 2026
@Luna-OS
Luna-OS marked this pull request as ready for review September 26, 2026 05:16
@Luna-OS
Luna-OS merged commit 3b81334 into main Sep 26, 2026
6 checks passed
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