ข้ามไปยังเนื้อหา

Core

เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน

The core layer is what every Cephalon app pulls in. It is the smallest, most stable surface — pure contracts and the composition engine.

PackageMaturityWhat it ships
Cephalon.AbstractionsM4Pure interfaces and types modules build against — IModule, ModuleDescriptor, Capability, ICapabilityRegistry, app-model types, transport types, technology contributor contracts.
Cephalon.EngineM3The composition engine — module discovery, dependency ordering, manifest v2, capability registry, lifecycle execution, integrity verification, cell boundary & CDC capture catalogs.
Cephalon.ScaffoldingM3Project / folder / package scaffolding that powers cephalon new. Apps consume this only at scaffold time.
Cephalon.ReferenceDocsM2Optional reference-doc tooling that turns XML comments into Markdown for the docs site. Build-time only.

The engine guarantees, in order:

  1. Validate the module set (no duplicate descriptors, no conflicting capability providers).
  2. Order modules deterministically based on DependsOn.
  3. Register module services into the DI container.
  4. Compose capabilities and language packs from base + project + package contributions.
  5. Execute lifecycle hooks (OnRegisterOnStart; OnStop runs in reverse order).
  6. Expose the runtime manifest, runtime catalogs, and health aggregation.

The full ordered contract lives in Reference → Architecture → Runtime contracts.

The AspNetCore host adapter wires the engine into ASP.NET Core’s WebApplicationBuilder. It:

  • registers the engine builder as a singleton.
  • registers IRuntimeManifest for DI consumers.
  • maps /engine/manifest, /engine/runtime, /engine/snapshot HTTP routes.
  • maps the REST behavior pipeline.
  • wires OpenAPI + Scalar for documenting the behaviors.
  • exposes app.MapCephalon() which finalises the route registrations.

See Hosts for the equivalent on Cephalon.Worker and other adapters.