# tmuxp.workspace.builder.resolve_builder_paths

- **Module:** tmuxp.workspace.builder
- **Package:** tmuxp
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/tmuxp/blob/153acdf6ff1268b14d3d03ed488f545a7123c8f1/src/tmuxp/workspace/builder/registry.py#L41
- **Page:** https://libtmux.org/en/py/latest/workspace/reference/tmuxp-workspace-builder-resolve_builder_paths/

```
tmuxp.workspace.builder.resolve_builder_paths(session_config: dict[str, t.Any], workspace_file: str | os.PathLike[str] | None = None) -> list[pathlib.Path]
```

Resolve and validate trusted ``workspace_builder_paths`` import roots.

Each entry is shell-expanded (``~`` and ``$VARS``), resolved relative to the
workspace file's directory when not absolute, and required to be an existing
directory. Returns ``[]`` when the key is absent, so existing workspaces add
nothing to ``sys.path``.

## Parameters

- `session_config` (dict[str, t.Any]): the expanded workspace configuration
- `workspace_file` (str | os.PathLike[str] | None): path to the workspace file; its parent anchors relative entries

## Returns

list of pathlib.Path

## Example

Absent key resolves to an empty list (no-op for existing workspaces):

```python
>>> resolve_builder_paths({}, None)
[]
```

## Example

An existing directory is resolved:

```python
>>> root = tmp_path / "roots"
>>> root.mkdir()
>>> resolve_builder_paths({"workspace_builder_paths": [str(root)]}, None) == [
...     root.resolve()
... ]
True
```

## Example

A missing directory is rejected:

```python
>>> resolve_builder_paths(
...     {"workspace_builder_paths": [str(tmp_path / "missing")]}, None
... )
Traceback (most recent call last):
...
tmuxp.exc.WorkspaceBuilderPathError: ...
```
