feat: MCP profile tools; ProfileUpdater/ProfilePresenter shared with /me; docs and Caddy snippet for /mcp
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
This commit is contained in:
22
core/app/Presenters/ProfilePresenter.php
Normal file
22
core/app/Presenters/ProfilePresenter.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Presenters;
|
||||
|
||||
use App\Enums\EventState;
|
||||
use App\Models\User;
|
||||
|
||||
/** Профиль для инбокса и агента: пояс, тихие часы, бейдж. */
|
||||
final class ProfilePresenter
|
||||
{
|
||||
/** @return array<string,mixed> */
|
||||
public static function present(User $user): array
|
||||
{
|
||||
return [
|
||||
'login' => $user->login,
|
||||
'tz' => $user->tz,
|
||||
'quiet_start' => substr($user->quiet_start, 0, 5),
|
||||
'quiet_end' => substr($user->quiet_end, 0, 5),
|
||||
'badge' => $user->events()->whereIn('state', EventState::badgeValues())->count(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user