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,59 @@
<?php
namespace Leantime\Domain\Goalcanvas\Tools;
use Laravel\Mcp\Server\Tool;
use Laravel\Mcp\Server\Tools\ToolInputSchema;
use Laravel\Mcp\Server\Tools\ToolResult;
use Leantime\Domain\Goalcanvas\Services\Goalcanvas;
/**
* Create a new goal board.
*/
class CreateGoalboardTool extends Tool
{
public function __construct(
private Goalcanvas $goalcanvasService,
) {}
public function schema(ToolInputSchema $schema): ToolInputSchema
{
return $schema
->string('title')->description('Title of the goal board.')
->required()
->integer('projectId')->description('Project ID this goal board belongs to.')
->required()
->string('description')->description('Description of the goal board.');
}
public function name(): string
{
return 'createGoalboard';
}
public function description(): string
{
return 'Creates a new goal board for organizing goals within a project.';
}
/**
* Handle the tool request.
*/
public function handle(array $arguments): ToolResult
{
$values = [
'title' => $arguments['title'],
'description' => ($arguments['description'] ?? ''),
'projectId' => (int) ($arguments['projectId'] ?? 0),
'author' => session('userdata.id'),
];
$boardId = $this->goalcanvasService->createGoalboard($values);
if ($boardId) {
return ToolResult::text("Goal board created successfully with ID: {$boardId}");
}
return ToolResult::error('Failed to create goal board. Please check the provided information.');
}
}