Skip to main content
An engine runs one fresh agent attempt and returns a structured result or a typed failure. This package holds that contract and the memory port, shared by the runtime and plugins. It also defines and checks graph plans, stored events and artifacts, workspace bindings, callbacks, and proof records. The runtime executes graphs and reads or writes those records. Command execution belongs to core; memory helpers belong to runtime.

The contract

An Engine has a name and a run method: one request, one event sink, one abort signal, one AgentResult. It may also have admit, which the runtime calls before a run when the plan asks for engine checks: admit receives the request without its prompt, and returns the identity the engine will run under, an EngineSelectionRecord with adapter, provider, model family, model, executable and capabilities. When the runtime passes the identity it saved earlier, an engine that would now run as something else refuses. An engine without admit is unsupported for the check, and the plan says whether that blocks the run. A live check is an ordinary run with purpose: 'preflight', no tools, no workspace and a leaf request. It proves the seat answers; it does no work. For a command-line adapter that needs an absolute executable, use resolveCommandExecutable('opencode') from @obversa/core/command. It reads the reader’s PATH when the file runs, so a copied example does not contain a machine-specific path.

Run one

This file runs a graph whose engine is not ready and shows the check pause the run before any dispatch, then the resume once the engine is ready. The engine implements both admit and run; it is in examples/preflight-host.mjs.
What it printed is on the graph executor page.

Public entry points

modelIdentity returns a ModelIdentity: the model family and, when the input names it, the provider. provider/model supplies both; a bare model supplies only its family. The family is the lowercase part before the model’s first hyphen. Whitespace inside the identifier, a second slash, an empty provider or model, and an empty or unknown family are refused with an EngineError of kind invalid-config. TeamSeat pairs an engine with its declared identity for workflow roles. SUBAGENT_TOOLS and CLAUDE_SUBAGENT_TOOLS are the shared lists of sub-agent tool names.

Memory contract

A Memory adapter has one scope and one execute(command) method. MEMORY_ROOT is /memories; every memory path starts there. Commands are view, create, str_replace, insert, delete and rename. MemoryCommand, MemoryResult and MemoryLimits describe requests, results and limits. The memory conformance kit lives at @obversa/api/testing. Use ground, curate and consolidate from @obversa/runtime/memory to read declared sources, select context and write a validated result.

Gotchas

  • Unsupported is not a success. An engine without admit passes a static check only when the lane’s policy allows unsupported seats.
  • A command-line adapter is admitted by path and version, not by a hash of the executable, and it does not control grandchildren it cannot see. An API-key adapter is admitted locally, with no executable, and its retry layers are off for the check only.

Source

packages/api in the repository. The plugins under plugins/ implement this contract; the plugins page lists them.