| 174 | } |
| 175 | |
| 176 | function showSubagent( |
| 177 | state: State, |
| 178 | input: { |
| 179 | sessionID: string |
| 180 | partID: string |
| 181 | callID: string |
| 182 | label: string |
| 183 | description: string |
| 184 | status: "running" | "completed" | "cancelled" | "error" |
| 185 | title?: string |
| 186 | toolCalls?: number |
| 187 | commits: StreamCommit[] |
| 188 | }, |
| 189 | ) { |
| 190 | state.footer.event({ |
| 191 | type: "stream.subagent", |
| 192 | state: { |
| 193 | tabs: [ |
| 194 | { |
| 195 | sessionID: input.sessionID, |
| 196 | partID: input.partID, |
| 197 | callID: input.callID, |
| 198 | label: input.label, |
| 199 | description: input.description, |
| 200 | status: input.status, |
| 201 | title: input.title, |
| 202 | toolCalls: input.toolCalls, |
| 203 | lastUpdatedAt: Date.now(), |
| 204 | }, |
| 205 | ], |
| 206 | details: { |
| 207 | [input.sessionID]: { |
| 208 | sessionID: input.sessionID, |
| 209 | commits: input.commits, |
| 210 | }, |
| 211 | }, |
| 212 | permissions: [], |
| 213 | questions: [], |
| 214 | }, |
| 215 | }) |
| 216 | } |
| 217 | |
| 218 | function wait(ms: number, signal?: AbortSignal): Promise<void> { |
| 219 | return new Promise((resolve) => { |