OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)

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,50 @@
<?php
namespace Leantime\Domain\Timesheets\Tools;
use Laravel\Mcp\Server\Tool;
use Laravel\Mcp\Server\Tools\ToolInputSchema;
use Laravel\Mcp\Server\Tools\ToolResult;
use Leantime\Domain\Timesheets\Services\Timesheets;
/**
* Stop a running timer.
*/
class StopTimerTool extends Tool
{
public function __construct(
private Timesheets $timesheetsService,
) {}
public function schema(ToolInputSchema $schema): ToolInputSchema
{
return $schema
->integer('ticketId')->description('Ticket ID to stop the timer for. Omit to stop the active timer.');
}
public function name(): string
{
return 'stopTimer';
}
public function description(): string
{
return 'Stop a running timer.';
}
/**
* Handle the tool request.
*/
public function handle(array $arguments): ToolResult
{
$ticketId = ($arguments['ticketId'] ?? null);
if ($ticketId !== null && (int) $ticketId > 0) {
$this->timesheetsService->punchOut((int) $ticketId);
} else {
$this->timesheetsService->stopActiveTimer();
}
return ToolResult::text('Timer stopped successfully.');
}
}