OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
Some checks failed
Security Audit / Composer Security Audit (push) Has been cancelled
Security Audit / NPM Security Audit (push) Has been cancelled
Security Audit / CodeQL Analysis (push) Has been cancelled

This commit is contained in:
wangruiguo
2026-09-03 18:49:20 +08:00
commit d647428529
3501 changed files with 1988906 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
<?php
namespace Leantime\Domain\Calendar\Tools;
use Laravel\Mcp\Server\Tool;
use Laravel\Mcp\Server\Tools\Annotations\IsReadOnly;
use Laravel\Mcp\Server\Tools\ToolInputSchema;
use Laravel\Mcp\Server\Tools\ToolResult;
use Leantime\Domain\Calendar\Services\Calendar;
/**
* Get the iCal URL for the user calendar.
*/
#[IsReadOnly]
class GetICalUrlTool extends Tool
{
public function __construct(
private Calendar $calendarService,
) {}
public function schema(ToolInputSchema $schema): ToolInputSchema
{
return $schema;
}
public function name(): string
{
return 'getICalUrl';
}
public function description(): string
{
return 'Gets the iCal URL for the user calendar.';
}
/**
* Handle the tool request.
*/
public function handle(array $arguments): ToolResult
{
try {
$url = $this->calendarService->getICalUrl();
return ToolResult::text($url);
} catch (\Exception $e) {
return ToolResult::error('No iCal URL available. Generate one first using generateIcalHash.');
}
}
}