Move the four providers onto _runtime and _shell_command; expected runtime scripts take the runtime config; add unique_preconditions. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
21 lines
674 B
Python
21 lines
674 B
Python
"""Strict Letta Code managed runtime inspection."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import List, Tuple
|
|
|
|
from ._runtime import expected_runtime_scripts, runtime_contract_exists
|
|
from ._strict_json import JsonObject
|
|
from .letta_contract import AGENT_KEY, LettaRuntimeContract
|
|
|
|
|
|
def _expected_scripts(agent_id: str, config: JsonObject) -> Tuple[str, str]:
|
|
return expected_runtime_scripts(AGENT_KEY, agent_id, config, fail_closed=True)
|
|
|
|
|
|
def letta_runtime_files_exist(contracts: List[LettaRuntimeContract]) -> bool:
|
|
return any(
|
|
runtime_contract_exists(contract, AGENT_KEY, "Letta Code", _expected_scripts)
|
|
for contract in contracts
|
|
)
|