File size: 3,235 Bytes
0e43bd0
54e07f9
0e43bd0
b48d603
af7a8bf
 
 
 
53320f0
07a2d3f
 
 
 
 
7c9c0fe
07a2d3f
 
 
 
 
 
54e07f9
07a2d3f
 
54e07f9
6ba1b81
07a2d3f
54e07f9
 
 
07a2d3f
54e07f9
07a2d3f
 
54e07f9
 
af7a8bf
07a2d3f
0e43bd0
ff5d01e
 
 
0e43bd0
07a2d3f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75e6d2d
 
 
 
 
 
 
07a2d3f
75e6d2d
cbf41ab
75e6d2d
 
07a2d3f
 
 
 
75e6d2d
0e43bd0
b48d603
0e43bd0
cbf41ab
75e6d2d
7c9c0fe
 
 
cbf41ab
07a2d3f
 
 
7c9c0fe
 
0e43bd0
07a2d3f
1fe9d0d
0e43bd0
75e6d2d
0e43bd0
 
6ba1b81
 
0e43bd0
b48d603
0e43bd0
 
 
1fe9d0d
 
 
 
0e43bd0
 
 
 
 
07a2d3f
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
from pydantic import BaseModel, Field
from typing import List, Dict, Optional, Union, Literal, Any

# --- ORCHESTRATION ---
class UserGoal(BaseModel):
    user_id: str
    project_id: str
    goal_text: str
    roblox_user_id: Optional[str] = "0"
    image_base64: Optional[str] = Field(None, description="Base64 encoded context image.")

class RecallRequest(BaseModel):
    project_id: str
    user_feedback: Optional[str] = "What is the next step?"

class ResetRequest(BaseModel):
    junior_instance_id: str
    supervisor_instance_id: str
    reason: str

# --- FEEDBACK LOOP ---
class SceneObjectState(BaseModel):
    """Represents a snapshot of an object currently in Roblox."""
    id: str # The Name in Roblox
    class_name: str
    position: Dict[str, float]
    size: Dict[str, float]
    parent_name: str

class ProjectFeedback(BaseModel):
    """Data sent FROM the Plugin TO the Orchestrator."""
    project_id: str
    message: str
    scene_snapshot: List[SceneObjectState] = []
    task_id_completed: Optional[str] = None
    status: Literal["SUCCESS", "FAILED"] = "SUCCESS"

# --- MATTER FORMAT ---
class Vector3(BaseModel):
    x: float = 0.0
    y: float = 0.0
    z: float = 0.0

class BuildPayload(BaseModel):
    id: str
    class_name: str = "Part"
    position: Vector3
    rotation: Vector3 = Vector3()
    size: Vector3
    color_hex: str = "#A3A2A5"
    anchored: bool = True
    transparency: float = 0.0
    material: str = "Plastic"
    mesh_id: Optional[str] = None
    texture_id: Optional[str] = None

class CSGPayload(BaseModel):
    operation: Literal["Union", "Subtract"]
    target_id: str
    tool_ids: List[str]

class Attribute(BaseModel):
    name: str
    type: Literal["String", "Number", "Boolean", "Color3"]
    value: Any

class ScriptPayload(BaseModel):
    name: str
    class_name: Literal["Script", "LocalScript", "ModuleScript"]
    parent: str 
    attributes: List[Attribute] = [] 
    source_code: str 

class RiggingCommand(BaseModel):
    part0_id: str
    part1_id: str
    joint_type: Literal["Weld", "Motor6D", "HingeConstraint", "BallSocketConstraint"]
    position: Vector3

# --- PROJECT FLOW ---
class TaskNode(BaseModel):
    task_id: str = Field(default_factory=lambda: "pending_id")
    title: str
    role_required: Literal[
        "PROJECT_MANAGER", 
        "SUPERVISOR_WORLD", 
        "SUPERVISOR_SCRIPT", 
        "3D_ARTIST", 
        "CONCEPT_ARTIST", 
        "SCRIPTING_ENGINEER", 
        "ERRANDS"
    ]
    instruction: str
    status: Literal["PENDING", "IN_PROGRESS", "COMPLETED", "FAILED"] = "PENDING"
    assigned_instance_id: Optional[str] = None
    subtasks: List['TaskNode'] = [] 
    
class ProjectFlow(BaseModel):
    project_id: str
    is_finished: bool = False
    next_task: Optional[TaskNode] = None

# --- COMMUNICATION ---
class AgentMessage(BaseModel):
    id: str
    from_agent: str
    to_agents: List[str]
    role: str
    content: str
    image_base64: Optional[str] = None

class GenerationRequest(BaseModel):
    agent_type: str
    agent_instance_id: str
    conversation_partner_id: str 
    prompt: str
    image_base64: Optional[str] = None

class ImageGenerationRequest(BaseModel):
    agent_instance_id: str
    prompt: str