feat: «Mi día», the few tickets I pick for today
A home panel with the tickets picked for today (10 at most), crossed out
as they get done and counted («1 de 3 terminados»), my open tickets to
add with one click, and what was left unfinished on my last day to carry
over. «☀ Mi día» on a ticket adds it or takes it out. The day is the
person's own (YYYY-MM-DD from the browser); private, no history (Mongo
`my_days`).
API: myDay(day), addToMyDay, removeFromMyDay; GET /api/me/day,
PUT/DELETE /api/me/day/{issue}. MCP: my_day.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -783,6 +783,50 @@ export class IssuesResolver {
|
||||
);
|
||||
}
|
||||
|
||||
@Tool({
|
||||
name: 'my_day',
|
||||
description:
|
||||
'«Mi día»: the tickets I picked for today (done ones marked), and what was left unfinished on my last day. Optionally add or remove one first. day is today in my time zone, YYYY-MM-DD.',
|
||||
paramsSchema: z.object({
|
||||
day: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
||||
add: issueRef.optional(),
|
||||
remove: issueRef.optional(),
|
||||
}),
|
||||
annotations: WRITE,
|
||||
})
|
||||
myDay(
|
||||
params: { day: string; add?: string; remove?: string },
|
||||
ctx: McpContext,
|
||||
) {
|
||||
const client = this.api.as(ctx);
|
||||
const query = { day: params.day };
|
||||
return toolResult(async () => {
|
||||
if (params.add)
|
||||
await this.api.data(
|
||||
client.PUT('/api/me/day/{issue}', {
|
||||
params: { path: { issue: params.add }, query },
|
||||
}),
|
||||
);
|
||||
if (params.remove)
|
||||
await this.api.data(
|
||||
client.DELETE('/api/me/day/{issue}', {
|
||||
params: { path: { issue: params.remove }, query },
|
||||
}),
|
||||
);
|
||||
const myDay = await this.api.data(
|
||||
client.GET('/api/me/day', { params: { query } }),
|
||||
);
|
||||
return {
|
||||
day: myDay.day,
|
||||
issues: myDay.issues.map(issueLine),
|
||||
leftover: myDay.leftover && {
|
||||
day: myDay.leftover.day,
|
||||
issues: myDay.leftover.issues.map(issueLine),
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@Tool({
|
||||
name: 'remind_me',
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user