@seal-sdk/platform
v0.13.0
Published
Public composition layer for the SEAL SDK.
Readme
@seal-sdk/platform
Public composition layer for the SEAL SDK.
The @seal-sdk/platform package builds and exposes the engines, infrastructure and
learning flows used by an application integrating SEAL.
Quick start
import {
PlatformBuilder,
} from "@seal-sdk/platform";
const seal = new PlatformBuilder()
.withConfig({
locale: "pt-BR",
})
.build();
seal.activity.register({
id: "activity-1",
title: "Build a sentence",
type: "sentence-construction",
level: "sentence",
pattern: "SVO",
availableUnits: [
"Anna",
"likes",
"music",
],
expectedUnits: [
"Anna",
"likes",
"music",
],
skillIds: [
"basic-svo-construction",
],
});
const session =
await seal.session.createSession({
learnerId: "learner-1",
activityId: "activity-1",
});PlatformBuilder
PlatformBuilder creates a SealPlatform with shared infrastructure and
connected engine instances.
Available configuration methods:
withConfig(config)merges SDK configuration values.withLogger(logger)replaces the default console logger.withWorkflow(enabled)controls whether the Workflow Engine is registered in theEngineRegistry.build()creates the platform.
Platform surface
A built platform exposes:
activitysessionevidenceassessmentprogressmasteryplayableanalyticsworkflowintegrationplugin
It also exposes shared infrastructure:
containerregistryeventBusloggerconfig
Configuration
The current SealConfig contract supports:
interface SealConfig {
locale?: string;
telemetry?: boolean;
analytics?: boolean;
}withConfig() stores and exposes these values through platform.config.
The current contract does not use telemetry or analytics as automatic
feature toggles.
Workflow registration
Workflow is enabled by default.
const seal = new PlatformBuilder()
.withWorkflow(false)
.build();When disabled, the Workflow Engine is not registered in the
EngineRegistry. It remains available through platform.workflow.
EngineRegistry
The Platform registers its engine-oriented capabilities in a shared
EngineRegistry. This allows engines and plugins to discover host
capabilities without depending directly on the complete Platform object.
The Plugin Engine receives the same Registry instance used by the Platform.
Container
The shared dependency injection container exposes platform capabilities that participate in container-based composition, including Evidence, Assessment and Playable.
Design principles
The Platform package follows these principles:
- one composition root for SDK capabilities;
- shared infrastructure between engines;
- explicit public contracts;
- modular learning-domain engines;
- Registry-based engine discovery;
- container-based dependency composition;
- configurable logging;
- incremental extensibility through Integration and Plugin.
