The cyrnel sdk package exports a small set of typescript types that
describe the data cyrnel exchanges between the host, adapters, and
environments. Everything else builds on these.
JSONSchema
A free-form JSON document. Cyrnel internally validates payloads against the
schema, any valid JSON schema format is fair game. Adapters and environments
treat schemas as opaque.
ServiceDefinition
The shape an adapter returns from generateDefinition. Cyrnel persists this
into the services table along with an id, hash, source,
adapter, and enabled flag. See Services.
summary is an optional short plain-text description shown in lists and
search. Keep it terse; use description for long-form markdown.
configSchema describes per-service configuration (validated on PATCH).
secretsSchema describes per-service secrets (validated on PATCH).
adapterDomain is opaque to cyrnel. Adapters use it to carry
install-time information that the runtime needs at invoke time.
The shape of each entry in ServiceDefinition.tools. id must be a
valid TypeScript identifier; it is what process code addresses. summary
is an optional short plain-text label, mirroring the service-level summary.
The snapshot cyrnel hands to an adapter through
AdapterModule.hydrateService. It carries everything the adapter needs to
serve invocations:
adapterDomain: The bag the adapter populated in generateDefinition.
tools: Per-tool adapterDomain keyed by tool id.
config: Validated configuration object (defaults applied).
secrets: Decrypted secrets object (defaults applied).
Adapters should treat this as the source of truth and refresh their
internal state every time hydrateService is called.
The payload of every tool call:
- Environment modules receive it through
EnvironmentBindings.invokeTool.
- Adapter modules receive it through
AdapterModule.invoke.
- The host validates
parameters against the tool’s inputSchema before
the adapter sees it (adapter-side validation is optional but
recommended).
Passed to EnvironmentModule.generateToolDocs when the API serves
GET /tools/:serviceId/:toolId/docs. The environment is expected to
return Markdown.
Module logging
The host owns all logging. A module receives a single ModuleLogger through
its setup context and never constructs a root logger. Every entry a module
emits is automatically tagged with type: "module", moduleId,
moduleType, and the owning adapterId/environmentId, these correlation
fields are host-managed and the module cannot forge or override them.
MODULE_LOG_LEVELS and ModuleLogLevel
The severity levels a module logger accepts. The API maps these to its own
internal level vocabulary, so modules are insulated from API-specific level
names.
ModuleLogBindings
The only correlation fields a module may set. phase groups a span of work
(e.g. "setup", "invoke", "execution"), and event is a structured key
describing a specific occurrence (e.g. "adapter-request"). All other
correlation fields (moduleId, moduleType, adapterId/environmentId,
serviceId, toolId, executionId, dispatchId, requestId) are set by the
host and ignored if a module attempts to supply them.
ModuleLogPayload
The free-form structured object a module passes alongside an optional message.
Values are subject to the module’s own redact() patterns and the host
baseline before being stored.
ModuleLogger
Usage:
child(bindings) returns a new logger that merges only phase/event.
Host-owned correlation fields are carried over and cannot be overwritten.
redact(patterns) returns a new logger that applies the module’s path
patterns additively on top of a non-disableable host baseline
(secrets / tokens / passwords / authorization). Chained redact() calls
accumulate patterns; non-string or empty-split patterns are ignored so a
malformed pattern can never redact the whole payload. The host never pushes
patterns into the setup context - reduction is configured by the module, for
the module.
context is Readonly: a module reads but never mutates the logger’s
bound metadata.
ModuleSetupContext and AdapterSetupContext
Passed to Module.setup. config and secrets are the validated
module-level objects from its configSchema/secretsSchema; logger is the
host-owned logger described above. AdapterSetupContext is a plain alias of
ModuleSetupContext, the adapter-vs-environment distinction lives in the
AdapterModule/EnvironmentModule interfaces, not in the context type.
Execution constants
The vocabulary an environment uses to report progress. ProcessService
adds idle and terminating on top, those are host-side states, not
environment-reported ones. See Execution and
Processes. Last modified on August 25, 2026