'object', 'properties' => [ 'id' => [ 'type' => 'integer', 'description' => 'Brief ID', ], ], 'required' => ['id'], ]; } public function handle(array $args, array $context = []): array { try { $id = $this->requireInt($args, 'id', 1); } catch (\InvalidArgumentException $e) { return $this->error($e->getMessage()); } $brief = ContentBrief::find($id); if (! $brief) { return $this->error("Brief not found: {$id}"); } // Optional workspace scoping for multi-tenant security if (! empty($context['workspace_id']) && $brief->workspace_id !== $context['workspace_id']) { return $this->error('Access denied: brief belongs to a different workspace'); } return $this->success([ 'brief' => [ 'id' => $brief->id, 'title' => $brief->title, 'slug' => $brief->slug, 'status' => $brief->status, 'content_type' => $brief->content_type instanceof BriefContentType ? $brief->content_type->value : $brief->content_type, 'service' => $brief->service, 'description' => $brief->description, 'keywords' => $brief->keywords, 'target_word_count' => $brief->target_word_count, 'difficulty' => $brief->difficulty, 'draft_output' => $brief->draft_output, 'refined_output' => $brief->refined_output, 'final_content' => $brief->final_content, 'error_message' => $brief->error_message, 'generation_log' => $brief->generation_log, 'metadata' => $brief->metadata, 'total_cost' => $brief->total_cost, 'created_at' => $brief->created_at->toIso8601String(), 'updated_at' => $brief->updated_at->toIso8601String(), 'generated_at' => $brief->generated_at?->toIso8601String(), 'refined_at' => $brief->refined_at?->toIso8601String(), 'published_at' => $brief->published_at?->toIso8601String(), ], ]); } }