(directory: string, event: { properties: { sessionID?: string } }, time: number)
| 326 | } |
| 327 | |
| 328 | const handleSessionIdle = (directory: string, event: { properties: { sessionID?: string } }, time: number) => { |
| 329 | const sessionID = event.properties.sessionID |
| 330 | void lookup(directory, sessionID).then((session) => { |
| 331 | if (meta.disposed) return |
| 332 | if (!session) return |
| 333 | if (session.parentID) return |
| 334 | |
| 335 | if (settings.sounds.agentEnabled()) { |
| 336 | void playSoundById(settings.sounds.agent()) |
| 337 | } |
| 338 | |
| 339 | append({ |
| 340 | directory, |
| 341 | time, |
| 342 | viewed: viewedInCurrentSession(directory, sessionID), |
| 343 | type: "turn-complete", |
| 344 | session: sessionID, |
| 345 | }) |
| 346 | |
| 347 | const href = `/${base64Encode(directory)}/session/${sessionID}` |
| 348 | if (settings.notifications.agent()) { |
| 349 | void platform.notify(language.t("notification.session.responseReady.title"), session.title ?? sessionID, href) |
| 350 | } |
| 351 | }) |
| 352 | } |
| 353 | |
| 354 | const handleSessionError = ( |
| 355 | directory: string, |
no test coverage detected