feat: a home page with life
Greeting and summary of the day, the coming week, the latest across my projects, who is online now, the week in numbers (mine and the team's, with a streak), sprints under way, «Retomar», project cards with their activity, what to pick up when nothing is mine and first steps for newcomers. REST (GET /api/me/home), GraphQL (myHome) and MCP (get_my_week). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -397,6 +397,26 @@ export interface paths {
|
||||
patch: operations["ProjectsController_changeMemberRole"];
|
||||
trace?: never;
|
||||
};
|
||||
"/api/me/home": {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
/**
|
||||
* The home page beyond my work
|
||||
* @description Agenda of my week, latest activity of my projects, the week in numbers (the team and me), sprints under way, project cards, suggestions, first steps and who is on what now.
|
||||
*/
|
||||
get: operations["IssuesController_home"];
|
||||
put?: never;
|
||||
post?: never;
|
||||
delete?: never;
|
||||
options?: never;
|
||||
head?: never;
|
||||
patch?: never;
|
||||
trace?: never;
|
||||
};
|
||||
"/api/me/portfolio": {
|
||||
parameters: {
|
||||
query?: never;
|
||||
@@ -2460,6 +2480,77 @@ export interface components {
|
||||
ChangeMemberRoleDto: {
|
||||
role: components["schemas"]["ProjectRole"];
|
||||
};
|
||||
AgendaItemDto: {
|
||||
/** Format: date */
|
||||
day: string;
|
||||
/** @enum {string} */
|
||||
kind: "ISSUE" | "SPRINT_END" | "RELEASE";
|
||||
projectKey: string;
|
||||
title: string;
|
||||
issueKey: string | null;
|
||||
};
|
||||
TeamWeekDto: {
|
||||
/** @description Finished per day, last 14, oldest first */
|
||||
perDay: number[];
|
||||
thisWeek: number;
|
||||
lastWeek: number;
|
||||
};
|
||||
MyWeekDto: {
|
||||
thisWeek: number;
|
||||
lastWeek: number;
|
||||
/** @description Days in a row with something finished */
|
||||
streak: number;
|
||||
};
|
||||
HomeSprintDto: {
|
||||
projectKey: string;
|
||||
projectName: string;
|
||||
sprint: components["schemas"]["SprintPulseDto"];
|
||||
};
|
||||
HomeSprintBriefDto: {
|
||||
name: string;
|
||||
percent: number;
|
||||
behind: boolean;
|
||||
};
|
||||
HomeProjectDto: {
|
||||
/** Format: uuid */
|
||||
projectId: string;
|
||||
open: number;
|
||||
overdue: number;
|
||||
/** @description Activity per day, last 14, oldest first */
|
||||
activity: number[];
|
||||
sprint: components["schemas"]["HomeSprintBriefDto"] | null;
|
||||
};
|
||||
SuggestionDto: {
|
||||
/** @enum {string} */
|
||||
kind: "UNASSIGNED" | "PROPOSALS" | "QA_WAITING";
|
||||
projectKey: string;
|
||||
count: number;
|
||||
};
|
||||
FirstStepsDto: {
|
||||
project: boolean;
|
||||
invited: boolean;
|
||||
ticket: boolean;
|
||||
calendar: boolean;
|
||||
};
|
||||
OnlineDto: {
|
||||
user: components["schemas"]["UserRefDto"];
|
||||
projectKey: string;
|
||||
issueKey: string | null;
|
||||
issueTitle: string | null;
|
||||
editing: boolean;
|
||||
at: string;
|
||||
};
|
||||
HomeDto: {
|
||||
agenda: components["schemas"]["AgendaItemDto"][];
|
||||
activity: components["schemas"]["ActivityDto"][];
|
||||
team: components["schemas"]["TeamWeekDto"];
|
||||
me: components["schemas"]["MyWeekDto"];
|
||||
sprints: components["schemas"]["HomeSprintDto"][];
|
||||
projects: components["schemas"]["HomeProjectDto"][];
|
||||
suggestions: components["schemas"]["SuggestionDto"][];
|
||||
firstSteps: components["schemas"]["FirstStepsDto"];
|
||||
online: components["schemas"]["OnlineDto"][];
|
||||
};
|
||||
ChildProgressDto: {
|
||||
total: number;
|
||||
/** @description Done or cancelled */
|
||||
@@ -4816,6 +4907,61 @@ export interface operations {
|
||||
};
|
||||
};
|
||||
};
|
||||
IssuesController_home: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
requestBody?: never;
|
||||
responses: {
|
||||
200: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["HomeDto"];
|
||||
};
|
||||
};
|
||||
/** @description Invalid input */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["ApiErrorDto"];
|
||||
};
|
||||
};
|
||||
/** @description Missing or rejected Pireon token */
|
||||
401: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["ApiErrorDto"];
|
||||
};
|
||||
};
|
||||
/** @description Not a member of the project (or not allowed) */
|
||||
403: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["ApiErrorDto"];
|
||||
};
|
||||
};
|
||||
/** @description Not found */
|
||||
404: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["ApiErrorDto"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
IssuesController_portfolio: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
|
||||
@@ -204,6 +204,27 @@ export class ProjectsResolver {
|
||||
);
|
||||
}
|
||||
|
||||
@Tool({
|
||||
name: 'get_my_week',
|
||||
description:
|
||||
"The user's coming week and how the last one went: tickets of theirs (assigned or watched) due in the next 7 days, sprint ends and planned releases; tickets finished by them and by their teams this week and last, and their streak; sprints under way; and, when nothing is theirs, what they could pick up (unassigned, waiting for QA, proposals to review).",
|
||||
paramsSchema: z.object({}),
|
||||
annotations: READ,
|
||||
})
|
||||
myWeek(_params: Record<string, never>, ctx: McpContext) {
|
||||
return toolResult(async () => {
|
||||
const home = await this.api.data(this.api.as(ctx).GET('/api/me/home'));
|
||||
// Compact: the page's activity feed, presence and first steps stay out.
|
||||
return {
|
||||
agenda: home.agenda,
|
||||
me: home.me,
|
||||
team: { thisWeek: home.team.thisWeek, lastWeek: home.team.lastWeek },
|
||||
sprints: home.sprints,
|
||||
suggestions: home.suggestions,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@Tool({
|
||||
name: 'get_portfolio',
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user