Interface: MakaioExtension<THostContext>
Makaio Framework / contracts / MakaioExtension
Interface: MakaioExtension<THostContext>
Section titled “Interface: MakaioExtension<THostContext>”Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:122
Executable Makaio extension manifest.
Extends ExtensionManifest with executable code: a service factory, a CLI contribution with interactive TUI support, and a Drizzle storage handler registration callback.
Source-of-truth rule: fields on this executable extension are the runtime wiring source. Serializable descriptor fields, including ExtensionManifest.contributions, are discovery metadata and are not promoted into executable contribution surfaces by the loader.
The host runtime calls create (if defined) with a ExtensionContext to instantiate the service. Window-only extensions that have no background service may omit create entirely.
Example
Section titled “Example”export const myExtension: MakaioExtension = { name: 'my-extension', displayName: 'My Extension', create: (ctx) => new MyService(ctx.bus),};Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”THostContext
Section titled “THostContext”THostContext extends ExtensionContext = NodeExtensionContext
Concrete context shape supplied by the host runtime. Defaults to NodeExtensionContext because the current framework hosts are Node-based.
Properties
Section titled “Properties”adapters?
Section titled “adapters?”
readonlyoptionaladapters?: readonlyAdapterContribution<unknown>[]
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:277
Adapter runtime definitions contributed by this extension.
Each entry pairs JSON-serializable discovery metadata with the full
runtime adapter definition typed via AdapterDefinitionContract.
The adapter contribution processor consumes this executable field directly;
descriptor contributions.adapters is not a registration fallback.
bootstrap?
Section titled “bootstrap?”
readonlyoptionalbootstrap?:ExtensionBootstrap
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:334
Bootstrap capability for project config import/export.
When present, this extension participates in:
- Project export: extension data can be saved to
.makaio/bootstrap/ - Project import: extension data can be restored from
.makaio/bootstrap/
browser?
Section titled “browser?”
readonlyoptionalbrowser?:object
Defined in: ../../../packages/contracts/src/extension/manifest.ts:388
Browser entry point for this extension. URL path the renderer fetches to load the extension’s UI.
entrypoint
Section titled “entrypoint”entrypoint:
string
URL path the renderer fetches to load the extension’s UI.
Must be an absolute path (starts with /). The loader additionally
enforces a /extensions/ prefix at runtime as defence-in-depth.
Example
Section titled “Example”'/extensions/my-extension/browser/index.js'Inherited from
Section titled “Inherited from”
readonlyoptionalcli?:ExtensionCliContribution
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:161
Executable CLI contribution registered under makaio <name>.
The runtime exposes the fully typed helper API through
@makaio/kernel/cli when authoring CLI commands. This manifest stores
only the type-erased executable shape used after loading.
Overrides
Section titled “Overrides”clients?
Section titled “clients?”
readonlyoptionalclients?: readonlyobject[]
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:246
Client runtime definitions contributed by this extension.
Loaded clients are passed to createClientsCorePackage during boot and
registered with the client bootstrap service. These definitions are the
runtime source of truth for client wiring; descriptor contributions.clients
is discovery metadata only.
configSchema?
Section titled “configSchema?”
readonlyoptionalconfigSchema?:ZodType<unknown,unknown,$ZodTypeInternals<unknown,unknown>>
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:223
Zod schema describing this extension’s configuration shape.
When present, the coordinator:
- Exposes the schema as JSON Schema via
extension.getConfigSchemaRPC - Loads stored config from
ExtensionConfigStorageSubjectsat boot - Parses it through this schema and injects the result into ExtensionContext.config
The schema should provide .default() values for all optional fields
so parsing {} always yields a valid config.
contributions?
Section titled “contributions?”
readonlyoptionalcontributions?:ContributionManifest
Defined in: ../../../packages/contracts/src/extension/manifest.ts:398
Adapters and client binaries contributed by this extension.
Discovery-time metadata only — serializable and safe to inspect without loading any extension code. Runtime activation and registration use the executable contribution fields on MakaioExtension; descriptor metadata may mirror those fields for pre-load introspection but is not used as a fallback wiring source.
Inherited from
Section titled “Inherited from”ExtensionManifest.contributions
create?
Section titled “create?”
readonlyoptionalcreate?: (ctx) =>ExtensionService|Promise<ExtensionService>
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:135
Factory that creates and returns the extension’s service.
Optional — window-only extensions that have no background service may omit this field entirely. When present, the host calls this during startup; the extension is responsible for all internal composition (choosing backends, creating sources, etc.) based on the provided context.
Parameters
Section titled “Parameters”THostContext
Runtime context with bus, host details, and machine identity.
Returns
Section titled “Returns”ExtensionService | Promise<ExtensionService>
The extension’s service instance (not yet initialized — host calls init).
critical?
Section titled “critical?”
readonlyoptionalcritical?:boolean
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:153
When true, startup fails if this extension fails to initialize.
Optional extensions default to isolated failure so one extension cannot prevent the runtime from booting. Framework and host core extensions set this to true when the runtime cannot safely continue without them.
dependencies?
Section titled “dependencies?”
readonlyoptionaldependencies?: readonlystring[]
Defined in: ../../../packages/contracts/src/extension/manifest.ts:355
Names of other extensions this extension depends on.
The registry ensures dependencies are initialized before this extension. Values are ExtensionManifest.name identifiers.
Inherited from
Section titled “Inherited from”ExtensionManifest.dependencies
displayName
Section titled “displayName”
readonlydisplayName:string
Defined in: ../../../packages/contracts/src/extension/manifest.ts:340
Human-readable display name shown in UI surfaces (e.g. 'Auth Switcher').
Inherited from
Section titled “Inherited from”
readonlyoptionalhttp?:object
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:169
Server-side HTTP routes.
Hosts that support HTTP route contributions call mount() on a fresh,
rebuildable app graph as extensions activate or stop. Contracts keeps the
app type erased so this layer does not depend on Hono.
readonlymount: (app) =>void
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”void
prefix
Section titled “prefix”
readonlyprefix:string
Host-owned HTTP app instance.
logImport?
Section titled “logImport?”
readonlyoptionallogImport?:LogImportContribution
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:285
Log import capability for external tool session import.
Opaque in contracts. The log-import contribution processor narrows
config to PluginLogImport at processing time.
readonlyname:string
Defined in: ../../../packages/contracts/src/extension/manifest.ts:338
Unique extension identifier.
Accepts plain identifiers (e.g. 'account-manager') and npm-scoped
names (e.g. '@acme/weather-tools'). Used as the primary key in the
extension registry and as the top-level CLI command name when no
cli override is provided.
Inherited from
Section titled “Inherited from”namespace?
Section titled “namespace?”
readonlyoptionalnamespace?:ExtensionNamespaceContribution
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:343
Bus namespace introspection for this extension.
The domain is auto-prefixed to 'extension:NAME' to avoid collisions.
Register schemas statically in a namespace.ts file for type-safe
subjects, then reference them here for documentation and introspection.
providers?
Section titled “providers?”
readonlyoptionalproviders?: readonlyobject[]
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:263
Provider definitions contributed by this extension.
Each entry defines a model provider (e.g., Anthropic, OpenAI) with its supported models, capabilities, and credential requirements. Loaded providers are registered with the provider subsystem during boot.
Provider definitions are executable extension contributions. Descriptor
contributions.providers may mirror provider identity metadata for
pre-load discovery, but is not a registration fallback.
provides?
Section titled “provides?”
readonlyoptionalprovides?: readonlyCapabilityToken[]
Defined in: ../../../packages/contracts/src/extension/manifest.ts:369
Capability tokens this extension provides when active.
Consumers and onboarding surfaces can inspect these declarations to decide whether a capability exists at all before prompting the user to configure it.
Inherited from
Section titled “Inherited from”requires?
Section titled “requires?”
readonlyoptionalrequires?: readonlystring[]
Defined in: ../../../packages/contracts/src/extension/manifest.ts:362
Host-provided environment capability tokens this extension requires.
This is an environment compatibility gate, not an extension-to-extension dependency. Use dependencies for structural extension ordering.
Inherited from
Section titled “Inherited from”runtimeBoot?
Section titled “runtimeBoot?”
readonlyoptionalruntimeBoot?:ExtensionRuntimeBootContribution<THostContext>
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:145
Boot-time executable contribution for registering runtime processors or services before package startup begins.
runtimeOwnership?
Section titled “runtimeOwnership?”
readonlyoptionalruntimeOwnership?:ExtensionRuntimeOwnership
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:140
Executable ownership declarations for runtime responsibilities that must have exactly one owner in a booted runtime.
sessionEventActions?
Section titled “sessionEventActions?”
readonlyoptionalsessionEventActions?:ExtensionSessionEventActionsContribution
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:325
Session event action factory for this extension.
When present, the runtime calls createActions(ctx) after all
dependencies are loaded and registers the returned declarations with
SessionEventActionService. Unregister callbacks are stored for
shutdown cleanup.
storage?
Section titled “storage?”
readonlyoptionalstorage?:StorageManifest&object
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:185
Executable storage contribution.
Extends StorageManifest (migration paths) with a Drizzle handler registration callback invoked by the composition root after migrations have been applied but before services are started.
The db parameter is typed as unknown in the contracts layer (which
does not take a drizzle dependency) — composition roots cast it to
MakaioDatabase before calling. The returned cleanup function is
invoked during graceful shutdown to unregister bus handlers.
Type Declaration
Section titled “Type Declaration”migrationSourceId?
Section titled “migrationSourceId?”
readonlyoptionalmigrationSourceId?:string
Stable runtime identity for the migration bundle.
Bundled hosts use this instead of packaged output paths when they need a durable key for migration deduplication and embedded lookup.
packageRoot?
Section titled “packageRoot?”
readonlyoptionalpackageRoot?:string
Absolute extension root used to resolve relative storage asset paths.
Required when a code-defined extension declares relative StorageManifest.migrations paths, since there is no descriptor file path for the runtime to infer from.
registerHandlers?
Section titled “registerHandlers?”
readonlyoptionalregisterHandlers?: (bus,db,ctx) =>void| (() =>void)
Registers Drizzle-backed bus storage handlers for this extension.
Parameters
Section titled “Parameters”The application bus instance.
unknown
The Drizzle database instance (typed opaquely here; cast at the call site).
THostContext
Runtime extension context supplying host details and machine identity (e.g., for machine-scoped storage registration).
Returns
Section titled “Returns”void | (() => void)
Optional cleanup function called during shutdown to unregister handlers.
Overrides
Section titled “Overrides”surface?
Section titled “surface?”
readonlyoptionalsurface?:"any"|"interactive"|"headless"
Defined in: ../../../packages/contracts/src/extension/manifest.ts:348
Execution surface the extension targets.
'interactive'— requires a UI shell (e.g., Electron renderer).'headless'— suitable for daemon or CLI-only runtimes.'any'— works in any surface (default when omitted).
Inherited from
Section titled “Inherited from”tools?
Section titled “tools?”
readonlyoptionaltools?:ExtensionToolsContribution<THostContext>
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:299
Tool contribution factory for this extension.
When present, the runtime calls createToolsets(ctx) after all
dependencies are loaded and registers the returned toolsets with
ToolRegistry. Extensions that contribute tools should declare a dependency
on the tool-registry service if one is required for registration.
readonlyoptionaltray?:TrayManifest
Defined in: ../../../packages/contracts/src/extension/manifest.ts:373
System tray entry for this extension.
Inherited from
Section titled “Inherited from”triggers?
Section titled “triggers?”
readonlyoptionaltriggers?:ExtensionTriggersContribution
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:315
Hash trigger factory for this extension.
When present, the runtime calls createTriggers(bus) after all
dependencies are loaded, then registers the returned triggers with
HashTriggerService.
Extensions declaring triggers should depend on 'hash-trigger' to ensure
the service exists when triggers are registered.
readonlyoptionalui?:ExtensionUiContribution
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:356
Browser UI contributions for this extension.
Groups all UI-layer contribution surfaces. Absent for headless-only extensions. The coordinator passes this bag to the web-framework loader which bridges each surface to the appropriate client-side registry.
uiConfig?
Section titled “uiConfig?”
readonlyoptionaluiConfig?:object
Defined in: ../../../packages/contracts/src/extension/makaio-extension.ts:232
UI configuration for schema-driven configuration forms.
Controls how the config form is rendered: edit mode (slidePanel vs full), which fields to hide, and per-field widget overrides (e.g. slider, color picker). Only meaningful when configSchema is also declared.
editMode
Section titled “editMode”editMode:
"inline"|"slidePanel"|"fullPage"
The editing mode for this entity
- inline: Edit directly in the list/card
- slidePanel: Edit in a slide-out panel
- fullPage: Edit on a dedicated full page
fieldOverrides?
Section titled “fieldOverrides?”
optionalfieldOverrides?:Record<string, {delimiter?:string;helpText?:string;max?:number;min?:number;options?:object[];placeholder?:string;step?:number;widget?:string; }>
Field-specific overrides for custom widgets and behavior Maps field name to widget configuration
hiddenFields?
Section titled “hiddenFields?”
optionalhiddenFields?:string[]
Fields to hide from the form UI These fields will not be rendered and cannot be edited
readOnlyInEditMode?
Section titled “readOnlyInEditMode?”
optionalreadOnlyInEditMode?:string[]
Fields that are read-only in edit mode These fields are visible but cannot be modified during editing
sections?
Section titled “sections?”
optionalsections?:object[]
Optional form sections for grouping related fields. When provided, fields are rendered in the given section order.
windows?
Section titled “windows?”
readonlyoptionalwindows?: readonlyWindowManifest[]
Defined in: ../../../packages/contracts/src/extension/manifest.ts:371
Windows this extension can open, keyed by WindowManifest.id.