Architecture
Overview
One package, one server, one React WebUI, and six native harness adapters.
Macaron Artifacts keeps the browser experience independent from the coding harness. The root package starts one local Node server and serves one prebuilt React application. Each conversation selects Claude Code, Codex, OpenCode, pi, Hermes, or OpenClaw through the same session and streaming contract.
Repository shape
bin/macaron-artifacts.mjs
README.md
artifacts/src/serverowns sessions, turns, Profiles, pairing, artifacts, and native harness lifecycles.artifacts/src/webcontains the shared conversation UI, Canvas panel, Profile manager, and theme system.artifacts/src/shareddefines the session, Profile, harness, and AI SDK UI-message types shared by both sides.artifacts/skills/ui4a/SKILL.mdis generated from the runtime manifest and gives models the exact UI4A contract.bin/macaron-artifacts.mjsstarts the bundled server and is the only published launcher.
A turn from browser to harness
- The browser creates or selects a session with a workspace, harness, Profile, and optional model override.
ActiveConversationcaptures the resolved configuration for that turn and asks the selectedHarnessAdapterto start native work.- Native events are normalized into AI SDK UI-message chunks while preserving each harness's event boundaries.
- The browser's per-session Chat instance renders text, reasoning, tools, approvals, and completion state.
- Title and follow-up enrichment runs separately on a disposable native branch and never changes the durable conversation.
There is no harness-specific SPA, launcher, message store, or Canvas implementation. Adding a harness means implementing HarnessAdapter, declaring capabilities, and registering it in artifacts/src/server/harnesses/index.ts.
Current harnesses
| Harness | Native connection | Profile model |
|---|---|---|
| Claude Code | Claude Agent SDK | App-managed environment and credentials |
| Codex | Codex app-server JSON-RPC | Native Profile files plus trusted runtime overrides |
| OpenCode | OpenCode local SDK server | App-managed provider and model settings |
| pi | Bundled pi SDK | App-managed provider and thinking settings |
| Hermes | Hermes headless JSON-RPC gateway | Gateway and model overrides |
| OpenClaw | Pinned Gateway client | Gateway, agent, and model overrides |
Read Server for lifecycle details and Packaging for the distribution boundary.