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

Constructors

Properties

apiStability: "beta" | "stable"
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 that have been registered in the registry.

    Returns Promise<ActionsRecord>

    All actions in the registry as a map of <key, action>.

  • Returns all actions that are resolvable by plugins as well as those that are already in the registry.

    NOTE: this method should not be used in latency sensitive code paths. It may rely on "admin" API calls such as "list models", which may cause increased cold start latency.

    Returns Promise<ActionMetadataRecord>

    All resolvable action metadata as a map of <key, action metadata>.

  • 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 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

  • Resolves a new Action dynamically by registering it.

    Parameters

    • pluginName: string

      The name of the plugin

    • actionType: ActionType

      The type of the action

    • actionName: string

      The name of the action

    Returns Promise<void>

  • Creates a new registry overlaid onto the provided registry.

    Parameters

    Returns Registry

    The new overlaid registry.