How 10x-app-builder/10x works
Purpose and Entry Points
10x is a native macOS 14+ SwiftUI application that turns conversational requirements into generated iOS SwiftUI projects, then builds and previews them in an iOS Simulator. The app entry point is 10x-macos/TenXAppApp.swift; root navigation/tab ownership is 10x-macos/ContentView.swift. The Xcode project is 10x-macos.xcodeproj/project.pbxproj.
Application State and Workspace
BuilderViewModel is the central observable state machine for a project workspace: chats, generation lifecycle, project mode, preview, production/review flows, and persistence coordination. Its split extensions isolate major workflow domains while sharing project state.
• 10x-macos/ViewModels/BuilderViewModel.swift
• 10x-macos/ViewModels/BuilderViewModel+Generation.swift
• 10x-macos/ViewModels/BuilderViewModel+Projects.swift
The UI is SwiftUI and organized around home/project selection, builder chat, and preview panels:
• 10x-macos/Views/HomeView.swift
• 10x-macos/Views/BuilderView.swift
• 10x-macos/Views/Preview/PreviewPanelView.swift
Generation Agent Boundary
The client runs the agentic loop locally. A user message reaches the view model, which invokes GenerationService; streamed model events and tool calls are converted into workspace/chat state. Prompts distinguish plan versus build behavior, while tool definitions constrain callable local capabilities.
• 10x-macos/Services/Builder/GenerationService.swift
• 10x-macos/Services/Builder/BuilderPrompts.swift
• 10x-macos/Services/Builder/BuilderToolDefinitions.swift
The remote boundary is a thin HTTP API/proxy rather than direct model integration. APIClient handles regular and streaming requests; stream payloads map into builder event models.
• 10x-macos/Services/APIClient.swift
• 10x-macos/Models/BuilderStreamEvent.swift
• 10x-macos/Models/BuilderChat.swift
Local Tool Execution and Project Files
Tool calls cross from model-directed intent to privileged local filesystem/process operations through ToolExecutor. This layer performs generated-source mutation/search and supports build-fix/context workflows; generated project metadata describes workspace and dependency/environment state.
• 10x-macos/Services/Builder/ToolExecutor.swift
• 10x-macos/Services/Builder/BuilderBuildFixSupport.swift
• 10x-macos/Models/ProjectWorkspaceDescriptor.swift
Local persistence is separate from remote API state: project messages, file trees, plans, and environment data are stored under each generated project’s tenx/ area. Existing projects can enter through an importer and filesystem changes can be observed.
• 10x-macos/Services/LocalProjectStore.swift
• 10x-macos/Services/ExistingProjectImporter.swift
• 10x-macos/Services/FileSystemWatcher.swift
Build and Simulator Preview Pipeline
Generated sources are scaffolded into an Xcode project through bundled XcodeGen, then compiled, installed, launched, and screen-captured using Xcode command-line/simulator services. Preview results return to the builder UI.
• 10x-macos/Services/XcodePreviewService.swift
• 10x-macos/Services/SimulatorPreviewService.swift
• 10x-macos/Models/PreviewScreenCapture.swift
This is a hard runtime boundary: the host macOS app requires Xcode, an installed iPhone Simulator runtime, bundled xcodegen, and permission to manipulate local project files/processes.
Identity, Integrations, and Product Services
Authentication state is managed separately from workspace generation, with credentials persisted in Keychain and hosted identity provided by Supabase. Project generation can also provision/manage Supabase and Superwall integrations.
• 10x-macos/ViewModels/AuthManager.swift
• 10x-macos/Services/AuthKeychainStore.swift
• 10x-macos/Services/SupabaseManagementService.swift
• 10x-macos/Services/SuperwallManagementService.swift
Configuration supplies API, Supabase, hosted-download, and updater endpoints:
• 10x-macos/Config.swift
• 10x-macos/Configuration/Development.xcconfig
• 10x-macos/Configuration/Production.xcconfig
Distribution and Evaluation
Sparkle updates are integrated into the macOS artifact; release CI builds, signs/notarizes, produces DMGs/appcasts, and deploys channel content to Vercel.
• 10x-macos/SparkleUpdater.swift
• .github/workflows/release-channel.yml
• scripts/release/publish-release.sh
A separate Swift CLI drives end-to-end builder evaluation suites, reusing the builder stack rather than being part of the desktop runtime.
• 10x-evals/main.swift
• 10x-evals/EvalRunner.swift
• evals/smoke-suite.yml
Main entry points: BuilderViewModel.swift Builder workspace · GenerationService.swift Generation service · ToolExecutor.swift Tool executor · LocalProjectStore.swift Local project store
Components 24
macOS App
- 10x App
10x-macos/TenXAppApp.swift - Root navigation
10x-macos/ContentView.swift - Builder workspace · Owns chats, generation, projects, preview, and review state.
10x-macos/ViewModels/BuilderViewModel.swift - Builder UI
10x-macos/Views/BuilderView.swift - Preview panel
10x-macos/Views/Preview/PreviewPanelView.swift - Auth manager
10x-macos/ViewModels/AuthManager.swift
Generation Agent
- Generation service · Streams model-directed plans, builds, and tool calls into workspace state.
10x-macos/Services/Builder/GenerationService.swift - Agent prompts & tools · Defines plan/build behavior and permitted local capabilities.
10x-macos/Services/Builder/BuilderPrompts.swift - API client
10x-macos/Services/APIClient.swift - Chat stream events
10x-macos/Models/BuilderStreamEvent.swift
Local Project Runtime
- Tool executor · Mutates and searches generated sources for build and context workflows.
10x-macos/Services/Builder/ToolExecutor.swift - Local project store · Stores messages, plans, file trees, and environment data under tenx/.
10x-macos/Services/LocalProjectStore.swift - Project importer
10x-macos/Services/ExistingProjectImporter.swift - Filesystem watcher
10x-macos/Services/FileSystemWatcher.swift - Xcode build pipeline · Uses bundled XcodeGen and Xcode command-line services.
10x-macos/Services/XcodePreviewService.swift - Simulator preview · Installs, launches, and captures the generated iOS app.
10x-macos/Services/SimulatorPreviewService.swift - Preview capture
10x-macos/Models/PreviewScreenCapture.swift
Identity & Delivery
- Keychain credentials
10x-macos/Services/AuthKeychainStore.swift - Supabase management
10x-macos/Services/SupabaseManagementService.swift - Superwall management
10x-macos/Services/SuperwallManagementService.swift - Sparkle updater
10x-macos/SparkleUpdater.swift - Release channel · Builds, signs, notarizes, publishes DMGs and appcasts.
.github/workflows/release-channel.yml
Evaluation
- Evaluation runner · Runs end-to-end builder evaluation suites outside the desktop runtime.
10x-evals/EvalRunner.swift - Smoke suite
evals/smoke-suite.yml
Connections 24
- 10x App → Root navigation: starts
- Root navigation → Builder workspace: owns
- Builder workspace → Builder UI: drives
- Builder workspace → Preview panel: supplies preview
- Builder workspace → Generation service: submits messages
- Generation service → Agent prompts & tools: uses
- Generation service → API client: streams requests
- API client → Chat stream events: maps payloads
- Chat stream events → Builder workspace: updates chat state
- Generation service → Tool executor: executes tool calls
- Tool executor → Local project store: reads and writes
- Builder workspace → Local project store: persists workspace
- Project importer → Local project store: imports into
- Filesystem watcher → Builder workspace: reports changes
- Tool executor → Xcode build pipeline: requests build
- Xcode build pipeline → Simulator preview: installs app
- Simulator preview → Preview capture: captures screen
- Preview capture → Builder workspace: returns preview
- Auth manager → Keychain credentials: persists credentials
- Builder workspace → Supabase management: provisions integration
- Builder workspace → Superwall management: provisions integration
- Release channel → Sparkle updater: publishes appcast
- Evaluation runner → Generation service: reuses builder stack
- Smoke suite → Evaluation runner: defines scenarios