onQueue('ai'); } public function handle(): void { $workspace = Workspace::findOrFail($this->workspaceId); $agent = new PostContentStreamer( workspace: $workspace, currentContent: $this->currentContent, ); $channel = new PrivateChannel("users.{$this->userId}.ai-gen.{$this->generationId}"); try { $agent->broadcast($this->prompt, $channel, now: true); } catch (\Throwable $e) { Log::error('PostContentGenerator stream failed', [ 'generation_id' => $this->generationId, 'error' => $e->getMessage(), ]); throw $e; } } }