Architecture overview
Status
Section titled “Status”This document is the authoritative architecture for the current coding product. Public names may change while the product has no compatibility baseline.
Dependency direction
Section titled “Dependency direction”CrystalCode (terminal host: the executable) ↓ ↓CrystalCode.Display CrystalCode.Engine ↓ ↓Spectre.Console CrystalCode.Providers(rasterization; ↓Terminal.Gui is Crystalreferenced, not called)
CrystalCode.Engine also references CrystalCode.Tools, CrystalCode.Plugins,Crystal.Tools, Crystal.Agents, and Crystal.Harness directly.CrystalCode.Tools and CrystalCode.Plugins each reference only Crystal andCrystal.Tools. CrystalCode referencesSpectre.Console and Spectre.Console.Cli for its commands and cards.CrystalCode.Display references Spectre.Console and Terminal.Gui only.It does not reference Crystal, Crystal.Tools, CrystalCode.Tools, theengine, or the executable host. CrystalCode.Engine does not referenceSpectre.Console, Terminal.Gui, CrystalCode.Display, or the executablehost, and it never touches the console. CrystalCode.Providersreferences only Crystal. No project in this repository modifies Crystal.A second front end (a desktop application, for example) references
CrystalCode.Engine and supplies its own surface. It does not copy engine code.
CrystalCode.Server sits beside CrystalCode.Display under the executable:
it references CrystalCode.Engine and the Microsoft.AspNetCore.App shared
framework only. It does not reference CrystalCode.Display, Spectre.Console,
Terminal.Gui, the executable, or System.Console. The executable references
it. CrystalCode.Server.Tests references CrystalCode.Server and guards that
direction. See Server protocol.
CrystalCode.Bridge sits beside them: it references CrystalCode.Engine only
and no package. It does not reference CrystalCode.Display,
CrystalCode.Server, Spectre.Console, Terminal.Gui, the executable, or
System.Console. The executable references it.
CrystalCode.Bridge.Tests references CrystalCode.Bridge and guards that
direction. See Bridge protocol.
If that desktop front end is built with Avalonia, write the UI in C# markup.
Do not add XAML or AXAML files.
EngineAssemblyTests and DisplayAssemblyTests fail the build when either
direction above is crossed.
CrystalCode.Tests references CrystalCode. CrystalCode.Engine.Tests references CrystalCode.Engine. CrystalCode.Display.Tests references CrystalCode.Display. CrystalCode.Providers.Tests references CrystalCode.Providers. CrystalCode.Server.Tests references CrystalCode.Server. CrystalCode.Bridge.Tests references CrystalCode.Bridge.