Skip to content

SkillRuntime

autogen.beta.tools.runtime.protocol.SkillRuntime #

Bases: Protocol

Unified runtime: storage, discovery, and execution of skills.

A runtime is responsible for three concerns:

  1. Storage — where skills are installed (install, remove).
  2. Discovery — scanning for installed skills (discover, load, invalidate).
  3. Execution — providing a shell environment to run scripts (shell).

:class:LocalRuntime is the default implementation.

cleanup property #

cleanup

Delete runtime storage on process exit.

lock_dir property #

lock_dir

Local directory where skills-lock.json is stored.

Always a local path — the lock file is host metadata, not runtime storage. LocalRuntime returns _install_dir. A future DockerRuntime would return a configurable local directory.

discover #

discover()

Return metadata for all installed skills.

Source code in autogen/beta/tools/runtime/protocol.py
def discover(self) -> list[SkillMetadata]:
    """Return metadata for all installed skills."""
    ...

load #

load(name)

Return the full SKILL.md text for name.

Source code in autogen/beta/tools/runtime/protocol.py
def load(self, name: str) -> str:
    """Return the full ``SKILL.md`` text for *name*."""
    ...

get_path #

get_path(name)

Return the directory path of a skill by name.

RAISES DESCRIPTION
KeyError

if no skill with that name is found.

Source code in autogen/beta/tools/runtime/protocol.py
def get_path(self, name: str) -> Path:
    """Return the directory path of a skill by name.

    Raises:
        KeyError: if no skill with that name is found.
    """
    ...

invalidate #

invalidate()

Clear discovery cache (call after install / remove).

Source code in autogen/beta/tools/runtime/protocol.py
def invalidate(self) -> None:
    """Clear discovery cache (call after install / remove)."""
    ...

ensure_storage #

ensure_storage()

Ensure the storage backend is ready.

LocalRuntime creates the install directory. A DockerRuntime might create a container volume. A no-op for read-only runtimes.

Source code in autogen/beta/tools/runtime/protocol.py
def ensure_storage(self) -> None:
    """Ensure the storage backend is ready.

    ``LocalRuntime`` creates the install directory.  A ``DockerRuntime``
    might create a container volume.  A no-op for read-only runtimes.
    """
    ...

install #

install(source, name)

Move an extracted skill from a staging directory into runtime storage.

PARAMETER DESCRIPTION
source

Local staging directory that contains the skill files.

TYPE: Path

name

Skill name (used as the sub-directory name in storage).

TYPE: str

Source code in autogen/beta/tools/runtime/protocol.py
def install(self, source: Path, name: str) -> None:
    """Move an extracted skill from a staging directory into runtime storage.

    Args:
        source: Local staging directory that contains the skill files.
        name:   Skill name (used as the sub-directory name in storage).
    """
    ...

remove #

remove(name)

Delete an installed skill from storage.

RAISES DESCRIPTION
ValueError

If name would resolve outside the install directory.

FileNotFoundError

If no skill with name is installed.

Source code in autogen/beta/tools/runtime/protocol.py
def remove(self, name: str) -> None:
    """Delete an installed skill from storage.

    Raises:
        ValueError:      If *name* would resolve outside the install directory.
        FileNotFoundError: If no skill with *name* is installed.
    """
    ...

shell #

shell(scripts_dir)

Return a :class:~autogen.beta.tools.shell.ShellEnvironment for scripts_dir.

PARAMETER DESCRIPTION
scripts_dir

Absolute path to the skill's scripts/ directory. Callers resolve this path via the discovery loader so that both install-dir and extra-path skills are handled uniformly.

TYPE: Path

Source code in autogen/beta/tools/runtime/protocol.py
def shell(self, scripts_dir: Path) -> ShellEnvironment:
    """Return a :class:`~autogen.beta.tools.shell.ShellEnvironment` for *scripts_dir*.

    Args:
        scripts_dir: Absolute path to the skill's ``scripts/`` directory.
                     Callers resolve this path via the discovery loader so
                     that both install-dir and extra-path skills are handled
                     uniformly.
    """
    ...