OUTPUT #992 | 2879 karakter | 74 satır
========== YENİ KOMUT | 23.09.2026 02:00:27 ==========

========== YENİ KOMUT | 23.09.2026 02:00:27 ==========

    except Exception:
        return
    if not valid:
        return
    contract = _json_object(child_summary)
    if isinstance(contract, dict):
        _save_creative_contract(parent_session_id, contract)


def _on_pre_llm_call(
    session_id: str = "",
    parent_session_id: str = "",
    **_: Any,
) -> Optional[dict]:
    sid = str(session_id or "")
    if not sid:
        return None
    try:
        con = sqlite3.connect(str(_DB), timeout=1)
        row = con.execute("SELECT source FROM sessions WHERE id=? LIMIT 1", (sid,)).fetchone()
        con.close()
        if row and str(row[0] or "") in {"subagent", "tool"}:
            return None
    except Exception:
        pass
    contract = _load_creative_contract(sid)
    if not contract:
        return None
    compact = json.dumps(contract, ensure_ascii=False, separators=(",", ":"))
    return {
        "context": (
            "HERMES_CREATIVE_CONTRACT_ACTIVE: This Astra-approved creative direction is the "
            "current production contract. Preserve its visual intent while choosing concrete "
            "assets and executing the canonical pipeline. Do not silently replace it. "
            f"CONTRACT={compact}"
        )
    }


def register(ctx) -> None:
    ctx.register_hook("pre_tool_call", _on_pre_tool_call)
    ctx.register_hook("post_tool_call", _on_post_tool_call)
    ctx.register_hook("subagent_start", _on_subagent_start)
    ctx.register_hook("subagent_stop", _on_subagent_stop)
    ctx.register_hook("pre_llm_call", _on_pre_llm_call)
---PLUGIN YAML---
name: shorts-production-guard
version: "0.3.0"
description: "Runtime guard for efficient autonomous Shorts/Reels production. Prevents production-time toolchain mutation, alternate QA fallbacks, and skill sprawl without limiting the overall agent turn budget."
author: "Barış Altınsay, Hermes Agent"
provides_hooks:
  - pre_tool_call
  - post_tool_call
  - pre_llm_call
  - subagent_start
  - subagent_stop
hooks:
  - pre_tool_call
  - post_tool_call
  - pre_llm_call
  - subagent_start
  - subagent_stop
---PLUGIN CONTEXT---
/home/hermes/.hermes/hermes-agent/hermes_cli/plugins.py:214:class PluginContext:
/home/hermes/.hermes/hermes-agent/.venv/lib64/python3.11/site-packages/nemo_relay/plugin.py:113:class PluginContext(Protocol):
/home/hermes/.hermes/hermes-agent/.venv/lib64/python3.11/site-packages/nemo_relay/_native.pyi:1216:class PluginContext:
/home/hermes/.hermes/hermes-agent/.venv/lib64/python3.11/site-packages/nemo_relay/plugin.pyi:51:class PluginContext(Protocol):
/home/hermes/.hermes/hermes-agent/.venv/lib/python3.11/site-packages/nemo_relay/plugin.py:113:class PluginContext(Protocol):
root@213-238-170-219:/home/hermes#