Application
Create an app definition, then activate exactly one runtime handle from it.
createManifesto(schema, effects)
createManifesto() is the SDK entry point for the base runtime.
import { createManifesto } from "@manifesto-ai/sdk";
import todoMel from "./todo.mel";
import type { TodoDomain } from "./todo.domain";
const manifesto = createManifesto<TodoDomain>(todoMel, {});
const app = manifesto.activate();| Parameter | Meaning |
|---|---|
schema | A compiled DomainSchema or MEL source string |
effects | A record of SDK effect handlers, keyed by effect type. You can author it directly or via @manifesto-ai/sdk/effects. |
createManifesto() returns an app definition. Runtime reads and writes such as snapshot(), action.<name>.submit(), observe, and inspect exist only after activate().
Compiler tooling artifacts such as DomainModule are outside this seam. If you compile through compileMelModule(), pass module.schema to createManifesto(), not the whole module.
Tooling vs Runtime
import { compileMelModule } from "@manifesto-ai/compiler";
import { createManifesto } from "@manifesto-ai/sdk";
const result = compileMelModule(melSource, { mode: "module" });
const module = result.module!;
const manifesto = createManifesto(module.schema, {});
const annotations = module.annotations;
const sourceMap = module.sourceMap;createManifesto()accepts MEL source orDomainSchema.createManifesto()does not acceptDomainModule.- tooling may read
module.annotations,module.sourceMap, andmodule.graph, but the runtime still starts from the schema. - importing a
.melfile through the default loader/bundler path still yields schema-only output, even when the MEL source uses@meta.
Activation Boundary
const app = createManifesto(schema, effects).activate();Activation owns the host loop, Snapshot projection, observers, action handles, and runtime inspection surface.
Do not activate the same app definition more than once. Create a new app definition if you need a separate runtime instance.
Decorate Before Activation
Optional approval and history layers wrap the app definition before it is activated. Skip this section when you only need the base runtime.
import { createManifesto } from "@manifesto-ai/sdk";
import { createInMemoryLineageStore, withLineage } from "@manifesto-ai/lineage";
import { createInMemoryGovernanceStore, withGovernance } from "@manifesto-ai/governance";
const app = withGovernance(
withLineage(createManifesto(schema, effects), {
store: createInMemoryLineageStore(),
}),
{
governanceStore: createInMemoryGovernanceStore(),
bindings,
execution,
},
).activate();The MEL domain stays the same. Base, history, and approval modes all expose the same action handles; their submit() result types express the active runtime mode.
Next
- Inspect the activated handle in Runtime Instance
- Submit work with Actions and Availability
- Add approval in Optional Approval/History Runtime