Spaces:
Sleeping
Sleeping
Update data_structures.py
Browse files- data_structures.py +11 -16
data_structures.py
CHANGED
|
@@ -6,7 +6,7 @@ class UserGoal(BaseModel):
|
|
| 6 |
user_id: str
|
| 7 |
project_id: str
|
| 8 |
goal_text: str
|
| 9 |
-
roblox_user_id: Optional[str] =
|
| 10 |
image_base64: Optional[str] = Field(None, description="Base64 encoded context image.")
|
| 11 |
|
| 12 |
class RecallRequest(BaseModel):
|
|
@@ -21,9 +21,10 @@ class ResetRequest(BaseModel):
|
|
| 21 |
# --- FEEDBACK LOOP ---
|
| 22 |
class SceneObjectState(BaseModel):
|
| 23 |
"""Represents a snapshot of an object currently in Roblox."""
|
| 24 |
-
|
| 25 |
class_name: str
|
| 26 |
position: Dict[str, float] # {x, y, z}
|
|
|
|
| 27 |
size: Dict[str, float]
|
| 28 |
parent_name: str
|
| 29 |
|
|
@@ -42,7 +43,7 @@ class Vector3(BaseModel):
|
|
| 42 |
z: float = 0.0
|
| 43 |
|
| 44 |
class MatterObject(BaseModel):
|
| 45 |
-
id: str
|
| 46 |
class_name: str = "Part"
|
| 47 |
position: Vector3
|
| 48 |
rotation: Vector3
|
|
@@ -51,21 +52,14 @@ class MatterObject(BaseModel):
|
|
| 51 |
anchored: bool = True
|
| 52 |
transparency: float = 0.0
|
| 53 |
material: str = "Plastic"
|
|
|
|
| 54 |
mesh_id: Optional[str] = None
|
| 55 |
texture_id: Optional[str] = None
|
| 56 |
|
| 57 |
-
class
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
rotation: Vector3
|
| 62 |
-
scale: float = 1.0
|
| 63 |
-
|
| 64 |
-
class RiggingCommand(BaseModel):
|
| 65 |
-
part0_id: str
|
| 66 |
-
part1_id: str
|
| 67 |
-
joint_type: Literal["Weld", "Motor6D", "HingeConstraint", "BallSocketConstraint"]
|
| 68 |
-
position: Vector3
|
| 69 |
|
| 70 |
class ScriptPayload(BaseModel):
|
| 71 |
name: str
|
|
@@ -94,7 +88,8 @@ class TaskNode(BaseModel):
|
|
| 94 |
class ProjectFlow(BaseModel):
|
| 95 |
project_id: str
|
| 96 |
game_concept_summary: str
|
| 97 |
-
|
|
|
|
| 98 |
|
| 99 |
# --- COMMUNICATION ---
|
| 100 |
class AgentMessage(BaseModel):
|
|
|
|
| 6 |
user_id: str
|
| 7 |
project_id: str
|
| 8 |
goal_text: str
|
| 9 |
+
roblox_user_id: Optional[str] = "0"
|
| 10 |
image_base64: Optional[str] = Field(None, description="Base64 encoded context image.")
|
| 11 |
|
| 12 |
class RecallRequest(BaseModel):
|
|
|
|
| 21 |
# --- FEEDBACK LOOP ---
|
| 22 |
class SceneObjectState(BaseModel):
|
| 23 |
"""Represents a snapshot of an object currently in Roblox."""
|
| 24 |
+
id: str # This maps to the Instance.Name in Roblox
|
| 25 |
class_name: str
|
| 26 |
position: Dict[str, float] # {x, y, z}
|
| 27 |
+
rotation: Dict[str, float] # {x, y, z}
|
| 28 |
size: Dict[str, float]
|
| 29 |
parent_name: str
|
| 30 |
|
|
|
|
| 43 |
z: float = 0.0
|
| 44 |
|
| 45 |
class MatterObject(BaseModel):
|
| 46 |
+
id: str # CRITICAL: The AI MUST assign this (e.g., "Floor_Base", "Wall_North")
|
| 47 |
class_name: str = "Part"
|
| 48 |
position: Vector3
|
| 49 |
rotation: Vector3
|
|
|
|
| 52 |
anchored: bool = True
|
| 53 |
transparency: float = 0.0
|
| 54 |
material: str = "Plastic"
|
| 55 |
+
shape: str = "Block" # Block, Ball, Cylinder
|
| 56 |
mesh_id: Optional[str] = None
|
| 57 |
texture_id: Optional[str] = None
|
| 58 |
|
| 59 |
+
class EditorCommand(BaseModel):
|
| 60 |
+
type: Literal["SELECT", "DELETE", "RENAME", "MOVE", "RESIZE"]
|
| 61 |
+
target_id: str # The Name of the object
|
| 62 |
+
payload: Dict[str, Any] # e.g., new position
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
class ScriptPayload(BaseModel):
|
| 65 |
name: str
|
|
|
|
| 88 |
class ProjectFlow(BaseModel):
|
| 89 |
project_id: str
|
| 90 |
game_concept_summary: str
|
| 91 |
+
is_finished: bool = False # If True, PM stops the loop
|
| 92 |
+
next_task: Optional[TaskNode] = None # The immediate next step
|
| 93 |
|
| 94 |
# --- COMMUNICATION ---
|
| 95 |
class AgentMessage(BaseModel):
|