How drawthingsai/local-code-community works
Local Code is a sandboxed AI coding and productivity agent for Apple devices. The main workflow starts with a user task in chat, passes through a model-specific agent and inference, then uses in-app tools on permitted project files to produce results. Separate capabilities include durable project history and context, built-in runtimes and browser access, and optional cloud-model use. The README documents these product relationships; sampled source excerpts are limited, so unsampled runtime connections are not asserted.
Main entry points: CodeAgent.swift Code agent · ToolsRegistry.swift Tool registry · ChatWorkflow.swift Chat workflow · TextGenerator.swift Text generation
Components 18
Task interaction
- Chat workflow
Apps/LocalCode/Sources/Chat/ChatWorkflow.swift
Agent runtime
- Agent scheduler
Apps/LocalCode/Sources/Agent/AgentScheduler.swift - Code agent
Apps/LocalCode/Sources/Agent/CodeAgent.swift - Model harnesses
Apps/LocalCode/Sources/Agent - Tool registry
Apps/LocalCode/Sources/Agent/ToolsRegistry.swift
Model inference
- Text generation
Apps/LocalCode/Sources/Agent/TextGenerator.swift - On-device models
Libraries/SwiftDiffusion/Sources/CoreMLModelManager/CoreMLModelManager.swift - Remote agent
Apps/LocalCode/Sources/Agent/RemoteAgentTranscriptAdapter.swift
Workspace tools
- File tools
Apps/LocalCode/Sources/Agent/FileTools.swift - Shell tools
Apps/LocalCode/Sources/Agent/BashTools.swift - Built-in runtimes
Apps/LocalCode/Resources/NodeMobile/Runtime - Web browser
Apps/LocalCode/Sources/Browser/BrowserWorkflow.swift
Context and history
- Project context
Apps/LocalCode/Sources/Agent/ProjectContext.swift - Long-term memory
Apps/LocalCode/Sources/Agent/MemoryContext.swift - Project history
Libraries/ProjectHistoryManager/Sources/ProjectHistoryManager.swift
Other components
- User
- Cloud model providers
- Allowed project files
Connections 17
- User → Chat workflow: submits task
README.md - Chat workflow → Agent scheduler: starts work
README.md - Agent scheduler → Code agent: runs agent
README.md - Code agent → Model harnesses: selects harness
README.md - Model harnesses → Text generation: requests inference
README.md - Text generation → On-device models: runs on-device
README.md - Text generation → Remote agent: supports remote
README.md - Remote agent → Cloud model providers: sends prompts
README.md - Code agent → Tool registry: invokes tools
README.md - Tool registry → File tools: dispatches
README.md - Tool registry → Shell tools: dispatches
README.md - Shell tools → Built-in runtimes: uses runtimes
README.md - Tool registry → Web browser: dispatches
README.md - File tools → Allowed project files: reads and writes
README.md - Code agent → Project context: uses context
README.md - Code agent → Long-term memory: uses context
README.md - Chat workflow → Project history: persists threads
README.md