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

Core

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

The core packages provide the contracts (Cephalon.Abstractions), the composition runtime (Cephalon.Engine), the decorator framework (Cephalon.Behaviors.*), and the default identifier strategy (Cephalon.Ids.Sfid). Every Cephalon app uses at least the first two.

Click any package name to jump to its source-doc (the canonical per-package detail synced from the engine repo).

PackageNuGet IDMaturityWhat it ships
AbstractionsCephalon.AbstractionsM3All public interfaces — IModule, IBehavior, IUserContext, ITenantContext, capability enums, manifest types. Zero runtime code.
EngineCephalon.EngineM3The composition runtime — module discovery, capability negotiation, runtime catalog, manifest emission.
Behaviors (base)Cephalon.BehaviorsM3The decorator base — IBehavior<TIn, TOut>, BehaviorPipelineBuilder, With* extension methods.
Behaviors.HttpCephalon.Behaviors.HttpM3HTTP-flavoured decorators — WithRequireScope, WithProblemDetails, WithIdempotency, WithRateLimit.
Behaviors.MessagingCephalon.Behaviors.MessagingM3Messaging-flavoured decorators — WithRetry, WithCircuitBreaker, WithOutbox, WithInbox.
Behaviors.PatternsCephalon.Behaviors.PatternsM3Composite patterns — WithSaga, WithProcessManager, WithBulkhead.
Behaviors.SourcegenCephalon.Behaviors.SourcegenM2Build-time source generator — emits typed registration glue for [Behavior]-tagged classes.
Ids.SfidCephalon.Ids.SfidM3Sfid value type + EF Core converter + IIdGenerator<Sfid>.
ScenarioMinimum packages
Anything CephalonCephalon.Abstractions + Cephalon.Engine
Behaviors in a module+ Cephalon.Behaviors (matching *.Http / *.Messaging flavour)
Source-generated behavior registration+ Cephalon.Behaviors.Sourcegen
Sfid id strategy (default)+ Cephalon.Ids.Sfid
public interface IModule
{
ModuleDescriptor Describe();
}
public interface IBehavior<TIn, TOut>
{
Task<TOut> HandleAsync(TIn input, CancellationToken ct);
}
public interface IUserContext
{
string? UserId { get; }
string? TenantId { get; }
IReadOnlyList<string> Scopes { get; }
bool IsAnonymous { get; }
}
public enum Capability
{
Data, Eventing, Identity, Tenancy, Observability,
Edge, Agentics, Retrieval, Audit, EventSourcing
}

Full surface: API Reference → Cephalon.Abstractions.

Entry points:

services.AddCephalonEngine(); // bare engine
services.AddCephalonAspNetCore(); // engine + ASP.NET Core host adapter
services.AddCephalonWorker(); // engine + worker host adapter
builder.AddModulesFromAssemblies(typeof(Program).Assembly);
var app = builder.Services.Build(webBuilder);
// Decorator chain — applied right-to-left
builder.MapProfile<CreateOrderBehavior>(b => b
.WithLogging()
.WithRequireScope("orders:write")
.WithOutbox()
.WithRetry(maxAttempts: 3));
Engine:* keyOwned byPurpose
Engine:Id (required)Cephalon.EngineUnique identifier — emitted in every log, manifest, OTLP resource attribute.
Engine:DeploymentCephalon.EngineTopology + deployment id + region.
Engine:CompositionCephalon.EngineModel: "Modular" (currently only option).
Engine:FeatureOrganizationCephalon.EngineModuleFirst
Engine:Data:IdStrategyCephalon.Ids.Sfid"Sfid" (default), "Guid", "Long", "Custom"
Cephalon.Engine depends on Cephalon.Abstractions
Cephalon.Behaviors depends on Cephalon.Abstractions
Cephalon.Behaviors.Http depends on Cephalon.Behaviors
Cephalon.Behaviors.Sourcegen → analyzer (build-time only)
Cephalon.Ids.Sfid depends on Cephalon.Abstractions + Sfid.Net (external)