Hook

HookContext

class teksi_hooks.hook.HookContext(parameters=<factory>, logger=<factory>, capabilities=<factory>)[source]

Runtime context passed to hook implementations.

The context contains user/configuration parameters, a logger and the capabilities available to the current hook run.

Parameters:
  • parameters (dict[str, Any])

  • logger (Logger)

  • capabilities (dict[type[Any], Any])

capability(capability_type)[source]

Return a capability instance by type.

Raises KeyError if the capability was not provided by the caller.

Parameters:

capability_type (type[T])

Return type:

T

Fields

parameters

Type: dict[str, Any]

Runtime parameters passed to the hook. These may come from configuration, command-line options or the calling workflow.

logger

Type: logging.Logger

Logger that hook implementations should use for runtime messages.

capabilities

Type: dict[type[Any], Any]

Available capabilities keyed by their capability type. Hooks declare required capability types via required_capabilities and retrieve them with capability(…).

HookMetadata

class teksi_hooks.hook.HookMetadata(name, description)[source]

Describes a hook implementation.

Metadata is used for validation, logging and user-facing diagnostics.

Parameters:
  • name (str)

  • description (str)

Fields

name

Type: str

Human-readable hook name used in logs and diagnostics.

description

Type: str

Short description of what the hook does.