The registry is used to store and lookup actions, trace stores, flow state stores, plugins, and schemas.

Constructors

Properties

asyncStore: AsyncStore
dotprompt: Dotprompt
parent?: Registry

Methods

  • Initializes all plugins in the registry.

    Returns Promise<void>

  • Initializes a plugin already registered with registerPluginProvider.

    Parameters

    • name: string

      The name of the plugin to initialize.

    Returns Promise<void | InitializedPlugin>

    The plugin.

  • Returns all actions in the registry.

    Returns Promise<ActionsRecord>

    All actions in the registry.

  • Type Parameters

    • T

    Parameters

    • type: string

    Returns Promise<Record<string, T>>

  • Looks up an action in the registry.

    Type Parameters

    Parameters

    • key: string

      The key of the action to lookup.

    Returns Promise<R>

    The action.

  • Looks up a plugin.

    Parameters

    • name: string

      The name of the plugin to lookup.

    Returns undefined | PluginProvider

    The plugin provider.

  • Looks up a schema.

    Parameters

    • name: string

      The name of the schema to lookup.

    Returns undefined | Schema

    The schema.

  • Type Parameters

    • T = unknown

    Parameters

    • type: string
    • key: string

    Returns Promise<undefined | T>

  • Registers an action in the registry.

    Type Parameters

    Parameters

    Returns void

  • Registers an action promise in the registry.

    Type Parameters

    Parameters

    Returns void

  • Registers a plugin provider. This plugin must be initialized before it can be used by calling initializePlugin or initializeAllPlugins.

    Parameters

    • name: string

      The name of the plugin to register.

    • provider: PluginProvider

      The plugin provider.

    Returns void

  • Registers a schema.

    Parameters

    • name: string

      The name of the schema to register.

    • data: Schema

      The schema to register (either a Zod schema or a JSON schema).

    Returns void

  • Parameters

    • type: string
    • name: string
    • value: any

    Returns void

  • Creates a new registry overlaid onto the provided registry.

    Parameters

    Returns Registry

    The new overlaid registry.