(message: unknown)
| 149 | } |
| 150 | |
| 151 | private isIpcRequest(message: unknown): message is IpcRequest { |
| 152 | if (!message || typeof message !== "object") return false; |
| 153 | const maybe = message as Record<string, unknown>; |
| 154 | return ( |
| 155 | typeof maybe.id === "string" && |
| 156 | typeof maybe.type === "string" && |
| 157 | IPC_REQUEST_TYPES.has(maybe.type as IpcRequest["type"]) |
| 158 | ); |
| 159 | } |
| 160 | |
| 161 | private async handleRequest(request: IpcRequest): Promise<void> { |
| 162 | if (!this.agent || !this.conversationService) { |