Skip to main content

Module workspace

Module workspace 

Source
Expand description

Workspace root, show slug, active show, and the two on-disk layouts.

Port of the path half of models.py.

Constants§

DEFAULT_SLUG
Fallback slug when neither --show nor project.json names one.

Functions§

active_show
Slug from .active_show, or None when the file is absent.
code_root
$XIL_CODEROOT — where the software and the heavy model venvs live.
derive_paths
Auto-detect the layout: legacy when the cast config exists only at the legacy root location, normalized otherwise.
derive_paths_legacy
Legacy layout (pre-0.1.8) — what xil migrate-workspace moves away from.
derive_paths_new 🔒
Normalized layout (0.1.8+).
episode_tag
S01E01 when a season is known, E01 otherwise.
expanduser 🔒
~ expansion the way Path.expanduser() does it: only a leading ~.
python_str
How Python’s str() would render a scalar JSON value. Only the cases that can plausibly land in a config file are covered.
read_json_object 🔒
read_project
Parsed project.json, or an empty object when absent.
resolve 🔒
Path.resolve() — absolute, symlinks followed when the path exists.
resolve_project_type
Content type from project.json, defaulting to "podcast".
resolve_season
Season number from an explicit value, else project.json, else None.
resolve_season_title
Season/arc title from an explicit value, else project.json, else None. An empty string in the file counts as absent (Python: or None).
resolve_slug
Slug from --show, else project.json’s show, else DEFAULT_SLUG.
resolve_venv_python
resolve_venv_python(venv_name, explicit) — the interpreter of an optional local-model venv (venv-whisper, venv-chatterbox, …).
set_active_show
Write slug to .active_show in the workspace root (no trailing newline, same as Python’s write_text).
show_slug
Show title → filesystem-safe slug: lowercase, keep only [a-z0-9].
type_defaults
Per-type production defaults: gap between dialogue stems and a stability hint. stability is None where Python has None.
workspace_root
The active workspace root: $XIL_PROJECTROOT (expanded, resolved), else the current directory.

Type Aliases§

Paths
Every standard pipeline path for one episode, keyed by the same logical names as the Python dict.