Skip to content

[macos][openworlds] Native app: OpenWorlds shell with Swift supervisor bridge #82

Description

@100yenadmin

Summary

OpenWorlds is now the visible ClawDnD macOS app shell. The native SwiftUI/AppKit
layer remains essential, but its job is supervision and integration: launch local
viewer/provider processes, persist settings, expose diagnostics, and bridge trusted
native actions into the OpenWorlds web surface.

This supersedes the earlier "native SwiftUI control center with embedded dashboard"
framing. The old SwiftUI sidebar/status-strip shell is not the product UX.

Architecture North Star

  • OpenWorlds owns visible app chrome: window frame, navigation rail, parchment
    stage, Chronicles, Settings, Table, Combat, Atlas, and future gameplay screens.
  • Swift/AppKit owns local native concerns: process lifecycle, dependency checks,
    provider launch, app preferences, logs, diagnostics, menu commands, and the
    WKWebView bridge.
  • Viewer owns same-origin browser-safe read models.
  • Engine and existing player move paths remain the only campaign-state writers.
  • Browser actions may call POST /move only for player intent.

Sprint Roadmap

Sprint 0: correction and safety

Sprint 1: OpenWorlds owns the window

  • Replace normal RootView with a full-window OpenWorlds host.
  • Start viewer/server.py automatically.
  • Wait for /openworlds/ readiness before navigation.
  • Hide the old SwiftUI Play/Campaigns/Monitor/Providers/Settings/Logs shell behind
    debug/recovery UI only.

Sprint 2: native supervisor bridge

  • Add window.ClawDnDNative.request(type, payload).
  • Bridge appStatus, dependencyStatus, providerStatuses, startViewer,
    stopViewer, startProviderSession, stopProvider, diagnostics,
    copyDiagnostics, and openFallbackDashboard.
  • Return structured success/error replies with request ids.

Sprint 3: Settings, Providers, Logs in OpenWorlds

  • Map app prefs and provider status into screen-settings.jsx.
  • Keep prototype-only controls marked Display-only.
  • Show logs and copy diagnostics from native state.

Sprint 4: Chronicles and running state

  • Make Chronicles the app home.
  • Show live/stale campaigns from /openworlds/campaigns.json.
  • Start/resume via native bridge and existing provider/player paths.

Sprint 5+: gameplay surface mapping

  • Complete table, combat, atlas, relations/camp, inventory/economy, acts, and
    bestiary/codex surfaces in issue-priority order.

Acceptance Criteria

  • Normal app launch shows OpenWorlds, not the old SwiftUI sidebar shell.
  • App does not open Safari for the play surface.
  • /dashboard remains a debug fallback only.
  • Swift can start/stop viewer/provider processes without becoming a game-state writer.
  • OpenWorlds surfaces distinguish Wired, Read-only, Display-only,
    Provider required, and Unavailable.

Validation

python3 -m unittest viewer.tests.test_openworlds_static -q
python3 -m py_compile viewer/server.py
swift build --package-path macos/ClawDnDApp
./script/build_and_run.sh --verify
python3 scripts/license_check.py
git diff --check

Original-Agent Handoff

Inspect first:

  • macos/ClawDnDApp/Sources/ClawDnDApp/Views/RootView.swift
  • macos/ClawDnDApp/Sources/ClawDnDApp/Views/WebView.swift
  • macos/ClawDnDApp/Sources/ClawDnDApp/Services/AppProcessService.swift
  • macos/ClawDnDApp/Sources/ClawDnDApp/Services/ProviderAdapters.swift
  • viewer/openworlds/app.jsx
  • viewer/openworlds/screen-settings.jsx
  • viewer/server.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestepicMajor roadmap epictier-1Tier 1: Claude Code plugin

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions