How I built a multi-agent simulator as a native SwiftUI app
Описание и применение
Sorcerer – это бесплатное приложение для macOS, которое моделирует взаимодействие AI‑персонажей без ключей API, используя существующие CLI‑инструменты и чистые функции для тестируемой логики.
Задача
Develop a free, open‑source macOS app that simulates a community of AI characters reacting to user‑defined hypotheses without requiring API keys.
Результат
Sorcerer enables rapid, key‑free simulation of AI communities, with testable logic and live streaming feedback.
Рабочий процесс
- 1. Prompt user for hypothesis and cast
- 2. Detect user PATH by launching /bin/zsh -ilc "printf '%s' $PATH"
- 3. Select provider CLI (claude, codex, ollama) and construct command with appropriate flags
- 4. Run provider, stream JSON output
- 5. Parse partial JSON to show live typing
- 6. Validate and apply round results via pure functions
- 7. Update world state and display posts, reactions, memories
- 8. Allow forking of world branches
Доказательства
I built Sorcerer, a free, open‑source macOS app (SwiftUI, macOS 15+, MIT) that simulates a community of AI characters reacting to a "what if…?" question.
Sorcerer runs the official tools the user is already signed in to: the claude CLI (Claude Code), the codex CLI (ChatGPT), or a local Ollama.
The simulation lives in Engine.swift, whose header says "Prompts and parsing. Pure functions, so the simulation rules are testable without a model."
- Дата записи: 2026-10-19T18:41:40.780Z