({ sessionId, toNodeId, title, description, role } = {})
| 75 | } |
| 76 | |
| 77 | delegateSubtask({ sessionId, toNodeId, title, description, role } = {}) { |
| 78 | if (!sessionId) throw new Error('sessionId is required'); |
| 79 | if (!title) throw new Error('title is required'); |
| 80 | |
| 81 | const VALID_ROLES = ['builder', 'planner', 'reviewer']; |
| 82 | const safeRole = VALID_ROLES.includes(role) ? role : 'builder'; |
| 83 | |
| 84 | return this.store.send({ |
| 85 | type: 'session_delegate', |
| 86 | payload: { |
| 87 | session_id: sessionId, |
| 88 | to_node_id: toNodeId || null, |
| 89 | title, |
| 90 | description: description || '', |
| 91 | role: safeRole, |
| 92 | delegated_at: new Date().toISOString(), |
| 93 | }, |
| 94 | priority: 'high', |
| 95 | }); |
| 96 | } |
| 97 | |
| 98 | submitResult({ sessionId, taskId, resultAssetId, summary } = {}) { |
| 99 | if (!sessionId) throw new Error('sessionId is required'); |
no test coverage detected