Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
chore(i18n): translate committed German to English in jarvis/skills/{runner,safe_imports,schema,skill_context} (isolated drain, batch 07_3_jarvis)
Ruben Lütke92553707085f
diff --git a/jarvis/skills/runner.py b/jarvis/skills/runner.pyindex 6c32162d31..db0b372ced 100644--- a/jarvis/skills/runner.py+++ b/jarvis/skills/runner.py@@ -1,13 +1,13 @@-"""SkillRunner: rendert Body (Jinja2-Sandbox) + führt Tool-Zeilen aus.+"""SkillRunner: renders the body (Jinja2 sandbox) + executes tool lines.-Body-Konvention:- Normaler Markdown-/Prose-Content.+Body convention:+ Normal Markdown/prose content.TOOL: <tool-name> {"arg": "value"}TOOL: other_tool {"k": 1}-Zeilen, die mit `TOOL:` beginnen, werden als Tool-Calls extrahiert-(nach dem Jinja-Rendering). Alles andere ist Prosa für LLM-Kontext.+Lines starting with `TOOL:` are extracted as tool calls+(after Jinja rendering). Everything else is prose for LLM context."""from __future__ import annotations@@ -23,7 +23,7 @@ from uuid import uuid4@dataclass(frozen=True)class _NowProxy:- """Jinja-friendly Wrapper um den aktuellen Zeitpunkt."""+ """Jinja-friendly wrapper around the current point in time."""iso: strepoch_ms: int@@ -32,7 +32,7 @@ class _NowProxy:@dataclass(frozen=True)class _DateProxy:- """Jinja-friendly Wrapper um das aktuelle Datum."""+ """Jinja-friendly wrapper around the current date."""iso: stryear: int@@ -83,7 +83,7 @@ _TOOL_LINE_RE = re.compile(r"^\s*TOOL:\s*(?P<name>\S+)\s*(?P<args>\{.*\})?\s*$")class SkillRunner:- """Runtime-Executor für Skills."""+ """Runtime executor for skills."""def __init__(self,@@ -108,7 +108,7 @@ class SkillRunner:# ------------------------------------------------------------------def render(self, skill: Skill, extra_context: dict[str, Any] | None = None) -> str:- """Rendert den Skill-Body via Jinja2-Sandbox."""+ """Renders the skill body via the Jinja2 sandbox."""if skill.frontmatter is None:return skill.bodyctx: dict[str, Any] = {@@ -146,7 +146,7 @@ class SkillRunner:@staticmethoddef extract_tool_calls(rendered_body: str) -> list[tuple[str, dict[str, Any]]]:- """Scannt Zeilen ab, die mit ``TOOL:`` beginnen."""+ """Scans lines starting with ``TOOL:``."""calls: list[tuple[str, dict[str, Any]]] = []for line in rendered_body.splitlines():m = _TOOL_LINE_RE.match(line)@@ -168,10 +168,10 @@ class SkillRunner:# ------------------------------------------------------------------async def _resolve_tool(self, name: str) -> Any | None:- """Versucht das Tool-Objekt aus dem Tool-Registry zu beschaffen."""+ """Tries to obtain the tool object from the tool registry."""if self.tool_registry is None:return None- # gängige APIs: .get(name), .resolve(name), __getitem__+ # common APIs: .get(name), .resolve(name), __getitem__for attr in ("get", "resolve"):fn = getattr(self.tool_registry, attr, None)if callable(fn):@@ -187,7 +187,7 @@ class SkillRunner:return Nonedef _check_risk(self, skill: Skill, tool_name: str) -> tuple[bool, str]:- """Gibt (allowed, reason). Wenn safety_enforcer fehlt, immer allow."""+ """Returns (allowed, reason). If safety_enforcer is missing, always allow."""if self.safety_enforcer is None or skill.frontmatter is None:return True, "no-enforcer"tier = skill.frontmatter.risk_policy.per_tool_overrides.get(@@ -217,7 +217,7 @@ class SkillRunner:skill: Skill,args: dict[str, Any] | None = None,) -> SkillResult:- """Führt den Skill aus (inkl. Tool-Calls)."""+ """Runs the skill (incl. tool calls)."""args = args or {}trace_id = uuid4()trigger_hint = args.get("_trigger", "manual")diff --git a/jarvis/skills/safe_imports.txt b/jarvis/skills/safe_imports.txtindex 2345ff0382..17713ff9eb 100644--- a/jarvis/skills/safe_imports.txt+++ b/jarvis/skills/safe_imports.txt@@ -1,15 +1,15 @@-# Allowlist erlaubter Python-Imports in Sub-Jarvis-authored Skills-# (Plan-§7.5 Sicherheits-Lint vor Promote, ergänzt durch Phase-7.5-Implementation).+# Allowlist of permitted Python imports in Jarvis-Agent-authored skills+# (Plan-§7.5 security lint before promote, extended by the Phase-7.5 implementation).#-# Skills sind Markdown mit YAML-Frontmatter — Python-Code-Blöcke darin-# werden nicht direkt ausgeführt; sie können aber via `scripts/`-Resources-# importiert werden. Dieser Lint scannt jeden Python-Block per AST und-# verbietet alles, was außerhalb dieser Liste liegt.+# Skills are Markdown with YAML frontmatter — Python code blocks inside+# are not executed directly; but they can be imported via `scripts/`+# resources. This lint scans every Python block via AST and+# forbids anything outside this list.#-# Format: ein Modulname pro Zeile, # für Kommentare. Submodule werden-# automatisch erlaubt (z.B. `pathlib.Path` → `pathlib` in der Liste).+# Format: one module name per line, # for comments. Submodules are+# allowed automatically (e.g. `pathlib.Path` → `pathlib` in the list).-# Stdlib — datenverarbeitend, ohne IO-Risiko+# Stdlib — data processing, no IO riskjsonretime@@ -35,13 +35,13 @@ http.clientloggingwarnings-# Async (für Skills mit Background-Tasks)+# Async (for skills with background tasks)asyncio-# Jarvis-Eigene APIs (Skills dürfen die nutzen)+# Jarvis's own APIs (skills are permitted to use these)jarvis.core.protocolsjarvis.core.configjarvis.skills.schema-# Pydantic für Schema-Validation in Skills+# Pydantic for schema validation in skillspydanticdiff --git a/jarvis/skills/schema.py b/jarvis/skills/schema.pyindex c0c3464e23..9f9aa34350 100644--- a/jarvis/skills/schema.py+++ b/jarvis/skills/schema.py@@ -1,10 +1,10 @@-"""Pydantic-Schemas + DataClasses für Skills.+"""Pydantic schemas + dataclasses for skills.-Frontmatter ist YAML — pydantic validiert strukturell. `Skill` selbst ist-ein frozen DataClass (Immutability für Flight-Recorder-Replay).+Frontmatter is YAML — pydantic validates it structurally. `Skill` itself is+a frozen dataclass (immutability for flight-recorder replay).-Skill-Lifecycle-Events erben von `jarvis.core.events.Event` — sind aber hier-definiert (nicht in events.py), damit wir die core-Layer nicht anfassen müssen.+Skill lifecycle events inherit from `jarvis.core.events.Event` — but are defined+here (not in events.py) so we don't have to touch the core layer."""from __future__ import annotations@@ -19,32 +19,32 @@ from jarvis.core.events import Eventfrom jarvis.core.protocols import RiskTier# -----------------------------------------------------------------------# Lifecycle-State+# Lifecycle state# ----------------------------------------------------------------------class SkillLifecycleState(str, Enum):- """Phasen im Skill-Leben."""- DRAFT = "draft" # noch nicht validiert / fehlerhaft- VALIDATED = "validated" # Frontmatter OK, Tools existieren- ACTIVE = "active" # vom User aktiviert, triggert- DISABLED = "disabled" # vom User deaktiviert+ """Phases in a skill's lifecycle."""+ DRAFT = "draft" # not yet validated / broken+ VALIDATED = "validated" # frontmatter OK, tools exist+ ACTIVE = "active" # activated by the user, triggers+ DISABLED = "disabled" # deactivated by the user# -----------------------------------------------------------------------# Frontmatter-Models+# Frontmatter models# ----------------------------------------------------------------------TriggerType = Literal["voice", "hotkey", "schedule"]class SkillTrigger(BaseModel):- """Ein Trigger — Voice-Pattern, Hotkey-Combo oder Cron-Expression."""+ """A trigger — voice pattern, hotkey combo, or cron expression."""model_config = ConfigDict(frozen=True, extra="forbid")type: TriggerType- pattern: str | None = None # Voice: Regex oder Template- combo: str | None = None # Hotkey: z.B. "ctrl+right_alt+j"- cron: str | None = None # Schedule: Cron-Expression+ pattern: str | None = None # voice: regex or template+ combo: str | None = None # hotkey: e.g. "ctrl+right_alt+j"+ cron: str | None = None # schedule: cron expressionlanguage: list[str] = Field(default_factory=lambda: ["de", "en"])@field_validator("pattern", "combo", "cron")@@ -53,19 +53,19 @@ class SkillTrigger(BaseModel):return v.strip() if isinstance(v, str) else vdef validate_payload(self) -> list[str]:- """Semantischer Check: je nach `type` muss das passende Feld gesetzt sein."""+ """Semantic check: depending on `type`, the matching field must be set."""errors: list[str] = []if self.type == "voice" and not self.pattern:- errors.append("voice-trigger braucht 'pattern'")+ errors.append("voice trigger needs 'pattern'")if self.type == "hotkey" and not self.combo:- errors.append("hotkey-trigger braucht 'combo'")+ errors.append("hotkey trigger needs 'combo'")if self.type == "schedule" and not self.cron:- errors.append("schedule-trigger braucht 'cron'")+ errors.append("schedule trigger needs 'cron'")return errorsclass SkillRiskPolicy(BaseModel):- """Risk-Tier-Konfiguration für einen Skill."""+ """Risk-tier configuration for a skill."""model_config = ConfigDict(frozen=True, extra="forbid")default_tier: RiskTier = "monitor"@@ -74,7 +74,7 @@ class SkillRiskPolicy(BaseModel):class SkillFrontmatter(BaseModel):- """YAML-Frontmatter einer SKILL.md."""+ """YAML frontmatter of a SKILL.md."""model_config = ConfigDict(frozen=True, extra="forbid")schema_version: Literal["1"] = "1"@@ -93,9 +93,9 @@ class SkillFrontmatter(BaseModel):risk_policy: SkillRiskPolicy = Field(default_factory=SkillRiskPolicy)config: dict[str, Any] = Field(default_factory=dict)token_budget_estimate: int = Field(default=2000, ge=1, le=100_000)- # Phase 7.5: Lifecycle-State im Frontmatter — OpenClaw-authored Skills- # tragen explizit `state: draft`, vom `draft_writer` erzwungen (Plan-§AD-8).- # Default `None` → Loader interpretiert als "validated/active" (Legacy).+ # Phase 7.5: lifecycle state in the frontmatter — OpenClaw-authored skills+ # explicitly carry `state: draft`, enforced by the `draft_writer` (Plan-§AD-8).+ # Default `None` → the loader interprets it as "validated/active" (legacy).state: SkillLifecycleState | None = None# Plugin<->Skill pairing (2026-06-07). When set, this skill is the canonical# source for a marketplace plugin's intent vocabulary; the deterministic@@ -127,35 +127,35 @@ class SkillFrontmatter(BaseModel):@classmethoddef _name_nonempty(cls, v: str) -> str:if not v or not v.strip():- raise ValueError("name darf nicht leer sein")+ raise ValueError("name must not be empty")return v.strip()@field_validator("homepage_url", "source_url", "docs_url", mode="before")@classmethoddef _clean_url(cls, v: Any) -> str | None:- """Trimmt Whitespace, mappt leere Strings auf None, erzwingt http(s)://.+ """Trims whitespace, maps empty strings to None, enforces http(s)://.- Begruendung: Pydantic's ``HttpUrl`` ist zu strikt (z.B. trailing-slash- Normalisierung), und wir wollen die Original-URL roundtrip-sicher- speichern. Max 2048 Zeichen schuetzt vor Missbrauch (Homepage-Feld als- JSON-Payload-Drop).+ Rationale: pydantic's ``HttpUrl`` is too strict (e.g. trailing-slash+ normalization), and we want to store the original URL roundtrip-safely.+ A 2048-char max guards against abuse (homepage field used as a+ JSON payload drop)."""if v is None:return Noneif not isinstance(v, str):- raise ValueError("URL muss string sein")+ raise ValueError("URL must be a string")cleaned = v.strip()if not cleaned:return Noneif len(cleaned) > 2048:- raise ValueError("URL zu lang (max 2048 Zeichen)")+ raise ValueError("URL too long (max 2048 characters)")if not (cleaned.startswith("http://") or cleaned.startswith("https://")):- raise ValueError("URL muss mit http:// oder https:// beginnen")+ raise ValueError("URL must start with http:// or https://")return cleaned# -----------------------------------------------------------------------# Skill-Container+# Skill container# ----------------------------------------------------------------------RESOURCE_KINDS: tuple[str, ...] = ("references", "scripts", "assets", "agents")@@ -163,19 +163,19 @@ RESOURCE_KINDS: tuple[str, ...] = ("references", "scripts", "assets", "agents")@dataclass(frozen=True, slots=True)class Skill:- """Eine geladene SKILL.md — parsed Frontmatter + Body + Metadaten.+ """A loaded SKILL.md — parsed frontmatter + body + metadata.- ``resources`` haelt die Bundle-Sibling-Ordner (analog zu Anthropic's- Claude-Skills-Struktur: ``references/``, ``scripts/``, ``assets/``,- ``agents/``). Wert pro Key ist die Liste der relativen File-Pfade zum- Skill-Root. Leer wenn der jeweilige Ordner nicht existiert.+ ``resources`` holds the bundle sibling folders (analogous to Anthropic's+ Claude-Skills structure: ``references/``, ``scripts/``, ``assets/``,+ ``agents/``). The value per key is the list of relative file paths to the+ skill root. Empty if the respective folder doesn't exist."""path: Path- frontmatter: SkillFrontmatter | None # None wenn DRAFT/broken+ frontmatter: SkillFrontmatter | None # None if DRAFT/brokenbody: strstate: SkillLifecycleState = SkillLifecycleState.DRAFTbody_hash: str = ""- error: str | None = None # Parse-/Validation-Fehler+ error: str | None = None # parse/validation errorresources: dict[str, tuple[str, ...]] = field(default_factory=lambda: {k: () for k in RESOURCE_KINDS})@@ -188,13 +188,13 @@ class Skill:@propertydef root(self) -> Path:- """Verzeichnis in dem die SKILL.md liegt — Basis fuer Resource-Lookups."""+ """Directory containing the SKILL.md — base for resource lookups."""return self.path.parent@dataclass(frozen=True, slots=True)class SkillResult:- """Gesamtes Ergebnis eines SkillRunner.run()."""+ """The overall result of a SkillRunner.run()."""skill_name: strsuccess: boolsteps: tuple[dict[str, Any], ...] = field(default_factory=tuple)@@ -204,7 +204,7 @@ class SkillResult:# -----------------------------------------------------------------------# Skill-Events (erben von jarvis.core.events.Event)+# Skill events (inherit from jarvis.core.events.Event)# ----------------------------------------------------------------------@dataclass(frozen=True, slots=True)@@ -253,10 +253,10 @@ class SkillRegistryReloaded(Event):@dataclass(frozen=True, slots=True)class SkillCreated(Event):- """Ein User-authored Skill wurde ueber die Desktop-App angelegt.+ """A user-authored skill was created via the desktop app.- Getrennt von ``SkillStateChanged``, damit die UI spezifisch auf das Authoring-- Event reagieren kann (Toast "Skill erstellt", React-Query-Invalidation).+ Separate from ``SkillStateChanged`` so the UI can react specifically to the+ authoring event (toast "Skill created", React-Query invalidation)."""skill_name: str = ""author: str = ""@@ -264,8 +264,8 @@ class SkillCreated(Event):@dataclass(frozen=True, slots=True)class SkillLinkCheckCompleted(Event):- """Der LinkHealthChecker hat HEAD-Requests fuer die URLs eines Skills- abgeschlossen und das Ergebnis im Cache aktualisiert.+ """The LinkHealthChecker has completed HEAD requests for a skill's URLs+ and updated the result in the cache."""skill_name: str = ""healthy: int = 0@@ -273,7 +273,7 @@ class SkillLinkCheckCompleted(Event):# -----------------------------------------------------------------------# Activation-Events (Skills-Brain-Integration, Phase Skills-1)+# Activation events (skills-brain integration, Phase Skills-1)# ----------------------------------------------------------------------@@ -293,13 +293,13 @@ class SkillInvoked(Event):@dataclass(frozen=True, slots=True)class SkillDirectTriggered(Event):- """Skill wurde via TriggerMatcher direkt aktiviert (Pre-Brain-Hook).+ """Skill was directly activated via the TriggerMatcher (pre-brain hook).- Komplementaer zu SkillStarted: SkillDirectTriggered markiert die- *Aktivierungs-Entscheidung* (Brain bypassed), SkillStarted markiert- den eigentlichen Run-Beginn im SkillRunner. Forward-compatible mit- Awareness-Layer (A0-A5) via ``trigger_type`` als activation_path-- Discriminator.+ Complementary to SkillStarted: SkillDirectTriggered marks the+ *activation decision* (brain bypassed), SkillStarted marks the+ actual run start in the SkillRunner. Forward-compatible with the+ awareness layer (A0-A5) via ``trigger_type`` as the activation-path+ discriminator."""skill_name: str = ""trigger_type: str = "" # "voice_direct" | "hotkey" | "cron"diff --git a/jarvis/skills/skill_context.py b/jarvis/skills/skill_context.pyindex c13b4e1612..c22a0e62f1 100644--- a/jarvis/skills/skill_context.py+++ b/jarvis/skills/skill_context.py@@ -1,18 +1,18 @@-"""Kontext-Registry fuer das Skill-System (Skills-Brain-Integration).+"""Context registry for the skill system (skills-brain integration).-Vorbild: ``jarvis/harness/computer_use_context.py``.+Modeled on: ``jarvis/harness/computer_use_context.py``.-Die Speech-Pipeline (Pre-Brain-Hook) und das ``run_skill``-Tool brauchen-Zugriff auf SkillRegistry + SkillRunner. Beide Komponenten werden aber an-verschiedenen Stellen instanziiert (BrainManager-Factory bzw. Pipeline--Bootstrap), und die Plugin-Tools werden via ``entry_points`` ohne Args-geladen. Statt umstaendliche DI durch alle Layer zu ziehen, halten wir-einen prozessweiten Kontext.+The speech pipeline (pre-brain hook) and the ``run_skill`` tool need+access to SkillRegistry + SkillRunner. Both components are instantiated at+different places (BrainManager factory vs. pipeline bootstrap), and the+plugin tools are loaded via ``entry_points`` without args. Instead of+threading cumbersome DI through every layer, we keep+a process-wide context.-Die App ruft einmal beim Start ``set_skill_context(ctx)``; Konsumenten-holen sich den Kontext mit ``get_skill_context()`` (raised RuntimeError-wenn nicht gesetzt) oder ``try_get_skill_context()`` (None wenn nicht-gesetzt — fuer optionale Hooks die gracefully skippen koennen).+The app calls ``set_skill_context(ctx)`` once at startup; consumers+fetch the context with ``get_skill_context()`` (raises RuntimeError+if not set) or ``try_get_skill_context()`` (None if not+set — for optional hooks that can gracefully skip)."""from __future__ import annotations@@ -26,7 +26,7 @@ if TYPE_CHECKING:@dataclassclass SkillContext:- """Alle Deps des Skill-Pfads an einer Stelle."""+ """All deps of the skill path in one place."""registry: SkillRegistryrunner: SkillRunner@@ -35,7 +35,7 @@ _CONTEXT: SkillContext | None = Nonedef set_skill_context(ctx: SkillContext | None) -> None:- """Setzt oder loescht (ctx=None) den globalen Skill-Context."""+ """Sets or clears (ctx=None) the global skill context."""global _CONTEXT_CONTEXT = ctx# Real-boot registration point for paired-skill capabilities. The brain@@ -59,21 +59,21 @@ def set_skill_context(ctx: SkillContext | None) -> None:def get_skill_context() -> SkillContext:- """Liefert den gesetzten Kontext oder wirft eine klare Fehlermeldung."""+ """Returns the set context, or raises a clear error message."""if _CONTEXT is None:raise RuntimeError(- "Skill-Context nicht gesetzt. "- "Die Haupt-App muss vor dem ersten Skill-Aufruf "- "`set_skill_context(...)` aufrufen.",+ "Skill context not set. "+ "The main app must call `set_skill_context(...)` "+ "before the first skill call.",)return _CONTEXTdef try_get_skill_context() -> SkillContext | None:- """Liefert den Kontext wenn gesetzt, sonst None.+ """Returns the context if set, otherwise None.- Fuer Code-Pfade die optional Skills nutzen (z.B. der Pre-Brain-Hook- in der Speech-Pipeline darf gracefully skippen wenn die Registry- nicht aufgesetzt wurde, etwa im Headless-Mock-Mode).+ For code paths that use skills optionally (e.g. the pre-brain hook+ in the speech pipeline may gracefully skip if the registry+ wasn't set up, such as in headless mock mode)."""return _CONTEXT