add intro

This commit is contained in:
2026-08-28 22:02:58 +07:00
parent 5fcbf6f2c5
commit 1a05799b2d
17 changed files with 1103 additions and 364 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ func (s *MCPService) Server() *server.MCPServer {
srv.AddTool(
mcp.NewTool(
"get_team_story",
mcp.WithDescription("Получить текущую историю команды: видимые точки сценария (текст, двери, улики) и информацию об игре. Команда идентифицируется паролем."),
mcp.WithDescription("Получить текущую историю команды: введение сценария (текст и аудио), видимые точки сценария (текст, двери, улики) и информацию об игре. Команда идентифицируется паролем."),
mcp.WithNumber("team_id", mcp.Required(), mcp.Description("ID команды")),
mcp.WithString("password", mcp.Required(), mcp.Description("Пароль команды")),
),
@@ -38,6 +38,10 @@ func (f *fakeGamePlayer) AddTeamAction(_ context.Context, teamID int, password,
func defaultStory() *storytelling.Story {
return &storytelling.Story{
Introduction: &storytelling.Introduction{
Text: "Добро пожаловать в особняк.",
Audio: "http://storage.test/api/files/intro.mp3",
},
Places: []*storytelling.Place{
{
Code: "entrance",
@@ -254,6 +258,9 @@ func TestGetTeamStory(t *testing.T) {
if !strings.Contains(got, "entrance") {
t.Fatalf("get_team_story: %q; want story JSON", got)
}
if !strings.Contains(got, `"introduction"`) || !strings.Contains(got, "Добро пожаловать в особняк.") {
t.Fatalf("get_team_story: %q; want introduction in story JSON", got)
}
}
func TestGetTeamStoryBusinessError(t *testing.T) {