Skip to content

livery.extensions.agents._agent

livery.extensions.agents._agent

What coding agents read in a workspace, answered for the workshop's engine.

The extension's extension.toml names these functions as its [fragments] renders: the workshop calls each with the workspace root while a workspace lists the extension, and writes what it answers. AGENTS.md is seeded at birth and committed for the repository's own facts; .claude/ and .agents/ belong to the checkout alone, controlled by [agents] enabled in workshop.toml.

Functions:

Name Description
enabled_agents

The agents enabled in root's workshop.toml under [agents] enabled.

claude_files

.claude/: rules, skills, hooks and settings.json when enabled.

antigravity_files

.agents/: rules, skills, hooks and hooks.json when enabled.

Attributes:

Name Type Description
SUPPORTED_AGENTS

SUPPORTED_AGENTS module-attribute

SUPPORTED_AGENTS = ('claude', 'antigravity')

enabled_agents

enabled_agents(root: Path) -> tuple[str, ...]

The agents enabled in root's workshop.toml under [agents] enabled.

Returns every supported agent when [agents] or enabled is absent. The contract schema validates the table, list shape, allowed values and uniqueness on read.

Source code in packages/extensions/agents/src/livery/extensions/agents/_agent.py
def enabled_agents(root: Path) -> tuple[str, ...]:
    """The agents enabled in *root*'s ``workshop.toml`` under ``[agents] enabled``.

    Returns every supported agent when ``[agents]`` or ``enabled`` is
    absent. The contract schema validates the table, list shape, allowed
    values and uniqueness on read.
    """
    contract = read_contract(root)
    table = contract.get("agents")
    if not isinstance(table, dict):
        return SUPPORTED_AGENTS
    raw = table.get("enabled")
    if not isinstance(raw, list):
        return SUPPORTED_AGENTS
    return tuple(str(name) for name in raw)

claude_files

claude_files(root: Path) -> dict[str, str | Path]

.claude/: rules, skills, hooks and settings.json when enabled.

Source code in packages/extensions/agents/src/livery/extensions/agents/_agent.py
def claude_files(root: Path) -> dict[str, str | Path]:
    """``.claude/``: rules, skills, hooks and ``settings.json`` when enabled."""
    if "claude" not in enabled_agents(root):
        return {}
    return _agent_directory(root, config_file="settings.json", target_dir=".claude")

antigravity_files

antigravity_files(root: Path) -> dict[str, str | Path]

.agents/: rules, skills, hooks and hooks.json when enabled.

Source code in packages/extensions/agents/src/livery/extensions/agents/_agent.py
def antigravity_files(root: Path) -> dict[str, str | Path]:
    """``.agents/``: rules, skills, hooks and ``hooks.json`` when enabled."""
    if "antigravity" not in enabled_agents(root):
        return {}
    return _agent_directory(root, config_file="hooks.json", target_dir=".agents")