# SPDX-License-Identifier: BSD-3-Clause """Action and observation models for the CrossDomain Reasoning environment.""" from typing import Literal from openenv.core.env_server.types import Action, Observation from pydantic import Field class CrossDomainAction(Action): """One move: run Python code as a scratchpad, or submit the final answer.""" tool: Literal["python", "submit"] = Field( ..., description=( "'python' runs `input` as a Python 3 script and returns its stdout/stderr; " "'submit' ends the episode with `input` as the final answer." ), ) input: str = Field( ..., description="Python source code for 'python', or the final answer text for 'submit'.", ) class CrossDomainObservation(Observation): """What the agent sees after reset or a step.""" task: str = Field(default="", description="The problem statement (reset only).") output: str = Field(default="", description="Output of the last tool call, or grading feedback.") steps_left: int = Field(default=0, description="Tool calls left before the episode is cut off.")