agent/php/Mcp/Tools/Agent/Content/ContentStatus.php
Snider bb88604045 feat(core): wire Core framework into agentic + monitor subsystems
Phase 2 of Core DI migration:
- Add *core.Core field + SetCore() to PrepSubsystem and monitor.Subsystem
- Register agentic/monitor/brain as Core services with lifecycle hooks
- Mark SetCompletionNotifier and SetNotifier as deprecated (removed in Phase 3)
- Fix monitor test to match actual event names
- initServices() now wires Core refs before legacy callbacks

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-24 14:44:53 +00:00

60 lines
1.8 KiB
PHP

<?php
declare(strict_types=1);
namespace Core\Mod\Agentic\Mcp\Tools\Agent\Content;
use Core\Mod\Agentic\Mcp\Tools\Agent\AgentTool;
use Mod\Content\Models\ContentBrief;
use Mod\Content\Services\AIGatewayService;
/**
* Get content generation pipeline status.
*
* Returns AI provider availability and brief counts by status.
*/
class ContentStatus extends AgentTool
{
protected string $category = 'content';
protected array $scopes = ['read'];
public function name(): string
{
return 'content_status';
}
public function description(): string
{
return 'Get content generation pipeline status (AI provider availability, brief counts)';
}
public function inputSchema(): array
{
return [
'type' => 'object',
'properties' => (object) [],
];
}
public function handle(array $args, array $context = []): array
{
$gateway = app(AIGatewayService::class);
return $this->success([
'providers' => [
'gemini' => $gateway->isGeminiAvailable(),
'claude' => $gateway->isClaudeAvailable(),
],
'pipeline_available' => $gateway->isAvailable(),
'briefs' => [
'pending' => ContentBrief::pending()->count(),
'queued' => ContentBrief::where('status', ContentBrief::STATUS_QUEUED)->count(),
'generating' => ContentBrief::where('status', ContentBrief::STATUS_GENERATING)->count(),
'review' => ContentBrief::needsReview()->count(),
'published' => ContentBrief::where('status', ContentBrief::STATUS_PUBLISHED)->count(),
'failed' => ContentBrief::where('status', ContentBrief::STATUS_FAILED)->count(),
],
]);
}
}