Skip to content

Interface: ExtensionCoordinatorOptions

Makaio Framework


Makaio Framework / kernel/extension / ExtensionCoordinatorOptions

Defined in: ../../../packages/kernel/src/extension/types.ts:27

Options for constructing an ExtensionCoordinator.

optional capabilities?: ReadonlySet<string>

Defined in: ../../../packages/kernel/src/extension/types.ts:60

Host-provided environment capability tokens.

Packages whose MakaioExtension.requires entries are not all present in this set are excluded during ExtensionCoordinator.load. Omit the set only in tests that intentionally bypass environment gating.


optional db?: unknown

Defined in: ../../../packages/kernel/src/extension/types.ts:39

Optional database instance for storage handler registration (opaque — cast to MakaioDatabase at call site).


optional extensionContextBase?: Omit<NodeExtensionContext, "config" | "identity" | "bus" | "signal" | "getService" | "dataDir" | "hasExtension">

Defined in: ../../../packages/kernel/src/extension/types.ts:49

Node host fields for the context supplied to extension factories.

Required when any loaded extension declares a create factory. When absent, extensions with create will fail to start.

Omit config, signal, and hasExtension — those are coordinator-owned and assembled per extension at context-build time.


optional launcherCommand?: string

Defined in: ../../../packages/kernel/src/extension/types.ts:37

Host launcher command embedded into client wiring installed from warning actions.

Defaults to 'makaio' for framework-only hosts. Hosts pass their own launcher policy through this seam so the runtime does not infer it from process entrypoints.


optional loadConfig?: (name) => Record<string, unknown> | undefined

Defined in: ../../../packages/kernel/src/extension/types.ts:75

Optional callback to retrieve stored configuration for a package during startAll and enablePackage. Returns undefined when no stored config exists.

string

Record<string, unknown> | undefined


optional loadEnabled?: (name) => boolean | undefined

Defined in: ../../../packages/kernel/src/extension/types.ts:70

Optional callback to retrieve persisted enabled state during startAll. Returns false to skip a package at boot, true or undefined to start normally.

string

boolean | undefined


optional persistEnabled?: (name, enabled) => Promise<void>

Defined in: ../../../packages/kernel/src/extension/types.ts:65

Optional callback to persist enabled/disabled state after a setEnabled call. The composition root supplies this to bridge into PreferencesSubjects or another durable store.

string

boolean

Promise<void>


optional runMigrations?: (sources) => Promise<void>

Defined in: ../../../packages/kernel/src/extension/types.ts:100

Optional callback invoked by ExtensionCoordinator.startAll to run database migrations declared by loaded packages before any services start.

The coordinator collects all packages whose StorageManifest.migrations field is set and passes them as an array of { name, migrationsPath, migrationSourceId } objects to this callback in topological (dependency) order. The callback is responsible for applying pending migrations — typically via Drizzle migrate() or the bundled applyMigrations() helper — using a tracking table keyed to the migration bundle identity so packages that share one folder share one ledger.

When absent, declared migrations are silently skipped and storage tables that depend on them will not be created at runtime.

The migrationsPath values are absolute discovery paths resolved by the coordinator from each package’s StorageManifest.migrations field plus executable storage.packageRoot metadata when needed. migrationSourceId is the stable runtime identity used for bundled hosts; when a package does not declare one, it falls back to migrationsPath.

readonly object[]

Migration sources in dependency order, each carrying the package name, absolute migration folder path, and stable source id.

Promise<void>

A promise that resolves when all migrations have been applied.


optional surface?: ExtensionRuntimeSurface

Defined in: ../../../packages/kernel/src/extension/types.ts:29

Hosted surface category used to apply package gating. Defaults to 'headless'.