(status: string)
| 253 | type TurnStatusKind = "active" | "terminal" | "unknown"; |
| 254 | |
| 255 | function classifyTurnStatus(status: string): TurnStatusKind { |
| 256 | if (!status) { |
| 257 | return "unknown"; |
| 258 | } |
| 259 | if ( |
| 260 | status === "inprogress" || |
| 261 | status === "running" || |
| 262 | status === "processing" || |
| 263 | status === "pending" || |
| 264 | status === "started" || |
| 265 | status === "queued" || |
| 266 | status === "waiting" || |
| 267 | status === "blocked" || |
| 268 | status === "needsinput" || |
| 269 | status === "requiresaction" || |
| 270 | status === "awaitinginput" || |
| 271 | status === "waitingforinput" |
| 272 | ) { |
| 273 | return "active"; |
| 274 | } |
| 275 | if ( |
| 276 | status === "completed" || |
| 277 | status === "done" || |
| 278 | status === "failed" || |
| 279 | status === "error" || |
| 280 | status === "canceled" || |
| 281 | status === "cancelled" || |
| 282 | status === "aborted" || |
| 283 | status === "stopped" || |
| 284 | status === "interrupted" |
| 285 | ) { |
| 286 | return "terminal"; |
| 287 | } |
| 288 | return "unknown"; |
| 289 | } |
| 290 | |
| 291 | function getExplicitActiveTurnState( |
| 292 | thread: Record<string, unknown>, |
no outgoing calls
no test coverage detected