agent/php/Actions/Subscription/DetectCapabilities.php
Virgil 6c69005aff feat(agent): implement fleet and sync RFC surfaces
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 07:27:15 +00:00

30 lines
830 B
PHP

<?php
declare(strict_types=1);
namespace Core\Mod\Agentic\Actions\Subscription;
use Core\Actions\Action;
class DetectCapabilities
{
use Action;
/**
* @param array<string, string> $apiKeys
* @return array<string, mixed>
*/
public function handle(array $apiKeys = []): array
{
$resolved = [
'claude' => ($apiKeys['claude'] ?? '') !== '' || (string) config('agentic.claude.api_key', '') !== '',
'gemini' => ($apiKeys['gemini'] ?? '') !== '' || (string) config('agentic.gemini.api_key', '') !== '',
'openai' => ($apiKeys['openai'] ?? '') !== '' || (string) config('agentic.openai.api_key', '') !== '',
];
return [
'providers' => $resolved,
'available' => array_keys(array_filter($resolved)),
];
}
}