Skip to main content
The InterfaceDefinition class defines a reusable contract that integrations can implement. Interfaces allow you to standardize common patterns (like HITL, LLM, or storage capabilities) across multiple integrations.

Constructor

InterfaceDefinitionProps

string
required
Unique identifier for the interface.
string
required
Semantic version of the interface.
string
Human-readable title for the interface.
string
Brief description of what the interface provides.
string
Path to icon file (SVG recommended).
string
Path to readme/documentation file.
object
Entity definitions that integrations must provide schemas for.
Entities in interfaces act as type parameters. Integrations that implement the interface must map these to concrete entity types.
object
Event definitions the interface can emit. Events can reference entities.
object
Action definitions that integrations must implement.
Actions can use entity references in their schemas. The schema property is a function that receives entity references as a parameter.
object
Channel definitions for message-based communication.
object
Custom metadata attributes.
object
Advanced configuration options.

Type Definitions

GenericEventDefinition

Defines an event that can reference entities defined in the interface.

GenericActionDefinition

Defines an action with input/output schemas that can reference entities.

GenericChannelDefinition

Defines a channel with message types that can reference entities.

Properties

string
The interface name.
string
The interface version.
string | undefined
Human-readable title.
string | undefined
Interface description.
object
Entity definitions defined by the interface.
object
Event definitions with resolved entity references.
object
Action definitions with resolved entity references.
object
Channel definitions with resolved entity references.
object
Interface metadata including SDK version.

Understanding Entity References

Interfaces use a generic system where entities act as type parameters. When you define an action or event schema, you receive entity references that can be used in your schema:
The entity references are automatically transformed to use z.ref() internally, allowing integrations to map them to concrete entity types.

Complete Example: HITL Interface

interface.definition.ts

Complete Example: LLM Interface

interface.definition.ts

Implementing an Interface

Integrations implement interfaces using the extend method. See IntegrationDefinition for details on implementing interfaces.
When an integration extends an interface, it must:
  • Map interface entities to concrete entity types
  • Implement all required actions
  • Fire all required events
  • Support all defined channels

See Also