# protocols

URL: /kida/api/environment/protocols/
Section: environment
Description: Protocols for Kida environment components.

Defines protocols for loaders, filters, and tests. These are static-only
type hints — they are not decorated with ``@runtime_checkable`` and are
not used with ``isinstance()`` anywhere in the codebase.

---

> For a complete page index, fetch /kida/llms.txt.

Open LLM text
(/kida/api/environment/protocols/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fenvironment%2Fprotocols%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fenvironment%2Fprotocols%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fenvironment%2Fprotocols%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fenvironment%2Fprotocols%2Findex.txt)

Module

#
`environment.protocols`

Protocols for Kida environment components.

Defines protocols for loaders, filters, and tests. These are static-only
type hints — they are not decorated with`@runtime_checkable`and are
not used with`isinstance()`anywhere in the codebase.

3Classes

## Classes

`Loader`

2

▼

Protocol for template loaders.

Protocol for template loaders.

#### Methods

`get_source`

1

`tuple[str, str | None]`

▼

Load template source.

`def get_source(self, name: str) -> tuple[str, str | None]`

##### Parameters

Name
Type
Description

`name`
`—`

Template identifier

##### Returns

`tuple[str, str | None]`

Tuple of (source_code, optional_filename)

`list_templates`

0

`list[str]`

▼

List all available templates.

`def list_templates(self) -> list[str]`

##### Returns

`list[str]`

`Filter`

1

▼

Protocol for template filters.

Protocol for template filters.

#### Methods

Internal Methods
1

▼

`__call__`

3

`Any`

▼

Apply filter to value.

`def __call__(self, value: Any, *args: Any, **kwargs: Any) -> Any`

##### Parameters

Name
Type
Description

`value`
`—`

`*args`
`—`

`**kwargs`
`—`

##### Returns

`Any`

`Test`

1

▼

Protocol for template tests.

Protocol for template tests.

#### Methods

Internal Methods
1

▼

`__call__`

3

`bool`

▼

Test value, return True/False.

`def __call__(self, value: Any, *args: Any, **kwargs: Any) -> bool`

##### Parameters

Name
Type
Description

`value`
`—`

`*args`
`—`

`**kwargs`
`—`

##### Returns

`bool`
