Location: skill_router.py
class SandboxType(str, Enum):
NATIVE = 'native' # same process, no isolation
DOCKER = 'docker' # Docker container
WASM = 'wasm' # WASM runtimeLocation: skill_router.py
@dataclass
class SkillIsolationPlan:
sandbox_type: SandboxType
memory_limit_mb: Optional[float] = None
timeout_seconds: int = 30
network_access: bool = FalseLocation: skill_executor.py:29
@dataclass(frozen=True)
class SkillExecutionResult:
success: bool
sandbox_type: SandboxType
output: Any = None # deserialized result from skill
error: str = '' # non-empty if success=False
execution_backend: str = '' # e.g. 'docker:python:3.12-slim'
reason: str = '' # why this sandbox was chosenLocation: skill_router.py
def plan_skill_isolation(skill_path: Path) -> SkillIsolationPlanReads skill.yaml manifest, checks risk level, returns isolation plan. Falls back to NATIVE if Docker/WASM unavailable.
Location: skill_executor.py
def execute_skill(
skill_path: Path,
payload: dict[str, Any],
isolation_plan: Optional[SkillIsolationPlan] = None,
) -> SkillExecutionResultPre: skill_path must contain a tool.py or tool.wasm.
Post: Returns SkillExecutionResult. Never raises (exceptions are captured into error field).
Dispatch priority:
- WASM →
WASMRuntime.run(wasm_file, payload) - DOCKER →
DockerSandbox.run(code, payload) - NATIVE →
importlib.import_module(tool).run(payload)
Location: skill_router.py
class SkillRouter:
def register(self, skill: SkillManifest) -> None
def route(self, query: str, top_k: int = 3) -> list[SkillCandidate]
def get(self, name: str) -> Optional[SkillManifest]
def list_skills(self) -> list[SkillManifest]~/.teaagent/skills/<skill-name>/
skill.yaml # manifest (name, description, risk_level, sandbox)
tool.py # main entrypoint: def run(payload: dict) -> Any
tool.wasm # optional WASM binary
requirements.txt # optional: pip packages for Docker
name: my-skill
description: "What this skill does (used for semantic routing)"
version: "1.0.0"
risk_level: low # low | medium | high
sandbox: native # native | docker | wasm
timeout_seconds: 30
memory_limit: "512mb"
network_access: false